Coding Challenge #85: The Game of Life
In this coding challenge, I attempt to code Conwayโs Game of Life cellular automata simulation in JavaScript using the p5.js library. Code: https://thecodingtrain.com/challenges/85-the-game-of-life
๐น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/UtSMCB1zv
๐ฅ Next video: https://youtu.be/H81Tdrmz2LA?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
๐ Conway's Game of Life on Wikipedia: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
๐ Mathematical Games: http://www.ibiblio.org/lifepatterns/october1970.html
Videos:
๐ My Video on The Game of Life: https://www.youtube.com/watch?v=tENSCEO-LEc
๐ 2D Arrays in JavaScript: https://www.youtube.com/watch?v=OTNpiLUSiB4
๐ The Modulo Operator with Golan Levin: https://www.youtube.com/watch?v=r5Iy3v1co0A
๐ด Coding Train Live 108: https://youtu.be/U8S1qDjIE2Yt=8518s
Related Coding Challenges:
๐ #89 Langton's Ant: https://youtu.be/G1EgjgMo48U
๐ #107 Sandpiles: https://youtu.be/diGjw5tghYU
๐ #102 2D Water Ripple: https://youtu.be/BZUdGqeOD0w
Timestamps:
0:00 Introduction
2:00 Generations
7:18 make2DArray()
17:20 Compute Next Generation
21:19 countNeighbors()
23:14 Deal with Edges
25:44 Implement Rules
30:00 Implement Wraparound with Modulus
36:13 Variations
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://discord.gg/hPuGy2g
๐ 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
#gameoflife #cellularautomata #modulus #javascript #p5js