aboutsummaryrefslogtreecommitdiff
path: root/challenge-329/hvukman/lua/329_p1.lua
blob: 726c0d15b71f2ac5b2b5f659e77efd6c54c7e3f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function counting (X)
print("string: ", X)
local ints = {}
-- store values as keys which are unique
for word in string.gmatch(X, "%d+") do 
    ints[word]= true
end
-- print keys
 for i,v in pairs(ints) do
            print (i)
        end
    end

counting("the1weekly2challenge2")
counting("go21od1lu5c7k")
counting("4p3e2r1l")