Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
def cellularAutomata(s: String) = {
|
||||
def it = Iterator.iterate(s) ( generation =>
|
||||
("_%s_" format generation).iterator
|
||||
sliding 3
|
||||
map (_ count (_ == '#'))
|
||||
map Map(2 -> "#").withDefaultValue("_")
|
||||
mkString
|
||||
)
|
||||
|
||||
(it drop 1) zip it takeWhile Function.tupled(_ != _) map (_._2) foreach println
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue