Teals intro to cs assignment 3.3 permanent high scores?

Hi,
I’m teaching based on Intro to CS with Arcade.Makecode. The 3.3 assignment is to create a high score table for a game. I don’t see how it can persist between executions of the game. I can make the game itself allow replays endlessly by having it on a countdown, after which the high scores are shown and the countdown is restarted, and each time the player make a good score they can enter their name. But this is all within one run of the game. I think it is impossible for the high score arrays for scores and names persist once I’ve actually executed “Game Over”, correct?

You’re correct. If the students use an actual “Game Over” block, then the data will be wiped clean. I believe the suggestion in this activity is that students display the high score using other means, then use “restart game” to allow users to play again.

Let’s double check that with @AlexK

That’s correct; as soon as you run a game over block, the game would end and you would lose any data stored in the game. Instead of using a game over block, instead the project could display the high score data in a show long text block and then, when the player presses the A button, your code could cause the game to start over (without relying on the built-in game over block).

The goal of the lesson is to work with arrays and to display their contents. The concept of a high score table is used as the vehicle for those topics. As an extension, you could encourage your students to look into using the settings-blocks extension to save and restore the array so that it works as a true high score table, persisting even after the game has ended.

1 Like

Thank you for the information! I think at the stage we’re at now in the course, using an extension (which I don’t know how to do myself) would not be advisable.

Appreciate all the help I get on this forum! Also thanks to KIKIvsIT !

3 Likes