Making Decisions with If Statements
public class mod
{
public static void main( String[] args ) throws Exception
{
for ( int i=0; i<80; i++ )
{
if ( i%14 == 0 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 1 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 2 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 3 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 4 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 5 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 6 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 7 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 8 )
System.out.print(" *_*_*_*_ \r");
else if ( i%14 == 9 )
System.out.print(" *_*_*_*_\r");
else if ( i%14 == 10 )
System.out.print("*_ *_*_*_\r");
else if ( i%14 == 11 )
System.out.print("*_*_* *_*_\r");
else if ( i%14 == 12 )
System.out.print("*_*_*_* *_\r");
else if ( i%14 == 13 )
System.out.print("*_*_*_*_ *\r");
//oh, this is starting to make sence
Thread.sleep(200);
}
}
}
Picture of the output