Thread: random()
View Single Post
06-06-13, 04:27 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by ravagernl View Post
lua Code:
  1. local random
  2. do
  3.     local rand = math.random
  4.     local x, y
  5.     function random(...)
  6.         repeat
  7.             x = math.random(...)
  8.         until x ~= y
  9.         y = x
  10.         return x
  11.     end
  12. end
I like how you upvalued math.random but then didn't use your upvalue.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote