diff --git a/libs/robot.lua b/libs/robot.lua index 05794f5..a10a183 100644 --- a/libs/robot.lua +++ b/libs/robot.lua @@ -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