/[emacs]/emacs/lisp/play/cookie1.el
ViewVC logotype

Diff of /emacs/lisp/play/cookie1.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by fx, Wed Aug 16 19:05:59 2000 UTC revision 1.16 by pj, Thu Nov 29 08:35:10 2001 UTC
# Line 69  Line 69 
69    
70  ;;;###autoload  ;;;###autoload
71  (defun cookie (phrase-file startmsg endmsg)  (defun cookie (phrase-file startmsg endmsg)
72    "Return a random phrase from PHRASE-FILE.  When the phrase file    "Return a random phrase from PHRASE-FILE.
73  is read in, display STARTMSG at beginning of load, ENDMSG at end."  When the phrase file is read in, display STARTMSG at the beginning
74    of load, ENDMSG at the end."
75    (let ((cookie-vector (cookie-snarf phrase-file startmsg endmsg)))    (let ((cookie-vector (cookie-snarf phrase-file startmsg endmsg)))
76      (shuffle-vector cookie-vector)      (shuffle-vector cookie-vector)
77      (aref cookie-vector 1)))      (aref cookie-vector 1)))
78    
79  ;;;###autoload  ;;;###autoload
80  (defun cookie-insert (phrase-file &optional count startmsg endmsg)  (defun cookie-insert (phrase-file &optional count startmsg endmsg)
81    "Insert random phrases from PHRASE-FILE; COUNT of them.  When the phrase file    "Insert random phrases from PHRASE-FILE; COUNT of them.
82  is read in, display STARTMSG at beginning of load, ENDMSG at end."  When the phrase file is read in, display STARTMSG at the beginning
83    of load, ENDMSG at the end."
84    (let ((cookie-vector (cookie-snarf phrase-file startmsg endmsg)))    (let ((cookie-vector (cookie-snarf phrase-file startmsg endmsg)))
85      (shuffle-vector cookie-vector)      (shuffle-vector cookie-vector)
86      (let ((start (point)))      (let ((start (point)))
# Line 151  Optional fifth arg REQUIRE-MATCH non-nil Line 153  Optional fifth arg REQUIRE-MATCH non-nil
153  ;  ;
154  ;;;###autoload  ;;;###autoload
155  (defun shuffle-vector (vector)  (defun shuffle-vector (vector)
156    "Randomly permute the elements of VECTOR (all permutations equally likely)"    "Randomly permute the elements of VECTOR (all permutations equally likely)."
157    (let ((i 0)    (let ((i 0)
158          j          j
159          temp          temp

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26