Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 1.04 KB

README.md

File metadata and controls

17 lines (13 loc) · 1.04 KB

Snakes-And-Ladders

Solving the Design Problem- Snakes and Ladders

Problem Statement

Create a snake and ladder application. The application should take as input (from the command line or a file):

  • Number of snakes (s) followed by s lines each containing 2 space-separated numbers denoting the head and tail positions of the snake.
  • Number of ladders (l) followed by l lines each containing 2 space-separated numbers denoting the start and end positions of the ladder.
  • Number of players (p) followed by p lines each containing a name.

After taking these inputs, you should print all the moves in the form of the current player name followed by a random number between 1 to 6 denoting the die roll and the initial and final position based on the move.

Format: <player_name> rolled a <dice_value> and moved from <initial_position> to <final_position>

When someone wins the game, print that the player won the game.

Format: <player_name> wins the game.