4800Pi
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.
Benchmark
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.
Note: This section is based on version 1 of the program. Version 2 is a little faster, e.g. screen mode 0 I now estimate to be 4h14m.
Screen mode | Characters | Time |
---|---|---|
0 | 4800 | 5h28m* |
1, 2 | 2400 | 1h22m* |
3, 128 | 1200 | 20m30s |
4, 5 | 600 | 5m07s |
6 | 300 | 1m17s |
* 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.
Status | Released |
Category | Tool |
Author | Java Cake Games |
Tags | commander-x16, pi |
Code license | MIT License |
Average session | About an hour |
Links | Blog, Source code |
Install instructions
LOAD "4800PI.PRG"
- (Optional) Set screen mode, e.g.
SCREEN 6
– see above table. 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
- Faster 4800PiMar 14, 2024
- Celebrating Pi Day on the Commander X16Mar 12, 2023
Leave a comment
Log in with itch.io to leave a comment.