Last active
May 22, 2023 20:25
-
-
Save cgsdev0/ec5d11e62c6f67b84b51d43d1f98803a to your computer and use it in GitHub Desktop.
new fizzbuzz just dropped
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
// boilerplate; ignore this part | |
#define loop(x) for(int _i=x;_i<=0x64;_i+=x) | |
#define i c+(_i-1)*012 | |
#define pn sprintf(i,"%d\n",_i) | |
#define ps(s) strcpy(i,#s"\n") | |
#define say(s) strcmp(#s,"Number")?ps(s):pn | |
int main(void) { | |
// create a buffer on the stack | |
char c['d'*0xa]; | |
// perform fizzbuzz | |
loop(0x1) say(Number); | |
loop(0x3) say(Fizz); | |
loop(0x5) say(Buzz); | |
loop(017) say(FizzBuzz); | |
// print output | |
loop(0b1) printf("%s", i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment