Question: In this programming part you are asked to implement a game called Score FarRight. Score FarRight is a 1-player game consisting of a row

In this programming part you are asked to implement a game called 

In this programming part you are asked to implement a game called Score FarRight. Score FarRight is a 1-player game consisting of a row of squares of any size each containing an integer, like this: 4852351640 The rules of the game are simple. The circle on the initial square (which can initially be anywhere in the array) is a marker that can move to other squares along the row. At each step in the game, you may move the marker right or left by the number of squares indicated by the integer in the square it currently occupies. The marker may move either left or right along the row but may not move past either end. For example, the only legal first move is to move the marker four squares to the right because there is no room to move four spaces to the left. The goal of the game is to move the marker to the cave, the "0" at the far right end of the row. In this configuration, you can solve the game by making the following set of moves: 4852351640 Step 1: Move right 485 2 3 5 1 6 40 51640 Starting position Step 2: Move right 48 523 Step 3: Move left Step 4: Move right 4852351640 4852351640 Though the Score FarRight game is solvable, actually with more than one solution some configurations of this form may be impossible, such as the following one: 582315 In this configuration, you will bounce between the two 5's, but you cannot reach any other square.

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 Programming Questions!