Langton's ant: Difference between revisions
m
→{{header|Sidef}}: minor code updates
m (→{{header|REXX}}: added more wording in the REXX output section.) |
m (→{{header|Sidef}}: minor code updates) |
||
Line 6,312:
var plane = size.of { size.of (White) }
var (x, y) =
var dir = dirs.len.irand
Line 6,319:
(x >= 0) && (y >= 0) && (x < size) && (y < size) || break
given (plane[x][y]) {
when (White) { dir--; plane[x][y] = Black }
when (Black) { dir++; plane[x][y] = White }
Line 6,325:
++moves
[[\x, \y]
}
|