Fond memories. Once upon a time when I was a 45 years younger hippy I programmed a 20 by 20 colored CA on an Ohio Scientific 6502 machine, photographed it and had a girl friend knit a sweater with that pattern. I wore the sweater when I graduated my physics MSc.
For my semester project in my computer security class a few years ago, I made a hashing algorithm (in Perl) that used CA. The initialization vector was built by iterating a CA rule 30 out to about 2000 rows and then the hash was built from applying a CA between 'chunks' of the input message (starting from the init vector). The cool thing is that a CA is really easy to calculate, but dang near impossible to figure out how many iterations you've done. So it works great for hashing :-)
I am very happy to see these coding challenges come back again... Please keep doing more of those. This one if fascinating, educational, fun to watch, and to try!
It would be an interesting experiment to take the 1D cells and give them some sort of deeper memory, extending the rulesets you could have exponentially. For instance, instead of only looking at the past generation, look at the past 2 or 3 generations, if applicable.
When you showed us the picture of the shell with that semi random pattern I got tears in my eyes. I've been fascinated by fractals since I was a teen in the 80's. Read the book Chaos and looked at nature with new eyes ever since. There is something with the connection between pure math and nature that resonate deep inside me.
I really enjoyed this video! I have been dabbling in cellular automata for some time and have come up with a nice 3d multi state version. Fascinating stuff! Wolfram's book now purchased!
Here a computer science professor from Spain. Excelent and very clear videos! I hope I can convince my colleagues to teach p5.js in the 1st year programming courses
In Minecraft 1.17 and before, cellular automata algorithms were used to generate random patterns when generating the world. I'm glad I stumbled on you video, it is really inspirign and now I want to code cellular automatas
Awesome. I actually already started doing this one back when you demoed 2D CAs because I was looking for something where the rule could be more easily inferred from the image and so reducing the state space to a single dimension and putting time on the y-axis was the solution to my problem.
What a coincidence (for me) you posted this today as I was considering writing something similar but 2d like Conway's Life (and I just watched your Life video again yesterday). Anyways, keep up the good work. Love your channel.
Thanks for this and happy that you'll get more time! I tested a variation: use rules based on 5 cells rather than 3 (2 neighborhood each side). It leads to 2^32 possible rules and generates of course more complex stuff. I also added color in an other way: based on the 5 cells I take the 3 firsts to compute the red value ( (value/7.)*200.+55. in order to prevent too dark colors, and it is applyed for white), the 3 next for green, and the 3 lasts for blue.
It's been too long Dan. Even the whistle has been collecting soo much dust that it barely works :D Nice to have you back. I will look forward to watching your videos.
My mind is honestly blown seeing how a simple set of rules can lead to such beauty and manifest itself in the real world 😍when you compared to real life examples, that just made it. Awesome video as always, amazing teacher and very inspirational :) keep up the good work!
I'm gonna use this as an opportunity to build something different with Godot. I don't usually do stuff like this since it's primarily a game engine, but it seems like a fun way to make a nice UI and a little sandbox for exploring the various rules.
Was watching your videos as a fresh Computer Science student and now still watching as a salaried Software Engineer. Your videos never fail to remind me of the fun of coding. Thanks so much!
man you some what changed my life. I mean i discoverd you when i was supossed to learn to my exam after middle school so i could go to good hischool in Wielun (its in Poland) and this was my break through in programming field i always wanted to be programmer but that was the time when i actually understood the basics concepts. Now Im 20 and Im in college on Cybersecurity faculty. I want to thank you for your work. It's trully realy good. I'd love to do something with you some project or something.
Together with Flash Math Creativity, The Nature Of Code is my favourite book of all time. It had so much interesting stuff in there I still use often. Looking forward to the new edition.
I have your first edition and I had a lot of fun with it, the only critic I have is that some of the exercise don't give you much information about how to complete them which can be a little bit frustrating, but I love all the projects we get to code.
It would be interesting to code Langton's Ant and more generally Turmites. You can get different ant patterns/behaviours by having two ants at different positions/ and orientations.
I’d really love a video on rendering a tile server wrapped around a sphere using a cubemap (as opposed to a equirectangular texture). This would require you to map all edges of each face of the cube to their respective neighbors to perform the correct query for the lat long bounds. Please consider! Love your work ❤
Another interesting idea would be to decide the next state of the cell by looking at some other combination of cells rather than the cell and its neighbors... for example, you could decide the cell's next state based on the 3 cells to its left or right. And of course, you could also look at more than just 3 cells. You could look at the cell, its 2 left-hand neighbors, and its 2 right-hand neighbors. This would yield 2^(2^5) (a little over 2 billion) possible rules.
I write a generic basic CA in C++ using bitset as birth and survival rules recently, it could simulate highlife, gol, night and day etc. without swapping algorithms. It performs worse in certain scenarios but it was general and could produce cool results with random rulesets.
The manual truth table from the a == 0 && b == 1 && c == 0, etc. Part actually made me go crazy lol. I'm taking a digital logic class in college and i've learned how to simplify boolean expressions using k-maps and minimization and stuff, so I was just going crazy from seeing that lol
17:56 While looking at the Sierpinski's triangle Cellular Automata, I noticed that it can be predicted, if you have a diagonal line then you just need to compute how many diagonal lines branch off of it, which is fairly simple, you can determine that every other pixel in a diagonal line will branch, moreover the length of the line that branches off follows this pattern, 010201030102010 although it is actually 2^0,2^1,2^0,2^2,2^0,2^1,2^0,2^3,2^0,2^1,2^0,2^2,2^0,2^1,2^0. Regardless, you can use this to render Sierpinski's triangles with a fair bit of efficiency. It's also worth noting that you must start with two diagonal lines in order to make the whole triangle.
i remember watching your videos when I didnt know how to program... Now I work as a software engineer and just got my degree, so you are kinda of part of it too. Thanks!
You should try coding up the Rock-Paper-Scissors ruleset for a 2D CA setup. A three-state (or 4 depending if you include a null state) that generates stable spirals. It has been compared to the Belousov-Zhabotinsky reaction in chemistry.
Fond memories. Once upon a time when I was a 45 years younger hippy I programmed a 20 by 20 colored CA on an Ohio Scientific 6502 machine, photographed it and had a girl friend knit a sweater with that pattern. I wore the sweater when I graduated my physics MSc.
would love to know if you still have/wear that sweater
@@mattshu The sweater is long lost. Life happened. The girl friend died a couple of years ago.
Ah! I read "Food memories" instead of fond ones...
babe wake up, new coding challenge just dropped
I told you to only wake me up for videos of cats pretending to be humans!
Thanks mate 'cause I too wanted to comment the same when this popped up in my feed🤝
Even I was going for "me time on chrome" but now coding challenge is new priority 🤣
Thanks for being an amazing teacher, Dan. I am forever grateful to you.
This made me very happy, best explanation of the 255 rules I've seen.
You go, Dan!
For my semester project in my computer security class a few years ago, I made a hashing algorithm (in Perl) that used CA. The initialization vector was built by iterating a CA rule 30 out to about 2000 rows and then the hash was built from applying a CA between 'chunks' of the input message (starting from the init vector). The cool thing is that a CA is really easy to calculate, but dang near impossible to figure out how many iterations you've done. So it works great for hashing :-)
I am very happy to see these coding challenges come back again... Please keep doing more of those. This one if fascinating, educational, fun to watch, and to try!
What a ride! That was absolutely FANTASTIC. Please post more Coding Challenges this year 🙏🙏🙏
Great video as always Dan! Your enthusiasm is so infectious!
Beautifully done! I love how you construct a solution from basic principles and delay optimization. It's perfect for following along!
Finally another interesting coding challenge! thank you for doing this series. I've learnt a lot! Much love from Indonesia 🙏🏻🔥
It would be an interesting experiment to take the 1D cells and give them some sort of deeper memory, extending the rulesets you could have exponentially. For instance, instead of only looking at the past generation, look at the past 2 or 3 generations, if applicable.
Fibonacci Cellular Automata?
That's like adding more states, and order of states could be optional if desired. Interesting idea!
@@Fishpizza1212the sum of the previous 2 states modulo 2 is the present state. Dear Dan, please make this happen 😊
@@PMA_ReginaldBoscoG But he just taught you everything you need to know to make it happen yourself. Spring forth, grasshopper.
@@chitlitlah Will try to do it asap.👍
Glad to see another instance of a Coding Challenge! I've missed this series :)
When you showed us the picture of the shell with that semi random pattern I got tears in my eyes.
I've been fascinated by fractals since I was a teen in the 80's. Read the book Chaos and looked at nature with new eyes ever since.
There is something with the connection between pure math and nature that resonate deep inside me.
Great ! I loved your regular old challenges.
I really enjoyed this video! I have been dabbling in cellular automata for some time and have come up with a nice 3d multi state version. Fascinating stuff! Wolfram's book now purchased!
Nice to have you back and see more videos from you.
A new coding challenge and I’m here for it. Great video Dan!
Here a computer science professor from Spain. Excelent and very clear videos! I hope I can convince my colleagues to teach p5.js in the 1st year programming courses
Thank you for the kind feedback!
Today I finished the 45th video of this incredible series of videos. Thank you Dan for this wonderful work called The Nature of Code
Your humor and enthusiasm is so contagious!!!
Its nice to have you back again!
Yey another great video from you! :D
In Minecraft 1.17 and before, cellular automata algorithms were used to generate random patterns when generating the world. I'm glad I stumbled on you video, it is really inspirign and now I want to code cellular automatas
This was so cool, I managed to recreate this in C++ using the qt framework. Thanks for this video!
Great video and I am so happy you are back making these 🎉
Oh my gosh I forgot how much I loved your videos ❤ This was excellent.
Always a great day when Dan releases a new coding video!!!
Utterly brilliant as always
That was beyond amazing to watch.
Awesome. I actually already started doing this one back when you demoed 2D CAs because I was looking for something where the rule could be more easily inferred from the image and so reducing the state space to a single dimension and putting time on the y-axis was the solution to my problem.
Incredible!
What a coincidence (for me) you posted this today as I was considering writing something similar but 2d like Conway's Life (and I just watched your Life video again yesterday). Anyways, keep up the good work. Love your channel.
Thanks for this and happy that you'll get more time!
I tested a variation: use rules based on 5 cells rather than 3 (2 neighborhood each side). It leads to 2^32 possible rules and generates of course more complex stuff.
I also added color in an other way: based on the 5 cells I take the 3 firsts to compute the red value ( (value/7.)*200.+55. in order to prevent too dark colors, and it is applyed for white), the 3 next for green, and the 3 lasts for blue.
I love this channel and their videos.
Keep going.
Thanks for making coding fun and enjoyable. I have pre-ordered your book as an appreciation.
Thank you for the support!
Oh my god, I love this video!!! thank you so much!!!
yeeeey, more coding challenges this year 🎉
Fantastic!
Great enthusiasm!
I startene watching your video thi summer and i was fascinated of the beauty of coding with graphics and using processing
Thank you for making these videos. I love you.
This channel is so entertaining and whimsical
Wohooo back to coding challenges🎉
Best channel ever! Love it
Amazing stuff!!! Thank you!
I really love your book i used it like 6 years back maybe to have some fun coding :)
Ive been super into these lately, you reading my mind xD
so amazing!
I'm so glad you explain things so simple. I would like to see 2D version now!
It’s a great coding lesson,sir! I love it!
I love every mathematic lesson you gave us
It's been too long Dan. Even the whistle has been collecting soo much dust that it barely works :D Nice to have you back. I will look forward to watching your videos.
My mind is honestly blown seeing how a simple set of rules can lead to such beauty and manifest itself in the real world 😍when you compared to real life examples, that just made it. Awesome video as always, amazing teacher and very inspirational :) keep up the good work!
Awesome Video Dan!
I've been trying to find a way to do image compression with cellular automata for like 2 weeks now. And lo and behold! a video!
Your joy brings me joy
Finally back with a new Coding Challenge!!!! 🎉
Thanks that was a great video!
Thanks!
You don't have to say sorry about your way to code. We all know that you're pro. Thank you. That blow my mind!
I got my stickers in the mail earlier this week! I know it's off topic but I'm so excited 😊
Yay! So glad to hear!
I'm gonna use this as an opportunity to build something different with Godot. I don't usually do stuff like this since it's primarily a game engine, but it seems like a fun way to make a nice UI and a little sandbox for exploring the various rules.
he is back!
Danke!
Amazing
Was watching your videos as a fresh Computer Science student and now still watching as a salaried Software Engineer. Your videos never fail to remind me of the fun of coding. Thanks so much!
I love hearing this!
you are an AMAZING teacher
man you some what changed my life. I mean i discoverd you when i was supossed to learn to my exam after middle school so i could go to good hischool in Wielun (its in Poland) and this was my break through in programming field i always wanted to be programmer but that was the time when i actually understood the basics concepts. Now Im 20 and Im in college on Cybersecurity faculty. I want to thank you for your work. It's trully realy good. I'd love to do something with you some project or something.
Thank you for sharing your story!!
Awsome video! Im excited for 2024. Your videos and your book will come in handy for both my path and and guide into code land. =]
honestly these videos could be called "fall in love with code"
veryyyyy fking cool man, i enjoyed this thoroughly, keep it up!
Together with Flash Math Creativity, The Nature Of Code is my favourite book of all time. It had so much interesting stuff in there I still use often. Looking forward to the new edition.
also, what a banger of a video... i had chills when the serpinski triangle showed up
I have your first edition and I had a lot of fun with it, the only critic I have is that some of the exercise don't give you much information about how to complete them which can be a little bit frustrating, but I love all the projects we get to code.
Maybe I can improve this for the new version!
Nice project!
GREAT VIDEO
It would be interesting to code Langton's Ant and more generally Turmites. You can get different ant patterns/behaviours by having two ants at different positions/
and orientations.
I’d really love a video on rendering a tile server wrapped around a sphere using a cubemap (as opposed to a equirectangular texture).
This would require you to map all edges of each face of the cube to their respective neighbors to perform the correct query for the lat long bounds. Please consider! Love your work ❤
Wow, I've done that week ago, but in c++. Nice to see, how it's done in other languages!
Whenever I get frustrated with coding, I just watch this series and I regain my wonder for coding
I recently added cellular automata to my terrain generation for nicer looking caves (3d). I found this video very interesting as well
yeahhhhh new videoo
Congratulations on your book publication!
Another interesting idea would be to decide the next state of the cell by looking at some other combination of cells rather than the cell and its neighbors... for example, you could decide the cell's next state based on the 3 cells to its left or right.
And of course, you could also look at more than just 3 cells. You could look at the cell, its 2 left-hand neighbors, and its 2 right-hand neighbors. This would yield 2^(2^5) (a little over 2 billion) possible rules.
You should try this and submit it to the passenger showcase!
im whatching 4 hours after you posted the video :)
Sir you are amazing
That intro was clean!
I write a generic basic CA in C++ using bitset as birth and survival rules recently, it could simulate highlife, gol, night and day etc. without swapping algorithms. It performs worse in certain scenarios but it was general and could produce cool results with random rulesets.
Always inspired when I get homework from Coding Train :D
Simply amazing 😊😊❤❤❤😅😅
The manual truth table from the a == 0 && b == 1 && c == 0, etc. Part actually made me go crazy lol. I'm taking a digital logic class in college and i've learned how to simplify boolean expressions using k-maps and minimization and stuff, so I was just going crazy from seeing that lol
Very nice
17:56 While looking at the Sierpinski's triangle Cellular Automata, I noticed that it can be predicted, if you have a diagonal line then you just need to compute how many diagonal lines branch off of it, which is fairly simple, you can determine that every other pixel in a diagonal line will branch, moreover the length of the line that branches off follows this pattern, 010201030102010 although it is actually 2^0,2^1,2^0,2^2,2^0,2^1,2^0,2^3,2^0,2^1,2^0,2^2,2^0,2^1,2^0. Regardless, you can use this to render Sierpinski's triangles with a fair bit of efficiency. It's also worth noting that you must start with two diagonal lines in order to make the whole triangle.
i remember watching your videos when I didnt know how to program... Now I work as a software engineer and just got my degree, so you are kinda of part of it too. Thanks!
I’m so happy to hear this!!
genius as hell
Just bought the book!
Looking forward to more Coding challenges in 2024
You should try coding up the Rock-Paper-Scissors ruleset for a 2D CA setup. A three-state (or 4 depending if you include a null state) that generates stable spirals. It has been compared to the Belousov-Zhabotinsky reaction in chemistry.
Yay!
LET'S GOOOOOOOO