Conway's Life NO Clones

Conway's Life NO Clones

by gregatku

👁 2,695 ❤️ 158 ⭐ 144 🔄 1
Created: Apr 22, 2019 Last modified: Mar 4, 2024 Shared: Apr 28, 2019

Description

Created by @gregatku for use in Coding Classes for Kids Unlimited. The info used to build this project is at https://en.wikipedia.org/wiki/Conway's Game of Life The general purpose of the 7 Pattern Buttons is: 1. "Life is like a box of chocolates ..." (my creations) 2. Created by me (for the thumbnail) 3. Glider Colliders (with beautiful 4-way symmetry) 4. Oscillators (cell sizes 0-1 mostly my own designs) 5. The "r" Pattern - large population generator, but in cell size 1 uses my Lizard pattern (turns into 2 separated "r"s at Gen 57) & also my "i i+", "5" & "Holey Box" patterns. In cell size 0 it uses my Pumpkin pattern (turns into 2 mirrored sideways "r"s at Gen 12) & others 6. Spaceship Colliders - Cell size 2 Gosper's Glider Gun & one of my own. Cell size 1 has my T 'n' T pattern, which generates 2 "spaceships" that bounce off the edges as "gliders" & my "Chopper" pattern that looks like it's lost its rotor. Importantly it also features how colliding Gliders can be used to create anything with 8 combining to create Gosper's Glider Gun! 7. Random Pattern Generator The rules for generating the game's next state are: 1. A Live cell with 2 or 3 neighbours survives 2. Thus any other Live cell dies 3. A Dead cell with 3 neighbours is reincarnated The original project had a 300 cell restriction imposed by Scratch's Clone limit, so this rewrite removes that restriction by maintaining a State list & drawing with the Pen, so we now have 4 options: 0. 13167 3x3 px cells in a 99 x 133 grid 1. 4800 5x5 px cells in a 60 x 80 grid 2. 1200 10x10 px cells in a 30 x 40 grid 3. 300 20x20 px cells in a 15 x 20 grid Note: Cell Size 1 is recommended for developing & testing of your own Patterns, because it's easier to place live cells in your Pattern. But you may not see the full potential of your own Patterns until you run them in a Cell Size 0 grid. Cell Size 3 was only included for initial development & testing because the project started life as a copy of the much simpler Clones version. It used to run so slowly (before I'd added Cell Size 0) when I 1st got it all working but in order to make it usable at all at Cell Size 1, I put every (repeat # cells) block inside a (run without screen refresh) Custom Block & while it improved somewhat it was still slow. So I rewrote some of the code slightly, so it only redrew those cells whose state changed between generations. It made a huge difference. But @ArnoHu (whose own CGOL project is amazing) pointed out it's actually faster to erase everything & redraw all Live cells, which doubled its speed. In July 2021 @ArnoHu gave me two more Performance Tuning tips that made it another 4 times faster again! It's now nearly as fast in Scratch as it is in Turbowarp! In Cell Size 1 the following patterns run for the specified # of generations before reaching a stable population (maybe with some oscillators): ? (Planted Bombs) - 2271 LIFE - 763 4 [_]s - 1026 Rocket - 1714 Cyclone - 1432 Flower - 2008 Lizard - 1339 i i+ - 2132 5 - 2361 Holey Box - 2108 T 'n' T - 478 Chopper - 2633 It also has the following Period Oscillators: A P51, a set of crazy P5s & one each of P6-P14 in one pattern, resulting in it having a period of 360,360 (since this is the LCM of nos. 6-14) Cell Size 0 has 28 new ones: ? (Jet) - 2549 LIFE - 2863 gregatku - 3022 Catherine Wheel - 1417 Wings - 1622 4 Herschels (at Gen 35) - 1508 Whirlygig - 2241 Framed Mustard Flower - 2032 Teapot - 1912 Aladdin's Lamp - 2367 Koala - 3791 Candy Canes - 2695 Tree - 2500 Butterfly - 2736 Australia - 3264 Pumpkin - 1966 Which Way? - 903 Which Way 2? - 4077 G - 2444 S - 1704 Stairs - 2004 Wedge - 3705 Fly-Bys - 2426 Duckling - 6213 69 - 3180 Stealth Bombers Collide - 2822 Spaceship Precursors - 5049 Simple Puffer - 2023 Simple Puffer 2 - 288 P8 Bouncers - (P24 Glider Loop) P37 Oscillator & Reflector (both 180 & 90 degrees) BTW - the pattern shown in Cell Size 2 for the ? button (Life is like a box of chocolates ...) deserves special mention since unlike the others in all cell sizes, it should be stepped through one Gen at a time. It's my "Eye to Life" pattern that starts out as an eye, but after the 10th gen it reveals what looks like a face. Then through the course of its remaining generations, I see many different life forms revealed, most human-like (often bearded), including 2 clowns & a girl on a roller coaster, but I also see 2 birds, 3 different dogs, 2 goats, 2 cows, a reindeer, an antelope, a ram, a cat and 2 piranhas. It ends with a pair of cat's eyes in the dark. What do you see? If you're new to the "Game of Life" & have been bitten by the bug then at least the first 5 issues of the series of Quarterly "Lifeline" Newsletter edited & published by Robert Wainwright (1st published in 1971), are a must read! You can start at the first issue here: http://www.conwaylife.com/wiki/Lifeline_Volume_1 Regards Greg

Instructions

Conway's Life NO Clones - Click Green Flag to start. Click the Text Box (3 times) to set various options. Then: Click a Cell to change its state, or: Click a Pattern Button to seed the game with the indicated pattern (bottom one for a random pattern); (+) - Click it if you want to know where dead centre is; the [Play], [Pause], [Clear], [Replay], [Next], [Rule], [Color] & [Size] buttons' purposes will soon be obvious; [............ etc ...] full central horizontal line (Size=0 only); [ditto vertically] full central vertical line (Size=0 only). July 2021 Update: Now runs 8X faster in Scratch thanks to some Performance Tuning tips from @ArhoHu. For maximum speed run it here: https://turbowarp.org/303990029?fps=60 NEW FEATUREs added Jan 2021: Conway's rules for Survival (live cell with 2 or 3 neighbours) & Birth (dead cell with 3 neighbours) form one particular set of "cellular automata" rules but there are a plethora of others. Now has an Option to choose from 6 different Life Rules. Obviously the pattern buttons will have different outcomes if you choose Life Rules 2-6. The 2nd Option, Replicator, has both Survival & Birth set to "1357". If you choose it, the [?] button has a special pattern for it, but most patterns are worth exploring. When running Replicator with the [?] seed pattern, it's very interesting to stop it every 2^n generations (or a few gens before & after it) & step it one Gen at a time until you see what happens at Gens 2^n + 1 (ie. 5, 9, 17, 33 etc.) It's also worth stepping it through its first 65 Gens. There's a special pattern for Rule 6 in all Cell Sizes via the [?] button. There are no special Seed patterns to specifically suit Rules 3 or 4. Added a new seed pattern to highlight some of the features of the Morley Rule (Option 5). It's hidden in the [?] button (there's one for each Cell Size). FYI the Morley Spaceships move quite slowly. Rules 3 & 4 produce some interesting patterns with several of the Seed patterns designed for Conway's Life. The various "LIFE" button patterns for example. The 6 Options, presently available, are: 1 = Conway's Life ( 3/23 ) 2 = Replicator ( 1357/1357 ) 3 = 34 Life ( 34/34 ) 4 = 2x2 ( 36/125 ) 5 = Morley ( 368/245 ) 6 = Maze ( 12345/3 ) https://en.wikipedia.org/wiki/Life-like_cellular_automaton (for more info) PPS: NEW FEATURE added late Jan 2021: The project can now generate a 6 line RLE file format, for any displayed grid. To use it: [v] button - generates & displays the RLE (Download) [^] button - decodes the displayed RLE (Upload), then let's you change some items, before seeding the grid with the new RLE. The items it lets you change are: - Name - RLE pattern definition - Location: 1st col & row values (0 to centre) - Rule: rule = values <survival>/<birth> This enables you to import data from any RLE file (that fits), thus introducing that RLE to this project, to run it. While it is displayed you can copy the list elements row by row, into an RLE text file, that can then be imported into, say, copy.sh/life for superfast run speed. When changing the RLE by your question answers: Blank entry to accept the [current values] shown, enables the project to use other "cellular automata" rules (apart from the 6 it knows). Your thereby modified rule remains in force till you click [Rule] to reset it back to one of its 6 known Rules. RE: Spaceships in CGoL: In Random patterns the 3 most common ones are: 1. Glider - moves 1 diagonal cell every 4 cycles. (Colliding Gliders can be used to create anything) 2. LWSS - moves 2 orthogonal cells every 4 cycles (Bounces off edges as a Glider either up or down depending on if it hits it on an odd or even cycle) 3. MWSS - same as LWSS but one cell longer (Dies on an edge collision or with most other things) Note: xWSS = xWeight SpaceShip x - either L(ight), M(iddle) or H(eavy) HWSS - uncommon, one cell longer than MWSS Spaceships can be combined to create Puffers. The 1st pattern I found that generated an xWSS was my "TnT" pattern which releases 2 opposing LWSS's. My simple 6x6 "Fly-Bys" pattern (on the "Pumpkin" button) generates a left-flying LWSS at Gen 327 & much later a right-flying MWSS at Gen 1845. I observed the formation of these 2 Spaceships to identify the precursors to their formation. This led to my "Spaceship Precursors" pattern (2nd on the button above Random). Pattern # 4 is the Gen 318 LWSS precursor & # 2 is the Gen 1843 MWSS precursor. I found # 3 (down-arrow looking) 12 Gen precursor to an LWSS & its 478 Gen precursor (# 1) in a Random seed generated by this project. # 5 (top) which generates 2 LWSS's, was added when I accidentally found it recently. # 6 - 9 generate an H, M, L & LWSS. I found them experimenting with new seed patterns. 2 & 6 - 9 each create their SS in 2 Gens.

Project Details

Visibility
Visible
Comments
Enabled