Advertisement
Rochet2

Melt numbers into one and separate

May 11th, 2012
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. math.randomseed(os.time())
  2. local ONE = math.random(0,99)
  3. local TWO = math.random(0,999999)
  4. print("First number:", ONE)
  5. print("Second number:", TWO)
  6. local MELT = TWO*1000+ONE
  7. local ONE2 = tonumber(tostring(MELT):match("^%d*(%d%d%d)$"))
  8. local TWO2 = math.modf(MELT/1000)
  9. print("Together:", MELT)
  10. print("First number from MELT:", ONE2)
  11. print("Second number from MELT:", TWO2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement