Change Contents of the Bubble
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Questions on HW9-Fall2005

Ask your questions here, but at this point, I expect more students to be answering the questions than the teacher and TA...


so we started early. we got this error..."Error: invalid method declaration; return type required"
krista and eli

i got it no worries -krista

"No worries. Be Happy."


Is it "pixels" or "steps"? What's the unit on the ranges?


Treat them as roughly equivalent. The Turtle code tries to keep them equivalent, but they're sometimes not exactly. Don't worry about it. Treat them the same. Mark Guzdial


Nobody in the crowd wants to be within 10 steps of an obstacle. If someone is heading for an obstacle, and they're within 20 steps of the obstacle, they're going to turn 45 degrees to the left or right (randomly).
Is it 10 or 20?


Grr.
Student159 and Student160


Suggestions:
  • Make sure that your starting position is randomly distributed (uniformly) top to bottom along x=0 to 100. That way you'll see the movement easier than if they are clumped.
  • Go ahead and run it for 60 timesteps. (You won't lose credit for turning it in with only 30 timesteps.) In 60, you'll see them finish.
  • Always do the random turning and moving towards the edge at the START of the timestep. If you do it at the end, you might undo your avoidance of obstacles and crowds.
  • To turn -90 to +90, generate a random nextInt(180) and subtract 90.
Mark Guzdial



Link to this Page