Jump to content

Langton's ant: Difference between revisions

Line 3,415:
class Turn: left, right = False, True
class Color: white, black = '.', '#'
M = [[Color.white] * width for _ in xrangerange(height)]
 
x = width // 2
Line 3,435:
i += 1
 
print ("\n".join("".join(row) for row in M))</lang>
The output is the same as the basic D version.
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.