WireWorld
No preview image
Model was written in NetLogo 5.0RC6
•
Viewed 302 times
•
Downloaded 19 times
•
Run 0 times
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
http://karl.kiwi.gen.nz/CA-Wireworld.html
http://mathworld.wolfram.com/WireWorld.html
CREDITS AND REFERENCES
The rules for WireWorld were invented by Brian Silverman in 1987.
Comments and Questions
Please start the discussion about this model!
(You'll first need to log in.)
Click to Run Model
patches-own [next] ; These cryptic looking strings contain CA initial states in MCell ; format, as documented at ; http://www.mirekw.com/ca/ca_files_formats.html ; The basic idea is that the four cell states are A, B, C, and . (period). ; A number means repeat the next character that many times. ; $ (dollar sign) goes to the next row. to setup-gates clear-all ; http://www.maa.org/editorial/mathgames/mathgames_05_24_04.html ; http://www.maa.org/editorial/mathgames/allgates.mcl mcell (word "105.ACC$104.B3.C$77.C25.C3.3C$52.CC22.C.C23.C5.C$5.BAC19.CC22.C..C21.C" ".C5.C.CC13.C5.C.C$4.C3.C15.CBA..C18.CBA..4C16.CBA..C4.3C..C8.CBAC..AC." "C..C$CBAC3.3C..8C8.16C9.C.13C10.C.C.C.C.C..4C9.B..C..9C$5.C..C..C12.CB" "A..C18.CBA..4C16.CBAC..3C4.C10.CBAC..CC.C..C$4.A.CC.CC16.CC22.C..C22.C" "..C.C3.C14.C5.C.C$5.B46.CC24.C4.3C16.C5.C$79.4C20.C3.3C$104.B3.C$25.C" "3.C19.C3.C22.C21.5C..ACC$25.C3.C19.C3.C22.C$.5C20.C.C21.C.C22.C.C21.3C" "$5.C20.C.C21.3C22.C.C21.C.C$27.C46.C3.C19.C3.C$27.C21.5C20.C3.C19.C3.C") reset-ticks end to setup-binary-counter clear-all ; http://www.maa.org/editorial/mathgames/mathgames_05_24_04.html ; http://www.maa.org/editorial/mathgames/epjla.mcl ; http://pages.prodigy.net/nylesheise/edpeggjrcounter.html mcell (word "6.7C11.7C11.7C11.7C11.7C11.7C11.7C11.7C11.7C11.7C$5.C7.C9.C7.C9.C7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C$C5.C3.C..C10.C3.C..C10.C3.C..C10.C3.C..C10.C3.C.." "C10.C3.C..C10.C3.C..C10.C3.C..C10.C3.C..C10.C3.C..C10.C$C5.C..3C.C10.C" "..3C.C10.C..3C.C10.C..3C.C10.C..3C.C10.C..3C.C10.C..3C.C10.C..3C.C10.C" "..3C.C10.C..3C.C10.C$C4.C4.C..C9.C4.C..C9.C4.C..C9.C4.C..C9.C4.C..C9.C" "4.C..C9.C4.C..C9.C4.C..C9.C4.C..C9.C4.C..C10.C$C5.4C.C.C10.4C.C.C10.4C" ".C.C10.4C.C.C10.4C.C.C10.4C.C.C10.4C.C.C10.4C.C.C10.4C.C.C10.4C.C.C10." "C$C10.C.C.4C10.C.C.4C10.C.C.4C10.C.C.4C10.C.C.4C10.C.C.4C10.C.C.4C10.C" ".C.4C10.C.C.4C10.C.C.4C5.C$C10.C..C4.C9.C..C4.C9.C..C4.C9.C..C4.C9.C.." "C4.C9.C..C4.C9.C..C4.C9.C..C4.C9.C..C4.C9.C..C4.C4.C$C10.C.3C..C10.C." "3C..C10.C.3C..C10.C.3C..C10.C.3C..C10.C.3C..C10.C.3C..C10.C.3C..C10.C." "3C..C10.C.3C..C5.C$C10.C..C3.C10.C..C3.C10.C..C3.C10.C..C3.C10.C..C3.C" "10.C..C3.C10.C..C3.C10.C..C3.C10.C..C3.C10.C..C3.C5.C$C7.3C..C4.C7.3C" "..C4.C7.3C..C4.C7.3C..C4.C7.3C..C4.C7.3C..C4.C7.3C..C4.C7.3C..C4.C7.3C" "..C4.C7.3C..C4.C5.C$C6.C3.C.C.CC.5C..C3.C.C.CC.5C..C3.C.C.CC.5C..C3.C." "C.CC.5C..C3.C.C.CC.5C..C3.C.C.CC.5C..C3.C.C.CC.5C..C3.C.C.CC.5C..C3.C." "C.CC.5C..C3.C.C.CC.6C$.8C..C..C.CC5.4C..C..C.CC5.4C..C..C.CC5.4C..C..C" ".CC5.4C..C..C.CC5.4C..C..C.CC5.4C..C..C.CC5.4C..C..C.CC5.4C..C..C.CC5." "4C..C..C.CC$7.C..5C.C.3C4.C..5C.C.3C4.C..5C.C.3C4.C..5C.C.3C4.C..5C.C." "3C4.C..5C.C.3C4.C..5C.C.3C4.C..5C.C.3C4.C..5C.C.3C4.C..5C.C.3C$7.C3.C" "..3C4.C3.C3.C..3C4.C3.C3.C..3C4.C3.C3.C..3C4.C3.C3.C..3C4.C3.C3.C..3C" "4.C3.C3.C..3C4.C3.C3.C..3C4.C3.C3.C..3C4.C3.C3.C..3C4.C$7.C4.C..C4.C4." "C4.C..C4.C4.C4.C..C4.C4.C4.C..C4.C4.C4.C..C4.C4.C4.C..C4.C4.C4.C..C4.C" "4.C4.C..C4.C4.C4.C..C4.C4.C4.C..C4.C$7.C5.3C.C.C5.C5.3C.C.C5.C5.3C.C.C" "5.C5.3C.C.C5.C5.3C.C.C5.C5.3C.C.C5.C5.3C.C.C5.C5.3C.C.C5.C5.3C.C.C5.C" "5.3C.C.C$8.CC6.3C7.CC6.3C7.CC6.3C7.CC6.3C7.CC6.3C7.CC6.3C7.CC6.3C7.CC" "6.3C7.CC6.3C7.CC6.3C$10.C6.C.C8.C6.C.C8.C6.C.C8.C6.C.C8.C6.C.C8.C6.C.C" "8.C6.C.C8.C6.C.C8.C6.C.C8.C6.C.C$11.C7.C9.C7.C9.C7.C9.C7.C9.C7.C9.C7.C" "9.C7.C9.C7.C9.C7.C9.C7.C$12.7C11.7C11.7C11.7C11.7C11.7C11.7C11.7C11.7C" "11.7C") reset-ticks end to go ask patches [ set next pcolor ifelse pcolor = red [ set next blue ] [ ifelse pcolor = blue [ set next black ] [ if pcolor = black [ let c count neighbors with [pcolor = red] if c = 1 or c = 2 [ set next red ] ] ] ] ] ask patches [ set pcolor next ] tick end to mcell [spec] let patch-list sort patches while [spec != ""] [ while [first spec = "$"] [ let y [pycor] of first patch-list while [y = [pycor] of first patch-list] [ ask first patch-list [ set pcolor white ] set patch-list butfirst patch-list ] set spec butfirst spec ] let repeats 0 while [member? first spec ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]] [ set repeats 10 * repeats + read-from-string item 0 spec set spec butfirst spec ] if repeats = 0 [ set repeats 1 ] let c first spec set spec butfirst spec repeat repeats [ let p first patch-list set patch-list butfirst patch-list ask p [ if c = "." [ set pcolor white ] if c = "A" [ set pcolor red ] if c = "B" [ set pcolor blue ] if c = "C" [ set pcolor black ] ] ] ] foreach patch-list [ ask ? [ set pcolor white ] ] end
There are 2 versions of this model.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.