
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