Sunday, March 18, 2012

While everyone else is at the beach, I taught myself...

I know this doesn't exactly pertain to gaming per say, but i definitely believe they are related.

var i;
for( i = 1; i < 101; i++ )
if ( ( i % 3 ) + ( i % 5 ) == 0 ) {
  print( "FizzBuzz!" );
} else
if( i % 3 == 0 ) {
  print( "Fizz!");
} else
if( i % 5 == 0 ) {
  print( "Buzz!" );
} else {
  print( i );
}



you know programming is honestly just the fun side of math really. its all problem solving.

1 comment:

  1. use pastie
    http://pastie.org/private/sexoplijajox2gwcp3uag

    ReplyDelete