Jump to content

One-dimensional cellular automata: Difference between revisions

Line 668:
 
function rules(integer tri)
ifreturn tri = 3 or tri = 5 or tri = 6 then
return 1
else
return 0
end if
end function
 
function next_gen(atom gen)
atom new, bit
new += rules(and_bits(gen,3)*2) -- work with the first bit separately
new = 0
 
new += rules(and_bits(gen,3)*2) -- work with the first bit separately
bit = 2
while gen > 0 do
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.