Last active
August 14, 2021 07:58
-
-
Save wulab/ed6b44c811180506608836b6d3c0cb7f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(load "rand.scm") | |
(load "monte-carlo.scm") | |
(define (make-dice sides) | |
(lambda () (+ (modulo (rand) sides) 1))) | |
;; rolling a 7 and activating the robber | |
(define (catan-robber-activation) | |
(let ((d1 (make-dice 6)) | |
(d2 (make-dice 6))) | |
(= (+ (d1) (d2)) 7))) | |
(exact->inexact (monte-carlo 10000 catan-robber-activation)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment