.
This commit is contained in:
parent
61738ab112
commit
bb4a6ea7f9
@ -1,40 +1,42 @@
|
||||
basic = require("lib.basic")
|
||||
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)
|
||||
|
||||
if rand == 1 then
|
||||
write("forward ")
|
||||
x,y,z,r = tutel.forward(x,y,z,r)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.forward()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
elseif rand == 2 then
|
||||
write("back ")
|
||||
x,y,z,r = tutel.back(x,y,z,r)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.back()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
elseif rand == 3 then
|
||||
write("left ")
|
||||
r = tutel.left(r)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.left()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
elseif rand == 4 then
|
||||
write("right ")
|
||||
r = tutel.right(r)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.right()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
elseif rand == 5 then
|
||||
write("up ")
|
||||
y = tutel.up(y)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.up()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
elseif rand == 6 then
|
||||
write("down ")
|
||||
y = tutel.right(r)
|
||||
print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
tutel.right()
|
||||
print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. pos["r"])
|
||||
|
||||
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 ")
|
||||
--x,y,z,r = tutel.forward(x,y,z,r)
|
||||
--print("x: " .. x .. " y: " .. y .. " z: " .. z .. " r: " .. r)
|
||||
--x,y,z,pos["r"] = tutel.forward(x,y,z,r)
|
||||
--print("x: " .. pos["x"] .. " y: " .. pos["y"] .. " z: " .. pos["z"] .. " r: " .. r)
|
Loading…
Reference in New Issue
Block a user