Coverage for Card.py: 52%
113 statements
« prev ^ index » next coverage.py v7.6.3, created at 2024-10-15 19:33 +0000
« prev ^ index » next coverage.py v7.6.3, created at 2024-10-15 19:33 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
4# Copyright 2008-2011 Carl Gherardi
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Affero General Public License as published by
7# the Free Software Foundation, version 3 of the License.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU Affero General Public License
15# along with this program. If not, see <http://www.gnu.org/licenses/>.
16# In the "official" distribution you can find the license in agpl-3.0.txt.
17from __future__ import print_function
18from __future__ import division
20from past.utils import old_div
23# #import L10n
24# #_ = L10n.get_translation()
26card_map = {
27 "0": 0,
28 "2": 2,
29 "3": 3,
30 "4": 4,
31 "5": 5,
32 "6": 6,
33 "7": 7,
34 "8": 8,
35 "9": 9,
36 "T": 10,
37 "J": 11,
38 "Q": 12,
39 "K": 13,
40 "A": 14,
41}
43card_map_low = {
44 "0": 0,
45 "A": 1,
46 "2": 2,
47 "3": 3,
48 "4": 4,
49 "5": 5,
50 "6": 6,
51 "7": 7,
52 "8": 8,
53 "9": 9,
54 "T": 10,
55 "J": 11,
56 "Q": 12,
57 "K": 13,
58}
60card_map_abbr = [
61 ["AA", "AKs", "AQs", "AJs", "ATs", "A9s", "A8s", "A7s", "A6s", "A5s", "A4s", "A3s", "A2s"],
62 ["AKo", "KK", "KQs", "KJs", "KTs", "K9s", "K8s", "K7s", "K6s", "K5s", "K4s", "K3s", "K2s"],
63 ["AQo", "KQo", "QQ", "QJs", "QTs", "Q9s", "Q8s", "Q7s", "Q6s", "Q5s", "Q4s", "Q3s", "Q2s"],
64 ["AJo", "KJo", "QJo", "JJ", "JTs", "J9s", "J8s", "J7s", "J6s", "J5s", "J4s", "J3s", "J2s"],
65 ["ATo", "KTo", "QTo", "JTo", "TT", "T9s", "T8s", "T7s", "T6s", "T5s", "T4s", "T3s", "T2s"],
66 ["A9o", "K9o", "Q9o", "J9o", "T9o", "99", "98s", "97s", "96s", "95s", "94s", "93s", "92s"],
67 ["A8o", "K8o", "Q8o", "J8o", "T8o", "98o", "88", "87s", "86s", "85s", "84s", "83s", "82s"],
68 ["A7o", "K7o", "Q7o", "J7o", "T7o", "97o", "87o", "77", "76s", "75s", "74s", "73s", "72s"],
69 ["A6o", "K6o", "Q6o", "J6o", "T6o", "96o", "86o", "76o", "66", "65s", "64s", "63s", "62s"],
70 ["A5o", "K5o", "Q5o", "J5o", "T5o", "95o", "85o", "75o", "65o", "55", "54s", "53s", "52s"],
71 ["A4o", "K4o", "Q4o", "J4o", "T4o", "94o", "84o", "74o", "64o", "54o", "44", "43s", "42s"],
72 ["A3o", "K3o", "Q3o", "J3o", "T3o", "93o", "83o", "73o", "63o", "53o", "43o", "33", "32s"],
73 ["A2o", "K2o", "Q2o", "J2o", "T2o", "92o", "82o", "72o", "62o", "52o", "42o", "32o", "22"],
74]
76games = { # base, category
77 "holdem": ("hold", "holdem", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 2)]),
78 "2_holdem": ("hold", None, "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 3)]),
79 "6_holdem": ("hold", None, "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 2)]),
80 "omahahi": ("hold", "omaha", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 4)]),
81 "fusion": ("hold", "fusion", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 4)]),
82 "omahahilo": ("hold", "omaha8", "s", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 4)]),
83 "irish": ("hold", None, "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 4)]),
84 "5_omahahi": ("hold", "omaha", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 5)]),
85 "6_omahahi": ("hold", "omaha", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 6)]),
86 "5_omaha8": ("hold", "omaha8", "s", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 5)]),
87 "6_omaha8": ("hold", "omaha8", "s", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 6)]),
88 "cour_hi": ("hold", "omaha", "h", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 5)]),
89 "cour_hilo": ("hold", "omaha8", "s", {"PREFLOP": 0, "FLOP": 1, "TURN": 2, "RIVER": 3}, "RIVER", [(0, 5)]),
90 "aof_omaha": ("hold", "omaha", "h", {"FLOP": 0, "TURN": 1, "RIVER": 2}, "RIVER", [(0, 4)]),
91 "5_studhi": (
92 "stud",
93 "holdem",
94 "h",
95 {"SECOND": 0, "THIRD": 1, "FOURTH": 2, "FIFTH": 3},
96 "FIFTH",
97 [(0, 2), (0, 3), (0, 4), (0, 5)],
98 ),
99 "razz": (
100 "stud",
101 None,
102 "l",
103 {"THIRD": 0, "FOURTH": 1, "FIFTH": 2, "SIXTH": 3, "SEVENTH": 4},
104 "SEVENTH",
105 [(0, 3), (0, 4), (0, 5), (0, 6), (0, 7)],
106 ),
107 "studhi": (
108 "stud",
109 "7stud",
110 "h",
111 {"THIRD": 0, "FOURTH": 1, "FIFTH": 2, "SIXTH": 3, "SEVENTH": 4},
112 "SEVENTH",
113 [(0, 3), (0, 4), (0, 5), (0, 6), (0, 7)],
114 ),
115 "studhilo": (
116 "stud",
117 "7stud8",
118 "s",
119 {"THIRD": 0, "FOURTH": 1, "FIFTH": 2, "SIXTH": 3, "SEVENTH": 4},
120 "SEVENTH",
121 [(0, 3), (0, 4), (0, 5), (0, 6), (0, 7)],
122 ),
123 "27_3draw": (
124 "draw",
125 "lowball27",
126 "r",
127 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
128 "DRAWTHREE",
129 [(0, 5), (5, 10), (10, 15), (15, 20)],
130 ),
131 "fivedraw": ("draw", "holdem", "h", {"DEAL": 0, "DRAWONE": 1}, "DRAWONE", [(0, 5), (5, 10)]),
132 "badugi": (
133 "draw",
134 None,
135 "l",
136 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
137 "DRAWTHREE",
138 [(0, 4), (5, 9), (10, 14), (15, 19)],
139 ),
140 "27_1draw": ("draw", "lowball27", "r", {"DEAL": 0, "DRAWONE": 1}, "DRAWONE", [(0, 5), (5, 10)]),
141 "a5_3draw": (
142 "draw",
143 "lowball",
144 "l",
145 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
146 "DRAWTHREE",
147 [(0, 5), (5, 10), (10, 15), (15, 20)],
148 ),
149 "a5_1draw": ("draw", "lowball", "l", {"DEAL": 0, "DRAWONE": 1}, "DRAWONE", [(0, 5), (5, 10)]),
150 "27_razz": (
151 "stud",
152 "lowball27",
153 "l",
154 {"THIRD": 0, "FOURTH": 1, "FIFTH": 2, "SIXTH": 3, "SEVENTH": 4},
155 "SEVENTH",
156 [(0, 3), (0, 4), (0, 5), (0, 6), (0, 7)],
157 ),
158 "badacey": (
159 "draw",
160 None,
161 "s",
162 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
163 "DRAWTHREE",
164 [(0, 5), (5, 10), (10, 15), (15, 20)],
165 ),
166 "badeucey": (
167 "draw",
168 None,
169 "s",
170 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
171 "DRAWTHREE",
172 [(0, 5), (5, 10), (10, 15), (15, 20)],
173 ),
174 "drawmaha": (
175 "draw",
176 None,
177 "s",
178 {"DEAL": 0, "DRAWONE": 1, "DRAWTWO": 2, "DRAWTHREE": 3},
179 "DRAWTHREE",
180 [(0, 5), (5, 10), (10, 15), (15, 20)],
181 ),
182}
184hands = {
185 "Nothing": (1, None),
186 "NoPair": (2, "high card, %s"),
187 "OnePair": (3, "a pair of %s"),
188 "TwoPair": (4, "two pair, %s"),
189 "Trips": (5, "three of a kind, %s"),
190 "Straight": (6, "a straight, %s"),
191 "Flush": (7, "a flush, %s"),
192 "FlHouse": (8, "a full house, %s"),
193 "Quads": (9, "four of a kind, %s"),
194 "StFlush": (10, "a straight flush, %s"),
195}
197names = {
198 "A": ("Ace", "Aces", 14),
199 "K": ("King", "Kings", 13),
200 "Q": ("Queen", "Queens", 12),
201 "J": ("Jack", "Jacks", 11),
202 "T": ("Ten", "Tens", 10),
203 "9": ("Nine", "Nines", 9),
204 "8": ("Eight", "Eights", 8),
205 "7": ("Seven", "Sevens", 7),
206 "6": ("Six", "Sixes", 6),
207 "5": ("Five", "Fives", 5),
208 "4": ("Four", "Fours", 4),
209 "3": ("Three", "Threes", 3),
210 "2": ("Two", "Twos", 2),
211}
213iter = {0: 50000, 1: 0, 2: 0, 3: 0}
216def decodeStartHandValue(game, value):
217 if game in ("holdem", "6_holdem"):
218 return twoStartCardString(value)
219 elif game in ("razz", "27_razz"):
220 return decodeRazzStartHand(value)
221 else:
222 return "xx"
225def calcStartCards(hand, player):
226 hcs = hand.join_holecards(player, asList=True)
227 if hand.gametype["category"] in ("holdem", "6_holdem"):
228 value1 = card_map.get(hcs[0][0])
229 value2 = card_map.get(hcs[1][0])
230 return twoStartCards(value1, hcs[0][1], value2, hcs[1][1])
231 elif hand.gametype["category"] in ("razz", "27_razz"):
232 idx = encodeRazzStartHand(hcs)
233 return idx + 184
234 else:
235 # FIXME: Only do startCards value for holdem at the moment
236 return 170
239# The following depends on the exact implementation of twoStartCards.
240_firstcard = "((hp.startcards - 1) / 13)"
241_secondcard = f"((hp.startcards - 1) - 13 * {_firstcard})"
242_gap = "(%s - %s = %d)"
244DATABASE_FILTERS = {
245 "pair": f"{_firstcard} = {_secondcard}",
246 "suited": f"{_firstcard} > {_secondcard}",
247 "offsuit": f"{_firstcard} < {_secondcard}",
248 "suited_connectors": _gap % (_firstcard, _secondcard, 1),
249 "offsuit_connectors": _gap % (_secondcard, _firstcard, 1),
250}
253def StartCardRank(idx):
254 rankList = [
255 ("22", 54, 12),
256 ("32o", 160, 24),
257 ("42o", 157, 24),
258 ("52o", 154, 24),
259 ("62o", 164, 24),
260 ("72o", 169, 24),
261 ("82o", 168, 24),
262 ("92o", 166, 24),
263 ("T2o", 161, 24),
264 ("J2o", 153, 24),
265 ("Q2o", 145, 24),
266 ("K2o", 134, 24),
267 ("A2o", 113, 24),
268 ("32s", 111, 8),
269 ("33", 53, 12),
270 ("43o", 146, 24),
271 ("53o", 140, 24),
272 ("63o", 151, 24),
273 ("73o", 162, 24),
274 ("83o", 167, 24),
275 ("93o", 165, 24),
276 ("T3o", 159, 24),
277 ("J3o", 152, 24),
278 ("Q3o", 144, 24),
279 ("K3o", 132, 24),
280 ("A3o", 105, 24),
281 ("42s", 103, 8),
282 ("43s", 87, 8),
283 ("44", 51, 12),
284 ("54o", 129, 24),
285 ("64o", 137, 24),
286 ("74o", 147, 24),
287 ("84o", 156, 24),
288 ("94o", 163, 24),
289 ("T4o", 158, 24),
290 ("J4o", 149, 24),
291 ("Q4o", 141, 24),
292 ("K4o", 131, 24),
293 ("A4o", 101, 24),
294 ("52s", 100, 8),
295 ("53s", 82, 8),
296 ("54s", 66, 8),
297 ("55", 48, 12),
298 ("65o", 125, 24),
299 ("75o", 133, 24),
300 ("85o", 142, 24),
301 ("95o", 150, 24),
302 ("T5o", 155, 24),
303 ("J5o", 148, 24),
304 ("Q5o", 138, 24),
305 ("K5o", 126, 24),
306 ("A5o", 93, 24),
307 ("62s", 116, 8),
308 ("63s", 91, 8),
309 ("64s", 76, 8),
310 ("65s", 64, 8),
311 ("66", 38, 12),
312 ("76o", 121, 24),
313 ("86o", 127, 24),
314 ("96o", 136, 24),
315 ("T6o", 139, 24),
316 ("J6o", 143, 24),
317 ("Q6o", 135, 24),
318 ("K6o", 123, 24),
319 ("A6o", 107, 24),
320 ("72s", 122, 8),
321 ("73s", 108, 8),
322 ("74s", 86, 8),
323 ("75s", 71, 8),
324 ("76s", 58, 8),
325 ("77", 29, 12),
326 ("87o", 114, 24),
327 ("97o", 119, 24),
328 ("T7o", 124, 24),
329 ("J7o", 128, 24),
330 ("Q7o", 130, 24),
331 ("K7o", 117, 24),
332 ("A7o", 94, 24),
333 ("82s", 120, 8),
334 ("83s", 118, 8),
335 ("84s", 99, 8),
336 ("85s", 81, 8),
337 ("86s", 63, 8),
338 ("87s", 49, 8),
339 ("88", 21, 12),
340 ("98o", 97, 24),
341 ("T8o", 95, 24),
342 ("J8o", 106, 24),
343 ("Q8o", 109, 24),
344 ("K8o", 104, 24),
345 ("A8o", 83, 24),
346 ("92s", 115, 8),
347 ("93s", 112, 8),
348 ("94s", 110, 8),
349 ("95s", 89, 8),
350 ("96s", 70, 8),
351 ("97s", 52, 8),
352 ("98s", 42, 8),
353 ("99", 16, 12),
354 ("T9o", 69, 24),
355 ("J9o", 74, 24),
356 ("Q9o", 78, 24),
357 ("K9o", 73, 24),
358 ("A9o", 67, 24),
359 ("T2s", 102, 8),
360 ("T3s", 98, 8),
361 ("T4s", 96, 8),
362 ("T5s", 92, 8),
363 ("T6s", 77, 8),
364 ("T7s", 56, 8),
365 ("T8s", 40, 8),
366 ("T9s", 23, 8),
367 ("TT", 9, 12),
368 ("JTo", 45, 24),
369 ("QTo", 46, 24),
370 ("KTo", 41, 24),
371 ("ATo", 36, 24),
372 ("J2s", 90, 8),
373 ("J3s", 88, 8),
374 ("J4s", 85, 8),
375 ("J5s", 84, 8),
376 ("J6s", 80, 8),
377 ("J7s", 61, 8),
378 ("J8s", 44, 8),
379 ("J9s", 26, 8),
380 ("JTs", 17, 8),
381 ("JJ", 5, 12),
382 ("QJo", 32, 24),
383 ("KJo", 28, 24),
384 ("AJo", 24, 24),
385 ("Q2s", 79, 8),
386 ("Q3s", 75, 8),
387 ("Q4s", 72, 8),
388 ("Q5s", 68, 8),
389 ("Q6s", 65, 8),
390 ("Q7s", 59, 8),
391 ("Q8s", 43, 8),
392 ("Q9s", 27, 8),
393 ("QTs", 15, 8),
394 ("QJs", 13, 8),
395 ("QQ", 3, 12),
396 ("KQo", 19, 24),
397 ("AQo", 18, 24),
398 ("K2s", 62, 8),
399 ("K3s", 60, 8),
400 ("K4s", 57, 8),
401 ("K5s", 55, 8),
402 ("K6s", 50, 8),
403 ("K7s", 47, 8),
404 ("K8s", 37, 8),
405 ("K9s", 22, 8),
406 ("KTs", 14, 8),
407 ("KJs", 11, 8),
408 ("KQs", 7, 8),
409 ("KK", 2, 12),
410 ("AKo", 10, 24),
411 ("A2s", 39, 8),
412 ("A3s", 34, 8),
413 ("A4s", 33, 8),
414 ("A5s", 30, 8),
415 ("A6s", 35, 8),
416 ("A7s", 31, 8),
417 ("A8s", 25, 8),
418 ("A9s", 20, 8),
419 ("ATs", 12, 8),
420 ("AJs", 8, 8),
421 ("AQs", 6, 8),
422 ("AKs", 4, 8),
423 ("AA", 1, 12),
424 ("xx", 170, 0),
425 ]
426 return rankList[idx]
429def twoStartCards(value1, suit1, value2, suit2):
430 """Function to convert 2 value,suit pairs into a Holdem style starting hand e.g. AQo
431 Incoming values should be ints 2-14 (2,3,...K,A), suits are 'd'/'h'/'c'/'s'
432 Hand is stored as an int 13 * x + y + 1 where (x+2) represents rank of 1st card and
433 (y+2) represents rank of second card (2=2 .. 14=Ace)
434 If x > y then pair is suited, if x < y then unsuited
435 Examples:
436 1 22
437 2 32o
438 3 42o
439 ...
440 14 32s
441 15 33
442 16 42o
443 ...
444 169 AA
445 170 Unknown / Illegal cards
446 """
447 if value1 is None or value1 < 2 or value1 > 14 or value2 is None or value2 < 2 or value2 > 14:
448 return 170
449 elif value1 == value2: # pairs
450 return (13 * (value2 - 2) + (value2 - 2)) + 1
451 elif suit1 == suit2:
452 return 13 * (value1 - 2) + (value2 - 2) + 1 if value1 > value2 else 13 * (value2 - 2) + (value1 - 2) + 1
453 elif value1 > value2:
454 return 13 * (value2 - 2) + (value1 - 2) + 1
455 else:
456 return 13 * (value1 - 2) + (value2 - 2) + 1
459def is_suited(cards):
460 # Check if all cards have the same suit
461 return all(card[1] == cards[0][1] for card in cards)
464def is_double_suited(cards):
465 # Check if there are exactly two unique suits
466 suits = {card[1] for card in cards}
467 return len(suits) == 2
470def is_rainbow(cards):
471 # Check if all cards have different suits
472 suits = {card[1] for card in cards}
473 return len(suits) == 4
476def fourStartCards(cards):
477 if len(cards) != 4:
478 return "Invalid input: You must provide exactly four cards."
480 if is_suited(cards):
481 return "Suited"
482 elif is_double_suited(cards):
483 return "Double Suited"
484 elif is_rainbow(cards):
485 return "Rainbow"
486 else:
487 return "Neither Suited nor Rainbow"
490def twoStartCardString(card):
491 """Function to convert an int representing 2 holdem hole cards (as created by twoStartCards)
492 into a string like AQo"""
493 ret = "xx"
494 if card > 0 and card < 170:
495 s = ("2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K", "A")
496 x = old_div((card - 1), 13)
497 y = (card - 1) - 13 * x
498 if x == y:
499 ret = s[x] + s[y]
500 elif x > y:
501 ret = s[x] + s[y] + "s"
502 else:
503 ret = s[y] + s[x] + "o"
504 print("twoStartCardString(", card, f") = {ret}")
505 return ret
508def cardFromValueSuit(value, suit):
509 """0=none, 1-13=2-Ah 14-26=2-Ad 27-39=2-Ac 40-52=2-As"""
510 if suit == "h":
511 return value - 1
512 elif suit == "d":
513 return value + 12
514 elif suit == "c":
515 return value + 25
516 elif suit == "s":
517 return value + 38
518 else:
519 return 0
522suitFromCardList = [
523 "",
524 "2h",
525 "3h",
526 "4h",
527 "5h",
528 "6h",
529 "7h",
530 "8h",
531 "9h",
532 "Th",
533 "Jh",
534 "Qh",
535 "Kh",
536 "Ah",
537 "2d",
538 "3d",
539 "4d",
540 "5d",
541 "6d",
542 "7d",
543 "8d",
544 "9d",
545 "Td",
546 "Jd",
547 "Qd",
548 "Kd",
549 "Ad",
550 "2c",
551 "3c",
552 "4c",
553 "5c",
554 "6c",
555 "7c",
556 "8c",
557 "9c",
558 "Tc",
559 "Jc",
560 "Qc",
561 "Kc",
562 "Ac",
563 "2s",
564 "3s",
565 "4s",
566 "5s",
567 "6s",
568 "7s",
569 "8s",
570 "9s",
571 "Ts",
572 "Js",
573 "Qs",
574 "Ks",
575 "As",
576]
579def valueSuitFromCard(card):
580 """Function to convert a card stored in the database (int 0-52) into value
581 and suit like 9s, 4c etc"""
582 global suitFromCardList
583 return "" if card < 0 or card > 52 or not card else suitFromCardList[card]
586encodeCardList = {
587 "2h": 1,
588 "3h": 2,
589 "4h": 3,
590 "5h": 4,
591 "6h": 5,
592 "7h": 6,
593 "8h": 7,
594 "9h": 8,
595 "Th": 9,
596 "Jh": 10,
597 "Qh": 11,
598 "Kh": 12,
599 "Ah": 13,
600 "2d": 14,
601 "3d": 15,
602 "4d": 16,
603 "5d": 17,
604 "6d": 18,
605 "7d": 19,
606 "8d": 20,
607 "9d": 21,
608 "Td": 22,
609 "Jd": 23,
610 "Qd": 24,
611 "Kd": 25,
612 "Ad": 26,
613 "2c": 27,
614 "3c": 28,
615 "4c": 29,
616 "5c": 30,
617 "6c": 31,
618 "7c": 32,
619 "8c": 33,
620 "9c": 34,
621 "Tc": 35,
622 "Jc": 36,
623 "Qc": 37,
624 "Kc": 38,
625 "Ac": 39,
626 "2s": 40,
627 "3s": 41,
628 "4s": 42,
629 "5s": 43,
630 "6s": 44,
631 "7s": 45,
632 "8s": 46,
633 "9s": 47,
634 "Ts": 48,
635 "Js": 49,
636 "Qs": 50,
637 "Ks": 51,
638 "As": 52,
639 " ": 0,
640}
643def encodeCard(cardString):
644 """Take a card string (Ah) and convert it to the db card code (1)."""
645 global encodeCardList
646 return encodeCardList.get(cardString, 0)
649def decodeRazzStartHand(idx):
650 decodeRazzList = {
651 -13: "(00)A",
652 -12: "(00)2",
653 -11: "(00)3",
654 -10: "(00)4",
655 -9: "(00)5",
656 -8: "(00)6",
657 -7: "(00)7",
658 -6: "(00)8",
659 -5: "(00)9",
660 -4: "(00)T",
661 -3: "(00)J",
662 -2: "(00)Q",
663 -1: "(00)K",
664 0: "xxx",
665 1: "(32)A",
666 2: "(3A)2",
667 3: "(2A)3",
668 4: "(42)A",
669 5: "(4A)2",
670 6: "(2A)4",
671 7: "(43)A",
672 8: "(4A)3",
673 9: "(3A)4",
674 10: "(43)2",
675 11: "(42)3",
676 12: "(32)4",
677 13: "(52)A",
678 14: "(5A)2",
679 15: "(2A)5",
680 16: "(53)A",
681 17: "(5A)3",
682 18: "(3A)5",
683 19: "(53)2",
684 20: "(52)3",
685 21: "(32)5",
686 22: "(54)A",
687 23: "(5A)4",
688 24: "(4A)5",
689 25: "(54)2",
690 26: "(52)4",
691 27: "(42)5",
692 28: "(54)3",
693 29: "(53)4",
694 30: "(43)5",
695 31: "(62)A",
696 32: "(6A)2",
697 33: "(2A)6",
698 34: "(63)A",
699 35: "(6A)3",
700 36: "(3A)6",
701 37: "(63)2",
702 38: "(62)3",
703 39: "(32)6",
704 40: "(64)A",
705 41: "(6A)4",
706 42: "(4A)6",
707 43: "(64)2",
708 44: "(62)4",
709 45: "(42)6",
710 46: "(64)3",
711 47: "(63)4",
712 48: "(43)6",
713 49: "(65)A",
714 50: "(6A)5",
715 51: "(5A)6",
716 52: "(65)2",
717 53: "(62)5",
718 54: "(52)6",
719 55: "(65)3",
720 56: "(63)5",
721 57: "(53)6",
722 58: "(65)4",
723 59: "(64)5",
724 60: "(54)6",
725 61: "(72)A",
726 62: "(7A)2",
727 63: "(2A)7",
728 64: "(73)A",
729 65: "(7A)3",
730 66: "(3A)7",
731 67: "(73)2",
732 68: "(72)3",
733 69: "(32)7",
734 70: "(74)A",
735 71: "(7A)4",
736 72: "(4A)7",
737 73: "(74)2",
738 74: "(72)4",
739 75: "(42)7",
740 76: "(74)3",
741 77: "(73)4",
742 78: "(43)7",
743 79: "(75)A",
744 80: "(7A)5",
745 81: "(5A)7",
746 82: "(75)2",
747 83: "(72)5",
748 84: "(52)7",
749 85: "(75)3",
750 86: "(73)5",
751 87: "(53)7",
752 88: "(75)4",
753 89: "(74)5",
754 90: "(54)7",
755 91: "(76)A",
756 92: "(7A)6",
757 93: "(6A)7",
758 94: "(76)2",
759 95: "(72)6",
760 96: "(62)7",
761 97: "(76)3",
762 98: "(73)6",
763 99: "(63)7",
764 100: "(76)4",
765 101: "(74)6",
766 102: "(64)7",
767 103: "(76)5",
768 104: "(75)6",
769 105: "(65)7",
770 106: "(82)A",
771 107: "(8A)2",
772 108: "(2A)8",
773 109: "(83)A",
774 110: "(8A)3",
775 111: "(3A)8",
776 112: "(83)2",
777 113: "(82)3",
778 114: "(32)8",
779 115: "(84)A",
780 116: "(8A)4",
781 117: "(4A)8",
782 118: "(84)2",
783 119: "(82)4",
784 120: "(42)8",
785 121: "(84)3",
786 122: "(83)4",
787 123: "(43)8",
788 124: "(85)A",
789 125: "(8A)5",
790 126: "(5A)8",
791 127: "(85)2",
792 128: "(82)5",
793 129: "(52)8",
794 130: "(85)3",
795 131: "(83)5",
796 132: "(53)8",
797 133: "(85)4",
798 134: "(84)5",
799 135: "(54)8",
800 136: "(86)A",
801 137: "(8A)6",
802 138: "(6A)8",
803 139: "(86)2",
804 140: "(82)6",
805 141: "(62)8",
806 142: "(86)3",
807 143: "(83)6",
808 144: "(63)8",
809 145: "(86)4",
810 146: "(84)6",
811 147: "(64)8",
812 148: "(86)5",
813 149: "(85)6",
814 150: "(65)8",
815 151: "(87)A",
816 152: "(8A)7",
817 153: "(7A)8",
818 154: "(87)2",
819 155: "(82)7",
820 156: "(72)8",
821 157: "(87)3",
822 158: "(83)7",
823 159: "(73)8",
824 160: "(87)4",
825 161: "(84)7",
826 162: "(74)8",
827 163: "(87)5",
828 164: "(85)7",
829 165: "(75)8",
830 166: "(87)6",
831 167: "(86)7",
832 168: "(76)8",
833 169: "(92)A",
834 170: "(9A)2",
835 171: "(2A)9",
836 172: "(93)A",
837 173: "(9A)3",
838 174: "(3A)9",
839 175: "(93)2",
840 176: "(92)3",
841 177: "(32)9",
842 178: "(94)A",
843 179: "(9A)4",
844 180: "(4A)9",
845 181: "(94)2",
846 182: "(92)4",
847 183: "(42)9",
848 184: "(94)3",
849 185: "(93)4",
850 186: "(43)9",
851 187: "(95)A",
852 188: "(9A)5",
853 189: "(5A)9",
854 190: "(95)2",
855 191: "(92)5",
856 192: "(52)9",
857 193: "(95)3",
858 194: "(93)5",
859 195: "(53)9",
860 196: "(95)4",
861 197: "(94)5",
862 198: "(54)9",
863 199: "(96)A",
864 200: "(9A)6",
865 201: "(6A)9",
866 202: "(96)2",
867 203: "(92)6",
868 204: "(62)9",
869 205: "(96)3",
870 206: "(93)6",
871 207: "(63)9",
872 208: "(96)4",
873 209: "(94)6",
874 210: "(64)9",
875 211: "(96)5",
876 212: "(95)6",
877 213: "(65)9",
878 214: "(97)A",
879 215: "(9A)7",
880 216: "(7A)9",
881 217: "(97)2",
882 218: "(92)7",
883 219: "(72)9",
884 220: "(97)3",
885 221: "(93)7",
886 222: "(73)9",
887 223: "(97)4",
888 224: "(94)7",
889 225: "(74)9",
890 226: "(97)5",
891 227: "(95)7",
892 228: "(75)9",
893 229: "(97)6",
894 230: "(96)7",
895 231: "(76)9",
896 232: "(98)A",
897 233: "(9A)8",
898 234: "(8A)9",
899 235: "(98)2",
900 236: "(92)8",
901 237: "(82)9",
902 238: "(98)3",
903 239: "(93)8",
904 240: "(83)9",
905 241: "(98)4",
906 242: "(94)8",
907 243: "(84)9",
908 244: "(98)5",
909 245: "(95)8",
910 246: "(85)9",
911 247: "(98)6",
912 248: "(96)8",
913 249: "(86)9",
914 250: "(98)7",
915 251: "(97)8",
916 252: "(87)9",
917 253: "(T2)A",
918 254: "(TA)2",
919 255: "(2A)T",
920 256: "(T3)A",
921 257: "(TA)3",
922 258: "(3A)T",
923 259: "(T3)2",
924 260: "(T2)3",
925 261: "(32)T",
926 262: "(T4)A",
927 263: "(TA)4",
928 264: "(4A)T",
929 265: "(T4)2",
930 266: "(T2)4",
931 267: "(42)T",
932 268: "(T4)3",
933 269: "(T3)4",
934 270: "(43)T",
935 271: "(T5)A",
936 272: "(TA)5",
937 273: "(5A)T",
938 274: "(T5)2",
939 275: "(T2)5",
940 276: "(52)T",
941 277: "(T5)3",
942 278: "(T3)5",
943 279: "(53)T",
944 280: "(T5)4",
945 281: "(T4)5",
946 282: "(54)T",
947 283: "(T6)A",
948 284: "(TA)6",
949 285: "(6A)T",
950 286: "(T6)2",
951 287: "(T2)6",
952 288: "(62)T",
953 289: "(T6)3",
954 290: "(T3)6",
955 291: "(63)T",
956 292: "(T6)4",
957 293: "(T4)6",
958 294: "(64)T",
959 295: "(T6)5",
960 296: "(T5)6",
961 297: "(65)T",
962 298: "(T7)A",
963 299: "(TA)7",
964 300: "(7A)T",
965 301: "(T7)2",
966 302: "(T2)7",
967 303: "(72)T",
968 304: "(T7)3",
969 305: "(T3)7",
970 306: "(73)T",
971 307: "(T7)4",
972 308: "(T4)7",
973 309: "(74)T",
974 310: "(T7)5",
975 311: "(T5)7",
976 312: "(75)T",
977 313: "(T7)6",
978 314: "(T6)7",
979 315: "(76)T",
980 316: "(T8)A",
981 317: "(TA)8",
982 318: "(8A)T",
983 319: "(T8)2",
984 320: "(T2)8",
985 321: "(82)T",
986 322: "(T8)3",
987 323: "(T3)8",
988 324: "(83)T",
989 325: "(T8)4",
990 326: "(T4)8",
991 327: "(84)T",
992 328: "(T8)5",
993 329: "(T5)8",
994 330: "(85)T",
995 331: "(T8)6",
996 332: "(T6)8",
997 333: "(86)T",
998 334: "(T8)7",
999 335: "(T7)8",
1000 336: "(87)T",
1001 337: "(T9)A",
1002 338: "(TA)9",
1003 339: "(9A)T",
1004 340: "(T9)2",
1005 341: "(T2)9",
1006 342: "(92)T",
1007 343: "(T9)3",
1008 344: "(T3)9",
1009 345: "(93)T",
1010 346: "(T9)4",
1011 347: "(T4)9",
1012 348: "(94)T",
1013 349: "(T9)5",
1014 350: "(T5)9",
1015 351: "(95)T",
1016 352: "(T9)6",
1017 353: "(T6)9",
1018 354: "(96)T",
1019 355: "(T9)7",
1020 356: "(T7)9",
1021 357: "(97)T",
1022 358: "(T9)8",
1023 359: "(T8)9",
1024 360: "(98)T",
1025 361: "(J2)A",
1026 362: "(JA)2",
1027 363: "(2A)J",
1028 364: "(J3)A",
1029 365: "(JA)3",
1030 366: "(3A)J",
1031 367: "(J3)2",
1032 368: "(J2)3",
1033 369: "(32)J",
1034 370: "(J4)A",
1035 371: "(JA)4",
1036 372: "(4A)J",
1037 373: "(J4)2",
1038 374: "(J2)4",
1039 375: "(42)J",
1040 376: "(J4)3",
1041 377: "(J3)4",
1042 378: "(43)J",
1043 379: "(J5)A",
1044 380: "(JA)5",
1045 381: "(5A)J",
1046 382: "(J5)2",
1047 383: "(J2)5",
1048 384: "(52)J",
1049 385: "(J5)3",
1050 386: "(J3)5",
1051 387: "(53)J",
1052 388: "(J5)4",
1053 389: "(J4)5",
1054 390: "(54)J",
1055 391: "(J6)A",
1056 392: "(JA)6",
1057 393: "(6A)J",
1058 394: "(J6)2",
1059 395: "(J2)6",
1060 396: "(62)J",
1061 397: "(J6)3",
1062 398: "(J3)6",
1063 399: "(63)J",
1064 400: "(J6)4",
1065 401: "(J4)6",
1066 402: "(64)J",
1067 403: "(J6)5",
1068 404: "(J5)6",
1069 405: "(65)J",
1070 406: "(J7)A",
1071 407: "(JA)7",
1072 408: "(7A)J",
1073 409: "(J7)2",
1074 410: "(J2)7",
1075 411: "(72)J",
1076 412: "(J7)3",
1077 413: "(J3)7",
1078 414: "(73)J",
1079 415: "(J7)4",
1080 416: "(J4)7",
1081 417: "(74)J",
1082 418: "(J7)5",
1083 419: "(J5)7",
1084 420: "(75)J",
1085 421: "(J7)6",
1086 422: "(J6)7",
1087 423: "(76)J",
1088 424: "(J8)A",
1089 425: "(JA)8",
1090 426: "(8A)J",
1091 427: "(J8)2",
1092 428: "(J2)8",
1093 429: "(82)J",
1094 430: "(J8)3",
1095 431: "(J3)8",
1096 432: "(83)J",
1097 433: "(J8)4",
1098 434: "(J4)8",
1099 435: "(84)J",
1100 436: "(J8)5",
1101 437: "(J5)8",
1102 438: "(85)J",
1103 439: "(J8)6",
1104 440: "(J6)8",
1105 441: "(86)J",
1106 442: "(J8)7",
1107 443: "(J7)8",
1108 444: "(87)J",
1109 445: "(J9)A",
1110 446: "(JA)9",
1111 447: "(9A)J",
1112 448: "(J9)2",
1113 449: "(J2)9",
1114 450: "(92)J",
1115 451: "(J9)3",
1116 452: "(J3)9",
1117 453: "(93)J",
1118 454: "(J9)4",
1119 455: "(J4)9",
1120 456: "(94)J",
1121 457: "(J9)5",
1122 458: "(J5)9",
1123 459: "(95)J",
1124 460: "(J9)6",
1125 461: "(J6)9",
1126 462: "(96)J",
1127 463: "(J9)7",
1128 464: "(J7)9",
1129 465: "(97)J",
1130 466: "(J9)8",
1131 467: "(J8)9",
1132 468: "(98)J",
1133 469: "(JT)A",
1134 470: "(JA)T",
1135 471: "(TA)J",
1136 472: "(JT)2",
1137 473: "(J2)T",
1138 474: "(T2)J",
1139 475: "(JT)3",
1140 476: "(J3)T",
1141 477: "(T3)J",
1142 478: "(JT)4",
1143 479: "(J4)T",
1144 480: "(T4)J",
1145 481: "(JT)5",
1146 482: "(J5)T",
1147 483: "(T5)J",
1148 484: "(JT)6",
1149 485: "(J6)T",
1150 486: "(T6)J",
1151 487: "(JT)7",
1152 488: "(J7)T",
1153 489: "(T7)J",
1154 490: "(JT)8",
1155 491: "(J8)T",
1156 492: "(T8)J",
1157 493: "(JT)9",
1158 494: "(J9)T",
1159 495: "(T9)J",
1160 496: "(Q2)A",
1161 497: "(QA)2",
1162 498: "(2A)Q",
1163 499: "(Q3)A",
1164 500: "(QA)3",
1165 501: "(3A)Q",
1166 502: "(Q3)2",
1167 503: "(Q2)3",
1168 504: "(32)Q",
1169 505: "(Q4)A",
1170 506: "(QA)4",
1171 507: "(4A)Q",
1172 508: "(Q4)2",
1173 509: "(Q2)4",
1174 510: "(42)Q",
1175 511: "(Q4)3",
1176 512: "(Q3)4",
1177 513: "(43)Q",
1178 514: "(Q5)A",
1179 515: "(QA)5",
1180 516: "(5A)Q",
1181 517: "(Q5)2",
1182 518: "(Q2)5",
1183 519: "(52)Q",
1184 520: "(Q5)3",
1185 521: "(Q3)5",
1186 522: "(53)Q",
1187 523: "(Q5)4",
1188 524: "(Q4)5",
1189 525: "(54)Q",
1190 526: "(Q6)A",
1191 527: "(QA)6",
1192 528: "(6A)Q",
1193 529: "(Q6)2",
1194 530: "(Q2)6",
1195 531: "(62)Q",
1196 532: "(Q6)3",
1197 533: "(Q3)6",
1198 534: "(63)Q",
1199 535: "(Q6)4",
1200 536: "(Q4)6",
1201 537: "(64)Q",
1202 538: "(Q6)5",
1203 539: "(Q5)6",
1204 540: "(65)Q",
1205 541: "(Q7)A",
1206 542: "(QA)7",
1207 543: "(7A)Q",
1208 544: "(Q7)2",
1209 545: "(Q2)7",
1210 546: "(72)Q",
1211 547: "(Q7)3",
1212 548: "(Q3)7",
1213 549: "(73)Q",
1214 550: "(Q7)4",
1215 551: "(Q4)7",
1216 552: "(74)Q",
1217 553: "(Q7)5",
1218 554: "(Q5)7",
1219 555: "(75)Q",
1220 556: "(Q7)6",
1221 557: "(Q6)7",
1222 558: "(76)Q",
1223 559: "(Q8)A",
1224 560: "(QA)8",
1225 561: "(8A)Q",
1226 562: "(Q8)2",
1227 563: "(Q2)8",
1228 564: "(82)Q",
1229 565: "(Q8)3",
1230 566: "(Q3)8",
1231 567: "(83)Q",
1232 568: "(Q8)4",
1233 569: "(Q4)8",
1234 570: "(84)Q",
1235 571: "(Q8)5",
1236 572: "(Q5)8",
1237 573: "(85)Q",
1238 574: "(Q8)6",
1239 575: "(Q6)8",
1240 576: "(86)Q",
1241 577: "(Q8)7",
1242 578: "(Q7)8",
1243 579: "(87)Q",
1244 580: "(Q9)A",
1245 581: "(QA)9",
1246 582: "(9A)Q",
1247 583: "(Q9)2",
1248 584: "(Q2)9",
1249 585: "(92)Q",
1250 586: "(Q9)3",
1251 587: "(Q3)9",
1252 588: "(93)Q",
1253 589: "(Q9)4",
1254 590: "(Q4)9",
1255 591: "(94)Q",
1256 592: "(Q9)5",
1257 593: "(Q5)9",
1258 594: "(95)Q",
1259 595: "(Q9)6",
1260 596: "(Q6)9",
1261 597: "(96)Q",
1262 598: "(Q9)7",
1263 599: "(Q7)9",
1264 600: "(97)Q",
1265 601: "(Q9)8",
1266 602: "(Q8)9",
1267 603: "(98)Q",
1268 604: "(QT)A",
1269 605: "(QA)T",
1270 606: "(TA)Q",
1271 607: "(QT)2",
1272 608: "(Q2)T",
1273 609: "(T2)Q",
1274 610: "(QT)3",
1275 611: "(Q3)T",
1276 612: "(T3)Q",
1277 613: "(QT)4",
1278 614: "(Q4)T",
1279 615: "(T4)Q",
1280 616: "(QT)5",
1281 617: "(Q5)T",
1282 618: "(T5)Q",
1283 619: "(QT)6",
1284 620: "(Q6)T",
1285 621: "(T6)Q",
1286 622: "(QT)7",
1287 623: "(Q7)T",
1288 624: "(T7)Q",
1289 625: "(QT)8",
1290 626: "(Q8)T",
1291 627: "(T8)Q",
1292 628: "(QT)9",
1293 629: "(Q9)T",
1294 630: "(T9)Q",
1295 631: "(QJ)A",
1296 632: "(QA)J",
1297 633: "(JA)Q",
1298 634: "(QJ)2",
1299 635: "(Q2)J",
1300 636: "(J2)Q",
1301 637: "(QJ)3",
1302 638: "(Q3)J",
1303 639: "(J3)Q",
1304 640: "(QJ)4",
1305 641: "(Q4)J",
1306 642: "(J4)Q",
1307 643: "(QJ)5",
1308 644: "(Q5)J",
1309 645: "(J5)Q",
1310 646: "(QJ)6",
1311 647: "(Q6)J",
1312 648: "(J6)Q",
1313 649: "(QJ)7",
1314 650: "(Q7)J",
1315 651: "(J7)Q",
1316 652: "(QJ)8",
1317 653: "(Q8)J",
1318 654: "(J8)Q",
1319 655: "(QJ)9",
1320 656: "(Q9)J",
1321 657: "(J9)Q",
1322 658: "(QJ)T",
1323 659: "(QT)J",
1324 660: "(JT)Q",
1325 661: "(K2)A",
1326 662: "(KA)2",
1327 663: "(2A)K",
1328 664: "(K3)A",
1329 665: "(KA)3",
1330 666: "(3A)K",
1331 667: "(K3)2",
1332 668: "(K2)3",
1333 669: "(32)K",
1334 670: "(K4)A",
1335 671: "(KA)4",
1336 672: "(4A)K",
1337 673: "(K4)2",
1338 674: "(K2)4",
1339 675: "(42)K",
1340 676: "(K4)3",
1341 677: "(K3)4",
1342 678: "(43)K",
1343 679: "(K5)A",
1344 680: "(KA)5",
1345 681: "(5A)K",
1346 682: "(K5)2",
1347 683: "(K2)5",
1348 684: "(52)K",
1349 685: "(K5)3",
1350 686: "(K3)5",
1351 687: "(53)K",
1352 688: "(K5)4",
1353 689: "(K4)5",
1354 690: "(54)K",
1355 691: "(K6)A",
1356 692: "(KA)6",
1357 693: "(6A)K",
1358 694: "(K6)2",
1359 695: "(K2)6",
1360 696: "(62)K",
1361 697: "(K6)3",
1362 698: "(K3)6",
1363 699: "(63)K",
1364 700: "(K6)4",
1365 701: "(K4)6",
1366 702: "(64)K",
1367 703: "(K6)5",
1368 704: "(K5)6",
1369 705: "(65)K",
1370 706: "(K7)A",
1371 707: "(KA)7",
1372 708: "(7A)K",
1373 709: "(K7)2",
1374 710: "(K2)7",
1375 711: "(72)K",
1376 712: "(K7)3",
1377 713: "(K3)7",
1378 714: "(73)K",
1379 715: "(K7)4",
1380 716: "(K4)7",
1381 717: "(74)K",
1382 718: "(K7)5",
1383 719: "(K5)7",
1384 720: "(75)K",
1385 721: "(K7)6",
1386 722: "(K6)7",
1387 723: "(76)K",
1388 724: "(K8)A",
1389 725: "(KA)8",
1390 726: "(8A)K",
1391 727: "(K8)2",
1392 728: "(K2)8",
1393 729: "(82)K",
1394 730: "(K8)3",
1395 731: "(K3)8",
1396 732: "(83)K",
1397 733: "(K8)4",
1398 734: "(K4)8",
1399 735: "(84)K",
1400 736: "(K8)5",
1401 737: "(K5)8",
1402 738: "(85)K",
1403 739: "(K8)6",
1404 740: "(K6)8",
1405 741: "(86)K",
1406 742: "(K8)7",
1407 743: "(K7)8",
1408 744: "(87)K",
1409 745: "(K9)A",
1410 746: "(KA)9",
1411 747: "(9A)K",
1412 748: "(K9)2",
1413 749: "(K2)9",
1414 750: "(92)K",
1415 751: "(K9)3",
1416 752: "(K3)9",
1417 753: "(93)K",
1418 754: "(K9)4",
1419 755: "(K4)9",
1420 756: "(94)K",
1421 757: "(K9)5",
1422 758: "(K5)9",
1423 759: "(95)K",
1424 760: "(K9)6",
1425 761: "(K6)9",
1426 762: "(96)K",
1427 763: "(K9)7",
1428 764: "(K7)9",
1429 765: "(97)K",
1430 766: "(K9)8",
1431 767: "(K8)9",
1432 768: "(98)K",
1433 769: "(KT)A",
1434 770: "(KA)T",
1435 771: "(TA)K",
1436 772: "(KT)2",
1437 773: "(K2)T",
1438 774: "(T2)K",
1439 775: "(KT)3",
1440 776: "(K3)T",
1441 777: "(T3)K",
1442 778: "(KT)4",
1443 779: "(K4)T",
1444 780: "(T4)K",
1445 781: "(KT)5",
1446 782: "(K5)T",
1447 783: "(T5)K",
1448 784: "(KT)6",
1449 785: "(K6)T",
1450 786: "(T6)K",
1451 787: "(KT)7",
1452 788: "(K7)T",
1453 789: "(T7)K",
1454 790: "(KT)8",
1455 791: "(K8)T",
1456 792: "(T8)K",
1457 793: "(KT)9",
1458 794: "(K9)T",
1459 795: "(T9)K",
1460 796: "(KJ)A",
1461 797: "(KA)J",
1462 798: "(JA)K",
1463 799: "(KJ)2",
1464 800: "(K2)J",
1465 801: "(J2)K",
1466 802: "(KJ)3",
1467 803: "(K3)J",
1468 804: "(J3)K",
1469 805: "(KJ)4",
1470 806: "(K4)J",
1471 807: "(J4)K",
1472 808: "(KJ)5",
1473 809: "(K5)J",
1474 810: "(J5)K",
1475 811: "(KJ)6",
1476 812: "(K6)J",
1477 813: "(J6)K",
1478 814: "(KJ)7",
1479 815: "(K7)J",
1480 816: "(J7)K",
1481 817: "(KJ)8",
1482 818: "(K8)J",
1483 819: "(J8)K",
1484 820: "(KJ)9",
1485 821: "(K9)J",
1486 822: "(J9)K",
1487 823: "(KJ)T",
1488 824: "(KT)J",
1489 825: "(JT)K",
1490 826: "(KQ)A",
1491 827: "(KA)Q",
1492 828: "(QA)K",
1493 829: "(KQ)2",
1494 830: "(K2)Q",
1495 831: "(Q2)K",
1496 832: "(KQ)3",
1497 833: "(K3)Q",
1498 834: "(Q3)K",
1499 835: "(KQ)4",
1500 836: "(K4)Q",
1501 837: "(Q4)K",
1502 838: "(KQ)5",
1503 839: "(K5)Q",
1504 840: "(Q5)K",
1505 841: "(KQ)6",
1506 842: "(K6)Q",
1507 843: "(Q6)K",
1508 844: "(KQ)7",
1509 845: "(K7)Q",
1510 846: "(Q7)K",
1511 847: "(KQ)8",
1512 848: "(K8)Q",
1513 849: "(Q8)K",
1514 850: "(KQ)9",
1515 851: "(K9)Q",
1516 852: "(Q9)K",
1517 853: "(KQ)T",
1518 854: "(KT)Q",
1519 855: "(QT)K",
1520 856: "(KQ)J",
1521 857: "(KJ)Q",
1522 858: "(QJ)K",
1523 859: "(2A)A",
1524 860: "(22)A",
1525 861: "(AA)2",
1526 862: "(2A)2",
1527 863: "(3A)A",
1528 864: "(33)A",
1529 865: "(AA)3",
1530 866: "(3A)3",
1531 867: "(32)2",
1532 868: "(33)2",
1533 869: "(22)3",
1534 870: "(32)3",
1535 871: "(4A)A",
1536 872: "(44)A",
1537 873: "(AA)4",
1538 874: "(4A)4",
1539 875: "(42)2",
1540 876: "(44)2",
1541 877: "(22)4",
1542 878: "(42)4",
1543 879: "(43)3",
1544 880: "(44)3",
1545 881: "(33)4",
1546 882: "(43)4",
1547 883: "(5A)A",
1548 884: "(55)A",
1549 885: "(AA)5",
1550 886: "(5A)5",
1551 887: "(52)2",
1552 888: "(55)2",
1553 889: "(22)5",
1554 890: "(52)5",
1555 891: "(53)3",
1556 892: "(55)3",
1557 893: "(33)5",
1558 894: "(53)5",
1559 895: "(54)4",
1560 896: "(55)4",
1561 897: "(44)5",
1562 898: "(54)5",
1563 899: "(6A)A",
1564 900: "(66)A",
1565 901: "(AA)6",
1566 902: "(6A)6",
1567 903: "(62)2",
1568 904: "(66)2",
1569 905: "(22)6",
1570 906: "(62)6",
1571 907: "(63)3",
1572 908: "(66)3",
1573 909: "(33)6",
1574 910: "(63)6",
1575 911: "(64)4",
1576 912: "(66)4",
1577 913: "(44)6",
1578 914: "(64)6",
1579 915: "(65)5",
1580 916: "(66)5",
1581 917: "(55)6",
1582 918: "(65)6",
1583 919: "(7A)A",
1584 920: "(77)A",
1585 921: "(AA)7",
1586 922: "(7A)7",
1587 923: "(72)2",
1588 924: "(77)2",
1589 925: "(22)7",
1590 926: "(72)7",
1591 927: "(73)3",
1592 928: "(77)3",
1593 929: "(33)7",
1594 930: "(73)7",
1595 931: "(74)4",
1596 932: "(77)4",
1597 933: "(44)7",
1598 934: "(74)7",
1599 935: "(75)5",
1600 936: "(77)5",
1601 937: "(55)7",
1602 938: "(75)7",
1603 939: "(76)6",
1604 940: "(77)6",
1605 941: "(66)7",
1606 942: "(76)7",
1607 943: "(8A)A",
1608 944: "(88)A",
1609 945: "(AA)8",
1610 946: "(8A)8",
1611 947: "(82)2",
1612 948: "(88)2",
1613 949: "(22)8",
1614 950: "(82)8",
1615 951: "(83)3",
1616 952: "(88)3",
1617 953: "(33)8",
1618 954: "(83)8",
1619 955: "(84)4",
1620 956: "(88)4",
1621 957: "(44)8",
1622 958: "(84)8",
1623 959: "(85)5",
1624 960: "(88)5",
1625 961: "(55)8",
1626 962: "(85)8",
1627 963: "(86)6",
1628 964: "(88)6",
1629 965: "(66)8",
1630 966: "(86)8",
1631 967: "(87)7",
1632 968: "(88)7",
1633 969: "(77)8",
1634 970: "(87)8",
1635 971: "(9A)A",
1636 972: "(99)A",
1637 973: "(AA)9",
1638 974: "(9A)9",
1639 975: "(92)2",
1640 976: "(99)2",
1641 977: "(22)9",
1642 978: "(92)9",
1643 979: "(93)3",
1644 980: "(99)3",
1645 981: "(33)9",
1646 982: "(93)9",
1647 983: "(94)4",
1648 984: "(99)4",
1649 985: "(44)9",
1650 986: "(94)9",
1651 987: "(95)5",
1652 988: "(99)5",
1653 989: "(55)9",
1654 990: "(95)9",
1655 991: "(96)6",
1656 992: "(99)6",
1657 993: "(66)9",
1658 994: "(96)9",
1659 995: "(97)7",
1660 996: "(99)7",
1661 997: "(77)9",
1662 998: "(97)9",
1663 999: "(98)8",
1664 1000: "(99)8",
1665 1001: "(88)9",
1666 1002: "(98)9",
1667 1003: "(TA)A",
1668 1004: "(TT)A",
1669 1005: "(AA)T",
1670 1006: "(TA)T",
1671 1007: "(T2)2",
1672 1008: "(TT)2",
1673 1009: "(22)T",
1674 1010: "(T2)T",
1675 1011: "(T3)3",
1676 1012: "(TT)3",
1677 1013: "(33)T",
1678 1014: "(T3)T",
1679 1015: "(T4)4",
1680 1016: "(TT)4",
1681 1017: "(44)T",
1682 1018: "(T4)T",
1683 1019: "(T5)5",
1684 1020: "(TT)5",
1685 1021: "(55)T",
1686 1022: "(T5)T",
1687 1023: "(T6)6",
1688 1024: "(TT)6",
1689 1025: "(66)T",
1690 1026: "(T6)T",
1691 1027: "(T7)7",
1692 1028: "(TT)7",
1693 1029: "(77)T",
1694 1030: "(T7)T",
1695 1031: "(T8)8",
1696 1032: "(TT)8",
1697 1033: "(88)T",
1698 1034: "(T8)T",
1699 1035: "(T9)9",
1700 1036: "(TT)9",
1701 1037: "(99)T",
1702 1038: "(T9)T",
1703 1039: "(JA)A",
1704 1040: "(JJ)A",
1705 1041: "(AA)J",
1706 1042: "(JA)J",
1707 1043: "(J2)2",
1708 1044: "(JJ)2",
1709 1045: "(22)J",
1710 1046: "(J2)J",
1711 1047: "(J3)3",
1712 1048: "(JJ)3",
1713 1049: "(33)J",
1714 1050: "(J3)J",
1715 1051: "(J4)4",
1716 1052: "(JJ)4",
1717 1053: "(44)J",
1718 1054: "(J4)J",
1719 1055: "(J5)5",
1720 1056: "(JJ)5",
1721 1057: "(55)J",
1722 1058: "(J5)J",
1723 1059: "(J6)6",
1724 1060: "(JJ)6",
1725 1061: "(66)J",
1726 1062: "(J6)J",
1727 1063: "(J7)7",
1728 1064: "(JJ)7",
1729 1065: "(77)J",
1730 1066: "(J7)J",
1731 1067: "(J8)8",
1732 1068: "(JJ)8",
1733 1069: "(88)J",
1734 1070: "(J8)J",
1735 1071: "(J9)9",
1736 1072: "(JJ)9",
1737 1073: "(99)J",
1738 1074: "(J9)J",
1739 1075: "(JT)T",
1740 1076: "(JJ)T",
1741 1077: "(TT)J",
1742 1078: "(JT)J",
1743 1079: "(QA)A",
1744 1080: "(QQ)A",
1745 1081: "(AA)Q",
1746 1082: "(QA)Q",
1747 1083: "(Q2)2",
1748 1084: "(QQ)2",
1749 1085: "(22)Q",
1750 1086: "(Q2)Q",
1751 1087: "(Q3)3",
1752 1088: "(QQ)3",
1753 1089: "(33)Q",
1754 1090: "(Q3)Q",
1755 1091: "(Q4)4",
1756 1092: "(QQ)4",
1757 1093: "(44)Q",
1758 1094: "(Q4)Q",
1759 1095: "(Q5)5",
1760 1096: "(QQ)5",
1761 1097: "(55)Q",
1762 1098: "(Q5)Q",
1763 1099: "(Q6)6",
1764 1100: "(QQ)6",
1765 1101: "(66)Q",
1766 1102: "(Q6)Q",
1767 1103: "(Q7)7",
1768 1104: "(QQ)7",
1769 1105: "(77)Q",
1770 1106: "(Q7)Q",
1771 1107: "(Q8)8",
1772 1108: "(QQ)8",
1773 1109: "(88)Q",
1774 1110: "(Q8)Q",
1775 1111: "(Q9)9",
1776 1112: "(QQ)9",
1777 1113: "(99)Q",
1778 1114: "(Q9)Q",
1779 1115: "(QT)T",
1780 1116: "(QQ)T",
1781 1117: "(TT)Q",
1782 1118: "(QT)Q",
1783 1119: "(QJ)J",
1784 1120: "(QQ)J",
1785 1121: "(JJ)Q",
1786 1122: "(QJ)Q",
1787 1123: "(KA)A",
1788 1124: "(KK)A",
1789 1125: "(AA)K",
1790 1126: "(KA)K",
1791 1127: "(K2)2",
1792 1128: "(KK)2",
1793 1129: "(22)K",
1794 1130: "(K2)K",
1795 1131: "(K3)3",
1796 1132: "(KK)3",
1797 1133: "(33)K",
1798 1134: "(K3)K",
1799 1135: "(K4)4",
1800 1136: "(KK)4",
1801 1137: "(44)K",
1802 1138: "(K4)K",
1803 1139: "(K5)5",
1804 1140: "(KK)5",
1805 1141: "(55)K",
1806 1142: "(K5)K",
1807 1143: "(K6)6",
1808 1144: "(KK)6",
1809 1145: "(66)K",
1810 1146: "(K6)K",
1811 1147: "(K7)7",
1812 1148: "(KK)7",
1813 1149: "(77)K",
1814 1150: "(K7)K",
1815 1151: "(K8)8",
1816 1152: "(KK)8",
1817 1153: "(88)K",
1818 1154: "(K8)K",
1819 1155: "(K9)9",
1820 1156: "(KK)9",
1821 1157: "(99)K",
1822 1158: "(K9)K",
1823 1159: "(KT)T",
1824 1160: "(KK)T",
1825 1161: "(TT)K",
1826 1162: "(KT)K",
1827 1163: "(KJ)J",
1828 1164: "(KK)J",
1829 1165: "(JJ)K",
1830 1166: "(KJ)K",
1831 1167: "(KQ)Q",
1832 1168: "(KK)Q",
1833 1169: "(QQ)K",
1834 1170: "(KQ)K",
1835 1171: "(AA)A",
1836 1172: "(22)2",
1837 1173: "(33)3",
1838 1174: "(44)4",
1839 1175: "(55)5",
1840 1176: "(66)6",
1841 1177: "(77)7",
1842 1178: "(88)8",
1843 1179: "(99)9",
1844 1180: "(TT)T",
1845 1181: "(JJ)J",
1846 1182: "(QQ)Q",
1847 1183: "(KK)K",
1848 }
1849 return decodeRazzList[idx]
1852def encodeRazzStartHand(cards):
1853 """Take Razz starting hand and return an integer index for storing in db"""
1854 startHand = ""
1855 if card_map_low[cards[0][0]] > card_map_low[cards[1][0]]:
1856 startHand = f"({cards[0][0]}{cards[1][0]}){cards[2][0]}"
1857 else:
1858 startHand = f"({cards[1][0]}{cards[0][0]}){cards[2][0]}"
1859 # print "DEBUG: startHand: %s" % startHand
1860 encodeRazzList = {
1861 "(00)A": -13,
1862 "(00)2": -12,
1863 "(00)3": -11,
1864 "(00)4": -10,
1865 "(00)5": -9,
1866 "(00)6": -8,
1867 "(00)7": -7,
1868 "(00)8": -6,
1869 "(00)9": -5,
1870 "(00)T": -4,
1871 "(00)J": -3,
1872 "(00)Q": -2,
1873 "(00)K": -1,
1874 "(00)0": 0,
1875 "(32)A": 1,
1876 "(3A)2": 2,
1877 "(2A)3": 3,
1878 "(42)A": 4,
1879 "(4A)2": 5,
1880 "(2A)4": 6,
1881 "(43)A": 7,
1882 "(4A)3": 8,
1883 "(3A)4": 9,
1884 "(43)2": 10,
1885 "(42)3": 11,
1886 "(32)4": 12,
1887 "(52)A": 13,
1888 "(5A)2": 14,
1889 "(2A)5": 15,
1890 "(53)A": 16,
1891 "(5A)3": 17,
1892 "(3A)5": 18,
1893 "(53)2": 19,
1894 "(52)3": 20,
1895 "(32)5": 21,
1896 "(54)A": 22,
1897 "(5A)4": 23,
1898 "(4A)5": 24,
1899 "(54)2": 25,
1900 "(52)4": 26,
1901 "(42)5": 27,
1902 "(54)3": 28,
1903 "(53)4": 29,
1904 "(43)5": 30,
1905 "(62)A": 31,
1906 "(6A)2": 32,
1907 "(2A)6": 33,
1908 "(63)A": 34,
1909 "(6A)3": 35,
1910 "(3A)6": 36,
1911 "(63)2": 37,
1912 "(62)3": 38,
1913 "(32)6": 39,
1914 "(64)A": 40,
1915 "(6A)4": 41,
1916 "(4A)6": 42,
1917 "(64)2": 43,
1918 "(62)4": 44,
1919 "(42)6": 45,
1920 "(64)3": 46,
1921 "(63)4": 47,
1922 "(43)6": 48,
1923 "(65)A": 49,
1924 "(6A)5": 50,
1925 "(5A)6": 51,
1926 "(65)2": 52,
1927 "(62)5": 53,
1928 "(52)6": 54,
1929 "(65)3": 55,
1930 "(63)5": 56,
1931 "(53)6": 57,
1932 "(65)4": 58,
1933 "(64)5": 59,
1934 "(54)6": 60,
1935 "(72)A": 61,
1936 "(7A)2": 62,
1937 "(2A)7": 63,
1938 "(73)A": 64,
1939 "(7A)3": 65,
1940 "(3A)7": 66,
1941 "(73)2": 67,
1942 "(72)3": 68,
1943 "(32)7": 69,
1944 "(74)A": 70,
1945 "(7A)4": 71,
1946 "(4A)7": 72,
1947 "(74)2": 73,
1948 "(72)4": 74,
1949 "(42)7": 75,
1950 "(74)3": 76,
1951 "(73)4": 77,
1952 "(43)7": 78,
1953 "(75)A": 79,
1954 "(7A)5": 80,
1955 "(5A)7": 81,
1956 "(75)2": 82,
1957 "(72)5": 83,
1958 "(52)7": 84,
1959 "(75)3": 85,
1960 "(73)5": 86,
1961 "(53)7": 87,
1962 "(75)4": 88,
1963 "(74)5": 89,
1964 "(54)7": 90,
1965 "(76)A": 91,
1966 "(7A)6": 92,
1967 "(6A)7": 93,
1968 "(76)2": 94,
1969 "(72)6": 95,
1970 "(62)7": 96,
1971 "(76)3": 97,
1972 "(73)6": 98,
1973 "(63)7": 99,
1974 "(76)4": 100,
1975 "(74)6": 101,
1976 "(64)7": 102,
1977 "(76)5": 103,
1978 "(75)6": 104,
1979 "(65)7": 105,
1980 "(82)A": 106,
1981 "(8A)2": 107,
1982 "(2A)8": 108,
1983 "(83)A": 109,
1984 "(8A)3": 110,
1985 "(3A)8": 111,
1986 "(83)2": 112,
1987 "(82)3": 113,
1988 "(32)8": 114,
1989 "(84)A": 115,
1990 "(8A)4": 116,
1991 "(4A)8": 117,
1992 "(84)2": 118,
1993 "(82)4": 119,
1994 "(42)8": 120,
1995 "(84)3": 121,
1996 "(83)4": 122,
1997 "(43)8": 123,
1998 "(85)A": 124,
1999 "(8A)5": 125,
2000 "(5A)8": 126,
2001 "(85)2": 127,
2002 "(82)5": 128,
2003 "(52)8": 129,
2004 "(85)3": 130,
2005 "(83)5": 131,
2006 "(53)8": 132,
2007 "(85)4": 133,
2008 "(84)5": 134,
2009 "(54)8": 135,
2010 "(86)A": 136,
2011 "(8A)6": 137,
2012 "(6A)8": 138,
2013 "(86)2": 139,
2014 "(82)6": 140,
2015 "(62)8": 141,
2016 "(86)3": 142,
2017 "(83)6": 143,
2018 "(63)8": 144,
2019 "(86)4": 145,
2020 "(84)6": 146,
2021 "(64)8": 147,
2022 "(86)5": 148,
2023 "(85)6": 149,
2024 "(65)8": 150,
2025 "(87)A": 151,
2026 "(8A)7": 152,
2027 "(7A)8": 153,
2028 "(87)2": 154,
2029 "(82)7": 155,
2030 "(72)8": 156,
2031 "(87)3": 157,
2032 "(83)7": 158,
2033 "(73)8": 159,
2034 "(87)4": 160,
2035 "(84)7": 161,
2036 "(74)8": 162,
2037 "(87)5": 163,
2038 "(85)7": 164,
2039 "(75)8": 165,
2040 "(87)6": 166,
2041 "(86)7": 167,
2042 "(76)8": 168,
2043 "(92)A": 169,
2044 "(9A)2": 170,
2045 "(2A)9": 171,
2046 "(93)A": 172,
2047 "(9A)3": 173,
2048 "(3A)9": 174,
2049 "(93)2": 175,
2050 "(92)3": 176,
2051 "(32)9": 177,
2052 "(94)A": 178,
2053 "(9A)4": 179,
2054 "(4A)9": 180,
2055 "(94)2": 181,
2056 "(92)4": 182,
2057 "(42)9": 183,
2058 "(94)3": 184,
2059 "(93)4": 185,
2060 "(43)9": 186,
2061 "(95)A": 187,
2062 "(9A)5": 188,
2063 "(5A)9": 189,
2064 "(95)2": 190,
2065 "(92)5": 191,
2066 "(52)9": 192,
2067 "(95)3": 193,
2068 "(93)5": 194,
2069 "(53)9": 195,
2070 "(95)4": 196,
2071 "(94)5": 197,
2072 "(54)9": 198,
2073 "(96)A": 199,
2074 "(9A)6": 200,
2075 "(6A)9": 201,
2076 "(96)2": 202,
2077 "(92)6": 203,
2078 "(62)9": 204,
2079 "(96)3": 205,
2080 "(93)6": 206,
2081 "(63)9": 207,
2082 "(96)4": 208,
2083 "(94)6": 209,
2084 "(64)9": 210,
2085 "(96)5": 211,
2086 "(95)6": 212,
2087 "(65)9": 213,
2088 "(97)A": 214,
2089 "(9A)7": 215,
2090 "(7A)9": 216,
2091 "(97)2": 217,
2092 "(92)7": 218,
2093 "(72)9": 219,
2094 "(97)3": 220,
2095 "(93)7": 221,
2096 "(73)9": 222,
2097 "(97)4": 223,
2098 "(94)7": 224,
2099 "(74)9": 225,
2100 "(97)5": 226,
2101 "(95)7": 227,
2102 "(75)9": 228,
2103 "(97)6": 229,
2104 "(96)7": 230,
2105 "(76)9": 231,
2106 "(98)A": 232,
2107 "(9A)8": 233,
2108 "(8A)9": 234,
2109 "(98)2": 235,
2110 "(92)8": 236,
2111 "(82)9": 237,
2112 "(98)3": 238,
2113 "(93)8": 239,
2114 "(83)9": 240,
2115 "(98)4": 241,
2116 "(94)8": 242,
2117 "(84)9": 243,
2118 "(98)5": 244,
2119 "(95)8": 245,
2120 "(85)9": 246,
2121 "(98)6": 247,
2122 "(96)8": 248,
2123 "(86)9": 249,
2124 "(98)7": 250,
2125 "(97)8": 251,
2126 "(87)9": 252,
2127 "(T2)A": 253,
2128 "(TA)2": 254,
2129 "(2A)T": 255,
2130 "(T3)A": 256,
2131 "(TA)3": 257,
2132 "(3A)T": 258,
2133 "(T3)2": 259,
2134 "(T2)3": 260,
2135 "(32)T": 261,
2136 "(T4)A": 262,
2137 "(TA)4": 263,
2138 "(4A)T": 264,
2139 "(T4)2": 265,
2140 "(T2)4": 266,
2141 "(42)T": 267,
2142 "(T4)3": 268,
2143 "(T3)4": 269,
2144 "(43)T": 270,
2145 "(T5)A": 271,
2146 "(TA)5": 272,
2147 "(5A)T": 273,
2148 "(T5)2": 274,
2149 "(T2)5": 275,
2150 "(52)T": 276,
2151 "(T5)3": 277,
2152 "(T3)5": 278,
2153 "(53)T": 279,
2154 "(T5)4": 280,
2155 "(T4)5": 281,
2156 "(54)T": 282,
2157 "(T6)A": 283,
2158 "(TA)6": 284,
2159 "(6A)T": 285,
2160 "(T6)2": 286,
2161 "(T2)6": 287,
2162 "(62)T": 288,
2163 "(T6)3": 289,
2164 "(T3)6": 290,
2165 "(63)T": 291,
2166 "(T6)4": 292,
2167 "(T4)6": 293,
2168 "(64)T": 294,
2169 "(T6)5": 295,
2170 "(T5)6": 296,
2171 "(65)T": 297,
2172 "(T7)A": 298,
2173 "(TA)7": 299,
2174 "(7A)T": 300,
2175 "(T7)2": 301,
2176 "(T2)7": 302,
2177 "(72)T": 303,
2178 "(T7)3": 304,
2179 "(T3)7": 305,
2180 "(73)T": 306,
2181 "(T7)4": 307,
2182 "(T4)7": 308,
2183 "(74)T": 309,
2184 "(T7)5": 310,
2185 "(T5)7": 311,
2186 "(75)T": 312,
2187 "(T7)6": 313,
2188 "(T6)7": 314,
2189 "(76)T": 315,
2190 "(T8)A": 316,
2191 "(TA)8": 317,
2192 "(8A)T": 318,
2193 "(T8)2": 319,
2194 "(T2)8": 320,
2195 "(82)T": 321,
2196 "(T8)3": 322,
2197 "(T3)8": 323,
2198 "(83)T": 324,
2199 "(T8)4": 325,
2200 "(T4)8": 326,
2201 "(84)T": 327,
2202 "(T8)5": 328,
2203 "(T5)8": 329,
2204 "(85)T": 330,
2205 "(T8)6": 331,
2206 "(T6)8": 332,
2207 "(86)T": 333,
2208 "(T8)7": 334,
2209 "(T7)8": 335,
2210 "(87)T": 336,
2211 "(T9)A": 337,
2212 "(TA)9": 338,
2213 "(9A)T": 339,
2214 "(T9)2": 340,
2215 "(T2)9": 341,
2216 "(92)T": 342,
2217 "(T9)3": 343,
2218 "(T3)9": 344,
2219 "(93)T": 345,
2220 "(T9)4": 346,
2221 "(T4)9": 347,
2222 "(94)T": 348,
2223 "(T9)5": 349,
2224 "(T5)9": 350,
2225 "(95)T": 351,
2226 "(T9)6": 352,
2227 "(T6)9": 353,
2228 "(96)T": 354,
2229 "(T9)7": 355,
2230 "(T7)9": 356,
2231 "(97)T": 357,
2232 "(T9)8": 358,
2233 "(T8)9": 359,
2234 "(98)T": 360,
2235 "(J2)A": 361,
2236 "(JA)2": 362,
2237 "(2A)J": 363,
2238 "(J3)A": 364,
2239 "(JA)3": 365,
2240 "(3A)J": 366,
2241 "(J3)2": 367,
2242 "(J2)3": 368,
2243 "(32)J": 369,
2244 "(J4)A": 370,
2245 "(JA)4": 371,
2246 "(4A)J": 372,
2247 "(J4)2": 373,
2248 "(J2)4": 374,
2249 "(42)J": 375,
2250 "(J4)3": 376,
2251 "(J3)4": 377,
2252 "(43)J": 378,
2253 "(J5)A": 379,
2254 "(JA)5": 380,
2255 "(5A)J": 381,
2256 "(J5)2": 382,
2257 "(J2)5": 383,
2258 "(52)J": 384,
2259 "(J5)3": 385,
2260 "(J3)5": 386,
2261 "(53)J": 387,
2262 "(J5)4": 388,
2263 "(J4)5": 389,
2264 "(54)J": 390,
2265 "(J6)A": 391,
2266 "(JA)6": 392,
2267 "(6A)J": 393,
2268 "(J6)2": 394,
2269 "(J2)6": 395,
2270 "(62)J": 396,
2271 "(J6)3": 397,
2272 "(J3)6": 398,
2273 "(63)J": 399,
2274 "(J6)4": 400,
2275 "(J4)6": 401,
2276 "(64)J": 402,
2277 "(J6)5": 403,
2278 "(J5)6": 404,
2279 "(65)J": 405,
2280 "(J7)A": 406,
2281 "(JA)7": 407,
2282 "(7A)J": 408,
2283 "(J7)2": 409,
2284 "(J2)7": 410,
2285 "(72)J": 411,
2286 "(J7)3": 412,
2287 "(J3)7": 413,
2288 "(73)J": 414,
2289 "(J7)4": 415,
2290 "(J4)7": 416,
2291 "(74)J": 417,
2292 "(J7)5": 418,
2293 "(J5)7": 419,
2294 "(75)J": 420,
2295 "(J7)6": 421,
2296 "(J6)7": 422,
2297 "(76)J": 423,
2298 "(J8)A": 424,
2299 "(JA)8": 425,
2300 "(8A)J": 426,
2301 "(J8)2": 427,
2302 "(J2)8": 428,
2303 "(82)J": 429,
2304 "(J8)3": 430,
2305 "(J3)8": 431,
2306 "(83)J": 432,
2307 "(J8)4": 433,
2308 "(J4)8": 434,
2309 "(84)J": 435,
2310 "(J8)5": 436,
2311 "(J5)8": 437,
2312 "(85)J": 438,
2313 "(J8)6": 439,
2314 "(J6)8": 440,
2315 "(86)J": 441,
2316 "(J8)7": 442,
2317 "(J7)8": 443,
2318 "(87)J": 444,
2319 "(J9)A": 445,
2320 "(JA)9": 446,
2321 "(9A)J": 447,
2322 "(J9)2": 448,
2323 "(J2)9": 449,
2324 "(92)J": 450,
2325 "(J9)3": 451,
2326 "(J3)9": 452,
2327 "(93)J": 453,
2328 "(J9)4": 454,
2329 "(J4)9": 455,
2330 "(94)J": 456,
2331 "(J9)5": 457,
2332 "(J5)9": 458,
2333 "(95)J": 459,
2334 "(J9)6": 460,
2335 "(J6)9": 461,
2336 "(96)J": 462,
2337 "(J9)7": 463,
2338 "(J7)9": 464,
2339 "(97)J": 465,
2340 "(J9)8": 466,
2341 "(J8)9": 467,
2342 "(98)J": 468,
2343 "(JT)A": 469,
2344 "(JA)T": 470,
2345 "(TA)J": 471,
2346 "(JT)2": 472,
2347 "(J2)T": 473,
2348 "(T2)J": 474,
2349 "(JT)3": 475,
2350 "(J3)T": 476,
2351 "(T3)J": 477,
2352 "(JT)4": 478,
2353 "(J4)T": 479,
2354 "(T4)J": 480,
2355 "(JT)5": 481,
2356 "(J5)T": 482,
2357 "(T5)J": 483,
2358 "(JT)6": 484,
2359 "(J6)T": 485,
2360 "(T6)J": 486,
2361 "(JT)7": 487,
2362 "(J7)T": 488,
2363 "(T7)J": 489,
2364 "(JT)8": 490,
2365 "(J8)T": 491,
2366 "(T8)J": 492,
2367 "(JT)9": 493,
2368 "(J9)T": 494,
2369 "(T9)J": 495,
2370 "(Q2)A": 496,
2371 "(QA)2": 497,
2372 "(2A)Q": 498,
2373 "(Q3)A": 499,
2374 "(QA)3": 500,
2375 "(3A)Q": 501,
2376 "(Q3)2": 502,
2377 "(Q2)3": 503,
2378 "(32)Q": 504,
2379 "(Q4)A": 505,
2380 "(QA)4": 506,
2381 "(4A)Q": 507,
2382 "(Q4)2": 508,
2383 "(Q2)4": 509,
2384 "(42)Q": 510,
2385 "(Q4)3": 511,
2386 "(Q3)4": 512,
2387 "(43)Q": 513,
2388 "(Q5)A": 514,
2389 "(QA)5": 515,
2390 "(5A)Q": 516,
2391 "(Q5)2": 517,
2392 "(Q2)5": 518,
2393 "(52)Q": 519,
2394 "(Q5)3": 520,
2395 "(Q3)5": 521,
2396 "(53)Q": 522,
2397 "(Q5)4": 523,
2398 "(Q4)5": 524,
2399 "(54)Q": 525,
2400 "(Q6)A": 526,
2401 "(QA)6": 527,
2402 "(6A)Q": 528,
2403 "(Q6)2": 529,
2404 "(Q2)6": 530,
2405 "(62)Q": 531,
2406 "(Q6)3": 532,
2407 "(Q3)6": 533,
2408 "(63)Q": 534,
2409 "(Q6)4": 535,
2410 "(Q4)6": 536,
2411 "(64)Q": 537,
2412 "(Q6)5": 538,
2413 "(Q5)6": 539,
2414 "(65)Q": 540,
2415 "(Q7)A": 541,
2416 "(QA)7": 542,
2417 "(7A)Q": 543,
2418 "(Q7)2": 544,
2419 "(Q2)7": 545,
2420 "(72)Q": 546,
2421 "(Q7)3": 547,
2422 "(Q3)7": 548,
2423 "(73)Q": 549,
2424 "(Q7)4": 550,
2425 "(Q4)7": 551,
2426 "(74)Q": 552,
2427 "(Q7)5": 553,
2428 "(Q5)7": 554,
2429 "(75)Q": 555,
2430 "(Q7)6": 556,
2431 "(Q6)7": 557,
2432 "(76)Q": 558,
2433 "(Q8)A": 559,
2434 "(QA)8": 560,
2435 "(8A)Q": 561,
2436 "(Q8)2": 562,
2437 "(Q2)8": 563,
2438 "(82)Q": 564,
2439 "(Q8)3": 565,
2440 "(Q3)8": 566,
2441 "(83)Q": 567,
2442 "(Q8)4": 568,
2443 "(Q4)8": 569,
2444 "(84)Q": 570,
2445 "(Q8)5": 571,
2446 "(Q5)8": 572,
2447 "(85)Q": 573,
2448 "(Q8)6": 574,
2449 "(Q6)8": 575,
2450 "(86)Q": 576,
2451 "(Q8)7": 577,
2452 "(Q7)8": 578,
2453 "(87)Q": 579,
2454 "(Q9)A": 580,
2455 "(QA)9": 581,
2456 "(9A)Q": 582,
2457 "(Q9)2": 583,
2458 "(Q2)9": 584,
2459 "(92)Q": 585,
2460 "(Q9)3": 586,
2461 "(Q3)9": 587,
2462 "(93)Q": 588,
2463 "(Q9)4": 589,
2464 "(Q4)9": 590,
2465 "(94)Q": 591,
2466 "(Q9)5": 592,
2467 "(Q5)9": 593,
2468 "(95)Q": 594,
2469 "(Q9)6": 595,
2470 "(Q6)9": 596,
2471 "(96)Q": 597,
2472 "(Q9)7": 598,
2473 "(Q7)9": 599,
2474 "(97)Q": 600,
2475 "(Q9)8": 601,
2476 "(Q8)9": 602,
2477 "(98)Q": 603,
2478 "(QT)A": 604,
2479 "(QA)T": 605,
2480 "(TA)Q": 606,
2481 "(QT)2": 607,
2482 "(Q2)T": 608,
2483 "(T2)Q": 609,
2484 "(QT)3": 610,
2485 "(Q3)T": 611,
2486 "(T3)Q": 612,
2487 "(QT)4": 613,
2488 "(Q4)T": 614,
2489 "(T4)Q": 615,
2490 "(QT)5": 616,
2491 "(Q5)T": 617,
2492 "(T5)Q": 618,
2493 "(QT)6": 619,
2494 "(Q6)T": 620,
2495 "(T6)Q": 621,
2496 "(QT)7": 622,
2497 "(Q7)T": 623,
2498 "(T7)Q": 624,
2499 "(QT)8": 625,
2500 "(Q8)T": 626,
2501 "(T8)Q": 627,
2502 "(QT)9": 628,
2503 "(Q9)T": 629,
2504 "(T9)Q": 630,
2505 "(QJ)A": 631,
2506 "(QA)J": 632,
2507 "(JA)Q": 633,
2508 "(QJ)2": 634,
2509 "(Q2)J": 635,
2510 "(J2)Q": 636,
2511 "(QJ)3": 637,
2512 "(Q3)J": 638,
2513 "(J3)Q": 639,
2514 "(QJ)4": 640,
2515 "(Q4)J": 641,
2516 "(J4)Q": 642,
2517 "(QJ)5": 643,
2518 "(Q5)J": 644,
2519 "(J5)Q": 645,
2520 "(QJ)6": 646,
2521 "(Q6)J": 647,
2522 "(J6)Q": 648,
2523 "(QJ)7": 649,
2524 "(Q7)J": 650,
2525 "(J7)Q": 651,
2526 "(QJ)8": 652,
2527 "(Q8)J": 653,
2528 "(J8)Q": 654,
2529 "(QJ)9": 655,
2530 "(Q9)J": 656,
2531 "(J9)Q": 657,
2532 "(QJ)T": 658,
2533 "(QT)J": 659,
2534 "(JT)Q": 660,
2535 "(K2)A": 661,
2536 "(KA)2": 662,
2537 "(2A)K": 663,
2538 "(K3)A": 664,
2539 "(KA)3": 665,
2540 "(3A)K": 666,
2541 "(K3)2": 667,
2542 "(K2)3": 668,
2543 "(32)K": 669,
2544 "(K4)A": 670,
2545 "(KA)4": 671,
2546 "(4A)K": 672,
2547 "(K4)2": 673,
2548 "(K2)4": 674,
2549 "(42)K": 675,
2550 "(K4)3": 676,
2551 "(K3)4": 677,
2552 "(43)K": 678,
2553 "(K5)A": 679,
2554 "(KA)5": 680,
2555 "(5A)K": 681,
2556 "(K5)2": 682,
2557 "(K2)5": 683,
2558 "(52)K": 684,
2559 "(K5)3": 685,
2560 "(K3)5": 686,
2561 "(53)K": 687,
2562 "(K5)4": 688,
2563 "(K4)5": 689,
2564 "(54)K": 690,
2565 "(K6)A": 691,
2566 "(KA)6": 692,
2567 "(6A)K": 693,
2568 "(K6)2": 694,
2569 "(K2)6": 695,
2570 "(62)K": 696,
2571 "(K6)3": 697,
2572 "(K3)6": 698,
2573 "(63)K": 699,
2574 "(K6)4": 700,
2575 "(K4)6": 701,
2576 "(64)K": 702,
2577 "(K6)5": 703,
2578 "(K5)6": 704,
2579 "(65)K": 705,
2580 "(K7)A": 706,
2581 "(KA)7": 707,
2582 "(7A)K": 708,
2583 "(K7)2": 709,
2584 "(K2)7": 710,
2585 "(72)K": 711,
2586 "(K7)3": 712,
2587 "(K3)7": 713,
2588 "(73)K": 714,
2589 "(K7)4": 715,
2590 "(K4)7": 716,
2591 "(74)K": 717,
2592 "(K7)5": 7,
2593 "(K5)7": 719,
2594 "(75)K": 720,
2595 "(K7)6": 721,
2596 "(K6)7": 722,
2597 "(76)K": 723,
2598 "(K8)A": 724,
2599 "(KA)8": 725,
2600 "(8A)K": 726,
2601 "(K8)2": 727,
2602 "(K2)8": 728,
2603 "(82)K": 729,
2604 "(K8)3": 730,
2605 "(K3)8": 731,
2606 "(83)K": 732,
2607 "(K8)4": 733,
2608 "(K4)8": 734,
2609 "(84)K": 735,
2610 "(K8)5": 736,
2611 "(K5)8": 737,
2612 "(85)K": 738,
2613 "(K8)6": 739,
2614 "(K6)8": 740,
2615 "(86)K": 741,
2616 "(K8)7": 742,
2617 "(K7)8": 743,
2618 "(87)K": 744,
2619 "(K9)A": 745,
2620 "(KA)9": 746,
2621 "(9A)K": 747,
2622 "(K9)2": 748,
2623 "(K2)9": 749,
2624 "(92)K": 750,
2625 "(K9)3": 751,
2626 "(K3)9": 752,
2627 "(93)K": 753,
2628 "(K9)4": 754,
2629 "(K4)9": 755,
2630 "(94)K": 756,
2631 "(K9)5": 757,
2632 "(K5)9": 758,
2633 "(95)K": 759,
2634 "(K9)6": 760,
2635 "(K6)9": 761,
2636 "(96)K": 762,
2637 "(K9)7": 763,
2638 "(K7)9": 764,
2639 "(97)K": 765,
2640 "(K9)8": 766,
2641 "(K8)9": 767,
2642 "(98)K": 768,
2643 "(KT)A": 769,
2644 "(KA)T": 770,
2645 "(TA)K": 771,
2646 "(KT)2": 772,
2647 "(K2)T": 773,
2648 "(T2)K": 774,
2649 "(KT)3": 775,
2650 "(K3)T": 776,
2651 "(T3)K": 777,
2652 "(KT)4": 778,
2653 "(K4)T": 779,
2654 "(T4)K": 780,
2655 "(KT)5": 781,
2656 "(K5)T": 782,
2657 "(T5)K": 783,
2658 "(KT)6": 784,
2659 "(K6)T": 785,
2660 "(T6)K": 786,
2661 "(KT)7": 787,
2662 "(K7)T": 788,
2663 "(T7)K": 789,
2664 "(KT)8": 790,
2665 "(K8)T": 791,
2666 "(T8)K": 792,
2667 "(KT)9": 793,
2668 "(K9)T": 794,
2669 "(T9)K": 795,
2670 "(KJ)A": 796,
2671 "(KA)J": 797,
2672 "(JA)K": 798,
2673 "(KJ)2": 799,
2674 "(K2)J": 800,
2675 "(J2)K": 801,
2676 "(KJ)3": 802,
2677 "(K3)J": 803,
2678 "(J3)K": 804,
2679 "(KJ)4": 805,
2680 "(K4)J": 806,
2681 "(J4)K": 807,
2682 "(KJ)5": 808,
2683 "(K5)J": 809,
2684 "(J5)K": 810,
2685 "(KJ)6": 811,
2686 "(K6)J": 812,
2687 "(J6)K": 813,
2688 "(KJ)7": 814,
2689 "(K7)J": 815,
2690 "(J7)K": 816,
2691 "(KJ)8": 817,
2692 "(K8)J": 818,
2693 "(J8)K": 819,
2694 "(KJ)9": 820,
2695 "(K9)J": 821,
2696 "(J9)K": 822,
2697 "(KJ)T": 823,
2698 "(KT)J": 824,
2699 "(JT)K": 825,
2700 "(KQ)A": 826,
2701 "(KA)Q": 827,
2702 "(QA)K": 828,
2703 "(KQ)2": 829,
2704 "(K2)Q": 830,
2705 "(Q2)K": 831,
2706 "(KQ)3": 832,
2707 "(K3)Q": 833,
2708 "(Q3)K": 834,
2709 "(KQ)4": 835,
2710 "(K4)Q": 836,
2711 "(Q4)K": 837,
2712 "(KQ)5": 838,
2713 "(K5)Q": 839,
2714 "(Q5)K": 840,
2715 "(KQ)6": 841,
2716 "(K6)Q": 842,
2717 "(Q6)K": 843,
2718 "(KQ)7": 844,
2719 "(K7)Q": 845,
2720 "(Q7)K": 846,
2721 "(KQ)8": 847,
2722 "(K8)Q": 848,
2723 "(Q8)K": 849,
2724 "(KQ)9": 850,
2725 "(K9)Q": 851,
2726 "(Q9)K": 852,
2727 "(KQ)T": 853,
2728 "(KT)Q": 854,
2729 "(QT)K": 855,
2730 "(KQ)J": 856,
2731 "(KJ)Q": 857,
2732 "(QJ)K": 858,
2733 "(2A)A": 859,
2734 "(22)A": 860,
2735 "(AA)2": 861,
2736 "(2A)2": 862,
2737 "(3A)A": 863,
2738 "(33)A": 864,
2739 "(AA)3": 865,
2740 "(3A)3": 866,
2741 "(32)2": 867,
2742 "(33)2": 868,
2743 "(22)3": 869,
2744 "(32)3": 870,
2745 "(4A)A": 871,
2746 "(44)A": 872,
2747 "(AA)4": 873,
2748 "(4A)4": 874,
2749 "(42)2": 875,
2750 "(44)2": 876,
2751 "(22)4": 877,
2752 "(42)4": 878,
2753 "(43)3": 879,
2754 "(44)3": 880,
2755 "(33)4": 881,
2756 "(43)4": 882,
2757 "(5A)A": 883,
2758 "(55)A": 884,
2759 "(AA)5": 885,
2760 "(5A)5": 886,
2761 "(52)2": 887,
2762 "(55)2": 888,
2763 "(22)5": 889,
2764 "(52)5": 890,
2765 "(53)3": 891,
2766 "(55)3": 892,
2767 "(33)5": 893,
2768 "(53)5": 894,
2769 "(54)4": 895,
2770 "(55)4": 896,
2771 "(44)5": 897,
2772 "(54)5": 898,
2773 "(6A)A": 899,
2774 "(66)A": 900,
2775 "(AA)6": 901,
2776 "(6A)6": 902,
2777 "(62)2": 903,
2778 "(66)2": 904,
2779 "(22)6": 905,
2780 "(62)6": 906,
2781 "(63)3": 907,
2782 "(66)3": 908,
2783 "(33)6": 909,
2784 "(63)6": 910,
2785 "(64)4": 911,
2786 "(66)4": 912,
2787 "(44)6": 913,
2788 "(64)6": 914,
2789 "(65)5": 915,
2790 "(66)5": 916,
2791 "(55)6": 917,
2792 "(65)6": 918,
2793 "(7A)A": 919,
2794 "(77)A": 920,
2795 "(AA)7": 921,
2796 "(7A)7": 922,
2797 "(72)2": 923,
2798 "(77)2": 924,
2799 "(22)7": 925,
2800 "(72)7": 926,
2801 "(73)3": 927,
2802 "(77)3": 928,
2803 "(33)7": 929,
2804 "(73)7": 930,
2805 "(74)4": 931,
2806 "(77)4": 932,
2807 "(44)7": 933,
2808 "(74)7": 934,
2809 "(75)5": 935,
2810 "(77)5": 936,
2811 "(55)7": 937,
2812 "(75)7": 938,
2813 "(76)6": 939,
2814 "(77)6": 940,
2815 "(66)7": 941,
2816 "(76)7": 942,
2817 "(8A)A": 943,
2818 "(88)A": 944,
2819 "(AA)8": 945,
2820 "(8A)8": 946,
2821 "(82)2": 947,
2822 "(88)2": 948,
2823 "(22)8": 949,
2824 "(82)8": 950,
2825 "(83)3": 951,
2826 "(88)3": 952,
2827 "(33)8": 953,
2828 "(83)8": 954,
2829 "(84)4": 955,
2830 "(88)4": 956,
2831 "(44)8": 957,
2832 "(84)8": 958,
2833 "(85)5": 959,
2834 "(88)5": 960,
2835 "(55)8": 961,
2836 "(85)8": 962,
2837 "(86)6": 963,
2838 "(88)6": 964,
2839 "(66)8": 965,
2840 "(86)8": 966,
2841 "(87)7": 967,
2842 "(88)7": 968,
2843 "(77)8": 969,
2844 "(87)8": 970,
2845 "(9A)A": 971,
2846 "(99)A": 972,
2847 "(AA)9": 973,
2848 "(9A)9": 974,
2849 "(92)2": 975,
2850 "(99)2": 976,
2851 "(22)9": 977,
2852 "(92)9": 978,
2853 "(93)3": 979,
2854 "(99)3": 980,
2855 "(33)9": 981,
2856 "(93)9": 982,
2857 "(94)4": 983,
2858 "(99)4": 984,
2859 "(44)9": 985,
2860 "(94)9": 986,
2861 "(95)5": 987,
2862 "(99)5": 988,
2863 "(55)9": 989,
2864 "(95)9": 990,
2865 "(96)6": 991,
2866 "(99)6": 992,
2867 "(66)9": 993,
2868 "(96)9": 994,
2869 "(97)7": 995,
2870 "(99)7": 996,
2871 "(77)9": 997,
2872 "(97)9": 998,
2873 "(98)8": 999,
2874 "(99)8": 1000,
2875 "(88)9": 1001,
2876 "(98)9": 1002,
2877 "(TA)A": 1003,
2878 "(TT)A": 1004,
2879 "(AA)T": 1005,
2880 "(TA)T": 1006,
2881 "(T2)2": 1007,
2882 "(TT)2": 1008,
2883 "(22)T": 1009,
2884 "(T2)T": 1010,
2885 "(T3)3": 1011,
2886 "(TT)3": 1012,
2887 "(33)T": 1013,
2888 "(T3)T": 1014,
2889 "(T4)4": 1015,
2890 "(TT)4": 1016,
2891 "(44)T": 1017,
2892 "(T4)T": 1018,
2893 "(T5)5": 1019,
2894 "(TT)5": 1020,
2895 "(55)T": 1021,
2896 "(T5)T": 1022,
2897 "(T6)6": 1023,
2898 "(TT)6": 1024,
2899 "(66)T": 1025,
2900 "(T6)T": 1026,
2901 "(T7)7": 1027,
2902 "(TT)7": 1028,
2903 "(77)T": 1029,
2904 "(T7)T": 1030,
2905 "(T8)8": 1031,
2906 "(TT)8": 1032,
2907 "(88)T": 1033,
2908 "(T8)T": 1034,
2909 "(T9)9": 1035,
2910 "(TT)9": 1036,
2911 "(99)T": 1037,
2912 "(T9)T": 1038,
2913 "(JA)A": 1039,
2914 "(JJ)A": 1040,
2915 "(AA)J": 1041,
2916 "(JA)J": 1042,
2917 "(J2)2": 1043,
2918 "(JJ)2": 1044,
2919 "(22)J": 1045,
2920 "(J2)J": 1046,
2921 "(J3)3": 1047,
2922 "(JJ)3": 1048,
2923 "(33)J": 1049,
2924 "(J3)J": 1050,
2925 "(J4)4": 1051,
2926 "(JJ)4": 1052,
2927 "(44)J": 1053,
2928 "(J4)J": 1054,
2929 "(J5)5": 1055,
2930 "(JJ)5": 1056,
2931 "(55)J": 1057,
2932 "(J5)J": 1058,
2933 "(J6)6": 1059,
2934 "(JJ)6": 1060,
2935 "(66)J": 1061,
2936 "(J6)J": 1062,
2937 "(J7)7": 1063,
2938 "(JJ)7": 1064,
2939 "(77)J": 1065,
2940 "(J7)J": 1066,
2941 "(J8)8": 1067,
2942 "(JJ)8": 1068,
2943 "(88)J": 1069,
2944 "(J8)J": 1070,
2945 "(J9)9": 1071,
2946 "(JJ)9": 1072,
2947 "(99)J": 1073,
2948 "(J9)J": 1074,
2949 "(JT)T": 1075,
2950 "(JJ)T": 1076,
2951 "(TT)J": 1077,
2952 "(JT)J": 1078,
2953 "(QA)A": 1079,
2954 "(QQ)A": 1080,
2955 "(AA)Q": 1081,
2956 "(QA)Q": 1082,
2957 "(Q2)2": 1083,
2958 "(QQ)2": 1084,
2959 "(22)Q": 1085,
2960 "(Q2)Q": 1086,
2961 "(Q3)3": 1087,
2962 "(QQ)3": 1088,
2963 "(33)Q": 1089,
2964 "(Q3)Q": 1090,
2965 "(Q4)4": 1091,
2966 "(QQ)4": 1092,
2967 "(44)Q": 1093,
2968 "(Q4)Q": 1094,
2969 "(Q5)5": 1095,
2970 "(QQ)5": 1096,
2971 "(55)Q": 1097,
2972 "(Q5)Q": 1098,
2973 "(Q6)6": 1099,
2974 "(QQ)6": 1100,
2975 "(66)Q": 1101,
2976 "(Q6)Q": 1102,
2977 "(Q7)7": 1103,
2978 "(QQ)7": 1104,
2979 "(77)Q": 1105,
2980 "(Q7)Q": 1106,
2981 "(Q8)8": 1107,
2982 "(QQ)8": 1108,
2983 "(88)Q": 1109,
2984 "(Q8)Q": 1110,
2985 "(Q9)9": 1111,
2986 "(QQ)9": 1112,
2987 "(99)Q": 1113,
2988 "(Q9)Q": 1114,
2989 "(QT)T": 1115,
2990 "(QQ)T": 1116,
2991 "(TT)Q": 1117,
2992 "(QT)Q": 1118,
2993 "(QJ)J": 1119,
2994 "(QQ)J": 1120,
2995 "(JJ)Q": 1121,
2996 "(QJ)Q": 1122,
2997 "(KA)A": 1123,
2998 "(KK)A": 1124,
2999 "(AA)K": 1125,
3000 "(KA)K": 1126,
3001 "(K2)2": 1127,
3002 "(KK)2": 1128,
3003 "(22)K": 1129,
3004 "(K2)K": 1130,
3005 "(K3)3": 1131,
3006 "(KK)3": 1132,
3007 "(33)K": 1133,
3008 "(K3)K": 1134,
3009 "(K4)4": 1135,
3010 "(KK)4": 1136,
3011 "(44)K": 1137,
3012 "(K4)K": 1138,
3013 "(K5)5": 1139,
3014 "(KK)5": 1140,
3015 "(55)K": 1141,
3016 "(K5)K": 1142,
3017 "(K6)6": 1143,
3018 "(KK)6": 1144,
3019 "(66)K": 1145,
3020 "(K6)K": 1146,
3021 "(K7)7": 1147,
3022 "(KK)7": 1148,
3023 "(77)K": 1149,
3024 "(K7)K": 1150,
3025 "(K8)8": 1151,
3026 "(KK)8": 1152,
3027 "(88)K": 1153,
3028 "(K8)K": 1154,
3029 "(K9)9": 1155,
3030 "(KK)9": 1156,
3031 "(99)K": 1157,
3032 "(K9)K": 1158,
3033 "(KT)T": 1159,
3034 "(KK)T": 1160,
3035 "(TT)K": 1161,
3036 "(KT)K": 1162,
3037 "(KJ)J": 1163,
3038 "(KK)J": 1164,
3039 "(JJ)K": 1165,
3040 "(KJ)K": 1166,
3041 "(KQ)Q": 1167,
3042 "(KK)Q": 1168,
3043 "(QQ)K": 1169,
3044 "(KQ)K": 1170,
3045 "(AA)A": 1171,
3046 "(22)2": 1172,
3047 "(33)3": 1173,
3048 "(44)4": 1174,
3049 "(55)5": 1175,
3050 "(66)6": 1176,
3051 "(77)7": 1177,
3052 "(88)8": 1178,
3053 "(99)9": 1179,
3054 "(TT)T": 1180,
3055 "(JJ)J": 1181,
3056 "(QQ)Q": 1182,
3057 "(KK)K": 1183,
3058 }
3059 return idx if (idx := encodeRazzList.get(startHand)) else 0
3062if __name__ == "__main__":
3063 print("1) " + "Convert list ID to card (e.g. 1 to 2h)")
3064 print("2) " + "Convert card to list ID (e.g. 2h to 1)")
3065 s = eval(input("--> "))
3066 if s == 1:
3067 while True:
3068 cardid = eval(input("Enter list ID:" + " "))
3069 print(f"Card: '{suitFromCardList[int(cardid)]}'")
3070 elif s == 2:
3071 while True:
3072 cardid = eval(input("Enter card:" + " "))
3073 print(f"Encoded card: '{encodeCard(cardid)}'")
3074 else:
3075 print("Please enter 1 or 2")