i=0;
b=1;
while i<5 do
rand=math.random(0,1);
if rand==0 then
turtle.turnRight();
b=b+1;
end
if rand==1 then
turtle.turnLeft();
b=b-1;
end
i=i+1;
end
if b>4 then
b=b-4;
end
if b<-4 then
b=b+4;
end
if b==1 or b==-1 then
print("north");
end
if b==2 or b==-2 then
print("East");
end
if b==3 or b==-3 then
print("South");
end
if b==4 or b==-4 then
print("West");
end
