[ create a new paste ] login | about

Link: http://codepad.org/KUJ0koqr    [ raw code | output | fork ]

nepta - Lua, pasted on Apr 7:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local array = setmetatable({},{
	__index = function(t,k)
		t[k] = setmetatable({},{
			__index = function(t,k)
				t[k] = 0
				return t[k]
			end
		})
		return t[k]
	end
})

array[4][2] = 42
print("[4][2] : "..array[4][2])
print("[0][0] : "..array[0][0])
print("[10000000][154132148] : "..array[10000000][154132148])


Output:
1
2
3
[4][2] : 42
[0][0] : 0
[10000000][154132148] : 0


Create a new paste based on this one


Comments: