~subsetpark/whist

ref: ce6d559ad77293610211f21b8297b0acdddd859d whist/whist.janet -rw-r--r-- 590 bytes
ce6d559a — Zach Smith Complete whist 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## whist.janet
(import game/deal)
(import game/bid)
(import game/discard)
(import game/beginplay)
(import game/play)

## `next` Function Signature
(defn next
  ```
  Rules engine for Bid Whist.
  ```
  [{:state state
    :players players
    :action action}]
  ## Return Next State
  (match (state :phase)
    "deal" (deal/evaluate-phase state players)
    "bid" (bid/evaluate-phase state players action)
    "discard" (discard/evaluate-phase state players action)
    "begin_play" (beginplay/evaluate-phase state players action)
    "play" (play/evaluate-phase state players action))

)