3 ms·
Could probably store all multiples of 3 and 5 up to some really big number burned directly to hardware and then do something like a big CAM table the way Intern
by nonameiguess 5y ago
Could probably store all multiples of 3 and 5 up to some really big number burned directly to hardware and then do something like a big CAM table the way Internet core routers do mapping the numbers to ASCII bit strings. Then speedup IO by not having a general purpose display, but something more like an old-school digital clock that can only show digits and the words "fizz" and "buzz."
- function_seven 5y agoYou'll get docked points from the typography nerd for displaying "fizz" instead of "fizz"
- yuliyp 5y agoThat's definitely not going to be useful. By doing this 15 numbers at a time you completely avoid needing to do any division anyway. print FB, i+1. i+2, Fizz, i+3, Buzz. i+4, ... i+14. Then increment by 15. Also, even with a very slow CPU you'd already run faster than can be perceived on a digital clock