Skip to content
Game 2 Unit 4 of 5 1 hr learning time

The Win Screen

A game should invite you in and frame the result. PAUSE lets the player read the rules and begin when ready; a CLS gives the guessing a clean stage; and a green border crowns the win. Small touches that make it feel offered, not inflicted.

80% of Lucky Number

The game works and sounds good. But it starts abruptly — the first question lands before the player has read the rules — and the win looks like any other line. Two small changes fix both: an offered start, and a framed finish.

  10 BORDER 0: PAPER 0: INK 7: CLS
  20 RANDOMIZE
  30 LET n = INT (RND * 100) + 1
  40 LET c = 0
  50 INVERSE 1: PRINT AT 2, 0; "   *** LUCKY NUMBER ***          ": INVERSE 0
  60 PRINT
  70 PRINT "I'm thinking of a number"
  80 PRINT "between 1 and 100."
  90 PRINT
 100 PAUSE 0
 110 CLS
 120 INPUT "Your guess: "; g
 130 LET c = c + 1
 140 LET d = ABS (g - n)
 150 IF d > 50 THEN BORDER 1
 160 IF d > 25 AND d <= 50 THEN BORDER 5
 170 IF d > 10 AND d <= 25 THEN BORDER 6
 180 IF d > 5 AND d <= 10 THEN BORDER 2
 190 IF d <= 5 THEN BORDER 7
 200 IF g = n THEN GO TO 300
 210 IF g < n THEN PRINT "Too low!": BEEP 0.1, -5
 220 IF g > n THEN PRINT "Too high!": BEEP 0.1, 5
 230 GO TO 120
 300 BORDER 4: BEEP 0.1, 10: BEEP 0.1, 15: BEEP 0.1, 20: BEEP 0.2, 24
 310 PRINT "Got it! The number was "; n
 320 PRINT "You found it in "; c; " guesses."

Line 100 (PAUSE 0) and line 110 (CLS) drop in after the rules; line 300 gains a green BORDER 4 on the win.

ZX Spectrum win screen with a green border: the guess trail on a clean screen, then 'Got it! The number was 42' and 'You found it in 7 guesses.'
A green border crowns the win, on a clean stage the offered start cleared for the guessing. Seven guesses, and the screen says 'done'.

PAUSE 0 — an offered start

PAUSE 0 halts the program until the player presses a key. The 0 means "wait forever" — no timeout. Without it, the title flashes past and the first question arrives before anyone has read the rules. With it, the player reads, takes a breath, and begins when they choose. The game feels offered, not inflicted. Then CLS wipes the title so the guessing gets a clean stage.

The green border

The border has been shifting all game — blue, yellow, red, white — as feedback. On the win, line 300 sets it green and leaves it there. Green is the universal "go / good / done." After a game of changing colour, a steady green says: that's it, well played. The border that guided you now congratulates you.

Framing the result

A result needs a frame as much as a value. The same "Got it!" text, on a clean screen with a green border, reads as an ending — a moment, not just another printed line. That framing is what turns "the program stopped" into "you won."

Next: the last touch — telling the player not just how many guesses, but whether that was any good.