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 |