.
This commit is contained in:
parent
139c9b79d8
commit
3be1dc278d
@ -11,8 +11,8 @@ write("r (S=0,W=1,N=2,E=3):")
|
|||||||
r = read()
|
r = read()
|
||||||
|
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||||
for i=1,20 do
|
for i=1,5 do
|
||||||
rand = math.random(1,6)
|
rand = math.random(1,4)
|
||||||
|
|
||||||
if rand == 1 then
|
if rand == 1 then
|
||||||
write("forward ")
|
write("forward ")
|
||||||
@ -23,18 +23,10 @@ for i=1,20 do
|
|||||||
x,y,z,r = tutel.back(x,y,z,r)
|
x,y,z,r = tutel.back(x,y,z,r)
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||||
elseif rand == 3 then
|
elseif rand == 3 then
|
||||||
write("up ")
|
|
||||||
y = tutel.up(y)
|
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
|
||||||
elseif rand == 4 then
|
|
||||||
write("down ")
|
|
||||||
y = tutel.down(y)
|
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
|
||||||
elseif rand == 5 then
|
|
||||||
write("left ")
|
write("left ")
|
||||||
r = tutel.left(r)
|
r = tutel.left(r)
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||||
elseif rand == 6 then
|
elseif rand == 4 then
|
||||||
write("right ")
|
write("right ")
|
||||||
r = tutel.right(r)
|
r = tutel.right(r)
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||||
|
Loading…
Reference in New Issue
Block a user