all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 additions and 0 deletions

View file

@ -0,0 +1,14 @@
DynamicModule[{data =
ArrayPad[PadRight[Characters /@ StringSplit["tH.........
. .
...
. .
Ht.. ......", "\n"]] /. {" " -> 0, "t" -> 2, "H" -> 1,
"." -> 3}, 1]},
Dynamic@ArrayPlot[
data = CellularAutomaton[{{{_, _, _}, {_, 0, _}, {_, _, _}} ->
0, {{_, _, _}, {_, 1, _}, {_, _, _}} ->
2, {{_, _, _}, {_, 2, _}, {_, _, _}} ->
3, {{a_, b_, c_}, {d_, 3, e_}, {f_, g_, h_}} :>
Switch[Count[{a, b, c, d, e, f, g, h}, 1], 1, 1, 2, 1, _, 3]},
data], ColorRules -> {1 -> Yellow, 2 -> Red}]]