This file contains 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> | |
// calls `snprintf` with the correct fizbuz result. | |
// | |
// Note: zero modulus is questionable... but we assume it's fine. | |
// | |
// A response to Kevlin Henney's talk from 2019: https://youtu.be/SFv8Wm2HdNM | |
int fizzbuzz(char *dest, unsigned long dest_len, unsigned long num) { | |
// construct bit based result for the 4 possible states of fizbuz |