X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=random.lisp;h=bc9ca7546b97dc54b086030256bc1c400a61055b;hb=f010b1701edc118c73e9096fd3f8e05d1daa3c68;hp=80d387fbc51907ca212c2986791d5e5971733378;hpb=0e5343fda28c559f11e003805727f4c625d178f3;p=kmrcl.git diff --git a/random.lisp b/random.lisp index 80d387f..bc9ca75 100644 --- a/random.lisp +++ b/random.lisp @@ -7,34 +7,33 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: random.lisp,v 1.2 2002/10/06 13:30:17 kevin Exp $ +;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; -;;;; This file, part of Kmrcl, is Copyright (c) 2002 by Kevin M. Rosenberg -;;;; -;;;; Kmrcl users are granted the rights to distribute and use this software -;;;; as governed by the terms of the GNU General Public License. +;;;; KMRCL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package :kmrcl) +(in-package #:kmrcl) (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)