Loading

Paste #p4hgfxve8

  1. (defmacro do-with-%-chance-of (percent &body body)
  2.   (cond ((>=   0 (eval percent)) nil)
  3.         ((<= 100 (eval percent)) `(progn ,@body))
  4.         (t `(when (<= (1+ (random 100)) ,(eval percent))
  5.               ,@body))))