View Single Post
  #2  
Old 08-23-2013, 03:15 PM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 755
DrakilorP2P is just really niceDrakilorP2P is just really nice
Sounds a bit like "normal distribution", or "the bell curve." You can generate numbers that act like that using the "Box–Muller transform." Look up these things.

My attempt at implementing it in GScript:
PHP Code:
function normal() {
  
temp.2.7182818284590452353602874713526624977572470936999;
  return 
cos(2*pi*random(01)) * (-log(temp.erandom(01)))^0.5;

It generates numbers that are more likely to be close to 0.

If you know in advance that you only need numbers 1 through 10 it's probably easier to do it another way.
__________________
Testbed user: I figured since I can never find any scripters it was time to take desperate measures...and...TEACH MYSELF 0.0
Reply With Quote