Programming 1D Cellular Automata

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2024

ความคิดเห็น • 17

  • @sephadexerythrose8407
    @sephadexerythrose8407 10 วันที่ผ่านมา

    Thanks for walking us through this!
    I will make a 1-d automata in bash script showing text output.

    • @programmingchaos8957
      @programmingchaos8957  10 วันที่ผ่านมา +1

      I'm glad it was helpful. Creating a text based version with a bash script is a great idea. It's one of the the things I love about computer science/programmers, all of the cool ideas for how to apply things in ways I never would have thought of.

  • @flameofthephoenix8395
    @flameofthephoenix8395 3 หลายเดือนก่อน +1

    I assumed the 1-D version of Conways game of life just meant a direct transfer of the rules from a 2d grid to a 1D grid, after plugging it into Excel I have only been able to find one stable pattern, 2 live cells followed by 2 dead cells with another 2 live cells after that, it is effectively the same as the 2*2 block in the 2d version of the Automata.

    • @programmingchaos8957
      @programmingchaos8957  3 หลายเดือนก่อน +1

      Depending on the 'width' of the rule and the number of states there are lots of rules that lead to interesting patterns. Programming it in Excel is a clever approach. Do you write the rules in one row and then drag that row down to 'run' the simulation?

    • @flameofthephoenix8395
      @flameofthephoenix8395 3 หลายเดือนก่อน +1

      @@programmingchaos8957 Indeed! I just gave the conditional formatting for the whole sheet two rules so that 1s were white and 0s were black, then I did exactly as you stated, for the edge cases I of course wrapped around, however, for a board of significant size this becomes a slow calculation. I might just ingrain all the calculations into the conditional formatting, this way you only calculate cells on screen however it has the disadvantage of needing to recalculate values over and over particularly ones high up that are necessary to calculate in order to find the values of ones that are low down, if I were to combine conditional formatting and VBA by inserting a VBA function into the conditional formatting then it is possible that I could get the best of both worlds by storing previously calculating values to a list, however this introduces layers more complexity.

    • @flameofthephoenix8395
      @flameofthephoenix8395 3 หลายเดือนก่อน

      @@programmingchaos8957 After messing around with it a little more I've got it to be able to intake a iteration count variable and then format the entire spreadsheet according to the values in each cell and the next iteration, however there are some severe limitations, because I'm just recalculating things over and over without any capability to store the information already calculated the time it takes for it to calculate what should be rendered is 8^n where n is the number of iterations, additionally, there is no edge wrapping since I'm handling the entire spreadsheet I figured it would be too finicky and ultimately useless to include this, it becomes rather unusable past two iterations even with a good computer, which is surprising, I expected it to at least be able to handle 4, if there was a way to get conditional formatting to store more memory than just the previous formatting on cells so I could reuse more data this would be extremely helpful. But despite all of this it would be pretty neat to have Conway's game of life in Excel especially now that I'm doing it in 2d instead of 1d. If you want, I can copy and paste you the functions needed to run the simulation, there's only five since I took a fairly simple approach.

  • @Haagimus
    @Haagimus 9 หลายเดือนก่อน

    Just found your channel and I appreciate you making this content. I like the way you explained everything before getting into any actual code.

    • @programmingchaos8957
      @programmingchaos8957  9 หลายเดือนก่อน +2

      I'm glad the content is helpful. I have the same 'blank page' problem with code that I do with writing - having a blank page makes it very hard to start. If I sketch/outline/pseudocode the ideas in advance it makes projects much less overwhelming to start.

  • @Algoritmarte
    @Algoritmarte 8 หลายเดือนก่อน

    Very nice tutorial! I also "play" with CAs a lot!

    • @programmingchaos8957
      @programmingchaos8957  8 หลายเดือนก่อน

      Thank you! They are a lot of fun. Do you mainly use 1D or 2D? This project got me thinking about taking Conway's game of life 2D version and 'stacking' successive iterations. I'm pretty sure I've seen it done before, but can't remember how good it looked visually.

  • @ETBCOR
    @ETBCOR 9 หลายเดือนก่อน

    Lovely video as always!
    One random thing I realized while you were setting up the color mode: you could've simply used `states` instead of `360` for the max hue, then you wouldn't have to do the `[x]*(360/states)` in every rectangle call!

    • @programmingchaos8957
      @programmingchaos8957  9 หลายเดือนก่อน +1

      I hadn't thought of that - much simpler. It does have the potential drawback that it doesn't allow you to change color palettes easily. With the approach in the video you can do things like (([x]+30)*(360/states))%360 to 'shift' around the color wheel by 30 and get a different set of colors. But if you don't need that shift your approach is much simpler. Thanks!

  • @prietjepruck
    @prietjepruck 9 หลายเดือนก่อน

    Thanks Terry, another interesting tutorial.

    • @programmingchaos8957
      @programmingchaos8957  9 หลายเดือนก่อน +1

      Your welcome, and glad you enjoyed it. Now I'm tempted to try to apply these patterns to procedurally generate creatures to give them interesting textures.

    • @prietjepruck
      @prietjepruck 9 หลายเดือนก่อน

      @@programmingchaos8957 that would be interesting!

  • @per1sher
    @per1sher 9 หลายเดือนก่อน

    Nice implementation and explanation, as always.

    • @programmingchaos8957
      @programmingchaos8957  9 หลายเดือนก่อน

      Glad you enjoyed it. I'm not sure about my color choices. I need someone with a better artistic sense to make recommendations on the color palette.