Skip to content
C64 · BASIC · Game 04 BASIC ● 6 of 6 units live

Tally

Roll two dice a thousand times, count every total, and watch a bell curve rise out of pure randomness. Meet numeric arrays as counters and the screen as a chart — the first time the machine draws a shape you never told it to.

In Reflex the machine measured. Here it discovers. Tally rolls two dice over and over, counts how often each total comes up, and draws the result as a bar chart — and out of all that randomness a shape appears: a bell, tall in the middle at 7, short at the edges. The trick at its heart is emergence: you never tell the program to draw a bell, yet roll enough times and the bell is always there.

A C64 screen, black background: eleven cyan bars rising into a bell curve, tallest at 7, with the totals 2 to 12 labelled beneath.
Where you're headed: a thousand rolls of two dice, counted and drawn as bars — the classic bell, peaked at 7, that no single roll could predict.

This is your first program that holds many numbers in one place. You'll meet the array — a single named row of counters, one per total — and the value of a dice roll used as the index into it. Then you'll turn those counts into a picture by POKEing bars straight to the screen, the same screen-as-canvas you met in Skyline, now carrying data.

What you'll build:

  • A single die roll, then two dice added into a total from 2 to 12
  • An array of eleven counters, each total tallied by its own value as the index
  • A thousand-roll run where the bell appears in the numbers
  • The same counts drawn as POKEd bars — the bell as a picture
  • A scale that fits any run to the screen, and labels along the bottom
  • A run count the player sets, to roll 10, 100 or 1000 and watch the shape sharpen

6 units. About 5–6 hours. This follows Reflex and builds on Meet C64 BASIC.

Unit roadmap

Phase 1

Rolling

One die, then two — and the total of two dice is never even

Units 1–2 Complete
Phase 2

Counting

An array tallies every total; a short run is ragged, a long one settles

Units 3–4 Complete
Phase 3

The picture

The bell drawn straight to the screen, and a run count the player sets

Units 5–6 Complete