Timeline for Rand5() to Rand7()
Current License: CC BY-SA 2.5
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 29, 2011 at 18:51 | comment | added | Dr. Pain |
Even better: (defun rand7()(if(>(setq n(-(+(rand5)(* 5(rand5)))5))7)(rand7)n))
|
|
Apr 29, 2011 at 18:19 | comment | added | Dr. Pain |
Nice. You can squeeze out two more characters by making n a global variable: (defun rand7()(setq n(-(+(rand5)(* 5(rand5)))5))(if(> n 7)(rand7)n))
|
|
Jan 28, 2011 at 2:26 | history | answered | Jonathan Sternberg | CC BY-SA 2.5 |