Advertisement
Bolodefchoco_LUAXML

[Math] math.hasta

Aug 8th, 2015
376
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.40 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 08/08/2015
  3. --Last update: 15/05/2016
  4. --[[ Notes:
  5.     Does:
  6.         Retorna um unpack com todos os números entre x e y.
  7.     Args:
  8.         x --> Número 1, pode ser maior ou menor que y
  9.         y --> Número 2, pode ser maior ou menor que x
  10. ]]--
  11.  
  12. math.hasta=function(x,y)
  13.     local list={}
  14.     local v=(y<x and -1 or 1)
  15.     for i = x,y,v do table.insert(list,i) end
  16.     return table.unpack(list)
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement