CapsAdmin

Untitled

Feb 24th, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. local function lerp(m, a, b)
  2.     return (b - a) * m + a
  3. end
  4.  
  5. local generations = {}
  6.  
  7. for generation = 0, 10000 do
  8.     local result = math.random()
  9.        
  10.     for _, num in pairs(generations) do
  11.         if num > result then
  12.             result = lerp(0.5, result, num)
  13.         end
  14.     end
  15.    
  16.     table.insert(generations, result)
  17. end
  18.  
  19. print(generations[#generations])
Advertisement
Add Comment
Please, Sign In to add comment