# HG changeset patch # User Steve Losh # Date 1470795026 0 # Node ID 4744b5c5d33dc3f435a693634d78a02715c33fb6 # Parent 5502971bb4bb23e552b36ea95923968960ffaffd Add `random-gaussian-integer` diff -r 5502971bb4bb -r 4744b5c5d33d losh.lisp --- a/losh.lisp Wed Aug 10 01:57:01 2016 +0000 +++ b/losh.lisp Wed Aug 10 02:10:26 2016 +0000 @@ -155,6 +155,10 @@ spare (* v s)) (return (scale (* u s)))))))) +(defun random-gaussian-integer (&optional (mean 0) (standard-deviation 1)) + "Return a random integer from a gaussian distribution. NOT THREAD-SAFE (yet)!" + (round (random-gaussian mean standard-deviation))) + (defun d (n sides &optional (plus 0)) "Roll some dice. diff -r 5502971bb4bb -r 4744b5c5d33d package.lisp --- a/package.lisp Wed Aug 10 01:57:01 2016 +0000 +++ b/package.lisp Wed Aug 10 02:10:26 2016 +0000 @@ -21,6 +21,7 @@ #:random-range-exclusive #:random-around #:random-gaussian + #:random-gaussian-integer #:d #:juxt