- import Turtle.SimpleTurtle;
- public class DrunkTurtle extends SimpleTurtle {
- public void moveForward (double distance){
- for(int i = 0; i < 4; i++){
- if(Math.random()*10 < 5){
- super.turnLeft((int)Math.random()*60-30);
- }
- else{
- super.turnRight((int)Math.random()*60-30);
- }
- super.moveForward((Math.random()*2*distance)/7);
- }
- }
- }