.
This commit is contained in:
parent
61738ab112
commit
bb4a6ea7f9
@ -1,40 +1,42 @@
|
|||||||
basic = require("lib.basic")
|
basic = require("lib.basic")
|
||||||
tutel = require("lib.tutel")
|
tutel = require("lib.tutel")
|
||||||
|
|
||||||
print("start x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
|
||||||
for i=1,10 do
|
pos = tutel.getPos()
|
||||||
|
print("start x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
|
fopos["r"] i=1,10 do
|
||||||
rand = math.random(1,4)
|
rand = math.random(1,4)
|
||||||
|
|
||||||
if rand == 1 then
|
if rand == 1 then
|
||||||
write("forward ")
|
write("forward ")
|
||||||
x,y,z,r = tutel.forward(x,y,z,r)
|
tutel.forward()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
elseif rand == 2 then
|
elseif rand == 2 then
|
||||||
write("back ")
|
write("back ")
|
||||||
x,y,z,r = tutel.back(x,y,z,r)
|
tutel.back()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
elseif rand == 3 then
|
elseif rand == 3 then
|
||||||
write("left ")
|
write("left ")
|
||||||
r = tutel.left(r)
|
tutel.left()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
elseif rand == 4 then
|
elseif rand == 4 then
|
||||||
write("right ")
|
write("right ")
|
||||||
r = tutel.right(r)
|
tutel.right()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
elseif rand == 5 then
|
elseif rand == 5 then
|
||||||
write("up ")
|
write("up ")
|
||||||
y = tutel.up(y)
|
tutel.up()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
elseif rand == 6 then
|
elseif rand == 6 then
|
||||||
write("down ")
|
write("down ")
|
||||||
y = tutel.right(r)
|
tutel.right()
|
||||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
--print("start x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
--print("start x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. r)
|
||||||
--write("forward ")
|
--write("forward ")
|
||||||
--x,y,z,r = tutel.forward(x,y,z,r)
|
--x,y,z,pos["r"] = tutel.forward(x,y,z,r)
|
||||||
--print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
--print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. r)
|
Loading…
Reference in New Issue
Block a user