Last active
August 16, 2021 04:50
-
-
Save kickingvegas/4648ef933df859e65f0b7314f1f64283 to your computer and use it in GitHub Desktop.
chance elisp function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cl-defun chance (&key (win "You win.") &key (lose "You lose.")) | |
(interactive) | |
(message (if (<= (* 100 (cl-random 1.0)) (read-number "Chance (%): ")) win lose)) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment