Wednesday, October 28, 2009

All that time for this?

// cute little guy isn't it?

public class DuckDuckerDuckest
{
public static void main(String[] args)
{
int n;
n = -10; //set n to one to align 50 and 1
for (int i=51; i>0; --i) // the loop counts down but the game ticks forward... from zero, oops... or -10
{
String foo;
String bar;
String baz;
foo = " ";
bar = " ";
baz = " ";
// System.out.println(n); // Remove comment to print n on a separate line from the ducks and geese
if (n%3==0)
foo = " foo ";
//
if (n%5==0)
bar = " bar ";
//
if (n%7==0)
baz = " baz ";
//
System.out.println(foo + bar + baz + n);
n++;
}
}

}

No comments:

Post a Comment