I've got this:
(let ((num 1))
(mapcar (lambda (x)
(cons x (if (evenp (setf num (random 299)))
(1+ num)
(num))))
'(a b c d e f)))
which should produce something like this:
((A . 37) (B . 283) (C . 232) (D . 251) (E . 273) (F . 170)
only with odd numbers. Yes, very kludgy looking. Is there something with random-state
that would help? Or the "hidden system variable" that holds onto that initial random
calculation? Here's a global function I tried:
(defun random-odd ()
(let ((num 0))
(if (evenp (setf num (random 299)))
(1+ num)
(num))))
Also not working. What am I missing here?