~subsetpark/whist

ref: 8fc382a6dce31cc91d6440c69bd07e137b29b63c whist/init.janet -rw-r--r-- 715 bytes
8fc382a6 — Zach Smith Format all 6 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
27
28
29
30
31
## init.janet
## Config
(defn
  config
  []
  {:deck "52JJ"
   :player_count 4
   :stacks [{:id "trick"
             :label "trick"
             :orientation :up
             :max-size 4
             :alignment :stagger}]
   :info [{:id "north_south" :label "North/South" :value 0}
          {:id "east_west" :label "East/West" :value 0}]})

## Init
(defn-
  make-player
  [id team]
  {:id id :team team})

(defn init
  "Create an initial game state."
  [fst snd thd fth]
  {:players [(make-player fst "north_south")
             (make-player snd "east_west")
             (make-player thd "north_south")
             (make-player fth "east_west")]
   :state {:phase "deal" :info {:north_south 0 :east_west 0}}})