Advertisement
Pirnogion

TestParser

Oct 25th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. arg = { ... }
  2.  
  3. local function man(algo)
  4.  for v in string.gmatch(algo, "%a") do
  5.   if (v == "l") then turtle.turnLeft()
  6.   elseif (v == "r") then turtle.turnRight()
  7.   elseif (v == "f") then turtle.forward()
  8.   elseif (v == "u") then turtle.up()
  9.   elseif (v == "d") then turtle.down()
  10.   elseif (v == "b") then turtle.back()
  11.   elseif (v == "p") then print("lol")
  12.   else print("Impossible algorithm.") return false
  13.   end
  14.  
  15.  end
  16.  
  17.  return true
  18. end
  19.  
  20. man(tostring(arg[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement