Advertisement
Guest User

Koordinaten

a guest
May 4th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. y = 0
  2. x = 0
  3.  
  4. function x_calc(move_x, Feldgrenze_x)
  5.   if move_x < x and move_x >= 0 and move_x <= Feldgrenze_x then
  6.     turtle.turnLeft()
  7.     x = x - move_x
  8.   else if move_x > x and move_x >= 0 and move_x <= Feldgrenze_x then
  9.     turtle.turnRight()
  10.     x = move_x - x
  11.   else if move_x == x then
  12.    
  13.   else
  14.     print("Fehlerhafte Eingabe!")        
  15.    
  16.    
  17.    
  18.   turtle.turnLeft()
  19.   for i = 0, x, 1 do
  20.     turtle.forward()
  21.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement