ScratchData LogoScratchData
Back to ZapperX's profile

Cellular Automata (basic)

ZAZapperX•Created April 5, 2016
Cellular Automata (basic)
0
0
25 views
View on Scratch

Instructions

This is a program that generates cellular automata of a specific genre. They all start with one black square, then each generation a white square may become black depending on how many black neighbors it has (within the 8 squares around it), and a black square may become white depending on how many black neighbors it has. The rule, for example "Born 1, 3, 5, Die 1", dictates how many neighbors a cell must have to change color. The "born" rule is for white turning to black, and the "die" rule is for black turning to white. So, with the example rule, a white square turns black if it has exactly 1, 3, or 5 black neighbors, and a black square turns white if it has exactly 1 black neighbor. Enter the rule as a binary number. The first digit indicates whether you want "born 0" to be part of the rule; 0 means no, 1 means yes (0 is strongly recommended for the first digit, because the algorithm doesn't process "born 0" correctly, because it doesn't scan the entire screen every generation). The second digit of the binary number dictates whether you want "born 1" to be part of your rule. This should always be a 1, because the automata can never start otherwise (because it always starts with a single square). After that, you can enter either a 1 or 0 to decide whether you want each of 2-8 neighbors to trigger birth under your rule. The next "ask" is for the death rule, which dictates how many neighbors are required for a black square to turn white again. A good one to start with is "Born 1" (so type 01 in the first ask, and nothing in the second). Note that generation will be slower if you have a death rule. Turbo speed is always recommended. This program generates just one of many, many types of cellular automata—there are countless more breeds of rules to explore. See if you can think of some!

Project Details

Project ID104115686
CreatedApril 5, 2016
Last ModifiedApril 5, 2016
SharedApril 5, 2016
Visibilityvisible
CommentsAllowed