
Coding Challenge #156: Peeking inside Pi
π₯§ Happy Pi Day 2020! In this challenge, I build a simple web application using p5.js and node.js to search in the first billion digits of Pi. Code: https://thecodingtrain.com/challenges/156-peeking-inside-pi
πΉοΈ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/U649qYR4
π₯ Previous video: https://youtu.be/R3C2giDfmO8?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Next video: https://youtu.be/9z9mbiOZqSs?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
π Pi Searcher: https://angio.net/pi/
π Peek in Pi: http://pi.fathom.info/
π Boyer-Moore String Search: https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm
π createReadStream(): https://nodejs.org/api/fs.html#fscreatereadstreampath-options
Videos:
π₯ ES6 Arrow Function: https://www.youtube.com/watch?v=mrYMzpbFz18
π₯ Server-side with Node.js: https://www.youtube.com/watch?v=wxbQP1LMZsw
π₯ Working with Data and APIs track: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X
π΄ Coding Train Live 189: https://youtu.be/AkySW5uy7rU?t=1431s
Related Coding Challenges:
π #140 Leibniz Formula for Pi: https://youtu.be/uH4trBNn540
π #161 Estimating Ο from Random Numbers with Euclid's Algorithm: https://youtu.be/EvS_a921dBo
π #169 Pi in the Sky Game: https://youtu.be/_H9JIwWP7HQ
Timestamps:
0:00 Introduction
2:30 Importing Pi Into p5.js
3:37 Searching Numbers in Pi
7:09 IndexOf Function
13:13 Importing 1GB File
16:38 Dividing the Data into Read Streams
18:25 Searching 1 Billion Digits
19:44 Creating an API
28:42 Conclusions and Ideas
Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound
π Website: http://thecodingtrain.com/
πΎ Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide
π© Suggest Topics: https://github.com/CodingTrain/Suggestion-Box
π‘ GitHub: https://github.com/CodingTrain
π¬ Discord: https://thecodingtrain.com/discord
π Membership: http://youtube.com/thecodingtrain/join
π Store: https://standard.tv/codingtrain
ποΈ Twitter: https://twitter.com/thecodingtrain
πΈ Instagram: https://www.instagram.com/the.coding.train/
π₯ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
π₯ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
π p5.js: https://p5js.org
π p5.js Web Editor: https://editor.p5js.org/
π Processing: https://processing.org
π Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new
#math #piday #nodejs #p5js #javascript