;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file contains utf-8 non-ASCII characters, ;;; and so cannot be loaded into Emacs 22 or earlier. (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (string-lessp emacs-version "23") (error "`%s' was compiled for Emacs 23 or later" #$)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305!\204\306\305\307\"\210\300\207" [require cl-lib cookie1 ert fboundp cookie-shuffle-vector defalias shuffle-vector] 3) (defconst poker-ranks '(2 3 4 5 6 7 8 9 10 jack queen king ace)) (defconst poker-suits '(clubs diamonds hearts spades)) (defconst poker-deck (byte-code "\302\303\304X\203 BT\211\202 \237*\207" [card #:--cl-var-- 0 nil 51] 3)) (defconst poker-unicode-cards (byte-code "\306\307\310 \311\211\n:\203x\n@ \311\211:\203i@\312 \236A\313=\2036\314\202Y\315=\203A\316\202Y\317=\203L\320\202Y\321=\203W\322\202Y\323#BA\211\202\237+\237\f\244\nA\211\202 \f\237+\")\207" [unicode-suit poker-suits #:--cl-var-- suit #:--cl-var-- poker-ranks ((clubs . 208) (diamonds . 192) (hearts . 176) (spades . 160)) apply vector nil logior ace 1 jack 11 queen 13 king 14 126976 #:--cl-var-- rank #:--cl-var--] 7)) (defconst poker-pre-flop-starting-hands '((AA 0.8551 0.7375 0.6422 0.5622 0.4946 0.4388 0.3907 0.349 0.3134 0.2828) (KK 0.8273 0.692 0.586 0.5022 0.4331 0.3785 0.332 0.2951 0.2638 0.2386) (QQ 0.8017 0.6536 0.5387 0.4525 0.3829 0.3298 0.2878 0.2535 0.2265 0.2045) (JJ 0.7781 0.6166 0.496 0.4072 0.3406 0.2904 0.2511 0.2214 0.1984 0.181) (TT 0.7538 0.5807 0.4568 0.3689 0.3044 0.2577 0.2238 0.1979 0.1771 0.1626) (99 0.7251 0.541 0.4159 0.33 0.2709 0.2293 0.1989 0.1767 0.1605 0.1483) (88 0.6965 0.5052 0.3808 0.2995 0.2443 0.2084 0.1818 0.1634 0.1499 0.1391) (AKs 0.6787 0.5185 0.425 0.3655 0.3216 0.2876 0.2602 0.2362 0.2179 0.2004) (AQs 0.6718 0.5059 0.4104 0.3492 0.3056 0.272 0.2451 0.2228 0.2042 0.1884) (77 0.6674 0.47 0.3492 0.2728 0.2231 0.1912 0.1685 0.1524 0.141 0.1331) (AJs 0.6637 0.495 0.398 0.3365 0.2927 0.2591 0.2337 0.2131 0.1956 0.1813) (AK 0.6614 0.4933 0.3965 0.334 0.29 0.2556 0.2257 0.2027 0.183 0.1647) (ATs 0.6575 0.4845 0.388 0.3266 0.2827 0.2508 0.2259 0.2057 0.1888 0.1747) (AQ 0.6532 0.4804 0.3804 0.3175 0.2726 0.2376 0.2101 0.1858 0.1683 0.1521) (AJ 0.6467 0.4673 0.3673 0.3029 0.258 0.2241 0.197 0.1752 0.1569 0.1414) (KQs 0.6438 0.4828 0.3937 0.3377 0.2947 0.2639 0.2374 0.2156 0.1977 0.1825) (A9s 0.6404 0.4606 0.3617 0.2999 0.2574 0.2263 0.2032 0.184 0.1689 0.1556) (66 0.6394 0.4383 0.3205 0.2499 0.2054 0.178 0.1582 0.145 0.1353 0.1278) (AT 0.6389 0.4582 0.3555 0.2918 0.2467 0.2134 0.1878 0.1664 0.1492 0.1347) (KJs 0.6365 0.4712 0.3824 0.3244 0.2829 0.2513 0.2265 0.2071 0.1893 0.1755) (A8s 0.633 0.4531 0.354 0.2915 0.2498 0.219 0.1972 0.1785 0.1638 0.1511) (KTs 0.6302 0.4631 0.3713 0.3137 0.2736 0.2418 0.2185 0.1991 0.184 0.1703) (A7s 0.6261 0.4434 0.3436 0.2827 0.2425 0.2123 0.1908 0.1732 0.1592 0.1477) (KQ 0.6254 0.4559 0.3644 0.3051 0.2626 0.2289 0.2038 0.1814 0.1632 0.1476) (A9 0.6208 0.4325 0.3282 0.2635 0.2192 0.1866 0.1631 0.1429 0.127 0.1146) (A5s 0.6182 0.4351 0.3396 0.2804 0.2413 0.2142 0.1928 0.1757 0.1621 0.1513) (KJ 0.6167 0.4443 0.3509 0.291 0.2484 0.2166 0.1916 0.1702 0.1528 0.1387) (A6s 0.6162 0.4318 0.3326 0.2743 0.2351 0.2073 0.1867 0.1697 0.1564 0.1451) (QJs 0.6138 0.455 0.3702 0.3156 0.2762 0.2453 0.2211 0.2019 0.1855 0.1721) (A8 0.6132 0.4234 0.3185 0.2537 0.2109 0.1794 0.1557 0.1368 0.1216 0.1096) (K9s 0.613 0.439 0.3458 0.2865 0.2474 0.2179 0.1955 0.1764 0.1616 0.1501) (55 0.6097 0.4074 0.2951 0.2291 0.1908 0.1655 0.1491 0.1365 0.1291 0.1219) (KT 0.6095 0.4344 0.3391 0.2795 0.2377 0.2062 0.182 0.1623 0.1463 0.133) (A4s 0.6091 0.4264 0.3308 0.2737 0.2366 0.2094 0.1882 0.172 0.1584 0.1474) (QTs 0.6076 0.4459 0.3607 0.3052 0.2658 0.237 0.2141 0.1956 0.1803 0.1675) (A7 0.6049 0.4124 0.3085 0.2448 0.2018 0.1723 0.1499 0.1312 0.1164 0.1052) (A3s 0.6008 0.4184 0.323 0.2675 0.2316 0.204 0.1847 0.1685 0.1555 0.1443) (K8s 0.5985 0.4194 0.3251 0.2685 0.2291 0.2015 0.1799 0.1634 0.1499 0.1393) (A5 0.5976 0.4047 0.3026 0.2409 0.2012 0.1734 0.1514 0.1336 0.1196 0.1084) (A6 0.5945 0.4012 0.2965 0.2347 0.194 0.1654 0.1443 0.1275 0.113 0.1022) (QJ 0.5937 0.4274 0.34 0.2836 0.2426 0.2115 0.1873 0.167 0.1503 0.1374) (A2s 0.5928 0.4081 0.3147 0.2597 0.2244 0.1985 0.1793 0.1629 0.1503 0.1397) (K7s 0.5927 0.4121 0.3174 0.2617 0.224 0.1961 0.1761 0.1594 0.1461 0.1359) (K9 0.5922 0.4092 0.3108 0.251 0.21 0.1798 0.1562 0.138 0.123 0.1105) (Q9s 0.5909 0.4223 0.3346 0.2789 0.2404 0.2122 0.1898 0.1725 0.1592 0.1476) (JTs 0.5894 0.4354 0.3532 0.3017 0.2633 0.2351 0.2124 0.1954 0.1807 0.1688) (A4 0.5876 0.3943 0.2932 0.2339 0.1949 0.1673 0.146 0.1295 0.1164 0.105) (QT 0.5863 0.4173 0.3283 0.2712 0.2323 0.2017 0.1778 0.1589 0.1448 0.1325) (K6s 0.5858 0.4038 0.3101 0.2543 0.2173 0.1918 0.1719 0.1556 0.1434 0.1332) (A3 0.5784 0.3846 0.2848 0.2266 0.1894 0.1616 0.1416 0.1249 0.1122 0.1014) (K5s 0.5776 0.3947 0.3024 0.2488 0.2136 0.1876 0.1683 0.1531 0.1408 0.1309) (44 0.577 0.3741 0.2686 0.2114 0.1776 0.1564 0.1432 0.133 0.1256 0.1194) (Q8s 0.5765 0.4026 0.3132 0.2586 0.2226 0.1955 0.1748 0.1593 0.1469 0.1353) (K8 0.576 0.3878 0.2887 0.2304 0.19 0.1616 0.1402 0.1234 0.1101 0.0984) (J9s 0.5725 0.4117 0.3281 0.2753 0.238 0.2106 0.1896 0.1725 0.1605 0.1493) (A2 0.5694 0.3739 0.2755 0.2185 0.1811 0.1552 0.1352 0.1197 0.1065 0.0967) (K7 0.5692 0.3787 0.2813 0.2232 0.1835 0.1565 0.1344 0.1187 0.1053 0.095) (K4s 0.5691 0.3866 0.2953 0.2425 0.2075 0.1829 0.1635 0.1501 0.1374 0.1286) (Q9 0.5686 0.3918 0.3001 0.2436 0.2039 0.1758 0.153 0.1357 0.1211 0.11) (JT 0.5667 0.4056 0.3221 0.2696 0.2296 0.2016 0.1779 0.1612 0.147 0.1349) (Q7s 0.5614 0.3831 0.2948 0.2419 0.2061 0.1813 0.1627 0.1474 0.1358 0.1262) (K6 0.5607 0.3704 0.2729 0.2152 0.1777 0.1498 0.1304 0.1151 0.1023 0.0915) (K3s 0.5597 0.3785 0.2889 0.236 0.2025 0.1787 0.1601 0.1459 0.1343 0.1254) (J8s 0.557 0.3918 0.3075 0.2559 0.2203 0.1946 0.1748 0.1584 0.1466 0.1367) (T9s 0.5558 0.4035 0.3256 0.2742 0.2394 0.2124 0.1918 0.1757 0.1636 0.1529) (Q6s 0.5555 0.3762 0.2888 0.2363 0.2023 0.1778 0.1585 0.1449 0.1332 0.1227) (K5 0.5538 0.3615 0.2648 0.2087 0.1721 0.1458 0.1263 0.1112 0.0996 0.0892) (Q8 0.5531 0.3708 0.2787 0.2229 0.1848 0.1556 0.136 0.1202 0.1069 0.0968) (K2s 0.5514 0.3692 0.281 0.2304 0.1985 0.1746 0.157 0.1436 0.1322 0.1231) (J9 0.5491 0.38 0.295 0.2415 0.203 0.1747 0.1539 0.1375 0.1233 0.1127) (Q5s 0.5484 0.3695 0.2808 0.2313 0.1969 0.1739 0.156 0.1417 0.1303 0.1215) (33 0.5454 0.3437 0.2457 0.1946 0.1665 0.1502 0.1385 0.1299 0.1234 0.1176) (K4 0.5436 0.3524 0.2563 0.2011 0.1659 0.1406 0.1215 0.107 0.0961 0.0865) (J7s 0.542 0.373 0.2874 0.2375 0.2036 0.1794 0.1599 0.1462 0.1349 0.1258) (T8s 0.5417 0.3852 0.3055 0.2551 0.2205 0.1962 0.1766 0.1626 0.1506 0.1406) (Q4s 0.5392 0.3613 0.2743 0.2248 0.1916 0.1689 0.1527 0.1388 0.1271 0.1189) (Q7 0.5371 0.35 0.2581 0.2035 0.1674 0.1411 0.122 0.1079 0.0956 0.0865) (K3 0.5354 0.3431 0.248 0.1946 0.1602 0.1353 0.1182 0.104 0.0925 0.0834) (J8 0.5321 0.3596 0.2722 0.2202 0.1833 0.1565 0.1372 0.1215 0.1094 0.0993) (T9 0.532 0.3736 0.2929 0.2411 0.2038 0.1777 0.1571 0.1415 0.1288 0.1185) (Q3s 0.5316 0.3524 0.2671 0.2189 0.1868 0.1654 0.1474 0.135 0.1246 0.1161) (Q6 0.5305 0.3429 0.2512 0.1976 0.1619 0.1367 0.1177 0.104 0.0923 0.0833) (98s 0.5275 0.3775 0.3009 0.2516 0.2168 0.1916 0.1729 0.1586 0.1464 0.1372) (T7s 0.5264 0.3655 0.2859 0.2377 0.2045 0.1817 0.163 0.1496 0.1385 0.1296) (J6s 0.5262 0.3532 0.2704 0.2217 0.1894 0.1659 0.1489 0.1359 0.1255 0.1169) (K2 0.5254 0.3331 0.24 0.1886 0.1549 0.1317 0.1142 0.1006 0.0891 0.0809) (Q5 0.5227 0.3354 0.2444 0.1907 0.1566 0.1326 0.1141 0.1006 0.0903 0.0815) (Q2s 0.5224 0.3438 0.2598 0.2137 0.1824 0.1609 0.1441 0.1318 0.122 0.1129) (J5s 0.5214 0.348 0.2658 0.2172 0.1855 0.1636 0.1469 0.134 0.1233 0.1147) (J7 0.5164 0.3379 0.2518 0.1995 0.1651 0.1403 0.1216 0.1075 0.0967 0.0878) (T8 0.5157 0.3522 0.2715 0.2207 0.1851 0.1596 0.1404 0.1262 0.1148 0.1057) (Q4 0.5132 0.3249 0.2352 0.1835 0.1506 0.1276 0.1103 0.0973 0.0867 0.0787) (J4s 0.5126 0.3397 0.2586 0.2115 0.1814 0.1586 0.1432 0.1306 0.1203 0.1122) (22 0.5125 0.3132 0.2256 0.1817 0.1587 0.1448 0.1355 0.1279 0.1224 0.1163) (97s 0.5122 0.3594 0.2829 0.2357 0.2028 0.1796 0.1615 0.1481 0.1384 0.1293) (T6s 0.5106 0.3468 0.2675 0.2204 0.189 0.1669 0.1505 0.1378 0.1277 0.1188) (Q3 0.5044 0.3162 0.2278 0.1774 0.1455 0.1227 0.1062 0.0936 0.0837 0.0757) (J3s 0.5043 0.3315 0.2506 0.2054 0.1755 0.1541 0.1394 0.1275 0.118 0.1094) (87s 0.5028 0.3567 0.2828 0.2358 0.2033 0.1805 0.1633 0.1514 0.1403 0.132) (98 0.5009 0.3446 0.2668 0.2159 0.181 0.1558 0.1372 0.1228 0.1122 0.1037) (T7 0.5001 0.332 0.2499 0.2011 0.1671 0.1433 0.1252 0.1119 0.1017 0.0931) (J6 0.5 0.3182 0.2334 0.1823 0.1496 0.1259 0.1095 0.0966 0.0863 0.0782) (96s 0.4971 0.3404 0.2646 0.2192 0.1884 0.1668 0.1503 0.1377 0.127 0.1188) (J2s 0.4954 0.3231 0.2437 0.1999 0.1717 0.1513 0.1359 0.1236 0.1147 0.1066) (T5s 0.4952 0.3292 0.2501 0.2063 0.1761 0.1549 0.1396 0.1282 0.1188 0.1109) (J5 0.4941 0.3118 0.2268 0.1775 0.1454 0.1231 0.1065 0.094 0.084 0.0764) (Q2 0.494 0.3072 0.2206 0.1709 0.1408 0.1189 0.1026 0.0906 0.0804 0.0725) (T4s 0.4888 0.3213 0.2456 0.2012 0.1722 0.1513 0.1368 0.1246 0.1151 0.108) (86s 0.4859 0.3388 0.2662 0.2214 0.1909 0.1698 0.1538 0.1419 0.1319 0.1236) (97 0.4856 0.3255 0.2475 0.1996 0.1664 0.1427 0.126 0.1121 0.1023 0.0944) (J4 0.4846 0.3039 0.2184 0.1714 0.139 0.1175 0.1021 0.0904 0.0809 0.0731) (T6 0.4834 0.3115 0.2304 0.182 0.151 0.1272 0.1116 0.0997 0.0899 0.0822) (95s 0.4814 0.3222 0.2477 0.2033 0.1747 0.1539 0.1385 0.1266 0.1165 0.1096) (T3s 0.4798 0.3138 0.2375 0.1955 0.167 0.1478 0.1332 0.1209 0.1128 0.1053) (76s 0.4789 0.3382 0.2676 0.223 0.193 0.1722 0.1572 0.1452 0.1356 0.1278) (J3 0.4757 0.2944 0.2106 0.1645 0.1336 0.1133 0.0983 0.0862 0.0775 0.0703) (87 0.474 0.3238 0.2478 0.1999 0.1677 0.1446 0.1279 0.1153 0.1056 0.0983) (T2s 0.4715 0.3056 0.2314 0.1892 0.1628 0.1435 0.1298 0.1183 0.1097 0.1029) (85s 0.4703 0.3206 0.2488 0.205 0.177 0.1573 0.1424 0.1304 0.1219 0.1147) (96 0.4686 0.3059 0.2284 0.1813 0.1499 0.1283 0.1122 0.1003 0.0912 0.0836) (T5 0.4664 0.2914 0.212 0.1656 0.1365 0.1158 0.1004 0.0893 0.0801 0.073) (J2 0.4663 0.2856 0.2039 0.1576 0.1293 0.109 0.0945 0.083 0.0748 0.0675) (75s 0.4643 0.3202 0.2515 0.2098 0.181 0.1614 0.1472 0.1366 0.1285 0.1198) (94s 0.4639 0.3041 0.231 0.1884 0.1609 0.1414 0.1268 0.1159 0.1066 0.1) (T4 0.4598 0.2851 0.2057 0.1602 0.1323 0.1114 0.097 0.0854 0.0769 0.07) (65s 0.459 0.3217 0.2533 0.2122 0.1848 0.1654 0.1509 0.14 0.1311 0.1242) (86 0.458 0.3037 0.2299 0.1833 0.1542 0.1319 0.117 0.1057 0.0973 0.0899) (93s 0.4572 0.2974 0.2253 0.1837 0.1563 0.1377 0.1238 0.1129 0.1036 0.0972) (84s 0.4532 0.3021 0.2313 0.1905 0.1627 0.144 0.1297 0.1195 0.11 0.1038) (95 0.4517 0.2862 0.2096 0.1641 0.1348 0.1135 0.0998 0.0884 0.0796 0.073) (76 0.4502 0.3041 0.2314 0.1868 0.1561 0.1357 0.121 0.1099 0.1011 0.0943) (T3 0.4499 0.2775 0.1983 0.1542 0.1266 0.107 0.0928 0.0817 0.0742 0.0677) (92s 0.4487 0.2899 0.2194 0.1789 0.1523 0.1339 0.1208 0.1103 0.102 0.095) (74s 0.4454 0.3023 0.2339 0.1936 0.1668 0.1489 0.1345 0.1243 0.1156 0.1089) (54s 0.444 0.3104 0.2435 0.2044 0.1786 0.1607 0.1483 0.1374 0.1288 0.1224) (64s 0.4408 0.3049 0.2382 0.1975 0.1717 0.1535 0.1408 0.13 0.1219 0.1154) (T2 0.4407 0.2683 0.191 0.1486 0.1214 0.1027 0.0893 0.0794 0.0713 0.0646) (85 0.4407 0.2852 0.2114 0.1665 0.1386 0.1189 0.1042 0.0944 0.0862 0.0793) (83s 0.4345 0.2832 0.2138 0.1747 0.1498 0.1318 0.1185 0.1087 0.1005 0.0938) (75 0.4337 0.2848 0.2133 0.1717 0.1426 0.1241 0.1104 0.1002 0.0927 0.0862) (94 0.4332 0.2656 0.1904 0.1475 0.1203 0.1008 0.0872 0.078 0.0698 0.0635) (65 0.4281 0.2868 0.2169 0.1749 0.1468 0.1281 0.1149 0.1055 0.0979 0.091) (82s 0.4279 0.2772 0.2094 0.1718 0.1463 0.1285 0.1159 0.1062 0.0978 0.0909) (73s 0.4276 0.2833 0.2168 0.1773 0.1528 0.1356 0.1224 0.1128 0.1048 0.0985) (93 0.4264 0.2592 0.1849 0.1423 0.1153 0.0971 0.0841 0.0739 0.0665 0.0601) (53s 0.4248 0.292 0.228 0.1898 0.1658 0.1497 0.1375 0.1278 0.119 0.113) (63s 0.4236 0.2853 0.2201 0.1818 0.158 0.141 0.1283 0.1191 0.1107 0.1042) (84 0.4216 0.2648 0.1921 0.1486 0.1236 0.1044 0.0917 0.0813 0.0733 0.0676) (92 0.4173 0.2511 0.1784 0.1368 0.1108 0.0928 0.0801 0.071 0.0635 0.0569) (43s 0.4156 0.2826 0.2189 0.1825 0.1585 0.1431 0.1306 0.1218 0.1136 0.1071) (74 0.4141 0.2652 0.1954 0.1535 0.1279 0.1097 0.0973 0.0879 0.0804 0.0742) (54 0.4126 0.2739 0.2055 0.1658 0.1406 0.1234 0.1113 0.102 0.0946 0.0891) (64 0.4102 0.2676 0.199 0.1594 0.134 0.1165 0.1043 0.0943 0.0871 0.0815) (72s 0.4092 0.2647 0.1999 0.1623 0.1399 0.1236 0.1122 0.1026 0.0951 0.0892) (52s 0.4076 0.2737 0.2106 0.1748 0.1523 0.1373 0.1252 0.1159 0.109 0.102) (62s 0.4052 0.2669 0.2036 0.1666 0.1437 0.1279 0.1163 0.1072 0.0997 0.0931) (83 0.4021 0.2436 0.1742 0.1335 0.1084 0.0912 0.0791 0.0707 0.0636 0.0581) (42s 0.3982 0.2653 0.2033 0.1684 0.1467 0.1317 0.121 0.1119 0.1052 0.0981) (82 0.3962 0.2374 0.1688 0.1292 0.1048 0.0881 0.0765 0.0677 0.0605 0.0548) (73 0.3955 0.2447 0.1761 0.1375 0.1123 0.0957 0.0838 0.0749 0.0685 0.0627) (53 0.3938 0.2548 0.1883 0.1505 0.1274 0.1118 0.1009 0.0915 0.0854 0.0799) (63 0.3911 0.2475 0.1809 0.1419 0.1182 0.1018 0.091 0.0823 0.0752 0.0706) (32s 0.3895 0.2562 0.1951 0.1609 0.1406 0.1258 0.1155 0.1066 0.0991 0.0931) (43 0.3826 0.2444 0.1789 0.1428 0.12 0.1046 0.0937 0.0855 0.079 0.0735) (72 0.3738 0.2244 0.1581 0.1218 0.0989 0.0835 0.0726 0.0647 0.0586 0.0538) (52 0.3736 0.2342 0.1694 0.1342 0.1121 0.0975 0.0866 0.0795 0.0734 0.0683) (62 0.3709 0.2273 0.1622 0.1257 0.1032 0.088 0.0777 0.0699 0.0639 0.0587) (42 0.3631 0.225 0.1632 0.1271 0.1073 0.0932 0.0828 0.0755 0.0693 0.0643) (32 0.3539 0.2162 0.1536 0.1202 0.0996 0.0859 0.0769 0.0698 0.0632 0.0584))) #@102 Make a poker card from RANK and SUIT. RANK is one of `poker-ranks' and SUIT is one of `poker-suits'. (defalias 'poker-make-card #[(rank suit) " >\204\n\304\305!\210\n >\204\304\306!\210\307\n \"\310_\307 \"\\\207" [rank poker-ranks suit poker-suits cl--assertion-failed (memq rank poker-ranks) (memq suit poker-suits) cl-position 13] 4 (#$ . 13975)]) (put 'poker-make-card 'byte-optimizer 'byte-compile-inline-expand) #@52 The rank (a integer from 0 to 12) of a poker CARD. (defalias 'poker-card-rank #[(card) "\250\203\301Y\203\302X\204\303\304\305\300E\"\210\306\246\207" [card 0 51 signal wrong-type-argument (integer 0 51) 13] 5 (#$ . 14404)]) (put 'poker-card-rank 'byte-optimizer 'byte-compile-inline-expand) #@52 The suit (an integer from 0 to 3) of a poker CARD. (defalias 'poker-card-suit #[(card) "\250\203\301Y\203\302X\204\303\304\305\300E\"\210\306\245\207" [card 0 51 signal wrong-type-argument (integer 0 51) 13] 5 (#$ . 14713)]) (put 'poker-card-suit 'byte-optimizer 'byte-compile-inline-expand) #@56 The name of a poker CARD (a string of two characters). (defalias 'poker-card-name #[(card) "\250\203\301Y\203\302X\204\303\304\305\300E\"\210\306\211\250\203-\301Y\203-\302X\2045\303\304\307\300E\"\210\310\246)H\311\211\250\203N\301Y\203N\302X\204V\303\304\312\300E\"\210\310\245)HP\207" [card 0 51 signal wrong-type-argument (integer 0 51) ["2" "3" "4" "5" "6" "7" "8" "9" "T" "J" "Q" "K" "A"] (integer 0 51) 13 ["c" "d" "h" "s"] (integer 0 51)] 8 (#$ . 15022)]) (put 'poker-card-name 'byte-optimizer 'byte-compile-inline-expand) #@41 The Unicode character for a poker CARD. (defalias 'poker-card-unicode #[(card) " H\207" [poker-unicode-cards card] 2 (#$ . 15587)]) #@279 Calculate the value of a given 5 card poker HAND. The result is a 24 bit integer where the leftmost 4 bits (0-8) indicate the type of hand, and the remaining nibbles are rank values of decisive cards. The highest possible value is therefore #x8CBA98 and the lowest is #x053210. (defalias 'poker-hand-value #[(hand) "\306\307\211\203\202\n@\211\250\203 \310Y\203 \311X\204%\312\313\314 \303E\"\210 \315\246)\316\f \"\204z\317\nA\307\211+\203q+@\211\211\250\203T \310Y\203T \311X\204\\\312\313\314 \303E\"\210 \315\246)\f=\203h T+A\211+\204=\307 +\fB B)\nA\211\204 *\320\"\211,G-\321\322,\".\321\323,\",\324-\325=\203\246\326\202-\327=\203V.@\330=\203\305.A@\331=\203\305\332\211.\206\317.@\325.8Z\325=@\211\250\203\343 \310Y\203\343 \311X\204\353\312\313\333 \303E\"\210 \315\245)A/0/\203*0/@\211\250\203 \310Y\203 \311X\204\312\313\333 \303E\"\210 \315\245)=\203*/A\211/\204\372/*?1\2112\203?1\203?\334\202R2\203H\335\202R1\203Q\336\202R\310*\202,\337\232\203a\340\202,\341\232\203l\342\202,\343\232\203w\344\202,\345\232\205\346\347.@\350\"\347.A@\330\"-\351V\203\235\347\351.8\352\"\202\236\310-\331V\203\257\347\331.8\325\"\202\260\310-\325V\203\276\325.8\202\277\310&+\207" [hand result cards card rank count sort nil 0 51 signal wrong-type-argument (integer 0 51) 13 rassq 1 #[(lhs rhs) "@ @V\206@ @U\205A AV\207" [lhs rhs] 2] mapcar cdr car logior 4 1048576 5 12 3 (3 2 1 0 0) (integer 0 51) 8388608 4194304 5242880 (2 2 1) 2097152 (3 1 1) 3145728 (3 2) 6291456 (4 1) 7340032 ash 16 2 8 --dolist-tail-- rank-counts ranks-length ranks tail suit flush straight] 9 (#$ . 15727)]) #@47 Return non-nil if HAND1 is better than HAND2. (defalias 'poker-hand-> #[(hand1 hand2) "\302!\302 !V\207" [hand1 hand2 poker-hand-value] 3 (#$ . 17443)]) #@86 Sort HANDS (a list of list of cards) according to the value of the individual hands. (defalias 'poker-sort-hands #[(hands) "\301\302\303\301\304\"\305\306\307$\"\207" [hands mapcar cdr cl-sort #[(hand) "\301!B\207" [hand poker-hand-value] 2] > :key car] 7 (#$ . 17603)]) #@69 A list of all unique ways of taking N different elements from LIST. (defalias 'poker-combinations #[(n list) "\205>G\n\303=\203A\203@C\202C\2021\n =\203(C\2021\304\305\306\nSA\"\" \nV\205<\306\nA\"\244)\207" [list length n 1 mapcar #[(rest) "@ B\207" [list rest] 2] poker-combinations] 5 (#$ . 17883)]) #@99 Generate a list of possible 5 card poker hands from CARDS. CARDS is a list of 5 to 7 poker cards. (defalias 'poker-possible-hands #[(cards) "G\211\250\203 \306Y\203 \307X\204\310\311\312 \313E\"\210)G\307=\203\n@A\n@\nA\f@\fA@A@A@A \257 \257 BBBB \257 BBBB BBB \314!BB BBBB BBB BB \314\f!B BBBB BBB BB B\314\n! BBBB BBB BB B\f\257.\f\207\315\306\"\207" [cards #1=#:temp cdr car cddr cadr 5 7 signal wrong-type-argument (integer 5 7) (length cards) butlast poker-combinations cdddr caddr cddddr cadddr cdddddr caddddr cddddddr cadddddr] 22 (#$ . 18213)]) #@79 Find the best hand for a number of CARDS (usually a list of 6 or 7 elements). (defalias 'poker-best-hand #[(cards) "\306\307\310\n!\307\211\203'\f@\311 !\211 V\203  )\fA\211\204\307,\207" [best-hand max cards hand --dolist-tail-- value 0 nil poker-possible-hands poker-hand-value] 3 (#$ . 18920)]) #@38 The english name of poker card RANK. (defalias 'poker-rank-to-string #[(rank) "\301H\207" [rank ["2" "3" "4" "5" "6" "7" "8" "9" "10" "jack" "queen" "king" "ace"]] 2 (#$ . 19240)]) #@45 The plural english name of poker card RANK. (defalias 'poker-rank-to-plural-string #[(rank) "\301!\302P\207" [rank poker-rank-to-string "s"] 2 (#$ . 19428)]) #@100 Return a string description of the value of the given poker HAND. HAND is a list of 5 poker cards. (defalias 'poker-describe-hand #[(hand) "G\306=\204 \307\310!\210\311!\306\312\n\313Y\203-\314\315 \n\316_[\"\317\" B\nS\211\202 \237+\211:\205\345\f@\211\320=\203\236\fA\211%:\205\232%@&%A\211':\205\231'A\211(:\205\230(A\211):\205\227)A\211*:\205\226*A\211+?\205\225&\211,\321=\203\215\322\202\224\323\324\325,!\")))))*)\202\344 \326=\203*\fA\211-:\205&-@.-A\211/:\205%/@0/A\2111:\205$1@\2112\313=\205#1A\2113:\205\"3@\2114\313=\205!3A\2115:\205 5@\2116\313=\2055A\2117?\2050.8,\323\327\3308!\325,!#*))))))**)\202\344 \331=\203\266\fA\2119:\205\2629@:9A\211;:\205\261;@<;A\211=:\205\260=@\211>\313=\205\257=A\211?:\205\256?@\211@\313=\205\255?A\211A:\205\254A@\211B\313=\205\253AA\211C?\205\252<:DE\323\332\330D!\330E!#*))))))**)\202\344 \306=\203F\fA\211F:\205BF@GFA\211H:\205AH@IHA\211J:\205@J@KJA\211L:\205?L@MLA\211N:\205>N@ONA\211P?\205=OMKIG,QRST\323\333\325,!\325Q!\325R!\325S!\325T!&-*****)\202\344 \316=\203\253\fA\211U:\205\247U@VUA\211W:\205\246WA\211X:\205\245XA\211Y:\205\244YA\211Z:\205\243ZA\211[?\205\242V\211,\334=\203\232\335\202\241\323\336\325,!\")))))*)\202\344 \334=\2038\fA\211\\:\2054\\@]\\A\211^:\2053^@_^A\211`:\2052`@a`A\211b:\2051b@\211c\313=\2050bA\211d:\205/d@\211e\313=\205.dA\211f?\205-a_]D,g\323\337\330D!\325,!\325g!$+))))***)\202\344 \340=\203\305\fA\211h:\205\301h@ihA\211j:\205\300j@kjA\211l:\205\277l@mlA\211n:\205\276n@\211o\313=\205\275nA\211p:\205\274p@\211q\313=\205\273pA\211r?\205\272mkist,\323\341\330s!\330t!\325,!$+))))***)\202\344 \342=\203S\fA\211u:\205Ou@vuA\211w:\205Nw@xwA\211y:\205My@zyA\211{:\205L{@|{A\211}:\205K}@\211~\313=\205J}A\211?\205I|zxvE,QR\323\343\330E!\325,!\325Q!\325R!%,))****)\202\344 \313=\203\343\fA\211\200:\205\337\200@\201\200A\211\202:\205\336\202@\203\202A\211\204:\205\335\204@\205\204A\211\206:\205\334\206@\207\206A\211\210:\205\333\210@\211\210A\211\212?\205\332\211\207\205\203\201,QRST\323\344\325,!\325Q!\325R!\325S!\325T!&-*****)\202\344\312))\207" [hand value i #1=#:--cl-var-- #2=#:val #3=#:x7224 5 cl--assertion-failed (eq (length hand) 5) poker-hand-value nil 0 logand ash 4 15 8 12 "royal flush" format "%s high straight flush" poker-rank-to-string 7 "four %s, %s high" poker-rank-to-plural-string 6 "full house of %s and %s" "%s high flush, %s %s %s and %s kickers" 3 "5 high straight (steel wheel)" "%s high straight" "three %s, %s high, %s kicker" 2 "wwo pairs of %s and %s, %s high" 1 "a pair of %s, %s high, %s and %s kickers" "high card %s, %s %s %s and %s kickers" #4=#:x7225 #5=#:x7226 #6=#:x7227 #7=#:x7229 #8=#:x7231 #9=#:x7233 #10=#:x7235 high #11=#:x7236 #12=#:x7237 #13=#:x7238 #14=#:x7239 #15=#:x7240 #16=#:x7241 #17=#:x7242 #18=#:x7243 #19=#:x7244 #20=#:x7245 #21=#:x7246 four #22=#:x7247 #23=#:x7248 #24=#:x7249 #25=#:x7250 #26=#:x7251 #27=#:x7252 #28=#:x7253 #29=#:x7254 #30=#:x7255 #31=#:x7256 #32=#:x7257 three two #33=#:x7258 #34=#:x7259 #35=#:x7260 #36=#:x7261 #37=#:x7262 #38=#:x7263 #39=#:x7264 #40=#:x7265 #41=#:x7266 #42=#:x7267 #43=#:x7268 k1 k2 k3 k4 #44=#:x7269 #45=#:x7270 #46=#:x7271 #47=#:x7273 #48=#:x7275 #49=#:x7277 #50=#:x7279 #51=#:x7280 #52=#:x7281 #53=#:x7282 #54=#:x7283 #55=#:x7284 #56=#:x7285 #57=#:x7286 #58=#:x7287 #59=#:x7288 #60=#:x7289 #61=#:x7290 kicker #62=#:x7291 #63=#:x7292 #64=#:x7293 #65=#:x7294 #66=#:x7295 #67=#:x7296 #68=#:x7297 #69=#:x7298 #70=#:x7299 #71=#:x7300 #72=#:x7301 two1 two2 #73=#:x7302 #74=#:x7303 #75=#:x7304 #76=#:x7305 #77=#:x7306 #78=#:x7307 #79=#:x7308 #80=#:x7309 #81=#:x7310 #82=#:x7311 #83=#:x7312 #84=#:x7313 #85=#:x7314 #86=#:x7315 #87=#:x7316 #88=#:x7317 #89=#:x7318 #90=#:x7319 #91=#:x7320 #92=#:x7321 #93=#:x7322 #94=#:x7323] 9 (#$ . 19594)]) #@43 Return a shuffled deck of 52 poker cards. (defalias 'poker-random-deck #[nil "\301\302\303\304\"!\305\"\207" [poker-deck append cookie-shuffle-vector apply vector nil] 5 (#$ . 23671)]) #@130 Estimate the strength of POCKET and COMMUNITY cards against number of OPPONENTS. The optional number of OPPONENTS defaults to 1. (defalias 'poker-strength #[(pocket &optional community opponents) "\204 \206 \306\307\n! \2368\206\310\311\f\310W\203\312 \313 \206,\306\314\"\n\314\211\203R@\315\"A\211\204<*\314\211\203s@\315\"A\211\204]*\316\310W\203\307 \206\207\306\310  W\203\275\211A\242!\" #\"#!\"#HBI\210+ T\211 \202\216*T\211\202|*\317\314\"$\320GZ\310%%W\203\364\211A\242$B$%T\211%\202\331* \321\322\323\306\nBC\322\324\"\244\"\325\326\327$@@\\+T\211\202*\330 !\f\245*\207" [community opponents pocket poker-pre-flop-starting-hands iterations wins 1 poker-starting-hand-name 0 300 poker-random-deck make-vector nil delete 2 append 5 cl-sort mapcar #[(info) "\302\303A \"!\241\210\207" [info board poker-best-hand append] 5] #[(cards) "\301B\207" [cards 0] 2] poker-hand-> :key cdr float i --dotimes-limit-- players deck card --dolist-tail-- cards player #1=#:v #2=#:v #3=#:v board _] 9 (#$ . 23864)]) (defalias 'poker-starting-hand-name #[(pocket) "G\306=\204 \307\310!\210@A@=\203\307\311!\210\312\313\314\315\316\317\320\321\322\323\324\325\326\327& @\211\250\203< \330Y\203< \331X\204D\332\333\334 \301E\"\210 \335\246)A@\211\250\203] \330Y\203] \331X\204e\332\333\334 \301E\"\210 \335\246)@\211\250\203} \330Y\203} \331X\204\205\332\333\336 \301E\"\210 \335\245)A@\211\250\203\236 \330Y\203\236 \331X\204\246\332\333\336 \301E\"\210 \335\245)=\f W\203\276\f# #)\f\337\340$\"W\203\342 \337\340$\"W\203\342\n\204\342\f\306\\\340_ \306\\\\\202\360\341 \fH H\n\205\356\342Q!,\207" [pocket card suited rank2 rank1 rank-name 2 cl--assertion-failed (eq (length pocket) 2) (not (eq (nth 0 pocket) (nth 1 pocket))) vector "2" "3" "4" "5" "6" "7" "8" "9" "T" "J" "Q" "K" "A" 0 51 signal wrong-type-argument (integer 0 51) 13 (integer 0 51) cl-position 10 intern "s" tmp poker-ranks] 15]) (defalias 'poker-pre-flop-starting-hands #[(opponents) "\306 \306\211\203> @ \306\211\2036 @\n\f=\203\204\n\307\211 >\204-\310\311!\210 >\2048\310\312!\210\313 \"\314_\313 \"\\*\f\315\211 >\204U\310\311!\210 >\204`\310\312!\210\313 \"\314_\313 \"\\*D\316\306#\317!)BB\202/\313\n \"\313\f \"W\203\231\n\f)\320\306\211\203. @\n\307\211 >\204\265\310\311!\210 >\204\300\310\312!\210\313 \"\314_\313 \"\\*\f\203\330\307\202\331\315\211 >\204\346\310\311!\210 >\204\361\310\312!\210\313 \"\314_\313 \"\\*D\317!\321\"\204&\322 \210\323\324\"\210\316\306#BB* A\211\204\242* A\211\204* A\211\204\n\306\325\326\327\330$+\207" [hands poker-ranks rank1 --dolist-tail-- rank2 suit nil clubs cl--assertion-failed (memq rank poker-ranks) (memq suit poker-suits) cl-position 13 hearts poker-strength poker-starting-hand-name (nil t) rassq accept-process-output message "%S" cl-sort > :key cdr rank poker-suits pocket opponents tmp suited code] 6]) #@43 Return the odds when BET is added to POT. (defalias 'poker-pot-odds #[(bet pot) "\302! \\\245\207" [bet pot float] 3 (#$ . 26982)]) #@50 Randomly choose between FOLD%, CALL% and RAISE%. (defalias 'poker-random-fold-call-raise #[(fold% call% raise%) "\304 \n#\305U\204\306\307!\210\310\305!\211W\203\311\2029  \\W\203(\312\2029 \304 \n#W\2036\313\2029\314\315!)\207" [fold% call% raise% value + 100 cl--assertion-failed (= (+ fold% call% raise%) 100) random fold call raise error "Random FCR Error"] 6 (#$ . 27122)]) #@129 Create a new poker player with NAME and FCR-FN. FCR-FN specifies a function to use when a fold-call-raise decision is required. (defalias 'poker-make-player #[(name fcr-fn) "\300B\302\303B\304\303B\305\306B\301 B\257\207" [name fcr-fn stack 0 wagered pocket nil] 6 (#$ . 27522)]) #@34 Return the name of poker PLAYER. (defalias 'poker-player-name #[(player) "\301\236A\207" [player name] 2 (#$ . 27810)]) #@45 Return the remaining stack of poker PLAYER. (defalias 'poker-player-stack #[(player) "\301\236A\207" [player stack] 2 (#$ . 27937)]) #@34 Make PLAYER bet AMOUNT of chips. (defalias 'poker-player-bet #[(player amount) "\305! ^\211\306U\203\307\310!\210\n\306U\204.\311\236\211\211A\nZ\241\210)\312\236\211\211A\n\\\241\210)\n)\207" [player amount actual #1=#:v #2=#:v poker-player-stack 0 message "WARNING: Actual is 0." stack wagered] 4 (#$ . 28077)]) #@30 Give PLAYER AMOUNT of chips. (defalias 'poker-player-payout #[(player amount) "\303\236\211\211A\n\\\241\210)\n\207" [player #1=#:v amount stack] 4 (#$ . 28406)]) #@63 Return the amount of chips currently wagered by poker PLAYER. (defalias 'poker-player-wagered #[(player) "\301\236A\207" [player wagered] 2 (#$ . 28577)]) #@51 Return the current pocket (hole) cards of PLAYER. (defalias 'poker-player-pocket #[(player) "\301\236A\207" [player pocket] 2 (#$ . 28739)]) #@48 Make PLAYER fold and forget about their cards. (defalias 'poker-player-fold #[(player) "\301\236\302\241\207" [player pocket nil] 2 (#$ . 28887)]) (defalias 'poker-player-active-p #[(player) "\301!\205 \302!\303V\207" [player poker-player-pocket poker-player-wagered 0] 2]) (defalias 'poker-player-all-in-p #[(player) "\301!\205 \302!\303U\207" [player poker-player-active-p poker-player-stack 0] 2]) (defalias 'poker-player-can-bet-p #[(player) "\301!\205 \302!\303V\207" [player poker-player-pocket poker-player-stack 0] 2]) (defalias 'poker-player-best-hand #[(player community) "\302!G\303Y\204 \304\305!\210 G\306Y\204\304\307!\210\310\311\302! \"!\207" [player community poker-player-pocket 2 cl--assertion-failed (>= (length (poker-player-pocket player)) 2) 3 (>= (length community) 3) poker-best-hand append] 4]) (defalias 'poker-player-give-card #[(player card) "\250\203\303Y\203\304X\204\305\306\307\300E\"\210\310 \236\211\nAB\241)\207" [card player #1=#:v 0 51 signal wrong-type-argument (integer 0 51) pocket] 6]) (defalias 'poker-player-fcr-fn #[(player) "\301\236A\207" [player fcr-fn] 2]) (defalias 'poker-player-fcr #[(player pot amount-to-call max-raise board opponents) "\306! \n \f &\207" [player pot amount-to-call max-raise board opponents poker-player-fcr-fn] 7]) (defalias 'poker-read-fold-call-raise #[(pot to-call max-raise &optional prompt) "\306\307 \310\311\312#\210\310\313\314#\210 \315V\203\310\316\317#\210\310\320\321#\210)\322\n\204g\323\324\325\f\2064\326 # \315V\203L#\315U\203H\327\202X\330\202X#\315U\203W\331\202X\332%!\210\333\334\335 !\"\211\203,\n\314=\203q\322\202\255\n\312=\203|#\202\255\n\317=\205\255# T\211 V\203\232\336\324\337 \"!\211\202\211\250\204\251\340\341\342\317E\"\210)\\+\207" [map max-raise action cursor-in-echo-area prompt pot t make-sparse-keymap define-key [99] call [102] fold 0 [114] raise [113] quit nil message format "%s%d in pot, %d to call: (f)old%s: " "" ", (c)heck or (r)aise" ", (c)all or (r)aise" " or (c)heck" " or (c)all" lookup-key vector read-event read-number "Raise by (max %d): " signal wrong-type-argument integer to-call] 9]) (defalias 'poker-interactive-fcr #[(player pot due max-raise board opponents) "\305 \n\306\307\310\311\312 !\313#\f\203\314\310\311\f\315#\316Q\202\317\320 !$$\207" [pot due max-raise player board poker-read-fold-call-raise format "%s%s, %d stack, " mapconcat poker-card-name poker-player-pocket ", " "(" " " ")" "" poker-player-stack] 12]) (defalias 'poker-automatic-fcr #[(player pot due max-raise board &optional opponents) "\306\307! \n#\310\f \"\" \"\245\211#\311W\203\"\312\313\314\315#\202E#\316W\2031\312\317\320\321#\202E#\322W\203@\312\323\324\325#\202E\312\323\326\327#\211$\330>\203`\331!\fZ\332W\203` \333W\203`\334$$\335=\203p \336W\203p\337$\f\323U\203\200$\334=\203\200\337$$\334=\203\213\340\202\243$\337=\203\226\f\202\243$\335=\205\243\f\341%^\\,\207" [player board opponents strength due pot poker-strength poker-player-pocket poker-pot-odds 0.8 poker-random-fold-call-raise 95 1 4 1.0 80 15 5 1.3 0 60 40 25 75 (call raise) poker-player-stack 200 0.5 fold raise 0.1 call nil 100 pot-odds rate-of-return action max-raise] 5]) #@43 Make PLAYER the first element of PLAYERS. (defalias 'poker-rotate-to-first #[(player players) "\304 \"\211\205 G\nZ\305\306 \"\307 \"\"))\207" [player players position shift cl-position append last butlast] 6 (#$ . 32169)]) (defalias 'poker-next-players #[(player players) "\302 \"A\207" [player players poker-rotate-to-first] 3]) (defalias 'poker-next-player #[(player players) "\302 \"@\207" [player players poker-next-players] 3]) #@74 Return the amount of chips in the pot, the total wagered by all PLAYERS. (defalias 'poker-pot #[(players) "\301\302\303\304\"\"\207" [players apply + mapcar poker-player-wagered] 5 (#$ . 32618)]) #@66 Determine the maximum amount of chips wagered by any of PLAYERS. (defalias 'poker-current-wager #[(players) "\301\302\303\304\"\"\207" [players apply max mapcar poker-player-wagered] 5 (#$ . 32821)]) #@39 Collect AMOUNT of wager from PLAYERS. (defalias 'poker-collect-wager #[(amount players) "\306 \307\211\2037 @\304\n\236 \fAV\203$\fA\\\f\306\241\210\202/ \\\f\211A Z\241\210) A\211\204\n\307+\207" [total players player --dolist-tail-- wagered amount 0 nil] 4 (#$ . 33028)]) #@74 Distribute chips to WINNERS from PLAYERS accounting for split-pot rules. (defalias 'poker-distribute-winnings #[(winners players) "\204\306\307!\210 G\310V\204\306\311!\210G\310U\203&\312@\313\314@! \"\"\207\315\316\317\314\"\"\313\n \"\211G\245 \fG_Z\312@\f \\\"\210A\320\211\203f@\312\f\"\210A\211\204R* ,\207" [winners players lowest total each leftover cl--assertion-failed (not (null winners)) 1 (> (length players) 1) poker-player-payout poker-collect-wager poker-player-wagered apply min mapcar nil player --dolist-tail--] 6 (#$ . 33324)]) #@86 Determine the maximum amount allowed to raise for PLAYER considering PLAYERS stacks. (defalias 'poker-player-max-raise #[(player players) "\303\304\305\306\307 \"\"\"\304!\n\203\310\311\n\"\202\312^)\207" [player players other-stacks mapcar poker-player-stack cl-remove cl-remove-if-not poker-player-can-bet-p apply max 0] 7 (#$ . 33911)]) (defalias 'poker-interactive-p #[(players) "\301\302\303\304$\207" [players cl-find poker-interactive-fcr :key poker-player-fcr-fn] 5]) #@29 Ask PLAYER for next action. (defalias 'poker-dealer-ask-player #[(player players board allow-raise) "\306! \203\307\n\"\202\310\311!\312\n!Z\313\314\"GS \310V\204+\315\316!\210\317\n\f  &\211\203O\250\203K\fZ X\204O\315\320!\210\204c\321\322\323\324\n!\"!\210\325\n!\202\247\310U\203s\321\326\324\n!\"\202\247\250\205\247\fU\203\214\321\327\324\n!#\210\202\242\fY\204\227\315\330!\210\321\331\324\n!\fZ#\210\332\n\"-\207" [players allow-raise player opponents amount-to-call max-raise poker-pot poker-player-max-raise 0 poker-current-wager poker-player-wagered cl-remove-if-not poker-player-pocket cl--assertion-failed (> opponents 0) poker-player-fcr (or (null decision) (and (integerp decision) (<= (- decision amount-to-call) max-raise))) message format "%s folds." poker-player-name poker-player-fold "%s checks." "%s calls %d." (>= decision amount-to-call) "%s raises by %d." poker-player-bet pot board decision] 8 (#$ . 34401)]) #@62 Deal a round of texas holdem poker with MIN-BET for PLAYERS. (defalias 'poker-dealer #[(min-bet deck board players) "G\306V\204 \307\310!\210 \204\341\311!\312U\203\341\313\314!\210\313\315\316\n@! \317\245#\210\320\n@ \317\245\"\210\313\321\316\nA@! #\210\320\nA@ \"\210\313\322!\210\317\312\f W\203{\323@\211A\203sA@@\324@B\211AB\242\"\210AA\211A\204Y*\fT\211\202J*\313\325!\210\326\nA@\"\323@\211A\203\256A@@\327@!\312U\204\245\330@ \331$\210AA\211A\204\217*\327\nA@!\312U\204\330\332\333\"G\306V\204\317\334\nA@!\335!W\203\330\330\nA@ \331$\210\336 B $)\207\311!\312U\204 \332\337\"G\306U\203 \332\337\"C\313\340\316C@!\341C\"#\210C)\207 \204e\342\343\344A@\"\"\203e\313\345!\210\342\346\344A@\"\"\323@\211A\203\\A@@\332\333\"G\306V\204K\334@!\335!W\203S\330@ \323$\210AA\211A\2041*\336 B $\207 \204\317\347\312\f W\203\204B\211AB\242 B\fT\211\202n*\313\350\351\352 \353#\"\210\332\333\"\323@\211A\203\306A@@\332\333\"G\306V\204\265\334@!\335!W\203\275\330@ \331$\210AA\211A\204\233*\336 B $\207 G\347U\203 \342\354\"\203 \313\355!\210\342\356\"\323@\211A\203A@@\330@ \323$\210AA\211A\204\356*\336 B $\207 G\347U\203lB\211AB\242 B\313\357\351\352 \353#\"\210 \317_\332\333\"\323@\211A\203cA@@\332\333\"G\306V\204R\334@!\335!W\203Z\330@ \331$\210AA\211A\2048*\336 B $\207 G\360U\203\252\342\361\"\203\252\313\362!\210\342\363\"\323@\211A\203\241A@@\330@ \323$\210AA\211A\204\213*\336 B $\207 G\360U\203B\211AB\242 B\313\364\351\352 \353#\"\210\332\333\"\323@\211A\203\374A@@\332\333\"G\306V\204\353\334@!\335!W\203\363\330@ \331$\210AA\211A\204\321*\336 B $\207 G\365U\203C\342\366\"\203C\313\367!\210\342\370\"\323@\211A\203:A@@\330@ \323$\210AA\211A\204$*\336 B $\207 G\365U\2034\311!\312U\203V\307\371!\210\332\337\"\323\372!DE\211FG\306V\204r\373\374F#\210F\203-FG\306U\203\244\313\375\316F@!\341F\"#\210D\203\226\376\317!\210FEBE\323\211F\202t\377\201H\201I\201JF\"!@!G\342\201KF\"CF\323@\211A\203A@@\313\201L\316@!\351\352\201M@!\353#\201N\201O@ \"!$\210D\203\367\376\317!\210AA\211A\204\312*\313\375\351\316C\201P#\341C\"#\210D\203\376\317!\210CEBE*\332\337\"\211F\204w E\237+B\207\373 B \257\207" [players board blinds min-bet _ --dotimes-limit-- 1 cl--assertion-failed (> (length players) 1) poker-pot 0 message "Collecting blinds." "%s posts %d small blind." poker-player-name 2 poker-player-bet "%s posts %d big blind." "Dealing cards to players." nil poker-player-give-card "Initial betting round." poker-next-players poker-player-stack poker-dealer-ask-player t cl-remove-if-not poker-player-can-bet-p poker-player-wagered poker-current-wager poker-dealer poker-player-active-p "%s silently wins %d." poker-distribute-winnings cl-remove-if #[(player) "\302!\303U\206\304!?\206\305!\206\302!\306 !U\207" [player players poker-player-wagered 0 poker-player-pocket poker-player-all-in-p poker-current-wager] 3] poker-rotate-to-first "Pre flop, second round of bets." #[(player) "\302!\303U\206\304!?\206\305!\206\302!\306 !U\207" [player players poker-player-wagered 0 poker-player-pocket poker-player-all-in-p poker-current-wager] 3] 3 "The flop: %s" mapconcat poker-card-name " " #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] "The flop, second round of bets." #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] "The turn: %s" 4 #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] "The turn, second round of bets." #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] "The river: %s" 5 #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] "Last betting round." #[(player) "\302!?\206\303!\304 !U\207" [player players poker-player-can-bet-p poker-player-wagered poker-current-wager] 3] (not (zerop (poker-pot players))) poker-interactive-p error "In-play to small: %S %S" "%s wins %d." sit-for poker-hand-value player --dolist-tail-- deck winners game-interactive-p groups in-play best-hand-value poker-sort-hands mapcar #[(player) "\302 \"\207" [player board poker-player-best-hand] 3] #[(player) "\303\304 \"!\nW\207" [player board best-hand-value poker-hand-value poker-player-best-hand] 4] "%s shows %s, %s." poker-player-pocket poker-describe-hand poker-player-best-hand ", "] 9 (#$ . 35394)]) #@38 Play a game of texas hold 'em poker. (defalias 'poker #[(initial-stack min-bet players) "G\306V\204 \307\310!\210\311\211\203+\n@\312\313\314 ! #\210\315 \236 \241\210\nA\211\204*\316!\317G!8\311\211/0\320/\"/\203\3770\203S\316!\203\377\312\321 GTG#\210\3221\323 \311$ B\324\325\"\210\326\327\320/\"\"A\242/\330\331\"\2112\203\214\326\332\"\f2\244)\312\333\334\335\336\337\311\"\340\341\342$\343#\"\210/\203\305/\235\204\256\307\344!\210G3\320/\"3GU\204\304\307\345!\210)\346 \2100\203C\316!\204C\312\347GT\2114\350=\203\344\351\202\3714\352=\203\357\353\202\37145\354\3555\"))\"\210\202C0\203\316!\203\312\356!\210 ,B\207" [players player --dolist-tail-- initial-stack losers rounds 1 cl--assertion-failed (> (length players) 1) nil message "%s receives %d chips." poker-player-name stack poker-interactive-p random poker-rotate-to-first "Round %d, %d players." poker-dealer poker-random-deck mapc poker-player-fold cl-remove-if #[(player) "\301!\302U\207" [player poker-player-stack 0] 2] cl-remove-if-not #[(player) "\301!\302U\207" [player poker-player-stack 0] 2] #[(player) " \235\205\302\303\304!\"\210\305\207" [player lost message "%s drops out." poker-player-name t] 4] "Remaining players: %s" mapconcat #[(player) "\301\302\303!\304!#\207" [player format "%s (%d)" poker-player-name poker-player-stack] 5] cl-sort append > :key poker-player-stack " " (member button-player players) (= count (length players)) accept-process-output "You drop out in %s place." 2 "2nd" 3 "3rd" format "%dth" "You are the winner." button-player game-interactive-p min-bet lost count rank n] 10 (#$ . 40192) (list (read-number "Initial stack: " 1000) (read-number "Minimum bet: " 50) (list (poker-make-player "Angela" #'poker-automatic-fcr) (poker-make-player "Bettina" #'poker-automatic-fcr) (poker-make-player "Christina" #'poker-automatic-fcr) (poker-make-player "Daniela" #'poker-automatic-fcr) (poker-make-player "Emil" #'poker-automatic-fcr) (poker-make-player "Frank" #'poker-automatic-fcr) (poker-make-player "Günther" #'poker-automatic-fcr) (poker-make-player "Harald" #'poker-automatic-fcr) (poker-make-player "Ingrid" #'poker-automatic-fcr) (poker-make-player (user-full-name) #'poker-interactive-fcr)))]) (byte-code "\301\302\303#\210\304\305\306\307\305\310\311\310\312\310&\"\210\304\313\306\307\313\310\314\310\312\310&\"\210\304\315\306\307\315\310\316\310\312\310&\"\210\304\317\306\307\317\310\320\310\312\310&\"\210\321\317!\207" [menu-bar-games-menu define-key [poker] (menu-item "Texas hold 'em poker" poker :help "Play Texas hold 'em poker") ert-set-test poker-combinations record ert-test nil #[nil "\306\3071\310\311\312\313\314\n\315\"\"G)D0\202 \316 @ A)D\317\320\321\216\322\f\"\211)\2047\323!\210) \210+\306\3241P\310\325\312\326\n\"G)D0\202Z\316 @ A)D\327\320\330\216\322\"\211)\204v\323!\210)+\207" [#1=#:fn-7324 signal-hook-function poker-deck err #2=#:args-7325 #3=#:value-7326 equal (error) ert--should-signal-hook 21 poker-combinations 5 last 7 signal #4=#:ert-form-evaluation-aborted-7327 nil #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#1# #2# #3# -explainer- #6=#:form-description-7328 (should (equal 21 (length (poker-combinations 5 (last poker-deck 7))))) :form eql #4# :value equal ert-explainer :explanation apply ert--signal-should-execution] 6] apply ert-fail (error) 1326 2 #5=#:ert-form-evaluation-aborted-7332 #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#7=#:fn-7329 #8=#:args-7330 #9=#:value-7331 -explainer- #10=#:form-description-7333 (should (equal 1326 (length (poker-combinations 2 poker-deck)))) :form eql #5# :value equal ert-explainer :explanation apply ert--signal-should-execution] 6] #6# #7# #8# #9# #10#] 6] :passed poker-possible-hands #[nil "\306\3071\310\311\312!\313\314\315\")D0\202\316\n@\nA)D\317\320\321\216\322 \"\211)\2043\323 !\210)\f\210+\306\3241M\310\311\325!\313\314\326\")D0\202W\316\n@\nA)D\327\320\330\216\322\"\211)\204s\323!\210)+\207" [#11=#:fn-7334 signal-hook-function err #12=#:args-7335 #13=#:value-7336 #14=#:form-description-7338 equal (error) ert--should-signal-hook poker-possible-hands #15=(1 2 3 4 5 6 7) poker-combinations 5 #16=(1 2 3 4 5 6 7) signal #17=#:ert-form-evaluation-aborted-7337 nil #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#11# #12# #13# -explainer- #14# (should (equal (poker-possible-hands '#15#) (poker-combinations 5 '#16#))) :form eql #17# :value equal ert-explainer :explanation apply ert--signal-should-execution] 6] apply ert-fail (error) #18=(1 2 3 4 5 6) #19=(1 2 3 4 5 6) #20=#:ert-form-evaluation-aborted-7342 #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#21=#:fn-7339 #22=#:args-7340 #23=#:value-7341 -explainer- #24=#:form-description-7343 (should (equal (poker-possible-hands '#18#) (poker-combinations 5 '#19#))) :form eql #20# :value equal ert-explainer :explanation apply ert--signal-should-execution] 6] #21# #22# #23# #24#] 4] poker-hand-value #[nil "\306\307 \306\211\203} @\310\311\312\nD\313\nD\314\nD\315\nD\316\nD\257\"!\306\211\203u @\317\3201B\321\322\f!)\323D0\202N\324@A)D \325!\306\"\326\216\327  \"\211!)\204i\330\"!\210)!\210+ A\211\204,* A\211\204\f* \306#\211\205v @# \306$\211\203m @$ \306%\211\203e @% \306&\211\203] @& \306'\211\203U @'#$=\203\337$%=\203\337%&=\203\337&'=\204N\310\331\312#D\313$D\314%D\315&D\316'D\257\"!\306\211\203M @\317(\3321\321\322\f!)\333D0\202%\324(@A)D)\334*\306+\335\216\327()\"\211*)\204A\330+!\210)*\210+ A\211\204* A\211\204\273* A\211\204\256* A\211\204\241* A\211\204\224* A\211\204\207\306+\207" [#25=#:--cl-permute-- poker-suits suit --dolist-tail-- hand #26=#:fn-7344 nil #[(list) "\205A\204\fC\207\301\302\"\207" [list cl-mapcan #[(elt) "\303\304\305 \n\"!\"\207" [#25# elt list mapcar #[(l) " B\207" [elt l] 2] remq] 6]] 3] mapcar #[(args) "\301\302\"\207" [args apply poker-make-card] 3] ace king queen jack 10 eq (error) ert--should-signal-hook poker-hand-value 9222808 signal #27=#:ert-form-evaluation-aborted-7347 #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#26# #29=#:args-7345 #30=#:value-7346 -explainer- #31=#:form-description-7348 (should (eq (poker-hand-value hand) 9222808)) :form eql #27# :value eq ert-explainer :explanation apply ert--signal-should-execution] 6] apply ert-fail #[(args) "\301\302\"\207" [args apply poker-make-card] 3] (error) 5028504 #28=#:ert-form-evaluation-aborted-7352 #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#32=#:fn-7349 #33=#:args-7350 #34=#:value-7351 -explainer- #35=#:form-description-7353 (should (eq (poker-hand-value hand) 5028504)) :form eql #28# :value eq ert-explainer :explanation apply ert--signal-should-execution] 6] signal-hook-function err #29# #30# #31# s1 s2 s3 s4 s5 #32# #33# #34# #35#] 10] poker #[nil "\306\307\310\"\306\311\310\"\306\312\310\"\306\313\310\"\306\314\310\"\306\315\310\"\306\316\310\"\306\317\310\"\306\320\310\"\306\321\310\"\257\n\211G\322V\205x\323\3241M\325\326\327\330\331#@@!G\330_)D0\202V\332 @ A)D\333\334 \335\216\336 \f\"\211)\204m\337 !\210) \210+A\211\202,)\207" [players #36=#:fn-7354 signal-hook-function err #37=#:args-7355 #38=#:value-7356 poker-make-player "Angela" poker-automatic-fcr "Bettina" "Christoph" "Daniela" "Emilia" "Franz" "Günter" "Harald" "Isabella" "Jakob" 1 equal (error) ert--should-signal-hook poker-player-stack poker 1000 100 signal #39=#:ert-form-evaluation-aborted-7357 nil #[nil "\305C\306 BD\244\307\n\310\"?\205\311\nD\244\312\313N\211\205\"\314\315 \"D)\244\316\f!\207" [#36# #37# #38# -explainer- #40=#:form-description-7358 (should (equal (poker-player-stack (caar (poker 1000 100 players))) (* 1000 (length players)))) :form eql #39# :value equal ert-explainer :explanation apply ert--signal-should-execution] 6] apply ert-fail #40#] 13] provide] 10)