feat(robot): add turnBack method

This commit is contained in:
Guillaume ARM 2024-05-26 01:35:12 +02:00
parent 69a04a19d5
commit edcab83d4e

View File

@ -200,6 +200,16 @@ api.create = function(state, givenConfig)
return ok, err
end
robot.turnBack = function()
local ok, errorMessage = robot.turnLeft()
if not ok then
error('turnBack: cannot turn left because ' .. tostring(errorMessage))
end
return robot.turnLeft()
end
robot.getState = function()
return state
end