CompuServe Messages

#Random #

    26-Apr-88 17:06:17
Sb: #Random #
Fm: Derek Lane 71631,306
To: ALL
Hello everyone! Maybe somebody can give me some help. I'm trying to generate a random integer between 1 and 64 for a calling program. I can get the random number from the system clock, but I don't know how to set the limits of 1 to 64. Here is a sample of the code: . (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)))) (princ (strcat "\n" (rtos msec 2 2)))) . If anyone can give me a hand I'd appreciate it…I might even be able to return the favor someday! ================== ==>> Big D in Big D <<== ================== .