A downloadable calculator

Have you ever been stuck in the situation where you need a screenful of pi but can't afford an SD card with a capacity of even a couple kilobytes? Look no further, my friend, for in the blink of an eye* this program will calculate it for you!

* "Blink of an eye" is defined as the duration the eye is closed for whilst sleeping.


The number of digits generated depends on the screen mode your Commander is in when the program is run. A larger number of digits takes significantly longer to generate, so you may wish to adjust your screen mode before running.

Screen mode
1, 2
3, 128
4, 5

* Calculated from Box16 warp mode. Timing may be inaccurate, but should still be a decent ballpark.

How does it work?

Honestly, I don't know. But it's open source on GitHub, if you want to try and find out. It was inspired by the below video and is fundamentally the same, though requires more 24-bit routines due to calculating up to 4800 digits rather than 960.

I was tempted to call this PI.PRG, but that uninspired name is already taken.


4800PI.PRG 697 bytes

Install instructions

  1. LOAD "PI.PRG"
  2. (Optional) Set screen mode, e.g. SCREEN 6 – see above table.
  3. RUN

After running, you may press the RESET button on your Commander X16 (Ctrl+R in emulator) to return to BASIC.

Note: In screen mode 0 (80 columns, 60 rows) it takes about 11 seconds for the first decimal place to appear. Please be patient with it. But if it takes longer, I guess it's broken.

Development log

Leave a comment

Log in with itch.io to leave a comment.