Guest User

Untitled

a guest
May 6th, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.21 KB | None | 0 0
  1. (defun score (&rest dice)
  2. (let ((multi-value-size 3)
  3. (dice-thrown (make-array 7 :initial-element 0))
  4. (singular-values (make-array 7 :initial-contents '(0 100 0 0 0 50 0)))
  5. (multiple-of-3-values (make-array 7 :initial-contents '(0 1000 200 300 400 500 600)) )
  6. )
  7. (+ 0
  8. (progn
  9. (dolist (thrown dice) (incf (aref dice-thrown thrown)) )
  10. (loop for dice-number from 1 to 6 summing
  11. (if (>= (aref dice-thrown dice-number) multi-value-size)
  12. (+ (aref multiple-of-3-values dice-number) (* (- (aref dice-thrown dice-number) multi-value-size) (aref singular-values dice-number)))
  13. (* (aref dice-thrown dice-number) (aref singular-values dice-number))
  14. )
  15. )
  16. )
  17. )
  18. ) )
  19.  
Advertisement
Add Comment
Please, Sign In to add comment