Assignemnt #112 Odometer Loops

Code

     ///Name: Prooz Fereydouni
    ///Period: 7
    ///Project Name: Odometer Loops
    ///File Name: OL.java
    ///Date: 5/8/2016
    
import java.util.Scanner;

public class OL
{
    public static void main( String[] args ) throws Exception
    {
        Scanner kb = new Scanner(System.in);
        System.out.print("Which base (2-10): ");
        int a = kb.nextInt();
        for ( int thous=0; thous<=a; thous++ )
        
            for ( int hund=0; hund<=a; hund++ )
            
                for ( int tens=0; tens<=a; tens++ )
                
                    for ( int ones=0; ones<=a; ones++ )
                    {
                        System.out.print( " " + thous + "" + hund + "" + tens + "" + ones + "\r" );
                        Thread.sleep(1);
                    }
        //it does work
        System.out.println();
    }
}

    

Picture of the output

assignment112