@derekhubbard/

FizzBuzz in Lua - Nic and Derek

Lua

No description

fork
loading
Files
  • main.lua
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function printOutput(i) 
	if (i % 3 == 0 and i % 5 == 0) then
		print('FizzBuzz')
	elseif i % 3 == 0 then
		print('Fizz') 	
	elseif i % 5 == 0 then
		print('Buzz') 	
	else 
		print(i) 	
	end
end

for i = 1, 100 do 
	printOutput(i)
end