shell.run("clear")
while true do
  e,a = os.pullEvent("key")
  
  if a == 200 then
    turtle.forward()
  elseif a == 208 then
    turtle.back()
  elseif a == 203 then
    turtle.turnLeft()
  elseif a == 205 then
    turtle.turnRight()
  elseif a == 17 then
    turtle.up()
  elseif a == 31 then
    turtle.down()
  elseif a == 57 then
    turtle.attack()
    turtle.dig()
  end
end