Earlier quoted context omitted.
I hate puzzles too, especially the gotcha ones with esoteric knowledge required. But for FizzBuzz I explain the problem, explain that there is no trick and the simplest answer that produces the correct output will be fine. To solve it you need to know about building a loop, what the mod operator does, and maybe keeping state depending on how you build it. I tell them to write it in the language they know best. None o…
You don't need mod, loops or recursion to solve it. For instance: local remove = table.remove local insert = table.insert local print = print local sequence = { false , false , 'Fizz' , false , 'Buzz', 'Fizz' , false , false , 'Fizz' , 'Buzz' , false , 'Fizz' , false , false , 'FizzBuzz' } local function o(v) local name = remove(sequence,1) insert(sequence,name) print(name or v) return v + 1 end local function t(v) r…
Console.Write(String.Join("\r\n", Enumerable.Range(1, 100).Select(x => x % 15 == 0 ? "FizzBuzz" : x % 5 == 0 ? "Buzz" : x % 3 == 0 ? "Fizz" : x.ToString())));