~subsetpark/whist

ref: b0f715a90af4b24daa3c892ceb00f7eb78478281 whist/whist.janet -rw-r--r-- 590 bytes
b0f715a9 — Zach Smith Add some explanatory text 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))

)