Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

fizzbuzz

Name: übermench 2011-12-26 15:04

just wanted to post my awesome fizzbuzz implementation
#include <stdio.h>
#include <stdlib.h>

void main(int j) {
  printf(((char*[]){"%d\n","fizz\n","buzz\n","fizzbuzz\n"})[!(j%3)+!(j%5)*2], j);
  (&main + (&exit - &main)*(j/100))((j+1)*(1-j/100) );
}

Name: Anonymous 2011-12-26 17:56

i=0;
while [[ $i -lt 100 ]]; do
    echo -n "$i: "
    [[ $[i % 3] == 0 ]] && echo -n "fizz"
    [[ $[i % 5] == 0 ]] && echo "buzz" || echo
    i=$[i + 1]
done


u jelly OP?

Name: Anonymous 2011-12-26 19:12

a;main(){while(a++<100){!(a%15)?printf("FizzBuzz\n"):!(a%5)?printf("Buzz\n"):!(a%3)?printf("Fizz\n"):printf("%d\n",a);}}

Name: Anonymous 2011-12-26 20:23


1.upto 100 do |a|
b = false   
if (a % 3 == 0) then
b = true; print "Fizz" end
if (a % 5 == 0) then
b = true; print "Buzz" end
unless b print a end
print "\n"
end

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List