Skip to content

Instantly share code, notes, and snippets.

@jamesandariese
Created April 18, 2015 03:03
Show Gist options
  • Save jamesandariese/8faa3e4ae638b4f80f1e to your computer and use it in GitHub Desktop.
Save jamesandariese/8faa3e4ae638b4f80f1e to your computer and use it in GitHub Desktop.
dense fizzbuzz in C with no branches
#include <stdio.h>
int main() {
for (int i=1;;i++) printf("FizzBuzz\n\0 Buzz\n\0 Fizz\n\0 %d\n"+(0-i%3&16|0-i%5&32),i);
}
@jamesandariese
Copy link
Author

I think this can probably be made a lot shorter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment