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))) |
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 |