Star Student Builder logoStar Student Builder
← Systems, Data and the Way Out Std 9–12Project 2 of 4

A High Score Table That Survives

🎯 The top five scores, with names, kept in order and saved with the project.

πŸ’‘ The idea behind it

Inserting into a sorted list is a real algorithm, and it is the same one in every language.

🧱 Blocks you will need

listsinsert at of listdelete of listrepeat untiljoinitem of list

πŸ”¨ Build it

  1. Two lists: scoreNames and scoreValues, kept in the same order.
  2. At game over, ask for a name.
  3. Walk down the list: set i to 1, repeat until (i > length) or (score > item i of scoreValues) β†’ change i by 1.
  4. Insert the new score at position i in both lists.
  5. If the list is now longer than 5, delete item 6 from both. Display with a join of rank, name and value.

πŸš€ Make it harder

  • Handle a tie by putting the newer score second.
  • Show the table sorted on the stage using a single text sprite and a join loop.

🐞 Bugs you will hit

  • Names and scores drift apart: every insert and delete must be done on BOTH lists, always in the same step.
  • The new score never appears: your comparison is the wrong way round β€” check > against <.

⬇ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it β†’
Ask GuruAcharya Samayeshwar