I would expect the following code to have the robot scan until it finds a target, at which point all scanning stops. However, the actual behaviour is that it continues scanning ... and I'm not sure I understand why. Can someone enlighten me?
require 'robot'
class Scanning
include Robot
def tick( events )
turn_gun( 1 ) if events['robot_scanned'].empty?
end
end
|