Created
March 23, 2011 04:51
-
-
Save oskimura/882636 to your computer and use it in GitHub Desktop.
Random.scm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use math.mt-random) | |
(define (random-maker) | |
(let ((m (make <mersenne-twister> :seed (sys-time)))) | |
(lambda (a b) | |
(let ((upper (- b a))) | |
(+ a (mt-random-integer m (+ upper 1))))))) | |
(define random (random-maker)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment