X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=random.lisp;h=756cc5f38d902c6a6926587595cd2c0f6dc18b11;hp=115c404c0aea6fff4c6a05c22095890eca62c4d6;hb=373a64e9369c2e96c465eb462a035884c7e08fa6;hpb=4a5b626f01db51b02f969adb33ddad6aa9ee303a diff --git a/random.lisp b/random.lisp index 115c404..756cc5f 100644 --- a/random.lisp +++ b/random.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: random.lisp,v 1.4 2003/06/06 21:59:30 kevin Exp $ +;;;; $Id$ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -20,22 +20,22 @@ (defun seed-random-generator () "Evaluate a random number of items" - (let ((randfile (make-pathname - :directory '(:absolute "dev") - :name "urandom"))) + (let ((randfile (make-pathname + :directory '(:absolute "dev") + :name "urandom"))) (setf *random-state* (make-random-state t)) (if (probe-file randfile) - (with-open-file - (rfs randfile :element-type 'unsigned-byte) - (let* - ;; ((seed (char-code (read-char rfs)))) - ((seed (read-byte rfs))) - ;;(format t "Randomizing!~%") - (loop - for item from 1 to seed - do (loop - for it from 0 to (+ (read-byte rfs) 5) - do (random 65536)))))))) + (with-open-file + (rfs randfile :element-type 'unsigned-byte) + (let* + ;; ((seed (char-code (read-char rfs)))) + ((seed (read-byte rfs))) + ;;(format t "Randomizing!~%") + (loop + for item from 1 to seed + do (loop + for it from 0 to (+ (read-byte rfs) 5) + do (random 65536)))))))) (defmacro random-choice (&rest exprs)