You are browsing as a guest. Sign up (or log in) to start making projects!

4h 20m 59s logged

I’ve gotten the first 200 digits of pi generated in Pico-8! But the 300th is wrong… okay… a bit of background. First, why am I trying to generate pi, why not just precompute it and store it in rom? Gee I wish. A limitation in Pico-8 is that one cart can only have about 8000 tokens total, and each list element counts as a token, so having a sufficiently large amount of tokens, like 10 000 would literally be impossible, so instead I’ll just compute it when the program loads up and store it in RAM. What is interesting though is how I got this done! I used an algorithm by Rabinowitz and Wagon (link to the paper: http://stanleyrabinowitz.com/bibliography/spigot.pdf) where you start with a bunch of 2s, and do various operations on them from right to left involving division and multiplication to get a number who’s 10s digit is the digit of pi for that iteration. My implementation should be working the same, however for a reason I am yet to figure out it stops working between 200 and 300 digits of pi, most likely due to a small error in my implementation that causes it to drift very slowly, only mattering after a couple hundred digits.

0
11

Comments 0

No comments yet. Be the first!