General FizzBuzz: Difference between revisions
Content deleted Content added
→{{header|Lua}}: Changed to reflect changes in the original (Python) version. |
→{{header|Lua}}: Removed default values, added output. |
||
Line 1,166:
'''One of the few solutions which do not use expensive modulo ''(think about the CPU!)''.'''
{{trans|Python}}
<lang Lua>local
3, 'cheese ',▼
2, 'borccoli ',▼
3, 'sauce ',▼
local function fizzbuzz(n, mods)▼
local res = {}
Line 1,212 ⟶ 1,202:
end
</lang>
{{out}}
<pre>
> mods = {
▲>> 3, 'cheese ',
▲>> 3, 'sauce ',
>> }
1
broccoli
cheese sauce
broccoli
5
cheese broccoli sauce
7
broccoli </pre>
=={{header|Nim}}==
|