我的机器人课程出现以下错误:
Commands tests @robot.placed at least 4 times (RepeatedConditional)
这是导致它的有问题的代码:
def move
@robot.move_forward if @robot.placed
end
def left
@robot.left if @robot.placed
end
def right
@robot.right if @robot.placed
end
def report
puts @robot.report_current_position if @robot.placed
end
我们将如何重新组织它以避免此警告?