Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun score (&rest dice)
- (let ((multi-value-size 3)
- (dice-thrown (make-array 7 :initial-element 0))
- (singular-values (make-array 7 :initial-contents '(0 100 0 0 0 50 0)))
- (multiple-of-3-values (make-array 7 :initial-contents '(0 1000 200 300 400 500 600)) )
- )
- (+ 0
- (progn
- (dolist (thrown dice) (incf (aref dice-thrown thrown)) )
- (loop for dice-number from 1 to 6 summing
- (if (>= (aref dice-thrown dice-number) multi-value-size)
- (+ (aref multiple-of-3-values dice-number) (* (- (aref dice-thrown dice-number) multi-value-size) (aref singular-values dice-number)))
- (* (aref dice-thrown dice-number) (aref singular-values dice-number))
- )
- )
- )
- )
- ) )
Advertisement
Add Comment
Please, Sign In to add comment