Zebra0.com

alice math


Text of video
public void myFirstMethod() {
    //Programmer : Janet Joy
    //Monkey jumps for banana
    //Monkey reaches up with both arms
    this.goldenMonkey.getRightShoulder().turn( TurnDirection.LEFT, 0.35 );
    this.goldenMonkey.getLeftShoulder().turn( TurnDirection.RIGHT, 0.4 );
    //Monkey jumps 0.25
    Double amountToJump = 0.25;
    this.goldenMonkey.move( MoveDirection.UP, amountToJump );
    this.goldenMonkey.move( MoveDirection.DOWN, amountToJump );
    amountToJump = amountToJump*1.3;
    //Jump a little bit higher : amountToJump is now 0.325
    this.goldenMonkey.move( MoveDirection.UP, amountToJump );
    this.goldenMonkey.move( MoveDirection.DOWN, amountToJump );
    amountToJump = amountToJump*1.3;
    //Jump a little bit higher : amountToJump is now 0.4225
    this.goldenMonkey.move( MoveDirection.UP, amountToJump );
    this.goldenMonkey.move( MoveDirection.DOWN, amountToJump );
 } 

End of lesson, Next lesson: