1
我收到以下错误在我的机器人类:Ruby的臭佬质量检查
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
如何将我们重新组织该避免这个警告?