Starting from:

$30

CSE201-AP Assignment 3 Solved


1. Player
This is a single player game with a really simple objective: how many game points the player obtained when he completed the game. The player has a name and s/he must remember his position on the game floor after every move.

2. Game
As shown in the picture, the game would have 14 floors and it counts the total points collected during the game play. Negative points are also allowed in the game. There are different types of floors: a) empty floor, b) snake floor, and c) ladder floor. There are two types of snake floor that you can ever encounter: a) normal and b) king cobra. Likewise, there are two types of ladders that you can ever encounter: a) normal, and b) elevator. The location of each snake floor, ladder floor, and empty floor is fixed as shown in the picture. Each floor must remember its location in the game.

Whenever a player moves to any floor, s/he has to jump on the floor to know the type of floor:

●     Empty floor rewards the player with one point and displays the message that player has reached an empty floor.

●     Normal snake floor would deduct two points from total and would display the message that player has reached normal snake floor. After this it will move the player’s position to the first floor as shown in the picture.

●     King cobra snake would deduct four points from total and would display the message that player has reached king cobra. After this it will move the player’s position to the third floor as shown in the picture.

●     Ladder floor rewards the player with two points and displays the message that the player has reached a ladder floor. After this it will move the player’s position to the twelfth floor as shown in the picture.

●     Elevator floor rewards the player with four points and displays the message that the player has reached the elevator floor. After this it will move the player’s position to the tenth floor as shown in the picture.

3. Dice
This game has a special dice that has only two faces, 1 and 2. When a dice is thrown, it returns a randomly chosen face value. To make this assignment even more simpler, you can reuse the

The game is started only when the player gets 1 on the Dice.
Sample test case:

Enter the player name and hit enter
Michael Jackson
The game setup is ready
Hit enter to roll the dice

 

Dice gave 2
Game cannot start until you get 1
Hit enter to roll the dice

Dice gave 1
Player position Floor-0
Michael Jackson has reached an Empty Floor

Hit enter to roll the dice

Dice gave 2
Player position Floor-2
Michael Jackson has reached an Elevator Floor


Player position Floor-10
Michael Jackson has reached an Empty Floor
Hit enter to roll the dice

Dice gave 2
Player position Floor-12
Michael Jackson has reached an Empty Floor
Hit enter to roll the dice

Dice gave 2
Player cannot move
Hit enter to roll the dice

Dice gave 1
Player position Floor-13
Michael Jackson has reached an Empty Floor

Game over

Michael Jackson accumulated 8 points

--------------------------------------

More products