Question: Implementation As you work, compare your output to this sample output. Work through the following three steps one at a time. INITIALIZINGTHE GAME The game

 Implementation As you work, compare your output to this sample output.Work through the following three steps one at a time. INITIALIZINGTHE GAMEThe game takes place on a horizontal line that is 20 characterswide and made up of underscores (_). At the beginning of thegame, the user is asked to choose a location for the gem

Implementation As you work, compare your output to this sample output. Work through the following three steps one at a time. INITIALIZINGTHE GAME The game takes place on a horizontal line that is 20 characters wide and made up of underscores (_). At the beginning of the game, the user is asked to choose a location for the gem () and the player (P)-the code that asks for a location has been done for you. If the user does not want to choose, the gem () and player (P) should each be placed at a random position on a horizontal line. The player and the gem cannot start in the same random position. Make use of the useful code snippets to implement the randomization. Once placed, the line with the player character should be printed out. The player and gem positions begin counting at zero. For example, a line where player =1 would look like this: When this step is finished, your program should accept a player coordinate and a gem coordinate, then print a starting board. Complete this step before moving on. Once initialized, the program should ask what direction the user would like move: left or right. If the user enters "left", the character should move one space to the left. If the user enters "right", the character should move one space to the right. Make use of the useful code snippets to collect input from the user. If the player is NOT on the same space as the gem, print a helpful message. If the difference between the player's position and the gem's position is: - Greater than or equal to 7, print "Very cold!" - 1 (the gem is next to the player), print "Very warm!" Then, print the new state of the board and repeat the game progression until the gem is found. When this step is finished, your program should allow your player to move left and right on the board an infinite number of times. Complete this step before moving on. Repeat "Progressing the Game" until the player "finds" the gem by landing on the space where the gem is placed. Once the gem is located: - Print the new state of the line with the gem instead of the player character - Print out "Found the gem!" for the player When this step is complete, your program output should match the complete sample output. Initialize Board (10 points) Accept values for the player and gem placements Randomize player and gem values when prompted Print initial game board with given values Player Movement (45 points) Account for leftward player movement and print new board Account for rightward player movement and print new board Allow player to move in a combination of left and right Print Statements (10 points) Print "Very cold!" before printing new board when player moves 7 or more spaces away from gem Print "Very warm!" before printing new board when player moves next to the gem Game Completion (25 points) Run initialization, movement, and print statements until the game end state Print completed board when player reaches the gem Print the congratulatory message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!