Advertisement
Bolodefchoco_LUAXML

[Math] math.mtable

Dec 8th, 2016
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 08/12/2016
  3. --Last update: 08/12/2016
  4. --[[ Notes:
  5.     Does:
  6.         Cria uma tabuada
  7.     Args:
  8.         s --> Início da tabuada
  9.         mmin --> Valor inicial para multiplicação
  10.         e --> Fim da tabuada
  11.         mmax --> Valor final para a multiplicação
  12. ]]--
  13.  
  14. math.mtable = function(s,mmin,e,mmax)
  15.     local m = {}
  16.     e = e and e or s
  17.     mmax = mmax and mmax or mmin
  18.     for i = s,e do
  19.         m[i] = {}
  20.         for j = mmin,mmax do
  21.             m[i][j] = i * j
  22.         end
  23.     end
  24.     return m
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement