Langton's ant: Difference between revisions
Content added Content deleted
(Python) |
|||
Line 274: | Line 274: | ||
i = 0 |
i = 0 |
||
while i < nsteps and |
while i < nsteps and 0 <= x < width and 0 <= y < height: |
||
turn = Turn.left if M[y][x] == Color.black else Turn.right |
turn = Turn.left if M[y][x] == Color.black else Turn.right |
||
M[y][x] = Color.white if M[y][x] == Color.black else Color.black |
M[y][x] = Color.white if M[y][x] == Color.black else Color.black |