Hacker News new | past | comments | ask | show | jobs | submit login

Here's my shot at a solution:

;; * SPOILER? *

  (defun rand7 ()
    (loop (let ((result (+ (1- (rand5))
	   		   (1- (rand5)))))
	    (if (< result 7)
	        (return (1+ result))))))
;; * SPOILER *

edit: If it doesn't work I'd like to know why...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: