Skip to content

Instantly share code, notes, and snippets.

@kickingvegas
Last active August 16, 2021 04:50
Show Gist options
  • Save kickingvegas/4648ef933df859e65f0b7314f1f64283 to your computer and use it in GitHub Desktop.
Save kickingvegas/4648ef933df859e65f0b7314f1f64283 to your computer and use it in GitHub Desktop.
chance elisp function
(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