Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Flowchart and pseudocode only. Game 2: Snakes and Ladders Main task: The program should allow the user to play Snakes and Ladders against 1-3 other

image text in transcribed

Flowchart and pseudocode only.

Game 2: Snakes and Ladders Main task: The program should allow the user to play Snakes and Ladders against 1-3 other players. The board has 100 squares, starting from 1 and going up to 100. The players start at square 1. The first player to reach square 100 wins the game. Each player rolls the dice when their turn comes. Based on the dice value, the players move. The dice has six sides. For example, if a player is on square 10 and they roll 5, they will move to square 15. A player wins if they arrive at/land on square 100, exactly. That is, if a player is on square 97, and they roll 4, they cannot move. They must keep playing until they roll exactly 3. Each player should have a colour or a name assigned to them. So, after each turn, the program should display: [Lela) rolled a (5] and moved from square (10) to (15). Before the game begins, the program should place a number of snakes and ladders on the board. Each snake has a head and a tail on the board. If the player lands on a square where a snake's head is, the player should move down to the square where the end of the snake's tail is. Similarly, if the player lands on a square Updated August 2020 2 of 7 where the bottom of the ladder is, the player should move up to the square where the top of the ladder is. That is, the head of a snake is always in a square of a higher number than the square where the end of its tail is, and the top of a ladder is always in a square of a higher number than the square where its bottom is. If a player rolls 6, they move the number given (moving down a snake or up a ladder if moving six squares forward lands on one of them) and then they get an additional turn. The game continues until all players, but one, reach square 100. The board also contains two biscuits (one on each of two squares determined by the program before the game begins). If a player lands on a biscuit square they can keep the biscuit and feed it to the next snake that they encounter so that they do not have to move down to the tail square. It is not a requirement that the board and its contents (snakes, ladders, etc.) are displayed to the players. Variations: Student A: The board also contains two big sticks. If a player lands on a big stick square, they can keep the big stick and use it to create an extra step on the next ladder that they encounter, which will move them up 10 squares (one row) on the board from the square where the head of the ladder is. Note: a big stick cannot be used for any ladder the top of which is in the row which includes the 'Finish' square (the row of squares from 91 to 100). Student B: The board also contains two big sticks. If a player lands on a big stick square, they can keep the big stick and use it to scare away the next snake that they encounter which will result in the snake moving 10 squares (one row) up the board. Note: a big stick cannot be used for any snake the head of which is in the row which includes the 'Finish' square (the row of squares from 91 to 100). Ideas for additional functionalities for either variation (optional): The snakes and ladders are randomly placed on the board, so they are in different positions every time the users play the game. The player is able to select the game's difficulty level by selecting the number of snakes and their 'length', the number of ladders and their 'height', and/or the number of biscuits/big sticks available on the board. Biscuits and big sticks are removed from the board once they have been picked up. They can be used at any point in the game not just the next time the player who holds the big stick/biscuit lands on the head of a snake/bottom of a ladder. Your own ideas. Game 2: Snakes and Ladders Main task: The program should allow the user to play Snakes and Ladders against 1-3 other players. The board has 100 squares, starting from 1 and going up to 100. The players start at square 1. The first player to reach square 100 wins the game. Each player rolls the dice when their turn comes. Based on the dice value, the players move. The dice has six sides. For example, if a player is on square 10 and they roll 5, they will move to square 15. A player wins if they arrive at/land on square 100, exactly. That is, if a player is on square 97, and they roll 4, they cannot move. They must keep playing until they roll exactly 3. Each player should have a colour or a name assigned to them. So, after each turn, the program should display: [Lela) rolled a (5] and moved from square (10) to (15). Before the game begins, the program should place a number of snakes and ladders on the board. Each snake has a head and a tail on the board. If the player lands on a square where a snake's head is, the player should move down to the square where the end of the snake's tail is. Similarly, if the player lands on a square Updated August 2020 2 of 7 where the bottom of the ladder is, the player should move up to the square where the top of the ladder is. That is, the head of a snake is always in a square of a higher number than the square where the end of its tail is, and the top of a ladder is always in a square of a higher number than the square where its bottom is. If a player rolls 6, they move the number given (moving down a snake or up a ladder if moving six squares forward lands on one of them) and then they get an additional turn. The game continues until all players, but one, reach square 100. The board also contains two biscuits (one on each of two squares determined by the program before the game begins). If a player lands on a biscuit square they can keep the biscuit and feed it to the next snake that they encounter so that they do not have to move down to the tail square. It is not a requirement that the board and its contents (snakes, ladders, etc.) are displayed to the players. Variations: Student A: The board also contains two big sticks. If a player lands on a big stick square, they can keep the big stick and use it to create an extra step on the next ladder that they encounter, which will move them up 10 squares (one row) on the board from the square where the head of the ladder is. Note: a big stick cannot be used for any ladder the top of which is in the row which includes the 'Finish' square (the row of squares from 91 to 100). Student B: The board also contains two big sticks. If a player lands on a big stick square, they can keep the big stick and use it to scare away the next snake that they encounter which will result in the snake moving 10 squares (one row) up the board. Note: a big stick cannot be used for any snake the head of which is in the row which includes the 'Finish' square (the row of squares from 91 to 100). Ideas for additional functionalities for either variation (optional): The snakes and ladders are randomly placed on the board, so they are in different positions every time the users play the game. The player is able to select the game's difficulty level by selecting the number of snakes and their 'length', the number of ladders and their 'height', and/or the number of biscuits/big sticks available on the board. Biscuits and big sticks are removed from the board once they have been picked up. They can be used at any point in the game not just the next time the player who holds the big stick/biscuit lands on the head of a snake/bottom of a ladder. Your own ideas

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

Are robots going to displace all workers? Explain your answer.

Answered: 1 week ago