~subsetpark/whist

ref: b4197421dcbc4b6877e7b574a1fc6ee2802d1171 whist/init.janet -rw-r--r-- 693 bytes
b4197421 — Zach Smith Replace add_score with info boxes 1 year, 1 month 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
(defn
  config
  []
  {:deck "52JJ"
   :stacks [{:name "trick"
	     :orientation :up
	     :max-size 4
	     :alignment :stagger}]
   :info [{:name "north_south" :label "North/South" :value 0}
	  {:name "east_west" :label "East/West" :value 0}
	  {:name "tricks_north" :value 0}
	  {:name "tricks_east" :value 0}
	  {:name "tricks_south" :value 0}
	  {:name "tricks_west" :value 0}]})

(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"}})