Conway's Game of Life

Conway's Game of Life

by plyingfig

๐Ÿ‘ 324 โค๏ธ 26 โญ 20 ๐Ÿ”„ 0
Created: Mar 21, 2021 Last modified: Jun 20, 2021 Shared: Apr 11, 2021

Description

If too laggy on your PC, you can instead run on turbowarp: https://turbowarp.org/504922751 https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life This project started as me explaining to my kids what Conway's Game of Life is. I then thought that it would be a good idea to "finish" it and share it. So I added the instructions, and improved the editor, and added ability to import/export grids, and provided pre-defined patterns, and ... etc. I was litterally assailed by a gang of feeping creatures! All scratch code is by me. This project wasn't properly planned, and the resulting code is a bit messy... The simulation engine is pretty-much a straight implementation of the algorithm, without much optimisation. Those interested in better ways of implementing it should check out HashLife, which uses hashing and quad trees to speed the simulation up (it is quite cool!). Description of the methodology can be found here: https://github.com/mafm/HashLife The style of the instructions are very much inspired by the tutorials from @papipupepappa . Thx to @helloitsme23496 for beta-testing.

Instructions

โ–บ Hit the green flag. Then click or press any key to get to the main menu. โ–บ Listen/watch the ยซInstructionsยป [I] if you don't know what Conway's Game of Life is. โ–บ ยซDraw & Simulateยป [D] to explore the Game of Life. Draw/erase cells on the grid with the pencil/eraser, and let the cells evolve, step by step or in automatic mode. (More details below.) โ–บ If you lack inspiration, just ยซSimulate a Random Soupยป [S]. โ•โ• Keyboard short-cuts โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• [Space] displays/hides command buttons. [M] returns to the main menu. โ–บ Drawing [D] selects the pencil. [S]/{Play button} starts the simulation. [C]/{Clear button} clears the grid. [R]/{Reset button} resets the grid to its state at the start of the last simulation. [E] selects the eraser. [L]/{Pattern button} lets you select and load a pre-defined pattern (see below). {Import button} imports a saved grid. {Export button} exports the current grid. [Right arrow]/{Forward button} evolves the grid by one generation. [1], [2], [3], [4]/{Resol. button} changes the resolution of the grid, from high resolution (80x60) to low resolution (40x30). High resolution is slower and requires more CPU. Changing the resolution clears the grid. โ–บ Simulation [D]/{Stop button} stops the simulation and enters drawing mode. [P]/{Pause/Play button} pauses/resumes the simulation. [Right arrow]/{Forward button} evolves the grid by one generation (while simulation is paused). โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• โ•โ• Predefined patterns โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• You can look at some interesting patterns via the Pattern command. โ–บ Still life: pattern that is stable (it doesn't change). โ–บ Oscillator: pattern that repeats itself in a stationary way. โ–บ Spaceship: pattern that "moves"; it repeats itself, like an oscillator, but after a translation. โ–บ Gun: pattern that repeats itself after spawning a spaceship pattern (e.g. glider gun). โ–บ Methuselah: pattern that evolves for a LONG time before stabilizing or dying (the highest resolution grid is in fact too small to see the full evolution, but it nevertheless gives an idea). โ–บ Puffer: pattern that moves like a spaceship, but leaves debris behind. โ–บ Fuse: a sequence of stable/oscillator patterns that are "burnt" by a moving pattern. โ–บ Eater: stable pattern that is able to destroy another pattern, while restoring itself to its initial state. โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• The grid is a cylinder (kind of). Left and right sides are connected, but offset by one line. This is because I went for a basic implementation of the grid... โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• Share your cool patterns in the comments, by using the Export command (paste the export code in a comment). โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ• #game #gameoflife #simulation

Project Details

Visibility
Visible
Comments
Enabled

More Cool Projects

Project thumbnail
View Project

MEMO 1^10ZELDA

by lateone1

Project thumbnail
View Project

TF2-2D

by anonymous_trend

Project thumbnail
View Project

My taking Borna

by Luker0707

Project thumbnail
View Project

Angry birds level editor remix

by Jonathancode

Project thumbnail
View Project

Catch the Dark huo fa!

by mooncake2012

Project thumbnail
View Project

Miku's Rhythm game (Dio invades?!)

by ASAP_Flex20

Project thumbnail
View Project

Digital fish aquarium keep your fish alive

by lunnathechump

Project thumbnail
View Project

Endless Numbers remix

by kemosushiamongus

Project thumbnail
View Project

Nickelodeon Ident: Fly Catch/Splits head (EXTENDED VERSION)

by GUGADIAS

Project thumbnail
View Project

Beat up Cussing Tunner copy remix

by tomaszalazar25

Project thumbnail
View Project

The color mixer

by user10234576

Project thumbnail
View Project

ใ‚คใƒ‹ใ‚ฏใƒญใฎ็›ดๆ„Ÿใ‚ขใƒ‹ใƒก #112 - ่ธๅˆ‡

by 1296-cat

Project thumbnail
View Project

Beat up jack

by codingrocks9_55

Project thumbnail
View Project

โญ Tower of Scratch โญ

by MaxyBrian

Project thumbnail
View Project

Super Mario Galaxy 2D

by Scratcher5410

Project thumbnail
View Project

sky ใƒœใƒผใƒซใ“ใ‚ใ“ใ‚20 hardmode4

by skyblueball2

Project thumbnail
View Project

โ˜ MMGISS Tower defense v4.6 โ˜

by MMGISS

Project thumbnail
View Project

Lemonoid Space Shooter!

by FelixTheBooster

Project thumbnail
View Project

Geometry Dash Wave Challenge (Nerfed Remix)

by XavyGD

Project thumbnail
View Project

2027-Present Mickey Mouse Meets 1939-Present Mickey Mouse

by YellowLeggs

Project thumbnail
View Project

ใ€้Ÿณใ‚ขใƒชใ€‘ใƒ—ใƒญใ‚ปใ‚ซใฃใฝใ„้Ÿณใ‚ฒใƒผ

by FC-SC

Project thumbnail
View Project

Bren319's Russian lore but ะ” Spells ะกะŸะ ะะ’ะ•ะ”ะ›ะ˜ะ’ะžะกะขะฌ

by SillygooseMike

Project thumbnail
View Project

TurboWarpOS 1.0 | Beta 2.1 #OS #TurboWarpOS #TurboWarp_OS

by USER9646

Project thumbnail
View Project

Every ALBTWIABCDEFGHIJKLMNOPQRSTUVWXYZIOF letter before Z rewound time...

by SillyGooseReturns