I need to create a method turn_left who changes the facing, facing always start in :south (Im implementing a robot who moves into a board) so if i call method turn_left should change the facing to East and then to North and to West and then return to south. Im thinking in something like this:
{
0: S
1: E
2: N
3: W
}
this is my code
# Models the Robor behavior for the game
class Robot
def initialize(attr = {})
# @position = attr[:position]
# @move = attr[:move]
@facing = :south
# @turn_left =
# @turn_right =
# @errors =
end
def position
end
def move
end
def facing
@facing
end
def turn_left
end
def turn_right
end
def errors
end
end
Thank you so much!!!