~subsetpark/whist

ref: b677ce25024b86d1b5ab62f4a77a8b359a07e8fc whist/init.janet -rw-r--r-- 396 bytes
b677ce25 — Zach Smith Handle last card to trick 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
(defn
  config
  []
  {:deck "52JJ"
   :stacks {"trick" {:orientation :up
		     :max-size 4
		     :alignment :stagger}}})

(defn-
  make-player
  [id team]
  {:id id :team team :score 0})

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