diff options
author | Paul Eggert <eggert@twinsun.com> | 1993-08-01 20:50:07 +0000 |
---|---|---|
committer | Paul Eggert <eggert@twinsun.com> | 1993-08-01 20:50:07 +0000 |
commit | c5eeaf525f4a7c0d5776f560f2a0bc54429d4568 (patch) | |
tree | 36f3bb0ce6d1761556ab237fb0a15bf32c66c8e2 /lisp/play/cookie1.el | |
parent | 82305cbd4d216880da4149ede6a0701fd8f9b843 (diff) | |
download | emacs-c5eeaf525f4a7c0d5776f560f2a0bc54429d4568.tar.gz |
(pick-random): Remove.
All callers changed to use `random' instead.
Diffstat (limited to 'lisp/play/cookie1.el')
-rw-r--r-- | lisp/play/cookie1.el | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lisp/play/cookie1.el b/lisp/play/cookie1.el index ee5521aa3b4..a7792fb32b6 100644 --- a/lisp/play/cookie1.el +++ b/lisp/play/cookie1.el @@ -30,8 +30,7 @@ ;; the NSA Trunk Trawler. ;; ;; The two entry points are `cookie' and `cookie-insert'. The helper -;; functions `pick-random' and `shuffle-vector' may be of interest to -;; programmers. +;; function `shuffle-vector' may be of interest to programmers. ;; ;; The code expects phrase files to be in one of two formats: ;; @@ -121,10 +120,6 @@ subsequent calls on the same file won't go to disk." (message endmsg) (set sym (apply 'vector result))))))) -(defun pick-random (n) - "Returns a random number from 0 to N-1 inclusive." - (% (logand 0777777 (random)) n)) - ; Thanks to Ian G Batten <BattenIG@CS.BHAM.AC.UK> ; [of the University of Birmingham Computer Science Department] ; for the iterative version of this shuffle. @@ -137,7 +132,7 @@ subsequent calls on the same file won't go to disk." temp (len (length vector))) (while (< i len) - (setq j (+ i (pick-random (- len i)))) + (setq j (+ i (random (- len i)))) (setq temp (aref vector i)) (aset vector i (aref vector j)) (aset vector j temp) |