[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eWhen I was in High School\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003ePeople\u0026nbsp; were walking on the moon,\u003c/li\u003e\n\u003cli\u003eI was learning to program with BASIC and,\u003c/li\u003e\n\u003cli\u003eI learned about \u003ca title=\"Cellular Automata\" href=\"https://en.wikipedia.org/wiki/Cellular_automaton\" target=\"_blank\"\u003eCellular Automata\u003c/a\u003e from Scientific American, and I thought it was really neat.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eNow, no one is on the moon, I mostly don't program in BASIC... but I still think Cellular Automata is pretty neat. So much so, it's one of my go-to things to fool around with on different tiny devices - micro:bit, Circuit Playground, and, of course, my favorite NeoTrinkey!\u003c/p\u003e\n\u003cp\u003eI've got a \u003ca title=\"NeoLife programs\" href=\"https://github.com/mrklingon/NeoLife/tree/main\" target=\"_blank\"\u003erepository \u003c/a\u003ewith some of my experiments.\u003c/p\u003e\n\u003cp\u003eThe first is\u0026nbsp;\u003ca title=\"Linear Cellular Automata\" href=\"https://github.com/mrklingon/NeoLife/blob/main/lca.py\"\u003elca.py . \u003c/a\u003e\u0026nbsp;This lets you run a linear cellular automata on the Neo. Run it as \"code.py\" or, in Thonny, load it up and click the \"run\" icon. It's a simple program that will run 10 generations every time you touch pad #1. Touching pad #2 randomizes the universe. Output is printed to the REPL - but the four pixels of the Neo will show four of the cells with random colors.\u003c/p\u003e\n\u003cp\u003eOutput looks like this:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/953/original/lca.jpg?1719952973","metadata":{"caption":""}},{"element_type":"text","content":"\n        \u003cp\u003eRecently I learned of the mathematician\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca title=\"Nils Barricelli\" href=\"https://en.wikipedia.org/wiki/Nils_Aall_Barricelli\" target=\"_blank\"\u003eNils Barricelli\u003c/a\u003e, who did early work in the 1950's to simulate life\u003cspan class=\"mw-page-title-main\"\u003e\u003c/span\u003e\u003c/p\u003e\n\u003cp\u003e\u003ca title=\"George Dyson (science historian)\" href=\"https://en.wikipedia.org/wiki/George_Dyson_(science_historian)\"\u003eGeorge Dyson\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003edescribed Barricelli's first experiments at Princeton:\u003csup id=\"cite_ref-8\" class=\"reference\"\u003e\u003ca href=\"https://en.wikipedia.org/wiki/Nils_Aall_Barricelli#cite_note-8\"\u003e[8]\u003c/a\u003e\u003c/sup\u003e\u003c/p\u003e\n\u003cblockquote\u003e\n\u003cp\u003eAt 10:38 p.m. on March 3, 1953, in a one-story brick building at the end of Olden Lane in Princeton, New Jersey, Italian-Norwegian mathematical biologist Nils Aall Barricelli inoculated a 5-kilobyte digital universe with random numbers generated by drawing playing cards from a shuffled deck. \"A series of numerical experiments are being made with the aim of verifying the possibility of an evolution similar to that of living organisms taking place in an artificially created universe,\" he announced.\u003c/p\u003e\n\u003c/blockquote\u003e\n\u003cp\u003eThis inspired me to create simbio.py. Running this as code.py (or in Thonny, opening it and \"running it\") will go through successive generations. Touch pad #1 to toggle on/off the running of generations. Touch pad #2 to randomize the universe - the four pixels show a glimpse of the generations, but the REPL will show:\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      ","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/954/original/simbio.jpg?1719953119","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003cp\u003eIf ALL cells \"die\" the four pixels will flash white and the universe will be rebooted with a random restart. More often the universe will settle down to a cyclic pattern that repeats continuously.\u003c/p\u003e\n\u003cp\u003eFinally, inspired by\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca title=\"\" href=\"https://www.youtube.com/watch?v=82Rb3HbkD_E\u0026amp;ab_channel=KevinMcAleer\" target=\"_blank\"\u003e\"Is Micropython better than BASIC?\"\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eI thought about writing my own Life simulator in CircuitPython and came up with\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca title=\"life.py\" href=\"https://github.com/mrklingon/NeoLife/blob/main/life.py\" target=\"_blank\"\u003elife.py\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003e- (which requires\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca title=\"prt.py\" href=\"https://github.com/mrklingon/NeoLife/blob/main/prt.py\" target=\"_blank\"\u003eprt.py\u003c/a\u003e\u003cspan\u003e\u0026nbsp;\u003c/span\u003eand\u003cspan\u003e\u0026nbsp;\u003c/span\u003e\u003ca title=\"ncount.py\" href=\"https://github.com/mrklingon/NeoLife/blob/main/ncount.py\"\u003encount.py\u003c/a\u003e; the prt.py lets you redirect output to HID keystrokes if REPL=False, and ncount.py is for some blinking lights).\u003c/p\u003e\n\u003cp\u003eRun as code.py, or in Thonny from the \"run\" button, it will generate multiple runs of different patterns:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eblinkers - cyclic patterns of three dots\u003c/li\u003e\n\u003cli\u003ebars - a vertical bar; the universe is a torus, so the bar is a \"ring\"\u003c/li\u003e\n\u003cli\u003eglider - a moving pattern that slowly inches across the universe\u003c/li\u003e\n\u003cli\u003erpentonimo - a pattern that generates more complexity\u003c/li\u003e\n\u003cli\u003erandom start - salts the universe with random cells\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/955/original/life.jpg?1719953227","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003eAt the bottom of the code you'll see:\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003efor p in [blinkers,bar,glider,rpent]: # each defined pattern\u003c/code\u003e\u003cbr\u003e\u003ccode\u003e\u0026nbsp; \u0026nbsp; dopat(p) # salt universe with pattern\u003c/code\u003e\u003cbr\u003e\u003ccode\u003e\u0026nbsp; \u0026nbsp; showU() # display pattern\u003c/code\u003e\u003cbr\u003e\u003ccode\u003e\u0026nbsp; \u0026nbsp; rungens(10) # run 10 generations\u003c/code\u003e\u003cbr\u003e\u003ccode\u003erandU() # salt universe with random cells\u003c/code\u003e\u003cbr\u003e\u003ccode\u003eshowU() # show universe\u003c/code\u003e\u003cbr\u003e\u003ccode\u003erungens(10) # run ten generations.\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eFor fun:\u0026nbsp;\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003ecomment out that section\u003c/li\u003e\n\u003cli\u003ethen, in the REPL type \"from life import *\"\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003eThen you can type, for example\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003erandU()\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eshowU()\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003erungens(10)\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eor\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003edopat(glider)\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eshowU()\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003erungens(10)\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eFor more fun, you'll find \"live.py\" in the repository. This is a Python version of life.py that you can run on it's own in a Python interpreter.\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/000/956/original/live.jpg?1719953491","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n        \u003cp\u003e\u003cspan\u003eAs always, the NeoTrinkey is small, but mighty - containing a whole universe of possibilities to bring to \"LIFE!\"\u003c/span\u003e\u003c/p\u003e\n      \n","metadata":{}}]