Anonymous user
Langton's ant: Difference between revisions
no edit summary
(GP) |
No edit summary |
||
Line 773:
....................................................................................................
....................................................................................................</pre>
=={{header|TI-83 BASIC}}==
The initial Pxl-On(0,0) calibrates the screen, otherwise it doesn't work, and the variable N counts the generation number.
<lang TI-83b>PROGRAM:LANT
:ClrDraw
:0→N
:Pxl-On(0,0)
:47→X
:31→Y
:90→Θ
:Repeat getKey
:If pxl-Test(Y,X)
:Then
:Θ+90→Θ
:Else
:Θ-90→Θ
:End
:Pxl-Change(Y,X)
:X+cos(Θ°)→X
:Y+sin(Θ°)→Y
:N+1→N
:End
</lang>
|