projects
/
langlearn
/
.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Added Lua fizzbuzz example
[langlearn/.git]
/
fizzbuzz
/
lua
/
MaximumGeeker
/
fizzbuzz.lua
1
--[[ FizzBuzz, Lua 5.1 ]]--
2
3
local ans = {
4
'Fizz',
5
'Buzz',
6
'FizzBuzz'
7
}
8
9
for i = 1, 100 do
10
local c = 0
11
12
if i%3 == 0 then
13
c = c + 1
14
end
15
16
if i%5 == 0 then
17
c = c + 2
18
end
19
20
if ans[c] then
21
print( i, ans[c] )
22
end
23
end