View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

Sp2000 Midterm Review: Coding the Robot Car

Review at Midterm Review - Sp2000.

"Assume that we've bumped our front right bumper"
"Shift all wheels into reverse gear"
#('a' 'b' 'c' 'd' 'e' 'f') do: [:each | each shiftRear.]
"Activate all wheels for one second."
wheelsController activateFor: 1.
"Shift right side wheels into forward gear."
#('d' 'e' 'f') do: [:each | each shiftForward.].
"Makes right wheels go forward while right wheels go reverse – right turn."
wheelsController activateFor: 1.


There's an assumption here (and in the original code) that's worth exploring. What understands shiftRear and shiftForward? And is that a good idea? Mark Guzdial

Strings understand shifts, which is not a good idea. Each wheel needs a wrapper object that controls the shifting, and those objects should be passed the shifts in the do loops.
Gary Herndon


"Makes left wheels go forward while right wheels go reverse – left turn."

uhm, I'm not on Mars, but that's gonna be a right turn. So which way do we WANT to turn? Left or right?
Matt Hayllar

Link to this Page