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.
use pastie
ReplyDeletehttp://pastie.org/private/sexoplijajox2gwcp3uag