Data update
This commit is contained in:
parent
5af6d93694
commit
796d366b97
455 changed files with 7413 additions and 1900 deletions
|
|
@ -25,6 +25,7 @@ The problem has received some analysis; for more details, please take a look at
|
|||
|
||||
|
||||
;Related task:
|
||||
* Rosetta Code: [[Conway's Game of Life]].
|
||||
* [[Conway%27s_Game_of_Life|Conway's Game of Life]].
|
||||
* [[Elementary_cellular_automaton|Elementary cellular automaton]]
|
||||
<br><br>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
len f[] 100 * 100
|
||||
proc show . .
|
||||
for y = 0 to 99
|
||||
for x = 0 to 99
|
||||
if f[y * 100 + x + 1] = 1
|
||||
move x y
|
||||
rect 1 1
|
||||
for y = 0 to 99
|
||||
for x = 0 to 99
|
||||
if f[y * 100 + x + 1] = 1
|
||||
move x y
|
||||
rect 1 1
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
.
|
||||
proc run x y dir . .
|
||||
dx[] = [ 0 1 0 -1 ]
|
||||
dy[] = [ -1 0 1 0 ]
|
||||
while x >= 0 and x < 100 and y >= 0 and y < 100
|
||||
v = f[y * 100 + x + 1]
|
||||
f[y * 100 + x + 1] = 1 - v
|
||||
dir = (dir + 2 * v) mod 4 + 1
|
||||
x += dx[dir]
|
||||
y += dy[dir]
|
||||
.
|
||||
dx[] = [ 0 1 0 -1 ]
|
||||
dy[] = [ -1 0 1 0 ]
|
||||
while x >= 0 and x < 100 and y >= 0 and y < 100
|
||||
v = f[y * 100 + x + 1]
|
||||
f[y * 100 + x + 1] = 1 - v
|
||||
dir = (dir + 2 * v) mod 4 + 1
|
||||
x += dx[dir]
|
||||
y += dy[dir]
|
||||
.
|
||||
.
|
||||
call run 70 40 0
|
||||
call show
|
||||
run 70 40 0
|
||||
show
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue