Last active
June 30, 2017 15:28
-
-
Save deque-blog/de8c18a39fdf4c10e987ec4147027bad to your computer and use it in GitHub Desktop.
This file contains 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
ValidBonuses : Vect n (Fin (S PinCount)) -> Type | |
ValidBonuses {n = Z} bonuses = LTE 0 0 -- 1) No bonuses, no constraints | |
ValidBonuses {n = (S _)} bonuses = -- 2) In case of bonuses: | |
Either -- Either: | |
(finToNat (head bonuses) = PinCount) -- * The first roll is 10 | |
(sum (map finToNat bonuses) `LTE` PinCount) -- * Or the sum is less than 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment