~subsetpark/whist

ref: ce6d559ad77293610211f21b8297b0acdddd859d whist/init.janet -rw-r--r-- 659 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
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}}})