Coding Challenge #85: The Game of Life

[ad_1]
In this coding challenge, I attempt to code Conway’s Game of Life cellular automata simulation in JavaScript using the p5.js library.

Support this channel on Patreon:
To buy Coding Train merchandise:
To Support the Processing Foundation:

Send me your questions and coding challenges!:

Contact:
Twitter:
The Coding Train website:

Links discussed in this video:
Conway’s Game of Life on Wikipedia:
Mathematical Games:

Videos mentioned in this video:
My Video on The Game of Life:
2D Arrays in JavaScript:
The Modulo Operator with Golan Levin:

Source Code for the all Video Lessons:

p5.js:
Processing:

For an Introduction to Programming:
For More Coding Challenges:

Help us caption & translate this video!


Posted

in

by

Tags:

Comments

24 responses to “Coding Challenge #85: The Game of Life”

  1. Quillbert Avatar

    Can you do a tutorial on the Network library for processing 3?

  2. TZPlayer Avatar

    Just a little question, can you do a cellular automaton in python without any libraries?

  3. Espen Sande Larsen Avatar

    Great video as always! Here is my version. I slowed down the iterations, and changed the rules. As well as implementing a touch screen interface: https://www.instagram.com/p/BZwHjLHg5JO/ I kinda like how it stabilizes into a "circuit board" 🙂

  4. Krondelo Avatar

    YES! I've been wanting this, thank you Dan!

  5. Danny Van Der Knaap Avatar

    Checkout the typeof function and the indexof would make this coding so much easier

  6. Calidrelle Avatar

    Wonderfull 35:46, the final music note just when the game fall into a stable state !!!! That was written 😉
    Nice job, Dan !!

  7. Hamza Hajji Avatar

    2d array in one line:
    new Array(cols).fill(new Array(rows).fill(null))

  8. nikodemr Avatar

    You definitely instead of repeating the same huge loop over and over should just write a function that would iterate through all of the elements and call a callback on each of them. Something like forEach or even map but for your specific 2D array. It still wouldn’t be the best solution but it’d look much much nicer and cleaner

  9. TrollingAround Avatar

    Nice vid – however 47 years of assembly programmers just shuddered.

  10. TheFeralRobot Avatar

    This is the best coding channel ever!

  11. Jimmy Brawn Avatar

    I had a whiteboard interview today with this challenge, so coincidental!

  12. Kaleidoskot Avatar

    I have used the celular automata to make a visual identity for one non profit organisation (in processing), you can check it here: https://www.behance.net/gallery/49497955/Be-International
    You can change the rules of the automata to make more effects.

  13. Patrick Rehn Avatar

    Hi there, did you ever play/looked at the game Screeps? Would really like to see your try on that ! Regards Kendalor

  14. Drizzt Do'Urden Avatar

    Thanks for uploading, and showing. This is helping me understand the fun aspects of coding. Trying to land a job, no luck yet.

  15. ToFu Avatar

    I once did something similar in C++ with a 1-dimensional array >.<

  16. giorgio marchetti Avatar

    The idea of an history for every cell was good, why dont you make a tutorial fur it?

  17. Tural Huseynov Avatar

    Are you create social network for your subscribe? Everybody speaks one another

  18. Melih Durmaz Avatar

    I have a small coding challenge idea. Imagine a grid of dots, like a really big grid. And when you click on any part of the grid, it creates an illusion of a ripple effect, like you're looking at water from a top-down view. And the illusion will be created by manipulating the size of dots (or circles if you will, since they will get bigger and smaller)

  19. asdf Avatar

    wow that console.table is amazing, thanks for that 😀

  20. ThePixelGamers Avatar

    hello i love your videos i watch for 3 years

  21. Kunal Sharma Avatar

    pls make a MEAN app projects

  22. Daniel Valdenegro Avatar

    Dude you're awesome… I'll try to replicate this in python just to learn and for fun 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *