セルオートマトン
https://gyazo.com/a78a48f5d9903ac37ca3a041f1ea7ad0.png
https://gyazo.com/975c2f44fbfce98f79823ba93a4c5b97.png
文字端末でも楽しいのを作れるのではないか?
code:cell.rb
len = 80
s = "0" * len + "1" + "0" * len
while true do
puts s
news = "0" * s.length
(0..s.length-3).each { |i|
to = '0' if from == '000'
to = '1' if from == '001'
to = '1' if from == '010'
to = '1' if from == '011'
to = '1' if from == '100'
to = '0' if from == '101'
to = '0' if from == '110'
to = '0' if from == '111'
}
s = news
end
実行結果
https://gyazo.com/b969aa3c1313b5d385a47f4405e8377f.png
code:ruby
seed = (ARGV0 ? ARGV0.to_i : 30) b = format('%08b',seed).split(//)
len = (ARGV1 ? ARGV1.to_i : 80) s = "0" * len + "1" + "0" * len
while true do
puts s
ss = "0" * s.length
(0..s.length-3).each { |i|
}
s = ss
end