Download User Manual
Transcript
Robbie the Robot User Manual version 0.99 Here, we assume that each item to be moved will be at the same location initially, perhaps being fed down an assembly line, and that each is dropped at the same location. This makes Robbie demand attention until an object is available for him to pick up: program "Bother" start register boolean Ignored set Ignored true register integer Beeps set Beeps 0 while Ignored do set Beeps ; ; ; ; is there an item yet? not yet . . . number of beeps issued no beeping yet ; keep it up ‘til you get an item Beeps + 1 if ; count beep Beeps < 3 then beep 1000 500 else beep 5000 500 endif ; short beep first two times grab ; try to pick up item if weight > 0 set Ignored endif then false ; then out of patience ; see if you got one ; if so, quit the loop endwhile stop Here, we assume that each item to be moved will be at the same location initially, perhaps being fed down an assembly line, and that each is dropped at the same location. Page 7 of 7