How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask LogicPro Your Own Question
LogicPro
LogicPro, Engineer
Category: Homework
Satisfied Customers: 13171
Experience:  Expert in Java C++ C C# VB Javascript Design SQL HTML
29751445
Type Your Homework Question Here...
LogicPro is online now
A new question is answered every 9 seconds

Design the Snakes and Ladders game. The project needs to

This answer was rated:

design the Snakes and Ladders game. The project needs to simulate the game with the ability to roll dice between two players, and then apply the game logic to decide who the winner is.
The game board has 100 cells starting from 1 to 100. There are two players and each player rolls the dice and moves cell position accordingly. There are snakes and ladders in different cells with each cell having either a ladder, a snake or nothing but not both in the same cell. If a player moves to a cell that contains a ladder, the player jumps up by 15 cells. If the player moves to a cell including a snake mouth, the player drops off by 10 cells. The rolling of dice continues until one of the players reaches a cell above 99, that player will be declared as the winner of the game.
The steps to design the game are:
Step 1: GetPlayersList()
Create a function GetPlayersList() that reads and stores both player names in a list. The function prints and returns the nameList.
Step 2: GenerateLaddersPosition()
There are 15 ladders in the game. Declare function GenerateLaddersPosition()to generate the positions of these ladders randomly, and store them in a list. Ladder positions should be in the range of cells 5 to 85. You must avoid assigning the same
cell to more than one ladder. The function prints the ladder positions and returns the ladderList.
Step 3: GenerateSnakesPosition()
There are 10 snakes in the game. Declare function GenerateSnakesPosition()to generate the positions of these snakes mouths randomly, and store them in a list. Snake mouth positions should be in the range of cells 20 to 95.
You must avoid assigning the same cell to more than one snake. Moreover, the function should receive an input argument (ladderList) to avoid assigning a cell to both a ladder and a snake, meaning that no cell can host both a ladder or a snake mouth. The function prints and returns the snakeList.
Step 4: RollDice()
Define a function to roll the dice i.e., generating a random number between 1 and 6. The function should receive two arguments, current position of the player rolling the dice, and the name of the player rolling the dice and returns the new position of the player. The function also prints the value of the dice, and the new position of the player:
Step 5: CheckForLadder()
Write a function to accept three arguments, 1) current position of a player, 2)V ladderList, and 3) the plyer name, and check if the position contains a ladder. If so, increase the current position of the player by 15 cells and return the new position.
The function also prints a message explaining what happened, and the new player position. For example:
Step 6: CheckForSnake()
Create a function to receive three arguments, 1) current position of the player, 2) snakeList, and 3) the player name, and check if the position contains a snake mouth. If so, decrease the current position of the player by 10 cells and return the new position.
The function also prints a message explaining what happened, and the new player position, for example:
Step 7: Main Program
The main program is responsible for running the game using the functions defined above, and identify the winner. An example of the tasks on the Main program can be:
1. Use a list to maintain the position of the players, each index shows the position of a player. Initialize each index of the list by zero meaning that the initial position of each player is cell 0.
2. Initialize the list of players by calling GetPlayersList().
3. Initialize list of ladders and snakes by calling the GenerateLaddersPosition() and GenerateSnakesPosition().
4. Use a loop to start playing the game. Inside the loop:
• Use a for loop that counts twice, once for each player:
i. Get new position of the current player by calling RollDice().
ii. Check whether the player position is more than 99. In this case, the player is the winner of the game so the game should print a message and break from both of the loops, and terminate the program.
iii. Otherwise, for the current player, check for ladder and snake positions by calling CheckForLadder() and CheckForSnakes(), and update the current player’s position respectively, if necessary.
Customer: replied 4 months ago.
i am waiting for more than one hour

Let me check. I was offline

Is it in c++ or java?

Customer: replied 4 months ago.
python

Do you have sample input/output?

Customer: replied 4 months ago.
i attached the input output sample

What is the deadline?

Customer: replied 4 months ago.
monday

Looking at the efforts, I am sending offer. let me know once you accept it and I'll provide ASAP

Customer: replied 4 months ago.
but i paid $75

I am sorry. Not sure about it. I am looking at different amount and sent offer per the efforts

Customer: replied 4 months ago.
not sure about the answer ?

about the amount you paid. I can provide the answer once you accept offer

Customer: replied 4 months ago.
sure I paid the money and Just Answer promise me to answer my question

okay. please check back on sunday for answer

Download answer from here: http://www.wikisend.com/download/548194/

You can give your rating by selecting five stars located on the top right of the question page. Giving a positive rating compensates the Expert for their time with you. Please remember that your Expert will not be paid until you leave a positive rating for the answer. If the stars are grayed out or you cannot click on the stars to rate your experience, reply to your Expert and let them know so they can adjust your question and allow you to rate.

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Please consider adding bonus

http://ww2.justanswer.com/help/what-if-expert-does-really-fantastic-job-hl

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers. It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Thank you for using this site!

LogicPro

Hi again,

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Just following up with you to see how everything is going and if you have more questions for me.

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.

I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!

Thanks very much for using Just Answer!

Best wishes

LogicPro

Customer: replied 4 months ago.
Hi
The program dont work properly,it is call the name of players and the ladder & snack places twice .
Also Please dont use sample in the program .
Thanks

can you elaborate and provide screenshot pls?

Customer: replied 4 months ago.
I send you the screenShot

I will check and reply

Customer: replied 4 months ago.
ok

ok

Customer: replied 4 months ago.
Hi,
In the main program we have to use a for loop:
4. Use a loop to start playing the game. Inside the loop:
• Use a for loop that counts twice, once for each player:
i. Get new position of the current player by calling RollDice().
ii. Check whether the player position is more than 99. In this case, the player is the winner of the game so the game should print a message and break from both of the loops, and terminate the program.
iii. Otherwise, for the current player, check for ladder and snake positions by calling CheckForLadder() and CheckForSnakes(), and update the current player’s position respectively, if necessary

ok

Download answer again from here: http://wikisend.com/download/535508/

Unzip the zip file to get python code with output screenshot.

You can give your rating by selecting five stars located on the top right of the question page. Giving a positive rating compensates the Expert for their time with you. Please remember that your Expert will not be paid until you leave a positive rating for the answer. If the stars are grayed out or you cannot click on the stars to rate your experience, reply to your Expert and let them know so they can adjust your question and allow you to rate.

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Please consider adding bonus

http://ww2.justanswer.com/help/what-if-expert-does-really-fantastic-job-hl

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like other customers to get instant answers. It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

Thank you for using this site!

LogicPro

Hi again,

Please read:

https://ww2-secure.justanswer.com/help/do-i-have-rate-answer

http://ww2.justanswer.com/help/how-do-i-rate-answer-hl

Just following up with you to see how everything is going and if you have more questions for me.

We can continue the conversation until you're satisfied and rate my answer as excellent to credit me. I can address follow up questions and I'm always here to help.

You can ask me again using "For LogicPro only" at the start of your questions like you do to get instant answers.

It will ensure that question is for me.

Please bookmark my profile page:

http://www.justanswer.com/homework/expert-logicpro/

so you can come back and ask me a question anytime.

If you need any additional information on this answer, please don't hesitate to ask by clicking on 'Reply to Expert', and I will reply as soon as possible.

I hope you found the information in my answer helpful, and if so, please let me know, here. Thank you!

Thanks very much for using Just Answer!

Best wishes

LogicPro

THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
LogicPro and other Homework Specialists are ready to help you