Snake and Ladders Board

Where is the mistake in the code?