Langton's ant: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: Un-eat the Ruby example) |
m (→{{header|REXX}}: corrected spelling error (typo) in a comment.) |
||
Line 1,743: | Line 1,743: | ||
else dir=dir+1 /*if cell is white, turn right. */ |
else dir=dir+1 /*if cell is white, turn right. */ |
||
if dir==0 then dir=4 /*ant should be facing "west". */ |
if dir==0 then dir=4 /*ant should be facing "west". */ |
||
if dir==5 then dir=1 /*and |
if dir==5 then dir=1 /*and should be facing "north". */ |
||
select /*ant walks direction it's facing*/ |
select /*ant walks direction it's facing*/ |
||
when dir==1 then y=y+1 /*walking north? Then go "up". */ |
when dir==1 then y=y+1 /*walking north? Then go "up". */ |