Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Happy Pi day with this PWA to cut 100k Pi digits offline (accdoo.app)
1 point by imcotton on March 14, 2024 | hide | past | favorite
It using JavaScript native BigInt and Chudnovsky Algorithm ([wiki]), the code was taken from one of the examples in the QuickJS project ([quickjs/pi], [pi_bigint.js]).

The syntax for cutting:

    pi#6     // take 6 digits of Pi (314_159)
    pi#6#3   // take 6 digits of Pi but drop 3 beforehand (159_265)

    pi#1#40000   // take one digit at 40,000th
It uses service workers to cache static files, by the time it opens up you already free to be offline, try toggle network switch to verify.

It has download link at bottom of the about page ([accdoo.app/about]) which you could then self host it by dropping into any static hosting services.

btw, the Pi feature was by-product from the original App but I won't expand here, if you'd like to learn more, please checkout its Show HN post (39115559, 39138957 and 39238295) previously.

[wiki]: https://en.wikipedia.org/wiki/Chudnovsky_algorithm

[quickjs/pi]: https://bellard.org/quickjs/pi.html

[pi_bigint.js]: https://github.com/bellard/quickjs/blob/master/examples/pi_b...

[accdoo.app/about]: https://accdoo.app/about#releases

[39115559]: https://news.ycombinator.com/item?id=39115559

[39138957]: https://news.ycombinator.com/item?id=39138957

[39238295]: https://news.ycombinator.com/item?id=39238295



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: