Zebra0.com

alice calculationsCounter Loops

Counter Loops

Using a while loop to count using counter=counter+1


Text of video

Download calculations-counter.a3p

public void myFirstMethod() {
    //Programmer : Janet Joy
    //Tiger counts
    Integer counter = 0;
    while ( true ) {
        counter = counter+1;
        this.stuffedTiger.say( ""+counter );
    }
} 

My code doesn't look like that!

NEXT: 3 Guys take turns counting