196k views
3 votes
Natalie is creating a game. The object of the game is for the player to get a cat to his toy in 10 moves or less. The game begins with the cat positioned at the top-left corner of the screen and the toy at the bottom-right corner of the screen. Natalie wants the player to be able to make the cat go 50 steps in one move by pressing an arrow key, and go 100 steps in one move by pressing the space bar. The number of remaining moves is decreased by one each time the player presses a key. The game will count down from 10 moves and display the number of moves remaining. If the move count reaches zero or the cat reaches his toy, then the game will start over. Natalie discovers that her program is not restarting when the number of remaining moves reaches zero. Consider the following code segment: if movesRemaining = 0 then What is wrong with this expression that Natalie wrote?

1 Answer

4 votes

Answer: she forgot to write a loop program like while, or for

Step-by-step explanation:

User JFAP
by
7.1k points