vlatkovski

wrapping table

Apr 1st, 2015
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.23 KB | None | 0 0
  1. t = setmetatable({}, {
  2.     __index = function(t, i)
  3.         return (i>#t and t[i-#t]) or (#t>i and t[#t-i]);
  4.     end;
  5. });
  6.  
  7. t[1] = "A";
  8. t[2] = "B";
  9. t[3] = "C";
  10.  
  11. for i=1,math.random(10,30) do
  12.     math.randomseed(os.time());
  13.     return t[i];
  14. end;
Advertisement
Add Comment
Please, Sign In to add comment