/
test_handcalc.clsp
444 lines (426 loc) · 18.1 KB
/
test_handcalc.clsp
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
(include *standard-cl-23*)
(import std.relops)
(import std.deep_compare)
(import std.assert)
(import std.reverse)
(import std.prepend)
(import std.truncate)
(import std.map)
(import std.filtermap)
(import std.slice)
(import std.print)
(import std.partition)
(import std.append)
(import handcalc exposing handcalc)
(import onehandcalc exposing onehandcalc)
(defun cards-by-bitmask (mask cards)
(if cards
(let ((next-cards (cards-by-bitmask (lsh mask -1) (r cards))))
(if (logand 1 mask)
(c (f cards) next-cards)
next-cards
)
)
()
)
)
(defun count-bits (mask)
(if mask
(let ((next (count-bits (lsh mask -1))))
(if (logand mask 1)
(+ 1 next)
next
)
)
0
)
)
(defun must-have-bits (N M)
(if (= (count-bits M) N)
M
(x "Mask" M "should have" N "bits")
)
)
(defun must-be-len (N L)
(if (= (list-len L) N)
L
(x "List" L "should have" N "elements")
)
)
(defun generate_handcalc_and_reverse_response (cards)
(assign
reversed-cards (reverse cards)
handcalc-result (print (list "handcalc fwd result for cards" cards) (handcalc cards))
reverse-handcalc-result (print (list "handcalc rev result for cards" reversed-cards) (handcalc reversed-cards))
chosen-cards (cards-by-bitmask (must-have-bits 5 handcalc-result) cards)
reverse-chosen-cards (cards-by-bitmask (must-have-bits 5 reverse-handcalc-result) reversed-cards)
(c (must-be-len 5 chosen-cards) (must-be-len 5 reverse-chosen-cards))
)
)
(defun runtests_inner ((myfunc firstarg secondarg . remaining))
(assign-lambda
(first-chosen-cards . first-rev-cards) (generate_handcalc_and_reverse_response firstarg)
(second-chosen-cards . second-rev-cards) (generate_handcalc_and_reverse_response secondarg)
first-ohc (print (list "first onehandcalc from " first-chosen-cards) (onehandcalc (must-be-len 5 first-chosen-cards)))
second-ohc (print (list "second onehandcalc from " second-chosen-cards) (onehandcalc (must-be-len 5 second-chosen-cards)))
first-rev-ohc (print (list "first rev onehandcalc from " first-rev-cards) (onehandcalc (must-be-len 5 first-rev-cards)))
second-rev-ohc (print (list "second rev onehandcalc from " second-rev-cards) (onehandcalc (must-be-len 5 second-rev-cards)))
(assert
(print (list "======== compare hands ========" first-ohc second-ohc) (a myfunc (list first-ohc second-ohc)))
(print (list "======== first equal ==========" first-ohc first-rev-ohc) (deep= first-ohc first-rev-ohc))
(print (list "======== second equal =========" second-ohc second-rev-ohc) (deep= second-ohc second-rev-ohc))
(if remaining
(runtests_inner remaining)
0
)
)
)
)
(defun runtests tests (if tests (runtests_inner tests) ()))
;; Join these up when large application bug is fixed.
(export ()
(runtests
; all beats both emerge over and measure higher
; straight flush with higher kicker ties
; A1 K1 Q1 J1 T1 91 = A1 K1 Q1 J1 T1 81
deep=
(list (c 12 1) (c 11 1) (c 14 1) (c 13 1) (c 10 1) (c 9 1))
(list (c 12 1) (c 11 1) (c 14 1) (c 13 1) (c 10 1) (c 8 1))
; straight flushes of different suits tie
; A1 K1 Q1 J1 T1 = A2 K2 Q2 J2 T2
deep=
(list (c 14 1) (c 13 1) (c 12 1) (c 11 1) (c 10 1))
(list (c 14 2) (c 13 2) (c 12 2) (c 11 2) (c 10 2))
; higher straight flush beats lower straight flush
; A1 K1 Q1 J1 T1 > 61 51 41 31 21
deep>
(list (c 14 1) (c 13 1) (c 12 1) (c 11 1) (c 10 1))
(list (c 6 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
; A1 K1 Q1 J1 T1 91 = A1 K1 Q1 J1 T1
deep=
(list (c 12 1) (c 11 1) (c 14 1) (c 13 1) (c 10 1) (c 9 1))
(list (c 14 2) (c 11 2) (c 10 2) (c 13 2) (c 12 2))
; lower (2-6) straight flush beats ace to four straight flush
; 61 51 41 31 21 > A2 52 42 32 22
deep>
(list (c 6 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
(list (c 14 2) (c 5 2) (c 4 2) (c 3 2) (c 2 2))
; A1 61 51 41 31 21 = 61 51 41 31 21
deep=
(list (c 14 1) (c 6 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
(list (c 6 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
; ace to four straight flush with higher kicker ties
; A2 52 42 32 22 61 = A1 51 41 31 21 71
deep=
(list (c 14 2) (c 5 2) (c 4 2) (c 3 2) (c 2 2) (c 6 1))
(list (c 14 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1) (c 7 1))
; ace to four straight flushes of different suits tie
; A1 51 41 31 21 = A2 52 42 32 22
deep=
(list (c 14 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
(list (c 14 2) (c 5 2) (c 4 2) (c 3 2) (c 2 2))
; ace to four straight flush beats four of a kind
; A1 51 41 31 21 > K1 K2 K3 K4 J1
deep>
(list (c 14 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 11 1))
; A1 A2 A3 A4 51 41 31 21 = A1 51 41 31 21
deep=
(list (c 14 1) (c 14 2) (c 14 3) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
(list (c 14 1) (c 5 1) (c 4 1) (c 3 1) (c 2 1))
; four of a kind with higher kicker wins
; K1 K2 K3 K4 Q1 > K1 K2 K3 K4 J1
deep>
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 12 1))
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 11 1))
; K1 K2 K3 K4 T1 91 = K1 K2 K3 K4 T1
deep=
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 10 1) (c 9 1))
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 10 1))
; four of a kind with higher second kicker ties
; K1 K2 K3 K4 Q1 J1 = K1 K2 K3 K4 Q1 T1
deep=
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 12 1) (c 11 1))
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 12 1) (c 10 1))
; higher four of a kind beats lower four of a kind
; K1 K2 K3 K4 21 > 31 32 33 34 A1
deep>
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 2 1))
(list (c 3 1) (c 3 2) (c 3 3) (c 3 4) (c 14 1))
; K1 K2 K3 K4 31 32 33 34 = K1 K2 K3 K4 32
deep=
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 3 1) (c 3 2) (c 3 3) (c 3 4))
(list (c 13 1) (c 13 2) (c 13 3) (c 13 4) (c 3 2))
; four of a kind beats full house
; 21 22 23 24 31 > A1 A2 A3 K1 K2
deep>
(list (c 2 1) (c 2 2) (c 2 3) (c 2 4) (c 3 1))
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 13 2))
; four of a kind equality: 21 22 23 24 A1 A2 A3 = 21 22 23 24 A2
deep=
(list (c 2 1) (c 2 2) (c 2 3) (c 2 4) (c 14 1) (c 14 2) (c 14 3))
(list (c 2 1) (c 2 2) (c 2 3) (c 2 4) (c 14 2))
; full house with higher set wins
; 51 52 53 21 22 > 31 32 33 71 72
deep>
(list (c 5 1) (c 5 2) (c 5 3) (c 2 1) (c 2 2))
(list (c 3 1) (c 3 2) (c 3 3) (c 7 1) (c 7 2))
; A1 A2 A3 K1 K2 K3 = A1 A2 A3 K1 K2
deep=
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 13 2) (c 13 3))
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 13 2))
; full house with same set and higher pair wins
; 51 52 53 41 42 > 51 52 53 31 32
deep>
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2))
(list (c 5 1) (c 5 2) (c 5 3) (c 3 1) (c 3 2))
; A1 A2 A3 K1 K2 51 52 = A1 A2 A3 K1 K2
deep=
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 13 2) (c 5 1) (c 5 2))
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 13 2))
; full house ties with two sets
; 51 52 53 41 42 A1 = 51 52 53 41 42 43
deep=
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2) (c 14 1))
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2) (c 4 3))
; full house beats flush
; 51 52 53 41 42 > A1 Q1 T1 81 71
deep>
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2))
(list (c 14 1) (c 12 1) (c 10 1) (c 8 1) (c 7 1))
; 51 52 53 41 42 A1 K1 Q1 = 51 52 53 41 42
deep=
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2) (c 14 1) (c 13 1) (c 12 1))
(list (c 5 1) (c 5 2) (c 5 3) (c 4 1) (c 4 2))
; higher flush beats lower flush
; A1 61 51 41 31 > K1 Q1 J1 T1 81
deep>
(list (c 14 1) (c 6 1) (c 5 1) (c 4 1) (c 3 1))
(list (c 13 1) (c 12 2) (c 11 1) (c 10 1) (c 8 1))
; A1 K1 Q1 J1 81 71 = A1 K1 Q1 J1 81
deep=
(list (c 14 1) (c 13 1) (c 12 1) (c 11 1) (c 8 1) (c 7 1))
(list (c 14 1) (c 13 1) (c 12 1) (c 11 1) (c 8 1))
; flush with higher second card wins
; A1 K1 51 41 31 > A1 Q1 J1 T1 91
deep>
(list (c 14 1) (c 13 1) (c 5 1) (c 4 1) (c 3 1))
(list (c 14 1) (c 12 2) (c 11 1) (c 10 1) (c 9 1))
; flush with higher third card wins
; A1 K1 Q1 41 31 > A1 K1 J1 T1 91
deep>
(list (c 14 1) (c 13 1) (c 12 1) (c 4 1) (c 3 1))
(list (c 14 1) (c 13 1) (c 11 1) (c 10 1) (c 9 1))
; flush with higher fourth card wins
; A1 K1 Q1 T1 21 > A1 K1 Q1 91 81
deep>
(list (c 14 1) (c 13 1) (c 12 1) (c 10 1) (c 2 1))
(list (c 14 1) (c 13 1) (c 12 1) (c 9 1) (c 8 1))
; flush with higher fifth card wins
; A1 K1 Q1 T1 81 > A1 K1 Q1 T1 71
deep>
(list (c 14 1) (c 13 1) (c 12 1) (c 10 1) (c 8 1))
(list (c 14 1) (c 13 1) (c 12 1) (c 10 1) (c 7 1))
; flushes of different suits tie
; A1 K1 J1 T1 81 = A2 K2 J2 T2 82
deep=
(list (c 14 1) (c 13 1) (c 11 1) (c 10 1) (c 8 1))
(list (c 14 2) (c 13 2) (c 11 2) (c 10 2) (c 8 2))
; same flush with higher sixth card ties
; A1 K1 J1 T1 81 71 = A1 K1 J1 T1 81 61
deep=
(list (c 14 1) (c 13 1) (c 11 1) (c 10 1) (c 8 1) (c 7 1))
(list (c 14 1) (c 13 1) (c 11 1) (c 10 1) (c 8 1) (c 6 1))
; flush beats straight
; 71 61 51 41 21 > A1 K2 Q3 J4 T1
deep>
(list (c 7 1) (c 6 1) (c 5 1) (c 4 1) (c 2 1))
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1))
; A1 K2 Q3 J4 T1 81 71 61 = A1 T1 81 71 61
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1) (c 8 1) (c 7 1) (c 6 1))
(list (c 14 1) (c 10 1) (c 8 1) (c 7 1) (c 6 1))
; straight with higher kicker ties
; A1 K2 Q3 J4 T1 92 = A1 K2 Q3 J4 T1 22
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1) (c 9 2))
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1) (c 2 2))
; straights of different suits tie
; A1 K2 Q3 J4 T1 = A2 K3 Q4 J1 T2
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1))
(list (c 14 2) (c 13 3) (c 12 4) (c 11 1) (c 10 2))
; higher straight beats lower straight
; A1 K2 Q3 J4 T1 > 61 52 43 34 21
deep>
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1))
(list (c 6 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
; A1 K2 Q3 J4 T1 92 83 = A1 K2 Q3 J4 T1
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 10 1) (c 9 2) (c 8 3))
(list (c 14 2) (c 13 3) (c 12 4) (c 11 1) (c 10 2))
; lower (2-6) straight beats ace to four straight
; 61 52 43 34 21 > A1 52 43 34 21
deep>
(list (c 6 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
(list (c 14 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
; A1 62 53 44 31 22 = 62 53 44 31 22
deep=
(list (c 14 1) (c 6 2) (c 5 3) (c 4 4) (c 3 1) (c 2 2))
(list (c 6 2) (c 5 3) (c 4 4) (c 3 1) (c 2 2))
; ace to four straight with higher kicker ties
; A1 52 43 34 21 K2 = A1 52 43 34 21 72
deep=
(list (c 14 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1) (c 13 2))
(list (c 14 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1) (c 7 2))
; ace to fours of different suits tie
; A1 52 43 34 21 = A2 53 44 31 22
deep=
(list (c 14 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
(list (c 14 2) (c 5 3) (c 4 4) (c 3 1) (c 2 2))
; ace to four straight beats set
; A1 52 43 34 21 > A1 A2 A3 K1 Q2
deep>
(list (c 14 1) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
(list (c 14 1) (c 14 2) (c 14 3) (c 13 1) (c 12 2))
; A1 A2 A3 52 43 34 21 = A1 52 43 34 21
deep=
(list (c 14 1) (c 14 2) (c 14 3) (c 5 2) (c 4 3) (c 3 4) (c 2 1))
(list (c 14 1) (c 5 2) (c 4 3) (c 3 2) (c 2 1))
; higher set wins
; 71 72 73 34 21 > 51 52 53 A4 K1
deep>
(list (c 7 1) (c 7 2) (c 7 3) (c 3 4) (c 2 1))
(list (c 5 1) (c 5 2) (c 5 3) (c 14 4) (c 13 1))
; set with higher first kicker wins
; 71 72 73 A1 22 > 71 72 73 K1 Q2
deep>
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 2 2))
(list (c 7 1) (c 7 2) (c 7 3) (c 13 1) (c 12 2))
; 71 72 73 A1 K2 J3 54 43 = 71 72 73 A1 K2
deep=
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 13 2) (c 11 3) (c 5 4) (c 4 3))
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 13 2))
; set with higher second kicker wins
; 71 72 73 A1 K2 > 71 72 73 A1 Q2
deep>
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 13 2))
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 12 2))
; set with higher third kicker ties
; 71 72 73 A1 K2 Q3 = 71 72 73 A1 K2 J3
deep=
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 13 2) (c 12 3))
(list (c 7 1) (c 7 2) (c 7 3) (c 14 1) (c 13 2) (c 11 3))
; set beats two pair
; 71 72 73 34 21 > A1 A2 K3 K4 Q1
deep>
(list (c 7 1) (c 7 2) (c 7 3) (c 3 4) (c 2 1))
(list (c 14 1) (c 14 2) (c 13 3) (c 13 4) (c 12 1))
; two pair with higher high pair wins
; K1 K2 33 34 21 > Q1 Q2 J3 J4 A1
deep>
(list (c 13 1) (c 13 2) (c 3 3) (c 3 4) (c 2 1))
(list (c 12 1) (c 12 2) (c 11 3) (c 11 4) (c 14 1))
; A1 A2 K1 K2 J1 J2 = A1 A2 K1 K2 J3
deep=
(list (c 14 1) (c 14 2) (c 13 1) (c 13 2) (c 11 1) (c 11 2))
(list (c 14 1) (c 14 2) (c 13 1) (c 13 2) (c 11 3))
; two pair with tied higher pair and higher lower pair wins
; K1 K2 71 72 23 > K1 K2 63 64 A1
deep>
(list (c 13 1) (c 13 2) (c 7 1) (c 7 2) (c 2 3))
(list (c 13 1) (c 13 2) (c 6 3) (c 6 4) (c 14 1))
; two pair with higher kicker wins
; K1 K2 Q3 Q4 J1 > K1 K2 Q3 Q4 T1
deep>
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 11 1))
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 10 1))
; K1 K2 Q3 Q4 A1 T1 92 63 = K1 K2 Q3 Q4 A1
deep=
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 14 1) (c 10 1) (c 9 2) (c 6 3))
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 14 1))
; two pair with higher second kicker ties
; K1 K2 Q3 Q4 J1 T2 = K1 K2 Q3 Q4 J1 92
deep=
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 11 1) (c 10 2))
(list (c 13 1) (c 13 2) (c 12 3) (c 12 4) (c 11 1) (c 9 2))
; two pair beats pair
; 41 42 33 34 21 > A1 A2 K3 Q4 J1
deep>
(list (c 4 1) (c 4 2) (c 3 3) (c 3 4) (c 2 1))
(list (c 14 1) (c 14 2) (c 13 3) (c 12 4) (c 11 1))
; higher pair wins
; 71 72 53 44 31 > 61 62 A3 K4 Q1
deep>
(list (c 7 1) (c 7 2) (c 5 3) (c 4 4) (c 3 1))
(list (c 6 1) (c 6 2) (c 14 3) (c 13 4) (c 12 1))
; tied pair with higher first kicker wins
; 91 92 A3 34 21 > 91 92 K3 Q4 J1
deep>
(list (c 9 1) (c 9 2) (c 14 3) (c 3 4) (c 2 1))
(list (c 9 1) (c 9 2) (c 13 3) (c 12 4) (c 11 1))
; 21 22 A1 Q2 J3 94 81 = 21 22 A1 Q2 J3
deep=
(list (c 2 1) (c 2 2) (c 14 1) (c 12 2) (c 11 3) (c 9 4) (c 8 1))
(list (c 2 1) (c 2 2) (c 14 1) (c 12 2) (c 11 3))
; tied pair with higher second kicker wins
; 91 92 A3 K4 21 > 91 92 A3 Q4 J1
deep>
(list (c 9 1) (c 9 2) (c 14 3) (c 13 4) (c 2 1))
(list (c 9 1) (c 9 2) (c 14 3) (c 12 4) (c 11 1))
; tied pair with higher third kicker wins
; 91 92 A3 K4 Q1 > 91 92 A3 K4 J1
deep>
(list (c 9 1) (c 9 2) (c 14 3) (c 13 4) (c 12 1))
(list (c 9 1) (c 9 2) (c 14 3) (c 13 4) (c 11 1))
; tied pair with higher fourth kicker ties
; 91 92 A3 K4 Q1 J2 = 91 92 A3 K4 Q1 T2
deep=
(list (c 9 1) (c 9 2) (c 14 3) (c 13 4) (c 12 1) (c 11 2))
(list (c 9 1) (c 9 2) (c 14 3) (c 13 4) (c 12 1) (c 10 2))
; pair beats high card
; 21 22 33 44 51 > A1 Q2 J3 T4 91
deep>
(list (c 2 1) (c 2 2) (c 3 3) (c 4 4) (c 5 1))
(list (c 14 1) (c 12 2) (c 11 3) (c 10 4) (c 9 1))
; higher high card wins
; A1 22 33 44 61 > K1 Q2 J3 T4 81
deep>
(list (c 14 1) (c 2 2) (c 3 3) (c 4 4) (c 6 1))
(list (c 13 1) (c 12 2) (c 11 3) (c 10 4) (c 8 1))
; A1 K2 J3 T4 81 72 53 = A1 K2 J3 T4 81
deep=
(list (c 14 1) (c 13 2) (c 11 3) (c 10 4) (c 8 1) (c 7 2) (c 5 3))
(list (c 14 1) (c 13 2) (c 11 3) (c 10 4) (c 8 1))
; higher second card wins
; A1 K2 23 34 41 > A1 Q2 J3 T4 91
deep>
(list (c 14 1) (c 13 2) (c 2 3) (c 3 4) (c 4 1))
(list (c 14 1) (c 12 2) (c 11 3) (c 10 4) (c 9 1))
; higher third card wins
; A1 K2 Q3 24 41 > A1 K2 J3 T4 91
deep>
(list (c 14 1) (c 13 2) (c 12 3) (c 2 4) (c 4 1))
(list (c 14 1) (c 13 2) (c 11 3) (c 10 4) (c 9 1))
; higher fourth card wins
; A1 K2 Q3 J4 31 > A1 K2 Q3 T4 91
deep>
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 3 1))
(list (c 14 1) (c 13 2) (c 12 3) (c 10 4) (c 9 1))
; higher fifth card wins
; A1 K2 Q3 J4 91 > A1 K2 Q3 J4 81
deep>
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 9 1))
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 8 1))
; higher sixth card ties
; A1 K2 Q3 J4 91 22 = A1 K2 Q3 J4 91 82
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 9 1) (c 2 2))
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 9 1) (c 8 2))
; high cards of different suits ties
; A1 K2 Q3 J4 91 = A2 K3 Q4 J1 92
deep=
(list (c 14 1) (c 13 2) (c 12 3) (c 11 4) (c 9 1))
(list (c 14 2) (c 13 3) (c 12 4) (c 11 1) (c 9 2))
)
)