Random #
You will no doubt get a thousands answers to this (cause it's fun and fairly
easy) but this is how I solved your problem.
Note: You had half the battle finished.
;random.lsp
(defun get_random ( / ctime hour min sec)
(setq ctime (getvar "cdate")
hour (* 100 (- ctime (fix ctime)))
min (* 100 (- hour (fix hour)))
sec (* 100 (- min (fix min)))
msec (* 100 (- sec (fix sec))))
)
;And now the rest of the story
(defun c:random (/ msec)
(while (or (< msec 1)(> msec 65)) ;this sets a range for the while loop
(get_random) ;get a random number
)
(prompt (strcat "\nYour answer is : "(rtos msec 2 0)))
(princ)
)
Jamie