I raise you the compile time calculated fizzbuzz in Nim ;)
proc fizzbuzz(): seq[string] =
result = @
for i in 1..100:
if i mod 15 == 0: "FizzBuzz"
elif i mod 5 == 0: "Buzz"
elif i mod 3 == 0: "Fizz"
const compileTimeValue = fizzbuzz()
C++20 isn't available yet, but we're a bit closer to this approach. :)
Interested in adding this to the collection? 😁
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.