Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Example 1
- for a = 1, 3 do
- for b = 1, 3 do
- for c = 1, 3 do
- for d = 1, 3 do
- print(a .. b .. c .. d)
- end
- end
- end
- end
- -- Example 2
- local function f(i)
- local str = ""
- for j = 1, 4 do
- local n = math.floor(i/3^(4 - j)%3) + 1
- str = str .. n
- end
- return str
- end
- for i = 0, 3^4 - 1 do
- print(i, f(i))
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement