Skip to content
Game 1 8 Units

Lucky Number

Type in a complete visual game, then learn programming by changing what it does.

Lucky Number title screen — rainbow cascade and block-pixel letters

The computer picks a secret number between 1 and 100. You guess. It tells you higher or lower. A temperature bar shows how close you are. Big block-pixel digits display your guess. The border shifts colour. Sound effects punctuate every guess. Win and the screen erupts in colour.

Lucky Number mid-game — temperature bar, big digits, and feedback

How It Works

Your first Spectrum program isn’t a toy example — it’s a real game. You type the whole thing in before you understand any of it, just like millions of children did with magazine listings in the 1980s. Then you learn how it works by changing it: swapping messages, adjusting colours, tweaking the scoring, breaking and fixing the loop. Every concept is understood through its visible effect on the running game.

What You’ll Learn

  • PRINT — putting text on screen
  • LET — storing values in variables
  • INPUT — asking the player a question
  • IF/THEN — making decisions
  • GO TO — loops
  • RND — random numbers
  • REM — comments

Prerequisites

None. This is the very first game. If you’ve never written a line of code, start here.

Unit Roadmap

8 of 8 units available