Langton's ant: Difference between revisions
m
→{{header|APL}}
m (→{{header|APL}}) |
m (→{{header|APL}}) |
||
Line 521:
}
⍝ iterate one step: takes and
step ← {
grid ant dir ← ⍵
Line 534:
⍝ up is -1 0, right is 0 1, down is 1 0, and left is 0 -1
ant +← (4 2 ⍴ ¯1 0, 0 1, 1 0, 0 ¯1)[dir;]
grid ant dir
}
|