From aa7e03d0134afadef313476f354f12eb89c74de6 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 00:04:31 -0400 Subject: [PATCH 01/65] Add poker hand evaluation vocab --- extra/poker/arrays/arrays.factor | 1261 ++++++++++++++++++++++++++++++ extra/poker/authors.txt | 1 + extra/poker/poker-tests.factor | 16 + extra/poker/poker.factor | 179 +++++ extra/poker/summary.txt | 1 + 5 files changed, 1458 insertions(+) create mode 100644 extra/poker/arrays/arrays.factor create mode 100644 extra/poker/authors.txt create mode 100644 extra/poker/poker-tests.factor create mode 100644 extra/poker/poker.factor create mode 100644 extra/poker/summary.txt diff --git a/extra/poker/arrays/arrays.factor b/extra/poker/arrays/arrays.factor new file mode 100644 index 0000000000..b415265348 --- /dev/null +++ b/extra/poker/arrays/arrays.factor @@ -0,0 +1,1261 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +IN: poker.arrays + +! This is a lookup table for all flush hands. A zero means that specific +! combination is not possible with this type of hand. +CONSTANT: flushes-table +{ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 1599 0 0 0 0 0 0 0 1598 0 0 0 1597 0 1596 8 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 1595 0 0 0 0 0 0 0 1594 0 0 0 1593 0 1592 1591 0 0 0 0 0 0 0 0 1590 +0 0 0 1589 0 1588 1587 0 0 0 0 1586 0 1585 1584 0 0 1583 1582 0 7 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 1581 0 0 0 0 0 0 0 1580 0 0 0 1579 0 1578 1577 0 0 0 0 0 +0 0 0 1576 0 0 0 1575 0 1574 1573 0 0 0 0 1572 0 1571 1570 0 0 1569 1568 0 1567 +0 0 0 0 0 0 0 0 0 0 1566 0 0 0 1565 0 1564 1563 0 0 0 0 1562 0 1561 1560 0 0 +1559 1558 0 1557 0 0 0 0 0 0 1556 0 1555 1554 0 0 1553 1552 0 1551 0 0 0 0 1550 +1549 0 1548 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1547 0 0 0 0 0 +0 0 1546 0 0 0 1545 0 1544 1543 0 0 0 0 0 0 0 0 1542 0 0 0 1541 0 1540 1539 0 0 +0 0 1538 0 1537 1536 0 0 1535 1534 0 1533 0 0 0 0 0 0 0 0 0 0 1532 0 0 0 1531 0 +1530 1529 0 0 0 0 1528 0 1527 1526 0 0 1525 1524 0 1523 0 0 0 0 0 0 1522 0 1521 +1520 0 0 1519 1518 0 1517 0 0 0 0 1516 1515 0 1514 0 0 0 1513 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 1512 0 0 0 1511 0 1510 1509 0 0 0 0 1508 0 1507 1506 0 0 1505 1504 0 +1503 0 0 0 0 0 0 1502 0 1501 1500 0 0 1499 1498 0 1497 0 0 0 0 1496 1495 0 1494 +0 0 0 1493 0 0 0 0 0 0 0 0 0 0 1492 0 1491 1490 0 0 1489 1488 0 1487 0 0 0 0 +1486 1485 0 1484 0 0 0 1483 0 0 0 0 0 0 0 0 1482 1481 0 1480 0 0 0 1479 0 0 0 0 +0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1478 0 0 0 +0 0 0 0 1477 0 0 0 1476 0 1475 1474 0 0 0 0 0 0 0 0 1473 0 0 0 1472 0 1471 1470 +0 0 0 0 1469 0 1468 1467 0 0 1466 1465 0 1464 0 0 0 0 0 0 0 0 0 0 1463 0 0 0 +1462 0 1461 1460 0 0 0 0 1459 0 1458 1457 0 0 1456 1455 0 1454 0 0 0 0 0 0 1453 +0 1452 1451 0 0 1450 1449 0 1448 0 0 0 0 1447 1446 0 1445 0 0 0 1444 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 1443 0 0 0 1442 0 1441 1440 0 0 0 0 1439 0 1438 1437 0 0 1436 +1435 0 1434 0 0 0 0 0 0 1433 0 1432 1431 0 0 1430 1429 0 1428 0 0 0 0 1427 1426 +0 1425 0 0 0 1424 0 0 0 0 0 0 0 0 0 0 1423 0 1422 1421 0 0 1420 1419 0 1418 0 0 +0 0 1417 1416 0 1415 0 0 0 1414 0 0 0 0 0 0 0 0 1413 1412 0 1411 0 0 0 1410 0 0 +0 0 0 0 0 1409 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1408 0 0 0 1407 0 +1406 1405 0 0 0 0 1404 0 1403 1402 0 0 1401 1400 0 1399 0 0 0 0 0 0 1398 0 1397 +1396 0 0 1395 1394 0 1393 0 0 0 0 1392 1391 0 1390 0 0 0 1389 0 0 0 0 0 0 0 0 0 +0 1388 0 1387 1386 0 0 1385 1384 0 1383 0 0 0 0 1382 1381 0 1380 0 0 0 1379 0 0 +0 0 0 0 0 0 1378 1377 0 1376 0 0 0 1375 0 0 0 0 0 0 0 1374 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 1373 0 1372 1371 0 0 1370 1369 0 1368 0 0 0 0 1367 1366 0 1365 +0 0 0 1364 0 0 0 0 0 0 0 0 1363 1362 0 1361 0 0 0 1360 0 0 0 0 0 0 0 1359 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 1358 1357 0 1356 0 0 0 1355 0 0 0 0 0 0 0 1354 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1353 0 0 0 0 0 0 0 1352 0 0 0 1351 0 1350 +1349 0 0 0 0 0 0 0 0 1348 0 0 0 1347 0 1346 1345 0 0 0 0 1344 0 1343 1342 0 0 +1341 1340 0 1339 0 0 0 0 0 0 0 0 0 0 1338 0 0 0 1337 0 1336 1335 0 0 0 0 1334 0 +1333 1332 0 0 1331 1330 0 1329 0 0 0 0 0 0 1328 0 1327 1326 0 0 1325 1324 0 +1323 0 0 0 0 1322 1321 0 1320 0 0 0 1319 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1318 0 0 0 +1317 0 1316 1315 0 0 0 0 1314 0 1313 1312 0 0 1311 1310 0 1309 0 0 0 0 0 0 1308 +0 1307 1306 0 0 1305 1304 0 1303 0 0 0 0 1302 1301 0 1300 0 0 0 1299 0 0 0 0 0 +0 0 0 0 0 1298 0 1297 1296 0 0 1295 1294 0 1293 0 0 0 0 1292 1291 0 1290 0 0 0 +1289 0 0 0 0 0 0 0 0 1288 1287 0 1286 0 0 0 1285 0 0 0 0 0 0 0 1284 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1283 0 0 0 1282 0 1281 1280 0 0 0 0 1279 0 1278 +1277 0 0 1276 1275 0 1274 0 0 0 0 0 0 1273 0 1272 1271 0 0 1270 1269 0 1268 0 0 +0 0 1267 1266 0 1265 0 0 0 1264 0 0 0 0 0 0 0 0 0 0 1263 0 1262 1261 0 0 1260 +1259 0 1258 0 0 0 0 1257 1256 0 1255 0 0 0 1254 0 0 0 0 0 0 0 0 1253 1252 0 +1251 0 0 0 1250 0 0 0 0 0 0 0 1249 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1248 0 +1247 1246 0 0 1245 1244 0 1243 0 0 0 0 1242 1241 0 1240 0 0 0 1239 0 0 0 0 0 0 +0 0 1238 1237 0 1236 0 0 0 1235 0 0 0 0 0 0 0 1234 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 1233 1232 0 1231 0 0 0 1230 0 0 0 0 0 0 0 1229 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 1228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 1227 0 0 0 1226 0 1225 1224 0 0 0 0 1223 0 1222 1221 0 0 1220 1219 0 1218 0 +0 0 0 0 0 1217 0 1216 1215 0 0 1214 1213 0 1212 0 0 0 0 1211 1210 0 1209 0 0 0 +1208 0 0 0 0 0 0 0 0 0 0 1207 0 1206 1205 0 0 1204 1203 0 1202 0 0 0 0 1201 +1200 0 1199 0 0 0 1198 0 0 0 0 0 0 0 0 1197 1196 0 1195 0 0 0 1194 0 0 0 0 0 0 +0 1193 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1192 0 1191 1190 0 0 1189 1188 0 +1187 0 0 0 0 1186 1185 0 1184 0 0 0 1183 0 0 0 0 0 0 0 0 1182 1181 0 1180 0 0 0 +1179 0 0 0 0 0 0 0 1178 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1177 1176 0 1175 0 0 0 +1174 0 0 0 0 0 0 0 1173 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1172 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1171 0 1170 1169 0 0 1168 1167 +0 1166 0 0 0 0 1165 1164 0 1163 0 0 0 1162 0 0 0 0 0 0 0 0 1161 1160 0 1159 0 0 +0 1158 0 0 0 0 0 0 0 1157 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1156 1155 0 1154 0 0 +0 1153 0 0 0 0 0 0 0 1152 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1151 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1150 1149 0 1148 0 0 0 1147 0 0 0 +0 0 0 0 1146 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1145 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 1144 0 0 0 0 0 0 0 1143 0 0 0 1142 0 1141 1140 0 0 +0 0 0 0 0 0 1139 0 0 0 1138 0 1137 1136 0 0 0 0 1135 0 1134 1133 0 0 1132 1131 +0 1130 0 0 0 0 0 0 0 0 0 0 1129 0 0 0 1128 0 1127 1126 0 0 0 0 1125 0 1124 1123 +0 0 1122 1121 0 1120 0 0 0 0 0 0 1119 0 1118 1117 0 0 1116 1115 0 1114 0 0 0 0 +1113 1112 0 1111 0 0 0 1110 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1109 0 0 0 1108 0 1107 +1106 0 0 0 0 1105 0 1104 1103 0 0 1102 1101 0 1100 0 0 0 0 0 0 1099 0 1098 1097 +0 0 1096 1095 0 1094 0 0 0 0 1093 1092 0 1091 0 0 0 1090 0 0 0 0 0 0 0 0 0 0 +1089 0 1088 1087 0 0 1086 1085 0 1084 0 0 0 0 1083 1082 0 1081 0 0 0 1080 0 0 0 +0 0 0 0 0 1079 1078 0 1077 0 0 0 1076 0 0 0 0 0 0 0 1075 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 1074 0 0 0 1073 0 1072 1071 0 0 0 0 1070 0 1069 1068 0 0 +1067 1066 0 1065 0 0 0 0 0 0 1064 0 1063 1062 0 0 1061 1060 0 1059 0 0 0 0 1058 +1057 0 1056 0 0 0 1055 0 0 0 0 0 0 0 0 0 0 1054 0 1053 1052 0 0 1051 1050 0 +1049 0 0 0 0 1048 1047 0 1046 0 0 0 1045 0 0 0 0 0 0 0 0 1044 1043 0 1042 0 0 0 +1041 0 0 0 0 0 0 0 1040 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1039 0 1038 1037 0 +0 1036 1035 0 1034 0 0 0 0 1033 1032 0 1031 0 0 0 1030 0 0 0 0 0 0 0 0 1029 +1028 0 1027 0 0 0 1026 0 0 0 0 0 0 0 1025 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1024 +1023 0 1022 0 0 0 1021 0 0 0 0 0 0 0 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1019 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1018 +0 0 0 1017 0 1016 1015 0 0 0 0 1014 0 1013 1012 0 0 1011 1010 0 1009 0 0 0 0 0 +0 1008 0 1007 1006 0 0 1005 1004 0 1003 0 0 0 0 1002 1001 0 1000 0 0 0 999 0 0 +0 0 0 0 0 0 0 0 998 0 997 996 0 0 995 994 0 993 0 0 0 0 992 991 0 990 0 0 0 989 +0 0 0 0 0 0 0 0 988 987 0 986 0 0 0 985 0 0 0 0 0 0 0 984 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 983 0 982 981 0 0 980 979 0 978 0 0 0 0 977 976 0 975 0 0 0 974 0 +0 0 0 0 0 0 0 973 972 0 971 0 0 0 970 0 0 0 0 0 0 0 969 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 968 967 0 966 0 0 0 965 0 0 0 0 0 0 0 964 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +963 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 962 0 +961 960 0 0 959 958 0 957 0 0 0 0 956 955 0 954 0 0 0 953 0 0 0 0 0 0 0 0 952 +951 0 950 0 0 0 949 0 0 0 0 0 0 0 948 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 947 946 0 +945 0 0 0 944 0 0 0 0 0 0 0 943 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 942 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 941 940 0 939 0 0 0 938 0 0 0 +0 0 0 0 937 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 936 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 935 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 934 0 0 0 933 0 932 931 0 0 0 0 930 0 929 928 0 0 927 926 0 925 0 0 +0 0 0 0 924 0 923 922 0 0 921 920 0 919 0 0 0 0 918 917 0 916 0 0 0 915 0 0 0 0 +0 0 0 0 0 0 914 0 913 912 0 0 911 910 0 909 0 0 0 0 908 907 0 906 0 0 0 905 0 0 +0 0 0 0 0 0 904 903 0 902 0 0 0 901 0 0 0 0 0 0 0 900 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 899 0 898 897 0 0 896 895 0 894 0 0 0 0 893 892 0 891 0 0 0 890 0 0 0 +0 0 0 0 0 889 888 0 887 0 0 0 886 0 0 0 0 0 0 0 885 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 884 883 0 882 0 0 0 881 0 0 0 0 0 0 0 880 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 879 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 878 0 877 +876 0 0 875 874 0 873 0 0 0 0 872 871 0 870 0 0 0 869 0 0 0 0 0 0 0 0 868 867 0 +866 0 0 0 865 0 0 0 0 0 0 0 864 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 863 862 0 861 0 +0 0 860 0 0 0 0 0 0 0 859 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 858 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 857 856 0 855 0 0 0 854 0 0 0 0 0 0 +0 853 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 852 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 851 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +850 0 849 848 0 0 847 846 0 845 0 0 0 0 844 843 0 842 0 0 0 841 0 0 0 0 0 0 0 0 +840 839 0 838 0 0 0 837 0 0 0 0 0 0 0 836 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 835 +834 0 833 0 0 0 832 0 0 0 0 0 0 0 831 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 830 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 829 828 0 827 0 0 0 826 +0 0 0 0 0 0 0 825 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 824 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 823 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 822 821 0 820 0 0 0 819 0 0 0 0 0 0 0 818 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +817 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 816 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 10 0 0 0 0 0 0 0 815 0 0 0 814 0 813 812 0 0 0 0 0 0 0 0 811 0 0 0 810 0 809 +808 0 0 0 0 807 0 806 805 0 0 804 803 0 802 0 0 0 0 0 0 0 0 0 0 801 0 0 0 800 0 +799 798 0 0 0 0 797 0 796 795 0 0 794 793 0 792 0 0 0 0 0 0 791 0 790 789 0 0 +788 787 0 786 0 0 0 0 785 784 0 783 0 0 0 782 0 0 0 0 0 0 0 0 0 0 0 0 0 0 781 0 +0 0 780 0 779 778 0 0 0 0 777 0 776 775 0 0 774 773 0 772 0 0 0 0 0 0 771 0 770 +769 0 0 768 767 0 766 0 0 0 0 765 764 0 763 0 0 0 762 0 0 0 0 0 0 0 0 0 0 761 0 +760 759 0 0 758 757 0 756 0 0 0 0 755 754 0 753 0 0 0 752 0 0 0 0 0 0 0 0 751 +750 0 749 0 0 0 748 0 0 0 0 0 0 0 747 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 746 0 0 0 745 0 744 743 0 0 0 0 742 0 741 740 0 0 739 738 0 737 0 0 0 0 0 0 +736 0 735 734 0 0 733 732 0 731 0 0 0 0 730 729 0 728 0 0 0 727 0 0 0 0 0 0 0 0 +0 0 726 0 725 724 0 0 723 722 0 721 0 0 0 0 720 719 0 718 0 0 0 717 0 0 0 0 0 0 +0 0 716 715 0 714 0 0 0 713 0 0 0 0 0 0 0 712 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 711 0 710 709 0 0 708 707 0 706 0 0 0 0 705 704 0 703 0 0 0 702 0 0 0 0 0 0 0 +0 701 700 0 699 0 0 0 698 0 0 0 0 0 0 0 697 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 696 +695 0 694 0 0 0 693 0 0 0 0 0 0 0 692 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 691 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 690 0 0 0 +689 0 688 687 0 0 0 0 686 0 685 684 0 0 683 682 0 681 0 0 0 0 0 0 680 0 679 678 +0 0 677 676 0 675 0 0 0 0 674 673 0 672 0 0 0 671 0 0 0 0 0 0 0 0 0 0 670 0 669 +668 0 0 667 666 0 665 0 0 0 0 664 663 0 662 0 0 0 661 0 0 0 0 0 0 0 0 660 659 0 +658 0 0 0 657 0 0 0 0 0 0 0 656 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 655 0 654 +653 0 0 652 651 0 650 0 0 0 0 649 648 0 647 0 0 0 646 0 0 0 0 0 0 0 0 645 644 0 +643 0 0 0 642 0 0 0 0 0 0 0 641 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 640 639 0 638 0 +0 0 637 0 0 0 0 0 0 0 636 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 635 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 634 0 633 632 0 0 631 630 0 629 +0 0 0 0 628 627 0 626 0 0 0 625 0 0 0 0 0 0 0 0 624 623 0 622 0 0 0 621 0 0 0 0 +0 0 0 620 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 619 618 0 617 0 0 0 616 0 0 0 0 0 0 0 +615 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 614 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 613 612 0 611 0 0 0 610 0 0 0 0 0 0 0 609 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 608 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +607 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 606 0 0 0 605 0 +604 603 0 0 0 0 602 0 601 600 0 0 599 598 0 597 0 0 0 0 0 0 596 0 595 594 0 0 +593 592 0 591 0 0 0 0 590 589 0 588 0 0 0 587 0 0 0 0 0 0 0 0 0 0 586 0 585 584 +0 0 583 582 0 581 0 0 0 0 580 579 0 578 0 0 0 577 0 0 0 0 0 0 0 0 576 575 0 574 +0 0 0 573 0 0 0 0 0 0 0 572 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 571 0 570 569 0 +0 568 567 0 566 0 0 0 0 565 564 0 563 0 0 0 562 0 0 0 0 0 0 0 0 561 560 0 559 0 +0 0 558 0 0 0 0 0 0 0 557 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 556 555 0 554 0 0 0 +553 0 0 0 0 0 0 0 552 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 551 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 550 0 549 548 0 0 547 546 0 545 0 0 +0 0 544 543 0 542 0 0 0 541 0 0 0 0 0 0 0 0 540 539 0 538 0 0 0 537 0 0 0 0 0 0 +0 536 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 535 534 0 533 0 0 0 532 0 0 0 0 0 0 0 531 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 530 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 529 528 0 527 0 0 0 526 0 0 0 0 0 0 0 525 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 524 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 523 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 522 0 521 520 0 0 519 518 0 +517 0 0 0 0 516 515 0 514 0 0 0 513 0 0 0 0 0 0 0 0 512 511 0 510 0 0 0 509 0 0 +0 0 0 0 0 508 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 507 506 0 505 0 0 0 504 0 0 0 0 0 +0 0 503 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 502 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 501 500 0 499 0 0 0 498 0 0 0 0 0 0 0 497 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 496 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 495 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 494 493 0 492 0 0 0 491 +0 0 0 0 0 0 0 490 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 489 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 488 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 487 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 486 0 0 0 485 0 484 483 0 0 0 0 482 0 481 +480 0 0 479 478 0 477 0 0 0 0 0 0 476 0 475 474 0 0 473 472 0 471 0 0 0 0 470 +469 0 468 0 0 0 467 0 0 0 0 0 0 0 0 0 0 466 0 465 464 0 0 463 462 0 461 0 0 0 0 +460 459 0 458 0 0 0 457 0 0 0 0 0 0 0 0 456 455 0 454 0 0 0 453 0 0 0 0 0 0 0 +452 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 451 0 450 449 0 0 448 447 0 446 0 0 0 0 +445 444 0 443 0 0 0 442 0 0 0 0 0 0 0 0 441 440 0 439 0 0 0 438 0 0 0 0 0 0 0 +437 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 436 435 0 434 0 0 0 433 0 0 0 0 0 0 0 432 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 431 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 430 0 429 428 0 0 427 426 0 425 0 0 0 0 424 423 0 422 0 0 0 +421 0 0 0 0 0 0 0 0 420 419 0 418 0 0 0 417 0 0 0 0 0 0 0 416 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 415 414 0 413 0 0 0 412 0 0 0 0 0 0 0 411 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 410 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 409 +408 0 407 0 0 0 406 0 0 0 0 0 0 0 405 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 404 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 403 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 402 0 401 400 0 0 399 398 0 397 0 0 0 0 396 395 0 +394 0 0 0 393 0 0 0 0 0 0 0 0 392 391 0 390 0 0 0 389 0 0 0 0 0 0 0 388 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 387 386 0 385 0 0 0 384 0 0 0 0 0 0 0 383 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 382 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 381 380 0 379 0 0 0 378 0 0 0 0 0 0 0 377 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 376 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 375 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 374 373 0 372 0 0 0 371 0 0 0 0 0 0 0 370 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 369 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 368 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 367 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 366 0 365 364 0 0 363 362 0 361 0 0 0 0 360 359 0 358 0 0 0 357 0 0 0 0 0 +0 0 0 356 355 0 354 0 0 0 353 0 0 0 0 0 0 0 352 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +351 350 0 349 0 0 0 348 0 0 0 0 0 0 0 347 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 346 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 345 344 0 343 0 0 0 +342 0 0 0 0 0 0 0 341 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 340 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 339 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 338 337 0 336 0 0 0 335 0 0 0 0 0 0 0 334 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 333 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 332 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 331 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 330 329 0 328 0 0 0 +327 0 0 0 0 0 0 0 326 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 325 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 324 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 323 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 1 } + +! This is a lookup table for all non-flush hands consisting of five unique +! ranks (i.e. either Straights or High Card hands). A zero means that specific +! combination is not possible with this type of hand. +CONSTANT: unique5-table +{ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1608 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 7462 0 0 0 0 0 0 0 7461 0 0 0 7460 0 7459 1607 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 7458 0 0 0 0 0 0 0 7457 0 0 0 7456 0 7455 7454 0 0 0 0 0 0 +0 0 7453 0 0 0 7452 0 7451 7450 0 0 0 0 7449 0 7448 7447 0 0 7446 7445 0 1606 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7444 0 0 0 0 0 0 0 7443 0 0 0 7442 0 7441 +7440 0 0 0 0 0 0 0 0 7439 0 0 0 7438 0 7437 7436 0 0 0 0 7435 0 7434 7433 0 0 +7432 7431 0 7430 0 0 0 0 0 0 0 0 0 0 7429 0 0 0 7428 0 7427 7426 0 0 0 0 7425 0 +7424 7423 0 0 7422 7421 0 7420 0 0 0 0 0 0 7419 0 7418 7417 0 0 7416 7415 0 +7414 0 0 0 0 7413 7412 0 7411 0 0 0 1605 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 7410 0 0 0 0 0 0 0 7409 0 0 0 7408 0 7407 7406 0 0 0 0 0 0 0 0 7405 0 0 0 +7404 0 7403 7402 0 0 0 0 7401 0 7400 7399 0 0 7398 7397 0 7396 0 0 0 0 0 0 0 0 +0 0 7395 0 0 0 7394 0 7393 7392 0 0 0 0 7391 0 7390 7389 0 0 7388 7387 0 7386 0 +0 0 0 0 0 7385 0 7384 7383 0 0 7382 7381 0 7380 0 0 0 0 7379 7378 0 7377 0 0 0 +7376 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7375 0 0 0 7374 0 7373 7372 0 0 0 0 7371 0 +7370 7369 0 0 7368 7367 0 7366 0 0 0 0 0 0 7365 0 7364 7363 0 0 7362 7361 0 +7360 0 0 0 0 7359 7358 0 7357 0 0 0 7356 0 0 0 0 0 0 0 0 0 0 7355 0 7354 7353 0 +0 7352 7351 0 7350 0 0 0 0 7349 7348 0 7347 0 0 0 7346 0 0 0 0 0 0 0 0 7345 +7344 0 7343 0 0 0 7342 0 0 0 0 0 0 0 1604 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 7341 0 0 0 0 0 0 0 7340 0 0 0 7339 0 7338 7337 0 0 0 0 0 +0 0 0 7336 0 0 0 7335 0 7334 7333 0 0 0 0 7332 0 7331 7330 0 0 7329 7328 0 7327 +0 0 0 0 0 0 0 0 0 0 7326 0 0 0 7325 0 7324 7323 0 0 0 0 7322 0 7321 7320 0 0 +7319 7318 0 7317 0 0 0 0 0 0 7316 0 7315 7314 0 0 7313 7312 0 7311 0 0 0 0 7310 +7309 0 7308 0 0 0 7307 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7306 0 0 0 7305 0 7304 7303 +0 0 0 0 7302 0 7301 7300 0 0 7299 7298 0 7297 0 0 0 0 0 0 7296 0 7295 7294 0 0 +7293 7292 0 7291 0 0 0 0 7290 7289 0 7288 0 0 0 7287 0 0 0 0 0 0 0 0 0 0 7286 0 +7285 7284 0 0 7283 7282 0 7281 0 0 0 0 7280 7279 0 7278 0 0 0 7277 0 0 0 0 0 0 +0 0 7276 7275 0 7274 0 0 0 7273 0 0 0 0 0 0 0 7272 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 7271 0 0 0 7270 0 7269 7268 0 0 0 0 7267 0 7266 7265 0 0 7264 +7263 0 7262 0 0 0 0 0 0 7261 0 7260 7259 0 0 7258 7257 0 7256 0 0 0 0 7255 7254 +0 7253 0 0 0 7252 0 0 0 0 0 0 0 0 0 0 7251 0 7250 7249 0 0 7248 7247 0 7246 0 0 +0 0 7245 7244 0 7243 0 0 0 7242 0 0 0 0 0 0 0 0 7241 7240 0 7239 0 0 0 7238 0 0 +0 0 0 0 0 7237 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7236 0 7235 7234 0 0 7233 +7232 0 7231 0 0 0 0 7230 7229 0 7228 0 0 0 7227 0 0 0 0 0 0 0 0 7226 7225 0 +7224 0 0 0 7223 0 0 0 0 0 0 0 7222 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7221 7220 0 +7219 0 0 0 7218 0 0 0 0 0 0 0 7217 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1603 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 7216 0 0 0 0 0 0 0 7215 0 0 0 7214 0 7213 7212 0 0 0 0 0 0 0 0 7211 0 0 0 +7210 0 7209 7208 0 0 0 0 7207 0 7206 7205 0 0 7204 7203 0 7202 0 0 0 0 0 0 0 0 +0 0 7201 0 0 0 7200 0 7199 7198 0 0 0 0 7197 0 7196 7195 0 0 7194 7193 0 7192 0 +0 0 0 0 0 7191 0 7190 7189 0 0 7188 7187 0 7186 0 0 0 0 7185 7184 0 7183 0 0 0 +7182 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7181 0 0 0 7180 0 7179 7178 0 0 0 0 7177 0 +7176 7175 0 0 7174 7173 0 7172 0 0 0 0 0 0 7171 0 7170 7169 0 0 7168 7167 0 +7166 0 0 0 0 7165 7164 0 7163 0 0 0 7162 0 0 0 0 0 0 0 0 0 0 7161 0 7160 7159 0 +0 7158 7157 0 7156 0 0 0 0 7155 7154 0 7153 0 0 0 7152 0 0 0 0 0 0 0 0 7151 +7150 0 7149 0 0 0 7148 0 0 0 0 0 0 0 7147 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 7146 0 0 0 7145 0 7144 7143 0 0 0 0 7142 0 7141 7140 0 0 7139 7138 0 7137 +0 0 0 0 0 0 7136 0 7135 7134 0 0 7133 7132 0 7131 0 0 0 0 7130 7129 0 7128 0 0 +0 7127 0 0 0 0 0 0 0 0 0 0 7126 0 7125 7124 0 0 7123 7122 0 7121 0 0 0 0 7120 +7119 0 7118 0 0 0 7117 0 0 0 0 0 0 0 0 7116 7115 0 7114 0 0 0 7113 0 0 0 0 0 0 +0 7112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7111 0 7110 7109 0 0 7108 7107 0 +7106 0 0 0 0 7105 7104 0 7103 0 0 0 7102 0 0 0 0 0 0 0 0 7101 7100 0 7099 0 0 0 +7098 0 0 0 0 0 0 0 7097 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7096 7095 0 7094 0 0 0 +7093 0 0 0 0 0 0 0 7092 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7091 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7090 0 0 0 7089 0 7088 +7087 0 0 0 0 7086 0 7085 7084 0 0 7083 7082 0 7081 0 0 0 0 0 0 7080 0 7079 7078 +0 0 7077 7076 0 7075 0 0 0 0 7074 7073 0 7072 0 0 0 7071 0 0 0 0 0 0 0 0 0 0 +7070 0 7069 7068 0 0 7067 7066 0 7065 0 0 0 0 7064 7063 0 7062 0 0 0 7061 0 0 0 +0 0 0 0 0 7060 7059 0 7058 0 0 0 7057 0 0 0 0 0 0 0 7056 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 7055 0 7054 7053 0 0 7052 7051 0 7050 0 0 0 0 7049 7048 0 7047 0 +0 0 7046 0 0 0 0 0 0 0 0 7045 7044 0 7043 0 0 0 7042 0 0 0 0 0 0 0 7041 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 7040 7039 0 7038 0 0 0 7037 0 0 0 0 0 0 0 7036 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 7035 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 7034 0 7033 7032 0 0 7031 7030 0 7029 0 0 0 0 7028 7027 0 7026 +0 0 0 7025 0 0 0 0 0 0 0 0 7024 7023 0 7022 0 0 0 7021 0 0 0 0 0 0 0 7020 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 7019 7018 0 7017 0 0 0 7016 0 0 0 0 0 0 0 7015 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 7014 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 7013 7012 0 7011 0 0 0 7010 0 0 0 0 0 0 0 7009 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 7008 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +1602 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 7007 0 0 0 0 0 0 0 7006 0 0 0 7005 0 7004 7003 0 0 0 0 0 0 0 0 7002 0 0 0 +7001 0 7000 6999 0 0 0 0 6998 0 6997 6996 0 0 6995 6994 0 6993 0 0 0 0 0 0 0 0 +0 0 6992 0 0 0 6991 0 6990 6989 0 0 0 0 6988 0 6987 6986 0 0 6985 6984 0 6983 0 +0 0 0 0 0 6982 0 6981 6980 0 0 6979 6978 0 6977 0 0 0 0 6976 6975 0 6974 0 0 0 +6973 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6972 0 0 0 6971 0 6970 6969 0 0 0 0 6968 0 +6967 6966 0 0 6965 6964 0 6963 0 0 0 0 0 0 6962 0 6961 6960 0 0 6959 6958 0 +6957 0 0 0 0 6956 6955 0 6954 0 0 0 6953 0 0 0 0 0 0 0 0 0 0 6952 0 6951 6950 0 +0 6949 6948 0 6947 0 0 0 0 6946 6945 0 6944 0 0 0 6943 0 0 0 0 0 0 0 0 6942 +6941 0 6940 0 0 0 6939 0 0 0 0 0 0 0 6938 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 6937 0 0 0 6936 0 6935 6934 0 0 0 0 6933 0 6932 6931 0 0 6930 6929 0 6928 +0 0 0 0 0 0 6927 0 6926 6925 0 0 6924 6923 0 6922 0 0 0 0 6921 6920 0 6919 0 0 +0 6918 0 0 0 0 0 0 0 0 0 0 6917 0 6916 6915 0 0 6914 6913 0 6912 0 0 0 0 6911 +6910 0 6909 0 0 0 6908 0 0 0 0 0 0 0 0 6907 6906 0 6905 0 0 0 6904 0 0 0 0 0 0 +0 6903 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6902 0 6901 6900 0 0 6899 6898 0 +6897 0 0 0 0 6896 6895 0 6894 0 0 0 6893 0 0 0 0 0 0 0 0 6892 6891 0 6890 0 0 0 +6889 0 0 0 0 0 0 0 6888 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6887 6886 0 6885 0 0 0 +6884 0 0 0 0 0 0 0 6883 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6882 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6881 0 0 0 6880 0 6879 +6878 0 0 0 0 6877 0 6876 6875 0 0 6874 6873 0 6872 0 0 0 0 0 0 6871 0 6870 6869 +0 0 6868 6867 0 6866 0 0 0 0 6865 6864 0 6863 0 0 0 6862 0 0 0 0 0 0 0 0 0 0 +6861 0 6860 6859 0 0 6858 6857 0 6856 0 0 0 0 6855 6854 0 6853 0 0 0 6852 0 0 0 +0 0 0 0 0 6851 6850 0 6849 0 0 0 6848 0 0 0 0 0 0 0 6847 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 6846 0 6845 6844 0 0 6843 6842 0 6841 0 0 0 0 6840 6839 0 6838 0 +0 0 6837 0 0 0 0 0 0 0 0 6836 6835 0 6834 0 0 0 6833 0 0 0 0 0 0 0 6832 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 6831 6830 0 6829 0 0 0 6828 0 0 0 0 0 0 0 6827 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 6826 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 6825 0 6824 6823 0 0 6822 6821 0 6820 0 0 0 0 6819 6818 0 6817 +0 0 0 6816 0 0 0 0 0 0 0 0 6815 6814 0 6813 0 0 0 6812 0 0 0 0 0 0 0 6811 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 6810 6809 0 6808 0 0 0 6807 0 0 0 0 0 0 0 6806 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 6805 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 6804 6803 0 6802 0 0 0 6801 0 0 0 0 0 0 0 6800 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 6799 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +6798 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6797 0 0 0 +6796 0 6795 6794 0 0 0 0 6793 0 6792 6791 0 0 6790 6789 0 6788 0 0 0 0 0 0 6787 +0 6786 6785 0 0 6784 6783 0 6782 0 0 0 0 6781 6780 0 6779 0 0 0 6778 0 0 0 0 0 +0 0 0 0 0 6777 0 6776 6775 0 0 6774 6773 0 6772 0 0 0 0 6771 6770 0 6769 0 0 0 +6768 0 0 0 0 0 0 0 0 6767 6766 0 6765 0 0 0 6764 0 0 0 0 0 0 0 6763 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 6762 0 6761 6760 0 0 6759 6758 0 6757 0 0 0 0 6756 6755 +0 6754 0 0 0 6753 0 0 0 0 0 0 0 0 6752 6751 0 6750 0 0 0 6749 0 0 0 0 0 0 0 +6748 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6747 6746 0 6745 0 0 0 6744 0 0 0 0 0 0 0 +6743 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6742 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 6741 0 6740 6739 0 0 6738 6737 0 6736 0 0 0 0 6735 +6734 0 6733 0 0 0 6732 0 0 0 0 0 0 0 0 6731 6730 0 6729 0 0 0 6728 0 0 0 0 0 0 +0 6727 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6726 6725 0 6724 0 0 0 6723 0 0 0 0 0 0 +0 6722 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6721 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 6720 6719 0 6718 0 0 0 6717 0 0 0 0 0 0 0 6716 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 6715 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 6714 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6713 0 +6712 6711 0 0 6710 6709 0 6708 0 0 0 0 6707 6706 0 6705 0 0 0 6704 0 0 0 0 0 0 +0 0 6703 6702 0 6701 0 0 0 6700 0 0 0 0 0 0 0 6699 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 6698 6697 0 6696 0 0 0 6695 0 0 0 0 0 0 0 6694 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 6693 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6692 +6691 0 6690 0 0 0 6689 0 0 0 0 0 0 0 6688 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6687 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6686 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6685 6684 0 6683 0 0 0 6682 0 0 0 0 0 0 0 +6681 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6680 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 6679 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1601 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1609 0 0 0 0 0 0 0 6678 0 0 0 6677 +0 6676 6675 0 0 0 0 0 0 0 0 6674 0 0 0 6673 0 6672 6671 0 0 0 0 6670 0 6669 +6668 0 0 6667 6666 0 6665 0 0 0 0 0 0 0 0 0 0 6664 0 0 0 6663 0 6662 6661 0 0 0 +0 6660 0 6659 6658 0 0 6657 6656 0 6655 0 0 0 0 0 0 6654 0 6653 6652 0 0 6651 +6650 0 6649 0 0 0 0 6648 6647 0 6646 0 0 0 6645 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +6644 0 0 0 6643 0 6642 6641 0 0 0 0 6640 0 6639 6638 0 0 6637 6636 0 6635 0 0 0 +0 0 0 6634 0 6633 6632 0 0 6631 6630 0 6629 0 0 0 0 6628 6627 0 6626 0 0 0 6625 +0 0 0 0 0 0 0 0 0 0 6624 0 6623 6622 0 0 6621 6620 0 6619 0 0 0 0 6618 6617 0 +6616 0 0 0 6615 0 0 0 0 0 0 0 0 6614 6613 0 6612 0 0 0 6611 0 0 0 0 0 0 0 6610 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6609 0 0 0 6608 0 6607 6606 0 0 0 0 +6605 0 6604 6603 0 0 6602 6601 0 6600 0 0 0 0 0 0 6599 0 6598 6597 0 0 6596 +6595 0 6594 0 0 0 0 6593 6592 0 6591 0 0 0 6590 0 0 0 0 0 0 0 0 0 0 6589 0 6588 +6587 0 0 6586 6585 0 6584 0 0 0 0 6583 6582 0 6581 0 0 0 6580 0 0 0 0 0 0 0 0 +6579 6578 0 6577 0 0 0 6576 0 0 0 0 0 0 0 6575 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 6574 0 6573 6572 0 0 6571 6570 0 6569 0 0 0 0 6568 6567 0 6566 0 0 0 6565 0 +0 0 0 0 0 0 0 6564 6563 0 6562 0 0 0 6561 0 0 0 0 0 0 0 6560 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 6559 6558 0 6557 0 0 0 6556 0 0 0 0 0 0 0 6555 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 6554 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 6553 0 0 0 6552 0 6551 6550 0 0 0 0 6549 0 6548 6547 0 0 6546 +6545 0 6544 0 0 0 0 0 0 6543 0 6542 6541 0 0 6540 6539 0 6538 0 0 0 0 6537 6536 +0 6535 0 0 0 6534 0 0 0 0 0 0 0 0 0 0 6533 0 6532 6531 0 0 6530 6529 0 6528 0 0 +0 0 6527 6526 0 6525 0 0 0 6524 0 0 0 0 0 0 0 0 6523 6522 0 6521 0 0 0 6520 0 0 +0 0 0 0 0 6519 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6518 0 6517 6516 0 0 6515 +6514 0 6513 0 0 0 0 6512 6511 0 6510 0 0 0 6509 0 0 0 0 0 0 0 0 6508 6507 0 +6506 0 0 0 6505 0 0 0 0 0 0 0 6504 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6503 6502 0 +6501 0 0 0 6500 0 0 0 0 0 0 0 6499 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6498 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6497 0 6496 6495 0 0 +6494 6493 0 6492 0 0 0 0 6491 6490 0 6489 0 0 0 6488 0 0 0 0 0 0 0 0 6487 6486 +0 6485 0 0 0 6484 0 0 0 0 0 0 0 6483 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6482 6481 +0 6480 0 0 0 6479 0 0 0 0 0 0 0 6478 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6477 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6476 6475 0 6474 0 0 0 +6473 0 0 0 0 0 0 0 6472 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6471 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6470 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 6469 0 0 0 6468 0 6467 6466 0 0 0 0 6465 0 6464 +6463 0 0 6462 6461 0 6460 0 0 0 0 0 0 6459 0 6458 6457 0 0 6456 6455 0 6454 0 0 +0 0 6453 6452 0 6451 0 0 0 6450 0 0 0 0 0 0 0 0 0 0 6449 0 6448 6447 0 0 6446 +6445 0 6444 0 0 0 0 6443 6442 0 6441 0 0 0 6440 0 0 0 0 0 0 0 0 6439 6438 0 +6437 0 0 0 6436 0 0 0 0 0 0 0 6435 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6434 0 +6433 6432 0 0 6431 6430 0 6429 0 0 0 0 6428 6427 0 6426 0 0 0 6425 0 0 0 0 0 0 +0 0 6424 6423 0 6422 0 0 0 6421 0 0 0 0 0 0 0 6420 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 6419 6418 0 6417 0 0 0 6416 0 0 0 0 0 0 0 6415 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 6414 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6413 +0 6412 6411 0 0 6410 6409 0 6408 0 0 0 0 6407 6406 0 6405 0 0 0 6404 0 0 0 0 0 +0 0 0 6403 6402 0 6401 0 0 0 6400 0 0 0 0 0 0 0 6399 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 6398 6397 0 6396 0 0 0 6395 0 0 0 0 0 0 0 6394 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 6393 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6392 +6391 0 6390 0 0 0 6389 0 0 0 0 0 0 0 6388 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6387 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6386 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6385 0 6384 6383 0 0 6382 6381 0 6380 0 0 +0 0 6379 6378 0 6377 0 0 0 6376 0 0 0 0 0 0 0 0 6375 6374 0 6373 0 0 0 6372 0 0 +0 0 0 0 0 6371 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6370 6369 0 6368 0 0 0 6367 0 0 +0 0 0 0 0 6366 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6365 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6364 6363 0 6362 0 0 0 6361 0 0 0 0 0 0 0 +6360 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6359 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 6358 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +6357 6356 0 6355 0 0 0 6354 0 0 0 0 0 0 0 6353 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +6352 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6351 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6350 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6349 0 +0 0 6348 0 6347 6346 0 0 0 0 6345 0 6344 6343 0 0 6342 6341 0 6340 0 0 0 0 0 0 +6339 0 6338 6337 0 0 6336 6335 0 6334 0 0 0 0 6333 6332 0 6331 0 0 0 6330 0 0 0 +0 0 0 0 0 0 0 6329 0 6328 6327 0 0 6326 6325 0 6324 0 0 0 0 6323 6322 0 6321 0 +0 0 6320 0 0 0 0 0 0 0 0 6319 6318 0 6317 0 0 0 6316 0 0 0 0 0 0 0 6315 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 6314 0 6313 6312 0 0 6311 6310 0 6309 0 0 0 0 6308 +6307 0 6306 0 0 0 6305 0 0 0 0 0 0 0 0 6304 6303 0 6302 0 0 0 6301 0 0 0 0 0 0 +0 6300 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6299 6298 0 6297 0 0 0 6296 0 0 0 0 0 0 +0 6295 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6294 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6293 0 6292 6291 0 0 6290 6289 0 6288 0 0 0 0 +6287 6286 0 6285 0 0 0 6284 0 0 0 0 0 0 0 0 6283 6282 0 6281 0 0 0 6280 0 0 0 0 +0 0 0 6279 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6278 6277 0 6276 0 0 0 6275 0 0 0 0 +0 0 0 6274 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6273 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6272 6271 0 6270 0 0 0 6269 0 0 0 0 0 0 0 6268 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 6267 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 6266 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6265 +0 6264 6263 0 0 6262 6261 0 6260 0 0 0 0 6259 6258 0 6257 0 0 0 6256 0 0 0 0 0 +0 0 0 6255 6254 0 6253 0 0 0 6252 0 0 0 0 0 0 0 6251 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 6250 6249 0 6248 0 0 0 6247 0 0 0 0 0 0 0 6246 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 6245 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6244 +6243 0 6242 0 0 0 6241 0 0 0 0 0 0 0 6240 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6239 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6238 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6237 6236 0 6235 0 0 0 6234 0 0 0 0 0 0 0 +6233 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6232 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 6231 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6230 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 6229 0 6228 6227 0 0 6226 6225 0 6224 0 0 0 0 6223 6222 0 +6221 0 0 0 6220 0 0 0 0 0 0 0 0 6219 6218 0 6217 0 0 0 6216 0 0 0 0 0 0 0 6215 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6214 6213 0 6212 0 0 0 6211 0 0 0 0 0 0 0 6210 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6209 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 6208 6207 0 6206 0 0 0 6205 0 0 0 0 0 0 0 6204 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 6203 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 6202 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6201 6200 0 6199 0 +0 0 6198 0 0 0 0 0 0 0 6197 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6196 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6195 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 6194 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6193 6192 0 6191 0 0 0 6190 0 0 0 0 0 0 +0 6189 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6188 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 6187 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +6186 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 0 1600 } + +! This is a lookup table for the product of prime values associated with the +! cards in a hand. +CONSTANT: products-table +{ 48 72 80 108 112 120 162 168 176 180 200 208 252 264 270 272 280 300 304 312 +368 378 392 396 405 408 420 440 450 456 464 468 496 500 520 552 567 588 592 594 +612 616 630 656 660 675 680 684 696 700 702 728 744 750 760 780 828 882 888 891 +918 920 924 945 952 968 980 984 990 1020 1026 1044 1050 1053 1064 1092 1100 +1116 1125 1140 1144 1160 1170 1240 1242 1250 1288 1300 1323 1332 1352 1372 1377 +1380 1386 1428 1452 1470 1476 1480 1485 1496 1530 1539 1540 1566 1575 1596 1624 +1638 1640 1650 1672 1674 1700 1710 1716 1736 1740 1750 1755 1768 1820 1860 1863 +1875 1900 1932 1950 1976 1998 2024 2028 2058 2070 2072 2079 2142 2156 2178 2205 +2214 2220 2244 2295 2296 2300 2312 2349 2380 2392 2394 2420 2436 2450 2457 2460 +2475 2508 2511 2548 2550 2552 2565 2574 2584 2604 2610 2625 2652 2660 2728 2750 +2790 2850 2860 2888 2898 2900 2925 2964 2997 3016 3036 3042 3087 3100 3105 3108 +3128 3213 3220 3224 3234 3250 3256 3267 3321 3330 3332 3366 3380 3388 3430 3444 +3450 3465 3468 3496 3588 3591 3608 3630 3654 3675 3690 3700 3724 3740 3762 3822 +3825 3828 3848 3850 3861 3876 3906 3915 3944 3978 4004 4060 4092 4095 4100 4125 +4180 4185 4216 4232 4250 4264 4275 4332 4340 4347 4350 4375 4408 4420 4446 4508 +4524 4550 4554 4563 4650 4662 4692 4712 4732 4750 4802 4836 4851 4875 4884 4940 +4995 4998 5032 5049 5060 5070 5082 5145 5166 5175 5180 5202 5236 5244 5324 5336 +5355 5382 5390 5412 5445 5481 5535 5550 5576 5586 5624 5643 5684 5704 5733 5740 +5742 5750 5772 5775 5780 5814 5852 5859 5916 5950 5967 5980 5985 6050 6076 6125 +6138 6150 6188 6232 6292 6324 6348 6370 6375 6380 6396 6435 6460 6498 6525 6612 +6650 6669 6728 6762 6786 6808 6820 6825 6831 6875 6916 6975 6993 7038 7068 7084 +7098 7125 7150 7192 7203 7220 7245 7250 7252 7254 7326 7436 7497 7540 7544 7546 +7548 7605 7623 7688 7749 7750 7803 7820 7866 7986 8004 8036 8050 8060 8073 8085 +8092 8118 8125 8140 8228 8325 8330 8364 8372 8379 8415 8436 8450 8470 8526 8556 +8575 8584 8613 8625 8658 8670 8721 8740 8788 8874 8918 8925 8932 9009 9020 9044 +9075 9114 9135 9176 9196 9207 9225 9250 9310 9348 9350 9405 9438 9486 9512 9522 +9548 9555 9594 9620 9625 9724 9747 9765 9860 9918 9945 9975 10092 10108 10143 +10150 10168 10179 10212 10250 10450 10540 10556 10557 10580 10602 10625 10647 +10660 10725 10788 10830 10850 10868 10875 10878 10881 10948 10952 10989 11020 +11050 11115 11132 11154 11270 11284 11316 11319 11322 11375 11385 11396 11492 +11532 11625 11655 11662 11780 11781 11799 11830 11858 11875 11979 12005 12006 +12054 12075 12136 12138 12177 12236 12342 12350 12495 12546 12580 12628 12650 +12654 12675 12705 12716 12789 12834 12844 12876 12915 12950 12987 13005 13034 +13156 13167 13182 13310 13311 13340 13377 13448 13455 13468 13475 13671 13764 +13794 13804 13875 13923 13940 13965 14014 14022 14025 14036 14060 14157 14210 +14212 14229 14260 14268 14283 14350 14355 14375 14391 14450 14535 14756 14812 +14875 14877 14924 14950 15004 15028 15125 15138 15162 15190 15225 15252 15318 +15345 15375 15428 15548 15561 15580 15675 15730 15778 15870 15884 15903 15925 +15939 15950 16150 16182 16245 16275 16317 16428 16492 16562 16575 16588 16625 +16698 16731 16796 16820 16905 16965 16974 16983 17020 17050 17204 17238 17298 +17493 17595 17612 17732 17745 17787 17875 17908 17980 18009 18050 18081 18125 +18130 18135 18204 18207 18315 18326 18513 18525 18590 18634 18676 18772 18819 +18837 18850 18860 18865 18975 18981 19074 19220 19228 19251 19266 19314 19375 +19425 19516 19550 19551 19604 19652 19665 19684 19773 19844 19894 19964 19965 +20090 20097 20125 20150 20172 20230 20295 20332 20349 20350 20482 20570 20646 +20691 20825 20956 21021 21033 21054 21125 21164 21175 21266 21315 21402 21460 +21483 21525 21645 21658 21675 21692 21812 21850 21879 21964 21970 22022 22185 +22218 22295 22425 22506 22542 22550 22707 22724 22743 22785 22878 22940 22977 +22990 23125 23188 23275 23276 23322 23375 23452 23548 23595 23667 23715 23751 +23780 23805 23826 23828 23925 23985 24050 24206 24225 24244 24273 24453 24548 +24633 24642 24650 24794 24795 24843 25012 25025 25047 25172 25230 25270 25375 +25382 25389 25420 25461 25575 25625 25636 25641 25857 25916 25947 26026 26125 +26350 26404 26411 26450 26505 26588 26650 26862 26908 27075 27125 27195 27306 +27380 27404 27436 27489 27508 27531 27550 27625 27676 27716 27830 27885 27951 +28126 28158 28175 28275 28305 28322 28413 28611 28652 28730 28798 28830 28899 +28971 29155 29282 29302 29325 29348 29406 29450 29478 29575 29601 29645 29716 +29766 29841 30015 30044 30135 30225 30258 30303 30340 30345 30525 30628 30668 +30723 30758 30855 30875 30932 30969 31059 31213 31262 31365 31372 31434 31450 +31581 31625 31635 31654 31790 31899 31977 32085 32103 32110 32116 32186 32375 +32487 32585 32708 32725 32775 32946 32955 33033 33201 33212 33275 33292 33327 +33350 33418 33524 33579 33620 33759 33813 33825 34276 34317 34485 34606 34684 +34713 34850 34914 34983 35035 35055 35090 35150 35322 35378 35525 35588 35650 +35739 35836 35875 35972 36075 36125 36244 36309 36556 36575 36822 36946 36963 +36975 37004 37030 37076 37107 37191 37323 37375 37444 37468 37510 37518 37570 +37791 37845 37905 37975 38073 38295 38318 38332 38675 38709 38870 38950 38962 +39039 39325 39445 39494 39525 39556 39627 39675 39710 39875 39882 39886 39897 +39975 40052 40204 40222 40293 40362 40375 40455 40508 40817 40898 40959 41070 +41154 41262 41325 41405 41492 41503 41574 41745 41876 42021 42050 42189 42237 +42284 42435 42476 42483 42550 42625 42772 42826 43095 43197 43225 43245 43263 +43732 43911 43923 43953 44109 44175 44198 44217 44252 44275 44289 44506 44649 +44764 44770 44919 44950 44954 45125 45254 45325 45356 45387 45619 45747 45815 +46137 46475 46585 46748 46893 46930 47068 47125 47138 47150 47151 47175 47212 +47396 47481 47619 47685 47804 48050 48165 48279 48285 48314 48334 48484 48668 +48807 48875 49010 49036 49049 49077 49126 49130 49419 49610 49735 49818 49972 +50025 50127 50225 50286 50375 50430 50468 50575 50578 50692 50875 51129 51205 +51425 51615 51646 51842 51909 52173 52234 52275 52316 52325 52371 52390 52514 +52598 52635 52725 52767 52972 52983 53067 53165 53428 53475 53482 53505 53613 +53650 53754 53958 53998 54145 54188 54418 54549 54625 54910 54925 55055 55223 +55233 55419 55506 55545 55594 55796 55825 55924 56265 56277 56355 56375 56525 +56637 57122 57188 57195 57350 57475 57477 57498 57681 57722 57868 57967 58190 +58305 58311 58425 58443 58870 59204 59241 59409 59450 59565 59644 59675 59774 +59823 59829 60125 60236 60306 60333 60515 60543 60775 61132 61226 61347 61364 +61370 61605 61625 61642 61659 61731 61828 61893 61985 62271 62361 62530 62678 +62814 63075 63175 63206 63426 63455 63550 63825 63916 64124 64141 64158 64239 +64467 64676 65065 65219 65348 65366 65596 65598 65702 65875 65975 66033 66092 +66125 66297 66470 66625 66748 66759 66861 67146 67155 67270 67425 67431 67599 +67881 67925 68265 68306 68324 68425 68450 68590 68614 68770 68782 68875 68894 +68913 69003 69290 69454 69575 69597 69629 69874 69938 70315 70395 70525 70587 +70602 70642 70707 70725 70805 71094 71188 71225 71668 71687 71825 71995 72075 +72261 72358 72471 72501 72964 73002 73036 73205 73255 73346 73515 73593 73625 +73689 73695 73964 74415 74431 74698 74727 74907 74958 75429 75645 75803 75850 +75867 76342 76475 76874 76895 77077 77121 77198 77372 77469 77763 77996 78039 +78155 78166 78292 78351 78585 78625 78771 78884 78897 78925 79135 79475 80073 +80142 80223 80275 80465 80475 80631 80852 80937 80997 81466 81548 81549 81627 +82225 82251 82365 82418 82522 82654 82708 83030 83259 83375 83391 83398 83421 +83486 83545 83810 84050 84175 84249 84303 84721 85514 85683 85782 85918 86025 +86247 86275 86428 86515 86583 86756 86779 87125 87172 87285 87362 87412 87542 +87725 87875 88102 88305 88412 88445 88806 88825 88837 89001 89125 89175 89590 +89661 89930 90117 90354 90364 90459 91091 91143 91234 91839 92046 92055 92225 +92365 92414 92463 92510 92575 93058 93092 93275 93357 93775 93795 93925 94017 +94178 94221 94622 94809 95139 95325 95571 95795 95830 95874 96026 96237 96278 +96425 96596 97006 97175 97375 97405 97526 97556 97682 98022 98049 98394 98397 +98441 98494 98553 98716 98735 99127 99275 99567 99705 99715 100510 100555 +100719 100793 100905 101062 102051 102245 102459 102487 102557 102675 102885 +102921 103075 103155 103156 103173 103246 103341 103675 103935 104044 104181 +104284 104690 104811 104907 104975 105125 105154 105183 105524 105710 105754 +105903 105963 106227 106375 106641 106782 106930 107065 107525 107559 107653 +107822 108086 108537 109089 109142 109174 109330 109388 109417 109503 109554 +110019 110075 110331 110495 110789 110825 110946 111265 111476 111910 111925 +112047 112375 112385 112406 112437 112651 113135 113553 113775 114057 114308 +114513 115258 115292 115311 115797 116058 116242 116402 116522 116725 116932 +116963 117249 117325 117334 117438 117670 117711 117845 117875 118490 119119 +119164 119187 119306 120125 120175 120213 120785 120802 120835 121121 121670 +121923 121975 122018 122199 122525 122815 122825 123025 123627 123783 123823 +123981 124025 124468 124545 124558 124775 124930 125097 125229 125426 125541 +125715 125829 125902 125948 126075 126445 127075 127426 127534 127738 127756 +128018 128271 128673 128877 128986 129115 129311 129514 129605 130134 130203 +130585 130975 131043 131118 131285 131313 131495 132153 132158 132275 132618 +133052 133133 133209 133342 133570 133705 134113 134125 134162 134199 134385 +134895 134995 135014 135531 135575 136045 136214 136325 136367 136851 137275 +137547 137566 137924 138069 138229 138621 138765 138985 139113 139564 139587 +139601 139638 140714 140777 141267 141933 142025 142228 142538 142766 142805 +142970 143143 143375 143745 143811 144039 144279 144305 144417 144925 145475 +145509 145521 146234 146289 146334 146523 146566 146575 147033 147175 147436 +147591 147706 147741 147994 148010 148625 148666 148707 148925 149435 149702 +149891 150183 150590 150765 150898 151294 151525 151593 152218 152438 153062 +153065 153410 153425 153729 154105 154652 154693 154869 155771 156066 156325 +156426 156674 156695 157035 157325 157339 157604 157731 158015 158389 158565 +158631 158804 158875 159562 159790 160173 160225 160395 161161 161253 161414 +161733 161975 162129 162578 163370 163415 163713 163761 163990 163995 164169 +164255 164331 164738 164983 165025 165886 166175 166419 166634 167042 167214 +167865 168175 168609 168674 169099 169169 169756 170126 170338 170765 171125 +171275 171462 171475 171535 171925 171941 171955 172235 172546 172822 172887 +172975 173225 173635 174087 174097 174363 174603 174685 174783 174845 174902 +175491 175972 176001 176157 176505 176605 177023 177489 177735 177970 178126 +178334 178746 178802 178959 179075 180154 180761 180895 181203 181447 181917 +182505 182590 182666 182819 183027 183365 183425 183483 183799 184093 184382 +184910 185725 186093 186238 186694 186702 186745 186837 186998 187187 187395 +187775 188108 188139 188518 188853 188922 188993 189625 190333 190463 190855 +191139 191301 191425 191607 191634 191675 192027 192185 192995 193325 193430 +193479 194271 194463 194579 194996 195201 195415 195730 196075 196137 196677 +197098 197846 198237 198927 199082 199927 200013 200158 200355 200725 201243 +202027 202521 202612 203203 203319 203522 203665 204321 204425 205751 205942 +206045 206305 206349 206635 206886 207214 207575 208075 208444 208495 208658 +208715 209209 209457 209525 210125 210749 210826 211071 212602 213342 213785 +213807 214149 214225 214291 214455 214774 214795 215747 215878 216775 216890 +217217 217341 217558 217906 218405 218530 218855 219351 219373 219501 219849 +220255 221030 221122 221221 221559 221991 222015 222111 222425 222999 223706 +223975 224516 224553 224825 224939 225446 225885 225998 226347 226525 226941 +228085 228206 228327 228475 228657 228718 228781 229586 229593 229957 230115 +230318 231035 231275 231725 231978 232101 232562 232645 232730 232934 233206 +233818 234025 234099 234175 234639 235011 235246 235445 235543 235586 236406 +236555 237429 237614 238206 239071 239343 239575 239685 240065 240149 240526 +240695 240737 240994 241129 242121 242515 243089 243815 243867 243890 244205 +244559 244783 245055 245985 246123 246202 246235 247107 247225 247247 248788 +248829 248897 249067 249158 249951 250325 250563 250821 251275 252586 252655 +253011 253175 253253 254634 255189 255507 255626 256711 257193 258115 258819 +258874 259233 259259 259325 259407 259666 260110 260642 260678 260710 261326 +261443 261725 262353 262885 263097 263302 264275 264385 265475 265727 265837 +266955 267189 267197 267325 267501 267674 268119 268203 269059 269555 270193 +270215 270231 270802 272194 272855 272935 273325 273581 273885 273999 274022 +274846 275684 276573 276575 277365 277574 278018 278179 278369 278690 279357 +279775 280041 280053 280497 281015 282302 282777 283383 283475 284053 284258 +284954 285131 285770 287287 287451 287638 287738 288145 288463 288827 289289 +290145 290605 290966 291005 291305 291893 292175 292201 292494 293335 293595 +293854 294151 294175 295075 295647 296225 296769 296989 297910 298265 298623 +298775 299299 299367 300237 300713 302005 303025 303646 303862 303918 304175 +304606 305045 305283 305762 305767 305942 306397 306475 307582 308074 308357 +308913 309442 310329 310821 311170 311395 312325 312666 312987 313565 314019 +314041 314171 314534 314755 314870 315425 315514 316239 316342 316825 317471 +318478 318565 318734 318835 318903 319319 319345 319390 320013 320045 322161 +322465 323449 323785 323817 324818 325335 325622 325703 325822 326337 326859 +326975 327795 328757 329623 330395 331075 331177 331298 331545 331683 331731 +333355 333925 335405 335559 335699 336091 336743 336774 336973 337502 337535 +338169 338675 338997 339031 339521 340442 340535 341341 341446 341734 341887 +342309 343077 343915 344379 344729 344810 345477 347282 347633 347967 348725 +348843 349095 349401 349525 349809 350727 350987 351538 351785 352869 353379 +353717 354609 355570 355946 356345 356421 356915 357309 357425 359414 359513 +360778 360789 361361 361491 361675 362674 363562 364021 364154 364994 365585 +365835 366415 367114 368039 369265 369303 369985 370025 370139 371665 371722 +372775 373182 373737 374255 375193 375683 376475 377245 377377 378235 378301 +378879 378917 380494 380545 381095 381938 381951 381997 382075 382109 382655 +383439 383525 384307 384659 384826 385526 386425 386630 387686 388311 388531 +389499 390165 390166 390963 391017 391065 391534 391685 391989 393421 394010 +394953 395937 397010 397822 397969 398866 398905 399475 400078 400673 400775 +401511 401698 401882 402866 403403 403535 404225 406203 406334 406445 406802 +406847 407407 407827 408291 408425 409975 410669 410839 411033 411845 412114 +412269 413075 413526 413678 414715 415454 416361 416585 417027 417074 417175 +417571 417605 418035 419881 421685 422807 423243 423453 424390 424589 424762 +424879 425258 425315 425546 425845 426374 426387 427025 427063 427431 428655 +429598 429913 430606 431365 431457 431607 432055 435638 435953 436449 437255 +438741 438991 440657 440781 440818 443989 444925 445315 445835 445991 446369 +446865 447005 447083 447146 447811 447925 448063 450262 450385 451451 453299 +453871 454138 454181 454597 455469 455793 455877 456025 456475 456665 456909 +458643 458689 458913 458983 459173 460955 461373 462111 462275 462346 462553 +462722 464163 465595 466697 466735 466755 467495 468999 469567 470327 471295 +471801 472305 472549 473271 474513 474734 476749 477158 477717 478101 479085 +480491 480766 481481 481574 482734 483575 484561 485537 486098 486266 487227 +487475 487490 488433 488733 489325 490637 491878 492499 492745 493025 494615 +496223 496947 497705 497798 498883 499681 500395 501787 502918 503234 505161 +505325 506253 506530 507566 508079 508277 508805 508898 509675 510663 511819 +512006 512169 512601 512746 512981 514786 514855 516925 516971 517215 517979 +518035 519622 520331 520421 520923 521110 521594 521645 523957 527065 527307 +528143 529529 531505 532763 533355 533533 533919 535717 536393 536558 536935 +537251 539121 539695 540175 541167 541282 541717 542087 542225 542659 543286 +543895 544011 544765 544825 545054 545343 546231 546325 547491 548359 550671 +551614 552575 552805 555458 555611 555814 555841 557566 557583 558467 559265 +559682 559773 561290 562438 563615 563914 564775 564949 564995 567853 568178 +569023 570515 570741 571795 572242 572663 572907 573562 573965 574678 575795 +576583 577239 578289 578347 579945 580601 581405 581529 581647 581825 582335 +582958 583015 583219 584545 584647 585249 585599 587301 588115 588965 590359 +591015 593021 593929 594035 594146 594473 595441 595515 596183 596733 598299 +600117 600281 600457 600691 601315 602485 602547 602823 603725 603911 604299 +604877 605098 607202 609501 609725 610203 612157 613118 614422 615043 615505 +616975 618171 618233 620194 620289 620517 620806 620977 621970 622895 623162 +623181 623441 624169 625611 625807 628694 630539 631465 633919 634114 634933 +636585 637143 637887 638319 639065 639331 639561 640211 640871 644397 644725 +645337 645909 647185 648907 649078 649165 650275 651605 651695 651775 651833 +653315 653429 653457 654493 655402 656183 656903 657662 658255 659525 659813 +661227 662966 663803 664411 665482 669185 670719 671099 675393 676286 677005 +677846 680485 680846 681207 682486 683501 683675 684574 685055 685069 687115 +687242 687401 689210 689843 692461 692714 693519 693842 693935 694083 695045 +696725 696787 700553 700843 701437 702559 702658 704099 705686 705755 708883 +709142 709423 709631 710645 712101 712327 712385 714425 715737 719095 719345 +720575 720797 721149 722361 724101 724594 725249 726869 727415 729147 729399 +729554 730303 730639 730825 731235 733381 734635 734638 735034 737426 737817 +737891 742577 743002 743774 744107 744775 746697 748867 749177 751502 751709 +754354 754377 754851 755573 756613 757393 758582 759115 759655 759795 761349 +761453 761515 762671 763347 764405 764855 768009 768955 769119 770185 772179 +773605 773927 774566 774706 775489 777925 779433 781665 782254 782391 782971 +783959 785213 785519 785806 786335 787175 788785 789061 790855 790993 791282 +792281 793117 796195 796835 798475 798721 800513 803551 804287 804837 806113 +809042 809627 811923 812045 812383 813967 814055 814555 814929 815269 816221 +817581 817663 818363 818662 823361 824182 824551 827421 828134 828245 828269 +828971 829226 829939 830297 830414 831575 831649 832117 833187 833721 836349 +836969 837199 838409 839523 839914 841841 841935 843479 843657 843755 845871 +850586 851105 852267 853615 854335 858363 858458 859027 860343 861707 862017 +862025 866723 866822 868205 870758 872053 872275 873422 874437 876826 877591 +877933 878845 884051 884374 885391 886414 887777 888925 889778 889865 891219 +893809 894179 894691 896506 898535 898909 900358 901945 906059 906685 907647 +908831 908905 910385 910803 912247 912373 912485 914641 916487 917662 917785 +918731 919677 921475 921557 921633 924482 926497 926782 927707 927979 929305 +930291 931209 932955 933658 934743 935693 936859 943041 947546 947807 949003 +950521 951142 951171 951235 952679 954845 955451 959077 960089 961961 962065 +963815 964894 966329 966575 969215 971509 971618 973063 973617 975415 978835 +979693 980837 983103 983411 985025 986493 988057 988418 989417 990437 990698 +990847 992525 994449 994555 994903 997165 997339 997694 998223 998963 1000195 +1004245 1004663 1004705 1005238 1006733 1007083 1007165 1012894 1013173 1014101 +1014429 1015835 1016738 1016769 1017005 1018381 1021269 1023729 1024309 1024426 +1026817 1026861 1028489 1030285 1030863 1032226 1033815 1034195 1036849 1037153 +1038635 1039071 1040763 1042685 1049191 1053987 1056757 1057978 1058529 1058743 +1059022 1060975 1061905 1062761 1063145 1063517 1063713 1063865 1065935 1066121 +1067857 1070167 1070558 1070797 1072478 1073995 1076515 1076537 1078259 1083047 +1083121 1084039 1085773 1085926 1086891 1088153 1089095 1094331 1094951 1095274 +1096381 1099825 1100869 1101957 1102045 1102551 1103414 1104299 1105819 1106139 +1106959 1107197 1114366 1114503 1114673 1115569 1115661 1117865 1119371 1121549 +1121894 1123343 1125655 1127253 1131531 1132058 1132681 1133407 1135234 1135345 +1136863 1137873 1139677 1140377 1146442 1147619 1155865 1156805 1157819 1159171 +1159543 1161849 1162059 1162213 1169311 1171001 1172354 1173381 1175675 1178709 +1181257 1182446 1183301 1186835 1186923 1187329 1191547 1192895 1195061 1196069 +1196506 1196569 1198483 1199266 1201915 1203935 1206835 1208938 1209271 1210547 +1211573 1213511 1213526 1213563 1213682 1215245 1215487 1215665 1216171 1218725 +1225367 1227993 1229695 1230383 1234838 1236273 1239953 1242201 1242989 1243839 +1244495 1245621 1245811 1255133 1255501 1257295 1257949 1257962 1258085 1259871 +1262723 1263661 1266325 1266749 1267474 1268915 1269359 1272245 1272467 1274539 +1275879 1277479 1279091 1280015 1281137 1281865 1281974 1282633 1284899 1285999 +1286965 1287687 1292669 1293853 1294033 1295723 1299055 1300233 1301027 1302775 +1303985 1306137 1306877 1310133 1310278 1314542 1315239 1316978 1322893 1325467 +1326561 1329621 1331729 1334667 1336783 1338623 1339634 1340003 1341395 1344718 +1344759 1346891 1349341 1349834 1350537 1351166 1353205 1354111 1354886 1356277 +1356901 1358215 1362635 1365581 1368334 1370369 1370386 1372019 1376493 1379035 +1381913 1386723 1388645 1389223 1389535 1390173 1392377 1393915 1396031 1399205 +1400273 1400487 1403207 1403225 1405943 1406095 1406587 1409785 1410031 1412327 +1414127 1414562 1416389 1420445 1421319 1422169 1423807 1426713 1428163 1430605 +1431382 1432417 1433531 1433729 1433905 1436695 1437293 1442399 1442926 1446071 +1447341 1447873 1448161 1448402 1454089 1457395 1457427 1459354 1459759 1465399 +1466641 1468987 1469194 1472207 1482627 1483339 1485365 1486047 1486667 1488403 +1489411 1492309 1496541 1497067 1497238 1503593 1507121 1507857 1508638 1511653 +1512118 1512745 1514071 1515839 1516262 1518005 1519341 1519817 1524733 1525107 +1526657 1529099 1531309 1532795 1533433 1536055 1536639 1542863 1544491 1548339 +1550485 1552015 1552661 1554925 1557905 1563419 1565011 1566461 1567247 1571735 +1575917 1582009 1582559 1583023 1585285 1586126 1586899 1586967 1588533 1589483 +1600313 1602403 1604986 1605837 1608717 1612682 1616197 1616402 1617122 1618211 +1619527 1622695 1628889 1629887 1635622 1638505 1639187 1641809 1642911 1644155 +1655121 1657415 1657466 1661569 1663705 1670053 1671241 1671549 1675333 1681691 +1682681 1682841 1685509 1687829 1689569 1690715 1691701 1692197 1694173 1694407 +1694615 1698087 1698619 1701343 1701931 1702115 1702851 1706215 1709659 1711435 +1711463 1718105 1719663 1721573 1722202 1723025 1727878 1729937 1731785 1734605 +1735327 1739881 1742293 1750507 1751629 1753037 1756645 1758531 1760213 1761319 +1764215 1769261 1771774 1772855 1773593 1773669 1776481 1778498 1781143 1786499 +1790921 1791946 1792021 1794611 1794759 1798899 1801751 1804231 1804786 1806091 +1807117 1811485 1812446 1813407 1818677 1820289 1820523 1822139 1823885 1825579 +1826246 1834963 1836595 1837585 1843565 1847042 1847677 1849243 1852201 1852257 +1852462 1856261 1857505 1859435 1869647 1870297 1872431 1877953 1878755 1879537 +1885885 1886943 1891279 1894487 1896455 1901211 1901501 1907689 1908386 1910051 +1916291 1920983 1922961 1924814 1929254 1930649 1933459 1936415 1936765 1939751 +1944103 1945349 1951481 1952194 1955635 1956449 1957703 1958887 1964515 1965417 +1968533 1971813 1973699 1975103 1975467 1976777 1978205 1979939 1980218 1982251 +1984279 1987453 1988623 1994707 1999283 1999591 1999898 2002481 2002847 2007467 +2009451 2011373 2017077 2019127 2019719 2022605 2024751 2026749 2032329 2040353 +2044471 2046655 2048449 2050841 2052501 2055579 2056223 2060455 2062306 2066801 +2070107 2070335 2071771 2073065 2076035 2079511 2092717 2099785 2100659 2111317 +2114698 2116543 2117843 2120393 2121843 2125207 2126465 2132273 2132902 2137822 +2141737 2145913 2146145 2146981 2147073 2150477 2153437 2155657 2164389 2167055 +2167957 2170679 2172603 2172821 2176895 2181067 2183555 2188021 2189031 2192065 +2193763 2200429 2203791 2204534 2207161 2209339 2210351 2210935 2212873 2215457 +2215763 2216035 2219399 2221271 2224445 2234837 2237411 2238067 2241265 2242454 +2245857 2250895 2257333 2262957 2266627 2268177 2271773 2274393 2275229 2284997 +2285258 2289443 2293907 2294155 2301817 2302658 2304323 2311205 2313649 2316955 +2320381 2329187 2330038 2334145 2336191 2338919 2340503 2343314 2345057 2357381 +2359379 2362789 2363153 2363486 2367001 2368333 2368865 2372461 2377855 2379189 +2382961 2386241 2388701 2396009 2397106 2399567 2405347 2407479 2412235 2416193 +2419023 2422109 2424499 2424603 2425683 2428447 2429045 2442862 2444923 2445773 +2453433 2459303 2461462 2466827 2469901 2471045 2473211 2476441 2476745 2481997 +2482597 2486199 2494235 2497759 2501369 2501917 2505919 2513095 2519959 2532235 +2536079 2541845 2542903 2544971 2551594 2553439 2561065 2571233 2572619 2580565 +2580991 2581934 2582827 2583303 2585843 2589151 2591817 2592629 2598977 2600507 +2603209 2611037 2612233 2614447 2618629 2618998 2624369 2630257 2631218 2636953 +2640239 2641171 2644213 2644945 2647555 2648657 2655037 2657661 2667747 2673539 +2674463 2676395 2678741 2681195 2681869 2687919 2688907 2700451 2705329 2707063 +2707179 2709239 2710981 2711471 2714815 2718669 2732561 2733511 2737889 2738185 +2739369 2750321 2758535 2760953 2764177 2766049 2767787 2769487 2770563 2771431 +2778693 2785915 2791613 2792387 2798939 2804735 2816033 2820103 2827442 2830145 +2831323 2831647 2838085 2857921 2861062 2862579 2865317 2866105 2868767 2884637 +2886689 2887221 2893757 2893881 2898469 2902291 2904739 2906449 2915674 2922029 +2926703 2928291 2930885 2937874 2939699 2951069 2951897 2956115 2970327 2977051 +2986159 2988073 2991265 2997383 2997797 2998165 2999847 3004603 3005249 3007693 +3022345 3022438 3025541 3027973 3033815 3033877 3034205 3047653 3055019 3056977 +3066613 3068891 3078251 3082729 3085771 3087095 3090277 3093409 3093459 3095309 +3101527 3102449 3114223 3120469 3124979 3130231 3137771 3140486 3144905 3147331 +3151253 3154591 3159637 3160729 3168685 3170366 3172047 3192101 3197207 3199353 +3204935 3206269 3206733 3211817 3230882 3234199 3235687 3243737 3246473 3255482 +3267803 3268967 3271021 3275695 3276971 3286355 3292445 3295331 3299179 3306801 +3307837 3308987 3316411 3328039 3328997 3332849 3339611 3346109 3349085 3361795 +3363681 3372149 3374585 3377129 3377543 3377915 3379321 3381487 3387215 3390361 +3400663 3411067 3414433 3415997 3420835 3424361 3425965 3427391 3427887 3445403 +3453839 3453987 3457817 3459463 3467443 3479998 3487583 3487627 3491929 3494413 +3495057 3502969 3514971 3516263 3518333 3531359 3536405 3537193 3542851 3545129 +3545229 3558583 3569929 3578455 3585491 3595659 3604711 3607315 3607426 3610477 +3612791 3614693 3617141 3621005 3624179 3628411 3637933 3646313 3648385 3651583 +3655847 3660151 3662497 3664293 3665441 3672985 3683017 3692193 3693157 3702923 +3706577 3719573 3728153 3735407 3743095 3744653 3746953 3748322 3753673 3765157 +3771595 3779309 3779831 3780295 3789227 3790655 3800741 3809927 3816131 3817879 +3827227 3827391 3833459 3856214 3860173 3861949 3864619 3872901 3881273 3900281 +3915083 3926629 3928497 3929941 3933137 3946813 3946827 3962203 3965315 3973319 +3985267 3993743 3997418 4012465 4012547 4024823 4031261 4031705 4035239 4039951 +4040509 4041005 4042687 4042805 4050553 4055843 4081181 4086511 4089055 4090757 +4093379 4103239 4121741 4131833 4133261 4138561 4143665 4148947 4153546 4170751 +4172201 4180963 4187771 4197431 4219007 4221811 4231283 4241163 4247341 4247887 +4260113 4260883 4273102 4274803 4277489 4291593 4302397 4305505 4309279 4314311 +4319695 4321933 4325633 4352051 4358341 4373511 4375681 4392287 4395859 4402867 +4405999 4406811 4416787 4425499 4429435 4433549 4436159 4446245 4449731 4458389 +4459939 4467073 4479865 4486909 4502641 4509973 4511965 4531115 4533001 4533657 +4554737 4560743 4565615 4567277 4574953 4585973 4586959 4600897 4602578 4609423 +4617605 4617931 4619527 4621643 4631155 4632959 4672841 4678223 4688719 4706513 +4709861 4710729 4721393 4721519 4724419 4729081 4739311 4742101 4755549 4757297 +4767521 4770965 4775147 4777721 4780723 4789169 4793269 4796351 4803821 4812035 +4821877 4822543 4823135 4829513 4834531 4846323 4864057 4871087 4875277 4880485 +4883223 4884763 4890467 4893779 4903301 4930783 4936409 4940377 4950545 4950967 +4951969 4955143 4999745 5009837 5034679 5035589 5047141 5050241 5069407 5084651 +5097301 5100154 5107739 5135119 5142179 5143333 5155765 5161217 5178013 5211503 +5219997 5222587 5231281 5240333 5258773 5271649 5276851 5280233 5286745 5292413 +5296877 5306917 5316979 5321303 5323153 5332255 5343161 5343899 5344555 5357183 +5382871 5389969 5397691 5411139 5436299 5448839 5459441 5487317 5511335 5517163 +5528809 5538101 5551441 5570917 5579977 5590127 5592059 5606135 5617451 5621447 +5622483 5634343 5635211 5644387 5651522 5656597 5657407 5659927 5677243 5690267 +5699369 5713145 5724677 5748431 5756645 5761691 5768419 5783557 5784321 5787191 +5801131 5818879 5824621 5825095 5827289 5837009 5841557 5852327 5858285 5888069 +5891843 5896579 5897657 5898629 5908715 5920039 5964803 5972593 5975653 5992765 +5996127 5998331 6009133 6024007 6024083 6027707 6047573 6068777 6107155 6129013 +6153655 6159049 6166241 6170417 6182423 6201209 6224743 6226319 6229171 6230319 +6243787 6244423 6247789 6268121 6271811 6298177 6305431 6315517 6316751 6322079 +6343561 6378985 6387767 6391861 6409653 6412009 6424717 6439537 6447947 6454835 +6464647 6468037 6483617 6485011 6503453 6528799 6534047 6547495 6578045 6580783 +6583811 6585001 6591499 6595963 6608797 6649159 6658769 6674393 6675251 6679351 +6704017 6709469 6725897 6736849 6752389 6791609 6832679 6876857 6883643 6903867 +6918791 6930763 6958627 6971107 6979061 6982823 6999643 7005547 7039139 7048421 +7050857 7058519 7065853 7068605 7119281 7132231 7139269 7152655 7166363 7172191 +7206529 7218071 7229981 7243379 7289185 7292311 7296893 7344685 7358377 7359707 +7367987 7379021 7395949 7401443 7424087 7431413 7434817 7451873 7453021 7464397 +7465157 7482377 7517179 7525837 7534519 7537123 7556095 7563113 7620301 7624109 +7650231 7653043 7685899 7715869 7777289 7780091 7795229 7800127 7829729 7848589 +7851215 7858097 7867273 7872601 7877647 7887919 7888933 7903283 7925915 7936093 +7947563 7966211 7979183 7998403 8026447 8054141 8059303 8077205 8080567 8084707 +8115389 8138705 8155133 8155351 8176753 8201599 8234809 8238581 8258753 8272201 +8297509 8316649 8329847 8332831 8339441 8389871 8401553 8420933 8448337 8452891 +8477283 8480399 8516807 8544523 8550017 8553401 8560357 8609599 8615117 8642273 +8675071 8699995 8707621 8717789 8723693 8740667 8773921 8782579 8804429 8806759 +8827423 8869751 8890211 8894171 8907509 8909119 8930579 8992813 8995921 9001687 +9018565 9035849 9036769 9099743 9116063 9166493 9194653 9209263 9230371 9303983 +9309829 9370805 9379019 9389971 9411631 9414613 9472111 9478093 9485801 9503329 +9523541 9536099 9549761 9613007 9622493 9640535 9649489 9659011 9732047 9744757 +9781739 9806147 9828767 9855703 9872267 9896047 9926323 9965009 9968453 9993545 +10013717 10044353 10050791 10060709 10083499 10158731 10170301 10188541 +10193761 10204859 10232447 10275973 10282559 10309819 10314971 10316297 +10354117 10383865 10405103 10432409 10482433 10496123 10506613 10511293 +10553113 10578533 10586477 10610897 10631543 10652251 10657993 10682755 +10692677 10737067 10754551 10773529 10784723 10891199 10896779 10938133 +10991701 10999439 11096281 11137363 11173607 11194313 11231207 11233237 +11308087 11342683 11366807 11386889 11393027 11394187 11430103 11473481 +11473589 11484911 11506445 11516531 11528497 11529979 11560237 11630839 +11647649 11648281 11692487 11730961 11731109 11758021 11780899 11870599 +11950639 12005773 12007943 12023777 12041003 12124937 12166747 12178753 +12179993 12264871 12311417 12333497 12404509 12447641 12488149 12511291 +12540151 12568919 12595651 12625991 12664619 12689261 12713977 12726523 +12750385 12774821 12815209 12823423 12836077 12853003 12871417 12888227 +12901781 12999173 12999337 13018667 13055191 13119127 13184083 13306099 +13404989 13435741 13438339 13482071 13496749 13538041 13590803 13598129 +13642381 13707797 13739417 13745537 13759819 13791559 13863863 13895843 +13902787 13955549 13957343 13990963 14033767 14088461 14128805 14200637 +14223761 14329471 14332061 14365121 14404489 14466563 14471699 14537411 +14575951 14638717 14686963 14742701 14854177 14955857 14967277 15060079 +15068197 15117233 15145247 15231541 15247367 15320479 15340681 15355819 +15362659 15405791 15464257 15523091 15538409 15550931 15581189 15699857 +15735841 15745927 15759439 15878603 15881473 15999503 16036207 16109023 +16158307 16221281 16267463 16360919 16398659 16414841 16460893 16585361 +16593649 16623409 16656623 16782571 16831853 16895731 16976747 16999133 +17023487 17102917 17145467 17218237 17272673 17349337 17389357 17437013 +17529601 17546899 17596127 17598389 17769851 17850539 17905151 17974933 +18129667 18171487 18240449 18285733 18327913 18378373 18457339 18545843 +18588623 18596903 18738539 18809653 18812071 18951881 18999031 19060859 +19096181 19139989 19424693 19498411 19572593 19591907 19645847 19780327 +19805323 19840843 19870597 19918169 20089631 20262569 20309309 20375401 +20413159 20452727 20607379 20615771 20755039 20764327 20843129 20922427 +20943073 21000733 21001829 21160633 21209177 21240983 21303313 21688549 +21709951 21875251 21925711 21946439 21985799 22135361 22186421 22261483 +22365353 22450231 22453117 22619987 22772507 22844503 22998827 23207189 +23272297 23383889 23437829 23448269 23502061 23716519 24033257 24240143 +24319027 24364093 24528373 24584953 24783229 24877283 24880481 24971929 +24996571 25054231 25065391 25314179 25352141 25690723 25788221 25983217 +26169397 26280467 26480567 26694131 26782109 26795437 26860699 26948111 +26998049 27180089 27462497 27566719 27671597 27698903 27775163 27909803 +27974183 28050847 28092913 28306813 28713161 28998521 29343331 29579983 +29692241 29834617 29903437 29916757 30118477 30259007 30663121 30693379 +30927079 30998419 31083371 31860737 31965743 32515583 32777819 32902213 +33059981 33136241 33151001 33388541 33530251 33785551 33978053 34170277 +34270547 34758037 35305141 35421499 35609059 35691199 36115589 36321367 +36459209 36634033 36734893 36998113 37155143 37438043 37864361 37975471 +38152661 39121913 39458687 39549707 40019977 40594469 40783879 40997909 +41485399 42277273 42599173 43105703 43351309 43724491 43825351 44346461 +45192947 45537047 45970307 46847789 47204489 47765779 48037937 48451463 +48677533 49140673 50078671 50459971 52307677 52929647 53689459 53939969 +54350669 55915103 57962561 58098991 58651771 59771317 60226417 61959979 +64379963 64992503 66233081 66737381 71339959 73952233 76840601 79052387 +81947069 85147693 87598591 94352849 104553157 } + +! This is a lookup table for the final hand values of all hands not covered in +! the flushes and unique5 tables above. +CONSTANT: values-table +{ 166 322 165 310 164 2467 154 2466 163 3325 321 162 3324 2464 2401 161 2465 +3314 160 2461 159 2400 320 3323 153 2457 6185 2463 3303 2452 158 3322 157 298 +2460 2446 152 3292 156 2398 3321 2462 5965 155 6184 309 2456 3320 2439 3313 +2395 2459 2431 2335 2451 6181 3319 3281 2422 151 2391 2445 6183 2399 2455 319 +3291 2412 5964 6175 2386 3318 5745 150 2450 6180 3312 3317 297 6165 2458 2438 +5961 2430 2380 142 2444 3311 308 3316 318 286 149 6150 5963 6174 3259 5525 3315 +2421 2397 2454 5955 148 6182 2373 3302 6164 2437 5960 2411 5744 2449 2365 3310 +5945 6178 2429 6129 2334 2394 2453 6179 6101 147 141 3309 6149 5741 2448 2356 +2443 3215 2269 5930 2420 2396 5954 3290 3248 3280 2346 6065 6172 2390 2410 3308 +317 146 6173 2442 5944 3258 6128 3270 2393 6020 3301 6162 145 3289 5735 2436 +2385 5958 2447 6100 5909 2333 6169 6163 2428 2332 5881 5725 6177 316 5929 3307 +3300 6159 144 2435 6147 3204 285 3306 2379 6064 2441 2389 6148 2427 5524 2329 +2419 307 143 5845 3288 5952 3214 3257 2268 6019 5710 5962 3160 2440 6144 2384 +2409 5305 5908 3269 5800 3305 3287 6171 5942 5521 3299 6126 2418 5743 2392 6155 +5880 2372 2434 5949 6176 6127 6098 5959 3304 2331 6161 2364 2426 315 2325 2408 +3298 3094 6099 2378 5689 140 2433 6168 5939 3286 6123 5740 5927 306 5661 5844 +6140 2425 3213 2320 130 6095 3279 2328 6062 6158 2355 5515 2417 2388 6146 5085 +5304 2267 5799 3297 6063 3149 6170 6135 274 2432 5953 5924 5523 6017 3247 2371 +2345 5625 2407 5505 2416 2383 3285 2424 3278 6018 5906 2314 6059 5742 3159 5935 +6160 2363 6119 5734 2387 6143 5943 3237 3284 296 5878 5580 6167 2406 3256 6091 +3017 5520 2324 6125 6014 5957 6154 3083 3296 6114 5724 2382 314 5490 5903 2415 +6097 5739 2377 139 6157 3295 2354 5920 6086 6145 5084 2319 5738 2423 129 3093 +5928 2307 3283 5875 5842 3212 3277 6122 2405 2266 6055 3203 3246 313 2344 2299 +305 6139 5915 2203 6108 3282 5709 6094 2376 5522 3158 5797 138 6061 3255 3294 +5514 6010 6142 3276 5951 6050 3193 5303 5469 6080 284 2414 2370 2313 5839 4865 +2381 6134 262 5899 2263 5733 6124 5956 6016 6153 3236 5441 5907 2413 3254 2362 +3293 2290 5504 6005 5732 5941 5301 5871 2404 3006 6096 5519 5794 6058 2330 6166 +304 5879 6118 5894 5948 5723 2929 3092 3275 5688 2403 2369 6044 2280 5722 6090 +6121 2375 3016 5866 137 3202 6013 5737 6073 4645 5660 6156 2306 5405 2361 6138 +312 2353 6113 5729 5938 3253 5081 5489 6093 5999 2265 5835 2327 5926 6060 3211 +2830 2298 5843 2259 6085 5950 2374 5083 3226 136 273 128 5888 5360 5708 2402 +4864 2343 6133 5295 5719 5513 5790 6054 6015 5707 5830 3192 5302 3157 3274 5860 +3210 6037 5798 5624 2352 3148 2254 6141 5940 2137 2202 2368 6107 2262 311 5923 +6057 3268 3273 6029 5285 6117 2289 5947 6009 5503 5518 5785 5731 3252 6049 3245 +5468 6152 2360 6079 5992 303 5579 5905 135 2342 3138 5934 6089 3015 2323 2367 +6012 5704 3251 3156 295 2918 4644 5440 5687 5984 5824 5877 2279 6112 3209 5937 +6004 5721 5300 2248 4425 3091 2359 3267 5925 5686 5715 5853 3082 5659 3272 2720 +6084 3182 5728 6120 2318 5270 3201 6151 2928 5488 5902 5779 2351 6043 5658 6137 +5075 2819 2258 5919 6053 6092 5082 3225 2326 3250 6072 2366 3072 3271 134 5404 +5874 5975 3147 5841 5512 3244 5718 5080 2200 6106 3090 2341 5922 5683 5998 2264 +5706 2350 4861 2829 6132 2358 5065 5817 133 5623 6008 5700 2253 3208 250 5914 +6048 261 3249 2241 6078 2201 5359 5904 2312 5655 2599 4863 5796 6136 5933 5622 +5502 5294 5809 3243 3266 3207 5517 2340 5249 294 6056 3235 2233 5467 5772 6036 +5876 5578 5838 5509 3137 6116 6003 5695 5946 3155 2136 5298 5898 4424 2261 5703 +5221 4855 5577 302 6131 3081 5439 5764 6028 2349 5284 132 6088 3265 3014 5050 +2322 6011 2927 5299 2247 5870 5901 5991 3005 4641 6042 5685 5793 5619 5499 5714 +6111 2357 5936 3089 5918 2709 5679 5487 5893 3181 3206 5736 3242 6071 4205 4643 +2305 2224 5873 5983 2339 5657 131 6115 5840 3200 6083 301 5078 2317 5651 5997 +127 2995 5865 3154 5574 5185 2828 3071 2297 5403 5755 2719 6087 238 5511 3013 +5913 5674 2321 6052 3205 5269 5079 2199 2214 4635 3264 5682 5834 3127 5795 3146 +6110 5074 5292 3985 3199 2348 2257 118 5484 5699 6105 5029 5646 2071 3191 5921 +3224 6130 5140 2240 5887 6035 5358 5654 2588 5837 5974 4862 5621 6082 6007 5501 +2134 5293 2316 6047 2347 5897 126 5466 5789 6077 5001 5615 3241 2311 5829 5495 +4860 2232 5932 5859 2338 5064 6027 5282 2288 5508 2252 6051 5730 5694 4845 2135 +5297 5869 3088 272 5990 3004 5668 5438 3153 5792 2598 3240 3145 5576 6002 2337 +5283 2197 6104 5892 5570 4421 3198 5516 5784 5248 5610 4204 3061 3263 5982 5640 +3080 3152 2278 3012 5618 293 6006 5498 6046 5720 4625 5463 300 5678 2926 4423 +6076 5864 5486 5900 2310 6041 6109 5220 4965 4854 5931 2917 4642 3262 2223 5823 +5480 2718 5727 5917 5049 5565 5267 5077 3234 2246 5435 5650 6070 5833 2994 4640 +2304 4830 5402 5872 5573 6081 3011 5072 3239 3984 2315 5852 6001 125 3171 2336 +3765 2005 4415 5673 3180 5996 283 4920 5268 3087 5886 2907 2213 3079 2827 5778 +5973 3126 5604 2296 3151 5475 5073 5291 5717 2818 5912 2925 5788 117 5483 3197 +5645 5357 249 6040 5705 5828 4858 3238 3086 5184 5858 5633 5062 292 2193 3261 +6103 299 124 5916 5510 2133 3190 2198 6069 5465 4634 2597 2303 5399 5559 3196 +5614 6034 3150 5494 5836 4859 6045 2808 5063 5281 5816 5459 2131 6075 226 5896 +2309 5028 5995 2260 5783 5246 2070 3144 5139 2239 4610 2826 5667 5437 3260 4809 +2295 3545 6026 3136 2188 6102 2287 5911 5500 3233 5808 5431 2984 2196 5868 5354 +5569 5989 5702 3003 5000 5218 4852 5247 5609 5791 6000 2916 3060 2231 3085 5639 +5289 5771 5822 5597 4781 4405 5454 5507 6074 5047 5891 2308 4844 260 5296 123 +3078 5462 4201 4422 4638 6033 5684 5981 5219 3195 4853 2277 5713 5851 106 2924 +5763 5589 3232 5479 3764 5895 5426 6039 282 4420 5048 5863 5564 5266 4203 3084 +5434 5777 5552 4639 6025 5656 5279 3143 5401 2286 2717 4390 5071 5497 2817 5726 +6068 2182 3170 3010 4624 2708 2302 5395 5867 237 5988 3002 5485 5832 3194 4964 +5182 4589 2906 3070 5069 3981 2222 5544 5603 2923 5994 2256 4745 5474 5890 6038 +5076 271 2825 5448 3009 4195 4632 2294 5681 5885 5980 291 5356 4829 2276 5972 +4857 5910 4561 5183 3983 5632 5061 5815 2192 5716 5754 5350 6067 5698 2698 2004 +5026 4414 2068 2301 5390 5862 5787 4919 5137 3231 5827 122 5420 3116 2212 4633 +5653 5857 3544 5059 5398 5558 3125 4700 2716 5620 5993 2251 3189 5290 2807 5807 +5264 5458 2130 6032 1939 2824 116 5482 4998 5027 5831 2293 5245 2069 2596 5138 +121 2127 3077 5770 3975 3142 2587 2255 5535 2187 5345 5693 4842 2132 3223 5782 +2175 2922 5430 2983 6024 5884 5464 5275 3008 5353 4999 2285 5217 5971 4851 5575 +5493 3135 5762 4525 5288 3188 5280 5596 3141 5987 3001 5453 4418 6031 5786 5046 +5701 5826 4843 2896 2167 4849 6066 4609 2915 2300 4637 5384 5856 2122 5436 4808 +2577 5617 5821 5889 2250 5044 105 4185 4622 5588 2707 5677 5979 2195 5425 3007 +2245 2275 6023 4419 3050 2595 4962 3230 2284 5413 4202 2823 3059 4480 5712 120 +5850 2292 5551 4780 5278 4404 5861 3761 5986 3000 3179 5781 5243 2181 4369 4623 +5649 5461 5339 5394 4200 2993 4827 2715 5572 5776 3229 4963 3134 5181 2797 3076 +5260 5068 2816 5543 5753 5478 3763 4170 2002 3140 4412 5672 5978 4917 3187 2274 +5265 5215 214 3105 3965 5447 4341 2914 119 2158 4631 6030 5433 281 3069 5820 +4828 5400 4389 5070 3075 3222 3982 2116 5883 3169 5349 115 2244 2697 2003 5025 +5644 4413 5970 2067 4629 5389 5680 4918 2714 5136 2921 4588 5419 3115 5711 290 +5377 5849 6022 3980 5255 2586 5058 5814 2283 3139 3755 4744 5473 5697 5825 259 +5023 2065 5263 5855 2148 5055 4194 5985 2238 225 3950 4997 5613 5775 5355 2249 +5652 3541 4856 2822 4560 3228 2126 2291 5060 5369 2815 3221 2191 5806 5534 5882 +2594 5344 4995 5969 4841 2174 4149 4607 5179 5332 5666 5977 2230 5274 3068 4806 +4305 3543 5769 5397 2273 4699 5506 202 5780 5239 289 5692 3074 5457 4839 2129 +2194 1938 5854 5568 3039 4417 3186 5244 248 5608 2895 2166 280 4848 3227 2920 +4608 5324 5638 3974 5383 2121 4778 5813 4807 5761 4402 2713 2576 2186 5696 2109 +5211 2061 2593 2973 5043 2913 4621 5134 5429 2237 4198 2982 4260 5819 5352 3185 +3049 3535 5216 4961 4850 5412 5040 5616 3929 6021 5496 3073 5234 4524 5287 2243 +2282 2687 5805 4779 4403 5452 4619 2706 5676 5045 2101 5563 3220 5242 3133 5848 +4959 2919 2999 2229 5338 4199 4636 5768 5968 4826 2221 3745 4387 3178 2796 5259 +5691 2821 5206 4835 104 4184 3168 2281 3762 2912 2001 5774 5424 4411 5648 2992 +4916 5818 4824 5214 1873 3104 4586 5571 2814 2905 5976 2998 5035 2157 3978 4479 +2272 5315 5760 5602 5277 4742 2242 5752 3760 4388 1999 4409 5671 2115 5175 4914 +4192 2180 4368 3067 5847 5393 2592 2211 4628 3124 3730 3184 4121 4558 5180 4587 +5631 3177 2820 5376 5067 2190 3979 5254 2712 2271 4615 4169 2705 5675 4743 5481 +5773 5228 5022 5643 2064 2092 3964 5446 2147 5054 4340 4193 5812 4630 2813 2566 +2220 5557 4697 3132 2585 5019 94 3901 4559 2806 5368 5130 2236 2128 2711 5170 +1936 5348 288 5647 3525 236 5024 2991 3219 2066 5388 5200 4820 4994 5612 3183 +5135 2911 5492 4606 5178 5418 5331 3114 3972 5804 5967 4805 2997 3542 5057 2185 +5751 4698 3754 4991 1995 1807 2962 5238 5670 2082 2228 5262 4838 279 5767 1937 +3949 4604 2210 3038 4996 5665 5811 3218 3123 4803 3540 5690 5846 5014 2056 4085 +2125 5323 4522 5286 3973 5595 5966 4777 5125 4401 3709 2235 2270 114 3176 5343 +2108 5210 5642 2060 3510 5567 2972 4840 2173 5607 4148 5133 4197 5759 3058 2591 +2996 5273 4304 5637 5803 2584 4775 4399 5039 2812 4986 103 5233 4182 4523 5587 +2686 2227 4618 190 5460 5766 2885 4416 2100 5611 5491 5164 2894 2165 4958 4847 +4040 4477 3066 5550 2590 5382 3028 2120 5276 2704 3131 287 5477 3758 4386 4955 +3865 5042 5205 4834 5562 2179 4183 4366 4620 2219 4600 5664 4259 5432 5758 5193 +4799 3048 3534 4960 4823 3217 213 4585 5411 3928 4384 5066 5034 3977 4478 5810 +5542 5314 4167 3130 2710 4741 2990 270 5008 3759 2050 1998 5566 4408 5241 5119 +5174 5606 4913 3962 2234 4338 4191 3057 4367 4583 5337 2904 5636 3489 5750 2786 +4825 3744 4771 1990 4395 5601 2703 5669 2910 4557 4739 2795 5472 4910 3820 5258 +5802 4950 3681 2209 4614 2696 4168 2000 3175 4189 4410 247 4980 2218 5227 4915 +3216 5213 2091 1872 3103 2226 3113 3963 4339 5765 4555 2156 2565 5630 5056 2589 +4696 113 5476 3752 5018 5641 93 2811 2989 4815 2114 5129 5561 5261 3645 5169 +1935 3947 3174 2583 4627 5199 3538 4819 5396 5556 5749 5157 3729 82 4694 4120 +4380 2124 3065 3971 5375 5757 4905 2805 5253 5533 5456 258 3753 4990 2208 3129 +1994 1933 201 2961 3122 5021 2172 2063 2081 4146 4579 2146 5053 2903 5272 3948 +4603 4302 3969 178 4802 5600 3539 5149 4735 112 5471 3900 5013 3064 2055 2909 +4521 5367 4595 5124 2702 5663 5428 2874 2043 2981 3524 5351 2582 4944 5112 4993 +278 2164 4846 4147 4605 4551 5177 5330 2217 5629 2119 3461 4804 4303 4519 2189 +2575 5594 4774 3128 4398 5451 1806 5237 4985 5605 5041 5801 4181 3056 4837 5635 +4257 4973 1741 224 2035 3037 2884 2951 3047 3532 3173 5555 5104 4690 2225 5163 +3926 2908 4476 4084 5322 2804 3425 3027 4776 5748 5455 102 4179 4400 3708 5586 +1984 3757 1929 5662 5423 4794 2107 4899 5209 4954 5240 2059 3509 2810 2971 4365 +5132 2207 4196 4599 2775 4258 4474 3121 3742 5192 4798 5549 3533 2184 277 5038 +5560 5257 2676 3927 4383 5756 5232 3063 2685 4166 5427 235 111 3600 2980 4363 +4617 5007 5634 2049 5392 3172 4766 2099 5212 1870 4375 3102 5118 3961 4957 4337 +2155 4039 4582 4515 3167 2581 5593 2785 3743 4770 5541 1989 4394 5450 4164 4385 +4738 4909 2113 2809 3864 4574 5204 4949 4833 2701 2902 3959 5445 4335 4188 4626 +4979 5599 4937 2026 5470 3727 4118 4822 1871 4584 5095 2216 5033 4554 3976 3062 +5252 5313 4175 5585 3380 3751 4740 5422 5347 2695 1997 5020 4407 2062 4814 5387 +4546 5173 4912 2940 2700 2145 5628 5052 4190 3946 2988 5417 269 4470 4788 5548 +3488 4929 3537 3166 5156 3728 3898 81 4693 4119 3749 4556 4379 2215 3819 4904 +5747 3680 1977 2178 4359 4613 2901 3522 5391 5554 1932 3944 4892 2016 4992 5226 +5598 4145 4730 2090 2555 3055 5176 2206 4578 2803 2987 3120 2123 4301 2564 4760 +3968 5540 1675 1924 4695 4160 5148 5017 4734 1804 5532 5236 92 3899 5342 5128 +4836 5746 4594 3644 110 3955 5444 1969 5168 4143 1934 4331 2873 5627 3036 2042 +3523 4884 2183 4299 5198 4943 5111 4818 4082 2205 4550 3970 2580 3119 2979 4518 +3706 5346 2694 4989 1993 2106 5208 1805 2960 2058 3507 5386 5553 2970 4685 2080 +5131 2893 109 4510 5416 3112 4256 4972 189 5592 2802 4602 2034 2950 5381 3531 +5449 2118 4801 5103 4689 2574 1918 5037 2665 3925 5012 5231 2054 4083 4520 2579 +276 3165 5123 4178 3707 4616 1983 1928 3940 2098 4254 4793 4898 3508 268 3529 +4956 4568 4037 2900 5410 101 2863 3923 2774 5584 3460 4473 3741 2986 5421 4724 +2978 4773 5531 4397 5341 2675 4984 3862 5203 4832 4180 2171 4139 4465 2699 5547 +4362 1740 1960 5271 5336 2883 4295 5591 4765 4821 3739 1869 4374 4875 3054 4540 +5162 5626 5032 4038 2794 4475 4753 2204 2177 4514 3424 4354 3026 3118 3756 4163 +1996 4406 4953 5172 3863 4911 4573 2892 2163 1867 4364 3101 3958 4598 5539 4334 +3486 108 5380 2985 100 4155 5191 4936 4797 5583 4679 2025 3726 2573 4117 3053 +5094 3817 2801 4382 2764 5443 3678 2112 4326 4174 4612 4165 70 2578 3599 1950 +5006 4250 5546 5225 2048 3046 2544 2089 5117 4545 3960 3724 5409 2939 4115 4336 +3919 4581 275 4469 4787 5374 3487 3117 2784 4928 2176 2693 4769 4348 1988 5016 +4393 91 3897 5385 3748 4737 4908 5127 3818 3164 5415 4948 3642 246 5167 3679 +223 1976 4358 3521 107 5051 5335 4187 4978 3943 4891 5538 5197 2015 4817 3735 +2852 4729 212 2554 2793 3895 4504 5256 4553 5590 4759 5366 4717 177 1923 3935 +5442 3379 3750 4320 4159 4988 1992 1803 2959 3519 2079 4813 3163 1863 257 3643 +3954 1968 4142 3945 4601 4330 2154 5329 4883 5530 4800 4298 3536 5340 4533 5155 +2692 80 4692 2899 5011 4378 2053 4081 3052 1801 2170 99 4134 4903 5582 5122 +3705 4709 5414 3111 4290 1931 3506 3035 4684 3720 4144 4111 4577 4459 4509 3458 +5373 5545 4079 4300 5321 3967 4672 5251 1674 4772 4396 3703 1917 2753 5147 2664 +4733 2800 4983 2891 2105 2162 2057 3504 267 1911 4593 5379 1738 2144 2117 2872 +3939 2882 2041 2572 4253 4942 5110 5529 5161 3528 4567 4036 3891 3051 5036 4549 +2862 3922 3422 3025 5365 5537 3459 2169 4517 4664 4128 4245 4723 2684 3045 3515 +4284 4952 200 3861 5408 2097 3914 2977 1903 4138 4464 4597 3162 5328 4034 4255 +4971 1739 1959 5190 2033 4796 4294 2949 3530 3738 5102 4874 4688 4539 3924 4381 +1797 4497 5235 2898 4752 3423 3859 4353 2890 2161 4831 5334 3597 4177 2691 1982 +5005 1927 2047 2654 5378 256 4792 4897 2571 5116 2792 2976 3110 1866 4580 4075 +5320 3485 2773 5031 2783 4472 3740 4154 4768 1987 4678 5312 4392 3699 4736 4239 +4907 3816 4489 2674 98 5207 1858 234 245 3500 5581 4947 2969 2763 3677 4325 +5407 2153 3161 69 3908 4186 3598 4977 1949 4361 4249 3483 4764 2543 1868 4373 +3723 4452 2111 4114 4552 3918 2897 5230 3814 4513 3377 2683 5528 3675 4347 4655 +4611 5333 4162 4812 3715 97 4106 2168 2799 2841 4572 3641 5372 2088 2791 4030 +3957 5250 1894 4333 2563 4935 3734 5154 2024 3725 2851 79 4691 4116 4377 5015 +4444 5093 90 3894 5536 4902 4503 3855 5202 1852 2143 3100 4173 4716 3934 3378 +3639 4319 2152 1930 3518 3886 2889 2160 4816 4313 1862 4544 4576 2938 5364 2975 +2110 3966 4468 4786 1672 5311 2570 4927 5146 2533 4732 4532 3896 3747 4987 1991 +1800 2958 2798 4133 4592 2643 5171 5327 4100 2078 2690 4708 1975 2871 4357 2040 +1884 4289 5371 3520 3942 3044 4890 3479 4941 5109 2014 1792 5406 3109 3719 4728 +2742 4110 2553 4548 4458 3457 5010 3810 2052 4078 4516 4758 4671 3671 1673 1922 +2142 3034 4158 3702 2752 1802 5224 3503 96 4070 1910 5319 3880 2689 3953 2974 +1967 4970 1737 4141 4329 2032 5363 2948 3694 2562 3455 4882 4297 5101 4687 2790 +2104 3108 89 3495 3890 2968 4080 3421 4982 4435 5126 5527 4176 4663 3704 4127 +3635 1981 5166 4244 5326 1926 1735 3514 4791 4896 4283 3505 266 5196 1845 3099 +4683 3913 1902 1786 2151 5229 4277 4508 2772 4033 4471 2682 3419 3024 1916 2663 +2096 233 2673 1796 4496 255 4951 95 4025 3858 5526 3596 4360 4064 5318 3938 +2653 4596 4763 4252 211 4372 3688 2159 4795 4093 3527 4566 4035 3850 5370 2103 +5201 2051 4269 4074 2522 2861 4512 3921 2967 2569 5121 3698 4722 4161 3594 4238 +5004 4488 2046 1857 3860 3499 4571 2141 5030 4137 3956 4232 4463 3907 4332 5310 +188 3043 3451 1958 4934 4293 2023 2681 3482 2888 265 3737 4767 4873 3873 1986 +5092 4391 4538 4451 5362 3107 2095 4906 4751 3813 4172 2568 4352 3376 4946 3674 +4019 3474 4654 1731 2881 4976 3714 4105 4543 2840 2937 5160 3805 5325 1865 4224 +4029 4467 4785 3666 1893 3844 3484 3042 3415 3023 4926 4153 4677 2789 3374 3746 +1779 5223 4443 3815 2087 3854 2762 4811 3676 1851 1974 4324 4356 68 2561 3638 +3033 2688 3941 1948 4889 4248 2013 5309 5189 58 3098 2542 3885 4727 2552 4312 +2150 3722 4057 5317 78 3106 4113 3917 4376 4757 3630 5165 1671 1921 4901 2632 +4157 4346 2532 3590 199 2102 5195 2045 3468 222 2642 5115 3640 4099 3952 1966 +4140 4328 1883 4575 3799 4881 4296 3478 3660 2782 1837 3733 3097 1985 1669 2850 +1791 2957 2887 2741 2149 4731 2077 3893 5222 4502 3809 2680 2086 3670 4715 3933 +4591 2567 4318 2870 2560 2094 2039 3517 4682 4940 2140 5009 1861 4012 88 4069 +3879 4507 4547 5120 4215 3693 3454 3624 3041 2731 3370 1915 2662 4531 3494 5361 +3837 1799 5194 4810 4434 4132 3634 4707 3446 3937 4288 4251 4969 1734 2031 2947 +3526 1844 4565 5153 2886 3718 2139 4981 77 4686 4109 1785 2956 2860 3920 4457 +4276 3456 5308 4077 2076 4670 3418 4721 1726 176 1771 2880 3701 2751 1980 1925 +2788 5159 4790 4895 3502 4024 4136 4462 1909 3032 3410 1736 244 4063 1957 2511 +4292 2771 3040 1665 3736 4872 3687 4092 4537 5145 1828 5316 3096 3889 3792 3849 +4750 4268 2521 264 3420 4351 3653 4590 4662 4126 4243 46 254 5188 2038 3593 +3440 2966 3513 4282 2085 5108 4762 1864 3912 4371 1901 4231 3031 2559 4032 3450 +4152 4676 3585 4511 5003 87 3872 1720 4049 2787 2879 1795 4495 5114 2761 2679 +4323 3617 3857 5158 4570 67 3595 4018 1947 3473 4247 2093 1730 2781 2652 2030 +3404 232 2965 2946 2541 4933 5100 2022 1818 3095 3721 4112 3804 3916 4223 2138 +4945 4073 3665 3843 3414 4345 4171 3697 4975 1979 3373 1778 221 4237 3829 5187 +4789 4487 2075 1856 3498 2678 4542 3906 2936 253 3365 4466 3732 4784 57 2849 +3481 4925 3579 4004 5002 3892 4450 2044 4056 4501 2672 5307 3629 3812 5113 4714 +2631 3932 3375 4317 3673 1973 3589 4653 4355 3516 3467 1762 5152 2780 4888 3713 +4761 76 2012 4104 1860 4370 2839 4726 263 4900 4028 3433 3798 1892 3030 3659 +4756 1836 4530 1668 1920 4156 3784 4974 1798 4442 4131 2621 5306 3853 4569 1850 +4706 4287 1713 3637 3951 1965 2878 1660 4327 2084 5144 4880 2021 3359 3717 2964 +3884 4108 4311 4011 4456 5091 2558 4076 3397 3022 4669 4214 1670 2869 3623 86 +3700 2730 3369 2750 2531 1752 4939 5107 3836 3501 3609 5151 1908 2641 4541 4681 +4098 187 2935 3445 1882 4506 3029 5186 4783 3477 2083 1790 3888 2740 1914 2661 +3995 2557 3808 4661 4125 3669 4242 3572 4968 1725 1972 85 1770 2955 243 3512 +4281 3936 2074 5099 2011 1654 2963 3911 2610 5143 1900 4725 2551 4068 3878 4564 +4031 3409 2510 2859 2779 3692 4755 3453 1978 1664 1919 2868 4720 2037 1827 4894 +1794 4494 3493 3791 4938 5106 3856 4433 3652 2677 3633 2770 1964 4135 4461 2651 +45 2954 3439 1733 1956 2073 4291 1843 2671 4871 2500 1784 4536 4072 4275 4749 +3352 3584 3696 3417 4350 4236 4967 1719 2029 4048 4486 1855 2945 3497 3775 5098 +4680 3616 4023 1705 3905 210 4505 4062 3403 3480 5150 4151 3686 75 4675 4091 +1817 4449 1913 252 3848 3389 3021 4893 4267 3811 2520 2556 2760 3672 4322 4652 +66 4932 2769 3592 84 1946 3828 3712 4246 4103 2838 5090 2540 4563 4027 1696 +4230 2670 1891 2877 2858 3915 3449 1647 3364 5142 4719 3578 3871 4344 4003 4441 +2489 3020 3852 1849 2934 3564 3636 2867 4460 4017 2036 3472 1729 4924 1955 1761 +2953 5105 3883 3731 4310 2072 2848 4535 3803 4222 3432 2778 3664 175 4748 3842 +4500 1971 3413 4349 2530 4713 3931 4887 3372 83 1777 4316 3783 4931 2020 2620 +2550 2640 4097 3555 5089 1859 1881 4966 1712 2028 1659 220 3476 4150 56 5097 +4674 1789 3358 2739 4529 4055 3807 3396 198 3628 3344 2759 3668 1963 4130 2630 +4321 231 65 4705 3588 4879 1945 4286 4782 1751 2952 3466 4923 3608 251 4067 +3877 3716 4107 2768 3797 4455 3691 34 3452 2876 3658 74 4668 1835 4343 1667 +3492 2669 2749 4886 2010 3994 4432 3335 3019 3632 2549 3571 1907 1732 4754 1842 +1653 1912 2660 2847 2609 1783 4010 4274 3887 4499 1639 4213 3416 5141 4712 3622 +3930 73 4660 2729 4124 3368 4315 4241 4878 3511 3835 4280 4562 4022 209 242 +3910 4061 3444 1899 1686 4930 2875 2019 3685 4090 4528 5088 3847 2499 4266 2519 +1793 4493 1630 4129 3018 3351 2777 1724 4704 1954 1769 3591 4285 2650 4870 3774 +4534 219 2659 4229 2866 1704 2027 4454 3408 2944 3448 2509 4071 4922 5096 4667 +1663 3870 3695 2748 1826 3790 4235 3388 4485 1854 3651 3496 1970 4016 1906 3471 +2478 1728 44 2857 3904 4885 3438 2009 4718 2548 3802 4221 2767 1695 241 4448 +3663 3841 2943 3412 1646 64 2776 3583 4659 4123 1944 3371 4240 1776 2668 1718 +72 4651 4047 2539 4279 2488 3711 4869 4102 3615 3563 3909 1962 2837 1898 4026 +4747 4877 3402 55 1890 4342 1816 4054 197 4492 4440 3627 2629 3851 1848 1620 +3587 2667 3465 2649 3827 2846 4673 3882 3554 4498 4309 3796 2865 2018 2758 3657 +3363 1834 4314 1666 63 2658 5087 3577 71 2529 4002 4234 4484 1853 2538 3343 +2639 4096 3903 1880 1760 4527 3475 2933 4009 1788 4447 2856 2738 3431 4212 4921 +33 3806 2017 3621 22 2942 2728 3367 3667 5086 4650 3782 3834 3710 2619 4101 230 +2836 3334 4453 3443 4066 3876 1711 2864 1953 2008 1889 1658 3690 4711 4868 2747 +2547 3357 2932 4439 3491 4746 3395 1638 1905 2766 4431 1847 1723 1768 3631 1750 +186 3607 3881 1961 1841 4308 3407 2508 1782 4876 1685 4273 2007 4122 2941 1662 +4703 2546 2528 1825 4278 3789 3993 2757 3650 1629 1897 2638 4095 4021 3570 43 +1943 3437 1879 4060 4666 2537 1652 2608 3684 1787 4491 229 4089 2737 3846 2765 +4265 2518 3582 1904 2657 240 1717 4046 2666 3614 4065 3875 2477 4228 3401 3689 +3447 4658 2845 1815 4233 4483 208 3869 3490 2931 2498 4430 4710 3902 3350 1896 +2656 4015 3826 3470 1727 3773 1840 4446 1703 1781 1952 3801 4272 4220 3362 3662 +3840 4867 3411 2006 4526 3576 4001 2648 2545 2855 1775 3387 2835 4020 4702 1619 +1888 4059 1759 3683 54 4088 4438 2930 3430 1694 3845 1951 4053 1846 4264 2517 +4665 1645 3626 4866 2628 2746 3781 3586 2756 2618 2487 3464 4307 62 3562 1710 +1942 4227 1657 3795 2536 239 3356 3656 1833 4649 3868 174 3394 2637 4094 4657 +2834 21 1878 4014 3469 1749 1887 185 196 3606 2736 61 3553 3800 1941 4008 4219 +3661 3839 207 2535 4211 3620 2727 3366 1774 4490 3992 2854 3833 3874 3342 4306 +3569 2647 3442 1651 53 2607 2527 4052 4429 32 3625 228 2844 2627 1722 1877 2655 +1767 4482 1839 3463 4701 1780 3333 4271 2735 3794 3406 2507 3655 1832 1661 4445 +2497 1824 2853 3788 1637 3349 3649 4058 2745 4648 42 3682 3436 4087 3772 218 +2755 1702 4007 4263 2516 60 1684 1940 4210 3619 3581 2726 2534 4437 3386 1716 +4045 3832 4656 1838 1628 4226 3613 195 3441 4270 3400 3867 1895 1693 1814 1644 +4013 2526 1721 1766 2843 2486 3825 2636 2754 4086 3561 4218 59 2646 3838 2476 +3405 4262 227 2506 3361 173 1773 217 3575 1823 4000 3787 3648 4225 41 4481 52 +3435 1758 4051 3866 3552 2645 2626 3429 3580 2842 3462 1715 4044 3780 4428 3341 +2617 3612 4647 3793 1618 4217 1709 3654 2744 1831 3399 1656 206 3355 1813 1772 +1886 31 3393 4436 3824 1748 51 4006 3332 3605 4646 4050 4209 3618 2725 3360 +2625 2833 3574 3999 3831 1885 2515 1636 3991 2525 20 3568 2743 1757 2635 1830 +1650 1876 2606 1683 3428 184 1765 2734 3779 1627 2616 2524 4005 2505 1708 1655 +4208 2634 1822 2724 3354 3786 1875 3647 3830 2496 3392 40 3348 3434 194 1747 +4427 3604 3771 2475 1701 2644 50 1714 4043 1764 2832 3990 3611 3385 216 3567 +3398 2504 4426 1812 1649 2605 1821 3785 1692 3646 1829 1643 3823 39 4261 2514 +2485 1617 3560 2523 3573 3998 2831 183 4042 2495 1874 3610 2723 3347 1756 2733 +2513 3770 1811 3427 1700 3551 3778 4216 2615 3822 3384 19 1707 3340 1763 172 +3353 2633 3997 3391 1691 215 1642 30 1820 1746 2732 3603 1755 2484 2624 3559 +3331 38 3426 3989 3777 2614 49 3566 1635 1706 4041 1648 2604 2623 2512 3550 +3390 1682 1810 1745 4207 3602 205 3339 1626 3821 2494 3988 3346 29 3565 3996 +3769 4206 171 1699 2603 193 3330 2474 1754 3383 2503 1634 48 3776 2613 1690 37 +182 2493 1641 1681 3345 2483 2502 3558 3768 1625 1698 1819 1616 1744 3601 3382 +47 3987 3549 2622 1689 2722 2473 1640 2602 3338 2482 3557 1809 18 28 1753 2492 +3329 2501 3548 2721 1615 204 3767 1697 1633 36 3337 3381 1680 1743 27 2612 1688 +1624 170 3328 17 1808 2481 3556 35 1632 2601 2472 1679 3986 3547 1623 192 203 +3336 3766 181 26 1614 2471 2491 3327 1742 1687 1631 2480 2611 1678 16 1613 180 +1622 191 3546 2490 2470 15 2600 25 3326 169 24 1612 2479 1677 1621 1676 14 168 +2469 2468 1611 23 1610 13 179 12 167 11 } diff --git a/extra/poker/authors.txt b/extra/poker/authors.txt new file mode 100644 index 0000000000..fbbb745b7d --- /dev/null +++ b/extra/poker/authors.txt @@ -0,0 +1 @@ +Aaron Schaefer \ No newline at end of file diff --git a/extra/poker/poker-tests.factor b/extra/poker/poker-tests.factor new file mode 100644 index 0000000000..29bd3ce6b8 --- /dev/null +++ b/extra/poker/poker-tests.factor @@ -0,0 +1,16 @@ +USING: accessors poker poker.private tools.test ; +IN: poker.tests + +[ 134236965 ] [ "KD" >ckf ] unit-test +[ 529159 ] [ "5s" >ckf ] unit-test +[ 33589533 ] [ "jc" >ckf ] unit-test + + +[ 7462 ] [ "7C 5D 4H 3S 2C" value>> ] unit-test +[ 1601 ] [ "KD QS JC TH 9S" value>> ] unit-test +[ 9 ] [ "6C 5C 4C 3C 2C" value>> ] unit-test +[ 1 ] [ "AC KC QC JC TC" value>> ] unit-test + +[ "High Card" ] [ "7C 5D 4H 3S 2C" >value ] unit-test +[ "Straight" ] [ "KD QS JC TH 9S" >value ] unit-test +[ "Straight Flush" ] [ "6C 5C 4C 3C 2C" >value ] unit-test diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor new file mode 100644 index 0000000000..c903bcfcb3 --- /dev/null +++ b/extra/poker/poker.factor @@ -0,0 +1,179 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors ascii binary-search combinators kernel locals math + math.bitwise math.order poker.arrays sequences splitting ; +IN: poker + +! The algorithm used is based on Cactus Kev's Poker Hand Evaluator: +! http://www.suffecool.net/poker/evaluator.html + +ckf) ( rank suit -- n ) + rank rank suit rank card-bitfield ; + +: >ckf ( str -- n ) + #! Cactus Kev Format + >upper 1 cut (>ckf) ; + +: flush? ( cards -- ? ) + HEX: F000 [ bitand ] reduce 0 = not ; + +: rank-bits ( cards -- q ) + 0 [ bitor ] reduce -16 shift ; + +! Needs MEMO: to prevent unique5 lookup twice? +: lookup ( cards table -- value ) + [ rank-bits ] dip nth ; + +: unique5? ( cards -- ? ) + unique5-table lookup 0 > ; + +: prime-bits ( cards -- q ) + [ HEX: FF bitand ] map product ; + +: hand-value ( cards -- value ) + { + { [ dup flush? ] [ flushes-table lookup ] } + { [ dup unique5? ] [ unique5-table lookup ] } + [ + prime-bits products-table sorted-index + values-table nth + ] + } cond ; + +: >card-rank ( card -- str ) + -8 shift HEX: F bitand RANK_STR nth ; + +: >card-suit ( card -- str ) + { + { [ dup 15 bit? ] [ drop "C" ] } + { [ dup 14 bit? ] [ drop "D" ] } + { [ dup 13 bit? ] [ drop "H" ] } + [ drop "S" ] + } cond ; + +PRIVATE> + +TUPLE: hand + { cards sequence } + { value integer } ; + +M: hand <=> [ value>> ] compare ; +M: hand equal? + over hand? [ [ value>> ] bi@ = ] [ 2drop f ] if ; + +: ( str -- hand ) + " " split [ >ckf ] map + dup hand-value hand boa ; + +: hand-rank ( hand -- rank ) + value>> { + { [ dup 6185 > ] [ drop HIGH_CARD ] } ! 1277 high card + { [ dup 3325 > ] [ drop ONE_PAIR ] } ! 2860 one pair + { [ dup 2467 > ] [ drop TWO_PAIR ] } ! 858 two pair + { [ dup 1609 > ] [ drop THREE_OF_A_KIND ] } ! 858 three-kind + { [ dup 1599 > ] [ drop STRAIGHT ] } ! 10 straights + { [ dup 322 > ] [ drop FLUSH ] } ! 1277 flushes + { [ dup 166 > ] [ drop FULL_HOUSE ] } ! 156 full house + { [ dup 10 > ] [ drop FOUR_OF_A_KIND ] } ! 156 four-kind + [ drop STRAIGHT_FLUSH ] ! 10 straight-flushes + } cond ; + +: >value ( hand -- str ) + hand-rank VALUE_STR nth ; + +: >cards ( hand -- str ) + cards>> [ + [ >card-rank ] [ >card-suit ] bi append + ] map " " join ; diff --git a/extra/poker/summary.txt b/extra/poker/summary.txt new file mode 100644 index 0000000000..c8efe851c8 --- /dev/null +++ b/extra/poker/summary.txt @@ -0,0 +1 @@ +5-card poker hand evaluator From 1023fa51f4427c6a89b45fbeb87863939b9da703 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sat, 4 Apr 2009 23:04:53 -0500 Subject: [PATCH 02/65] Fix mailbox-get-all, and make mailbox timeouts throw a wait-timeout error instead of a string --- basis/concurrency/conditions/conditions.factor | 4 +++- .../concurrency/mailboxes/mailboxes-tests.factor | 16 ++++++++++++++-- basis/concurrency/mailboxes/mailboxes.factor | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/basis/concurrency/conditions/conditions.factor b/basis/concurrency/conditions/conditions.factor index 11e624110c..ad00bbdfa9 100644 --- a/basis/concurrency/conditions/conditions.factor +++ b/basis/concurrency/conditions/conditions.factor @@ -20,10 +20,12 @@ IN: concurrency.conditions ] ] dip later ; +ERROR: wait-timeout ; + : wait ( queue timeout status -- ) over [ [ queue-timeout [ drop ] ] dip suspend - [ "Timeout" throw ] [ cancel-alarm ] if + [ wait-timeout ] [ cancel-alarm ] if ] [ [ drop '[ _ push-front ] ] dip suspend drop ] if ; diff --git a/basis/concurrency/mailboxes/mailboxes-tests.factor b/basis/concurrency/mailboxes/mailboxes-tests.factor index 64971eeb77..81e54f1807 100644 --- a/basis/concurrency/mailboxes/mailboxes-tests.factor +++ b/basis/concurrency/mailboxes/mailboxes-tests.factor @@ -1,6 +1,6 @@ IN: concurrency.mailboxes.tests -USING: concurrency.mailboxes concurrency.count-downs vectors -sequences threads tools.test math kernel strings namespaces +USING: concurrency.mailboxes concurrency.count-downs concurrency.conditions +vectors sequences threads tools.test math kernel strings namespaces continuations calendar destructors ; { 1 1 } [ [ integer? ] mailbox-get? ] must-infer-as @@ -75,3 +75,15 @@ continuations calendar destructors ; [ ] [ "d" get 5 seconds await-timeout ] unit-test [ ] [ "m" get dispose ] unit-test + +[ { "foo" "bar" } ] [ + + "foo" over mailbox-put + "bar" over mailbox-put + mailbox-get-all +] unit-test + +[ + 1 seconds mailbox-get-timeout +] [ wait-timeout? ] must-fail-with + \ No newline at end of file diff --git a/basis/concurrency/mailboxes/mailboxes.factor b/basis/concurrency/mailboxes/mailboxes.factor index f6aec94b41..200adb14ae 100755 --- a/basis/concurrency/mailboxes/mailboxes.factor +++ b/basis/concurrency/mailboxes/mailboxes.factor @@ -49,7 +49,7 @@ M: mailbox dispose* threads>> notify-all ; : mailbox-get-all-timeout ( mailbox timeout -- array ) block-if-empty - [ dup mailbox-empty? ] + [ dup mailbox-empty? not ] [ dup data>> pop-back ] produce nip ; From 52c74da3b79b9a79cc022d42bd29ebd96e116221 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 00:07:48 -0400 Subject: [PATCH 03/65] Fix documentation typo for search-index word --- basis/binary-search/binary-search-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/binary-search/binary-search-docs.factor b/basis/binary-search/binary-search-docs.factor index cf7915159a..20b33a0bcb 100644 --- a/basis/binary-search/binary-search-docs.factor +++ b/basis/binary-search/binary-search-docs.factor @@ -14,7 +14,7 @@ $nl HELP: sorted-index { $values { "obj" object } { "seq" "a sorted sequence" } { "i" "an index, or " { $link f } } } -{ $description "Outputs the index and value of the element closest to " { $snippet "elt" } " in the sequence. See " { $link search } " for details." } +{ $description "Outputs the index of the element closest to " { $snippet "elt" } " in the sequence. See " { $link search } " for details." } { $notes "If the sequence has at least one element, this word always outputs a valid index, because it finds the closest match, not necessarily an exact one. In this respect its behavior differs from " { $link index } "." } ; { index index-from last-index last-index-from sorted-index } related-words From 469c3c05ec1703363b6fab3180200f92ed2941ce Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 15:32:36 -0400 Subject: [PATCH 04/65] Speed up map product in poker vocab --- extra/poker/poker.factor | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor index c903bcfcb3..172bb49506 100644 --- a/extra/poker/poker.factor +++ b/extra/poker/poker.factor @@ -112,15 +112,17 @@ CONSTANT: VALUE_STR { "" "Straight Flush" "Four of a Kind" "Full House" "Flush" : rank-bits ( cards -- q ) 0 [ bitor ] reduce -16 shift ; -! Needs MEMO: to prevent unique5 lookup twice? : lookup ( cards table -- value ) [ rank-bits ] dip nth ; : unique5? ( cards -- ? ) unique5-table lookup 0 > ; +: map-product ( seq quot -- n ) + [ 1 ] 2dip [ dip * ] curry [ swap ] prepose each ; inline + : prime-bits ( cards -- q ) - [ HEX: FF bitand ] map product ; + [ HEX: FF bitand ] map-product ; : hand-value ( cards -- value ) { From 8fdc852038bb1aa6631197e2b8dbdf0f53619c56 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 15:37:03 -0400 Subject: [PATCH 05/65] Solution to Project Euler problem 54 --- extra/project-euler/054/054-tests.factor | 4 + extra/project-euler/054/054.factor | 87 ++ extra/project-euler/054/poker.txt | 1000 ++++++++++++++++++++++ extra/project-euler/project-euler.factor | 18 +- 4 files changed, 1100 insertions(+), 9 deletions(-) create mode 100644 extra/project-euler/054/054-tests.factor create mode 100644 extra/project-euler/054/054.factor create mode 100644 extra/project-euler/054/poker.txt diff --git a/extra/project-euler/054/054-tests.factor b/extra/project-euler/054/054-tests.factor new file mode 100644 index 0000000000..31e915c70c --- /dev/null +++ b/extra/project-euler/054/054-tests.factor @@ -0,0 +1,4 @@ +USING: project-euler.054 tools.test ; +IN: project-euler.054.tests + +[ 376 ] [ euler054 ] unit-test diff --git a/extra/project-euler/054/054.factor b/extra/project-euler/054/054.factor new file mode 100644 index 0000000000..2e7eaa4cd3 --- /dev/null +++ b/extra/project-euler/054/054.factor @@ -0,0 +1,87 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +USING: arrays io.encodings.ascii io.files kernel math.order poker + project-euler.common sequences ; +IN: project-euler.054 + +! http://projecteuler.net/index.php?section=problems&id=54 + +! DESCRIPTION +! ----------- + +! In the card game poker, a hand consists of five cards and are ranked, from +! lowest to highest, in the following way: + +! * High Card: Highest value card. +! * One Pair: Two cards of the same value. +! * Two Pairs: Two different pairs. +! * Three of a Kind: Three cards of the same value. +! * Straight: All cards are consecutive values. +! * Flush: All cards of the same suit. +! * Full House: Three of a kind and a pair. +! * Four of a Kind: Four cards of the same value. +! * Straight Flush: All cards are consecutive values of same suit. +! * Royal Flush: Ten, Jack, Queen, King, Ace, in same suit. + +! The cards are valued in the order: +! 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King, Ace. + +! If two players have the same ranked hands then the rank made up of the +! highest value wins; for example, a pair of eights beats a pair of fives (see +! example 1 below). But if two ranks tie, for example, both players have a pair +! of queens, then highest cards in each hand are compared (see example 4 +! below); if the highest cards tie then the next highest cards are compared, +! and so on. + +! Consider the following five hands dealt to two players: + +! Hand Player 1 Player 2 Winner +! --------------------------------------------------------- +! 1 5H 5C 6S 7S KD 2C 3S 8S 8D TD +! Pair of Fives Pair of Eights Player 2 + +! 2 5D 8C 9S JS AC 2C 5C 7D 8S QH +! Highest card Ace Highest card Queen Player 1 + +! 3 2D 9C AS AH AC 3D 6D 7D TD QD +! Three Aces Flush with Diamonds Player 2 + +! 4 4D 6S 9H QH QC 3D 6D 7H QD QS +! Pair of Queens Pair of Queens +! Highest card Nine Highest card Seven Player 1 + +! 5 2H 2D 4C 4D 4S 3C 3D 3S 9S 9D +! Full House Full House +! With Three Fours With Three Threes Player 1 + +! The file, poker.txt, contains one-thousand random hands dealt to two players. +! Each line of the file contains ten cards (separated by a single space): the +! first five are Player 1's cards and the last five are Player 2's cards. You +! can assume that all hands are valid (no invalid characters or repeated +! cards), each player's hand is in no specific order, and in each hand there is +! a clear winner. + +! How many hands does Player 1 win? + + +! SOLUTION +! -------- + + + +: euler054 ( -- answer ) + source-054 [ [ ] map first2 player1-win? ] count ; + +! [ euler054 ] 100 ave-time +! 36 ms ave run time - 2.71 SD (100 trials) + +SOLUTION: euler054 diff --git a/extra/project-euler/054/poker.txt b/extra/project-euler/054/poker.txt new file mode 100644 index 0000000000..231e249533 --- /dev/null +++ b/extra/project-euler/054/poker.txt @@ -0,0 +1,1000 @@ +8C TS KC 9H 4S 7D 2S 5D 3S AC +5C AD 5D AC 9C 7C 5H 8D TD KS +3H 7H 6S KC JS QH TD JC 2D 8S +TH 8H 5C QS TC 9H 4D JC KS JS +7C 5H KC QH JD AS KH 4C AD 4S +5H KS 9C 7D 9H 8D 3S 5D 5C AH +6H 4H 5C 3H 2H 3S QH 5S 6S AS +TD 8C 4H 7C TC KC 4C 3H 7S KS +7C 9C 6D KD 3H 4C QS QC AC KH +JC 6S 5H 2H 2D KD 9D 7C AS JS +AD QH TH 9D 8H TS 6D 3S AS AC +2H 4S 5C 5S TC KC JD 6C TS 3C +QD AS 6H JS 2C 3D 9H KC 4H 8S +KD 8S 9S 7C 2S 3S 6D 6S 4H KC +3C 8C 2D 7D 4D 9S 4S QH 4H JD +8C KC 7S TC 2D TS 8H QD AC 5C +3D KH QD 6C 6S AD AS 8H 2H QS +6S 8D 4C 8S 6C QH TC 6D 7D 9D +2S 8D 8C 4C TS 9S 9D 9C AC 3D +3C QS 2S 4H JH 3D 2D TD 8S 9H +5H QS 8S 6D 3C 8C JD AS 7H 7D +6H TD 9D AS JH 6C QC 9S KD JC +AH 8S QS 4D TH AC TS 3C 3D 5C +5S 4D JS 3D 8H 6C TS 3S AD 8C +6D 7C 5D 5H 3S 5C JC 2H 5S 3D +5H 6H 2S KS 3D 5D JD 7H JS 8H +KH 4H AS JS QS QC TC 6D 7C KS +3D QS TS 2H JS 4D AS 9S JC KD +QD 5H 4D 5D KH 7H 3D JS KD 4H +2C 9H 6H 5C 9D 6C JC 2D TH 9S +7D 6D AS QD JH 4D JS 7C QS 5C +3H KH QD AD 8C 8H 3S TH 9D 5S +AH 9S 4D 9D 8S 4H JS 3C TC 8D +2C KS 5H QD 3S TS 9H AH AD 8S +5C 7H 5D KD 9H 4D 3D 2D KS AD +KS KC 9S 6D 2C QH 9D 9H TS TC +9C 6H 5D QH 4D AD 6D QC JS KH +9S 3H 9D JD 5C 4D 9H AS TC QH +2C 6D JC 9C 3C AD 9S KH 9D 7D +KC 9C 7C JC JS KD 3H AS 3C 7D +QD KH QS 2C 3S 8S 8H 9H 9C JC +QH 8D 3C KC 4C 4H 6D AD 9H 9D +3S KS QS 7H KH 7D 5H 5D JD AD +2H 2C 6H TH TC 7D 8D 4H 8C AS +4S 2H AC QC 3S 6D TH 4D 4C KH +4D TC KS AS 7C 3C 6D 2D 9H 6C +8C TD 5D QS 2C 7H 4C 9C 3H 9H +5H JH TS 7S TD 6H AD QD 8H 8S +5S AD 9C 8C 7C 8D 5H 9D 8S 2S +4H KH KS 9S 2S KC 5S AD 4S 7D +QS 9C QD 6H JS 5D AC 8D 2S AS +KH AC JC 3S 9D 9S 3C 9C 5S JS +AD 3C 3D KS 3S 5C 9C 8C TS 4S +JH 8D 5D 6H KD QS QD 3D 6C KC +8S JD 6C 3S 8C TC QC 3C QH JS +KC JC 8H 2S 9H 9C JH 8S 8C 9S +8S 2H QH 4D QC 9D KC AS TH 3C +8S 6H TH 7C 2H 6S 3C 3H AS 7S +QH 5S JS 4H 5H TS 8H AH AC JC +9D 8H 2S 4S TC JC 3C 7H 3H 5C +3D AD 3C 3S 4C QC AS 5D TH 8C +6S 9D 4C JS KH AH TS JD 8H AD +4C 6S 9D 7S AC 4D 3D 3S TC JD +AD 7H 6H 4H JH KC TD TS 7D 6S +8H JH TC 3S 8D 8C 9S 2C 5C 4D +2C 9D KC QH TH QS JC 9C 4H TS +QS 3C QD 8H KH 4H 8D TD 8S AC +7C 3C TH 5S 8H 8C 9C JD TC KD +QC TC JD TS 8C 3H 6H KD 7C TD +JH QS KS 9C 6D 6S AS 9H KH 6H +2H 4D AH 2D JH 6H TD 5D 4H JD +KD 8C 9S JH QD JS 2C QS 5C 7C +4S TC 7H 8D 2S 6H 7S 9C 7C KC +8C 5D 7H 4S TD QC 8S JS 4H KS +AD 8S JH 6D TD KD 7C 6C 2D 7D +JC 6H 6S JS 4H QH 9H AH 4C 3C +6H 5H AS 7C 7S 3D KH KC 5D 5C +JC 3D TD AS 4D 6D 6S QH JD KS +8C 7S 8S QH 2S JD 5C 7H AH QD +8S 3C 6H 6C 2C 8D TD 7D 4C 4D +5D QH KH 7C 2S 7H JS 6D QC QD +AD 6C 6S 7D TH 6H 2H 8H KH 4H +KS JS KD 5D 2D KH 7D 9C 8C 3D +9C 6D QD 3C KS 3S 7S AH JD 2D +AH QH AS JC 8S 8H 4C KC TH 7D +JC 5H TD 7C 5D KD 4C AD 8H JS +KC 2H AC AH 7D JH KH 5D 7S 6D +9S 5S 9C 6H 8S TD JD 9H 6C AC +7D 8S 6D TS KD 7H AC 5S 7C 5D +AH QC JC 4C TC 8C 2H TS 2C 7D +KD KC 6S 3D 7D 2S 8S 3H 5S 5C +8S 5D 8H 4C 6H KC 3H 7C 5S KD +JH 8C 3D 3C 6C KC TD 7H 7C 4C +JC KC 6H TS QS TD KS 8H 8C 9S +6C 5S 9C QH 7D AH KS KC 9S 2C +4D 4S 8H TD 9C 3S 7D 9D AS TH +6S 7D 3C 6H 5D KD 2C 5C 9D 9C +2H KC 3D AD 3H QD QS 8D JC 4S +8C 3H 9C 7C AD 5D JC 9D JS AS +5D 9H 5C 7H 6S 6C QC JC QD 9S +JC QS JH 2C 6S 9C QC 3D 4S TC +4H 5S 8D 3D 4D 2S KC 2H JS 2C +TD 3S TH KD 4D 7H JH JS KS AC +7S 8C 9S 2D 8S 7D 5C AD 9D AS +8C 7H 2S 6C TH 3H 4C 3S 8H AC +KD 5H JC 8H JD 2D 4H TD JH 5C +3D AS QH KS 7H JD 8S 5S 6D 5H +9S 6S TC QS JC 5C 5D 9C TH 8C +5H 3S JH 9H 2S 2C 6S 7S AS KS +8C QD JC QS TC QC 4H AC KH 6C +TC 5H 7D JH 4H 2H 8D JC KS 4D +5S 9C KH KD 9H 5C TS 3D 7D 2D +5H AS TC 4D 8C 2C TS 9D 3H 8D +6H 8D 2D 9H JD 6C 4S 5H 5S 6D +AD 9C JC 7D 6H 9S 6D JS 9H 3C +AD JH TC QS 4C 5D 9S 7C 9C AH +KD 6H 2H TH 8S QD KS 9D 9H AS +4H 8H 8D 5H 6C AH 5S AS AD 8S +QS 5D 4S 2H TD KS 5H AC 3H JC +9C 7D QD KD AC 6D 5H QH 6H 5S +KC AH QH 2H 7D QS 3H KS 7S JD +6C 8S 3H 6D KS QD 5D 5C 8H TC +9H 4D 4S 6S 9D KH QC 4H 6C JD +TD 2D QH 4S 6H JH KD 3C QD 8C +4S 6H 7C QD 9D AS AH 6S AD 3C +2C KC TH 6H 8D AH 5C 6D 8S 5D +TD TS 7C AD JC QD 9H 3C KC 7H +5D 4D 5S 8H 4H 7D 3H JD KD 2D +JH TD 6H QS 4S KD 5C 8S 7D 8H +AC 3D AS 8C TD 7H KH 5D 6C JD +9D KS 7C 6D QH TC JD KD AS KC +JH 8S 5S 7S 7D AS 2D 3D AD 2H +2H 5D AS 3C QD KC 6H 9H 9S 2C +9D 5D TH 4C JH 3H 8D TC 8H 9H +6H KD 2C TD 2H 6C 9D 2D JS 8C +KD 7S 3C 7C AS QH TS AD 8C 2S +QS 8H 6C JS 4C 9S QC AD TD TS +2H 7C TS TC 8C 3C 9H 2D 6D JC +TC 2H 8D JH KS 6D 3H TD TH 8H +9D TD 9H QC 5D 6C 8H 8C KC TS +2H 8C 3D AH 4D TH TC 7D 8H KC +TS 5C 2D 8C 6S KH AH 5H 6H KC +5S 5D AH TC 4C JD 8D 6H 8C 6C +KC QD 3D 8H 2D JC 9H 4H AD 2S +TD 6S 7D JS KD 4H QS 2S 3S 8C +4C 9H JH TS 3S 4H QC 5S 9S 9C +2C KD 9H JS 9S 3H JC TS 5D AC +AS 2H 5D AD 5H JC 7S TD JS 4C +2D 4S 8H 3D 7D 2C AD KD 9C TS +7H QD JH 5H JS AC 3D TH 4C 8H +6D KH KC QD 5C AD 7C 2D 4H AC +3D 9D TC 8S QD 2C JC 4H JD AH +6C TD 5S TC 8S AH 2C 5D AS AC +TH 7S 3D AS 6C 4C 7H 7D 4H AH +5C 2H KS 6H 7S 4H 5H 3D 3C 7H +3C 9S AC 7S QH 2H 3D 6S 3S 3H +2D 3H AS 2C 6H TC JS 6S 9C 6C +QH KD QD 6D AC 6H KH 2C TS 8C +8H 7D 3S 9H 5D 3H 4S QC 9S 5H +2D 9D 7H 6H 3C 8S 5H 4D 3S 4S +KD 9S 4S TC 7S QC 3S 8S 2H 7H +TC 3D 8C 3H 6C 2H 6H KS KD 4D +KC 3D 9S 3H JS 4S 8H 2D 6C 8S +6H QS 6C TC QD 9H 7D 7C 5H 4D +TD 9D 8D 6S 6C TC 5D TS JS 8H +4H KC JD 9H TC 2C 6S 5H 8H AS +JS 9C 5C 6S 9D JD 8H KC 4C 6D +4D 8D 8S 6C 7C 6H 7H 8H 5C KC +TC 3D JC 6D KS 9S 6H 7S 9C 2C +6C 3S KD 5H TS 7D 9H 9S 6H KH +3D QD 4C 6H TS AC 3S 5C 2H KD +4C AS JS 9S 7C TS 7H 9H JC KS +4H 8C JD 3H 6H AD 9S 4S 5S KS +4C 2C 7D 3D AS 9C 2S QS KC 6C +8S 5H 3D 2S AC 9D 6S 3S 4D TD +QD TH 7S TS 3D AC 7H 6C 5D QC +TC QD AD 9C QS 5C 8D KD 3D 3C +9D 8H AS 3S 7C 8S JD 2D 8D KC +4C TH AC QH JS 8D 7D 7S 9C KH +9D 8D 4C JH 2C 2S QD KD TS 4H +4D 6D 5D 2D JH 3S 8S 3H TC KH +AD 4D 2C QS 8C KD JH JD AH 5C +5C 6C 5H 2H JH 4H KS 7C TC 3H +3C 4C QC 5D JH 9C QD KH 8D TC +3H 9C JS 7H QH AS 7C 9H 5H JC +2D 5S QD 4S 3C KC 6S 6C 5C 4C +5D KH 2D TS 8S 9C AS 9S 7C 4C +7C AH 8C 8D 5S KD QH QS JH 2C +8C 9D AH 2H AC QC 5S 8H 7H 2C +QD 9H 5S QS QC 9C 5H JC TH 4H +6C 6S 3H 5H 3S 6H KS 8D AC 7S +AC QH 7H 8C 4S KC 6C 3D 3S TC +9D 3D JS TH AC 5H 3H 8S 3S TC +QD KH JS KS 9S QC 8D AH 3C AC +5H 6C KH 3S 9S JH 2D QD AS 8C +6C 4D 7S 7H 5S JC 6S 9H 4H JH +AH 5S 6H 9S AD 3S TH 2H 9D 8C +4C 8D 9H 7C QC AD 4S 9C KC 5S +9D 6H 4D TC 4C JH 2S 5D 3S AS +2H 6C 7C KH 5C AD QS TH JD 8S +3S 4S 7S AH AS KC JS 2S AD TH +JS KC 2S 7D 8C 5C 9C TS 5H 9D +7S 9S 4D TD JH JS KH 6H 5D 2C +JD JS JC TH 2D 3D QD 8C AC 5H +7S KH 5S 9D 5D TD 4S 6H 3C 2D +4S 5D AC 8D 4D 7C AD AS AH 9C +6S TH TS KS 2C QC AH AS 3C 4S +2H 8C 3S JC 5C 7C 3H 3C KH JH +7S 3H JC 5S 6H 4C 2S 4D KC 7H +4D 7C 4H 9S 8S 6S AD TC 6C JC +KH QS 3S TC 4C 8H 8S AC 3C TS +QD QS TH 3C TS 7H 7D AH TD JC +TD JD QC 4D 9S 7S TS AD 7D AC +AH 7H 4S 6D 7C 2H 9D KS JC TD +7C AH JD 4H 6D QS TS 2H 2C 5C +TC KC 8C 9S 4C JS 3C JC 6S AH +AS 7D QC 3D 5S JC JD 9D TD KH +TH 3C 2S 6H AH AC 5H 5C 7S 8H +QC 2D AC QD 2S 3S JD QS 6S 8H +KC 4H 3C 9D JS 6H 3S 8S AS 8C +7H KC 7D JD 2H JC QH 5S 3H QS +9H TD 3S 8H 7S AC 5C 6C AH 7C +8D 9H AH JD TD QS 7D 3S 9C 8S +AH QH 3C JD KC 4S 5S 5D TD KS +9H 7H 6S JH TH 4C 7C AD 5C 2D +7C KD 5S TC 9D 6S 6C 5D 2S TH +KC 9H 8D 5H 7H 4H QC 3D 7C AS +6S 8S QC TD 4S 5C TH QS QD 2S +8S 5H TH QC 9H 6S KC 7D 7C 5C +7H KD AH 4D KH 5C 4S 2D KC QH +6S 2C TD JC AS 4D 6C 8C 4H 5S +JC TC JD 5S 6S 8D AS 9D AD 3S +6D 6H 5D 5S TC 3D 7D QS 9D QD +4S 6C 8S 3S 7S AD KS 2D 7D 7C +KC QH JC AC QD 5D 8D QS 7H 7D +JS AH 8S 5H 3D TD 3H 4S 6C JH +4S QS 7D AS 9H JS KS 6D TC 5C +2D 5C 6H TC 4D QH 3D 9H 8S 6C +6D 7H TC TH 5S JD 5C 9C KS KD +8D TD QH 6S 4S 6C 8S KC 5C TC +5S 3D KS AC 4S 7D QD 4C TH 2S +TS 8H 9S 6S 7S QH 3C AH 7H 8C +4C 8C TS JS QC 3D 7D 5D 7S JH +8S 7S 9D QC AC 7C 6D 2H JH KC +JS KD 3C 6S 4S 7C AH QC KS 5H +KS 6S 4H JD QS TC 8H KC 6H AS +KH 7C TC 6S TD JC 5C 7D AH 3S +3H 4C 4H TC TH 6S 7H 6D 9C QH +7D 5H 4S 8C JS 4D 3D 8S QH KC +3H 6S AD 7H 3S QC 8S 4S 7S JS +3S JD KH TH 6H QS 9C 6C 2D QD +4S QH 4D 5H KC 7D 6D 8D TH 5S +TD AD 6S 7H KD KH 9H 5S KC JC +3H QC AS TS 4S QD KS 9C 7S KC +TS 6S QC 6C TH TC 9D 5C 5D KD +JS 3S 4H KD 4C QD 6D 9S JC 9D +8S JS 6D 4H JH 6H 6S 6C KS KH +AC 7D 5D TC 9S KH 6S QD 6H AS +AS 7H 6D QH 8D TH 2S KH 5C 5H +4C 7C 3D QC TC 4S KH 8C 2D JS +6H 5D 7S 5H 9C 9H JH 8S TH 7H +AS JS 2S QD KH 8H 4S AC 8D 8S +3H 4C TD KD 8C JC 5C QS 2D JD +TS 7D 5D 6C 2C QS 2H 3C AH KS +4S 7C 9C 7D JH 6C 5C 8H 9D QD +2S TD 7S 6D 9C 9S QS KH QH 5C +JC 6S 9C QH JH 8D 7S JS KH 2H +8D 5H TH KC 4D 4S 3S 6S 3D QS +2D JD 4C TD 7C 6D TH 7S JC AH +QS 7S 4C TH 9D TS AD 4D 3H 6H +2D 3H 7D JD 3D AS 2S 9C QC 8S +4H 9H 9C 2C 7S JH KD 5C 5D 6H +TC 9H 8H JC 3C 9S 8D KS AD KC +TS 5H JD QS QH QC 8D 5D KH AH +5D AS 8S 6S 4C AH QC QD TH 7H +3H 4H 7D 6S 4S 9H AS 8H JS 9D +JD 8C 2C 9D 7D 5H 5S 9S JC KD +KD 9C 4S QD AH 7C AD 9D AC TD +6S 4H 4S 9C 8D KS TC 9D JH 7C +5S JC 5H 4S QH AC 2C JS 2S 9S +8C 5H AS QD AD 5C 7D 8S QC TD +JC 4C 8D 5C KH QS 4D 6H 2H 2C +TH 4S 2D KC 3H QD AC 7H AD 9D +KH QD AS 8H TH KC 8D 7S QH 8C +JC 6C 7D 8C KH AD QS 2H 6S 2D +JC KH 2D 7D JS QC 5H 4C 5D AD +TS 3S AD 4S TD 2D TH 6S 9H JH +9H 2D QS 2C 4S 3D KH AS AC 9D +KH 6S 8H 4S KD 7D 9D TS QD QC +JH 5H AH KS AS AD JC QC 5S KH +5D 7D 6D KS KD 3D 7C 4D JD 3S +AC JS 8D 5H 9C 3H 4H 4D TS 2C +6H KS KH 9D 7C 2S 6S 8S 2H 3D +6H AC JS 7S 3S TD 8H 3H 4H TH +9H TC QC KC 5C KS 6H 4H AC 8S +TC 7D QH 4S JC TS 6D 6C AC KH +QH 7D 7C JH QS QD TH 3H 5D KS +3D 5S 8D JS 4C 2C KS 7H 9C 4H +5H 8S 4H TD 2C 3S QD QC 3H KC +QC JS KD 9C AD 5S 9D 7D 7H TS +8C JC KH 7C 7S 6C TS 2C QD TH +5S 9D TH 3C 7S QH 8S 9C 2H 5H +5D 9H 6H 2S JS KH 3H 7C 2H 5S +JD 5D 5S 2C TC 2S 6S 6C 3C 8S +4D KH 8H 4H 2D KS 3H 5C 2S 9H +3S 2D TD 7H 8S 6H JD KC 9C 8D +6S QD JH 7C 9H 5H 8S 8H TH TD +QS 7S TD 7D TS JC KD 7C 3C 2C +3C JD 8S 4H 2D 2S TD AS 4D AC +AH KS 6C 4C 4S 7D 8C 9H 6H AS +5S 3C 9S 2C QS KD 4D 4S AC 5D +2D TS 2C JS KH QH 5D 8C AS KC +KD 3H 6C TH 8S 7S KH 6H 9S AC +6H 7S 6C QS AH 2S 2H 4H 5D 5H +5H JC QD 2C 2S JD AS QC 6S 7D +6C TC AS KD 8H 9D 2C 7D JH 9S +2H 4C 6C AH 8S TD 3H TH 7C TS +KD 4S TS 6C QH 8D 9D 9C AH 7D +6D JS 5C QD QC 9C 5D 8C 2H KD +3C QH JH AD 6S AH KC 8S 6D 6H +3D 7C 4C 7S 5S 3S 6S 5H JC 3C +QH 7C 5H 3C 3S 8C TS 4C KD 9C +QD 3S 7S 5H 7H QH JC 7C 8C KD +3C KD KH 2S 4C TS AC 6S 2C 7C +2C KH 3C 4C 6H 4D 5H 5S 7S QD +4D 7C 8S QD TS 9D KS 6H KD 3C +QS 4D TS 7S 4C 3H QD 8D 9S TC +TS QH AC 6S 3C 9H 9D QS 8S 6H +3S 7S 5D 4S JS 2D 6C QH 6S TH +4C 4H AS JS 5D 3D TS 9C AC 8S +6S 9C 7C 3S 5C QS AD AS 6H 3C +9S 8C 7H 3H 6S 7C AS 9H JD KH +3D 3H 7S 4D 6C 7C AC 2H 9C TH +4H 5S 3H AC TC TH 9C 9H 9S 8D +8D 9H 5H 4D 6C 2H QD 6S 5D 3S +4C 5C JD QS 4D 3H TH AC QH 8C +QC 5S 3C 7H AD 4C KS 4H JD 6D +QS AH 3H KS 9H 2S JS JH 5H 2H +2H 5S TH 6S TS 3S KS 3C 5H JS +2D 9S 7H 3D KC JH 6D 7D JS TD +AC JS 8H 2C 8C JH JC 2D TH 7S +5D 9S 8H 2H 3D TC AH JC KD 9C +9D QD JC 2H 6D KH TS 9S QH TH +2C 8D 4S JD 5H 3H TH TC 9C KC +AS 3D 9H 7D 4D TH KH 2H 7S 3H +4H 7S KS 2S JS TS 8S 2H QD 8D +5S 6H JH KS 8H 2S QC AC 6S 3S +JC AS AD QS 8H 6C KH 4C 4D QD +2S 3D TS TD 9S KS 6S QS 5C 8D +3C 6D 4S QC KC JH QD TH KH AD +9H AH 4D KS 2S 8D JH JC 7C QS +2D 6C TH 3C 8H QD QH 2S 3S KS +6H 5D 9S 4C TS TD JS QD 9D JD +5H 8H KH 8S KS 7C TD AD 4S KD +2C 7C JC 5S AS 6C 7D 8S 5H 9C +6S QD 9S TS KH QS 5S QH 3C KC +7D 3H 3C KD 5C AS JH 7H 6H JD +9D 5C 9H KC 8H KS 4S AD 4D 2S +3S JD QD 8D 2S 7C 5S 6S 5H TS +6D 9S KC TD 3S 6H QD JD 5C 8D +5H 9D TS KD 8D 6H TD QC 4C 7D +6D 4S JD 9D AH 9S AS TD 9H QD +2D 5S 2H 9C 6H 9S TD QC 7D TC +3S 2H KS TS 2C 9C 8S JS 9D 7D +3C KC 6D 5D 6C 6H 8S AS 7S QS +JH 9S 2H 8D 4C 8H 9H AD TH KH +QC AS 2S JS 5C 6H KD 3H 7H 2C +QD 8H 2S 8D 3S 6D AH 2C TC 5C +JD JS TS 8S 3H 5D TD KC JC 6H +6S QS TC 3H 5D AH JC 7C 7D 4H +7C 5D 8H 9C 2H 9H JH KH 5S 2C +9C 7H 6S TH 3S QC QD 4C AC JD +2H 5D 9S 7D KC 3S QS 2D AS KH +2S 4S 2H 7D 5C TD TH QH 9S 4D +6D 3S TS 6H 4H KS 9D 8H 5S 2D +9H KS 4H 3S 5C 5D KH 6H 6S JS +KC AS 8C 4C JC KH QC TH QD AH +6S KH 9S 2C 5H TC 3C 7H JC 4D +JD 4S 6S 5S 8D 7H 7S 4D 4C 2H +7H 9H 5D KH 9C 7C TS TC 7S 5H +4C 8D QC TS 4S 9H 3D AD JS 7C +8C QS 5C 5D 3H JS AH KC 4S 9D +TS JD 8S QS TH JH KH 2D QD JS +JD QC 5D 6S 9H 3S 2C 8H 9S TS +2S 4C AD 7H JC 5C 2D 6D 4H 3D +7S JS 2C 4H 8C AD QD 9C 3S TD +JD TS 4C 6H 9H 7D QD 6D 3C AS +AS 7C 4C 6S 5D 5S 5C JS QC 4S +KD 6S 9S 7C 3C 5S 7D JH QD JS +4S 7S JH 2C 8S 5D 7H 3D QH AD +TD 6H 2H 8D 4H 2D 7C AD KH 5D +TS 3S 5H 2C QD AH 2S 5C KH TD +KC 4D 8C 5D AS 6C 2H 2S 9H 7C +KD JS QC TS QS KH JH 2C 5D AD +3S 5H KC 6C 9H 3H 2H AD 7D 7S +7S JS JH KD 8S 7D 2S 9H 7C 2H +9H 2D 8D QC 6S AD AS 8H 5H 6C +2S 7H 6C 6D 7D 8C 5D 9D JC 3C +7C 9C 7H JD 2H KD 3S KH AD 4S +QH AS 9H 4D JD KS KD TS KH 5H +4C 8H 5S 3S 3D 7D TD AD 7S KC +JS 8S 5S JC 8H TH 9C 4D 5D KC +7C 5S 9C QD 2C QH JS 5H 8D KH +TD 2S KS 3D AD KC 7S TC 3C 5D +4C 2S AD QS 6C 9S QD TH QH 5C +8C AD QS 2D 2S KC JD KS 6C JC +8D 4D JS 2H 5D QD 7S 7D QH TS +6S 7H 3S 8C 8S 9D QS 8H 6C 9S +4S TC 2S 5C QD 4D QS 6D TH 6S +3S 5C 9D 6H 8D 4C 7D TC 7C TD +AH 6S AS 7H 5S KD 3H 5H AC 4C +8D 8S AH KS QS 2C AD 6H 7D 5D +6H 9H 9S 2H QS 8S 9C 5D 2D KD +TS QC 5S JH 7D 7S TH 9S 9H AC +7H 3H 6S KC 4D 6D 5C 4S QD TS +TD 2S 7C QD 3H JH 9D 4H 7S 7H +KS 3D 4H 5H TC 2S AS 2D 6D 7D +8H 3C 7H TD 3H AD KC TH 9C KH +TC 4C 2C 9S 9D 9C 5C 2H JD 3C +3H AC TS 5D AD 8D 6H QC 6S 8C +2S TS 3S JD 7H 8S QH 4C 5S 8D +AC 4S 6C 3C KH 3D 7C 2D 8S 2H +4H 6C 8S TH 2H 4S 8H 9S 3H 7S +7C 4C 9C 2C 5C AS 5D KD 4D QH +9H 4H TS AS 7D 8D 5D 9S 8C 2H +QC KD AC AD 2H 7S AS 3S 2D 9S +2H QC 8H TC 6D QD QS 5D KH 3C +TH JD QS 4C 2S 5S AD 7H 3S AS +7H JS 3D 6C 3S 6D AS 9S AC QS +9C TS AS 8C TC 8S 6H 9D 8D 6C +4D JD 9C KC 7C 6D KS 3S 8C AS +3H 6S TC 8D TS 3S KC 9S 7C AS +8C QC 4H 4S 8S 6C 3S TC AH AC +4D 7D 5C AS 2H 6S TS QC AD TC +QD QC 8S 4S TH 3D AH TS JH 4H +5C 2D 9S 2C 3H 3C 9D QD QH 7D +KC 9H 6C KD 7S 3C 4D AS TC 2D +3D JS 4D 9D KS 7D TH QC 3H 3C +8D 5S 2H 9D 3H 8C 4C 4H 3C TH +JC TH 4S 6S JD 2D 4D 6C 3D 4C +TS 3S 2D 4H AC 2C 6S 2H JH 6H +TD 8S AD TC AH AC JH 9S 6S 7S +6C KC 4S JD 8D 9H 5S 7H QH AH +KD 8D TS JH 5C 5H 3H AD AS JS +2D 4H 3D 6C 8C 7S AD 5D 5C 8S +TD 5D 7S 9C 4S 5H 6C 8C 4C 8S +JS QH 9C AS 5C QS JC 3D QC 7C +JC 9C KH JH QS QC 2C TS 3D AD +5D JH AC 5C 9S TS 4C JD 8C KS +KC AS 2D KH 9H 2C 5S 4D 3D 6H +TH AH 2D 8S JC 3D 8C QH 7S 3S +8H QD 4H JC AS KH KS 3C 9S 6D +9S QH 7D 9C 4S AC 7H KH 4D KD +AH AD TH 6D 9C 9S KD KS QH 4H +QD 6H 9C 7C QS 6D 6S 9D 5S JH +AH 8D 5H QD 2H JC KS 4H KH 5S +5C 2S JS 8D 9C 8C 3D AS KC AH +JD 9S 2H QS 8H 5S 8C TH 5C 4C +QC QS 8C 2S 2C 3S 9C 4C KS KH +2D 5D 8S AH AD TD 2C JS KS 8C +TC 5S 5H 8H QC 9H 6H JD 4H 9S +3C JH 4H 9H AH 4S 2H 4C 8D AC +8S TH 4D 7D 6D QD QS 7S TC 7C +KH 6D 2D JD 5H JS QD JH 4H 4S +9C 7S JH 4S 3S TS QC 8C TC 4H +QH 9D 4D JH QS 3S 2C 7C 6C 2D +4H 9S JD 5C 5H AH 9D TS 2D 4C +KS JH TS 5D 2D AH JS 7H AS 8D +JS AH 8C AD KS 5S 8H 2C 6C TH +2H 5D AD AC KS 3D 8H TS 6H QC +6D 4H TS 9C 5H JS JH 6S JD 4C +JH QH 4H 2C 6D 3C 5D 4C QS KC +6H 4H 6C 7H 6S 2S 8S KH QC 8C +3H 3D 5D KS 4H TD AD 3S 4D TS +5S 7C 8S 7D 2C KS 7S 6C 8C JS +5D 2H 3S 7C 5C QD 5H 6D 9C 9H +JS 2S KD 9S 8D TD TS AC 8C 9D +5H QD 2S AC 8C 9H KS 7C 4S 3C +KH AS 3H 8S 9C JS QS 4S AD 4D +AS 2S TD AD 4D 9H JC 4C 5H QS +5D 7C 4H TC 2D 6C JS 4S KC 3S +4C 2C 5D AC 9H 3D JD 8S QS QH +2C 8S 6H 3C QH 6D TC KD AC AH +QC 6C 3S QS 4S AC 8D 5C AD KH +5S 4C AC KH AS QC 2C 5C 8D 9C +8H JD 3C KH 8D 5C 9C QD QH 9D +7H TS 2C 8C 4S TD JC 9C 5H QH +JS 4S 2C 7C TH 6C AS KS 7S JD +JH 7C 9H 7H TC 5H 3D 6D 5D 4D +2C QD JH 2H 9D 5S 3D TD AD KS +JD QH 3S 4D TH 7D 6S QS KS 4H +TC KS 5S 8D 8H AD 2S 2D 4C JH +5S JH TC 3S 2D QS 9D 4C KD 9S +AC KH 3H AS 9D KC 9H QD 6C 6S +9H 7S 3D 5C 7D KC TD 8H 4H 6S +3C 7H 8H TC QD 4D 7S 6S QH 6C +6D AD 4C QD 6C 5D 7D 9D KS TS +JH 2H JD 9S 7S TS KH 8D 5D 8H +2D 9S 4C 7D 9D 5H QD 6D AC 6S +7S 6D JC QD JH 4C 6S QS 2H 7D +8C TD JH KD 2H 5C QS 2C JS 7S +TC 5H 4H JH QD 3S 5S 5D 8S KH +KS KH 7C 2C 5D JH 6S 9C 6D JC +5H AH JD 9C JS KC 2H 6H 4D 5S +AS 3C TH QC 6H 9C 8S 8C TD 7C +KC 2C QD 9C KH 4D 7S 3C TS 9H +9C QC 2S TS 8C TD 9S QD 3S 3C +4D 9D TH JH AH 6S 2S JD QH JS +QD 9H 6C KD 7D 7H 5D 6S 8H AH +8H 3C 4S 2H 5H QS QH 7S 4H AC +QS 3C 7S 9S 4H 3S AH KS 9D 7C +AD 5S 6S 2H 2D 5H TC 4S 3C 8C +QH TS 6S 4D JS KS JH AS 8S 6D +2C 8S 2S TD 5H AS TC TS 6C KC +KC TS 8H 2H 3H 7C 4C 5S TH TD +KD AD KH 7H 7S 5D 5H 5S 2D 9C +AD 9S 3D 7S 8C QC 7C 9C KD KS +3C QC 9S 8C 4D 5C AS QD 6C 2C +2H KC 8S JD 7S AC 8D 5C 2S 4D +9D QH 3D 2S TC 3S KS 3C 9H TD +KD 6S AC 2C 7H 5H 3S 6C 6H 8C +QH TC 8S 6S KH TH 4H 5D TS 4D +8C JS 4H 6H 2C 2H 7D AC QD 3D +QS KC 6S 2D 5S 4H TD 3H JH 4C +7S 5H 7H 8H KH 6H QS TH KD 7D +5H AD KD 7C KH 5S TD 6D 3C 6C +8C 9C 5H JD 7C KC KH 7H 2H 3S +7S 4H AD 4D 8S QS TH 3D 7H 5S +8D TC KS KD 9S 6D AD JD 5C 2S +7H 8H 6C QD 2H 6H 9D TC 9S 7C +8D 6D 4C 7C 6C 3C TH KH JS JH +5S 3S 8S JS 9H AS AD 8H 7S KD +JH 7C 2C KC 5H AS AD 9C 9S JS +AD AC 2C 6S QD 7C 3H TH KS KD +9D JD 4H 8H 4C KH 7S TS 8C KC +3S 5S 2H 7S 6H 7D KS 5C 6D AD +5S 8C 9H QS 7H 7S 2H 6C 7D TD +QS 5S TD AC 9D KC 3D TC 2D 4D +TD 2H 7D JD QD 4C 7H 5D KC 3D +4C 3H 8S KD QH 5S QC 9H TC 5H +9C QD TH 5H TS 5C 9H AH QH 2C +4D 6S 3C AC 6C 3D 2C 2H TD TH +AC 9C 5D QC 4D AD 8D 6D 8C KC +AD 3C 4H AC 8D 8H 7S 9S TD JC +4H 9H QH JS 2D TH TD TC KD KS +5S 6S 9S 8D TH AS KH 5H 5C 8S +JD 2S 9S 6S 5S 8S 5D 7S 7H 9D +5D 8C 4C 9D AD TS 2C 7D KD TC +8S QS 4D KC 5C 8D 4S KH JD KD +AS 5C AD QH 7D 2H 9S 7H 7C TC +2S 8S JD KH 7S 6C 6D AD 5D QC +9H 6H 3S 8C 8H AH TC 4H JS TD +2C TS 4D 7H 2D QC 9C 5D TH 7C +6C 8H QC 5D TS JH 5C 5H 9H 4S +2D QC 7H AS JS 8S 2H 4C 4H 8D +JS 6S AC KD 3D 3C 4S 7H TH KC +QH KH 6S QS 5S 4H 3C QD 3S 3H +7H AS KH 8C 4H 9C 5S 3D 6S TS +9C 7C 3H 5S QD 2C 3D AD AC 5H +JH TD 2D 4C TS 3H KH AD 3S 7S +AS 4C 5H 4D 6S KD JC 3C 6H 2D +3H 6S 8C 2D TH 4S AH QH AD 5H +7C 2S 9H 7H KC 5C 6D 5S 3H JC +3C TC 9C 4H QD TD JH 6D 9H 5S +7C 6S 5C 5D 6C 4S 7H 9H 6H AH +AD 2H 7D KC 2C 4C 2S 9S 7H 3S +TH 4C 8S 6S 3S AD KS AS JH TD +5C TD 4S 4D AD 6S 5D TC 9C 7D +8H 3S 4D 4S 5S 6H 5C AC 3H 3D +9H 3C AC 4S QS 8S 9D QH 5H 4D +JC 6C 5H TS AC 9C JD 8C 7C QD +8S 8H 9C JD 2D QC QH 6H 3C 8D +KS JS 2H 6H 5H QH QS 3H 7C 6D +TC 3H 4S 7H QC 2H 3S 8C JS KH +AH 8H 5S 4C 9H JD 3H 7S JC AC +3C 2D 4C 5S 6C 4S QS 3S JD 3D +5H 2D TC AH KS 6D 7H AD 8C 6H +6C 7S 3C JD 7C 8H KS KH AH 6D +AH 7D 3H 8H 8S 7H QS 5H 9D 2D +JD AC 4H 7S 8S 9S KS AS 9D QH +7S 2C 8S 5S JH QS JC AH KD 4C +AH 2S 9H 4H 8D TS TD 6H QH JD +4H JC 3H QS 6D 7S 9C 8S 9D 8D +5H TD 4S 9S 4C 8C 8D 7H 3H 3D +QS KH 3S 2C 2S 3C 7S TD 4S QD +7C TD 4D 5S KH AC AS 7H 4C 6C +2S 5H 6D JD 9H QS 8S 2C 2H TD +2S TS 6H 9H 7S 4H JC 4C 5D 5S +2C 5H 7D 4H 3S QH JC JS 6D 8H +4C QH 7C QD 3S AD TH 8S 5S TS +9H TC 2S TD JC 7D 3S 3D TH QH +7D 4C 8S 5C JH 8H 6S 3S KC 3H +JC 3H KH TC QH TH 6H 2C AC 5H +QS 2H 9D 2C AS 6S 6C 2S 8C 8S +9H 7D QC TH 4H KD QS AC 7S 3C +4D JH 6S 5S 8H KS 9S QC 3S AS +JD 2D 6S 7S TC 9H KC 3H 7D KD +2H KH 7C 4D 4S 3H JS QD 7D KC +4C JC AS 9D 3C JS 6C 8H QD 4D +AH JS 3S 6C 4C 3D JH 6D 9C 9H +9H 2D 8C 7H 5S KS 6H 9C 2S TC +6C 8C AD 7H 6H 3D KH AS 5D TH +KS 8C 3S TS 8S 4D 5S 9S 6C 4H +9H 4S 4H 5C 7D KC 2D 2H 9D JH +5C JS TC 9D 9H 5H 7S KH JC 6S +7C 9H 8H 4D JC KH JD 2H TD TC +8H 6C 2H 2C KH 6H 9D QS QH 5H +AC 7D 2S 3D QD JC 2D 8D JD JH +2H JC 2D 7H 2C 3C 8D KD TD 4H +3S 4H 6D 8D TS 3H TD 3D 6H TH +JH JC 3S AC QH 9H 7H 8S QC 2C +7H TD QS 4S 8S 9C 2S 5D 4D 2H +3D TS 3H 2S QC 8H 6H KC JC KS +5D JD 7D TC 8C 6C 9S 3D 8D AC +8H 6H JH 6C 5D 8D 8S 4H AD 2C +9D 4H 2D 2C 3S TS AS TC 3C 5D +4D TH 5H KS QS 6C 4S 2H 3D AD +5C KC 6H 2C 5S 3C 4D 2D 9H 9S +JD 4C 3H TH QH 9H 5S AH 8S AC +7D 9S 6S 2H TD 9C 4H 8H QS 4C +3C 6H 5D 4H 8C 9C KC 6S QD QS +3S 9H KD TC 2D JS 8C 6S 4H 4S +2S 4C 8S QS 6H KH 3H TH 8C 5D +2C KH 5S 3S 7S 7H 6C 9D QD 8D +8H KS AC 2D KH TS 6C JS KC 7H +9C KS 5C TD QC AH 6C 5H 9S 7C +5D 4D 3H 4H 6S 7C 7S AH QD TD +2H 7D QC 6S TC TS AH 7S 9D 3H +TH 5H QD 9S KS 7S 7C 6H 8C TD +TH 2D 4D QC 5C 7D JD AH 9C 4H +4H 3H AH 8D 6H QC QH 9H 2H 2C +2D AD 4C TS 6H 7S TH 4H QS TD +3C KD 2H 3H QS JD TC QC 5D 8H +KS JC QD TH 9S KD 8D 8C 2D 9C +3C QD KD 6D 4D 8D AH AD QC 8S +8H 3S 9D 2S 3H KS 6H 4C 7C KC +TH 9S 5C 3D 7D 6H AC 7S 4D 2C +5C 3D JD 4D 2D 6D 5H 9H 4C KH +AS 7H TD 6C 2H 3D QD KS 4C 4S +JC 3C AC 7C JD JS 8H 9S QC 5D +JD 6S 5S 2H AS 8C 7D 5H JH 3D +8D TC 5S 9S 8S 3H JC 5H 7S AS +5C TD 3D 7D 4H 8D 7H 4D 5D JS +QS 9C KS TD 2S 8S 5C 2H 4H AS +TH 7S 4H 7D 3H JD KD 5D 2S KC +JD 7H 4S 8H 4C JS 6H QH 5S 4H +2C QS 8C 5S 3H QC 2S 6C QD AD +8C 3D JD TC 4H 2H AD 5S AC 2S +5D 2C JS 2D AD 9D 3D 4C 4S JH +8D 5H 5D 6H 7S 4D KS 9D TD JD +3D 6D 9C 2S AS 7D 5S 5C 8H JD +7C 8S 3S 6S 5H JD TC AD 7H 7S +2S 9D TS 4D AC 8D 6C QD JD 3H +9S KH 2C 3C AC 3D 5H 6H 8D 5D +KS 3D 2D 6S AS 4C 2S 7C 7H KH +AC 2H 3S JC 5C QH 4D 2D 5H 7S +TS AS JD 8C 6H JC 8S 5S 2C 5D +7S QH 7H 6C QC 8H 2D 7C JD 2S +2C QD 2S 2H JC 9C 5D 2D JD JH +7C 5C 9C 8S 7D 6D 8D 6C 9S JH +2C AD 6S 5H 3S KS 7S 9D KH 4C +7H 6C 2C 5C TH 9D 8D 3S QC AH +5S KC 6H TC 5H 8S TH 6D 3C AH +9C KD 4H AD TD 9S 4S 7D 6H 5D +7H 5C 5H 6D AS 4C KD KH 4H 9D +3C 2S 5C 6C JD QS 2H 9D 7D 3H +AC 2S 6S 7S JS QD 5C QS 6H AD +5H TH QC 7H TC 3S 7C 6D KC 3D +4H 3D QC 9S 8H 2C 3S JC KS 5C +4S 6S 2C 6H 8S 3S 3D 9H 3H JS +4S 8C 4D 2D 8H 9H 7D 9D AH TS +9S 2C 9H 4C 8D AS 7D 3D 6D 5S +6S 4C 7H 8C 3H 5H JC AH 9D 9C +2S 7C 5S JD 8C 3S 3D 4D 7D 6S +3C KC 4S 5D 7D 3D JD 7H 3H 4H +9C 9H 4H 4D TH 6D QD 8S 9S 7S +2H AC 8S 4S AD 8C 2C AH 7D TC +TS 9H 3C AD KS TC 3D 8C 8H JD +QC 8D 2C 3C 7D 7C JD 9H 9C 6C +AH 6S JS JH 5D AS QC 2C JD TD +9H KD 2H 5D 2D 3S 7D TC AH TS +TD 8H AS 5D AH QC AC 6S TC 5H +KS 4S 7H 4D 8D 9C TC 2H 6H 3H +3H KD 4S QD QH 3D 8H 8C TD 7S +8S JD TC AH JS QS 2D KH KS 4D +3C AD JC KD JS KH 4S TH 9H 2C +QC 5S JS 9S KS AS 7C QD 2S JD +KC 5S QS 3S 2D AC 5D 9H 8H KS +6H 9C TC AD 2C 6D 5S JD 6C 7C +QS KH TD QD 2C 3H 8S 2S QC AH +9D 9H JH TC QH 3C 2S JS 5C 7H +6C 3S 3D 2S 4S QD 2D TH 5D 2C +2D 6H 6D 2S JC QH AS 7H 4H KH +5H 6S KS AD TC TS 7C AC 4S 4H +AD 3C 4H QS 8C 9D KS 2H 2D 4D +4S 9D 6C 6D 9C AC 8D 3H 7H KD +JC AH 6C TS JD 6D AD 3S 5D QD +JC JH JD 3S 7S 8S JS QC 3H 4S +JD TH 5C 2C AD JS 7H 9S 2H 7S +8D 3S JH 4D QC AS JD 2C KC 6H +2C AC 5H KD 5S 7H QD JH AH 2D +JC QH 8D 8S TC 5H 5C AH 8C 6C +3H JS 8S QD JH 3C 4H 6D 5C 3S +6D 4S 4C AH 5H 5S 3H JD 7C 8D +8H AH 2H 3H JS 3C 7D QC 4H KD +6S 2H KD 5H 8H 2D 3C 8S 7S QD +2S 7S KC QC AH TC QS 6D 4C 8D +5S 9H 2C 3S QD 7S 6C 2H 7C 9D +3C 6C 5C 5S JD JC KS 3S 5D TS +7C KS 6S 5S 2S 2D TC 2H 5H QS +AS 7H 6S TS 5H 9S 9D 3C KD 2H +4S JS QS 3S 4H 7C 2S AC 6S 9D +8C JH 2H 5H 7C 5D QH QS KH QC +3S TD 3H 7C KC 8D 5H 8S KH 8C +4H KH JD TS 3C 7H AS QC JS 5S +AH 9D 2C 8D 4D 2D 6H 6C KC 6S +2S 6H 9D 3S 7H 4D KH 8H KD 3D +9C TC AC JH KH 4D JD 5H TD 3S +7S 4H 9D AS 4C 7D QS 9S 2S KH +3S 8D 8S KS 8C JC 5C KH 2H 5D +8S QH 2C 4D KC JS QC 9D AC 6H +8S 8C 7C JS JD 6S 4C 9C AC 4S +QH 5D 2C 7D JC 8S 2D JS JH 4C +JS 4C 7S TS JH KC KH 5H QD 4S +QD 8C 8D 2D 6S TD 9D AC QH 5S +QH QC JS 3D 3C 5C 4H KH 8S 7H +7C 2C 5S JC 8S 3H QC 5D 2H KC +5S 8D KD 6H 4H QD QH 6D AH 3D +7S KS 6C 2S 4D AC QS 5H TS JD +7C 2D TC 5D QS AC JS QC 6C KC +2C KS 4D 3H TS 8S AD 4H 7S 9S +QD 9H QH 5H 4H 4D KH 3S JC AD +4D AC KC 8D 6D 4C 2D KH 2C JD +2C 9H 2D AH 3H 6D 9C 7D TC KS +8C 3H KD 7C 5C 2S 4S 5H AS AH +TH JD 4H KD 3H TC 5C 3S AC KH +6D 7H AH 7S QC 6H 2D TD JD AS +JH 5D 7H TC 9S 7D JC AS 5S KH +2H 8C AD TH 6H QD KD 9H 6S 6C +QH KC 9D 4D 3S JS JH 4H 2C 9H +TC 7H KH 4H JC 7D 9S 3H QS 7S +AD 7D JH 6C 7H 4H 3S 3H 4D QH +JD 2H 5C AS 6C QC 4D 3C TC JH +AC JD 3H 6H 4C JC AD 7D 7H 9H +4H TC TS 2C 8C 6S KS 2H JD 9S +4C 3H QS QC 9S 9H 6D KC 9D 9C +5C AD 8C 2C QH TH QD JC 8D 8H +QC 2C 2S QD 9C 4D 3S 8D JH QS +9D 3S 2C 7S 7C JC TD 3C TC 9H +3C TS 8H 5C 4C 2C 6S 8D 7C 4H +KS 7H 2H TC 4H 2C 3S AS AH QS +8C 2D 2H 2C 4S 4C 6S 7D 5S 3S +TH QC 5D TD 3C QS KD KC KS AS +4D AH KD 9H KS 5C 4C 6H JC 7S +KC 4H 5C QS TC 2H JC 9S AH QH +4S 9H 3H 5H 3C QD 2H QC JH 8H +5D AS 7H 2C 3D JH 6H 4C 6S 7D +9C JD 9H AH JS 8S QH 3H KS 8H +3S AC QC TS 4D AD 3D AH 8S 9H +7H 3H QS 9C 9S 5H JH JS AH AC +8D 3C JD 2H AC 9C 7H 5S 4D 8H +7C JH 9H 6C JS 9S 7H 8C 9D 4H +2D AS 9S 6H 4D JS JH 9H AD QD +6H 7S JH KH AH 7H TD 5S 6S 2C +8H JH 6S 5H 5S 9D TC 4C QC 9S +7D 2C KD 3H 5H AS QD 7H JS 4D +TS QH 6C 8H TH 5H 3C 3H 9C 9D +AD KH JS 5D 3H AS AC 9S 5C KC +2C KH 8C JC QS 6D AH 2D KC TC +9D 3H 2S 7C 4D 6D KH KS 8D 7D +9H 2S TC JH AC QC 3H 5S 3S 8H +3S AS KD 8H 4C 3H 7C JH QH TS +7S 6D 7H 9D JH 4C 3D 3S 6C AS +4S 2H 2C 4C 8S 5H KC 8C QC QD +3H 3S 6C QS QC 2D 6S 5D 2C 9D +2H 8D JH 2S 3H 2D 6C 5C 7S AD +9H JS 5D QH 8S TS 2H 7S 6S AD +6D QC 9S 7H 5H 5C 7D KC JD 4H +QC 5S 9H 9C 4D 6S KS 2S 4C 7C +9H 7C 4H 8D 3S 6H 5C 8H JS 7S +2D 6H JS TD 4H 4D JC TH 5H KC +AC 7C 8D TH 3H 9S 2D 4C KC 4D +KD QS 9C 7S 3D KS AD TS 4C 4H +QH 9C 8H 2S 7D KS 7H 5D KD 4C +9C 2S 2H JC 6S 6C TC QC JH 5C +7S AC 8H KC 8S 6H QS JC 3D 6S +JS 2D JH 8C 4S 6H 8H 6D 5D AD +6H 7D 2S 4H 9H 7C AS AC 8H 5S +3C JS 4S 6D 5H 2S QH 6S 9C 2C +3D 5S 6S 9S 4C QS 8D QD 8S TC +9C 3D AH 9H 5S 2C 7D AD JC 3S +7H TC AS 3C 6S 6D 7S KH KC 9H +3S TC 8H 6S 5H JH 8C 7D AC 2S +QD 9D 9C 3S JC 8C KS 8H 5D 4D +JS AH JD 6D 9D 8C 9H 9S 8H 3H +2D 6S 4C 4D 8S AD 4S TC AH 9H +TS AC QC TH KC 6D 4H 7S 8C 2H +3C QD JS 9D 5S JC AH 2H TS 9H +3H 4D QH 5D 9C 5H 7D 4S JC 3S +8S TH 3H 7C 2H JD JS TS AC 8D +9C 2H TD KC JD 2S 8C 5S AD 2C +3D KD 7C 5H 4D QH QD TC 6H 7D +7H 2C KC 5S KD 6H AH QC 7S QH +6H 5C AC 5H 2C 9C 2D 7C TD 2S +4D 9D AH 3D 7C JD 4H 8C 4C KS +TH 3C JS QH 8H 4C AS 3D QS QC +4D 7S 5H JH 6D 7D 6H JS KH 3C +QD 8S 7D 2H 2C 7C JC 2S 5H 8C +QH 8S 9D TC 2H AD 7C 8D QD 6S +3S 7C AD 9H 2H 9S JD TS 4C 2D +3S AS 4H QC 2C 8H 8S 7S TD TC +JH TH TD 3S 4D 4H 5S 5D QS 2C +8C QD QH TC 6D 4S 9S 9D 4H QC +8C JS 9D 6H JD 3H AD 6S TD QC +KC 8S 3D 7C TD 7D 8D 9H 4S 3S +6C 4S 3D 9D KD TC KC KS AC 5S +7C 6S QH 3D JS KD 6H 6D 2D 8C +JD 2S 5S 4H 8S AC 2D 6S TS 5C +5H 8C 5S 3C 4S 3D 7C 8D AS 3H +AS TS 7C 3H AD 7D JC QS 6C 6H +3S 9S 4C AC QH 5H 5D 9H TS 4H +6C 5C 7H 7S TD AD JD 5S 2H 2S +7D 6C KC 3S JD 8D 8S TS QS KH +8S QS 8D 6C TH AC AH 2C 8H 9S +7H TD KH QH 8S 3D 4D AH JD AS +TS 3D 2H JC 2S JH KH 6C QC JS +KC TH 2D 6H 7S 2S TC 8C 9D QS +3C 9D 6S KH 8H 6D 5D TH 2C 2H +6H TC 7D AD 4D 8S TS 9H TD 7S +JS 6D JD JC 2H AC 6C 3D KH 8D +KH JD 9S 5D 4H 4C 3H 7S QS 5C +4H JD 5D 3S 3C 4D KH QH QS 7S +JD TS 8S QD AH 4C 6H 3S 5S 2C +QS 3D JD AS 8D TH 7C 6S QC KS +7S 2H 8C QC 7H AC 6D 2D TH KH +5S 6C 7H KH 7D AH 8C 5C 7S 3D +3C KD AD 7D 6C 4D KS 2D 8C 4S +7C 8D 5S 2D 2S AH AD 2C 9D TD +3C AD 4S KS JH 7C 5C 8C 9C TH +AS TD 4D 7C JD 8C QH 3C 5H 9S +3H 9C 8S 9S 6S QD KS AH 5H JH +QC 9C 5S 4H 2H TD 7D AS 8C 9D +8C 2C 9D KD TC 7S 3D KH QC 3C +4D AS 4C QS 5S 9D 6S JD QH KS +6D AH 6C 4C 5H TS 9H 7D 3D 5S +QS JD 7C 8D 9C AC 3S 6S 6C KH +8H JH 5D 9S 6D AS 6S 3S QC 7H +QD AD 5C JH 2H AH 4H AS KC 2C +JH 9C 2C 6H 2D JS 5D 9H KC 6D +7D 9D KD TH 3H AS 6S QC 6H AD +JD 4H 7D KC 3H JS 3C TH 3D QS +4C 3H 8C QD 5H 6H AS 8H AD JD +TH 8S KD 5D QC 7D JS 5S 5H TS +7D KC 9D QS 3H 3C 6D TS 7S AH +7C 4H 7H AH QC AC 4D 5D 6D TH +3C 4H 2S KD 8H 5H JH TC 6C JD +4S 8C 3D 4H JS TD 7S JH QS KD +7C QC KD 4D 7H 6S AD TD TC KH +5H 9H KC 3H 4D 3D AD 6S QD 6H +TH 7C 6H TS QH 5S 2C KC TD 6S +7C 4D 5S JD JH 7D AC KD KH 4H +7D 6C 8D 8H 5C JH 8S QD TH JD +8D 7D 6C 7C 9D KD AS 5C QH JH +9S 2C 8C 3C 4C KS JH 2D 8D 4H +7S 6C JH KH 8H 3H 9D 2D AH 6D +4D TC 9C 8D 7H TD KS TH KD 3C +JD 9H 8D QD AS KD 9D 2C 2S 9C +8D 3H 5C 7H KS 5H QH 2D 8C 9H +2D TH 6D QD 6C KC 3H 3S AD 4C +4H 3H JS 9D 3C TC 5H QH QC JC +3D 5C 6H 3S 3C JC 5S 7S 2S QH +AC 5C 8C 4D 5D 4H 2S QD 3C 3H +2C TD AH 9C KD JS 6S QD 4C QC +QS 8C 3S 4H TC JS 3H 7C JC AD +5H 4D 9C KS JC TD 9S TS 8S 9H +QD TS 7D AS AC 2C TD 6H 8H AH +6S AD 8C 4S 9H 8D 9D KH 8S 3C +QS 4D 2D 7S KH JS JC AD 4C 3C +QS 9S 7H KC TD TH 5H JS AC JH +6D AC 2S QS 7C AS KS 6S KH 5S +6D 8H KH 3C QS 2H 5C 9C 9D 6C +JS 2C 4C 6H 7D JC AC QD TD 3H +4H QC 8H JD 4C KD KS 5C KC 7S +6D 2D 3H 2S QD 5S 7H AS TH 6S +AS 6D 8D 2C 8S TD 8H QD JC AH +9C 9H 2D TD QH 2H 5C TC 3D 8H +KC 8S 3D KH 2S TS TC 6S 4D JH +9H 9D QS AC KC 6H 5D 4D 8D AH +9S 5C QS 4H 7C 7D 2H 8S AD JS +3D AC 9S AS 2C 2D 2H 3H JC KH +7H QH KH JD TC KS 5S 8H 4C 8D +2H 7H 3S 2S 5H QS 3C AS 9H KD +AD 3D JD 6H 5S 9C 6D AC 9S 3S +3D 5D 9C 2D AC 4S 2S AD 6C 6S +QC 4C 2D 3H 6S KC QH QD 2H JH +QC 3C 8S 4D 9S 2H 5C 8H QS QD +6D KD 6S 7H 3S KH 2H 5C JC 6C +3S 9S TC 6S 8H 2D AD 7S 8S TS +3C 6H 9C 3H 5C JC 8H QH TD QD +3C JS QD 5D TD 2C KH 9H TH AS +9S TC JD 3D 5C 5H AD QH 9H KC +TC 7H 4H 8H 3H TD 6S AC 7C 2S +QS 9D 5D 3C JC KS 4D 6C JH 2S +9S 6S 3C 7H TS 4C KD 6D 3D 9C +2D 9H AH AC 7H 2S JH 3S 7C QC +QD 9H 3C 2H AC AS 8S KD 8C KH +2D 7S TD TH 6D JD 8D 4D 2H 5S +8S QH KD JD QS JH 4D KC 5H 3S +3C KH QC 6D 8H 3S AH 7D TD 2D +5S 9H QH 4S 6S 6C 6D TS TH 7S +6C 4C 6D QS JS 9C TS 3H 8D 8S +JS 5C 7S AS 2C AH 2H AD 5S TC +KD 6C 9C 9D TS 2S JC 4H 2C QD +QS 9H TC 3H KC KS 4H 3C AD TH +KH 9C 2H KD 9D TC 7S KC JH 2D +7C 3S KC AS 8C 5D 9C 9S QH 3H +2D 8C TD 4C 2H QC 5D TC 2C 7D +KS 4D 6C QH TD KH 5D 7C AD 8D +2S 9S 8S 4C 8C 3D 6H QD 7C 7H +6C 8S QH 5H TS 5C 3C 4S 2S 2H +8S 6S 2H JC 3S 3H 9D 8C 2S 7H +QC 2C 8H 9C AC JD 4C 4H 6S 3S +3H 3S 7D 4C 9S 5H 8H JC 3D TC +QH 2S 2D 9S KD QD 9H AD 6D 9C +8D 2D KS 9S JC 4C JD KC 4S TH +KH TS 6D 4D 5C KD 5H AS 9H AD +QD JS 7C 6D 5D 5C TH 5H QH QS +9D QH KH 5H JH 4C 4D TC TH 6C +KH AS TS 9D KD 9C 7S 4D 8H 5S +KH AS 2S 7D 9D 4C TS TH AH 7C +KS 4D AC 8S 9S 8D TH QH 9D 5C +5D 5C 8C QS TC 4C 3D 3S 2C 8D +9D KS 2D 3C KC 4S 8C KH 6C JC +8H AH 6H 7D 7S QD 3C 4C 6C KC +3H 2C QH 8H AS 7D 4C 8C 4H KC +QD 5S 4H 2C TD AH JH QH 4C 8S +3H QS 5S JS 8H 2S 9H 9C 3S 2C +6H TS 7S JC QD AC TD KC 5S 3H +QH AS QS 7D JC KC 2C 4C 5C 5S +QH 3D AS JS 4H 8D 7H JC 2S 9C +5D 4D 2S 4S 9D 9C 2D QS 8H 7H +6D 7H 3H JS TS AC 2D JH 7C 8S +JH 5H KC 3C TC 5S 9H 4C 8H 9D +8S KC 5H 9H AD KS 9D KH 8D AH +JC 2H 9H KS 6S 3H QC 5H AH 9C +5C KH 5S AD 6C JC 9H QC 9C TD +5S 5D JC QH 2D KS 8H QS 2H TS +JH 5H 5S AH 7H 3C 8S AS TD KH +6H 3D JD 2C 4C KC 7S AH 6C JH +4C KS 9D AD 7S KC 7D 8H 3S 9C +7H 5C 5H 3C 8H QC 3D KH 6D JC +2D 4H 5D 7D QC AD AH 9H QH 8H +KD 8C JS 9D 3S 3C 2H 5D 6D 2S +8S 6S TS 3C 6H 8D 5S 3H TD 6C +KS 3D JH 9C 7C 9S QS 5S 4H 6H +7S 6S TH 4S KC KD 3S JC JH KS +7C 3C 2S 6D QH 2C 7S 5H 8H AH +KC 8D QD 6D KH 5C 7H 9D 3D 9C +6H 2D 8S JS 9S 2S 6D KC 7C TC +KD 9C JH 7H KC 8S 2S 7S 3D 6H +4H 9H 2D 4C 8H 7H 5S 8S 2H 8D +AD 7C 3C 7S 5S 4D 9H 3D JC KH +5D AS 7D 6D 9C JC 4C QH QS KH +KD JD 7D 3D QS QC 8S 6D JS QD +6S 8C 5S QH TH 9H AS AC 2C JD +QC KS QH 7S 3C 4C 5C KC 5D AH +6C 4H 9D AH 2C 3H KD 3D TS 5C +TD 8S QS AS JS 3H KD AC 4H KS +7D 5D TS 9H 4H 4C 9C 2H 8C QC +2C 7D 9H 4D KS 4C QH AD KD JS +QD AD AH KH 9D JS 9H JC KD JD +8S 3C 4S TS 7S 4D 5C 2S 6H 7C +JS 7S 5C KD 6D QH 8S TD 2H 6S +QH 6C TC 6H TD 4C 9D 2H QC 8H +3D TS 4D 2H 6H 6S 2C 7H 8S 6C +9H 9D JD JH 3S AH 2C 6S 3H 8S +2C QS 8C 5S 3H 2S 7D 3C AD 4S +5C QC QH AS TS 4S 6S 4C 5H JS +JH 5C TD 4C 6H JS KD KH QS 4H +TC KH JC 4D 9H 9D 8D KC 3C 8H +2H TC 8S AD 9S 4H TS 7H 2C 5C +4H 2S 6C 5S KS AH 9C 7C 8H KD +TS QH TD QS 3C JH AH 2C 8D 7D +5D KC 3H 5S AC 4S 7H QS 4C 2H +3D 7D QC KH JH 6D 6C TD TH KD +5S 8D TH 6C 9D 7D KH 8C 9S 6D +JD QS 7S QC 2S QH JC 4S KS 8D +7S 5S 9S JD KD 9C JC AD 2D 7C +4S 5H AH JH 9C 5D TD 7C 2D 6S +KC 6C 7H 6S 9C QD 5S 4H KS TD +6S 8D KS 2D TH TD 9H JD TS 3S +KH JS 4H 5D 9D TC TD QC JD TS +QS QD AC AD 4C 6S 2D AS 3H KC +4C 7C 3C TD QS 9C KC AS 8D AD +KC 7H QC 6D 8H 6S 5S AH 7S 8C +3S AD 9H JC 6D JD AS KH 6S JH +AD 3D TS KS 7H JH 2D JS QD AC +9C JD 7C 6D TC 6H 6C JC 3D 3S +QC KC 3S JC KD 2C 8D AH QS TS +AS KD 3D JD 8H 7C 8C 5C QD 6C diff --git a/extra/project-euler/project-euler.factor b/extra/project-euler/project-euler.factor index 1e1da38a3f..62f6a56c65 100644 --- a/extra/project-euler/project-euler.factor +++ b/extra/project-euler/project-euler.factor @@ -1,4 +1,4 @@ -! Copyright (c) 2007, 2008 Aaron Schaefer, Samuel Tardieu. +! Copyright (c) 2007, 2008, 2009 Aaron Schaefer, Samuel Tardieu. ! See http://factorcode.org/license.txt for BSD license. USING: definitions io io.files io.pathnames kernel math math.parser prettyprint project-euler.ave-time sequences vocabs vocabs.loader @@ -14,14 +14,14 @@ USING: definitions io io.files io.pathnames kernel math math.parser project-euler.037 project-euler.038 project-euler.039 project-euler.040 project-euler.041 project-euler.042 project-euler.043 project-euler.044 project-euler.045 project-euler.046 project-euler.047 project-euler.048 - project-euler.049 project-euler.052 project-euler.053 project-euler.055 - project-euler.056 project-euler.057 project-euler.059 project-euler.067 - project-euler.071 project-euler.073 project-euler.075 project-euler.076 - project-euler.079 project-euler.092 project-euler.097 project-euler.099 - project-euler.100 project-euler.116 project-euler.117 project-euler.134 - project-euler.148 project-euler.150 project-euler.151 project-euler.164 - project-euler.169 project-euler.173 project-euler.175 project-euler.186 - project-euler.190 project-euler.203 project-euler.215 ; + project-euler.049 project-euler.052 project-euler.053 project-euler.054 + project-euler.055 project-euler.056 project-euler.057 project-euler.059 + project-euler.067 project-euler.071 project-euler.073 project-euler.075 + project-euler.076 project-euler.079 project-euler.092 project-euler.097 + project-euler.099 project-euler.100 project-euler.116 project-euler.117 + project-euler.134 project-euler.148 project-euler.150 project-euler.151 + project-euler.164 project-euler.169 project-euler.173 project-euler.175 + project-euler.186 project-euler.190 project-euler.203 project-euler.215 ; IN: project-euler Date: Sun, 5 Apr 2009 17:32:53 -0500 Subject: [PATCH 06/65] Fixes for recent changes --- basis/opengl/textures/textures-tests.factor | 50 --------------------- extra/tetris/gl/gl.factor | 2 +- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/basis/opengl/textures/textures-tests.factor b/basis/opengl/textures/textures-tests.factor index 163871028d..3efdb43cd8 100644 --- a/basis/opengl/textures/textures-tests.factor +++ b/basis/opengl/textures/textures-tests.factor @@ -5,56 +5,6 @@ opengl.textures.private images kernel namespaces accessors sequences ; IN: opengl.textures.tests -[ ] [ - T{ image - { dim { 3 5 } } - { component-order RGB } - { bitmap - B{ - 1 2 3 4 5 6 7 8 9 - 10 11 12 13 14 15 16 17 18 - 19 20 21 22 23 24 25 26 27 - 28 29 30 31 32 33 34 35 36 - 37 38 39 40 41 42 43 44 45 - } - } - } "image" set -] unit-test - -[ - T{ image - { dim { 4 8 } } - { component-order RGB } - { bitmap - B{ - 1 2 3 4 5 6 7 8 9 7 8 9 - 10 11 12 13 14 15 16 17 18 16 17 18 - 19 20 21 22 23 24 25 26 27 25 26 27 - 28 29 30 31 32 33 34 35 36 34 35 36 - 37 38 39 40 41 42 43 44 45 43 44 45 - 37 38 39 40 41 42 43 44 45 43 44 45 - 37 38 39 40 41 42 43 44 45 43 44 45 - 37 38 39 40 41 42 43 44 45 43 44 45 - } - } - } -] [ - "image" get power-of-2-image -] unit-test - -[ - T{ image - { dim { 0 0 } } - { component-order R32G32B32 } - { bitmap B{ } } } -] [ - T{ image - { dim { 0 0 } } - { component-order R32G32B32 } - { bitmap B{ } } - } power-of-2-image -] unit-test - [ { { { 0 0 } { 10 0 } } diff --git a/extra/tetris/gl/gl.factor b/extra/tetris/gl/gl.factor index d1f398994e..0169249e81 100644 --- a/extra/tetris/gl/gl.factor +++ b/extra/tetris/gl/gl.factor @@ -37,7 +37,7 @@ IN: tetris.gl : draw-tetris ( width height tetris -- ) #! width and height are in pixels - GL_MODELVIEW [ + [ { [ board>> scale-board ] [ board>> draw-board ] From 75dd35179b48290b2725912404c725407d7f0a59 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 17:34:02 -0500 Subject: [PATCH 07/65] Fix alien unit tests --- core/alien/alien-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/alien/alien-tests.factor b/core/alien/alien-tests.factor index aa65a3e2d8..d3265f31bb 100644 --- a/core/alien/alien-tests.factor +++ b/core/alien/alien-tests.factor @@ -87,4 +87,4 @@ f initialize-test set-global [ 7575 ] [ initialize-test [ 7575 ] initialize-alien ] unit-test -[ { BAD-ALIEN } ] [ { BAD-ALIEN BAD-ALIEN BAD-ALIEN } prune ] unit-test \ No newline at end of file +[ V{ BAD-ALIEN } ] [ { BAD-ALIEN BAD-ALIEN BAD-ALIEN } prune ] unit-test \ No newline at end of file From 4a229e5205932455d8256deb8a348382503a9a00 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 21:16:20 -0400 Subject: [PATCH 08/65] Slight cleanup of PE problem 54 solution --- extra/project-euler/054/054.factor | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/extra/project-euler/054/054.factor b/extra/project-euler/054/054.factor index 2e7eaa4cd3..5cf42737fb 100644 --- a/extra/project-euler/054/054.factor +++ b/extra/project-euler/054/054.factor @@ -73,15 +73,12 @@ IN: project-euler.054 "resource:extra/project-euler/054/poker.txt" ascii file-lines [ [ 14 head-slice ] [ 14 tail-slice* ] bi 2array ] map ; -: player1-win? ( hand1 hand2 -- ? ) - before? ; inline - PRIVATE> : euler054 ( -- answer ) - source-054 [ [ ] map first2 player1-win? ] count ; + source-054 [ [ ] map first2 before? ] count ; ! [ euler054 ] 100 ave-time -! 36 ms ave run time - 2.71 SD (100 trials) +! 34 ms ave run time - 2.65 SD (100 trials) SOLUTION: euler054 From fda3f6d3f0fa707281c869f25fef1e146b04dd17 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 21:16:57 -0400 Subject: [PATCH 09/65] Add perfect hash optimization for poker vocab --- extra/poker/arrays/arrays.factor | 1267 ++++++++++++------------------ extra/poker/poker-tests.factor | 2 + extra/poker/poker.factor | 20 +- 3 files changed, 529 insertions(+), 760 deletions(-) diff --git a/extra/poker/arrays/arrays.factor b/extra/poker/arrays/arrays.factor index b415265348..bf758f166a 100644 --- a/extra/poker/arrays/arrays.factor +++ b/extra/poker/arrays/arrays.factor @@ -502,760 +502,517 @@ CONSTANT: unique5-table 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1600 } -! This is a lookup table for the product of prime values associated with the -! cards in a hand. -CONSTANT: products-table -{ 48 72 80 108 112 120 162 168 176 180 200 208 252 264 270 272 280 300 304 312 -368 378 392 396 405 408 420 440 450 456 464 468 496 500 520 552 567 588 592 594 -612 616 630 656 660 675 680 684 696 700 702 728 744 750 760 780 828 882 888 891 -918 920 924 945 952 968 980 984 990 1020 1026 1044 1050 1053 1064 1092 1100 -1116 1125 1140 1144 1160 1170 1240 1242 1250 1288 1300 1323 1332 1352 1372 1377 -1380 1386 1428 1452 1470 1476 1480 1485 1496 1530 1539 1540 1566 1575 1596 1624 -1638 1640 1650 1672 1674 1700 1710 1716 1736 1740 1750 1755 1768 1820 1860 1863 -1875 1900 1932 1950 1976 1998 2024 2028 2058 2070 2072 2079 2142 2156 2178 2205 -2214 2220 2244 2295 2296 2300 2312 2349 2380 2392 2394 2420 2436 2450 2457 2460 -2475 2508 2511 2548 2550 2552 2565 2574 2584 2604 2610 2625 2652 2660 2728 2750 -2790 2850 2860 2888 2898 2900 2925 2964 2997 3016 3036 3042 3087 3100 3105 3108 -3128 3213 3220 3224 3234 3250 3256 3267 3321 3330 3332 3366 3380 3388 3430 3444 -3450 3465 3468 3496 3588 3591 3608 3630 3654 3675 3690 3700 3724 3740 3762 3822 -3825 3828 3848 3850 3861 3876 3906 3915 3944 3978 4004 4060 4092 4095 4100 4125 -4180 4185 4216 4232 4250 4264 4275 4332 4340 4347 4350 4375 4408 4420 4446 4508 -4524 4550 4554 4563 4650 4662 4692 4712 4732 4750 4802 4836 4851 4875 4884 4940 -4995 4998 5032 5049 5060 5070 5082 5145 5166 5175 5180 5202 5236 5244 5324 5336 -5355 5382 5390 5412 5445 5481 5535 5550 5576 5586 5624 5643 5684 5704 5733 5740 -5742 5750 5772 5775 5780 5814 5852 5859 5916 5950 5967 5980 5985 6050 6076 6125 -6138 6150 6188 6232 6292 6324 6348 6370 6375 6380 6396 6435 6460 6498 6525 6612 -6650 6669 6728 6762 6786 6808 6820 6825 6831 6875 6916 6975 6993 7038 7068 7084 -7098 7125 7150 7192 7203 7220 7245 7250 7252 7254 7326 7436 7497 7540 7544 7546 -7548 7605 7623 7688 7749 7750 7803 7820 7866 7986 8004 8036 8050 8060 8073 8085 -8092 8118 8125 8140 8228 8325 8330 8364 8372 8379 8415 8436 8450 8470 8526 8556 -8575 8584 8613 8625 8658 8670 8721 8740 8788 8874 8918 8925 8932 9009 9020 9044 -9075 9114 9135 9176 9196 9207 9225 9250 9310 9348 9350 9405 9438 9486 9512 9522 -9548 9555 9594 9620 9625 9724 9747 9765 9860 9918 9945 9975 10092 10108 10143 -10150 10168 10179 10212 10250 10450 10540 10556 10557 10580 10602 10625 10647 -10660 10725 10788 10830 10850 10868 10875 10878 10881 10948 10952 10989 11020 -11050 11115 11132 11154 11270 11284 11316 11319 11322 11375 11385 11396 11492 -11532 11625 11655 11662 11780 11781 11799 11830 11858 11875 11979 12005 12006 -12054 12075 12136 12138 12177 12236 12342 12350 12495 12546 12580 12628 12650 -12654 12675 12705 12716 12789 12834 12844 12876 12915 12950 12987 13005 13034 -13156 13167 13182 13310 13311 13340 13377 13448 13455 13468 13475 13671 13764 -13794 13804 13875 13923 13940 13965 14014 14022 14025 14036 14060 14157 14210 -14212 14229 14260 14268 14283 14350 14355 14375 14391 14450 14535 14756 14812 -14875 14877 14924 14950 15004 15028 15125 15138 15162 15190 15225 15252 15318 -15345 15375 15428 15548 15561 15580 15675 15730 15778 15870 15884 15903 15925 -15939 15950 16150 16182 16245 16275 16317 16428 16492 16562 16575 16588 16625 -16698 16731 16796 16820 16905 16965 16974 16983 17020 17050 17204 17238 17298 -17493 17595 17612 17732 17745 17787 17875 17908 17980 18009 18050 18081 18125 -18130 18135 18204 18207 18315 18326 18513 18525 18590 18634 18676 18772 18819 -18837 18850 18860 18865 18975 18981 19074 19220 19228 19251 19266 19314 19375 -19425 19516 19550 19551 19604 19652 19665 19684 19773 19844 19894 19964 19965 -20090 20097 20125 20150 20172 20230 20295 20332 20349 20350 20482 20570 20646 -20691 20825 20956 21021 21033 21054 21125 21164 21175 21266 21315 21402 21460 -21483 21525 21645 21658 21675 21692 21812 21850 21879 21964 21970 22022 22185 -22218 22295 22425 22506 22542 22550 22707 22724 22743 22785 22878 22940 22977 -22990 23125 23188 23275 23276 23322 23375 23452 23548 23595 23667 23715 23751 -23780 23805 23826 23828 23925 23985 24050 24206 24225 24244 24273 24453 24548 -24633 24642 24650 24794 24795 24843 25012 25025 25047 25172 25230 25270 25375 -25382 25389 25420 25461 25575 25625 25636 25641 25857 25916 25947 26026 26125 -26350 26404 26411 26450 26505 26588 26650 26862 26908 27075 27125 27195 27306 -27380 27404 27436 27489 27508 27531 27550 27625 27676 27716 27830 27885 27951 -28126 28158 28175 28275 28305 28322 28413 28611 28652 28730 28798 28830 28899 -28971 29155 29282 29302 29325 29348 29406 29450 29478 29575 29601 29645 29716 -29766 29841 30015 30044 30135 30225 30258 30303 30340 30345 30525 30628 30668 -30723 30758 30855 30875 30932 30969 31059 31213 31262 31365 31372 31434 31450 -31581 31625 31635 31654 31790 31899 31977 32085 32103 32110 32116 32186 32375 -32487 32585 32708 32725 32775 32946 32955 33033 33201 33212 33275 33292 33327 -33350 33418 33524 33579 33620 33759 33813 33825 34276 34317 34485 34606 34684 -34713 34850 34914 34983 35035 35055 35090 35150 35322 35378 35525 35588 35650 -35739 35836 35875 35972 36075 36125 36244 36309 36556 36575 36822 36946 36963 -36975 37004 37030 37076 37107 37191 37323 37375 37444 37468 37510 37518 37570 -37791 37845 37905 37975 38073 38295 38318 38332 38675 38709 38870 38950 38962 -39039 39325 39445 39494 39525 39556 39627 39675 39710 39875 39882 39886 39897 -39975 40052 40204 40222 40293 40362 40375 40455 40508 40817 40898 40959 41070 -41154 41262 41325 41405 41492 41503 41574 41745 41876 42021 42050 42189 42237 -42284 42435 42476 42483 42550 42625 42772 42826 43095 43197 43225 43245 43263 -43732 43911 43923 43953 44109 44175 44198 44217 44252 44275 44289 44506 44649 -44764 44770 44919 44950 44954 45125 45254 45325 45356 45387 45619 45747 45815 -46137 46475 46585 46748 46893 46930 47068 47125 47138 47150 47151 47175 47212 -47396 47481 47619 47685 47804 48050 48165 48279 48285 48314 48334 48484 48668 -48807 48875 49010 49036 49049 49077 49126 49130 49419 49610 49735 49818 49972 -50025 50127 50225 50286 50375 50430 50468 50575 50578 50692 50875 51129 51205 -51425 51615 51646 51842 51909 52173 52234 52275 52316 52325 52371 52390 52514 -52598 52635 52725 52767 52972 52983 53067 53165 53428 53475 53482 53505 53613 -53650 53754 53958 53998 54145 54188 54418 54549 54625 54910 54925 55055 55223 -55233 55419 55506 55545 55594 55796 55825 55924 56265 56277 56355 56375 56525 -56637 57122 57188 57195 57350 57475 57477 57498 57681 57722 57868 57967 58190 -58305 58311 58425 58443 58870 59204 59241 59409 59450 59565 59644 59675 59774 -59823 59829 60125 60236 60306 60333 60515 60543 60775 61132 61226 61347 61364 -61370 61605 61625 61642 61659 61731 61828 61893 61985 62271 62361 62530 62678 -62814 63075 63175 63206 63426 63455 63550 63825 63916 64124 64141 64158 64239 -64467 64676 65065 65219 65348 65366 65596 65598 65702 65875 65975 66033 66092 -66125 66297 66470 66625 66748 66759 66861 67146 67155 67270 67425 67431 67599 -67881 67925 68265 68306 68324 68425 68450 68590 68614 68770 68782 68875 68894 -68913 69003 69290 69454 69575 69597 69629 69874 69938 70315 70395 70525 70587 -70602 70642 70707 70725 70805 71094 71188 71225 71668 71687 71825 71995 72075 -72261 72358 72471 72501 72964 73002 73036 73205 73255 73346 73515 73593 73625 -73689 73695 73964 74415 74431 74698 74727 74907 74958 75429 75645 75803 75850 -75867 76342 76475 76874 76895 77077 77121 77198 77372 77469 77763 77996 78039 -78155 78166 78292 78351 78585 78625 78771 78884 78897 78925 79135 79475 80073 -80142 80223 80275 80465 80475 80631 80852 80937 80997 81466 81548 81549 81627 -82225 82251 82365 82418 82522 82654 82708 83030 83259 83375 83391 83398 83421 -83486 83545 83810 84050 84175 84249 84303 84721 85514 85683 85782 85918 86025 -86247 86275 86428 86515 86583 86756 86779 87125 87172 87285 87362 87412 87542 -87725 87875 88102 88305 88412 88445 88806 88825 88837 89001 89125 89175 89590 -89661 89930 90117 90354 90364 90459 91091 91143 91234 91839 92046 92055 92225 -92365 92414 92463 92510 92575 93058 93092 93275 93357 93775 93795 93925 94017 -94178 94221 94622 94809 95139 95325 95571 95795 95830 95874 96026 96237 96278 -96425 96596 97006 97175 97375 97405 97526 97556 97682 98022 98049 98394 98397 -98441 98494 98553 98716 98735 99127 99275 99567 99705 99715 100510 100555 -100719 100793 100905 101062 102051 102245 102459 102487 102557 102675 102885 -102921 103075 103155 103156 103173 103246 103341 103675 103935 104044 104181 -104284 104690 104811 104907 104975 105125 105154 105183 105524 105710 105754 -105903 105963 106227 106375 106641 106782 106930 107065 107525 107559 107653 -107822 108086 108537 109089 109142 109174 109330 109388 109417 109503 109554 -110019 110075 110331 110495 110789 110825 110946 111265 111476 111910 111925 -112047 112375 112385 112406 112437 112651 113135 113553 113775 114057 114308 -114513 115258 115292 115311 115797 116058 116242 116402 116522 116725 116932 -116963 117249 117325 117334 117438 117670 117711 117845 117875 118490 119119 -119164 119187 119306 120125 120175 120213 120785 120802 120835 121121 121670 -121923 121975 122018 122199 122525 122815 122825 123025 123627 123783 123823 -123981 124025 124468 124545 124558 124775 124930 125097 125229 125426 125541 -125715 125829 125902 125948 126075 126445 127075 127426 127534 127738 127756 -128018 128271 128673 128877 128986 129115 129311 129514 129605 130134 130203 -130585 130975 131043 131118 131285 131313 131495 132153 132158 132275 132618 -133052 133133 133209 133342 133570 133705 134113 134125 134162 134199 134385 -134895 134995 135014 135531 135575 136045 136214 136325 136367 136851 137275 -137547 137566 137924 138069 138229 138621 138765 138985 139113 139564 139587 -139601 139638 140714 140777 141267 141933 142025 142228 142538 142766 142805 -142970 143143 143375 143745 143811 144039 144279 144305 144417 144925 145475 -145509 145521 146234 146289 146334 146523 146566 146575 147033 147175 147436 -147591 147706 147741 147994 148010 148625 148666 148707 148925 149435 149702 -149891 150183 150590 150765 150898 151294 151525 151593 152218 152438 153062 -153065 153410 153425 153729 154105 154652 154693 154869 155771 156066 156325 -156426 156674 156695 157035 157325 157339 157604 157731 158015 158389 158565 -158631 158804 158875 159562 159790 160173 160225 160395 161161 161253 161414 -161733 161975 162129 162578 163370 163415 163713 163761 163990 163995 164169 -164255 164331 164738 164983 165025 165886 166175 166419 166634 167042 167214 -167865 168175 168609 168674 169099 169169 169756 170126 170338 170765 171125 -171275 171462 171475 171535 171925 171941 171955 172235 172546 172822 172887 -172975 173225 173635 174087 174097 174363 174603 174685 174783 174845 174902 -175491 175972 176001 176157 176505 176605 177023 177489 177735 177970 178126 -178334 178746 178802 178959 179075 180154 180761 180895 181203 181447 181917 -182505 182590 182666 182819 183027 183365 183425 183483 183799 184093 184382 -184910 185725 186093 186238 186694 186702 186745 186837 186998 187187 187395 -187775 188108 188139 188518 188853 188922 188993 189625 190333 190463 190855 -191139 191301 191425 191607 191634 191675 192027 192185 192995 193325 193430 -193479 194271 194463 194579 194996 195201 195415 195730 196075 196137 196677 -197098 197846 198237 198927 199082 199927 200013 200158 200355 200725 201243 -202027 202521 202612 203203 203319 203522 203665 204321 204425 205751 205942 -206045 206305 206349 206635 206886 207214 207575 208075 208444 208495 208658 -208715 209209 209457 209525 210125 210749 210826 211071 212602 213342 213785 -213807 214149 214225 214291 214455 214774 214795 215747 215878 216775 216890 -217217 217341 217558 217906 218405 218530 218855 219351 219373 219501 219849 -220255 221030 221122 221221 221559 221991 222015 222111 222425 222999 223706 -223975 224516 224553 224825 224939 225446 225885 225998 226347 226525 226941 -228085 228206 228327 228475 228657 228718 228781 229586 229593 229957 230115 -230318 231035 231275 231725 231978 232101 232562 232645 232730 232934 233206 -233818 234025 234099 234175 234639 235011 235246 235445 235543 235586 236406 -236555 237429 237614 238206 239071 239343 239575 239685 240065 240149 240526 -240695 240737 240994 241129 242121 242515 243089 243815 243867 243890 244205 -244559 244783 245055 245985 246123 246202 246235 247107 247225 247247 248788 -248829 248897 249067 249158 249951 250325 250563 250821 251275 252586 252655 -253011 253175 253253 254634 255189 255507 255626 256711 257193 258115 258819 -258874 259233 259259 259325 259407 259666 260110 260642 260678 260710 261326 -261443 261725 262353 262885 263097 263302 264275 264385 265475 265727 265837 -266955 267189 267197 267325 267501 267674 268119 268203 269059 269555 270193 -270215 270231 270802 272194 272855 272935 273325 273581 273885 273999 274022 -274846 275684 276573 276575 277365 277574 278018 278179 278369 278690 279357 -279775 280041 280053 280497 281015 282302 282777 283383 283475 284053 284258 -284954 285131 285770 287287 287451 287638 287738 288145 288463 288827 289289 -290145 290605 290966 291005 291305 291893 292175 292201 292494 293335 293595 -293854 294151 294175 295075 295647 296225 296769 296989 297910 298265 298623 -298775 299299 299367 300237 300713 302005 303025 303646 303862 303918 304175 -304606 305045 305283 305762 305767 305942 306397 306475 307582 308074 308357 -308913 309442 310329 310821 311170 311395 312325 312666 312987 313565 314019 -314041 314171 314534 314755 314870 315425 315514 316239 316342 316825 317471 -318478 318565 318734 318835 318903 319319 319345 319390 320013 320045 322161 -322465 323449 323785 323817 324818 325335 325622 325703 325822 326337 326859 -326975 327795 328757 329623 330395 331075 331177 331298 331545 331683 331731 -333355 333925 335405 335559 335699 336091 336743 336774 336973 337502 337535 -338169 338675 338997 339031 339521 340442 340535 341341 341446 341734 341887 -342309 343077 343915 344379 344729 344810 345477 347282 347633 347967 348725 -348843 349095 349401 349525 349809 350727 350987 351538 351785 352869 353379 -353717 354609 355570 355946 356345 356421 356915 357309 357425 359414 359513 -360778 360789 361361 361491 361675 362674 363562 364021 364154 364994 365585 -365835 366415 367114 368039 369265 369303 369985 370025 370139 371665 371722 -372775 373182 373737 374255 375193 375683 376475 377245 377377 378235 378301 -378879 378917 380494 380545 381095 381938 381951 381997 382075 382109 382655 -383439 383525 384307 384659 384826 385526 386425 386630 387686 388311 388531 -389499 390165 390166 390963 391017 391065 391534 391685 391989 393421 394010 -394953 395937 397010 397822 397969 398866 398905 399475 400078 400673 400775 -401511 401698 401882 402866 403403 403535 404225 406203 406334 406445 406802 -406847 407407 407827 408291 408425 409975 410669 410839 411033 411845 412114 -412269 413075 413526 413678 414715 415454 416361 416585 417027 417074 417175 -417571 417605 418035 419881 421685 422807 423243 423453 424390 424589 424762 -424879 425258 425315 425546 425845 426374 426387 427025 427063 427431 428655 -429598 429913 430606 431365 431457 431607 432055 435638 435953 436449 437255 -438741 438991 440657 440781 440818 443989 444925 445315 445835 445991 446369 -446865 447005 447083 447146 447811 447925 448063 450262 450385 451451 453299 -453871 454138 454181 454597 455469 455793 455877 456025 456475 456665 456909 -458643 458689 458913 458983 459173 460955 461373 462111 462275 462346 462553 -462722 464163 465595 466697 466735 466755 467495 468999 469567 470327 471295 -471801 472305 472549 473271 474513 474734 476749 477158 477717 478101 479085 -480491 480766 481481 481574 482734 483575 484561 485537 486098 486266 487227 -487475 487490 488433 488733 489325 490637 491878 492499 492745 493025 494615 -496223 496947 497705 497798 498883 499681 500395 501787 502918 503234 505161 -505325 506253 506530 507566 508079 508277 508805 508898 509675 510663 511819 -512006 512169 512601 512746 512981 514786 514855 516925 516971 517215 517979 -518035 519622 520331 520421 520923 521110 521594 521645 523957 527065 527307 -528143 529529 531505 532763 533355 533533 533919 535717 536393 536558 536935 -537251 539121 539695 540175 541167 541282 541717 542087 542225 542659 543286 -543895 544011 544765 544825 545054 545343 546231 546325 547491 548359 550671 -551614 552575 552805 555458 555611 555814 555841 557566 557583 558467 559265 -559682 559773 561290 562438 563615 563914 564775 564949 564995 567853 568178 -569023 570515 570741 571795 572242 572663 572907 573562 573965 574678 575795 -576583 577239 578289 578347 579945 580601 581405 581529 581647 581825 582335 -582958 583015 583219 584545 584647 585249 585599 587301 588115 588965 590359 -591015 593021 593929 594035 594146 594473 595441 595515 596183 596733 598299 -600117 600281 600457 600691 601315 602485 602547 602823 603725 603911 604299 -604877 605098 607202 609501 609725 610203 612157 613118 614422 615043 615505 -616975 618171 618233 620194 620289 620517 620806 620977 621970 622895 623162 -623181 623441 624169 625611 625807 628694 630539 631465 633919 634114 634933 -636585 637143 637887 638319 639065 639331 639561 640211 640871 644397 644725 -645337 645909 647185 648907 649078 649165 650275 651605 651695 651775 651833 -653315 653429 653457 654493 655402 656183 656903 657662 658255 659525 659813 -661227 662966 663803 664411 665482 669185 670719 671099 675393 676286 677005 -677846 680485 680846 681207 682486 683501 683675 684574 685055 685069 687115 -687242 687401 689210 689843 692461 692714 693519 693842 693935 694083 695045 -696725 696787 700553 700843 701437 702559 702658 704099 705686 705755 708883 -709142 709423 709631 710645 712101 712327 712385 714425 715737 719095 719345 -720575 720797 721149 722361 724101 724594 725249 726869 727415 729147 729399 -729554 730303 730639 730825 731235 733381 734635 734638 735034 737426 737817 -737891 742577 743002 743774 744107 744775 746697 748867 749177 751502 751709 -754354 754377 754851 755573 756613 757393 758582 759115 759655 759795 761349 -761453 761515 762671 763347 764405 764855 768009 768955 769119 770185 772179 -773605 773927 774566 774706 775489 777925 779433 781665 782254 782391 782971 -783959 785213 785519 785806 786335 787175 788785 789061 790855 790993 791282 -792281 793117 796195 796835 798475 798721 800513 803551 804287 804837 806113 -809042 809627 811923 812045 812383 813967 814055 814555 814929 815269 816221 -817581 817663 818363 818662 823361 824182 824551 827421 828134 828245 828269 -828971 829226 829939 830297 830414 831575 831649 832117 833187 833721 836349 -836969 837199 838409 839523 839914 841841 841935 843479 843657 843755 845871 -850586 851105 852267 853615 854335 858363 858458 859027 860343 861707 862017 -862025 866723 866822 868205 870758 872053 872275 873422 874437 876826 877591 -877933 878845 884051 884374 885391 886414 887777 888925 889778 889865 891219 -893809 894179 894691 896506 898535 898909 900358 901945 906059 906685 907647 -908831 908905 910385 910803 912247 912373 912485 914641 916487 917662 917785 -918731 919677 921475 921557 921633 924482 926497 926782 927707 927979 929305 -930291 931209 932955 933658 934743 935693 936859 943041 947546 947807 949003 -950521 951142 951171 951235 952679 954845 955451 959077 960089 961961 962065 -963815 964894 966329 966575 969215 971509 971618 973063 973617 975415 978835 -979693 980837 983103 983411 985025 986493 988057 988418 989417 990437 990698 -990847 992525 994449 994555 994903 997165 997339 997694 998223 998963 1000195 -1004245 1004663 1004705 1005238 1006733 1007083 1007165 1012894 1013173 1014101 -1014429 1015835 1016738 1016769 1017005 1018381 1021269 1023729 1024309 1024426 -1026817 1026861 1028489 1030285 1030863 1032226 1033815 1034195 1036849 1037153 -1038635 1039071 1040763 1042685 1049191 1053987 1056757 1057978 1058529 1058743 -1059022 1060975 1061905 1062761 1063145 1063517 1063713 1063865 1065935 1066121 -1067857 1070167 1070558 1070797 1072478 1073995 1076515 1076537 1078259 1083047 -1083121 1084039 1085773 1085926 1086891 1088153 1089095 1094331 1094951 1095274 -1096381 1099825 1100869 1101957 1102045 1102551 1103414 1104299 1105819 1106139 -1106959 1107197 1114366 1114503 1114673 1115569 1115661 1117865 1119371 1121549 -1121894 1123343 1125655 1127253 1131531 1132058 1132681 1133407 1135234 1135345 -1136863 1137873 1139677 1140377 1146442 1147619 1155865 1156805 1157819 1159171 -1159543 1161849 1162059 1162213 1169311 1171001 1172354 1173381 1175675 1178709 -1181257 1182446 1183301 1186835 1186923 1187329 1191547 1192895 1195061 1196069 -1196506 1196569 1198483 1199266 1201915 1203935 1206835 1208938 1209271 1210547 -1211573 1213511 1213526 1213563 1213682 1215245 1215487 1215665 1216171 1218725 -1225367 1227993 1229695 1230383 1234838 1236273 1239953 1242201 1242989 1243839 -1244495 1245621 1245811 1255133 1255501 1257295 1257949 1257962 1258085 1259871 -1262723 1263661 1266325 1266749 1267474 1268915 1269359 1272245 1272467 1274539 -1275879 1277479 1279091 1280015 1281137 1281865 1281974 1282633 1284899 1285999 -1286965 1287687 1292669 1293853 1294033 1295723 1299055 1300233 1301027 1302775 -1303985 1306137 1306877 1310133 1310278 1314542 1315239 1316978 1322893 1325467 -1326561 1329621 1331729 1334667 1336783 1338623 1339634 1340003 1341395 1344718 -1344759 1346891 1349341 1349834 1350537 1351166 1353205 1354111 1354886 1356277 -1356901 1358215 1362635 1365581 1368334 1370369 1370386 1372019 1376493 1379035 -1381913 1386723 1388645 1389223 1389535 1390173 1392377 1393915 1396031 1399205 -1400273 1400487 1403207 1403225 1405943 1406095 1406587 1409785 1410031 1412327 -1414127 1414562 1416389 1420445 1421319 1422169 1423807 1426713 1428163 1430605 -1431382 1432417 1433531 1433729 1433905 1436695 1437293 1442399 1442926 1446071 -1447341 1447873 1448161 1448402 1454089 1457395 1457427 1459354 1459759 1465399 -1466641 1468987 1469194 1472207 1482627 1483339 1485365 1486047 1486667 1488403 -1489411 1492309 1496541 1497067 1497238 1503593 1507121 1507857 1508638 1511653 -1512118 1512745 1514071 1515839 1516262 1518005 1519341 1519817 1524733 1525107 -1526657 1529099 1531309 1532795 1533433 1536055 1536639 1542863 1544491 1548339 -1550485 1552015 1552661 1554925 1557905 1563419 1565011 1566461 1567247 1571735 -1575917 1582009 1582559 1583023 1585285 1586126 1586899 1586967 1588533 1589483 -1600313 1602403 1604986 1605837 1608717 1612682 1616197 1616402 1617122 1618211 -1619527 1622695 1628889 1629887 1635622 1638505 1639187 1641809 1642911 1644155 -1655121 1657415 1657466 1661569 1663705 1670053 1671241 1671549 1675333 1681691 -1682681 1682841 1685509 1687829 1689569 1690715 1691701 1692197 1694173 1694407 -1694615 1698087 1698619 1701343 1701931 1702115 1702851 1706215 1709659 1711435 -1711463 1718105 1719663 1721573 1722202 1723025 1727878 1729937 1731785 1734605 -1735327 1739881 1742293 1750507 1751629 1753037 1756645 1758531 1760213 1761319 -1764215 1769261 1771774 1772855 1773593 1773669 1776481 1778498 1781143 1786499 -1790921 1791946 1792021 1794611 1794759 1798899 1801751 1804231 1804786 1806091 -1807117 1811485 1812446 1813407 1818677 1820289 1820523 1822139 1823885 1825579 -1826246 1834963 1836595 1837585 1843565 1847042 1847677 1849243 1852201 1852257 -1852462 1856261 1857505 1859435 1869647 1870297 1872431 1877953 1878755 1879537 -1885885 1886943 1891279 1894487 1896455 1901211 1901501 1907689 1908386 1910051 -1916291 1920983 1922961 1924814 1929254 1930649 1933459 1936415 1936765 1939751 -1944103 1945349 1951481 1952194 1955635 1956449 1957703 1958887 1964515 1965417 -1968533 1971813 1973699 1975103 1975467 1976777 1978205 1979939 1980218 1982251 -1984279 1987453 1988623 1994707 1999283 1999591 1999898 2002481 2002847 2007467 -2009451 2011373 2017077 2019127 2019719 2022605 2024751 2026749 2032329 2040353 -2044471 2046655 2048449 2050841 2052501 2055579 2056223 2060455 2062306 2066801 -2070107 2070335 2071771 2073065 2076035 2079511 2092717 2099785 2100659 2111317 -2114698 2116543 2117843 2120393 2121843 2125207 2126465 2132273 2132902 2137822 -2141737 2145913 2146145 2146981 2147073 2150477 2153437 2155657 2164389 2167055 -2167957 2170679 2172603 2172821 2176895 2181067 2183555 2188021 2189031 2192065 -2193763 2200429 2203791 2204534 2207161 2209339 2210351 2210935 2212873 2215457 -2215763 2216035 2219399 2221271 2224445 2234837 2237411 2238067 2241265 2242454 -2245857 2250895 2257333 2262957 2266627 2268177 2271773 2274393 2275229 2284997 -2285258 2289443 2293907 2294155 2301817 2302658 2304323 2311205 2313649 2316955 -2320381 2329187 2330038 2334145 2336191 2338919 2340503 2343314 2345057 2357381 -2359379 2362789 2363153 2363486 2367001 2368333 2368865 2372461 2377855 2379189 -2382961 2386241 2388701 2396009 2397106 2399567 2405347 2407479 2412235 2416193 -2419023 2422109 2424499 2424603 2425683 2428447 2429045 2442862 2444923 2445773 -2453433 2459303 2461462 2466827 2469901 2471045 2473211 2476441 2476745 2481997 -2482597 2486199 2494235 2497759 2501369 2501917 2505919 2513095 2519959 2532235 -2536079 2541845 2542903 2544971 2551594 2553439 2561065 2571233 2572619 2580565 -2580991 2581934 2582827 2583303 2585843 2589151 2591817 2592629 2598977 2600507 -2603209 2611037 2612233 2614447 2618629 2618998 2624369 2630257 2631218 2636953 -2640239 2641171 2644213 2644945 2647555 2648657 2655037 2657661 2667747 2673539 -2674463 2676395 2678741 2681195 2681869 2687919 2688907 2700451 2705329 2707063 -2707179 2709239 2710981 2711471 2714815 2718669 2732561 2733511 2737889 2738185 -2739369 2750321 2758535 2760953 2764177 2766049 2767787 2769487 2770563 2771431 -2778693 2785915 2791613 2792387 2798939 2804735 2816033 2820103 2827442 2830145 -2831323 2831647 2838085 2857921 2861062 2862579 2865317 2866105 2868767 2884637 -2886689 2887221 2893757 2893881 2898469 2902291 2904739 2906449 2915674 2922029 -2926703 2928291 2930885 2937874 2939699 2951069 2951897 2956115 2970327 2977051 -2986159 2988073 2991265 2997383 2997797 2998165 2999847 3004603 3005249 3007693 -3022345 3022438 3025541 3027973 3033815 3033877 3034205 3047653 3055019 3056977 -3066613 3068891 3078251 3082729 3085771 3087095 3090277 3093409 3093459 3095309 -3101527 3102449 3114223 3120469 3124979 3130231 3137771 3140486 3144905 3147331 -3151253 3154591 3159637 3160729 3168685 3170366 3172047 3192101 3197207 3199353 -3204935 3206269 3206733 3211817 3230882 3234199 3235687 3243737 3246473 3255482 -3267803 3268967 3271021 3275695 3276971 3286355 3292445 3295331 3299179 3306801 -3307837 3308987 3316411 3328039 3328997 3332849 3339611 3346109 3349085 3361795 -3363681 3372149 3374585 3377129 3377543 3377915 3379321 3381487 3387215 3390361 -3400663 3411067 3414433 3415997 3420835 3424361 3425965 3427391 3427887 3445403 -3453839 3453987 3457817 3459463 3467443 3479998 3487583 3487627 3491929 3494413 -3495057 3502969 3514971 3516263 3518333 3531359 3536405 3537193 3542851 3545129 -3545229 3558583 3569929 3578455 3585491 3595659 3604711 3607315 3607426 3610477 -3612791 3614693 3617141 3621005 3624179 3628411 3637933 3646313 3648385 3651583 -3655847 3660151 3662497 3664293 3665441 3672985 3683017 3692193 3693157 3702923 -3706577 3719573 3728153 3735407 3743095 3744653 3746953 3748322 3753673 3765157 -3771595 3779309 3779831 3780295 3789227 3790655 3800741 3809927 3816131 3817879 -3827227 3827391 3833459 3856214 3860173 3861949 3864619 3872901 3881273 3900281 -3915083 3926629 3928497 3929941 3933137 3946813 3946827 3962203 3965315 3973319 -3985267 3993743 3997418 4012465 4012547 4024823 4031261 4031705 4035239 4039951 -4040509 4041005 4042687 4042805 4050553 4055843 4081181 4086511 4089055 4090757 -4093379 4103239 4121741 4131833 4133261 4138561 4143665 4148947 4153546 4170751 -4172201 4180963 4187771 4197431 4219007 4221811 4231283 4241163 4247341 4247887 -4260113 4260883 4273102 4274803 4277489 4291593 4302397 4305505 4309279 4314311 -4319695 4321933 4325633 4352051 4358341 4373511 4375681 4392287 4395859 4402867 -4405999 4406811 4416787 4425499 4429435 4433549 4436159 4446245 4449731 4458389 -4459939 4467073 4479865 4486909 4502641 4509973 4511965 4531115 4533001 4533657 -4554737 4560743 4565615 4567277 4574953 4585973 4586959 4600897 4602578 4609423 -4617605 4617931 4619527 4621643 4631155 4632959 4672841 4678223 4688719 4706513 -4709861 4710729 4721393 4721519 4724419 4729081 4739311 4742101 4755549 4757297 -4767521 4770965 4775147 4777721 4780723 4789169 4793269 4796351 4803821 4812035 -4821877 4822543 4823135 4829513 4834531 4846323 4864057 4871087 4875277 4880485 -4883223 4884763 4890467 4893779 4903301 4930783 4936409 4940377 4950545 4950967 -4951969 4955143 4999745 5009837 5034679 5035589 5047141 5050241 5069407 5084651 -5097301 5100154 5107739 5135119 5142179 5143333 5155765 5161217 5178013 5211503 -5219997 5222587 5231281 5240333 5258773 5271649 5276851 5280233 5286745 5292413 -5296877 5306917 5316979 5321303 5323153 5332255 5343161 5343899 5344555 5357183 -5382871 5389969 5397691 5411139 5436299 5448839 5459441 5487317 5511335 5517163 -5528809 5538101 5551441 5570917 5579977 5590127 5592059 5606135 5617451 5621447 -5622483 5634343 5635211 5644387 5651522 5656597 5657407 5659927 5677243 5690267 -5699369 5713145 5724677 5748431 5756645 5761691 5768419 5783557 5784321 5787191 -5801131 5818879 5824621 5825095 5827289 5837009 5841557 5852327 5858285 5888069 -5891843 5896579 5897657 5898629 5908715 5920039 5964803 5972593 5975653 5992765 -5996127 5998331 6009133 6024007 6024083 6027707 6047573 6068777 6107155 6129013 -6153655 6159049 6166241 6170417 6182423 6201209 6224743 6226319 6229171 6230319 -6243787 6244423 6247789 6268121 6271811 6298177 6305431 6315517 6316751 6322079 -6343561 6378985 6387767 6391861 6409653 6412009 6424717 6439537 6447947 6454835 -6464647 6468037 6483617 6485011 6503453 6528799 6534047 6547495 6578045 6580783 -6583811 6585001 6591499 6595963 6608797 6649159 6658769 6674393 6675251 6679351 -6704017 6709469 6725897 6736849 6752389 6791609 6832679 6876857 6883643 6903867 -6918791 6930763 6958627 6971107 6979061 6982823 6999643 7005547 7039139 7048421 -7050857 7058519 7065853 7068605 7119281 7132231 7139269 7152655 7166363 7172191 -7206529 7218071 7229981 7243379 7289185 7292311 7296893 7344685 7358377 7359707 -7367987 7379021 7395949 7401443 7424087 7431413 7434817 7451873 7453021 7464397 -7465157 7482377 7517179 7525837 7534519 7537123 7556095 7563113 7620301 7624109 -7650231 7653043 7685899 7715869 7777289 7780091 7795229 7800127 7829729 7848589 -7851215 7858097 7867273 7872601 7877647 7887919 7888933 7903283 7925915 7936093 -7947563 7966211 7979183 7998403 8026447 8054141 8059303 8077205 8080567 8084707 -8115389 8138705 8155133 8155351 8176753 8201599 8234809 8238581 8258753 8272201 -8297509 8316649 8329847 8332831 8339441 8389871 8401553 8420933 8448337 8452891 -8477283 8480399 8516807 8544523 8550017 8553401 8560357 8609599 8615117 8642273 -8675071 8699995 8707621 8717789 8723693 8740667 8773921 8782579 8804429 8806759 -8827423 8869751 8890211 8894171 8907509 8909119 8930579 8992813 8995921 9001687 -9018565 9035849 9036769 9099743 9116063 9166493 9194653 9209263 9230371 9303983 -9309829 9370805 9379019 9389971 9411631 9414613 9472111 9478093 9485801 9503329 -9523541 9536099 9549761 9613007 9622493 9640535 9649489 9659011 9732047 9744757 -9781739 9806147 9828767 9855703 9872267 9896047 9926323 9965009 9968453 9993545 -10013717 10044353 10050791 10060709 10083499 10158731 10170301 10188541 -10193761 10204859 10232447 10275973 10282559 10309819 10314971 10316297 -10354117 10383865 10405103 10432409 10482433 10496123 10506613 10511293 -10553113 10578533 10586477 10610897 10631543 10652251 10657993 10682755 -10692677 10737067 10754551 10773529 10784723 10891199 10896779 10938133 -10991701 10999439 11096281 11137363 11173607 11194313 11231207 11233237 -11308087 11342683 11366807 11386889 11393027 11394187 11430103 11473481 -11473589 11484911 11506445 11516531 11528497 11529979 11560237 11630839 -11647649 11648281 11692487 11730961 11731109 11758021 11780899 11870599 -11950639 12005773 12007943 12023777 12041003 12124937 12166747 12178753 -12179993 12264871 12311417 12333497 12404509 12447641 12488149 12511291 -12540151 12568919 12595651 12625991 12664619 12689261 12713977 12726523 -12750385 12774821 12815209 12823423 12836077 12853003 12871417 12888227 -12901781 12999173 12999337 13018667 13055191 13119127 13184083 13306099 -13404989 13435741 13438339 13482071 13496749 13538041 13590803 13598129 -13642381 13707797 13739417 13745537 13759819 13791559 13863863 13895843 -13902787 13955549 13957343 13990963 14033767 14088461 14128805 14200637 -14223761 14329471 14332061 14365121 14404489 14466563 14471699 14537411 -14575951 14638717 14686963 14742701 14854177 14955857 14967277 15060079 -15068197 15117233 15145247 15231541 15247367 15320479 15340681 15355819 -15362659 15405791 15464257 15523091 15538409 15550931 15581189 15699857 -15735841 15745927 15759439 15878603 15881473 15999503 16036207 16109023 -16158307 16221281 16267463 16360919 16398659 16414841 16460893 16585361 -16593649 16623409 16656623 16782571 16831853 16895731 16976747 16999133 -17023487 17102917 17145467 17218237 17272673 17349337 17389357 17437013 -17529601 17546899 17596127 17598389 17769851 17850539 17905151 17974933 -18129667 18171487 18240449 18285733 18327913 18378373 18457339 18545843 -18588623 18596903 18738539 18809653 18812071 18951881 18999031 19060859 -19096181 19139989 19424693 19498411 19572593 19591907 19645847 19780327 -19805323 19840843 19870597 19918169 20089631 20262569 20309309 20375401 -20413159 20452727 20607379 20615771 20755039 20764327 20843129 20922427 -20943073 21000733 21001829 21160633 21209177 21240983 21303313 21688549 -21709951 21875251 21925711 21946439 21985799 22135361 22186421 22261483 -22365353 22450231 22453117 22619987 22772507 22844503 22998827 23207189 -23272297 23383889 23437829 23448269 23502061 23716519 24033257 24240143 -24319027 24364093 24528373 24584953 24783229 24877283 24880481 24971929 -24996571 25054231 25065391 25314179 25352141 25690723 25788221 25983217 -26169397 26280467 26480567 26694131 26782109 26795437 26860699 26948111 -26998049 27180089 27462497 27566719 27671597 27698903 27775163 27909803 -27974183 28050847 28092913 28306813 28713161 28998521 29343331 29579983 -29692241 29834617 29903437 29916757 30118477 30259007 30663121 30693379 -30927079 30998419 31083371 31860737 31965743 32515583 32777819 32902213 -33059981 33136241 33151001 33388541 33530251 33785551 33978053 34170277 -34270547 34758037 35305141 35421499 35609059 35691199 36115589 36321367 -36459209 36634033 36734893 36998113 37155143 37438043 37864361 37975471 -38152661 39121913 39458687 39549707 40019977 40594469 40783879 40997909 -41485399 42277273 42599173 43105703 43351309 43724491 43825351 44346461 -45192947 45537047 45970307 46847789 47204489 47765779 48037937 48451463 -48677533 49140673 50078671 50459971 52307677 52929647 53689459 53939969 -54350669 55915103 57962561 58098991 58651771 59771317 60226417 61959979 -64379963 64992503 66233081 66737381 71339959 73952233 76840601 79052387 -81947069 85147693 87598591 94352849 104553157 } +! This is a lookup table for the perfect hash adjustment values. +CONSTANT: adjustments-table +{ 0 5628 7017 1298 2918 2442 8070 6383 6383 7425 2442 5628 8044 7425 3155 6383 +2918 7452 1533 6849 5586 7452 7452 1533 2209 6029 2794 3509 7992 7733 7452 131 +6029 4491 1814 7452 6110 3155 7077 6675 532 1334 7555 5325 3056 1403 1403 3969 +4491 1403 7592 522 8070 1403 0 1905 3584 2918 922 3304 6675 0 7622 7017 3210 +2139 1403 5225 0 3969 7992 5743 5499 5499 5345 7452 522 305 3056 7017 7017 2139 +1338 3056 7452 1403 6799 3204 3290 4099 1814 2191 4099 5743 1570 1334 7363 1905 +0 6799 4400 1480 6029 1905 0 7525 2028 2794 131 7646 3155 4986 1858 2442 7992 +1607 3584 4986 706 6029 5345 7622 6322 5196 1905 6847 218 1785 0 4099 2981 6849 +4751 3950 7733 3056 5499 4055 6849 1533 131 5196 2918 3879 5325 2794 6029 0 0 +322 7452 6178 2918 2320 6675 3056 6675 1533 6029 1428 2280 2171 6788 7452 3325 +107 4262 311 5562 7857 6110 2139 4942 4600 1905 0 3083 5345 7452 6675 0 6112 +4099 7017 1338 6799 2918 1232 3584 522 6029 5325 1403 6759 6849 508 6675 2987 +7745 6870 896 7452 1232 4400 12 2981 3850 4491 6849 0 6675 747 4491 7525 6675 +7452 7992 6921 7323 6849 3056 1199 2139 6029 6029 190 4351 7891 4400 7134 1533 +1194 3950 6675 5345 6383 7622 131 1905 2883 6383 1533 5345 2794 4303 1403 0 +1338 2794 992 4871 6383 4099 2794 3889 6184 3304 1905 6383 3950 3056 522 1810 +3975 7622 7452 522 6799 5866 7084 7622 6528 2798 7452 1810 7907 642 5345 1905 +6849 6675 7745 2918 4751 3229 2139 6029 5207 6601 2139 7452 5890 1428 5628 7622 +2139 3146 2400 578 941 7672 1814 3210 1533 4491 12 2918 1900 7425 2794 2987 +3465 1377 3822 3969 3210 859 5499 6878 1377 3056 4027 8065 8065 5207 4400 4303 +3210 3210 0 6675 357 5628 5512 1905 3452 1403 7646 859 6788 3210 2139 378 5663 +7733 870 0 4491 4813 2110 578 2139 3056 4099 1905 1298 4672 2191 3950 5499 3969 +4974 6323 6029 7414 6383 0 4974 3210 795 4099 131 5345 5345 6576 1810 1621 4400 +2918 1905 2442 2679 6322 7452 2110 1403 6383 2653 5132 6856 7841 2794 6110 2028 +6675 7425 6999 7441 6029 183 6675 4400 859 1403 2794 5985 5345 1533 322 4400 +1227 5890 4474 4491 3574 8166 6849 7086 5345 5345 5459 3584 6675 3969 7579 8044 +2295 2577 1480 5743 3304 5499 330 4303 6863 3822 4600 4751 5628 3822 2918 6675 +2400 6663 1403 6849 6029 3145 6110 3210 747 3229 3056 2918 7733 330 4055 7322 +5628 2987 3056 1905 2903 669 5325 2845 4099 5225 6283 4099 5000 642 4055 5345 +8034 2918 1041 5769 7051 1538 2918 3366 608 4303 3921 0 2918 1905 218 6687 5963 +859 3083 2987 896 5056 1905 2918 4415 7966 7646 2883 5628 7017 8029 6528 4474 +6322 5562 6669 4610 7006 } -! This is a lookup table for the final hand values of all hands not covered in -! the flushes and unique5 tables above. +! This is a lookup table for the perfect hash final hand values. CONSTANT: values-table -{ 166 322 165 310 164 2467 154 2466 163 3325 321 162 3324 2464 2401 161 2465 -3314 160 2461 159 2400 320 3323 153 2457 6185 2463 3303 2452 158 3322 157 298 -2460 2446 152 3292 156 2398 3321 2462 5965 155 6184 309 2456 3320 2439 3313 -2395 2459 2431 2335 2451 6181 3319 3281 2422 151 2391 2445 6183 2399 2455 319 -3291 2412 5964 6175 2386 3318 5745 150 2450 6180 3312 3317 297 6165 2458 2438 -5961 2430 2380 142 2444 3311 308 3316 318 286 149 6150 5963 6174 3259 5525 3315 -2421 2397 2454 5955 148 6182 2373 3302 6164 2437 5960 2411 5744 2449 2365 3310 -5945 6178 2429 6129 2334 2394 2453 6179 6101 147 141 3309 6149 5741 2448 2356 -2443 3215 2269 5930 2420 2396 5954 3290 3248 3280 2346 6065 6172 2390 2410 3308 -317 146 6173 2442 5944 3258 6128 3270 2393 6020 3301 6162 145 3289 5735 2436 -2385 5958 2447 6100 5909 2333 6169 6163 2428 2332 5881 5725 6177 316 5929 3307 -3300 6159 144 2435 6147 3204 285 3306 2379 6064 2441 2389 6148 2427 5524 2329 -2419 307 143 5845 3288 5952 3214 3257 2268 6019 5710 5962 3160 2440 6144 2384 -2409 5305 5908 3269 5800 3305 3287 6171 5942 5521 3299 6126 2418 5743 2392 6155 -5880 2372 2434 5949 6176 6127 6098 5959 3304 2331 6161 2364 2426 315 2325 2408 -3298 3094 6099 2378 5689 140 2433 6168 5939 3286 6123 5740 5927 306 5661 5844 -6140 2425 3213 2320 130 6095 3279 2328 6062 6158 2355 5515 2417 2388 6146 5085 -5304 2267 5799 3297 6063 3149 6170 6135 274 2432 5953 5924 5523 6017 3247 2371 -2345 5625 2407 5505 2416 2383 3285 2424 3278 6018 5906 2314 6059 5742 3159 5935 -6160 2363 6119 5734 2387 6143 5943 3237 3284 296 5878 5580 6167 2406 3256 6091 -3017 5520 2324 6125 6014 5957 6154 3083 3296 6114 5724 2382 314 5490 5903 2415 -6097 5739 2377 139 6157 3295 2354 5920 6086 6145 5084 2319 5738 2423 129 3093 -5928 2307 3283 5875 5842 3212 3277 6122 2405 2266 6055 3203 3246 313 2344 2299 -305 6139 5915 2203 6108 3282 5709 6094 2376 5522 3158 5797 138 6061 3255 3294 -5514 6010 6142 3276 5951 6050 3193 5303 5469 6080 284 2414 2370 2313 5839 4865 -2381 6134 262 5899 2263 5733 6124 5956 6016 6153 3236 5441 5907 2413 3254 2362 -3293 2290 5504 6005 5732 5941 5301 5871 2404 3006 6096 5519 5794 6058 2330 6166 -304 5879 6118 5894 5948 5723 2929 3092 3275 5688 2403 2369 6044 2280 5722 6090 -6121 2375 3016 5866 137 3202 6013 5737 6073 4645 5660 6156 2306 5405 2361 6138 -312 2353 6113 5729 5938 3253 5081 5489 6093 5999 2265 5835 2327 5926 6060 3211 -2830 2298 5843 2259 6085 5950 2374 5083 3226 136 273 128 5888 5360 5708 2402 -4864 2343 6133 5295 5719 5513 5790 6054 6015 5707 5830 3192 5302 3157 3274 5860 -3210 6037 5798 5624 2352 3148 2254 6141 5940 2137 2202 2368 6107 2262 311 5923 -6057 3268 3273 6029 5285 6117 2289 5947 6009 5503 5518 5785 5731 3252 6049 3245 -5468 6152 2360 6079 5992 303 5579 5905 135 2342 3138 5934 6089 3015 2323 2367 -6012 5704 3251 3156 295 2918 4644 5440 5687 5984 5824 5877 2279 6112 3209 5937 -6004 5721 5300 2248 4425 3091 2359 3267 5925 5686 5715 5853 3082 5659 3272 2720 -6084 3182 5728 6120 2318 5270 3201 6151 2928 5488 5902 5779 2351 6043 5658 6137 -5075 2819 2258 5919 6053 6092 5082 3225 2326 3250 6072 2366 3072 3271 134 5404 -5874 5975 3147 5841 5512 3244 5718 5080 2200 6106 3090 2341 5922 5683 5998 2264 -5706 2350 4861 2829 6132 2358 5065 5817 133 5623 6008 5700 2253 3208 250 5914 -6048 261 3249 2241 6078 2201 5359 5904 2312 5655 2599 4863 5796 6136 5933 5622 -5502 5294 5809 3243 3266 3207 5517 2340 5249 294 6056 3235 2233 5467 5772 6036 -5876 5578 5838 5509 3137 6116 6003 5695 5946 3155 2136 5298 5898 4424 2261 5703 -5221 4855 5577 302 6131 3081 5439 5764 6028 2349 5284 132 6088 3265 3014 5050 -2322 6011 2927 5299 2247 5870 5901 5991 3005 4641 6042 5685 5793 5619 5499 5714 -6111 2357 5936 3089 5918 2709 5679 5487 5893 3181 3206 5736 3242 6071 4205 4643 -2305 2224 5873 5983 2339 5657 131 6115 5840 3200 6083 301 5078 2317 5651 5997 -127 2995 5865 3154 5574 5185 2828 3071 2297 5403 5755 2719 6087 238 5511 3013 -5913 5674 2321 6052 3205 5269 5079 2199 2214 4635 3264 5682 5834 3127 5795 3146 -6110 5074 5292 3985 3199 2348 2257 118 5484 5699 6105 5029 5646 2071 3191 5921 -3224 6130 5140 2240 5887 6035 5358 5654 2588 5837 5974 4862 5621 6082 6007 5501 -2134 5293 2316 6047 2347 5897 126 5466 5789 6077 5001 5615 3241 2311 5829 5495 -4860 2232 5932 5859 2338 5064 6027 5282 2288 5508 2252 6051 5730 5694 4845 2135 -5297 5869 3088 272 5990 3004 5668 5438 3153 5792 2598 3240 3145 5576 6002 2337 -5283 2197 6104 5892 5570 4421 3198 5516 5784 5248 5610 4204 3061 3263 5982 5640 -3080 3152 2278 3012 5618 293 6006 5498 6046 5720 4625 5463 300 5678 2926 4423 -6076 5864 5486 5900 2310 6041 6109 5220 4965 4854 5931 2917 4642 3262 2223 5823 -5480 2718 5727 5917 5049 5565 5267 5077 3234 2246 5435 5650 6070 5833 2994 4640 -2304 4830 5402 5872 5573 6081 3011 5072 3239 3984 2315 5852 6001 125 3171 2336 -3765 2005 4415 5673 3180 5996 283 4920 5268 3087 5886 2907 2213 3079 2827 5778 -5973 3126 5604 2296 3151 5475 5073 5291 5717 2818 5912 2925 5788 117 5483 3197 -5645 5357 249 6040 5705 5828 4858 3238 3086 5184 5858 5633 5062 292 2193 3261 -6103 299 124 5916 5510 2133 3190 2198 6069 5465 4634 2597 2303 5399 5559 3196 -5614 6034 3150 5494 5836 4859 6045 2808 5063 5281 5816 5459 2131 6075 226 5896 -2309 5028 5995 2260 5783 5246 2070 3144 5139 2239 4610 2826 5667 5437 3260 4809 -2295 3545 6026 3136 2188 6102 2287 5911 5500 3233 5808 5431 2984 2196 5868 5354 -5569 5989 5702 3003 5000 5218 4852 5247 5609 5791 6000 2916 3060 2231 3085 5639 -5289 5771 5822 5597 4781 4405 5454 5507 6074 5047 5891 2308 4844 260 5296 123 -3078 5462 4201 4422 4638 6033 5684 5981 5219 3195 4853 2277 5713 5851 106 2924 -5763 5589 3232 5479 3764 5895 5426 6039 282 4420 5048 5863 5564 5266 4203 3084 -5434 5777 5552 4639 6025 5656 5279 3143 5401 2286 2717 4390 5071 5497 2817 5726 -6068 2182 3170 3010 4624 2708 2302 5395 5867 237 5988 3002 5485 5832 3194 4964 -5182 4589 2906 3070 5069 3981 2222 5544 5603 2923 5994 2256 4745 5474 5890 6038 -5076 271 2825 5448 3009 4195 4632 2294 5681 5885 5980 291 5356 4829 2276 5972 -4857 5910 4561 5183 3983 5632 5061 5815 2192 5716 5754 5350 6067 5698 2698 2004 -5026 4414 2068 2301 5390 5862 5787 4919 5137 3231 5827 122 5420 3116 2212 4633 -5653 5857 3544 5059 5398 5558 3125 4700 2716 5620 5993 2251 3189 5290 2807 5807 -5264 5458 2130 6032 1939 2824 116 5482 4998 5027 5831 2293 5245 2069 2596 5138 -121 2127 3077 5770 3975 3142 2587 2255 5535 2187 5345 5693 4842 2132 3223 5782 -2175 2922 5430 2983 6024 5884 5464 5275 3008 5353 4999 2285 5217 5971 4851 5575 -5493 3135 5762 4525 5288 3188 5280 5596 3141 5987 3001 5453 4418 6031 5786 5046 -5701 5826 4843 2896 2167 4849 6066 4609 2915 2300 4637 5384 5856 2122 5436 4808 -2577 5617 5821 5889 2250 5044 105 4185 4622 5588 2707 5677 5979 2195 5425 3007 -2245 2275 6023 4419 3050 2595 4962 3230 2284 5413 4202 2823 3059 4480 5712 120 -5850 2292 5551 4780 5278 4404 5861 3761 5986 3000 3179 5781 5243 2181 4369 4623 -5649 5461 5339 5394 4200 2993 4827 2715 5572 5776 3229 4963 3134 5181 2797 3076 -5260 5068 2816 5543 5753 5478 3763 4170 2002 3140 4412 5672 5978 4917 3187 2274 -5265 5215 214 3105 3965 5447 4341 2914 119 2158 4631 6030 5433 281 3069 5820 -4828 5400 4389 5070 3075 3222 3982 2116 5883 3169 5349 115 2244 2697 2003 5025 -5644 4413 5970 2067 4629 5389 5680 4918 2714 5136 2921 4588 5419 3115 5711 290 -5377 5849 6022 3980 5255 2586 5058 5814 2283 3139 3755 4744 5473 5697 5825 259 -5023 2065 5263 5855 2148 5055 4194 5985 2238 225 3950 4997 5613 5775 5355 2249 -5652 3541 4856 2822 4560 3228 2126 2291 5060 5369 2815 3221 2191 5806 5534 5882 -2594 5344 4995 5969 4841 2174 4149 4607 5179 5332 5666 5977 2230 5274 3068 4806 -4305 3543 5769 5397 2273 4699 5506 202 5780 5239 289 5692 3074 5457 4839 2129 -2194 1938 5854 5568 3039 4417 3186 5244 248 5608 2895 2166 280 4848 3227 2920 -4608 5324 5638 3974 5383 2121 4778 5813 4807 5761 4402 2713 2576 2186 5696 2109 -5211 2061 2593 2973 5043 2913 4621 5134 5429 2237 4198 2982 4260 5819 5352 3185 -3049 3535 5216 4961 4850 5412 5040 5616 3929 6021 5496 3073 5234 4524 5287 2243 -2282 2687 5805 4779 4403 5452 4619 2706 5676 5045 2101 5563 3220 5242 3133 5848 -4959 2919 2999 2229 5338 4199 4636 5768 5968 4826 2221 3745 4387 3178 2796 5259 -5691 2821 5206 4835 104 4184 3168 2281 3762 2912 2001 5774 5424 4411 5648 2992 -4916 5818 4824 5214 1873 3104 4586 5571 2814 2905 5976 2998 5035 2157 3978 4479 -2272 5315 5760 5602 5277 4742 2242 5752 3760 4388 1999 4409 5671 2115 5175 4914 -4192 2180 4368 3067 5847 5393 2592 2211 4628 3124 3730 3184 4121 4558 5180 4587 -5631 3177 2820 5376 5067 2190 3979 5254 2712 2271 4615 4169 2705 5675 4743 5481 -5773 5228 5022 5643 2064 2092 3964 5446 2147 5054 4340 4193 5812 4630 2813 2566 -2220 5557 4697 3132 2585 5019 94 3901 4559 2806 5368 5130 2236 2128 2711 5170 -1936 5348 288 5647 3525 236 5024 2991 3219 2066 5388 5200 4820 4994 5612 3183 -5135 2911 5492 4606 5178 5418 5331 3114 3972 5804 5967 4805 2997 3542 5057 2185 -5751 4698 3754 4991 1995 1807 2962 5238 5670 2082 2228 5262 4838 279 5767 1937 -3949 4604 2210 3038 4996 5665 5811 3218 3123 4803 3540 5690 5846 5014 2056 4085 -2125 5323 4522 5286 3973 5595 5966 4777 5125 4401 3709 2235 2270 114 3176 5343 -2108 5210 5642 2060 3510 5567 2972 4840 2173 5607 4148 5133 4197 5759 3058 2591 -2996 5273 4304 5637 5803 2584 4775 4399 5039 2812 4986 103 5233 4182 4523 5587 -2686 2227 4618 190 5460 5766 2885 4416 2100 5611 5491 5164 2894 2165 4958 4847 -4040 4477 3066 5550 2590 5382 3028 2120 5276 2704 3131 287 5477 3758 4386 4955 -3865 5042 5205 4834 5562 2179 4183 4366 4620 2219 4600 5664 4259 5432 5758 5193 -4799 3048 3534 4960 4823 3217 213 4585 5411 3928 4384 5066 5034 3977 4478 5810 -5542 5314 4167 3130 2710 4741 2990 270 5008 3759 2050 1998 5566 4408 5241 5119 -5174 5606 4913 3962 2234 4338 4191 3057 4367 4583 5337 2904 5636 3489 5750 2786 -4825 3744 4771 1990 4395 5601 2703 5669 2910 4557 4739 2795 5472 4910 3820 5258 -5802 4950 3681 2209 4614 2696 4168 2000 3175 4189 4410 247 4980 2218 5227 4915 -3216 5213 2091 1872 3103 2226 3113 3963 4339 5765 4555 2156 2565 5630 5056 2589 -4696 113 5476 3752 5018 5641 93 2811 2989 4815 2114 5129 5561 5261 3645 5169 -1935 3947 3174 2583 4627 5199 3538 4819 5396 5556 5749 5157 3729 82 4694 4120 -4380 2124 3065 3971 5375 5757 4905 2805 5253 5533 5456 258 3753 4990 2208 3129 -1994 1933 201 2961 3122 5021 2172 2063 2081 4146 4579 2146 5053 2903 5272 3948 -4603 4302 3969 178 4802 5600 3539 5149 4735 112 5471 3900 5013 3064 2055 2909 -4521 5367 4595 5124 2702 5663 5428 2874 2043 2981 3524 5351 2582 4944 5112 4993 -278 2164 4846 4147 4605 4551 5177 5330 2217 5629 2119 3461 4804 4303 4519 2189 -2575 5594 4774 3128 4398 5451 1806 5237 4985 5605 5041 5801 4181 3056 4837 5635 -4257 4973 1741 224 2035 3037 2884 2951 3047 3532 3173 5555 5104 4690 2225 5163 -3926 2908 4476 4084 5322 2804 3425 3027 4776 5748 5455 102 4179 4400 3708 5586 -1984 3757 1929 5662 5423 4794 2107 4899 5209 4954 5240 2059 3509 2810 2971 4365 -5132 2207 4196 4599 2775 4258 4474 3121 3742 5192 4798 5549 3533 2184 277 5038 -5560 5257 2676 3927 4383 5756 5232 3063 2685 4166 5427 235 111 3600 2980 4363 -4617 5007 5634 2049 5392 3172 4766 2099 5212 1870 4375 3102 5118 3961 4957 4337 -2155 4039 4582 4515 3167 2581 5593 2785 3743 4770 5541 1989 4394 5450 4164 4385 -4738 4909 2113 2809 3864 4574 5204 4949 4833 2701 2902 3959 5445 4335 4188 4626 -4979 5599 4937 2026 5470 3727 4118 4822 1871 4584 5095 2216 5033 4554 3976 3062 -5252 5313 4175 5585 3380 3751 4740 5422 5347 2695 1997 5020 4407 2062 4814 5387 -4546 5173 4912 2940 2700 2145 5628 5052 4190 3946 2988 5417 269 4470 4788 5548 -3488 4929 3537 3166 5156 3728 3898 81 4693 4119 3749 4556 4379 2215 3819 4904 -5747 3680 1977 2178 4359 4613 2901 3522 5391 5554 1932 3944 4892 2016 4992 5226 -5598 4145 4730 2090 2555 3055 5176 2206 4578 2803 2987 3120 2123 4301 2564 4760 -3968 5540 1675 1924 4695 4160 5148 5017 4734 1804 5532 5236 92 3899 5342 5128 -4836 5746 4594 3644 110 3955 5444 1969 5168 4143 1934 4331 2873 5627 3036 2042 -3523 4884 2183 4299 5198 4943 5111 4818 4082 2205 4550 3970 2580 3119 2979 4518 -3706 5346 2694 4989 1993 2106 5208 1805 2960 2058 3507 5386 5553 2970 4685 2080 -5131 2893 109 4510 5416 3112 4256 4972 189 5592 2802 4602 2034 2950 5381 3531 -5449 2118 4801 5103 4689 2574 1918 5037 2665 3925 5012 5231 2054 4083 4520 2579 -276 3165 5123 4178 3707 4616 1983 1928 3940 2098 4254 4793 4898 3508 268 3529 -4956 4568 4037 2900 5410 101 2863 3923 2774 5584 3460 4473 3741 2986 5421 4724 -2978 4773 5531 4397 5341 2675 4984 3862 5203 4832 4180 2171 4139 4465 2699 5547 -4362 1740 1960 5271 5336 2883 4295 5591 4765 4821 3739 1869 4374 4875 3054 4540 -5162 5626 5032 4038 2794 4475 4753 2204 2177 4514 3424 4354 3026 3118 3756 4163 -1996 4406 4953 5172 3863 4911 4573 2892 2163 1867 4364 3101 3958 4598 5539 4334 -3486 108 5380 2985 100 4155 5191 4936 4797 5583 4679 2025 3726 2573 4117 3053 -5094 3817 2801 4382 2764 5443 3678 2112 4326 4174 4612 4165 70 2578 3599 1950 -5006 4250 5546 5225 2048 3046 2544 2089 5117 4545 3960 3724 5409 2939 4115 4336 -3919 4581 275 4469 4787 5374 3487 3117 2784 4928 2176 2693 4769 4348 1988 5016 -4393 91 3897 5385 3748 4737 4908 5127 3818 3164 5415 4948 3642 246 5167 3679 -223 1976 4358 3521 107 5051 5335 4187 4978 3943 4891 5538 5197 2015 4817 3735 -2852 4729 212 2554 2793 3895 4504 5256 4553 5590 4759 5366 4717 177 1923 3935 -5442 3379 3750 4320 4159 4988 1992 1803 2959 3519 2079 4813 3163 1863 257 3643 -3954 1968 4142 3945 4601 4330 2154 5329 4883 5530 4800 4298 3536 5340 4533 5155 -2692 80 4692 2899 5011 4378 2053 4081 3052 1801 2170 99 4134 4903 5582 5122 -3705 4709 5414 3111 4290 1931 3506 3035 4684 3720 4144 4111 4577 4459 4509 3458 -5373 5545 4079 4300 5321 3967 4672 5251 1674 4772 4396 3703 1917 2753 5147 2664 -4733 2800 4983 2891 2105 2162 2057 3504 267 1911 4593 5379 1738 2144 2117 2872 -3939 2882 2041 2572 4253 4942 5110 5529 5161 3528 4567 4036 3891 3051 5036 4549 -2862 3922 3422 3025 5365 5537 3459 2169 4517 4664 4128 4245 4723 2684 3045 3515 -4284 4952 200 3861 5408 2097 3914 2977 1903 4138 4464 4597 3162 5328 4034 4255 -4971 1739 1959 5190 2033 4796 4294 2949 3530 3738 5102 4874 4688 4539 3924 4381 -1797 4497 5235 2898 4752 3423 3859 4353 2890 2161 4831 5334 3597 4177 2691 1982 -5005 1927 2047 2654 5378 256 4792 4897 2571 5116 2792 2976 3110 1866 4580 4075 -5320 3485 2773 5031 2783 4472 3740 4154 4768 1987 4678 5312 4392 3699 4736 4239 -4907 3816 4489 2674 98 5207 1858 234 245 3500 5581 4947 2969 2763 3677 4325 -5407 2153 3161 69 3908 4186 3598 4977 1949 4361 4249 3483 4764 2543 1868 4373 -3723 4452 2111 4114 4552 3918 2897 5230 3814 4513 3377 2683 5528 3675 4347 4655 -4611 5333 4162 4812 3715 97 4106 2168 2799 2841 4572 3641 5372 2088 2791 4030 -3957 5250 1894 4333 2563 4935 3734 5154 2024 3725 2851 79 4691 4116 4377 5015 -4444 5093 90 3894 5536 4902 4503 3855 5202 1852 2143 3100 4173 4716 3934 3378 -3639 4319 2152 1930 3518 3886 2889 2160 4816 4313 1862 4544 4576 2938 5364 2975 -2110 3966 4468 4786 1672 5311 2570 4927 5146 2533 4732 4532 3896 3747 4987 1991 -1800 2958 2798 4133 4592 2643 5171 5327 4100 2078 2690 4708 1975 2871 4357 2040 -1884 4289 5371 3520 3942 3044 4890 3479 4941 5109 2014 1792 5406 3109 3719 4728 -2742 4110 2553 4548 4458 3457 5010 3810 2052 4078 4516 4758 4671 3671 1673 1922 -2142 3034 4158 3702 2752 1802 5224 3503 96 4070 1910 5319 3880 2689 3953 2974 -1967 4970 1737 4141 4329 2032 5363 2948 3694 2562 3455 4882 4297 5101 4687 2790 -2104 3108 89 3495 3890 2968 4080 3421 4982 4435 5126 5527 4176 4663 3704 4127 -3635 1981 5166 4244 5326 1926 1735 3514 4791 4896 4283 3505 266 5196 1845 3099 -4683 3913 1902 1786 2151 5229 4277 4508 2772 4033 4471 2682 3419 3024 1916 2663 -2096 233 2673 1796 4496 255 4951 95 4025 3858 5526 3596 4360 4064 5318 3938 -2653 4596 4763 4252 211 4372 3688 2159 4795 4093 3527 4566 4035 3850 5370 2103 -5201 2051 4269 4074 2522 2861 4512 3921 2967 2569 5121 3698 4722 4161 3594 4238 -5004 4488 2046 1857 3860 3499 4571 2141 5030 4137 3956 4232 4463 3907 4332 5310 -188 3043 3451 1958 4934 4293 2023 2681 3482 2888 265 3737 4767 4873 3873 1986 -5092 4391 4538 4451 5362 3107 2095 4906 4751 3813 4172 2568 4352 3376 4946 3674 -4019 3474 4654 1731 2881 4976 3714 4105 4543 2840 2937 5160 3805 5325 1865 4224 -4029 4467 4785 3666 1893 3844 3484 3042 3415 3023 4926 4153 4677 2789 3374 3746 -1779 5223 4443 3815 2087 3854 2762 4811 3676 1851 1974 4324 4356 68 2561 3638 -3033 2688 3941 1948 4889 4248 2013 5309 5189 58 3098 2542 3885 4727 2552 4312 -2150 3722 4057 5317 78 3106 4113 3917 4376 4757 3630 5165 1671 1921 4901 2632 -4157 4346 2532 3590 199 2102 5195 2045 3468 222 2642 5115 3640 4099 3952 1966 -4140 4328 1883 4575 3799 4881 4296 3478 3660 2782 1837 3733 3097 1985 1669 2850 -1791 2957 2887 2741 2149 4731 2077 3893 5222 4502 3809 2680 2086 3670 4715 3933 -4591 2567 4318 2870 2560 2094 2039 3517 4682 4940 2140 5009 1861 4012 88 4069 -3879 4507 4547 5120 4215 3693 3454 3624 3041 2731 3370 1915 2662 4531 3494 5361 -3837 1799 5194 4810 4434 4132 3634 4707 3446 3937 4288 4251 4969 1734 2031 2947 -3526 1844 4565 5153 2886 3718 2139 4981 77 4686 4109 1785 2956 2860 3920 4457 -4276 3456 5308 4077 2076 4670 3418 4721 1726 176 1771 2880 3701 2751 1980 1925 -2788 5159 4790 4895 3502 4024 4136 4462 1909 3032 3410 1736 244 4063 1957 2511 -4292 2771 3040 1665 3736 4872 3687 4092 4537 5145 1828 5316 3096 3889 3792 3849 -4750 4268 2521 264 3420 4351 3653 4590 4662 4126 4243 46 254 5188 2038 3593 -3440 2966 3513 4282 2085 5108 4762 1864 3912 4371 1901 4231 3031 2559 4032 3450 -4152 4676 3585 4511 5003 87 3872 1720 4049 2787 2879 1795 4495 5114 2761 2679 -4323 3617 3857 5158 4570 67 3595 4018 1947 3473 4247 2093 1730 2781 2652 2030 -3404 232 2965 2946 2541 4933 5100 2022 1818 3095 3721 4112 3804 3916 4223 2138 -4945 4073 3665 3843 3414 4345 4171 3697 4975 1979 3373 1778 221 4237 3829 5187 -4789 4487 2075 1856 3498 2678 4542 3906 2936 253 3365 4466 3732 4784 57 2849 -3481 4925 3579 4004 5002 3892 4450 2044 4056 4501 2672 5307 3629 3812 5113 4714 -2631 3932 3375 4317 3673 1973 3589 4653 4355 3516 3467 1762 5152 2780 4888 3713 -4761 76 2012 4104 1860 4370 2839 4726 263 4900 4028 3433 3798 1892 3030 3659 -4756 1836 4530 1668 1920 4156 3784 4974 1798 4442 4131 2621 5306 3853 4569 1850 -4706 4287 1713 3637 3951 1965 2878 1660 4327 2084 5144 4880 2021 3359 3717 2964 -3884 4108 4311 4011 4456 5091 2558 4076 3397 3022 4669 4214 1670 2869 3623 86 -3700 2730 3369 2750 2531 1752 4939 5107 3836 3501 3609 5151 1908 2641 4541 4681 -4098 187 2935 3445 1882 4506 3029 5186 4783 3477 2083 1790 3888 2740 1914 2661 -3995 2557 3808 4661 4125 3669 4242 3572 4968 1725 1972 85 1770 2955 243 3512 -4281 3936 2074 5099 2011 1654 2963 3911 2610 5143 1900 4725 2551 4068 3878 4564 -4031 3409 2510 2859 2779 3692 4755 3453 1978 1664 1919 2868 4720 2037 1827 4894 -1794 4494 3493 3791 4938 5106 3856 4433 3652 2677 3633 2770 1964 4135 4461 2651 -45 2954 3439 1733 1956 2073 4291 1843 2671 4871 2500 1784 4536 4072 4275 4749 -3352 3584 3696 3417 4350 4236 4967 1719 2029 4048 4486 1855 2945 3497 3775 5098 -4680 3616 4023 1705 3905 210 4505 4062 3403 3480 5150 4151 3686 75 4675 4091 -1817 4449 1913 252 3848 3389 3021 4893 4267 3811 2520 2556 2760 3672 4322 4652 -66 4932 2769 3592 84 1946 3828 3712 4246 4103 2838 5090 2540 4563 4027 1696 -4230 2670 1891 2877 2858 3915 3449 1647 3364 5142 4719 3578 3871 4344 4003 4441 -2489 3020 3852 1849 2934 3564 3636 2867 4460 4017 2036 3472 1729 4924 1955 1761 -2953 5105 3883 3731 4310 2072 2848 4535 3803 4222 3432 2778 3664 175 4748 3842 -4500 1971 3413 4349 2530 4713 3931 4887 3372 83 1777 4316 3783 4931 2020 2620 -2550 2640 4097 3555 5089 1859 1881 4966 1712 2028 1659 220 3476 4150 56 5097 -4674 1789 3358 2739 4529 4055 3807 3396 198 3628 3344 2759 3668 1963 4130 2630 -4321 231 65 4705 3588 4879 1945 4286 4782 1751 2952 3466 4923 3608 251 4067 -3877 3716 4107 2768 3797 4455 3691 34 3452 2876 3658 74 4668 1835 4343 1667 -3492 2669 2749 4886 2010 3994 4432 3335 3019 3632 2549 3571 1907 1732 4754 1842 -1653 1912 2660 2847 2609 1783 4010 4274 3887 4499 1639 4213 3416 5141 4712 3622 -3930 73 4660 2729 4124 3368 4315 4241 4878 3511 3835 4280 4562 4022 209 242 -3910 4061 3444 1899 1686 4930 2875 2019 3685 4090 4528 5088 3847 2499 4266 2519 -1793 4493 1630 4129 3018 3351 2777 1724 4704 1954 1769 3591 4285 2650 4870 3774 -4534 219 2659 4229 2866 1704 2027 4454 3408 2944 3448 2509 4071 4922 5096 4667 -1663 3870 3695 2748 1826 3790 4235 3388 4485 1854 3651 3496 1970 4016 1906 3471 -2478 1728 44 2857 3904 4885 3438 2009 4718 2548 3802 4221 2767 1695 241 4448 -3663 3841 2943 3412 1646 64 2776 3583 4659 4123 1944 3371 4240 1776 2668 1718 -72 4651 4047 2539 4279 2488 3711 4869 4102 3615 3563 3909 1962 2837 1898 4026 -4747 4877 3402 55 1890 4342 1816 4054 197 4492 4440 3627 2629 3851 1848 1620 -3587 2667 3465 2649 3827 2846 4673 3882 3554 4498 4309 3796 2865 2018 2758 3657 -3363 1834 4314 1666 63 2658 5087 3577 71 2529 4002 4234 4484 1853 2538 3343 -2639 4096 3903 1880 1760 4527 3475 2933 4009 1788 4447 2856 2738 3431 4212 4921 -33 3806 2017 3621 22 2942 2728 3367 3667 5086 4650 3782 3834 3710 2619 4101 230 -2836 3334 4453 3443 4066 3876 1711 2864 1953 2008 1889 1658 3690 4711 4868 2747 -2547 3357 2932 4439 3491 4746 3395 1638 1905 2766 4431 1847 1723 1768 3631 1750 -186 3607 3881 1961 1841 4308 3407 2508 1782 4876 1685 4273 2007 4122 2941 1662 -4703 2546 2528 1825 4278 3789 3993 2757 3650 1629 1897 2638 4095 4021 3570 43 -1943 3437 1879 4060 4666 2537 1652 2608 3684 1787 4491 229 4089 2737 3846 2765 -4265 2518 3582 1904 2657 240 1717 4046 2666 3614 4065 3875 2477 4228 3401 3689 -3447 4658 2845 1815 4233 4483 208 3869 3490 2931 2498 4430 4710 3902 3350 1896 -2656 4015 3826 3470 1727 3773 1840 4446 1703 1781 1952 3801 4272 4220 3362 3662 -3840 4867 3411 2006 4526 3576 4001 2648 2545 2855 1775 3387 2835 4020 4702 1619 -1888 4059 1759 3683 54 4088 4438 2930 3430 1694 3845 1951 4053 1846 4264 2517 -4665 1645 3626 4866 2628 2746 3781 3586 2756 2618 2487 3464 4307 62 3562 1710 -1942 4227 1657 3795 2536 239 3356 3656 1833 4649 3868 174 3394 2637 4094 4657 -2834 21 1878 4014 3469 1749 1887 185 196 3606 2736 61 3553 3800 1941 4008 4219 -3661 3839 207 2535 4211 3620 2727 3366 1774 4490 3992 2854 3833 3874 3342 4306 -3569 2647 3442 1651 53 2607 2527 4052 4429 32 3625 228 2844 2627 1722 1877 2655 -1767 4482 1839 3463 4701 1780 3333 4271 2735 3794 3406 2507 3655 1832 1661 4445 -2497 1824 2853 3788 1637 3349 3649 4058 2745 4648 42 3682 3436 4087 3772 218 -2755 1702 4007 4263 2516 60 1684 1940 4210 3619 3581 2726 2534 4437 3386 1716 -4045 3832 4656 1838 1628 4226 3613 195 3441 4270 3400 3867 1895 1693 1814 1644 -4013 2526 1721 1766 2843 2486 3825 2636 2754 4086 3561 4218 59 2646 3838 2476 -3405 4262 227 2506 3361 173 1773 217 3575 1823 4000 3787 3648 4225 41 4481 52 -3435 1758 4051 3866 3552 2645 2626 3429 3580 2842 3462 1715 4044 3780 4428 3341 -2617 3612 4647 3793 1618 4217 1709 3654 2744 1831 3399 1656 206 3355 1813 1772 -1886 31 3393 4436 3824 1748 51 4006 3332 3605 4646 4050 4209 3618 2725 3360 -2625 2833 3574 3999 3831 1885 2515 1636 3991 2525 20 3568 2743 1757 2635 1830 -1650 1876 2606 1683 3428 184 1765 2734 3779 1627 2616 2524 4005 2505 1708 1655 -4208 2634 1822 2724 3354 3786 1875 3647 3830 2496 3392 40 3348 3434 194 1747 -4427 3604 3771 2475 1701 2644 50 1714 4043 1764 2832 3990 3611 3385 216 3567 -3398 2504 4426 1812 1649 2605 1821 3785 1692 3646 1829 1643 3823 39 4261 2514 -2485 1617 3560 2523 3573 3998 2831 183 4042 2495 1874 3610 2723 3347 1756 2733 -2513 3770 1811 3427 1700 3551 3778 4216 2615 3822 3384 19 1707 3340 1763 172 -3353 2633 3997 3391 1691 215 1642 30 1820 1746 2732 3603 1755 2484 2624 3559 -3331 38 3426 3989 3777 2614 49 3566 1635 1706 4041 1648 2604 2623 2512 3550 -3390 1682 1810 1745 4207 3602 205 3339 1626 3821 2494 3988 3346 29 3565 3996 -3769 4206 171 1699 2603 193 3330 2474 1754 3383 2503 1634 48 3776 2613 1690 37 -182 2493 1641 1681 3345 2483 2502 3558 3768 1625 1698 1819 1616 1744 3601 3382 -47 3987 3549 2622 1689 2722 2473 1640 2602 3338 2482 3557 1809 18 28 1753 2492 -3329 2501 3548 2721 1615 204 3767 1697 1633 36 3337 3381 1680 1743 27 2612 1688 -1624 170 3328 17 1808 2481 3556 35 1632 2601 2472 1679 3986 3547 1623 192 203 -3336 3766 181 26 1614 2471 2491 3327 1742 1687 1631 2480 2611 1678 16 1613 180 -1622 191 3546 2490 2470 15 2600 25 3326 169 24 1612 2479 1677 1621 1676 14 168 -2469 2468 1611 23 1610 13 179 12 167 11 } +{ 148 2934 166 5107 4628 166 166 166 166 3033 166 4692 166 5571 2225 166 5340 +3423 166 3191 1752 166 5212 166 166 3520 166 166 166 1867 166 3313 166 3461 166 +166 3174 1737 5010 5008 166 4344 2868 3877 166 4089 166 5041 4748 4073 4066 +5298 3502 1812 166 5309 166 233 3493 166 166 3728 5236 4252 4010 2149 166 164 +4580 3039 4804 3874 166 6170 2812 166 4334 166 166 166 166 166 166 1862 224 +2131 6081 166 2710 166 166 166 4765 166 1964 5060 166 1897 166 3987 166 166 +5566 2021 166 45 166 166 3283 3932 166 166 3519 166 166 291 166 166 5132 2800 +166 166 166 5531 4054 166 3509 166 166 4908 3028 1756 1910 4671 2729 5224 166 +121 3327 3317 166 181 2371 5541 166 1787 2666 5134 5698 166 5480 3870 166 3823 +166 3165 5343 5123 5089 166 2422 3724 166 2735 1953 5724 4444 4871 166 166 5001 +5512 3133 5171 166 2216 166 4877 4542 166 166 166 5270 166 166 166 1922 69 3547 +166 166 166 166 166 231 4547 5155 3357 3464 166 72 3332 166 4392 5971 3896 4451 +3173 2569 166 4466 2518 1698 2850 5349 166 166 4457 5062 166 2202 1650 2191 166 +1950 2583 166 5293 2032 5893 166 3994 5392 3878 96 166 166 3195 166 4001 1900 +2513 6027 166 166 166 166 5407 166 166 2332 5125 5891 3096 3172 166 166 3065 +166 166 4535 166 166 166 4553 3131 3693 166 2255 2613 166 166 166 166 2866 166 +166 166 2940 5333 3199 166 2628 4312 166 166 1794 4681 2058 3606 166 166 3542 +2166 4696 2520 166 4739 166 2563 166 166 3681 166 166 166 4127 1967 2972 166 +5227 166 166 5551 4255 56 166 5553 3219 4367 166 3218 4749 2886 3695 3711 2228 +166 166 166 2268 5054 3749 4825 166 4933 4992 4530 166 4892 3400 166 197 166 +6078 166 166 3971 166 166 5357 1852 3377 166 5196 3740 5320 166 166 3099 166 +4562 6061 3294 166 166 166 166 3266 3627 2567 166 228 2773 166 166 53 1833 2401 +124 166 4272 3922 5959 2903 3923 166 6155 166 166 166 166 216 166 5247 166 5591 +166 166 82 87 4526 166 166 5439 166 4935 166 3187 1869 166 1764 5500 6023 3356 +166 3350 2457 2455 166 1637 166 3342 166 166 3355 5154 166 276 166 166 166 3371 +5969 166 1665 166 166 166 166 166 166 166 4092 1712 3122 5086 166 166 4906 166 +2591 166 166 166 1894 2997 166 4476 4384 166 4747 4109 2655 166 5978 1636 4898 +166 166 166 166 166 166 166 5207 166 166 3712 3876 91 5876 3786 5998 166 166 +166 4391 166 166 2832 2220 4435 166 166 5796 3156 6112 166 1643 1821 3129 166 +4200 166 5857 166 166 2351 5902 1855 5043 166 3167 5191 3996 5718 4876 3071 +2965 5735 5930 6149 2345 3297 3822 166 166 307 6019 1859 2981 4914 3320 6165 +2328 140 2372 308 166 2280 5081 166 3275 166 159 2399 2327 5489 4690 6059 4492 +4269 6058 166 19 166 3323 5708 128 4812 2949 166 166 2890 2630 5237 166 256 +3673 4621 5380 166 3353 166 1651 2573 1635 4011 3429 3370 3720 166 166 6108 +3848 5104 2851 1998 166 166 5106 20 166 2633 166 166 166 166 5662 125 3651 1731 +4702 166 3197 166 2947 3046 4196 2185 6100 166 2602 2908 2487 166 5232 166 4028 +5919 166 2680 3608 3252 166 4899 166 166 166 166 2529 166 166 166 166 166 2534 +166 2299 4076 166 3643 166 3921 166 166 166 1939 2124 1829 2436 3892 166 3481 +271 5307 1697 166 166 5098 2906 5545 166 5980 3203 166 1903 4626 4674 6118 6097 +5926 4136 1677 3232 4720 166 166 166 229 2012 3620 166 3798 166 166 2609 3489 +3809 166 166 166 166 166 166 166 5826 166 166 166 4903 166 166 166 166 6168 166 +5052 5044 5644 2375 2677 4012 3062 5831 4752 166 4125 2610 2062 3238 292 2533 +5872 51 166 1947 4225 166 2288 4845 166 5788 166 5717 166 166 5549 5619 166 +4165 166 2721 2311 5501 4416 4383 166 166 3068 5499 5936 166 4204 4766 4688 +1870 5220 166 166 166 166 237 2523 6039 3061 2793 3998 166 2545 2309 3144 3679 +3969 166 166 166 4379 3574 205 2808 5822 166 166 2188 4823 4990 5561 5711 166 +5627 6034 5253 3783 5047 4405 166 59 1755 3178 318 166 4710 2933 3409 6062 2821 +166 6099 166 4178 166 166 4122 36 4779 166 166 4323 3073 5410 2101 166 166 44 +5690 166 3265 166 5222 5909 1838 166 4755 2215 166 4082 166 166 3210 5140 3124 +5238 166 5913 2321 166 2416 5976 3918 5078 4218 5703 4897 6011 5685 2214 166 +166 6180 5175 1715 166 166 3760 4497 1808 4826 166 2540 166 166 5513 4971 5915 +166 166 2525 166 4480 42 232 2412 2797 3229 5263 2852 5543 2126 3562 166 2872 +4695 5985 5136 2714 4262 5473 166 4160 4347 166 166 166 166 5271 166 166 5108 +166 166 166 166 5437 4875 3963 4362 5820 5559 4890 4728 166 166 2692 166 4870 +3591 5472 166 2690 166 5854 3817 166 280 166 166 113 4128 3396 166 4264 5058 +2283 166 2281 4916 5671 166 2708 166 166 4589 166 166 4689 166 1686 166 166 166 +166 166 1774 166 166 166 5651 3777 2234 166 3864 18 3589 4592 4777 166 166 5254 +4245 166 166 166 4368 5172 3522 166 4306 153 5230 166 5598 5420 311 2414 4159 +2985 5137 166 2179 1801 166 4595 2083 2020 166 3602 2170 4259 3048 166 166 4193 +2350 166 166 2702 166 4521 166 166 2496 166 4593 2006 166 166 2292 4135 166 +6069 4623 166 166 4827 3995 4291 3243 166 166 166 5622 166 3539 166 166 4915 +4373 2479 3775 6008 5838 4321 1612 5530 166 3773 4267 4086 3081 2261 166 166 +4785 4641 5292 166 4820 5612 5556 166 166 166 4396 6084 3414 166 3331 2380 5921 +4315 2340 166 5511 166 4713 3754 2912 2553 166 3468 5388 166 1932 3540 5834 166 +166 3186 5258 166 4107 166 166 166 166 166 166 166 166 2108 12 2368 2789 166 +166 4148 1878 166 166 2324 4179 2945 2531 166 166 166 4485 3765 2308 166 2754 +166 6102 166 1921 260 2241 166 2592 166 166 166 4964 166 3055 5261 4943 2916 +166 201 5728 166 5759 4314 4730 6024 166 4926 4762 1834 2055 166 40 166 5416 +166 3722 2360 1928 166 4889 4590 5550 3498 166 6003 2029 4106 4346 3758 166 +2753 103 1891 5067 166 3398 2079 5784 3074 3787 166 166 3936 166 5766 166 4847 +3928 5119 166 5181 4602 2605 5712 4523 166 166 4717 166 2227 2181 166 4678 166 +166 4901 166 4980 166 166 166 166 5806 2894 5631 4995 2608 166 166 166 3917 166 +3417 166 2795 1655 3189 3364 166 4839 3510 4212 5641 6091 138 166 166 3343 4620 +2722 4566 166 3518 3424 166 166 1653 166 5057 166 5375 4833 166 4273 4348 166 +166 166 4912 166 3662 166 4281 166 5169 166 5883 2737 2572 4685 4068 166 4214 +166 166 2409 166 166 4571 166 5624 5722 5949 166 3675 166 166 5109 3428 166 166 +5446 166 3290 166 3309 166 166 4776 166 166 166 166 166 166 5617 2860 166 166 +166 166 3629 1741 166 166 183 4973 3047 2854 75 2035 3652 2159 166 4150 6037 +3225 4519 1902 2678 2413 1961 166 166 166 166 4972 1847 166 5636 4017 166 3345 +166 4520 166 2861 166 3092 6060 157 2542 2298 4496 166 2607 6110 5707 2314 166 +166 273 166 5952 166 4957 322 6065 2272 6140 2438 3458 3287 166 166 166 166 +2684 288 3354 166 166 3983 1702 166 166 166 2393 2435 4202 3308 5805 5085 166 +166 1938 166 166 2171 5892 2337 166 4648 3116 2486 4363 3567 166 166 2822 2041 +166 4703 3956 5192 166 3975 5720 3647 2134 5932 166 166 5160 263 166 166 166 +4549 166 166 1701 3086 166 166 4737 166 2252 166 170 166 166 166 2301 5478 166 +166 5979 3007 166 166 166 4104 166 2469 2700 166 4998 3376 166 1840 166 166 +4470 166 5235 3930 166 166 166 6031 166 166 166 3827 4700 166 166 166 166 166 +166 4103 3976 166 166 166 166 5027 4322 5130 166 4741 2132 4118 3080 4137 166 +6179 166 166 166 166 166 6120 4188 166 2251 166 3253 166 4887 166 4293 5241 166 +166 166 166 166 166 5076 166 166 4177 166 221 166 2757 5377 166 43 166 166 3180 +5540 166 213 4541 166 166 166 166 166 1641 166 4578 4639 166 166 1683 2139 1689 +5249 5773 5226 166 2820 166 5516 5045 166 4896 5657 5189 166 5770 2725 5148 166 +166 166 2929 166 3479 166 166 4564 3752 4305 4232 166 5906 1779 166 2709 4941 +4342 166 4882 166 4277 2322 166 4879 1610 3038 166 3762 2054 5652 166 4524 3820 +4806 166 166 104 3416 4869 4243 4854 166 4114 166 2121 166 3463 3556 166 4795 +166 2118 3920 166 166 4667 5046 166 166 2088 4360 5787 2198 4233 5552 3970 3523 +2037 5791 166 166 4299 2336 166 166 166 4173 4588 3626 5187 166 3363 4611 294 +4962 5243 2719 6022 4976 3559 166 2662 5779 6151 166 3527 166 5404 6132 1839 +166 3090 166 2253 166 5441 5518 6049 166 166 6136 3026 3474 5960 166 3937 4105 +166 2348 2039 4738 166 5233 3882 3840 166 278 190 166 5751 4313 166 3855 166 +166 6171 166 166 5381 3941 166 166 166 166 3334 166 2038 6088 166 1918 5037 +2325 2378 4894 3514 3715 5168 166 166 4083 2873 166 166 166 2693 166 3543 166 +2577 3013 166 166 4594 2622 166 166 166 3401 166 166 5447 5328 5547 6133 2335 +3739 166 166 166 166 5614 3492 3610 3466 166 5336 4354 166 4662 166 166 4283 +166 166 303 5904 166 2717 166 166 2276 5564 2386 5661 2040 166 1630 4652 166 +4840 166 110 5329 3979 5734 2550 166 166 6007 5999 2978 4771 5360 166 4023 166 +166 5920 4065 166 3880 166 5422 1813 166 6166 73 166 166 3669 5762 5077 166 +2953 85 166 3517 166 116 166 2738 3710 166 1634 166 166 166 2290 3001 166 166 +3037 2400 3410 166 1791 4231 166 3546 5009 5299 2807 166 166 1675 1619 2374 +3093 5302 3278 2330 5301 2343 2307 3274 5017 2265 3700 2465 166 139 4292 166 +5056 3952 166 4528 2388 1886 166 166 3016 3698 5881 166 2379 3223 166 166 3847 +2407 5493 3183 3307 166 265 166 2421 6161 2057 5363 3863 2474 166 166 5427 166 +2140 2955 166 3070 4237 5018 5988 5570 275 4862 2357 166 195 166 2593 6047 166 +2878 166 166 2781 3004 4180 166 5593 166 5973 2544 5064 166 4324 4701 166 3084 +166 166 5372 4725 166 5650 166 166 2786 166 3781 3583 3682 1850 4420 3296 5173 +4461 166 166 166 2984 166 93 166 166 4336 5943 2922 3300 166 4843 166 166 166 +166 2094 166 2939 166 4656 166 5146 166 166 166 166 2104 3977 4660 5312 166 +1865 166 5487 5558 3380 166 1957 3162 3281 166 3588 3268 2099 166 166 2319 4913 +4187 5503 5782 150 166 52 5450 166 166 166 2941 5877 166 4031 5393 166 3931 +4166 3135 3445 166 5053 5430 4836 166 5315 3389 4636 166 166 3441 166 166 3767 +2961 166 4761 4604 3179 166 166 4751 2148 2015 166 123 5013 166 2936 166 2063 +166 5823 166 5096 166 166 4198 166 166 166 3845 166 166 238 166 2703 3541 166 +4813 166 4477 2349 4197 5996 3324 4789 3063 166 166 5504 5273 2805 13 166 5601 +5402 4119 5206 166 166 4251 3704 4176 1963 2882 166 202 3125 3318 112 166 3362 +4835 3420 3974 5099 166 4433 166 166 166 1766 2663 166 166 4683 166 166 5485 47 +5101 5341 5765 3390 1648 4341 3945 6045 1645 166 5578 2594 166 166 3772 166 166 +3196 3603 166 5399 166 5075 166 5911 4632 4781 5313 270 166 2346 166 166 166 +1986 166 166 4958 166 166 166 4048 166 3076 166 166 4891 166 166 57 166 220 166 +166 166 4117 166 166 166 166 5194 2658 166 166 2942 6071 4182 166 2976 5816 166 +166 166 166 3985 4211 2514 166 166 166 2504 3446 1711 166 166 2107 5190 166 34 +166 3912 5382 3003 166 166 166 2999 2404 4734 4455 2087 166 2405 156 166 2830 +3303 296 3295 2067 4268 166 166 5642 166 166 1901 166 5133 166 166 166 166 3176 +2973 4677 166 166 6164 3000 2396 2734 5697 5989 166 2823 5265 5852 166 166 2623 +2625 2287 4844 1758 166 166 166 166 166 6073 166 5379 2389 5279 2444 5515 166 +4038 166 4948 5640 166 166 3572 4258 166 166 166 5204 166 4603 5797 166 166 166 +1725 4600 166 166 5498 166 4152 166 172 4758 166 2598 2489 2076 4366 2568 166 +4352 3782 166 166 3059 3946 5138 5727 4484 5694 166 3796 166 166 166 166 5334 +1778 2245 166 4517 4419 2250 182 5856 166 2835 4495 1858 2033 6014 6086 3211 +166 166 154 2145 166 129 3661 2661 5860 6143 2640 3890 6160 166 166 2747 166 +166 2291 282 2476 166 166 3825 166 1925 166 4489 166 166 166 4034 166 166 166 +166 166 166 122 4708 4919 2373 2453 5419 5954 297 5290 166 1978 166 4932 3501 +166 3085 3386 166 5405 4512 166 3209 5740 4020 5495 5815 314 166 3190 4824 166 +166 3448 207 1623 6096 5878 166 1836 166 166 2728 166 5278 3419 3012 5618 5266 +3078 166 166 2244 166 4569 6068 166 3336 166 5677 6052 5079 166 5453 5245 5799 +166 1982 166 5958 4619 5821 166 5285 284 1631 5710 6070 5365 2189 3242 166 2752 +5483 5297 6150 5522 166 1815 166 166 166 5801 166 166 5398 166 166 166 2967 +2515 3169 166 166 2562 166 1617 2069 166 166 6154 166 3721 166 5327 166 166 166 +5592 166 166 2286 1716 3903 166 2395 286 3587 6146 3286 4186 5882 5894 5737 +6032 5879 2761 4829 3788 166 166 3233 5356 5693 166 2429 2449 141 3444 5186 166 +166 3477 4080 4584 166 166 3670 1851 3824 4337 3886 2792 166 5867 166 166 3557 +3147 166 166 2200 166 2505 166 4310 4865 5656 5992 5672 166 5199 135 3023 2994 +4472 166 166 166 2019 4319 3472 166 166 166 29 206 3944 3027 5804 4731 5449 166 +2825 3310 166 6172 5202 166 2516 3644 4557 166 166 166 166 2671 4427 3432 3276 +5584 5536 4645 3202 166 2612 166 4249 2425 3259 4622 166 2411 4303 4206 166 166 +166 3734 6063 118 166 166 3641 166 166 166 4937 1871 3421 2208 166 166 166 166 +4881 166 166 166 166 3298 166 61 166 166 166 3293 6145 71 3619 166 166 3383 +1624 320 2187 4113 166 166 166 166 166 5080 2344 5625 2358 1621 4230 5579 5359 +295 4248 5267 3883 6124 187 5112 2122 166 166 166 5142 6004 166 5322 6175 3639 +3182 4425 166 175 166 166 166 5778 3939 3484 166 166 5832 5248 5935 4467 5858 +166 5038 166 166 3102 166 4880 166 166 166 166 3418 1666 5338 3680 5291 4441 +3385 166 5733 4503 2774 166 2631 4153 166 2000 166 166 5345 166 166 4298 1804 +4707 166 1613 1952 2111 166 166 166 166 166 2897 166 166 4044 166 166 166 166 +2863 5475 166 166 166 1704 166 3609 2782 2018 166 5361 166 3694 3733 166 2785 +1969 166 166 2834 1868 3779 1877 60 166 4143 3902 166 4361 3188 2498 6009 166 +115 166 3138 166 4575 6080 133 2030 166 166 166 2306 2136 3043 3447 2142 166 +3799 1646 5269 3640 166 2674 5502 166 5467 166 5069 166 166 4654 4581 5274 5036 +4364 166 3115 166 2128 4544 5433 2086 2584 4413 166 166 5385 166 234 166 1625 +166 166 166 5139 2511 4974 2766 166 166 166 2095 3990 217 166 2988 4061 166 209 +4883 166 166 166 166 166 4326 166 5465 2859 166 2887 166 2231 166 1658 166 2246 +166 1844 166 166 3087 2871 3872 1660 48 166 166 3622 166 1709 166 166 6177 6173 +166 3569 166 166 166 241 3660 3631 166 166 5319 5141 174 166 166 4412 166 5145 +166 1919 166 5276 166 2385 166 1618 166 166 2501 166 166 1734 5966 3145 166 +1690 4025 1664 4559 2433 2392 3552 4006 1896 166 166 2546 4450 5396 4221 4046 +166 166 2642 166 4448 166 2784 3480 4807 166 166 3534 166 166 5272 166 166 2831 +4263 166 166 166 166 4414 5628 3486 166 3748 166 4598 3719 3598 3611 166 4792 +5059 4110 166 2656 166 166 84 5429 166 166 166 281 1955 166 166 166 3616 4997 +166 166 166 166 3230 166 166 166 166 166 166 77 166 166 166 1800 166 4236 166 +166 166 166 166 5757 2530 1662 166 4607 1659 166 1685 3341 166 1699 4058 3407 +1854 4417 3034 166 166 166 166 5568 166 3206 166 5529 166 166 166 2116 3487 144 +166 166 166 5523 5373 5321 166 6064 2921 166 1696 2473 166 166 3716 5689 166 +4608 3879 166 166 166 2156 166 4358 2446 166 3958 166 5520 4340 4848 166 3285 +166 2665 166 3459 1905 5115 68 5730 166 3127 5029 4370 166 3753 166 3674 6025 +4490 166 4183 166 94 166 166 4051 3766 3140 4907 3857 166 166 4596 166 3888 +3040 2507 5643 166 166 4311 2618 5582 166 166 3678 166 1988 166 166 4464 166 +166 166 166 4278 3677 2173 5256 166 166 5162 166 5178 1644 5094 166 2557 5506 +166 166 166 4927 5348 1797 166 166 39 166 3866 3655 236 5403 2175 3361 166 1976 +5993 226 166 4643 166 5339 4098 2653 4969 166 3346 4984 4635 166 166 166 166 +4981 188 166 166 28 4088 166 166 166 25 3663 2696 166 4679 5114 5802 166 166 +166 166 166 3810 5749 166 1673 4276 166 3756 4184 166 5630 166 166 166 4531 212 +5663 166 166 2746 166 5386 3618 3594 1887 166 166 5443 166 1726 4094 5065 4756 +166 166 5308 5225 2081 166 166 3064 166 166 1981 3637 4355 1626 166 166 4686 +166 5793 180 5066 2938 3819 4904 3601 166 166 2495 5025 5768 2621 4650 3041 166 +5897 3633 166 166 4375 166 5714 1667 3273 3950 1668 166 5855 166 2364 166 1881 +166 2646 5460 166 2770 4951 5414 166 4442 2113 5726 298 5934 2053 166 166 4053 +166 166 4514 4697 166 166 5198 2707 166 5605 166 166 5218 2596 166 2110 166 +1806 2160 166 166 2212 166 3636 166 166 4377 4021 3707 4502 166 4195 166 166 +166 4108 3725 3676 166 2084 166 166 166 166 4216 166 166 6156 166 2896 166 166 +166 166 166 166 3826 2870 3793 166 166 5927 166 2759 166 4613 2297 5638 166 +2842 5031 4793 5184 166 166 2008 166 257 2881 117 6051 3044 4079 2833 166 6117 +166 3236 5469 166 166 2874 6076 166 1799 80 41 166 1864 166 5709 1611 5026 5176 +168 3269 4081 166 166 1970 4550 166 4250 4101 4565 5950 5845 97 4064 166 5394 +4374 4343 166 166 4658 3248 166 208 1735 4047 2843 166 166 166 166 2794 166 166 +5844 166 166 3094 2177 5436 3646 166 3564 4682 166 5948 5835 162 2059 5151 2034 +1926 5941 5903 5177 166 166 166 4801 3439 1780 166 166 3280 3434 166 166 4498 +5565 4043 166 4432 4722 3959 166 3746 166 166 177 166 166 2748 166 4483 166 166 +4144 166 166 166 166 2066 2915 166 2049 2130 4684 166 49 3506 5391 166 2590 +6103 1714 2410 3053 3837 4301 166 3255 2644 166 166 4014 166 2475 4788 2876 166 +166 166 166 166 166 4140 166 166 321 166 1966 166 166 2855 3111 3800 166 4446 +2551 166 166 166 2824 166 166 166 2164 3010 2226 166 4857 166 2582 5118 4582 +5917 166 166 3338 3482 3328 166 4817 166 5371 3830 166 3009 1633 3329 4052 166 +3701 4983 4500 4487 4878 166 166 5482 3544 166 3057 2026 4398 2847 3532 3262 +3399 166 166 166 4478 4167 166 3411 2599 5362 166 2711 166 166 166 166 3452 +2522 5586 5548 3279 2538 166 166 166 4161 166 2123 166 166 2660 166 166 1706 +166 15 3537 5051 5869 166 3025 166 4447 3744 120 166 166 166 204 2810 166 5124 +2376 5306 166 166 4493 166 166 166 5289 6046 166 2762 2541 1857 2467 5163 166 +166 166 166 5830 166 2172 3359 166 2928 166 166 166 6129 166 5445 166 166 5924 +6144 166 102 166 166 1678 166 4491 5705 166 1753 166 3873 5725 4145 1909 166 +2155 166 166 1848 3315 1874 166 4945 2524 166 3263 2362 1785 166 166 166 152 +2102 5723 5131 5754 4032 4029 166 4295 3391 166 166 166 5282 1747 3159 2235 +5583 1786 3630 6111 2974 4797 3623 166 2071 4929 166 2603 3964 3378 166 166 +2654 151 3940 4527 4518 166 2430 1884 3812 166 2867 166 166 166 2756 5418 166 +2354 4606 166 2153 166 4855 166 166 1720 166 3213 3926 166 5158 4349 166 4828 +166 166 2031 166 2300 166 166 166 2211 4954 3121 4754 2485 166 166 166 3593 166 +2718 5317 2765 5120 166 2527 166 1994 5947 166 166 166 6085 2302 100 79 2982 +3705 2180 2043 166 1872 1671 166 3729 166 4944 3665 2217 2119 166 5615 166 1620 +166 166 166 166 35 3913 2760 166 3688 3672 4042 166 166 5117 4227 166 4445 2458 +3803 4554 4988 166 166 3141 3491 166 166 166 166 5095 4668 5567 166 166 2885 +1790 2996 166 166 166 166 3737 166 2470 166 166 4339 166 166 166 4920 166 166 +3697 5471 166 166 3538 4558 3467 5262 5609 3858 166 166 5007 2780 2791 2236 +5668 3134 166 166 5776 3470 3291 166 2532 166 166 166 3805 264 166 3227 166 166 +166 2334 166 5087 101 166 3634 58 2813 166 166 166 3222 4704 4488 4508 5459 +2117 5873 166 1828 166 166 166 166 166 2105 166 5613 5761 2920 3098 166 166 +3277 166 166 166 166 83 166 166 166 3967 166 5574 166 4985 30 3426 166 179 3014 +4015 246 2556 4449 3723 5611 3436 166 4240 3642 166 4536 2048 5810 166 1971 166 +5557 5323 5022 191 5492 166 4837 4426 2537 2271 3177 5674 166 2796 1995 166 +3906 166 4403 3862 4716 2406 3948 4670 4309 166 2575 5358 2951 166 3666 3612 +5577 4579 4743 166 6072 6036 4563 2586 166 5836 166 166 5752 166 3563 166 2909 +3251 92 166 4711 4149 166 166 3052 5122 2904 2635 1990 166 166 166 166 166 166 +166 166 4213 166 3103 3142 2683 6105 2209 3175 4215 166 166 166 166 166 166 166 +5303 4075 5374 166 4174 4154 1895 4538 2764 166 5817 6113 4033 166 6090 166 +2990 166 3164 166 166 166 247 166 6083 3412 166 5738 166 3599 166 1904 2162 +2547 3960 166 166 3154 55 166 5991 4921 2879 166 166 5347 166 166 166 2712 4787 +166 1908 166 166 166 3184 166 166 166 4572 3846 3657 166 166 5481 166 166 3397 +1856 4978 166 3900 3570 3802 166 166 2075 4408 166 6079 2313 166 166 5756 166 +166 2070 166 166 3137 166 166 3686 166 166 166 166 67 5019 166 1742 166 5354 +166 5149 166 2931 4946 6006 166 166 2865 4902 3029 1722 3449 166 1987 166 62 +5626 166 166 166 2670 1657 5599 3056 166 3791 5020 166 1979 4437 1899 166 166 +196 2636 166 143 3475 4317 2512 2415 5033 5024 2112 2864 3551 166 1688 33 4585 +3648 4399 166 166 166 166 166 1824 166 166 166 166 166 166 4513 166 2478 4407 +166 166 2492 4130 4318 2980 5746 166 2606 4063 4123 166 255 166 166 4680 166 +3586 5975 3935 166 5528 166 3158 166 166 2614 5035 166 3488 3214 166 166 166 +5413 3713 166 5875 4329 5250 166 166 3741 166 54 1885 3839 166 4924 166 166 166 +4158 166 166 2152 1661 166 166 4327 166 3933 166 5666 166 166 2580 166 3404 +4111 2862 4438 166 166 4072 166 166 3938 2958 4302 166 3851 166 268 166 166 +1975 222 3204 3438 4616 166 4275 3101 2648 3989 5215 166 4229 166 5440 166 5093 +2639 166 166 4439 166 2316 4239 166 166 166 166 166 1817 4486 166 3272 166 166 +4085 2078 2902 166 166 166 4381 1853 3054 166 166 5005 2669 166 2856 2706 166 +166 166 4185 166 1748 166 166 166 5771 166 166 3915 166 166 2205 6122 166 166 +1632 5400 166 2477 4740 166 166 166 1802 166 2472 3953 166 1849 2604 3780 2560 +4786 2566 3576 166 4768 166 1951 251 5068 166 166 166 2619 166 166 166 5432 166 +166 5260 5758 3908 166 4141 166 5777 166 166 166 166 166 3961 5143 166 3889 +3747 3743 166 2818 166 166 166 3867 166 166 3742 4763 2948 5533 166 3966 3555 +3843 3503 6005 166 4687 2790 4479 5828 3769 5688 166 166 166 166 3109 166 166 +166 166 4574 81 166 166 4576 3369 166 166 166 4207 166 5072 2210 166 184 166 +4673 166 166 166 166 166 166 1628 3590 1916 4784 4970 166 1832 166 166 3584 +3384 166 166 2880 1783 166 166 166 166 6115 6121 2157 5428 5859 4861 5635 4331 +5839 4223 313 166 166 6152 2168 166 4112 6089 6012 166 5294 3207 166 166 4884 +166 4655 166 166 166 1743 166 4077 166 4631 166 166 2957 1945 4936 166 166 5389 +166 166 5955 166 166 1639 2207 4129 166 3582 5560 6147 3088 166 166 4529 5259 +3118 166 3106 2853 166 1845 5660 166 3325 3973 2461 2163 166 3083 4190 166 166 +5505 166 166 3226 5507 109 6141 3991 166 4939 166 166 5889 3986 166 3664 4353 +2056 166 5071 166 166 4376 166 1958 2028 166 166 1793 166 5252 3536 166 166 +3525 3580 166 166 166 1782 5174 2011 1826 3352 3231 166 166 4986 2068 2801 166 +2500 166 5061 166 2263 2632 1993 166 2715 4424 166 166 6042 4661 166 5074 5479 +4822 166 166 166 166 5600 5853 166 1907 166 166 166 3808 166 5997 5032 4605 166 +1732 166 166 166 3015 5454 166 166 166 3806 5444 2238 1946 166 166 3221 4922 +166 6092 166 166 4007 166 3425 4282 2571 166 1749 166 166 38 4744 4900 4257 214 +5687 166 2490 2979 2924 166 4714 219 5344 3836 3302 78 1984 2986 2960 166 2869 +3507 3335 4967 2892 2723 4849 5070 166 166 4629 3815 166 4453 4760 166 3224 130 +166 166 166 166 166 3408 2494 2691 166 4325 2932 5165 5573 166 4769 166 5411 +5637 2050 166 166 2305 166 166 4834 24 4693 3554 2491 1738 166 166 166 23 2758 +3072 2564 4800 5537 3545 4133 166 166 166 5982 166 203 166 166 290 185 166 3774 +1929 3379 166 166 166 166 3002 166 3738 166 166 3344 4942 5353 2777 2839 4712 +1830 2664 166 5884 3516 166 5494 4169 2391 3319 166 166 5918 2597 166 4821 2787 +5719 166 166 166 1687 6148 3257 254 166 5180 6153 5964 306 166 6123 166 5208 +166 3163 5938 1736 166 2502 4910 166 166 2549 166 2900 3632 3270 166 2082 5953 +166 107 5750 166 166 166 5527 1751 4168 2950 166 2659 166 4189 1943 2595 166 +4191 166 166 166 166 2998 2296 5221 3617 166 5435 2451 2009 3005 2242 3768 3658 +166 166 166 166 166 2481 2256 166 166 4074 166 3120 166 4409 1759 166 166 1679 +3659 3499 5219 4501 3082 2047 166 166 166 4560 2768 5251 166 166 166 2437 3993 +3215 2447 166 166 166 2993 4963 166 3045 166 166 166 166 166 166 166 5521 166 +166 4868 166 3895 166 6131 3949 3306 3785 166 166 4895 4831 166 1772 166 166 +5928 166 2137 4805 2462 310 2667 3561 166 166 2312 4931 5255 166 166 166 5670 +166 2285 166 4672 5310 166 2103 2174 166 166 166 166 5417 166 4726 4203 166 166 +166 5581 166 5665 166 166 5747 166 166 2509 1973 2749 5463 166 166 4567 5014 +166 3322 3051 166 4090 166 3709 3887 3478 166 166 166 166 3565 3934 166 32 166 +166 166 2239 166 3947 3849 166 2022 166 2169 166 4691 98 166 3804 4155 1640 +4002 166 2138 1739 3730 5970 2274 4873 3119 166 4925 3577 3699 4049 3982 166 +5161 1744 166 166 166 5704 4979 2686 5383 5744 2289 166 166 166 3927 2539 166 +166 166 2585 166 4723 3755 4509 166 4961 2194 2535 166 176 166 4494 166 4171 +166 266 166 3454 5369 166 166 5899 5284 166 3607 3566 5514 166 1843 166 3997 +4599 2743 166 2857 2497 2751 166 166 166 3511 5742 166 166 166 4504 166 166 166 +5082 4401 166 166 5431 166 166 1949 4539 166 166 4852 166 166 3457 166 3433 +4669 166 1692 2454 3258 6159 166 166 166 166 166 2788 4350 3249 3816 4893 166 +4846 166 4993 1708 4138 166 2895 2891 166 1860 166 2480 1927 3853 166 166 166 +5100 166 3143 5159 166 4286 5182 5246 4975 166 2905 166 4917 5102 2044 6016 +5673 2005 5090 166 4634 3333 166 5702 3413 1762 6094 4284 4431 2641 166 4463 +5691 166 166 3442 3473 4192 2046 166 3838 166 3217 3349 166 2243 166 3490 166 +166 166 5922 166 166 166 4885 1798 2884 2750 5004 2741 166 166 5649 166 4410 +166 166 3382 166 166 1913 1703 5532 3770 166 5116 2645 2634 4357 5901 166 166 +5538 166 166 166 6028 166 166 5840 4102 2704 2091 5287 166 4757 2282 166 2650 +3528 64 253 3732 166 166 166 166 166 3465 166 166 166 5848 3110 111 166 166 +3403 2926 6030 3366 1948 4430 5509 3250 3972 2587 3579 166 6048 250 5275 4242 +2615 3112 3558 166 166 2342 166 5157 1917 2733 5647 1934 5675 166 3981 2923 +5213 5326 37 166 5288 3069 166 1923 5755 166 166 166 1888 166 6041 5895 5376 +3727 3901 166 5589 166 166 4609 166 166 166 4706 166 4482 1622 166 171 166 166 +4646 4151 2755 4614 166 2072 5409 4469 1647 4434 4633 1915 166 3615 4808 166 +3388 166 5280 2731 166 166 2417 166 14 166 4533 5126 166 2778 3022 166 166 166 +4830 4764 166 166 166 4982 166 4265 166 2466 5678 147 1883 166 166 166 114 4000 +2427 3597 166 4853 5981 166 2023 2519 166 1937 2221 4676 166 4522 5716 166 2432 +5731 166 6020 6163 4351 2442 4380 166 4390 1882 6139 4246 262 166 1676 5781 +2352 1956 200 166 166 5800 6184 166 2355 149 5962 5524 4238 166 5150 166 5888 +2423 166 5739 3192 4142 166 166 166 3201 161 4460 2459 158 166 166 166 166 2689 +166 166 166 166 1889 166 166 3374 166 70 166 2772 166 2995 166 2384 4989 166 +3299 166 166 166 166 3614 3645 3415 3160 1727 3735 5201 1693 3531 166 166 1776 +3871 166 166 166 166 86 3553 166 166 166 3392 166 166 2232 166 4977 2333 3394 +2875 2027 5736 166 1719 166 4952 2061 2150 5526 166 4637 166 4333 166 166 4733 +4809 3911 166 3460 166 5355 3126 4181 4436 300 166 3841 166 4770 126 5654 166 +166 166 1730 166 166 166 5610 166 6002 2197 3807 6109 166 166 166 166 166 5395 +4004 166 46 166 166 2570 4736 5318 4247 166 166 166 2293 3031 4591 166 245 166 +5510 1616 3117 4163 166 166 4759 3462 4819 4947 166 3128 5946 2278 2969 166 166 +5183 166 166 1729 173 2448 166 230 2971 166 166 5397 166 4093 3348 1866 4280 +166 6067 3794 166 166 166 4729 166 3456 166 2394 166 4953 166 166 2258 4863 166 +166 4060 166 5468 305 166 6134 166 166 2326 166 3453 2167 2845 166 166 166 5597 +166 166 166 166 5462 2809 5994 2899 166 166 166 5153 166 166 1638 166 166 4938 +3795 166 3842 166 166 166 2769 3194 166 4745 5508 5604 3910 166 166 4147 3239 +166 166 3548 3859 2092 166 2705 166 166 3625 4131 166 3513 166 166 2987 4555 +3107 166 166 166 166 5713 4698 3079 166 5342 166 166 2673 2517 2745 1795 166 +166 166 166 166 166 2463 166 166 2445 5425 6138 166 2687 3254 5871 166 2387 +4300 166 166 3529 1996 166 2369 3818 6126 1615 2643 65 4297 166 5324 3311 3852 +166 3868 4199 3978 166 166 166 5466 166 166 244 166 5929 6157 2390 5639 2267 +2073 4610 5774 2521 4556 166 4545 4307 2426 2450 166 5783 4968 6176 4156 166 +166 4126 3549 166 3581 5701 3234 166 4013 1879 166 6104 5874 166 166 3485 4279 +2528 5576 166 3992 166 3980 4934 166 2176 4228 5164 3784 1933 4120 5055 166 166 +5015 166 166 166 2310 1754 166 6087 166 166 4548 5268 2930 166 3656 166 3042 +5229 166 4016 2195 166 166 166 199 1745 3717 166 166 74 2668 252 4124 4657 5223 +166 2186 3628 166 166 166 4222 3114 2841 5103 3171 5135 166 166 2273 166 3899 +5332 5842 3575 2579 2431 2464 2229 3604 4561 2977 2815 166 3916 166 5825 166 +1694 166 4030 166 5841 166 3881 1831 166 5525 3011 166 5535 5217 316 4116 166 +166 2204 166 3136 3650 166 5813 1875 4511 4475 166 1999 166 2277 166 3024 5484 +5546 166 3988 5676 166 2213 2264 5214 166 4940 5974 166 4750 6077 166 1652 3148 +166 166 166 166 2554 166 6167 5257 5300 166 166 166 166 5408 166 166 3402 2141 +166 4663 5633 3312 166 2814 4930 1959 166 166 166 3861 166 166 302 2624 166 166 +166 1629 1724 166 3909 5281 166 2001 4395 5352 4428 2694 4850 166 166 5242 5910 +166 166 166 166 166 3212 166 2045 166 166 166 166 166 166 3017 4960 4456 166 +5616 6093 2151 166 166 166 315 3381 166 166 166 4330 166 6158 4721 6075 166 166 +166 4543 2303 166 166 3301 166 5000 3929 2543 3437 166 166 166 3422 166 5987 +5729 2428 166 4035 5588 3714 3834 5264 5743 166 3305 4886 6107 5156 166 166 166 +166 166 1672 5849 5827 5049 6101 2178 2420 3289 166 166 4274 6017 2257 166 4172 +3451 2367 2382 166 2964 4918 3241 2347 6082 99 2383 166 4454 163 2460 165 304 +1818 5580 166 312 5790 293 5794 5519 5083 3360 5748 166 3750 5034 166 166 166 +1863 3168 166 166 166 5111 166 166 166 166 2183 4510 166 166 3495 4382 4235 +4462 166 4056 5885 17 5028 1614 6038 166 2488 5632 3089 166 1940 66 4039 3999 +235 166 166 3829 3954 166 2365 269 166 166 166 166 166 166 4418 1796 4709 2004 +166 3596 5786 166 2819 4624 3152 2968 2838 166 5575 1767 5603 166 4386 5890 166 +1768 4201 3560 166 166 166 2184 2262 2966 2716 1765 2611 2983 166 4164 4084 142 +5314 166 166 4071 166 2578 2849 3600 166 166 166 166 5401 4814 3431 166 5088 +5084 198 166 3578 3764 166 2097 166 166 5390 4443 166 3166 166 4816 166 166 166 +166 3130 5963 1788 2129 1837 4100 6128 166 4586 5945 4772 166 5741 3151 3247 +5645 4507 5833 3904 6013 2506 3050 4175 1705 3019 166 5942 166 2418 3430 2230 +5745 166 2093 166 166 166 166 4666 3246 192 2010 4003 3533 5851 166 3621 3684 +3066 166 166 166 5073 3856 166 166 2224 166 2637 4270 166 166 5679 166 5792 +5850 166 2589 3060 2196 3476 3150 2025 166 166 166 2657 166 3685 3790 5587 2817 +3692 166 166 166 2359 2260 5896 2158 119 2816 5753 166 2739 5772 166 2919 2147 +1985 4271 4838 4991 166 166 166 5244 166 319 166 166 2779 4732 4994 5424 166 +166 3968 3049 3393 4473 4959 5967 5864 5170 4209 166 4810 4815 4205 2339 5023 +2279 5050 166 5837 132 166 166 166 2247 21 4775 166 166 5286 166 4170 4099 4803 +5767 166 166 166 5811 2240 5699 2499 166 4802 166 5785 166 166 166 3181 3435 +166 3339 166 5669 3865 2249 5002 166 4694 5461 4753 166 3157 166 1960 166 166 +166 2440 166 5818 5534 2439 1717 166 3789 2959 166 2943 166 2576 166 2002 2007 +1819 3256 4402 5311 3832 160 166 166 2803 166 3264 166 5863 166 2017 166 2798 +166 166 166 166 5607 4965 166 166 166 4537 4378 5944 3494 5457 5602 1942 5900 +5780 4411 5147 166 4966 2115 155 2827 1980 5063 166 285 5912 3304 2963 5179 +3220 166 166 166 2190 3708 5476 1944 2366 3893 166 166 166 3759 166 5434 2740 +1707 4244 5426 166 166 166 3155 166 4285 166 166 166 166 5721 166 3833 6001 301 +166 166 2574 186 2724 166 1873 3667 166 5216 166 2935 2100 4987 166 2284 166 +166 2911 3828 4009 166 2065 166 5496 6130 5563 4387 166 3771 3469 2989 2222 +4577 3965 4296 2975 3813 3240 166 4780 4481 3387 2338 166 6183 166 166 166 166 +166 2675 1761 2600 5167 3170 4773 2165 5166 166 2223 4642 166 166 4540 166 166 +166 3897 166 2483 1809 5477 3844 4067 2508 2275 166 166 166 166 166 3497 5458 +166 249 2956 166 4651 166 283 166 166 4955 4062 2315 2304 3261 2361 4791 4389 +1997 166 3455 166 166 166 166 166 166 4746 5695 5296 105 1841 3368 166 166 166 +5228 166 3496 4423 2024 3907 4774 166 166 166 166 166 2294 2193 166 166 166 166 +166 166 166 166 4393 166 166 2127 166 4573 166 5350 166 5016 3372 166 5653 166 +5972 4719 166 166 166 166 166 5370 166 6142 166 166 3691 2828 166 2601 166 2937 +2060 3654 3097 2341 5325 4568 4096 2776 166 2946 166 166 166 5843 1777 5295 +2837 4261 4397 5006 5808 4866 166 1713 5732 2954 166 166 27 166 4308 5629 2652 +2434 4474 166 4928 166 4727 3811 166 166 5234 166 6010 166 4911 166 4570 166 +6000 3450 5304 3919 166 166 4008 3942 166 272 2363 2064 3595 3505 166 166 3957 +1695 2452 4659 166 1792 166 131 5968 166 3731 3905 4115 166 166 2468 166 2727 +166 3526 4724 166 4388 3149 5539 5092 4440 6162 166 166 193 4429 2493 166 166 +3683 166 6029 166 277 166 166 166 5240 2408 166 309 2561 210 166 5200 166 166 +166 1930 5692 2697 166 166 166 3330 5331 3860 166 166 4335 166 50 3605 4289 +1763 166 166 166 166 3521 166 166 166 3668 166 166 166 166 166 3271 1656 166 +166 4782 166 2962 166 5907 166 3245 3375 2944 5933 166 166 5406 5655 3139 5423 +166 4359 5231 2548 166 3831 2858 5488 166 5824 166 166 166 3885 4372 166 166 +4024 166 4811 2970 166 4219 211 166 3471 166 166 166 166 3854 166 3358 2877 166 +166 5205 2804 166 166 166 4452 166 166 166 166 3776 166 166 3075 4208 166 5623 +1974 166 2647 166 3235 166 166 166 5211 166 166 4304 2206 166 4157 2182 166 +1816 2626 166 2893 2248 166 166 166 166 1983 5648 166 194 166 2106 4328 166 +4742 166 166 5572 2329 3314 166 6181 166 166 26 166 6026 166 166 2114 1669 4735 +166 166 4256 166 1861 166 5470 2317 166 4404 2482 166 5305 4415 5986 4949 5412 +166 1728 166 1898 166 166 4909 1989 166 166 166 2836 2051 274 166 2799 166 5865 +1663 4705 5121 2555 166 4316 4287 1880 1825 166 3689 166 1733 5012 166 166 2237 +4471 1682 2910 166 5366 166 166 166 166 4532 166 2802 166 166 166 4057 2471 166 +2889 166 166 4026 5682 3091 166 1977 166 2901 6137 5658 88 2318 1965 166 5914 +166 166 4468 1822 166 6050 5956 2201 166 4644 2918 166 3703 166 166 3524 4220 +2913 4210 166 166 2090 166 1906 1911 166 166 3671 2370 166 2552 166 3763 2259 +1924 166 5940 166 166 166 3185 3821 4069 261 2381 3244 166 166 5715 166 2052 +5905 166 2403 166 3030 2199 166 3550 166 166 1846 166 166 95 166 289 3208 2559 +5195 5091 1654 166 1781 1892 166 4516 2629 166 1700 3067 166 166 166 2080 1680 +166 166 166 5700 166 1820 5491 166 4226 166 166 166 166 4653 166 3508 227 5364 +166 2098 166 299 166 5795 166 166 166 166 3690 4134 5517 4534 5042 4874 5798 +4234 166 166 166 166 3702 166 166 3638 3108 3850 166 166 166 16 166 1775 166 +4022 166 223 4095 166 5127 4266 166 189 166 166 5203 166 1805 3884 3778 166 166 +2146 4818 166 2848 3440 4506 5886 3006 218 166 2377 166 4091 5925 166 4320 166 +2701 3036 166 166 166 4715 166 3801 166 3161 166 2077 166 4254 3032 243 1814 +166 166 166 166 166 166 166 166 1835 166 4394 166 5769 4923 166 2917 166 166 +178 166 166 1723 166 5887 166 4956 2952 166 4665 3925 3443 3123 166 166 166 166 +166 166 5144 166 4288 2074 2192 5442 6043 1746 2016 5995 2203 166 5686 5659 +3193 166 4055 166 166 2233 3571 5809 5984 2323 166 166 1740 89 4356 6053 6106 +3282 4796 166 6116 6056 2353 2829 166 5807 2042 166 166 166 1670 5937 4465 5646 +166 5562 3008 166 2419 3736 166 4132 169 166 166 166 2402 166 166 1968 2398 166 +1684 1827 4551 2679 3875 166 5585 3835 2295 166 1991 1803 2992 166 166 5847 +2649 166 76 5415 166 2269 2397 5387 5337 4422 166 2672 4832 4617 166 166 166 +166 4552 166 4612 1750 166 1931 166 1691 2424 4194 6018 166 166 4458 4856 166 +2089 3814 166 2844 166 3592 166 4867 5128 166 2685 166 166 2616 1972 2617 3943 +4664 166 4999 166 166 145 3635 166 166 4851 166 3483 5039 166 3649 3924 166 166 +166 3105 4260 166 6098 166 3568 267 2456 3653 2096 166 166 166 3512 166 3405 +166 3504 166 166 166 4005 2144 1769 166 5474 1920 5554 215 2443 3351 166 5961 +166 166 166 166 242 2331 166 166 5931 166 166 5862 166 1710 166 166 166 3321 +166 4139 166 166 3515 2732 2510 5544 166 166 2783 166 166 166 4018 4649 5789 +166 166 166 166 166 2726 6074 166 166 166 5684 166 166 3395 166 3100 166 5763 +3757 1992 166 3198 2003 166 166 4675 166 1893 5621 166 2270 166 166 166 5421 +5590 5664 4045 166 3687 4406 2699 1811 167 4036 5384 166 166 4601 1823 4041 239 +1954 166 146 166 166 3077 5152 5814 1649 5681 166 5868 166 166 3792 4860 166 +5335 5110 1718 166 166 166 166 3718 3365 2826 166 166 5021 4783 166 5569 5812 +166 166 1876 166 3260 166 1789 5667 4224 166 166 4385 166 166 2620 166 4162 +2883 2143 5497 166 166 5316 5680 166 166 248 4050 166 6021 166 2898 4618 166 +166 166 166 166 5368 166 5378 1842 1914 3696 3962 166 4345 2581 1773 2109 166 +4371 166 166 3761 5277 5870 3146 166 166 166 5764 127 3058 4059 4718 166 5097 +5040 5351 3205 166 166 4996 2991 2014 166 5846 2558 2688 5595 4027 3347 2125 +5696 5608 166 166 3228 3745 5775 166 1757 4647 166 5977 3020 166 240 2565 166 +4459 166 3367 166 166 166 3104 166 166 166 166 166 166 259 5486 2846 166 166 +166 4778 2713 166 3955 5683 2682 2914 5898 166 166 166 4400 317 166 5185 3021 +5983 4332 3891 166 3095 5003 166 166 166 5367 166 279 1784 4019 2736 4905 2651 +5346 166 4841 166 5606 166 166 2806 166 5239 166 166 3237 5490 166 225 166 166 +2254 166 2742 4587 22 166 166 166 5555 166 108 2927 2218 166 2120 166 5452 4087 +4369 166 166 166 166 166 4583 4338 6035 2840 4365 3624 11 1770 166 4630 166 +3216 166 166 166 4638 4699 3535 2536 4627 166 166 5760 1935 166 166 5210 166 +2219 2484 4597 5193 4799 3706 166 166 166 166 3337 3113 5951 4294 166 4040 3200 +4217 5861 2767 3530 4499 2775 4121 134 5939 5880 5908 3869 166 166 3316 6095 +2441 3288 166 3751 4794 166 166 5803 6169 2356 6182 6135 6127 166 3018 166 1674 +166 166 4097 166 5923 287 5965 5129 166 4078 166 166 6114 6015 5990 3573 166 +4146 2681 90 6055 4864 166 166 6119 3284 6054 5456 5113 6125 166 6057 166 3292 +166 166 166 166 166 6185 5105 1760 166 166 166 2720 166 2695 5448 166 1936 166 +1807 3406 166 166 2161 1642 166 5030 166 2036 5451 3427 166 166 166 166 3797 +166 1627 166 4515 166 166 166 4241 166 166 166 2771 166 31 5197 2638 3035 166 +166 3914 166 166 4546 166 166 166 4253 3500 166 166 2526 166 2698 166 3726 2744 +137 166 166 2676 166 5594 166 166 166 4842 166 63 2888 3585 4798 166 5011 166 +5634 5464 166 166 5620 3894 4070 166 2730 166 166 1810 2503 5957 1721 6066 5188 +166 166 1890 4505 1771 5455 166 3132 3984 166 166 2811 1962 166 166 4872 106 +3898 3267 166 2085 166 4950 6040 4525 6044 5866 3613 2907 4615 2135 258 166 +1681 1941 4888 166 4859 6178 6174 4858 5209 1912 3340 166 4640 5706 166 2763 +3153 3951 166 5542 5596 5819 5330 5048 4037 166 6033 4625 3326 2013 5283 136 +3373 2154 166 166 166 4421 166 5438 2627 2266 2320 166 2588 4790 4290 166 4767 +5829 2925 5916 2133 166 } diff --git a/extra/poker/poker-tests.factor b/extra/poker/poker-tests.factor index 29bd3ce6b8..9b7e99d3ea 100644 --- a/extra/poker/poker-tests.factor +++ b/extra/poker/poker-tests.factor @@ -8,9 +8,11 @@ IN: poker.tests [ 7462 ] [ "7C 5D 4H 3S 2C" value>> ] unit-test [ 1601 ] [ "KD QS JC TH 9S" value>> ] unit-test +[ 11 ] [ "AC AD AH AS KC" value>> ] unit-test [ 9 ] [ "6C 5C 4C 3C 2C" value>> ] unit-test [ 1 ] [ "AC KC QC JC TC" value>> ] unit-test [ "High Card" ] [ "7C 5D 4H 3S 2C" >value ] unit-test [ "Straight" ] [ "KD QS JC TH 9S" >value ] unit-test +[ "Four of a Kind" ] [ "AC AD AH AS KC" >value ] unit-test [ "Straight Flush" ] [ "6C 5C 4C 3C 2C" >value ] unit-test diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor index 172bb49506..ca999dbf6e 100644 --- a/extra/poker/poker.factor +++ b/extra/poker/poker.factor @@ -4,8 +4,10 @@ USING: accessors ascii binary-search combinators kernel locals math math.bitwise math.order poker.arrays sequences splitting ; IN: poker -! The algorithm used is based on Cactus Kev's Poker Hand Evaluator: +! The algorithm used is based on Cactus Kev's Poker Hand Evaluator with +! the Senzee Perfect Hash Optimization: ! http://www.suffecool.net/poker/evaluator.html +! http://www.senzee5.com/2006/06/some-perfect-hash.html card-rank ( card -- str ) From 87121c1468063196b3a210369ecc1fe1f8798dc6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 20:44:12 -0500 Subject: [PATCH 10/65] Fix prettyprinting of URLs --- basis/urls/prettyprint/prettyprint.factor | 7 +++++-- basis/urls/urls-tests.factor | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/basis/urls/prettyprint/prettyprint.factor b/basis/urls/prettyprint/prettyprint.factor index 59fb79e8d3..35e428c8fa 100644 --- a/basis/urls/prettyprint/prettyprint.factor +++ b/basis/urls/prettyprint/prettyprint.factor @@ -1,6 +1,9 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel present prettyprint.custom prettyprint.backend urls ; +USING: kernel present prettyprint.custom prettyprint.sections +prettyprint.backend urls ; IN: urls.prettyprint -M: url pprint* dup present "URL\" " "\"" pprint-string ; +M: url pprint* + \ URL" record-vocab + dup present "URL\" " "\"" pprint-string ; diff --git a/basis/urls/urls-tests.factor b/basis/urls/urls-tests.factor index 74eea9506c..f45ad6449e 100644 --- a/basis/urls/urls-tests.factor +++ b/basis/urls/urls-tests.factor @@ -1,5 +1,5 @@ IN: urls.tests -USING: urls urls.private tools.test +USING: urls urls.private tools.test prettyprint arrays kernel assocs present accessors ; CONSTANT: urls @@ -227,3 +227,5 @@ urls [ [ "http://localhost/?foo=bar" >url ] unit-test [ "/" ] [ "http://www.jedit.org" >url path>> ] unit-test + +[ "USING: urls ;\nURL\" foo\"" ] [ URL" foo" unparse-use ] unit-test \ No newline at end of file From 68728d1cc4d82d688ff7c46990efd96b27b90c84 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 20:44:34 -0500 Subject: [PATCH 11/65] Fix prettyprint of CONSTANT: and ALIAS: --- basis/see/see-tests.factor | 11 +++++++++++ basis/see/see.factor | 12 ++++++++++-- core/words/alias/alias.factor | 7 ++++--- core/words/constant/constant-tests.factor | 14 ++++++++++++++ core/words/constant/constant.factor | 8 ++++++-- 5 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 basis/see/see-tests.factor create mode 100644 core/words/constant/constant-tests.factor diff --git a/basis/see/see-tests.factor b/basis/see/see-tests.factor new file mode 100644 index 0000000000..3f11ec987e --- /dev/null +++ b/basis/see/see-tests.factor @@ -0,0 +1,11 @@ +IN: see.tests +USING: see tools.test io.streams.string math ; + +CONSTANT: test-const 10 +[ "IN: see.tests\nCONSTANT: test-const 10 inline\n" ] +[ [ \ test-const see ] with-string-writer ] unit-test + +ALIAS: test-alias + + +[ "USING: math ;\nIN: see.tests\nALIAS: test-alias + inline\n" ] +[ [ \ test-alias see ] with-string-writer ] unit-test diff --git a/basis/see/see.factor b/basis/see/see.factor index 32f49499db..9fc14ff581 100644 --- a/basis/see/see.factor +++ b/basis/see/see.factor @@ -7,7 +7,7 @@ definitions effects generic generic.standard io io.pathnames io.streams.string io.styles kernel make namespaces prettyprint prettyprint.backend prettyprint.config prettyprint.custom prettyprint.sections sequences sets sorting strings summary -words words.symbol ; +words words.symbol words.constant words.alias ; IN: see GENERIC: synopsis* ( defspec -- ) @@ -29,8 +29,16 @@ GENERIC: see* ( defspec -- ) : comment. ( text -- ) H{ { font-style italic } } styled-text ; +GENERIC: print-stack-effect? ( word -- ? ) + +M: parsing-word print-stack-effect? drop f ; +M: symbol print-stack-effect? drop f ; +M: constant print-stack-effect? drop f ; +M: alias print-stack-effect? drop f ; +M: word print-stack-effect? drop t ; + : stack-effect. ( word -- ) - [ [ parsing-word? ] [ symbol? ] bi or not ] [ stack-effect ] bi and + [ print-stack-effect? ] [ stack-effect ] bi and [ effect>string comment. ] when* ; > first stack-effect ; +M: alias definer drop \ ALIAS: f ; + +M: alias definition def>> first 1quotation ; \ No newline at end of file diff --git a/core/words/constant/constant-tests.factor b/core/words/constant/constant-tests.factor new file mode 100644 index 0000000000..2755039af6 --- /dev/null +++ b/core/words/constant/constant-tests.factor @@ -0,0 +1,14 @@ +IN: words.constant.tests +USING: tools.test math ; + +CONSTANT: a + + +[ + ] [ a ] unit-test + +CONSTANT: b \ + + +[ \ + ] [ b ] unit-test + +CONSTANT: c { 1 2 3 } + +[ { 1 2 3 } ] [ c ] unit-test diff --git a/core/words/constant/constant.factor b/core/words/constant/constant.factor index 43b7f37599..00302df98a 100644 --- a/core/words/constant/constant.factor +++ b/core/words/constant/constant.factor @@ -1,6 +1,6 @@ -! Copyright (C) 2008 Slava Pestov. +! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors kernel sequences words ; +USING: accessors kernel sequences words definitions quotations ; IN: words.constant PREDICATE: constant < word ( obj -- ? ) @@ -8,3 +8,7 @@ PREDICATE: constant < word ( obj -- ? ) : define-constant ( word value -- ) [ ] curry (( -- value )) define-inline ; + +M: constant definer drop \ CONSTANT: f ; + +M: constant definition def>> first literalize 1quotation ; \ No newline at end of file From 880f4097adf08767d96f014cd2476fa835e54b38 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 20:50:45 -0500 Subject: [PATCH 12/65] Clear button in search field is now positioned correctly --- basis/ui/gadgets/search-tables/search-tables-tests.factor | 3 +++ basis/ui/gadgets/search-tables/search-tables.factor | 1 + 2 files changed, 4 insertions(+) create mode 100644 basis/ui/gadgets/search-tables/search-tables-tests.factor diff --git a/basis/ui/gadgets/search-tables/search-tables-tests.factor b/basis/ui/gadgets/search-tables/search-tables-tests.factor new file mode 100644 index 0000000000..5a627286f9 --- /dev/null +++ b/basis/ui/gadgets/search-tables/search-tables-tests.factor @@ -0,0 +1,3 @@ +IN: ui.gadgets.search-tables.tests +USING: ui.gadgets.search-tables sequences tools.test ; +[ [ second ] ] must-infer diff --git a/basis/ui/gadgets/search-tables/search-tables.factor b/basis/ui/gadgets/search-tables/search-tables.factor index 4a2983bfe0..17570a8714 100644 --- a/basis/ui/gadgets/search-tables/search-tables.factor +++ b/basis/ui/gadgets/search-tables/search-tables.factor @@ -28,6 +28,7 @@ TUPLE: search-field < track field ; : ( model -- gadget ) horizontal search-field new-track + 0 >>fill { 5 5 } >>gap +baseline+ >>align swap 10 >>min-cols >>field From cbc63b49690aed45efa74c06fc46712e04c7e84f Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Sun, 5 Apr 2009 23:28:13 -0400 Subject: [PATCH 13/65] Add more unit test coverage for poker vocab --- extra/poker/poker-tests.factor | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extra/poker/poker-tests.factor b/extra/poker/poker-tests.factor index 9b7e99d3ea..f7d9e4f6c3 100644 --- a/extra/poker/poker-tests.factor +++ b/extra/poker/poker-tests.factor @@ -5,7 +5,6 @@ IN: poker.tests [ 529159 ] [ "5s" >ckf ] unit-test [ 33589533 ] [ "jc" >ckf ] unit-test - [ 7462 ] [ "7C 5D 4H 3S 2C" value>> ] unit-test [ 1601 ] [ "KD QS JC TH 9S" value>> ] unit-test [ 11 ] [ "AC AD AH AS KC" value>> ] unit-test @@ -16,3 +15,12 @@ IN: poker.tests [ "Straight" ] [ "KD QS JC TH 9S" >value ] unit-test [ "Four of a Kind" ] [ "AC AD AH AS KC" >value ] unit-test [ "Straight Flush" ] [ "6C 5C 4C 3C 2C" >value ] unit-test + +[ +gt+ ] [ "7C 5D 4H 3S 2C" "KD QS JC TH 9S" [ ] bi@ <=> ] unit-test +[ +lt+ ] [ "AC AD AH AS KC" "KD QS JC TH 9S" [ ] bi@ <=> ] unit-test +[ +eq+ ] [ "7C 5D 4H 3S 2C" "7D 5D 4D 3C 2S" [ ] bi@ <=> ] unit-test + +[ t ] [ "7C 5D 4H 3S 2C" "2C 3S 4H 5D 7C" [ ] bi@ = ] unit-test + +[ t ] [ "7C 5D 4H 3S 2C" "7D 5D 4D 3C 2S" [ ] bi@ = ] unit-test +[ f ] [ "7C 5D 4H 3S 2C" "7D 5D 4D 3C 2S" [ ] bi@ eq? ] unit-test From 687e9f90fe70c5e0491995fa911d797b9eaf07d3 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 23:16:48 -0500 Subject: [PATCH 14/65] Move models.history to extra --- basis/models/models-docs.factor | 1 - {basis => extra}/models/history/history-docs.factor | 0 {basis => extra}/models/history/history-tests.factor | 0 {basis => extra}/models/history/history.factor | 0 {basis => extra}/models/history/summary.txt | 0 5 files changed, 1 deletion(-) rename {basis => extra}/models/history/history-docs.factor (100%) rename {basis => extra}/models/history/history-tests.factor (100%) rename {basis => extra}/models/history/history.factor (100%) rename {basis => extra}/models/history/summary.txt (100%) diff --git a/basis/models/models-docs.factor b/basis/models/models-docs.factor index 2b90bdb0d5..8f40a8adbe 100644 --- a/basis/models/models-docs.factor +++ b/basis/models/models-docs.factor @@ -133,7 +133,6 @@ $nl { $subsection "models-impl" } { $subsection "models.arrow" } { $subsection "models.product" } -{ $subsection "models-history" } { $subsection "models-range" } { $subsection "models-delay" } ; diff --git a/basis/models/history/history-docs.factor b/extra/models/history/history-docs.factor similarity index 100% rename from basis/models/history/history-docs.factor rename to extra/models/history/history-docs.factor diff --git a/basis/models/history/history-tests.factor b/extra/models/history/history-tests.factor similarity index 100% rename from basis/models/history/history-tests.factor rename to extra/models/history/history-tests.factor diff --git a/basis/models/history/history.factor b/extra/models/history/history.factor similarity index 100% rename from basis/models/history/history.factor rename to extra/models/history/history.factor diff --git a/basis/models/history/summary.txt b/extra/models/history/summary.txt similarity index 100% rename from basis/models/history/summary.txt rename to extra/models/history/summary.txt From 8bf5fde791b992a73761614e6024982a804317df Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 23:18:25 -0500 Subject: [PATCH 15/65] Rename scroll word to set-scroll-position and make it public --- .../gadgets/scrollers/scrollers-docs.factor | 8 +++--- .../gadgets/scrollers/scrollers-tests.factor | 2 +- basis/ui/gadgets/scrollers/scrollers.factor | 25 ++++++++++--------- basis/ui/gadgets/viewports/viewports.factor | 4 +-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/basis/ui/gadgets/scrollers/scrollers-docs.factor b/basis/ui/gadgets/scrollers/scrollers-docs.factor index 8e0131ec31..92831bea00 100644 --- a/basis/ui/gadgets/scrollers/scrollers-docs.factor +++ b/basis/ui/gadgets/scrollers/scrollers-docs.factor @@ -11,11 +11,11 @@ HELP: find-scroller { $values { "gadget" gadget } { "scroller/f" { $maybe scroller } } } { $description "Finds the first parent of " { $snippet "gadget" } " which is a " { $link scroller } ". Outputs " { $link f } " if the gadget is not contained in a " { $link scroller } "." } ; -HELP: scroller-value +HELP: scroll-position { $values { "scroller" scroller } { "loc" "a pair of integers" } } { $description "Outputs the offset of the top-left corner of the scroller's " { $link viewport } "'s child." } ; -{ scroller-value scroll scroll>bottom scroll>top scroll>rect } related-words +{ scroll-position scroll scroll>bottom scroll>top scroll>rect } related-words HELP: { $values { "gadget" gadget } { "scroller" "a new " { $link scroller } } } @@ -48,8 +48,8 @@ ARTICLE: "ui.gadgets.scrollers" "Scroller gadgets" { $subsection scroller } { $subsection } "Getting and setting the scroll position:" -{ $subsection scroller-value } -{ $subsection scroll } +{ $subsection scroll-position } +{ $subsection set-scroll-position } "Writing scrolling-aware gadgets:" { $subsection scroll>bottom } { $subsection scroll>top } diff --git a/basis/ui/gadgets/scrollers/scrollers-tests.factor b/basis/ui/gadgets/scrollers/scrollers-tests.factor index d4cdc95daf..cf63d616be 100644 --- a/basis/ui/gadgets/scrollers/scrollers-tests.factor +++ b/basis/ui/gadgets/scrollers/scrollers-tests.factor @@ -74,7 +74,7 @@ dup layout drop "g2" get scroll>gadget "s" get layout - "s" get scroller-value + "s" get scroll-position ] map [ { 0 0 } = ] all? ] unit-test diff --git a/basis/ui/gadgets/scrollers/scrollers.factor b/basis/ui/gadgets/scrollers/scrollers.factor index a526cc618b..0852a6fe5d 100644 --- a/basis/ui/gadgets/scrollers/scrollers.factor +++ b/basis/ui/gadgets/scrollers/scrollers.factor @@ -29,6 +29,13 @@ M: gadget viewport-column-header drop f ; : scroll-down-line ( scroller -- ) y>> 1 swap slide-by-line ; +: set-scroll-position ( value scroller -- ) + [ + viewport>> [ dim>> { 0 0 } ] [ gadget-child pref-dim ] bi + 4array flip + ] keep + 2dup control-value = [ 2drop ] [ set-control-value ] if ; + > [ dim>> { 0 0 } ] [ gadget-child pref-dim ] bi - 4array flip - ] keep - 2dup control-value = [ 2drop ] [ set-control-value ] if ; - : (scroll>rect) ( rect scroller -- ) { - [ scroller-value vneg offset-rect ] + [ scroll-position vneg offset-rect ] [ viewport>> dim>> rect-min ] [ viewport>> loc>> offset-rect ] [ viewport>> [ v- { 0 0 } vmin ] [ v- { 0 0 } vmax ] with-rect-extents v+ ] - [ scroller-value v+ ] - [ scroll ] + [ scroll-position v+ ] + [ set-scroll-position ] } cleave ; : relative-scroll-rect ( rect gadget scroller -- newrect ) @@ -72,7 +72,7 @@ M: viewport pref-dim* gadget-child pref-viewport-dim ; 2&& ; : (update-scroller) ( scroller -- ) - [ scroller-value ] keep scroll ; + [ scroll-position ] keep set-scroll-position ; : (scroll>gadget) ( gadget scroller -- ) 2dup swap child? [ @@ -82,7 +82,8 @@ M: viewport pref-dim* gadget-child pref-viewport-dim ; ] [ f >>follows (update-scroller) drop ] if ; : (scroll>bottom) ( scroller -- ) - [ viewport>> gadget-child pref-dim { 0 1 } v* ] keep scroll ; + [ viewport>> gadget-child pref-dim { 0 1 } v* ] keep + set-scroll-position ; GENERIC: update-scroller ( scroller follows -- ) diff --git a/basis/ui/gadgets/viewports/viewports.factor b/basis/ui/gadgets/viewports/viewports.factor index c14c7f01fb..b154ef2322 100644 --- a/basis/ui/gadgets/viewports/viewports.factor +++ b/basis/ui/gadgets/viewports/viewports.factor @@ -23,7 +23,7 @@ M: viewport layout* M: viewport focusable-child* gadget-child ; -: scroller-value ( scroller -- loc ) +: scroll-position ( scroller -- loc ) model>> range-value [ >integer ] map ; M: viewport model-changed @@ -31,7 +31,7 @@ M: viewport model-changed [ relayout-1 ] [ [ gadget-child ] - [ scroller-value vneg ] + [ scroll-position vneg ] [ constraint>> ] tri v* >>loc drop ] bi ; From 78013c2bdffc9f579bbe1d8c137c265f32b7e77e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 23:19:18 -0500 Subject: [PATCH 16/65] Rename scroll word to set-scroll-position and make it public --- basis/ui/gadgets/scrollers/scrollers-docs.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/ui/gadgets/scrollers/scrollers-docs.factor b/basis/ui/gadgets/scrollers/scrollers-docs.factor index 92831bea00..011afa5c97 100644 --- a/basis/ui/gadgets/scrollers/scrollers-docs.factor +++ b/basis/ui/gadgets/scrollers/scrollers-docs.factor @@ -15,7 +15,7 @@ HELP: scroll-position { $values { "scroller" scroller } { "loc" "a pair of integers" } } { $description "Outputs the offset of the top-left corner of the scroller's " { $link viewport } "'s child." } ; -{ scroll-position scroll scroll>bottom scroll>top scroll>rect } related-words +{ scroll-position set-scroll-position scroll>bottom scroll>top scroll>rect } related-words HELP: { $values { "gadget" gadget } { "scroller" "a new " { $link scroller } } } @@ -23,7 +23,7 @@ HELP: { } related-words -HELP: scroll +HELP: set-scroll-position { $values { "scroller" scroller } { "value" "a pair of integers" } } { $description "Sets the offset of the top-left corner of the scroller's " { $link viewport } "'s child." } ; From 88bbb47bfa31afb37513628286b4146198da93f0 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 23:19:35 -0500 Subject: [PATCH 17/65] Browser tool now saves scroll bar position in history --- basis/ui/tools/browser/browser.factor | 41 ++++++++++++------- basis/ui/tools/browser/history/authors.txt | 1 + .../browser/history/history-tests.factor | 36 ++++++++++++++++ basis/ui/tools/browser/history/history.factor | 32 +++++++++++++++ 4 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 basis/ui/tools/browser/history/authors.txt create mode 100644 basis/ui/tools/browser/history/history-tests.factor create mode 100644 basis/ui/tools/browser/history/history.factor diff --git a/basis/ui/tools/browser/browser.factor b/basis/ui/tools/browser/browser.factor index e242b743f8..0c6e1fe05a 100644 --- a/basis/ui/tools/browser/browser.factor +++ b/basis/ui/tools/browser/browser.factor @@ -1,23 +1,33 @@ ! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: debugger help help.topics help.crossref help.home kernel -models compiler.units assocs words vocabs accessors fry -combinators.short-circuit namespaces sequences models -models.history help.apropos combinators ui.commands ui.gadgets -ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks -ui.gestures ui.gadgets.buttons ui.gadgets.packs -ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar -ui.gadgets.glass ui.gadgets.borders ui.tools.common -ui.tools.browser.popups ui ; +USING: debugger help help.topics help.crossref help.home kernel models +compiler.units assocs words vocabs accessors fry arrays +combinators.short-circuit namespaces sequences models help.apropos +combinators ui ui.commands ui.gadgets ui.gadgets.panes +ui.gadgets.scrollers ui.gadgets.tracks ui.gestures ui.gadgets.buttons +ui.gadgets.packs ui.gadgets.editors ui.gadgets.labels +ui.gadgets.status-bar ui.gadgets.glass ui.gadgets.borders ui.gadgets.viewports +ui.tools.common ui.tools.browser.popups ui.tools.browser.history ; IN: ui.tools.browser -TUPLE: browser-gadget < tool pane scroller search-field popup ; +TUPLE: browser-gadget < tool history pane scroller search-field popup ; { 650 400 } browser-gadget set-tool-dim +M: browser-gadget history-value + [ control-value ] [ scroller>> scroll-position ] + bi 2array ; + +M: browser-gadget set-history-value + [ first2 ] dip + [ set-control-value ] [ scroller>> set-scroll-position ] + bi-curry bi* ; + : show-help ( link browser-gadget -- ) - [ >link ] [ model>> ] bi* - [ [ add-recent ] [ add-history ] bi* ] [ set-model ] 2bi ; + [ >link ] dip + [ [ add-recent ] [ history>> add-history ] bi* ] + [ model>> set-model ] + 2bi ; : ( browser-gadget -- gadget ) model>> [ '[ _ print-topic ] try ] ; @@ -41,7 +51,8 @@ TUPLE: browser-gadget < tool pane scroller search-field popup ; : ( link -- gadget ) vertical browser-gadget new-track 1 >>fill - swap >link >>model + swap >link >>model + dup >>history dup >>search-field dup { 3 3 } { 1 0 } >>fill f track-add dup >>pane @@ -93,9 +104,9 @@ M: browser-gadget focusable-child* search-field>> ; \ show-browser H{ { +nullary+ t } } define-command -: com-back ( browser -- ) model>> go-back ; +: com-back ( browser -- ) history>> go-back ; -: com-forward ( browser -- ) model>> go-forward ; +: com-forward ( browser -- ) history>> go-forward ; : com-home ( browser -- ) "help.home" swap show-help ; diff --git a/basis/ui/tools/browser/history/authors.txt b/basis/ui/tools/browser/history/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/basis/ui/tools/browser/history/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/basis/ui/tools/browser/history/history-tests.factor b/basis/ui/tools/browser/history/history-tests.factor new file mode 100644 index 0000000000..20b16f450a --- /dev/null +++ b/basis/ui/tools/browser/history/history-tests.factor @@ -0,0 +1,36 @@ +USING: namespaces ui.tools.browser.history sequences tools.test ; +IN: ui.tools.browser.history.tests + +f "history" set + +"history" get add-history + +[ t ] [ "history" get back>> empty? ] unit-test +[ t ] [ "history" get forward>> empty? ] unit-test + +"history" get add-history +"history" get 3 >>value drop + +[ t ] [ "history" get back>> empty? ] unit-test +[ t ] [ "history" get forward>> empty? ] unit-test + +"history" get add-history +"history" get 4 >>value drop + +[ f ] [ "history" get back>> empty? ] unit-test +[ t ] [ "history" get forward>> empty? ] unit-test + +"history" get go-back + +[ 3 ] [ "history" get value>> ] unit-test + +[ t ] [ "history" get back>> empty? ] unit-test +[ f ] [ "history" get forward>> empty? ] unit-test + +"history" get go-forward + +[ 4 ] [ "history" get value>> ] unit-test + +[ f ] [ "history" get back>> empty? ] unit-test +[ t ] [ "history" get forward>> empty? ] unit-test + diff --git a/basis/ui/tools/browser/history/history.factor b/basis/ui/tools/browser/history/history.factor new file mode 100644 index 0000000000..f80189c783 --- /dev/null +++ b/basis/ui/tools/browser/history/history.factor @@ -0,0 +1,32 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel accessors sequences locals ; +IN: ui.tools.browser.history + +TUPLE: history owner back forward ; + +: ( owner -- history ) + V{ } clone V{ } clone history boa ; + +GENERIC: history-value ( object -- value ) + +GENERIC: set-history-value ( value object -- ) + +: (add-history) ( history to -- ) + swap owner>> history-value dup [ swap push ] [ 2drop ] if ; + +:: go-back/forward ( history to from -- ) + from empty? [ + history to (add-history) + from pop history owner>> set-history-value + ] unless ; + +: go-back ( history -- ) + dup [ forward>> ] [ back>> ] bi go-back/forward ; + +: go-forward ( history -- ) + dup [ back>> ] [ forward>> ] bi go-back/forward ; + +: add-history ( history -- ) + dup forward>> delete-all + dup back>> (add-history) ; \ No newline at end of file From 8201139dc7669ca7c79ef0b1d6db6ad39711cafc Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Mon, 6 Apr 2009 00:30:21 -0400 Subject: [PATCH 18/65] One more poker unit test dealing with equality --- extra/poker/poker-tests.factor | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extra/poker/poker-tests.factor b/extra/poker/poker-tests.factor index f7d9e4f6c3..1862974084 100644 --- a/extra/poker/poker-tests.factor +++ b/extra/poker/poker-tests.factor @@ -16,6 +16,8 @@ IN: poker.tests [ "Four of a Kind" ] [ "AC AD AH AS KC" >value ] unit-test [ "Straight Flush" ] [ "6C 5C 4C 3C 2C" >value ] unit-test +[ "6C 5C 4C 3C 2C" ] [ "6C 5C 4C 3C 2C" >cards ] unit-test + [ +gt+ ] [ "7C 5D 4H 3S 2C" "KD QS JC TH 9S" [ ] bi@ <=> ] unit-test [ +lt+ ] [ "AC AD AH AS KC" "KD QS JC TH 9S" [ ] bi@ <=> ] unit-test [ +eq+ ] [ "7C 5D 4H 3S 2C" "7D 5D 4D 3C 2S" [ ] bi@ <=> ] unit-test From cb6030778f78d75ec1bcb2a28873cd9ab05bbc2f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 5 Apr 2009 23:38:47 -0500 Subject: [PATCH 19/65] Fix ui.gadgets.scrollers unit tests --- basis/ui/gadgets/scrollers/scrollers-tests.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/ui/gadgets/scrollers/scrollers-tests.factor b/basis/ui/gadgets/scrollers/scrollers-tests.factor index cf63d616be..22df1f328b 100644 --- a/basis/ui/gadgets/scrollers/scrollers-tests.factor +++ b/basis/ui/gadgets/scrollers/scrollers-tests.factor @@ -45,13 +45,13 @@ IN: ui.gadgets.scrollers.tests [ { 100 100 } ] [ "s" get viewport>> gadget-child pref-dim ] unit-test - [ ] [ { 0 0 } "s" get scroll ] unit-test + [ ] [ { 0 0 } "s" get set-scroll-position ] unit-test [ { 0 0 } ] [ "s" get model>> range-min-value ] unit-test [ { 100 100 } ] [ "s" get model>> range-max-value ] unit-test - [ ] [ { 10 20 } "s" get scroll ] unit-test + [ ] [ { 10 20 } "s" get set-scroll-position ] unit-test [ { 10 20 } ] [ "s" get model>> range-value ] unit-test From 42f3b0e16e8d327c048053663788fe096986ca89 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 01:10:34 -0500 Subject: [PATCH 20/65] Fix bootstrap errors --- basis/bootstrap/stage2.factor | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/basis/bootstrap/stage2.factor b/basis/bootstrap/stage2.factor index 6c824b6155..12741f2170 100644 --- a/basis/bootstrap/stage2.factor +++ b/basis/bootstrap/stage2.factor @@ -45,11 +45,18 @@ SYMBOL: bootstrap-time [ optimized>> ] count-words " compiled words" print [ symbol? ] count-words " symbol words" print [ ] count-words " words total" print - + "Bootstrapping is complete." print "Now, you can run Factor:" print vm write " -i=" write "output-image" get print flush ; +: save/restore-error ( quot -- ) + error get-global + error-continuation get-global + [ call ] 2dip + error-continuation set-global + error set-global ; inline + [ ! We time bootstrap millis @@ -104,6 +111,7 @@ SYMBOL: bootstrap-time drop [ load-help? off - "vocab:bootstrap/bootstrap-error.factor" run-file + [ "vocab:bootstrap/bootstrap-error.factor" parse-file ] save/restore-error + call ] with-scope ] recover From 3752c706da151d168dbddf903c6ca4a91e41b5a9 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 02:57:39 -0500 Subject: [PATCH 21/65] Add M\ syntax for method literals --- basis/prettyprint/backend/backend.factor | 32 +++++++++++----------- basis/prettyprint/prettyprint-tests.factor | 22 --------------- core/bootstrap/syntax.factor | 1 + core/syntax/syntax-docs.factor | 4 +++ core/syntax/syntax.factor | 1 + 5 files changed, 22 insertions(+), 38 deletions(-) diff --git a/basis/prettyprint/backend/backend.factor b/basis/prettyprint/backend/backend.factor index bcd91a4d94..8004c1141f 100644 --- a/basis/prettyprint/backend/backend.factor +++ b/basis/prettyprint/backend/backend.factor @@ -41,18 +41,18 @@ M: effect pprint* effect>string "(" ")" surround text ; : pprint-prefix ( word quot -- ) ; inline +M: parsing-word pprint* + \ POSTPONE: [ pprint-word ] pprint-prefix ; + M: word pprint* - dup parsing-word? [ - \ POSTPONE: [ pprint-word ] pprint-prefix - ] [ - { - [ "break-before" word-prop line-break ] - [ pprint-word ] - [ ?start-group ] - [ ?end-group ] - [ "break-after" word-prop line-break ] - } cleave - ] if ; + [ pprint-word ] [ ?start-group ] [ ?end-group ] tri ; + +M: method-body pprint* + ; M: real pprint* number>string text ; @@ -206,8 +206,8 @@ M: curry pprint* pprint-object ; M: compose pprint* pprint-object ; M: wrapper pprint* - dup wrapped>> word? [ - > pprint-word block> - ] [ - pprint-object - ] if ; + { + { [ dup wrapped>> method-body? ] [ wrapped>> pprint* ] } + { [ dup wrapped>> word? ] [ > pprint-word block> ] } + [ pprint-object ] + } cond ; diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 7e37aa0da5..3350ae6c7b 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -180,28 +180,6 @@ DEFER: parse-error-file "string-layout-test" string-layout check-see ] unit-test -! Define dummy words for the below... -: ( a b c d -- e ) ; -: ( -- fmt ) ; -: send ( obj -- ) ; - -\ send soft "break-after" set-word-prop - -: final-soft-break-test ( -- str ) - { - "USING: kernel sequences ;" - "IN: prettyprint.tests" - ": final-soft-break-layout ( class dim -- view )" - " [ \"alloc\" send 0 0 ] dip first2 " - " \"initWithFrame:pixelFormat:\" send" - " dup 1 \"setPostsBoundsChangedNotifications:\" send" - " dup 1 \"setPostsFrameChangedNotifications:\" send ;" - } ; - -[ t ] [ - "final-soft-break-layout" final-soft-break-test check-see -] unit-test - : narrow-test ( -- str ) { "USING: arrays combinators continuations kernel sequences ;" diff --git a/core/bootstrap/syntax.factor b/core/bootstrap/syntax.factor index 6e6812e25c..a0b349be51 100644 --- a/core/bootstrap/syntax.factor +++ b/core/bootstrap/syntax.factor @@ -62,6 +62,7 @@ IN: bootstrap.syntax "W{" "[" "\\" + "M\\" "]" "delimiter" "f" diff --git a/core/syntax/syntax-docs.factor b/core/syntax/syntax-docs.factor index df9eb568f6..bb8791df97 100644 --- a/core/syntax/syntax-docs.factor +++ b/core/syntax/syntax-docs.factor @@ -167,6 +167,8 @@ $nl ARTICLE: "syntax" "Syntax" "Factor has two main forms of syntax: " { $emphasis "definition" } " syntax and " { $emphasis "literal" } " syntax. Code is data, so the syntax for code is a special case of object literal syntax. This section documents literal syntax. Definition syntax is covered in " { $link "words" } ". Extending the parser is the main topic of " { $link "parser" } "." { $subsection "parser-algorithm" } +{ $subsection "vocabulary-search" } +{ $subsection "top-level-forms" } { $subsection "syntax-comments" } { $subsection "syntax-literals" } { $subsection "syntax-immediate" } ; @@ -762,7 +764,9 @@ HELP: >> { $description "Marks the end of a parse time code block." } ; HELP: call-next-method +{ $syntax "call-next-method" } { $description "Calls the next applicable method. Only valid inside a method definition. The values at the top of the stack are passed on to the next method, and they must be compatible with that method's class specializer." } +{ $notes "This word looks like an ordinary word but it is a parsing word. It cannot be factored out of a method definition, since the code expansion references the current method object directly." } { $errors "Throws a " { $link no-next-method } " error if this is the least specific method, and throws an " { $link inconsistent-next-method } " error if the values at the top of the stack are not compatible with the current method's specializer." } ; diff --git a/core/syntax/syntax.factor b/core/syntax/syntax.factor index cb5cdfd5ac..2e072f72d8 100644 --- a/core/syntax/syntax.factor +++ b/core/syntax/syntax.factor @@ -104,6 +104,7 @@ IN: bootstrap.syntax "POSTPONE:" [ scan-word parsed ] define-core-syntax "\\" [ scan-word parsed ] define-core-syntax + "M\\" [ scan-word scan-word method parsed ] define-core-syntax "inline" [ word make-inline ] define-core-syntax "recursive" [ word make-recursive ] define-core-syntax "foldable" [ word make-foldable ] define-core-syntax From 268abfcf2a389104a47e4f2174af4482de94b50f Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 02:59:59 -0500 Subject: [PATCH 22/65] Remove method-specs in favor of M\ --- basis/compiler/tree/debugger/debugger.factor | 2 -- basis/editors/editors-docs.factor | 2 +- basis/hints/hints.factor | 5 ++-- basis/see/see-docs.factor | 7 +++++- basis/see/see.factor | 6 ----- basis/tools/annotations/annotations.factor | 11 +-------- basis/tools/deploy/shaker/shaker.factor | 2 -- basis/tools/disassembler/disassembler.factor | 2 -- core/generic/generic.factor | 26 -------------------- 9 files changed, 10 insertions(+), 53 deletions(-) diff --git a/basis/compiler/tree/debugger/debugger.factor b/basis/compiler/tree/debugger/debugger.factor index 430424291e..8e102e0ea3 100644 --- a/basis/compiler/tree/debugger/debugger.factor +++ b/basis/compiler/tree/debugger/debugger.factor @@ -130,8 +130,6 @@ M: node node>quot drop ; GENERIC: optimized. ( quot/word -- ) -M: method-spec optimized. first2 method optimized. ; - M: word optimized. specialized-def optimized. ; M: callable optimized. build-tree optimize-tree nodes>quot . ; diff --git a/basis/editors/editors-docs.factor b/basis/editors/editors-docs.factor index 0f50e40eb4..e3961aef80 100644 --- a/basis/editors/editors-docs.factor +++ b/basis/editors/editors-docs.factor @@ -22,7 +22,7 @@ HELP: edit "A word's documentation:" { $code "\\ foo >link edit" } "A method definition:" - { $code "{ editor draw-gadget* } edit" } + { $code "M\\ fixnum + edit" } "A help article:" { $code "\"handbook\" >link edit" } } ; diff --git a/basis/hints/hints.factor b/basis/hints/hints.factor index 804ef035f4..6fece31d88 100644 --- a/basis/hints/hints.factor +++ b/basis/hints/hints.factor @@ -65,7 +65,6 @@ M: object specializer-declaration class ; SYNTAX: HINTS: scan-object - dup method-spec? [ first2 method ] when [ redefined ] [ parse-definition "specializer" set-word-prop ] bi ; @@ -119,6 +118,6 @@ SYNTAX: HINTS: \ >be { { bignum fixnum } { fixnum fixnum } } "specializer" set-word-prop -\ hashtable \ at* method { { fixnum object } { word object } } "specializer" set-word-prop +M\ hashtable at* { { fixnum object } { word object } } "specializer" set-word-prop -\ hashtable \ set-at method { { object fixnum object } { object word object } } "specializer" set-word-prop +M\ hashtable set-at { { object fixnum object } { object word object } } "specializer" set-word-prop diff --git a/basis/see/see-docs.factor b/basis/see/see-docs.factor index 6d51b42a86..b2e99843c7 100644 --- a/basis/see/see-docs.factor +++ b/basis/see/see-docs.factor @@ -13,7 +13,12 @@ HELP: synopsis* HELP: see { $values { "defspec" "a definition specifier" } } -{ $contract "Prettyprints a definition." } ; +{ $contract "Prettyprints a definition." } +{ $examples + "A word:" { $code "\\ append see" } + "A method:" { $code "USE: arrays" "M\\ array length see" } + "A help article:" { $code "USE: help.topics" "\"help\" >link see" } +} ; HELP: see-methods { $values { "word" "a " { $link generic } " or a " { $link class } } } diff --git a/basis/see/see.factor b/basis/see/see.factor index 9fc14ff581..2494c72fa4 100644 --- a/basis/see/see.factor +++ b/basis/see/see.factor @@ -76,9 +76,6 @@ M: hook-generic synopsis* [ stack-effect. ] } cleave ; -M: method-spec synopsis* - first2 method synopsis* ; - M: method-body synopsis* [ definer. ] [ "method-class" word-prop pprint-word ] @@ -122,9 +119,6 @@ M: object see* block> ] with-use ; -M: method-spec see* - first2 method see* ; - GENERIC: see-class* ( word -- ) M: union-class see-class* diff --git a/basis/tools/annotations/annotations.factor b/basis/tools/annotations/annotations.factor index 8c3d95f2b8..64e6508ab6 100644 --- a/basis/tools/annotations/annotations.factor +++ b/basis/tools/annotations/annotations.factor @@ -20,9 +20,6 @@ M: word reset f "unannotated-def" set-word-prop ] [ drop ] if ; -M: method-spec reset - first2 method reset ; - ERROR: cannot-annotate-twice word ; word ( obj -- word ) - dup method-spec? [ first2 method ] when ; - : save-unannotated-def ( word -- ) dup def>> "unannotated-def" set-word-prop ; @@ -44,7 +38,7 @@ ERROR: cannot-annotate-twice word ; PRIVATE> : annotate ( word quot -- ) - [ method-spec>word check-annotate-twice ] dip + [ check-annotate-twice ] dip [ over save-unannotated-def (annotate) ] with-compilation-unit ; spaces print ] each ; M: word disassemble word-xt 2array disassemble ; -M: method-spec disassemble first2 method disassemble ; - cpu x86? "tools.disassembler.udis" "tools.disassembler.gdb" ? diff --git a/core/generic/generic.factor b/core/generic/generic.factor index c22641d439..ab0685f1d6 100644 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -24,11 +24,6 @@ M: generic definition drop f ; : method ( class generic -- method/f ) "methods" word-prop at ; -PREDICATE: method-spec < pair - first2 generic? swap class? and ; - -INSTANCE: method-spec definition - : order ( generic -- seq ) "methods" word-prop keys sort-classes ; @@ -90,9 +85,6 @@ TUPLE: check-method class generic ; PREDICATE: method-body < word "method-generic" word-prop >boolean ; -M: method-spec stack-effect - first2 method stack-effect ; - M: method-body stack-effect "method-generic" word-prop stack-effect ; @@ -139,24 +131,6 @@ M: default-method irrelevant? drop t ; dupd "default-method" set-word-prop ; ! Definition protocol -M: method-spec where - dup first2 method [ ] [ second ] ?if where ; - -M: method-spec set-where - first2 method set-where ; - -M: method-spec definer - first2 method definer ; - -M: method-spec definition - first2 method definition ; - -M: method-spec forget* - first2 method [ forgotten-definition ] [ forget* ] bi ; - -M: method-spec smart-usage - second smart-usage ; - M: method-body definer drop \ M: \ ; ; From 99b8400e56e23584db5544e3b3cb64357721ec31 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 03:00:46 -0500 Subject: [PATCH 23/65] Documentation updates --- basis/alien/syntax/tags.txt | 1 + .../combinators/short-circuit/smart/tags.txt | 1 + basis/combinators/short-circuit/tags.txt | 1 + basis/combinators/smart/smart-docs.factor | 14 +- basis/combinators/smart/tags.txt | 1 + basis/help/cookbook/cookbook.factor | 2 +- basis/help/handbook/handbook.factor | 89 +++-- basis/help/home/home-docs.factor | 1 - basis/help/syntax/tags.txt | 1 + basis/interpolate/tags.txt | 1 + basis/locals/locals-docs.factor | 11 +- basis/math/ranges/ranges-docs.factor | 4 +- basis/peg/ebnf/tags.txt | 1 + basis/ui/tools/tools-docs.factor | 4 +- basis/unicode/unicode-docs.factor | 2 +- basis/values/values-docs.factor | 2 +- basis/xml/syntax/tags.txt | 1 + core/combinators/combinators-docs.factor | 315 ++++++++++++++++-- core/definitions/definitions-docs.factor | 15 +- core/effects/effects-docs.factor | 15 +- core/generic/generic-docs.factor | 13 +- core/generic/generic-tests.factor | 3 - core/generic/math/math-docs.factor | 2 +- core/kernel/kernel-docs.factor | 285 ---------------- core/math/math-docs.factor | 5 +- core/math/order/order-docs.factor | 11 +- core/namespaces/namespaces-docs.factor | 3 +- core/parser/parser-docs.factor | 2 - core/quotations/quotations-docs.factor | 2 +- core/sequences/sequences-docs.factor | 11 +- core/slots/slots-docs.factor | 5 +- extra/peg-lexer/tags.txt | 3 +- 32 files changed, 440 insertions(+), 387 deletions(-) create mode 100644 basis/alien/syntax/tags.txt create mode 100644 basis/combinators/short-circuit/smart/tags.txt create mode 100644 basis/combinators/short-circuit/tags.txt create mode 100644 basis/combinators/smart/tags.txt create mode 100644 basis/help/syntax/tags.txt create mode 100644 basis/interpolate/tags.txt diff --git a/basis/alien/syntax/tags.txt b/basis/alien/syntax/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/alien/syntax/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/combinators/short-circuit/smart/tags.txt b/basis/combinators/short-circuit/smart/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/combinators/short-circuit/smart/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/combinators/short-circuit/tags.txt b/basis/combinators/short-circuit/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/combinators/short-circuit/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/combinators/smart/smart-docs.factor b/basis/combinators/smart/smart-docs.factor index 75f83c1a55..679b587759 100644 --- a/basis/combinators/smart/smart-docs.factor +++ b/basis/combinators/smart/smart-docs.factor @@ -108,17 +108,19 @@ HELP: append-outputs-as ARTICLE: "combinators.smart" "Smart combinators" -"The " { $vocab-link "combinators.smart" } " vocabulary implements " { $emphasis "smart combinators" } ". A smart combinator is one whose behavior depends on the static stack effect of an input quotation." $nl -"Smart inputs from a sequence:" +"The macros in the " { $vocab-link "combinators.smart" } " vocabulary look at the static stack effects of input quotations and generate code which produces or consumes the relevant number of stack values." $nl +"Call a quotation and discard all output values:" +{ $subsection drop-outputs } +"Take all input values from a sequence:" { $subsection inputsequence } { $subsection output>array } -"Reducing the output of a quotation:" +"Reducing the set of output values:" { $subsection reduce-outputs } -"Summing the output of a quotation:" +"Summing output values:" { $subsection sum-outputs } -"Appending the results of a quotation:" +"Concatenating output values:" { $subsection append-outputs } { $subsection append-outputs-as } ; diff --git a/basis/combinators/smart/tags.txt b/basis/combinators/smart/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/combinators/smart/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/help/cookbook/cookbook.factor b/basis/help/cookbook/cookbook.factor index 2cc19f87dd..867f373209 100644 --- a/basis/help/cookbook/cookbook.factor +++ b/basis/help/cookbook/cookbook.factor @@ -117,7 +117,7 @@ $nl } { $references { "Since quotations are objects, they can be constructed and taken apart at will. You can write code that writes code. Arrays are just one of the various types of sequences, and the sequence operations such as " { $link each } " and " { $link map } " operate on all types of sequences. There are many more sequence iteration operations than the ones above, too." } - "dataflow" + "combinators" "sequences" } ; diff --git a/basis/help/handbook/handbook.factor b/basis/help/handbook/handbook.factor index ed2a14a2f2..b2a0e56c0a 100644 --- a/basis/help/handbook/handbook.factor +++ b/basis/help/handbook/handbook.factor @@ -5,7 +5,7 @@ math system strings sbufs vectors byte-arrays quotations io.streams.byte-array classes.builtin parser lexer classes.predicate classes.union classes.intersection classes.singleton classes.tuple help.vocabs math.parser -accessors ; +accessors definitions ; IN: help.handbook ARTICLE: "conventions" "Conventions" @@ -49,7 +49,7 @@ $nl { "associative mapping" { "an object whose class implements the " { $link "assocs-protocol" } } } { "boolean" { { $link t } " or " { $link f } } } { "class" { "a set of objects identified by a " { $emphasis "class word" } " together with a discriminating predicate. See " { $link "classes" } } } - { "definition specifier" { "a " { $link word } ", " { $link method-spec } ", " { $link link } ", vocabulary specifier, or any other object whose class implements the " { $link "definition-protocol" } } } + { "definition specifier" { "an instance of " { $link definition } " which implements the " { $link "definition-protocol" } } } { "generalized boolean" { "an object interpreted as a boolean; a value of " { $link f } " denotes false and anything else denotes true" } } { "generic word" { "a word whose behavior depends can be specialized on the class of one of its inputs. See " { $link "generic" } } } { "method" { "a specialized behavior of a generic word on a class. See " { $link "generic" } } } @@ -70,7 +70,7 @@ ARTICLE: "tail-call-opt" "Tail-call optimization" $nl "Tail-call optimization allows iterative algorithms to be implemented in an efficient manner using recursion, without the need for any kind of primitive looping construct in the language. However, in practice, most iteration is performed via combinators such as " { $link while } ", " { $link each } ", " { $link map } ", " { $link assoc-each } ", and so on. The definitions of these combinators do bottom-out in recursive words, however." ; -ARTICLE: "evaluator" "Evaluation semantics" +ARTICLE: "evaluator" "Stack machine model" { $link "quotations" } " are evaluated sequentially from beginning to end. When the end is reached, the quotation returns to its caller. As each object in the quotation is evaluated in turn, an action is taken based on its type:" { $list { "a " { $link word } " - the word's definition quotation is called. See " { $link "words" } } @@ -84,12 +84,13 @@ ARTICLE: "objects" "Objects" "An " { $emphasis "object" } " is any datum which may be identified. All values are objects in Factor. Each object carries type information, and types are checked at runtime; Factor is dynamically typed." { $subsection "equality" } { $subsection "math.order" } -{ $subsection "destructors" } { $subsection "classes" } { $subsection "tuples" } { $subsection "generic" } -{ $subsection "slots" } -{ $subsection "mirrors" } ; +"Advanced features:" +{ $subsection "delegate" } +{ $subsection "mirrors" } +{ $subsection "slots" } ; ARTICLE: "numbers" "Numbers" { $subsection "arithmetic" } @@ -118,9 +119,9 @@ ARTICLE: "collections" "Collections" "Fixed-length sequences:" { $subsection "arrays" } { $subsection "quotations" } -"Fixed-length specialized sequences:" { $subsection "strings" } { $subsection "byte-arrays" } +{ $subsection "specialized-arrays" } "Resizable sequences:" { $subsection "vectors" } { $subsection "byte-vectors" } @@ -128,7 +129,8 @@ ARTICLE: "collections" "Collections" { $subsection "growable" } { $heading "Associative mappings" } { $subsection "assocs" } -{ $subsection "namespaces" } +{ $subsection "linked-assocs" } +{ $subsection "biassocs" } { $subsection "refs" } "Implementations:" { $subsection "hashtables" } @@ -140,26 +142,29 @@ ARTICLE: "collections" "Collections" { $subsection "dlists" } { $subsection "search-deques" } { $heading "Other collections" } -{ $subsection "boxes" } +{ $subsection "lists" } +{ $subsection "disjoint-sets" } +{ $subsection "interval-maps" } { $subsection "heaps" } +{ $subsection "boxes" } { $subsection "graphs" } { $subsection "buffers" } "There are also many other vocabularies tagged " { $link T{ vocab-tag { name "collections" } } } " in the library." ; -USING: io.encodings.utf8 io.encodings.utf16 io.encodings.binary io.encodings.ascii io.files ; +USING: io.encodings.utf8 io.encodings.binary io.files ; ARTICLE: "encodings-introduction" "An introduction to encodings" "In order to express text in terms of binary, some sort of encoding has to be used. In a modern context, this is understood as a two-way mapping between Unicode code points (characters) and some amount of binary. Since English isn't the only language in the world, ASCII is not sufficient as a mapping from binary to Unicode; it can't even express em-dashes or curly quotes. Unicode was designed as a universal character set that could potentially represent everything." $nl "Not all encodings can represent all Unicode code points, but Unicode can represent basically everything that exists in modern encodings. Some encodings are language-specific, and some can represent everything in Unicode. Though the world is moving toward Unicode and UTF-8, the reality today is that there are several encodings which must be taken into account." $nl -"Factor uses a system of encoding descriptors to denote encodings. Encoding descriptors are objects which describe encodings. Examples are " { $link utf8 } ", " { $link ascii } " and " { $link binary } ". Encoding descriptors can be passed around independently. Each encoding descriptor has some method for constructing an encoded or decoded stream, and the resulting stream has an encoding descriptor stored which has methods for reading or writing characters." $nl +"Factor uses a system of encoding descriptors to denote encodings. Encoding descriptors are objects which describe encodings. Examples are " { $link utf8 } " and " { $link binary } ". Encoding descriptors can be passed around independently. Each encoding descriptor has some method for constructing an encoded or decoded stream, and the resulting stream has an encoding descriptor stored which has methods for reading or writing characters." $nl "Constructors for streams which deal with bytes usually take an encoding as an explicit parameter. For example, to open a text file for reading whose contents are in UTF-8, use the following" { $code "\"file.txt\" utf8 " } "If there is an error in the encoded stream, a replacement character (0xFFFD) will be inserted. To throw an exception upon error, use a strict encoding as follows" { $code "\"file.txt\" utf8 strict " } "In a similar way, encodings can be specified when opening a file for writing." -{ $code "\"file.txt\" ascii " } +{ $code "USE: io.encodings.ascii" "\"file.txt\" ascii " } "An encoding is also needed for some words that don't return streams, such as " { $link file-contents } ", for example" -{ $code "\"file.txt\" utf16 file-contents" } +{ $code "USE: io.encodings.utf16" "\"file.txt\" utf16 file-contents" } "Encoding descriptors are also used by " { $link "io.streams.byte-array" } " and taken by combinators like " { $link with-file-writer } " and " { $link with-byte-reader } " which deal with streams. It is " { $emphasis "not" } " used with " { $link "io.streams.string" } " because these deal with abstract text." $nl "When the " { $link binary } " encoding is used, a " { $link byte-array } " is expected for writing and returned for reading, since the stream deals with bytes. All other encodings deal with strings, since they are used to represent text." ; @@ -239,40 +244,57 @@ ARTICLE: "class-index" "Class index" { $heading "Predicate classes" } { $index [ classes [ predicate-class? ] filter ] } ; -ARTICLE: "program-org" "Program organization" -{ $subsection "definitions" } -{ $subsection "vocabularies" } -{ $subsection "parser" } -{ $subsection "vocabs.loader" } -{ $subsection "source-files" } ; - USING: help.cookbook help.tutorial ; ARTICLE: "handbook-language-reference" "Language reference" +"Fundamentals:" { $subsection "conventions" } { $subsection "syntax" } -{ $subsection "dataflow" } -{ $subsection "objects" } -{ $subsection "program-org" } +{ $subsection "effects" } +"Data types:" +{ $subsection "booleans" } { $subsection "numbers" } { $subsection "collections" } -{ $subsection "io" } +"Evaluation semantics:" +{ $subsection "evaluator" } +{ $subsection "words" } +{ $subsection "shuffle-words" } +{ $subsection "combinators" } +{ $subsection "errors" } +{ $subsection "continuations" } +"Named values:" +{ $subsection "locals" } +{ $subsection "namespaces" } +{ $subsection "namespaces-global" } +{ $subsection "values" } +"Abstractions:" +{ $subsection "objects" } +{ $subsection "destructors" } +{ $subsection "macros" } +{ $subsection "fry" } +"Program organization:" +{ $subsection "vocabs.loader" } "Vocabularies tagged " { $link T{ vocab-tag { name "extensions" } } } " implement various additional language abstractions." ; ARTICLE: "handbook-environment-reference" "Environment reference" +"Parse time and compile time:" +{ $subsection "parser" } +{ $subsection "definitions" } +{ $subsection "vocabularies" } +{ $subsection "source-files" } +{ $subsection "compiler" } +"Tools:" { $subsection "prettyprint" } { $subsection "tools" } -{ $subsection "cli" } -{ $subsection "rc-files" } { $subsection "help" } { $subsection "inference" } -{ $subsection "compiler" } -{ $subsection "system" } { $subsection "images" } -{ $subsection "alien" } +"VM:" +{ $subsection "cli" } +{ $subsection "rc-files" } { $subsection "init" } -{ $subsection "layouts" } -{ $see-also "program-org" } ; +{ $subsection "system" } +{ $subsection "layouts" } ; ARTICLE: "handbook-library-reference" "Library reference" "This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "." @@ -282,9 +304,14 @@ ARTICLE: "handbook" "Factor handbook" "Learn the language:" { $subsection "cookbook" } { $subsection "first-program" } +"Reference material:" { $subsection "handbook-language-reference" } { $subsection "handbook-environment-reference" } +{ $subsection "io" } { $subsection "ui" } +{ $subsection "ui-tools" } +{ $subsection "unicode" } +{ $subsection "alien" } { $subsection "handbook-library-reference" } "Explore loaded libraries:" { $subsection "article-index" } diff --git a/basis/help/home/home-docs.factor b/basis/help/home/home-docs.factor index 6608a6e9c0..e6db2d3b9c 100644 --- a/basis/help/home/home-docs.factor +++ b/basis/help/home/home-docs.factor @@ -8,7 +8,6 @@ ARTICLE: "help.home" "Factor documentation" { $link "handbook" } { $link "vocab-index" } { $link "ui-tools" } - { $link "handbook-library-reference" } } { $heading "Recently visited" } { $table diff --git a/basis/help/syntax/tags.txt b/basis/help/syntax/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/help/syntax/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/interpolate/tags.txt b/basis/interpolate/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/basis/interpolate/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/basis/locals/locals-docs.factor b/basis/locals/locals-docs.factor index 18dabed4b0..b1f0b6ca17 100644 --- a/basis/locals/locals-docs.factor +++ b/basis/locals/locals-docs.factor @@ -112,7 +112,15 @@ HELP: MEMO:: { $description "Defines a memoized word with named inputs; it reads stack values into bindings from left to right, then executes the body with those bindings in lexical scope." } ; { POSTPONE: MEMO: POSTPONE: MEMO:: } related-words + +HELP: M:: +{ $syntax "M:: class generic ( bindings... -- outputs... ) body... ;" } +{ $description "Defines a method with named inputs; it reads stack values into bindings from left to right, then executes the body with those bindings in lexical scope." } +{ $notes "The output names do not affect the word's behavior, however the compiler attempts to check the stack effect as with other definitions." } ; +{ POSTPONE: M: POSTPONE: M:: } related-words + + ARTICLE: "locals-literals" "Locals in literals" "Certain data type literals are permitted to contain free variables. Any such literals are written into code which constructs an instance of the type with the free variable values spliced in. Conceptually, this is similar to the transformation applied to quotations containing free variables." $nl @@ -237,13 +245,14 @@ $nl } "The reason is that locals are rewritten into stack code at parse time, whereas macro expansion is performed later during compile time. To circumvent this problem, the " { $vocab-link "macros.expander" } " vocabulary is used to rewrite simple macro usages prior to local transformation, however "{ $vocab-link "macros.expander" } " does not deal with more complicated cases where the literal inputs to the macro do not immediately precede the macro call in the source." ; -ARTICLE: "locals" "Local variables and lexical closures" +ARTICLE: "locals" "Lexical variables and closures" "The " { $vocab-link "locals" } " vocabulary implements lexical scope with full closures, both downward and upward. Mutable bindings are supported, including assignment to bindings in outer scope." $nl "Compile-time transformation is used to compile local variables to efficient code; prettyprinter extensions are defined so that " { $link see } " can display original word definitions with local variables and not the closure-converted concatenative code which results." $nl "Applicative word definitions where the inputs are named local variables:" { $subsection POSTPONE: :: } +{ $subsection POSTPONE: M:: } { $subsection POSTPONE: MEMO:: } { $subsection POSTPONE: MACRO:: } "Lexical binding forms:" diff --git a/basis/math/ranges/ranges-docs.factor b/basis/math/ranges/ranges-docs.factor index 8987def80b..e35adb10e5 100644 --- a/basis/math/ranges/ranges-docs.factor +++ b/basis/math/ranges/ranges-docs.factor @@ -2,7 +2,7 @@ USING: help.syntax help.markup arrays sequences ; IN: math.ranges -ARTICLE: "ranges" "Ranges" +ARTICLE: "math.ranges" "Numeric ranges" "A " { $emphasis "range" } " is a virtual sequence with real number elements " "ranging from " { $emphasis "a" } " to " { $emphasis "b" } " by " { $emphasis "step" } ". Ascending as well as descending ranges are supported." $nl @@ -24,4 +24,4 @@ $nl { $code "100 1 [a,b] product" } "A range can be converted into a concrete sequence using a word such as " { $link >array } ". In most cases this is unnecessary since ranges implement the sequence protocol already. It is necessary if a mutable sequence is needed, for use with words such as " { $link set-nth } " or " { $link change-each } "." ; -ABOUT: "ranges" \ No newline at end of file +ABOUT: "math.ranges" \ No newline at end of file diff --git a/basis/peg/ebnf/tags.txt b/basis/peg/ebnf/tags.txt index 5af5dba748..1ccdafb2bb 100644 --- a/basis/peg/ebnf/tags.txt +++ b/basis/peg/ebnf/tags.txt @@ -1,2 +1,3 @@ +extensions text parsing diff --git a/basis/ui/tools/tools-docs.factor b/basis/ui/tools/tools-docs.factor index 93f45591a5..52cd77d726 100644 --- a/basis/ui/tools/tools-docs.factor +++ b/basis/ui/tools/tools-docs.factor @@ -55,7 +55,7 @@ $nl ARTICLE: "ui-tools" "UI developer tools" "The " { $vocab-link "ui.tools" } " vocabulary hierarchy implements a collection of simple developer tools." -$nl +{ $subsection "starting-ui-tools" } "To take full advantage of the UI tools, you should be using a supported text editor. See " { $link "editor" } "." $nl "Common functionality:" @@ -66,7 +66,7 @@ $nl { $subsection "ui-listener" } { $subsection "ui-browser" } { $subsection "ui-inspector" } -{ $subsection "ui-profiler" } +{ $subsection "ui.tools.profiler" } { $subsection "ui-walker" } { $subsection "ui.tools.deploy" } "Platform-specific features:" diff --git a/basis/unicode/unicode-docs.factor b/basis/unicode/unicode-docs.factor index 9450b49f0b..56432585c0 100644 --- a/basis/unicode/unicode-docs.factor +++ b/basis/unicode/unicode-docs.factor @@ -1,7 +1,7 @@ USING: help.markup help.syntax strings ; IN: unicode -ARTICLE: "unicode" "Unicode" +ARTICLE: "unicode" "Unicode support" "The " { $vocab-link "unicode" } " vocabulary and its sub-vocabularies implement support for the Unicode 5.1 character set." $nl "The Unicode character set contains most of the world's writing systems. Unicode is intended as a replacement for, and is a superset of, such legacy character sets as ASCII, Latin1, MacRoman, and so on. Unicode characters are called " { $emphasis "code points" } "; Factor's " { $link "strings" } " are sequences of code points." diff --git a/basis/values/values-docs.factor b/basis/values/values-docs.factor index df38869fbf..7c96f19ac9 100644 --- a/basis/values/values-docs.factor +++ b/basis/values/values-docs.factor @@ -2,7 +2,7 @@ USING: help.markup help.syntax ; IN: values ARTICLE: "values" "Global values" -"Usually, dynamically scoped variables are sufficient for holding data which is not literal. But occasionally, for global information that's calculated just once, it's useful to use the word mechanism instead, and set the word to the appropriate value just once. The " { $vocab-link "values" } " vocabulary implements " { $emphasis "values" } ", which abstract over this concept. To create a new word as a value, use the following syntax:" +"Usually, dynamically-scoped variables subsume global variables and are sufficient for holding global data. But occasionally, for global information that's calculated just once and must be accessed more rapidly than a dynamic variable lookup can provide, it's useful to use the word mechanism instead, and set a word to the appropriate value just once. The " { $vocab-link "values" } " vocabulary implements " { $emphasis "values" } ", which abstract over this concept. To create a new word as a value, use the following syntax:" { $subsection POSTPONE: VALUE: } "To get the value, just call the word. The following words manipulate values:" { $subsection get-value } diff --git a/basis/xml/syntax/tags.txt b/basis/xml/syntax/tags.txt index 71c0ff7282..4f4a20b1cb 100644 --- a/basis/xml/syntax/tags.txt +++ b/basis/xml/syntax/tags.txt @@ -1 +1,2 @@ +extensions syntax diff --git a/core/combinators/combinators-docs.factor b/core/combinators/combinators-docs.factor index cc502140ad..9c96fe34c9 100644 --- a/core/combinators/combinators-docs.factor +++ b/core/combinators/combinators-docs.factor @@ -4,46 +4,313 @@ math assocs sequences sequences.private combinators.private effects words ; IN: combinators +ARTICLE: "cleave-shuffle-equivalence" "Expressing shuffle words with cleave combinators" +"Cleave combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to cleave combinators are discussed in the documentation for " { $link bi } ", " { $link 2bi } ", " { $link 3bi } ", " { $link tri } ", " { $link 2tri } " and " { $link 3tri } "." +$nl +"Certain shuffle words can also be expressed in terms of the cleave combinators. Internalizing such identities can help with understanding and writing code using cleave combinators:" +{ $code + ": keep [ ] bi ;" + ": 2keep [ ] 2bi ;" + ": 3keep [ ] 3bi ;" + "" + ": dup [ ] [ ] bi ;" + ": 2dup [ ] [ ] 2bi ;" + ": 3dup [ ] [ ] 3bi ;" + "" + ": tuck [ nip ] [ ] 2bi ;" + ": swap [ nip ] [ drop ] 2bi ;" + "" + ": over [ ] [ drop ] 2bi ;" + ": pick [ ] [ 2drop ] 3bi ;" + ": 2over [ ] [ drop ] 3bi ;" +} ; + +ARTICLE: "cleave-combinators" "Cleave combinators" +"The cleave combinators apply multiple quotations to a single value." +$nl +"Two quotations:" +{ $subsection bi } +{ $subsection 2bi } +{ $subsection 3bi } +"Three quotations:" +{ $subsection tri } +{ $subsection 2tri } +{ $subsection 3tri } +"An array of quotations:" +{ $subsection cleave } +{ $subsection 2cleave } +{ $subsection 3cleave } +"Technically, the cleave combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on the top of the stack can be written in one of two ways:" +{ $code + "! First alternative; uses keep" + "[ 1 + ] keep" + "[ 1 - ] keep" + "2 *" + "! Second alternative: uses tri" + "[ 1 + ]" + "[ 1 - ]" + "[ 2 * ] tri" +} +"The latter is more aesthetically pleasing than the former." +{ $subsection "cleave-shuffle-equivalence" } ; + +ARTICLE: "spread-shuffle-equivalence" "Expressing shuffle words with spread combinators" +"Spread combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to spread combinators are discussed in the documentation for " { $link bi* } ", " { $link 2bi* } ", " { $link tri* } ", and " { $link 2tri* } "." +$nl +"Certain shuffle words can also be expressed in terms of the spread combinators. Internalizing such identities can help with understanding and writing code using spread combinators:" +{ $code + ": dip [ ] bi* ;" + ": 2dip [ ] [ ] tri* ;" + "" + ": slip [ call ] [ ] bi* ;" + ": 2slip [ call ] [ ] [ ] tri* ;" + "" + ": nip [ drop ] [ ] bi* ;" + ": 2nip [ drop ] [ drop ] [ ] tri* ;" + "" + ": rot" + " [ [ drop ] [ ] [ drop ] tri* ]" + " [ [ drop ] [ drop ] [ ] tri* ]" + " [ [ ] [ drop ] [ drop ] tri* ]" + " 3tri ;" + "" + ": -rot" + " [ [ drop ] [ drop ] [ ] tri* ]" + " [ [ ] [ drop ] [ drop ] tri* ]" + " [ [ drop ] [ ] [ drop ] tri* ]" + " 3tri ;" + "" + ": spin" + " [ [ drop ] [ drop ] [ ] tri* ]" + " [ [ drop ] [ ] [ drop ] tri* ]" + " [ [ ] [ drop ] [ drop ] tri* ]" + " 3tri ;" +} ; + +ARTICLE: "spread-combinators" "Spread combinators" +"The spread combinators apply multiple quotations to multiple values. The " { $snippet "*" } " suffix signifies spreading." +$nl +"Two quotations:" +{ $subsection bi* } +{ $subsection 2bi* } +"Three quotations:" +{ $subsection tri* } +{ $subsection 2tri* } +"An array of quotations:" +{ $subsection spread } +"Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:" +{ $code + "! First alternative; uses dip" + "[ [ 1 + ] dip 1 - ] dip 2 *" + "! Second alternative: uses tri*" + "[ 1 + ] [ 1 - ] [ 2 * ] tri*" +} +"A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "." +{ $subsection "spread-shuffle-equivalence" } ; + +ARTICLE: "apply-combinators" "Apply combinators" +"The apply combinators apply a single quotation to multiple values. The " { $snippet "@" } " suffix signifies application." +$nl +"Two quotations:" +{ $subsection bi@ } +{ $subsection 2bi@ } +"Three quotations:" +{ $subsection tri@ } +{ $subsection 2tri@ } +"A pair of utility words built from " { $link bi@ } ":" +{ $subsection both? } +{ $subsection either? } ; + +ARTICLE: "slip-keep-combinators" "Retain stack combinators" +"Sometimes an additional storage area is needed to hold objects. The " { $emphasis "retain stack" } " is an auxilliary stack for this purpose. Objects can be moved between the data and retain stacks using a set of combinators." +$nl +"The dip combinators invoke the quotation at the top of the stack, hiding the values underneath:" +{ $subsection dip } +{ $subsection 2dip } +{ $subsection 3dip } +{ $subsection 4dip } +"The slip combinators invoke a quotation further down on the stack. They are most useful for implementing other combinators:" +{ $subsection slip } +{ $subsection 2slip } +{ $subsection 3slip } +"The keep combinators invoke a quotation which takes a number of values off the stack, and then they restore those values:" +{ $subsection keep } +{ $subsection 2keep } +{ $subsection 3keep } ; + +ARTICLE: "curried-dataflow" "Curried dataflow combinators" +"Curried cleave combinators:" +{ $subsection bi-curry } +{ $subsection tri-curry } +"Curried spread combinators:" +{ $subsection bi-curry* } +{ $subsection tri-curry* } +"Curried apply combinators:" +{ $subsection bi-curry@ } +{ $subsection tri-curry@ } +{ $see-also "dataflow-combinators" } ; + +ARTICLE: "compositional-examples" "Examples of compositional combinator usage" +"Consider printing the same message ten times:" +{ $code ": print-10 ( -- ) 10 [ \"Hello, world.\" print ] times ;" } +"if we wanted to abstract out the message into a parameter, we could keep it on the stack between iterations:" +{ $code ": print-10 ( message -- ) 10 [ dup print ] times drop ;" } +"However, keeping loop-invariant values on the stack doesn't always work out nicely. For example, a word to subtract a value from each element of a sequence:" +{ $code ": subtract-n ( seq n -- seq' ) swap [ over - ] map nip ;" } +"Three shuffle words are required to pass the value around. Instead, the loop-invariant value can be partially applied to a quotation using " { $link curry } ", yielding a new quotation that is passed to " { $link map } ":" +{ $example + "USING: kernel math prettyprint sequences ;" + ": subtract-n ( seq n -- seq' ) [ - ] curry map ;" + "{ 10 20 30 } 5 subtract-n ." + "{ 5 15 25 }" +} +"Now consider the word that is dual to the one above; instead of subtracting " { $snippet "n" } " from each stack element, it subtracts each element from " { $snippet "n" } "." +$nl +"One way to write this is with a pair of " { $link swap } "s:" +{ $code ": n-subtract ( n seq -- seq' ) swap [ swap - ] curry map ;" } +"Since this pattern comes up often, " { $link with } " encapsulates it:" +{ $example + "USING: kernel math prettyprint sequences ;" + ": n-subtract ( n seq -- seq' ) [ - ] with map ;" + "30 { 10 20 30 } n-subtract ." + "{ 20 10 0 }" +} +{ $see-also "fry.examples" } ; + +ARTICLE: "compositional-combinators" "Compositional combinators" +"Certain combinators transform quotations to produce a new quotation." +{ $subsection "compositional-examples" } +"Fundamental operations:" +{ $subsection curry } +{ $subsection compose } +"Derived operations:" +{ $subsection 2curry } +{ $subsection 3curry } +{ $subsection with } +{ $subsection prepose } +"These operations run in constant time, and in many cases are optimized out altogether by the " { $link "compiler" } ". " { $link "fry" } " are an abstraction built on top of these operations, and code that uses this abstraction is often clearer than direct calls to the below words." +$nl +"Curried dataflow combinators can be used to build more complex dataflow by combining cleave, spread and apply patterns in various ways." +{ $subsection "curried-dataflow" } +"Quotations also implement the sequence protocol, and can be manipulated with sequence words; see " { $link "quotations" } ". However, such runtime quotation manipulation will not be optimized by the optimizing compiler." ; + +ARTICLE: "booleans" "Booleans" +"In Factor, any object that is not " { $link f } " has a true value, and " { $link f } " has a false value. The " { $link t } " object is the canonical true value." +{ $subsection f } +{ $subsection t } +"There are some logical operations on booleans:" +{ $subsection >boolean } +{ $subsection not } +{ $subsection and } +{ $subsection or } +{ $subsection xor } +"Boolean values are most frequently used for " { $link "conditionals" } "." +{ $heading "The f object and f class" } +"The " { $link f } " object is the unique instance of the " { $link f } " class; the two are distinct objects. The latter is also a parsing word which adds the " { $link f } " object to the parse tree at parse time. To refer to the class itself you must use " { $link POSTPONE: POSTPONE: } " or " { $link POSTPONE: \ } " to prevent the parsing word from executing." +$nl +"Here is the " { $link f } " object:" +{ $example "f ." "f" } +"Here is the " { $link f } " class:" +{ $example "\\ f ." "POSTPONE: f" } +"They are not equal:" +{ $example "f \\ f = ." "f" } +"Here is an array containing the " { $link f } " object:" +{ $example "{ f } ." "{ f }" } +"Here is an array containing the " { $link f } " class:" +{ $example "{ POSTPONE: f } ." "{ POSTPONE: f }" } +"The " { $link f } " object is an instance of the " { $link f } " class:" +{ $example "USE: classes" "f class ." "POSTPONE: f" } +"The " { $link f } " class is an instance of " { $link word } ":" +{ $example "USE: classes" "\\ f class ." "word" } +"On the other hand, " { $link t } " is just a word, and there is no class which it is a unique instance of." +{ $example "t \\ t eq? ." "t" } +"Many words which search collections confuse the case of no element being present with an element being found equal to " { $link f } ". If this distinction is imporant, there is usually an alternative word which can be used; for example, compare " { $link at } " with " { $link at* } "." ; + +ARTICLE: "conditionals-boolean-equivalence" "Expressing conditionals with boolean logic" +"Certain simple conditional forms can be expressed in a simpler manner using boolean logic." +$nl +"The following two lines are equivalent:" +{ $code "[ drop f ] unless" "swap and" } +"The following two lines are equivalent:" +{ $code "[ ] [ ] ?if" "swap or" } +"The following two lines are equivalent, where " { $snippet "L" } " is a literal:" +{ $code "[ L ] unless*" "L or" } ; + +ARTICLE: "conditionals" "Conditional combinators" +"The basic conditionals:" +{ $subsection if } +{ $subsection when } +{ $subsection unless } +"Forms abstracting a common stack shuffle pattern:" +{ $subsection if* } +{ $subsection when* } +{ $subsection unless* } +"Another form abstracting a common stack shuffle pattern:" +{ $subsection ?if } +"Sometimes instead of branching, you just need to pick one of two values:" +{ $subsection ? } +"Two combinators which abstract out nested chains of " { $link if } ":" +{ $subsection cond } +{ $subsection case } +{ $subsection "conditionals-boolean-equivalence" } +{ $see-also "booleans" "bitwise-arithmetic" both? either? } ; + +ARTICLE: "dataflow-combinators" "Data flow combinators" +"Data flow combinators pass values between quotations:" +{ $subsection "slip-keep-combinators" } +{ $subsection "cleave-combinators" } +{ $subsection "spread-combinators" } +{ $subsection "apply-combinators" } +{ $see-also "curried-dataflow" } ; + ARTICLE: "combinators-quot" "Quotation construction utilities" "Some words for creating quotations which can be useful for implementing method combinations and compiler transforms:" { $subsection cond>quot } { $subsection case>quot } { $subsection alist>quot } ; -ARTICLE: "call" "Calling code with known stack effects" -"Arbitrary quotations and words can be called from code accepted by the optimizing compiler. This is done by specifying the stack effect of the quotation literally. It is checked at runtime that the stack effect is accurate." +ARTICLE: "call" "Fundamental combinators" +"The most basic combinators are those that take either a quotation or word, and invoke it immediately. There are two sets of combinators; they differe in whether or not the stack effect of the expected code is declared." $nl -"Quotations:" -{ $subsection POSTPONE: call( } +"The simplest combinators do not take an effect declaration:" +{ $subsection call } +{ $subsection execute } +"These combinators only get optimized by the compiler if the quotation or word parameter is a literal; otherwise a compiler warning will result. Definitions of combinators which require literal parameters must be followed by the " { $link POSTPONE: inline } " declaration. For example:" +{ $code + ": keep ( x quot -- x )" + " over [ call ] dip ; inline" +} +"See " { $link "declarations" } " and " { $link "compiler-errors" } " for details." +$nl +"The other set of combinators allow arbitrary quotations and words to be called from optimized code. This is done by specifying the stack effect of the quotation literally. It is checked at runtime that the stack effect is accurate." { $subsection call-effect } -"Words:" -{ $subsection POSTPONE: execute( } { $subsection execute-effect } -"Unsafe calls:" +"A simple layer of syntax sugar is defined on top:" +{ $subsection POSTPONE: call( } +{ $subsection POSTPONE: execute( } +"Unsafe calls declare an effect statically without any runtime checking:" { $subsection call-effect-unsafe } -{ $subsection execute-effect-unsafe } ; +{ $subsection execute-effect-unsafe } +{ $see-also "effects" "inference" } ; -ARTICLE: "combinators" "Additional combinators" -"The " { $vocab-link "combinators" } " vocabulary provides a few useful combinators." +ARTICLE: "combinators" "Combinators" +"A central concept in Factor is that of a " { $emphasis "combinator" } ", which is a word taking code as input." +{ $subsection "call" } +{ $subsection "dataflow-combinators" } +{ $subsection "conditionals" } +{ $subsection "looping-combinators" } +{ $subsection "compositional-combinators" } +{ $subsection "combinators.short-circuit" } +{ $subsection "combinators.smart" } +"More combinators are defined for working on data structures, such as " { $link "sequences-combinators" } " and " { $link "assocs-combinators" } "." $nl -"Generalization of " { $link bi } " and " { $link tri } ":" -{ $subsection cleave } -"Generalization of " { $link 2bi } " and " { $link 2tri } ":" -{ $subsection 2cleave } -"Generalization of " { $link 3bi } " and " { $link 3tri } ":" -{ $subsection 3cleave } -"Generalization of " { $link bi* } " and " { $link tri* } ":" -{ $subsection spread } -"Two combinators which abstract out nested chains of " { $link if } ":" -{ $subsection cond } -{ $subsection case } -"The " { $vocab-link "combinators" } " also provides some less frequently-used features." +"The " { $vocab-link "combinators" } " provides some less frequently-used features." $nl "A combinator which can help with implementing methods on " { $link hashcode* } ":" { $subsection recursive-hashcode } -{ $subsection "call" } { $subsection "combinators-quot" } -{ $see-also "quotations" "dataflow" } ; +"Advanced topics:" +{ $see-also "quotations" } ; ABOUT: "combinators" diff --git a/core/definitions/definitions-docs.factor b/core/definitions/definitions-docs.factor index b53ab28cbc..9d49cf62c6 100644 --- a/core/definitions/definitions-docs.factor +++ b/core/definitions/definitions-docs.factor @@ -56,11 +56,24 @@ $nl { $subsection redefine-error } ; ARTICLE: "definitions" "Definitions" -"A " { $emphasis "definition" } " is an artifact read from a source file. This includes words, methods, help articles, and path names (which represent the source file at that location). Words for working with definitions are found in the " { $vocab-link "definitions" } " vocabulary." +"A " { $emphasis "definition" } " is an artifact read from a source file. Words for working with definitions are found in the " { $vocab-link "definitions" } " vocabulary." +$nl +"Definitions are defined using parsing words. Examples of definitions together with their defining parsing words are words (" { $link POSTPONE: : } "), methods (" { $link POSTPONE: M: } "), and vocabularies (" { $link POSTPONE: IN: } ")." +$nl +"All definitions share some common traits:" +{ $list + "There is a word to list all definitions of a given type" + "There is a parsing word for creating new definitions" + "There is an ordinary word which is the runtime equivalent of the parsing word, for introspection" + "Instances of the definition may be introspected and modified with the definition protocol" +} +"For every source file loaded into the system, a list of definitions is maintained. Pathname objects implement the definition protocol, acting over the definitions their source files contain. See " { $link "source-files" } " for details." { $subsection "definition-protocol" } { $subsection "definition-crossref" } { $subsection "definition-checking" } { $subsection "compilation-units" } +"A parsing word to remove definitions:" +{ $subsection POSTPONE: FORGET: } { $see-also "see" "parser" "source-files" "words" "generic" "help-impl" } ; ABOUT: "definitions" diff --git a/core/effects/effects-docs.factor b/core/effects/effects-docs.factor index b209dcf259..20709ca807 100644 --- a/core/effects/effects-docs.factor +++ b/core/effects/effects-docs.factor @@ -1,4 +1,4 @@ -USING: help.markup help.syntax math strings words kernel ; +USING: help.markup help.syntax math strings words kernel combinators ; IN: effects ARTICLE: "effect-declaration" "Stack effect declaration" @@ -29,14 +29,11 @@ $nl "The stack effect inferencer verifies stack effect comments to ensure the correct number of inputs and outputs is listed. Value names are ignored; only their number matters. An error is thrown if a word's declared stack effect does not match its inferred stack effect. See " { $link "inference" } "." ; ARTICLE: "effects" "Stack effects" -"A " { $emphasis "stack effect declaration" } ", for example " { $snippet "( x y -- z )" } " denotes that an operation takes two inputs, with " { $snippet "y" } " at the top of the stack, and returns one output." +"A " { $emphasis "stack effect declaration" } ", for example " { $snippet "( x y -- z )" } " denotes that an operation takes two inputs, with " { $snippet "y" } " at the top of the stack, and returns one output. Stack effects are first-class, and words for working with them are found in the " { $vocab-link "effects" } " vocabulary." $nl -"Stack effects of words can be declared." +"Stack effects of words must be declared, and the " { $link "compiler" } " checks that these declarations are correct. Invalid declarations are reported as " { $link "compiler-errors" } ". The " { $link "inference" } " tool can be used to check stack effects interactively." { $subsection "effect-declaration" } -"Stack effects are first-class, and words for working with them are found in the " { $vocab-link "effects" } " vocabulary." -{ $subsection effect } -{ $subsection effect? } -"There is a literal syntax for stack objects. It is most often used with " { $link define-declared } "." +"There is a literal syntax for stack objects. It is most often used with " { $link define-declared } ", " { $link call-effect } " and " { $link execute-effect } "." { $subsection POSTPONE: (( } "Getting a word's declared stack effect:" { $subsection stack-effect } @@ -45,7 +42,9 @@ $nl "Comparing effects:" { $subsection effect-height } { $subsection effect<= } -{ $see-also "inference" } ; +"The class of stack effects:" +{ $subsection effect } +{ $subsection effect? } ; ABOUT: "effects" diff --git a/core/generic/generic-docs.factor b/core/generic/generic-docs.factor index 06a8fa87a3..7017ef8a08 100644 --- a/core/generic/generic-docs.factor +++ b/core/generic/generic-docs.factor @@ -45,8 +45,8 @@ $nl { $subsection make-generic } "Low-level method constructor:" { $subsection } -"A " { $emphasis "method specifier" } " refers to a method and implements the " { $link "definition-protocol" } ":" -{ $subsection method-spec } +"Methods may be pushed on the stack with a literal syntax:" +{ $subsection POSTPONE: M\ } { $see-also "see" } ; ARTICLE: "method-combination" "Custom method combination" @@ -98,8 +98,8 @@ $nl "Generic words must declare their stack effect in order to compile. See " { $link "effect-declaration" } "." { $subsection "method-order" } { $subsection "call-next-method" } -{ $subsection "generic-introspection" } { $subsection "method-combination" } +{ $subsection "generic-introspection" } "Generic words specialize behavior based on the class of an object; sometimes behavior needs to be specialized on the object's " { $emphasis "structure" } "; this is known as " { $emphasis "pattern matching" } " and is implemented in the " { $vocab-link "match" } " vocabulary." ; ABOUT: "generic" @@ -119,9 +119,10 @@ HELP: define-generic { $description "Defines a generic word. A method combination is an object which responds to the " { $link perform-combination } " generic word." } { $contract "The method combination quotation is called each time the generic word has to be updated (for example, when a method is added), and thus must be side-effect free." } ; -HELP: method-spec -{ $class-description "The class of method specifiers, which are two-element arrays consisting of a class word followed by a generic word." } -{ $examples { $code "{ fixnum + }" "{ editor draw-gadget* }" } } ; +HELP: M\ +{ $syntax "M\\ class generic" } +{ $class-description "Pushes a method on the stack." } +{ $examples { $code "M\\ fixnum + see" } { $code "USING: ui.gadgets ui.gadgets.editors ;" "M\\ editor draw-gadget* edit" } } ; HELP: method-body { $class-description "The class of method bodies, which are words with special word properties set." } ; diff --git a/core/generic/generic-tests.factor b/core/generic/generic-tests.factor index aadc44833f..151c2f52fa 100755 --- a/core/generic/generic-tests.factor +++ b/core/generic/generic-tests.factor @@ -105,9 +105,6 @@ M: shit big-generic-test "shit" ; [ float ] [ \ real \ float math-class-max ] unit-test [ fixnum ] [ \ fixnum \ null math-class-max ] unit-test -[ t ] [ { hashtable equal? } method-spec? ] unit-test -[ f ] [ { word = } method-spec? ] unit-test - ! Regression TUPLE: first-one ; TUPLE: second-one ; diff --git a/core/generic/math/math-docs.factor b/core/generic/math/math-docs.factor index 4323f91bc3..60fa745339 100644 --- a/core/generic/math/math-docs.factor +++ b/core/generic/math/math-docs.factor @@ -15,7 +15,7 @@ HELP: no-math-method HELP: math-method { $values { "word" generic } { "class1" class } { "class2" class } { "quot" quotation } } { $description "Generates a definition for " { $snippet "word" } " when the two inputs are instances of " { $snippet "class1" } " and " { $snippet "class2" } ", respectively." } -{ $examples { $example "USING: generic.math math prettyprint ;" "\\ + fixnum float math-method ." "[ { fixnum float } declare [ >float ] dip float=>+ ]" } } ; +{ $examples { $example "USING: generic.math math prettyprint ;" "\\ + fixnum float math-method ." "[ { fixnum float } declare [ >float ] dip M\\ float + ]" } } ; HELP: math-class { $class-description "The class of subtypes of " { $link number } " which are not " { $link null } "." } ; diff --git a/core/kernel/kernel-docs.factor b/core/kernel/kernel-docs.factor index c178573a0a..36d04f1437 100644 --- a/core/kernel/kernel-docs.factor +++ b/core/kernel/kernel-docs.factor @@ -841,260 +841,6 @@ $nl { $subsection roll } { $subsection -roll } ; -ARTICLE: "cleave-shuffle-equivalence" "Expressing shuffle words with cleave combinators" -"Cleave combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to cleave combinators are discussed in the documentation for " { $link bi } ", " { $link 2bi } ", " { $link 3bi } ", " { $link tri } ", " { $link 2tri } " and " { $link 3tri } "." -$nl -"Certain shuffle words can also be expressed in terms of the cleave combinators. Internalizing such identities can help with understanding and writing code using cleave combinators:" -{ $code - ": keep [ ] bi ;" - ": 2keep [ ] 2bi ;" - ": 3keep [ ] 3bi ;" - "" - ": dup [ ] [ ] bi ;" - ": 2dup [ ] [ ] 2bi ;" - ": 3dup [ ] [ ] 3bi ;" - "" - ": tuck [ nip ] [ ] 2bi ;" - ": swap [ nip ] [ drop ] 2bi ;" - "" - ": over [ ] [ drop ] 2bi ;" - ": pick [ ] [ 2drop ] 3bi ;" - ": 2over [ ] [ drop ] 3bi ;" -} ; - -ARTICLE: "cleave-combinators" "Cleave combinators" -"The cleave combinators apply multiple quotations to a single value." -$nl -"Two quotations:" -{ $subsection bi } -{ $subsection 2bi } -{ $subsection 3bi } -"Three quotations:" -{ $subsection tri } -{ $subsection 2tri } -{ $subsection 3tri } -"Technically, the cleave combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on the top of the stack can be written in one of two ways:" -{ $code - "! First alternative; uses keep" - "[ 1 + ] keep" - "[ 1 - ] keep" - "2 *" - "! Second alternative: uses tri" - "[ 1 + ]" - "[ 1 - ]" - "[ 2 * ] tri" -} -"The latter is more aesthetically pleasing than the former." -$nl -"A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "." -{ $subsection "cleave-shuffle-equivalence" } ; - -ARTICLE: "spread-shuffle-equivalence" "Expressing shuffle words with spread combinators" -"Spread combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to spread combinators are discussed in the documentation for " { $link bi* } ", " { $link 2bi* } ", " { $link tri* } ", and " { $link 2tri* } "." -$nl -"Certain shuffle words can also be expressed in terms of the spread combinators. Internalizing such identities can help with understanding and writing code using spread combinators:" -{ $code - ": dip [ ] bi* ;" - ": 2dip [ ] [ ] tri* ;" - "" - ": slip [ call ] [ ] bi* ;" - ": 2slip [ call ] [ ] [ ] tri* ;" - "" - ": nip [ drop ] [ ] bi* ;" - ": 2nip [ drop ] [ drop ] [ ] tri* ;" - "" - ": rot" - " [ [ drop ] [ ] [ drop ] tri* ]" - " [ [ drop ] [ drop ] [ ] tri* ]" - " [ [ ] [ drop ] [ drop ] tri* ]" - " 3tri ;" - "" - ": -rot" - " [ [ drop ] [ drop ] [ ] tri* ]" - " [ [ ] [ drop ] [ drop ] tri* ]" - " [ [ drop ] [ ] [ drop ] tri* ]" - " 3tri ;" - "" - ": spin" - " [ [ drop ] [ drop ] [ ] tri* ]" - " [ [ drop ] [ ] [ drop ] tri* ]" - " [ [ ] [ drop ] [ drop ] tri* ]" - " 3tri ;" -} ; - -ARTICLE: "spread-combinators" "Spread combinators" -"The spread combinators apply multiple quotations to multiple values. The " { $snippet "*" } " suffix signifies spreading." -$nl -"Two quotations:" -{ $subsection bi* } -{ $subsection 2bi* } -"Three quotations:" -{ $subsection tri* } -{ $subsection 2tri* } -"Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:" -{ $code - "! First alternative; uses dip" - "[ [ 1 + ] dip 1 - ] dip 2 *" - "! Second alternative: uses tri*" - "[ 1 + ] [ 1 - ] [ 2 * ] tri*" -} -"A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "." -{ $subsection "spread-shuffle-equivalence" } ; - -ARTICLE: "apply-combinators" "Apply combinators" -"The apply combinators apply a single quotation to multiple values. The " { $snippet "@" } " suffix signifies application." -$nl -"Two quotations:" -{ $subsection bi@ } -{ $subsection 2bi@ } -"Three quotations:" -{ $subsection tri@ } -{ $subsection 2tri@ } -"A pair of utility words built from " { $link bi@ } ":" -{ $subsection both? } -{ $subsection either? } ; - -ARTICLE: "slip-keep-combinators" "Retain stack combinators" -"Sometimes an additional storage area is needed to hold objects. The " { $emphasis "retain stack" } " is an auxilliary stack for this purpose. Objects can be moved between the data and retain stacks using a set of combinators." -$nl -"The dip combinators invoke the quotation at the top of the stack, hiding the values underneath:" -{ $subsection dip } -{ $subsection 2dip } -{ $subsection 3dip } -{ $subsection 4dip } -"The slip combinators invoke a quotation further down on the stack. They are most useful for implementing other combinators:" -{ $subsection slip } -{ $subsection 2slip } -{ $subsection 3slip } -"The keep combinators invoke a quotation which takes a number of values off the stack, and then they restore those values:" -{ $subsection keep } -{ $subsection 2keep } -{ $subsection 3keep } ; - -ARTICLE: "curried-dataflow" "Curried dataflow combinators" -"Curried cleave combinators:" -{ $subsection bi-curry } -{ $subsection tri-curry } -"Curried spread combinators:" -{ $subsection bi-curry* } -{ $subsection tri-curry* } -"Curried apply combinators:" -{ $subsection bi-curry@ } -{ $subsection tri-curry@ } -{ $see-also "dataflow-combinators" } ; - -ARTICLE: "compositional-examples" "Examples of compositional combinator usage" -"Consider printing the same message ten times:" -{ $code ": print-10 ( -- ) 10 [ \"Hello, world.\" print ] times ;" } -"if we wanted to abstract out the message into a parameter, we could keep it on the stack between iterations:" -{ $code ": print-10 ( message -- ) 10 [ dup print ] times drop ;" } -"However, keeping loop-invariant values on the stack doesn't always work out nicely. For example, a word to subtract a value from each element of a sequence:" -{ $code ": subtract-n ( seq n -- seq' ) swap [ over - ] map nip ;" } -"Three shuffle words are required to pass the value around. Instead, the loop-invariant value can be partially applied to a quotation using " { $link curry } ", yielding a new quotation that is passed to " { $link map } ":" -{ $example - "USING: kernel math prettyprint sequences ;" - ": subtract-n ( seq n -- seq' ) [ - ] curry map ;" - "{ 10 20 30 } 5 subtract-n ." - "{ 5 15 25 }" -} -"Now consider the word that is dual to the one above; instead of subtracting " { $snippet "n" } " from each stack element, it subtracts each element from " { $snippet "n" } "." -$nl -"One way to write this is with a pair of " { $link swap } "s:" -{ $code ": n-subtract ( n seq -- seq' ) swap [ swap - ] curry map ;" } -"Since this pattern comes up often, " { $link with } " encapsulates it:" -{ $example - "USING: kernel math prettyprint sequences ;" - ": n-subtract ( n seq -- seq' ) [ - ] with map ;" - "30 { 10 20 30 } n-subtract ." - "{ 20 10 0 }" -} -{ $see-also "fry.examples" } ; - -ARTICLE: "compositional-combinators" "Compositional combinators" -"Certain combinators transform quotations to produce a new quotation." -{ $subsection "compositional-examples" } -"Fundamental operations:" -{ $subsection curry } -{ $subsection compose } -"Derived operations:" -{ $subsection 2curry } -{ $subsection 3curry } -{ $subsection with } -{ $subsection prepose } -"These operations run in constant time, and in many cases are optimized out altogether by the " { $link "compiler" } ". " { $link "fry" } " are an abstraction built on top of these operations, and code that uses this abstraction is often clearer than direct calls to the below words." -$nl -"Curried dataflow combinators can be used to build more complex dataflow by combining cleave, spread and apply patterns in various ways." -{ $subsection "curried-dataflow" } -"Quotations also implement the sequence protocol, and can be manipulated with sequence words; see " { $link "quotations" } ". However, such runtime quotation manipulation will not be optimized by the optimizing compiler." ; - -ARTICLE: "implementing-combinators" "Implementing combinators" -"The following pair of words invoke words and quotations reflectively:" -{ $subsection call } -{ $subsection execute } -"These words are used to implement combinators. Note that combinator definitions must be followed by the " { $link POSTPONE: inline } " declaration in order to compile in the optimizing compiler; for example:" -{ $code - ": keep ( x quot -- x )" - " over [ call ] dip ; inline" -} -"Word inlining is documented in " { $link "declarations" } "." ; - -ARTICLE: "booleans" "Booleans" -"In Factor, any object that is not " { $link f } " has a true value, and " { $link f } " has a false value. The " { $link t } " object is the canonical true value." -{ $subsection f } -{ $subsection t } -"The " { $link f } " object is the unique instance of the " { $link f } " class; the two are distinct objects. The latter is also a parsing word which adds the " { $link f } " object to the parse tree at parse time. To refer to the class itself you must use " { $link POSTPONE: POSTPONE: } " or " { $link POSTPONE: \ } " to prevent the parsing word from executing." -$nl -"Here is the " { $link f } " object:" -{ $example "f ." "f" } -"Here is the " { $link f } " class:" -{ $example "\\ f ." "POSTPONE: f" } -"They are not equal:" -{ $example "f \\ f = ." "f" } -"Here is an array containing the " { $link f } " object:" -{ $example "{ f } ." "{ f }" } -"Here is an array containing the " { $link f } " class:" -{ $example "{ POSTPONE: f } ." "{ POSTPONE: f }" } -"The " { $link f } " object is an instance of the " { $link f } " class:" -{ $example "USE: classes" "f class ." "POSTPONE: f" } -"The " { $link f } " class is an instance of " { $link word } ":" -{ $example "USE: classes" "\\ f class ." "word" } -"On the other hand, " { $link t } " is just a word, and there is no class which it is a unique instance of." -{ $example "t \\ t eq? ." "t" } -"Many words which search collections confuse the case of no element being present with an element being found equal to " { $link f } ". If this distinction is imporant, there is usually an alternative word which can be used; for example, compare " { $link at } " with " { $link at* } "." ; - -ARTICLE: "conditionals-boolean-equivalence" "Expressing conditionals with boolean logic" -"Certain simple conditional forms can be expressed in a simpler manner using boolean logic." -$nl -"The following two lines are equivalent:" -{ $code "[ drop f ] unless" "swap and" } -"The following two lines are equivalent:" -{ $code "[ ] [ ] ?if" "swap or" } -"The following two lines are equivalent, where " { $snippet "L" } " is a literal:" -{ $code "[ L ] unless*" "L or" } ; - -ARTICLE: "conditionals" "Conditionals and logic" -"The basic conditionals:" -{ $subsection if } -{ $subsection when } -{ $subsection unless } -"Forms abstracting a common stack shuffle pattern:" -{ $subsection if* } -{ $subsection when* } -{ $subsection unless* } -"Another form abstracting a common stack shuffle pattern:" -{ $subsection ?if } -"Sometimes instead of branching, you just need to pick one of two values:" -{ $subsection ? } -"There are some logical operations on booleans:" -{ $subsection >boolean } -{ $subsection not } -{ $subsection and } -{ $subsection or } -{ $subsection xor } -{ $subsection "conditionals-boolean-equivalence" } -"See " { $link "combinators" } " for forms which abstract away common patterns involving multiple nested branches." -{ $see-also "booleans" "bitwise-arithmetic" both? either? } ; - ARTICLE: "equality" "Equality" "There are two distinct notions of “sameness” when it comes to objects." $nl @@ -1116,34 +862,3 @@ ARTICLE: "assertions" "Assertions" { $subsection assert } { $subsection assert= } ; -ARTICLE: "dataflow-combinators" "Data flow combinators" -"Data flow combinators pass values between quotations:" -{ $subsection "slip-keep-combinators" } -{ $subsection "cleave-combinators" } -{ $subsection "spread-combinators" } -{ $subsection "apply-combinators" } -{ $see-also "curried-dataflow" } ; - -ARTICLE: "dataflow" "Data and control flow" -{ $subsection "evaluator" } -{ $subsection "words" } -{ $subsection "effects" } -{ $subsection "booleans" } -{ $subsection "shuffle-words" } -"A central concept in Factor is that of a " { $emphasis "combinator" } ", which is a word taking code as input." -{ $subsection "dataflow-combinators" } -{ $subsection "conditionals" } -{ $subsection "looping-combinators" } -{ $subsection "compositional-combinators" } -{ $subsection "combinators" } -"More combinators are defined for working on data structures, such as " { $link "sequences-combinators" } " and " { $link "assocs-combinators" } "." -$nl -"Advanced topics:" -{ $subsection "assertions" } -{ $subsection "implementing-combinators" } -{ $subsection "macros" } -{ $subsection "errors" } -{ $subsection "continuations" } ; - -ABOUT: "dataflow" - diff --git a/core/math/math-docs.factor b/core/math/math-docs.factor index f79dcb5481..c28bf062c1 100644 --- a/core/math/math-docs.factor +++ b/core/math/math-docs.factor @@ -355,8 +355,9 @@ ARTICLE: "bitwise-arithmetic" "Bitwise arithmetic" { $subsection 2/ } { $subsection 2^ } { $subsection bit? } -"The " { $vocab-link "math.bitwise" } " vocabulary implements additional bitwise integer operations." -{ $see-also "conditionals" } ; +{ $subsection "math.bitwise" } +{ $subsection "math.bits" } +{ $see-also "booleans" } ; ARTICLE: "arithmetic" "Arithmetic" "Factor attempts to preserve natural mathematical semantics for numbers. Multiplying two large integers never results in overflow, and dividing two integers yields an exact ratio. Floating point numbers are also supported, along with complex numbers." diff --git a/core/math/order/order-docs.factor b/core/math/order/order-docs.factor index 1bdd1009e9..8b2200aa67 100644 --- a/core/math/order/order-docs.factor +++ b/core/math/order/order-docs.factor @@ -87,7 +87,14 @@ ARTICLE: "order-specifiers" "Ordering specifiers" { $subsection +lt+ } { $subsection +eq+ } { $subsection +gt+ } ; - + +ARTICLE: "math.order.example" "Linear order example" +"A tuple class which defines an ordering among instances by comparing the values of the " { $snippet "id" } " slot:" +{ $code + "TUPLE: sprite id name bitmap ;" + "M: sprite <=> [ id>> ] compare ;" +} ; + ARTICLE: "math.order" "Linear order protocol" "Some classes have an intrinsic order amongst instances:" { $subsection <=> } @@ -101,6 +108,8 @@ ARTICLE: "math.order" "Linear order protocol" { $subsection before? } { $subsection after=? } { $subsection before=? } +"Out of the above generic words, it suffices to implement " { $link <=> } " alone. The others may be provided as an optimization." +{ $subsection "math.order.example" } { $see-also "sequences-sorting" } ; ABOUT: "math.order" diff --git a/core/namespaces/namespaces-docs.factor b/core/namespaces/namespaces-docs.factor index ff0542a7b8..74d7c58963 100644 --- a/core/namespaces/namespaces-docs.factor +++ b/core/namespaces/namespaces-docs.factor @@ -32,7 +32,7 @@ ARTICLE: "namespaces.private" "Namespace implementation details" { $subsection >n } { $subsection ndrop } ; -ARTICLE: "namespaces" "Variables and namespaces" +ARTICLE: "namespaces" "Dynamic variables and namespaces" "The " { $vocab-link "namespaces" } " vocabulary implements simple dynamically-scoped variables." $nl "A variable is an entry in an assoc of bindings, where the assoc is implicit rather than passed on the stack. These assocs are termed " { $emphasis "namespaces" } ". Nesting of scopes is implemented with a search order on namespaces, defined by a " { $emphasis "namestack" } ". Since namespaces are just assoc, any object can be used as a variable, however by convention, variables are keyed by symbols (see " { $link "words.symbol" } ")." @@ -43,7 +43,6 @@ $nl "Various utility words abstract away common variable access patterns:" { $subsection "namespaces-change" } { $subsection "namespaces-combinators" } -{ $subsection "namespaces-global" } "Implementation details your code probably does not care about:" { $subsection "namespaces.private" } "An alternative to dynamic scope is lexical scope. Lexically-scoped values and closures are implemented in the " { $vocab-link "locals" } " vocabulary." ; diff --git a/core/parser/parser-docs.factor b/core/parser/parser-docs.factor index 547f7c0490..be4b345f4f 100644 --- a/core/parser/parser-docs.factor +++ b/core/parser/parser-docs.factor @@ -92,9 +92,7 @@ ARTICLE: "parser" "The parser" "This parser is a general facility for reading textual representations of objects and definitions. The parser is implemented in the " { $vocab-link "parser" } " and " { $vocab-link "syntax" } " vocabularies." $nl "This section concerns itself with usage and extension of the parser. Standard syntax is described in " { $link "syntax" } "." -{ $subsection "vocabulary-search" } { $subsection "parser-files" } -{ $subsection "top-level-forms" } "The parser can be extended." { $subsection "parsing-words" } { $subsection "parser-lexer" } diff --git a/core/quotations/quotations-docs.factor b/core/quotations/quotations-docs.factor index 2a03b7c74f..a72f4adf88 100644 --- a/core/quotations/quotations-docs.factor +++ b/core/quotations/quotations-docs.factor @@ -24,7 +24,7 @@ ARTICLE: "wrappers" "Wrappers" "Wrappers are used to push words on the data stack; they evaluate to the object being wrapped:" { $subsection wrapper } { $subsection literalize } -{ $see-also "dataflow" "combinators" } ; +{ $see-also "combinators" } ; ABOUT: "quotations" diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index e2badc2031..4103950005 100755 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1354,14 +1354,16 @@ ARTICLE: "virtual-sequences" "Virtual sequences" "Virtual sequences allow different ways of accessing a sequence without having to create a new sequence or a new data structure altogether. To do this, they translate the virtual index into a normal index into an underlying sequence using the " { $link "virtual-sequences-protocol" } "." { $subsection "virtual-sequences-protocol" } ; -ARTICLE: "sequences-integers" "Integer sequences and counted loops" +ARTICLE: "sequences-integers" "Counted loops" "Integers support the sequence protocol in a trivial fashion; a non-negative integer presents its non-negative predecessors as elements. For example, the integer 3, when viewed as a sequence, contains the elements 0, 1, and 2. This is very useful for performing counted loops." $nl "For example, the " { $link each } " combinator, given an integer, simply calls a quotation that number of times, pushing a counter on each iteration that ranges from 0 up to that integer:" { $example "3 [ . ] each" "0\n1\n2" } "A common idiom is to iterate over a sequence, while also maintaining a loop counter. This can be done using " { $link each-index } ", " { $link map-index } " and " { $link reduce-index } "." $nl -"Combinators that produce new sequences, such as " { $link map } ", will output an array if the input is an integer." ; +"Combinators that produce new sequences, such as " { $link map } ", will output an array if the input is an integer." +$nl +"More elaborate counted loops can be performed with " { $link "math.ranges" } "." ; ARTICLE: "sequences-access" "Accessing sequence elements" { $subsection ?nth } @@ -1593,7 +1595,6 @@ $nl "Sequences implement a protocol:" { $subsection "sequence-protocol" } { $subsection "sequences-f" } -{ $subsection "sequences-integers" } "Sequence utility words can operate on any object whose class implements the sequence protocol. Most implementations are backed by storage. Some implementations obtain their elements from an underlying sequence, or compute them on the fly. These are known as " { $link "virtual-sequences" } "." { $subsection "sequences-access" } { $subsection "sequences-combinators" } @@ -1612,6 +1613,10 @@ $nl { $subsection "binary-search" } { $subsection "sets" } { $subsection "sequences-trimming" } +{ $subsection "sequences.deep" } +"Using sequences for looping:" +{ $subsection "sequences-integers" } +{ $subsection "ranges" } "For inner loops:" { $subsection "sequences-unsafe" } ; diff --git a/core/slots/slots-docs.factor b/core/slots/slots-docs.factor index 840fe628e0..1e5f9bf1dd 100644 --- a/core/slots/slots-docs.factor +++ b/core/slots/slots-docs.factor @@ -83,7 +83,7 @@ $nl "A word can be used to check if a class has an initial value or not:" { $subsection initial-value } ; -ARTICLE: "slots" "Slots" +ARTICLE: "slots" "Low-level slot operations" "The " { $vocab-link "slots" } " vocabulary contains words for introspecting the slots of an object. A " { $emphasis "slot" } " is a component of an object which can store a value." $nl { $link "tuples" } " are composed entirely of slots, and instances of " { $link "builtin-classes" } " consist of slots together with intrinsic data." @@ -104,6 +104,9 @@ $nl { $subsection define-changer } { $subsection define-slot-methods } { $subsection define-accessors } +"Unsafe slot access:" +{ $subsection slot } +{ $subsection set-slot } { $see-also "accessors" "mirrors" } ; ABOUT: "slots" diff --git a/extra/peg-lexer/tags.txt b/extra/peg-lexer/tags.txt index 47619a17f8..44385cf3b7 100644 --- a/extra/peg-lexer/tags.txt +++ b/extra/peg-lexer/tags.txt @@ -1 +1,2 @@ -reflection \ No newline at end of file +extensions +reflection From 1071a3c5644534127ec33551501e29b6d5ede673 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 03:03:46 -0500 Subject: [PATCH 24/65] Fix ui.tools.browser.history tests --- .../tools/browser/history/history-tests.factor | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/basis/ui/tools/browser/history/history-tests.factor b/basis/ui/tools/browser/history/history-tests.factor index 20b16f450a..454e4700a0 100644 --- a/basis/ui/tools/browser/history/history-tests.factor +++ b/basis/ui/tools/browser/history/history-tests.factor @@ -1,7 +1,13 @@ -USING: namespaces ui.tools.browser.history sequences tools.test ; +USING: namespaces ui.tools.browser.history sequences tools.test +accessors kernel ; IN: ui.tools.browser.history.tests -f "history" set +TUPLE: dummy obj ; + +M: dummy history-value obj>> ; +M: dummy set-history-value (>>obj) ; + +dummy new "history" set "history" get add-history @@ -9,27 +15,27 @@ f "history" set [ t ] [ "history" get forward>> empty? ] unit-test "history" get add-history -"history" get 3 >>value drop +3 "history" get owner>> set-history-value [ t ] [ "history" get back>> empty? ] unit-test [ t ] [ "history" get forward>> empty? ] unit-test "history" get add-history -"history" get 4 >>value drop +4 "history" get owner>> set-history-value [ f ] [ "history" get back>> empty? ] unit-test [ t ] [ "history" get forward>> empty? ] unit-test "history" get go-back -[ 3 ] [ "history" get value>> ] unit-test +[ 3 ] [ "history" get owner>> history-value ] unit-test [ t ] [ "history" get back>> empty? ] unit-test [ f ] [ "history" get forward>> empty? ] unit-test "history" get go-forward -[ 4 ] [ "history" get value>> ] unit-test +[ 4 ] [ "history" get owner>> history-value ] unit-test [ f ] [ "history" get back>> empty? ] unit-test [ t ] [ "history" get forward>> empty? ] unit-test From 3af8643c309ef5ea0b1ad067b1378f02c6a18048 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 03:03:58 -0500 Subject: [PATCH 25/65] More tags --- extra/descriptive/tags.txt | 1 + extra/multi-methods/tags.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 extra/descriptive/tags.txt create mode 100644 extra/multi-methods/tags.txt diff --git a/extra/descriptive/tags.txt b/extra/descriptive/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/extra/descriptive/tags.txt @@ -0,0 +1 @@ +extensions diff --git a/extra/multi-methods/tags.txt b/extra/multi-methods/tags.txt new file mode 100644 index 0000000000..f4274299b1 --- /dev/null +++ b/extra/multi-methods/tags.txt @@ -0,0 +1 @@ +extensions From 0f04061079a8b6fbc157aa873a982d2c9a635693 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 03:30:23 -0500 Subject: [PATCH 26/65] Fixing some unit test failures --- basis/prettyprint/prettyprint-tests.factor | 8 ++------ core/words/constant/constant-tests.factor | 8 +++++++- core/words/constant/constant.factor | 11 +++++++---- core/words/symbol/symbol.factor | 7 +++---- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/basis/prettyprint/prettyprint-tests.factor b/basis/prettyprint/prettyprint-tests.factor index 3350ae6c7b..799d500c18 100644 --- a/basis/prettyprint/prettyprint-tests.factor +++ b/basis/prettyprint/prettyprint-tests.factor @@ -278,11 +278,7 @@ GENERIC: generic-see-test-with-f ( obj -- obj ) M: f generic-see-test-with-f ; [ "USING: prettyprint.tests ;\nM: f generic-see-test-with-f ;\n" ] [ - [ { POSTPONE: f generic-see-test-with-f } see ] with-string-writer -] unit-test - -[ "USING: prettyprint.tests ;\nM: f generic-see-test-with-f ;\n" ] [ - [ \ f \ generic-see-test-with-f method see ] with-string-writer + [ M\ f generic-see-test-with-f see ] with-string-writer ] unit-test PREDICATE: predicate-see-test < integer even? ; @@ -309,5 +305,5 @@ GENERIC: ended-up-ballin' ( a -- b ) M: started-out-hustlin' ended-up-ballin' ; inline [ "USING: prettyprint.tests ;\nM: started-out-hustlin' ended-up-ballin' ; inline\n" ] [ - [ { started-out-hustlin' ended-up-ballin' } see ] with-string-writer + [ M\ started-out-hustlin' ended-up-ballin' see ] with-string-writer ] unit-test diff --git a/core/words/constant/constant-tests.factor b/core/words/constant/constant-tests.factor index 2755039af6..721846b2d1 100644 --- a/core/words/constant/constant-tests.factor +++ b/core/words/constant/constant-tests.factor @@ -1,10 +1,12 @@ IN: words.constant.tests -USING: tools.test math ; +USING: tools.test math words.constant ; CONSTANT: a + [ + ] [ a ] unit-test +[ t ] [ \ a constant? ] unit-test + CONSTANT: b \ + [ \ + ] [ b ] unit-test @@ -12,3 +14,7 @@ CONSTANT: b \ + CONSTANT: c { 1 2 3 } [ { 1 2 3 } ] [ c ] unit-test + +SYMBOL: foo + +[ f ] [ \ foo constant? ] unit-test \ No newline at end of file diff --git a/core/words/constant/constant.factor b/core/words/constant/constant.factor index 00302df98a..b518760bf9 100644 --- a/core/words/constant/constant.factor +++ b/core/words/constant/constant.factor @@ -3,12 +3,15 @@ USING: accessors kernel sequences words definitions quotations ; IN: words.constant -PREDICATE: constant < word ( obj -- ? ) - def>> dup length 1 = [ first word? not ] [ drop f ] if ; +PREDICATE: constant < word "constant" word-prop >boolean ; : define-constant ( word value -- ) - [ ] curry (( -- value )) define-inline ; + [ "constant" set-word-prop ] + [ [ ] curry (( -- value )) define-inline ] 2bi ; + +M: constant reset-word + [ call-next-method ] [ f "constant" set-word-prop ] bi ; M: constant definer drop \ CONSTANT: f ; -M: constant definition def>> first literalize 1quotation ; \ No newline at end of file +M: constant definition "constant" word-prop literalize 1quotation ; \ No newline at end of file diff --git a/core/words/symbol/symbol.factor b/core/words/symbol/symbol.factor index a107808eec..34ec6b9174 100644 --- a/core/words/symbol/symbol.factor +++ b/core/words/symbol/symbol.factor @@ -1,10 +1,9 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel sequences accessors definitions -words words.constant ; +USING: kernel sequences accessors definitions words ; IN: words.symbol -PREDICATE: symbol < constant ( obj -- ? ) +PREDICATE: symbol < word ( obj -- ? ) [ def>> ] [ [ ] curry ] bi sequence= ; M: symbol definer drop \ SYMBOL: f ; @@ -12,4 +11,4 @@ M: symbol definer drop \ SYMBOL: f ; M: symbol definition drop f ; : define-symbol ( word -- ) - dup define-constant ; + dup [ ] curry (( -- value )) define-inline ; From fb246e2c85497940576a8b08565e37acce8a177e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 04:15:58 -0500 Subject: [PATCH 27/65] Documentation fixes --- core/io/encodings/encodings-docs.factor | 4 ++-- core/sequences/sequences-docs.factor | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/io/encodings/encodings-docs.factor b/core/io/encodings/encodings-docs.factor index 204441c19a..d0f968a791 100644 --- a/core/io/encodings/encodings-docs.factor +++ b/core/io/encodings/encodings-docs.factor @@ -80,12 +80,12 @@ ARTICLE: "encodings-descriptors" "Encoding descriptors" "An encoding descriptor is something which can be used with binary input or output streams to encode or decode bytes stored in a certain representation. It must conform to the " { $link "encodings-protocol" } ". Encodings which you can use are defined in the following vocabularies:" { $subsection "io.encodings.binary" } { $subsection "io.encodings.utf8" } -{ $subsection "io.encodings.utf16" } +{ $vocab-subsection "UTF-16 encoding" "io.encodings.utf16" } { $vocab-subsection "UTF-32 encoding" "io.encodings.utf32" } { $vocab-subsection "Strict encodings" "io.encodings.strict" } "Legacy encodings:" { $vocab-subsection "8-bit encodings" "io.encodings.8-bit" } -{ $vocab-subsection "ASCII" "io.encodings.ascii" } +{ $vocab-subsection "ASCII encoding" "io.encodings.ascii" } { $see-also "encodings-introduction" } ; ARTICLE: "encodings-protocol" "Encoding protocol" diff --git a/core/sequences/sequences-docs.factor b/core/sequences/sequences-docs.factor index 4103950005..556e41249e 100755 --- a/core/sequences/sequences-docs.factor +++ b/core/sequences/sequences-docs.factor @@ -1616,7 +1616,7 @@ $nl { $subsection "sequences.deep" } "Using sequences for looping:" { $subsection "sequences-integers" } -{ $subsection "ranges" } +{ $subsection "math.ranges" } "For inner loops:" { $subsection "sequences-unsafe" } ; From 7bf0a46d3d02efa1aaa3dff0c5117f31d9134ec2 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 04:16:39 -0500 Subject: [PATCH 28/65] Updating tests for method-spec removal --- core/classes/classes.factor | 3 +-- core/classes/tuple/tuple-tests.factor | 2 +- core/generic/generic.factor | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/classes/classes.factor b/core/classes/classes.factor index eded33beed..ab8ba398cd 100644 --- a/core/classes/classes.factor +++ b/core/classes/classes.factor @@ -174,8 +174,7 @@ GENERIC: update-methods ( class seq -- ) [ forget ] [ drop ] if ] [ 2drop ] if ; -: forget-methods ( class -- ) - [ implementors ] [ [ swap 2array ] curry ] bi map forget-all ; +GENERIC: forget-methods ( class -- ) GENERIC: class-forgotten ( use class -- ) diff --git a/core/classes/tuple/tuple-tests.factor b/core/classes/tuple/tuple-tests.factor index fa2df4e312..6de1810a51 100644 --- a/core/classes/tuple/tuple-tests.factor +++ b/core/classes/tuple/tuple-tests.factor @@ -133,7 +133,7 @@ M: integer forget-robustness-generic ; [ [ ] [ \ forget-robustness-generic forget ] unit-test [ ] [ \ forget-robustness forget ] unit-test - [ ] [ { forget-robustness forget-robustness-generic } forget ] unit-test + [ ] [ M\ forget-robustness forget-robustness-generic forget ] unit-test ] with-compilation-unit ! rapido found this one diff --git a/core/generic/generic.factor b/core/generic/generic.factor index ab0685f1d6..65a802dc2d 100644 --- a/core/generic/generic.factor +++ b/core/generic/generic.factor @@ -188,5 +188,8 @@ M: generic subwords M: generic forget* [ subwords forget-all ] [ call-next-method ] bi ; +M: class forget-methods + [ implementors ] [ [ swap method ] curry ] bi map forget-all ; + : xref-generics ( -- ) all-words [ subwords [ xref ] each ] each ; From 890553b776009278dea4884cb5945f7b3ab56210 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 05:22:28 -0500 Subject: [PATCH 29/65] Fixing tests for method-sec removal --- basis/locals/locals-tests.factor | 2 +- basis/models/arrow/smart/smart-docs.factor | 21 +++++++++++++++++++ .../annotations/annotations-tests.factor | 2 +- basis/tools/deploy/test/14/14.factor | 17 +++++++++++++++ basis/tools/deploy/test/14/authors.txt | 1 + basis/tools/deploy/test/14/deploy.factor | 15 +++++++++++++ basis/ui/traverse/traverse-docs.factor | 0 basis/ui/traverse/traverse-tests.factor | 2 +- core/classes/tuple/tuple-tests.factor | 2 +- core/definitions/definitions-tests.factor | 11 ++++------ core/generic/generic-tests.factor | 4 ++-- 11 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 basis/models/arrow/smart/smart-docs.factor create mode 100644 basis/tools/deploy/test/14/14.factor create mode 100644 basis/tools/deploy/test/14/authors.txt create mode 100644 basis/tools/deploy/test/14/deploy.factor create mode 100644 basis/ui/traverse/traverse-docs.factor diff --git a/basis/locals/locals-tests.factor b/basis/locals/locals-tests.factor index 8e61e39faf..5e61c1ddfd 100644 --- a/basis/locals/locals-tests.factor +++ b/basis/locals/locals-tests.factor @@ -455,7 +455,7 @@ GENERIC: lambda-method-forget-test ( a -- b ) M:: integer lambda-method-forget-test ( a -- b ) ; -[ ] [ [ { integer lambda-method-forget-test } forget ] with-compilation-unit ] unit-test +[ ] [ [ M\ integer lambda-method-forget-test forget ] with-compilation-unit ] unit-test [ 10 ] [ 10 [| A | { [ A ] } ] call first call ] unit-test diff --git a/basis/models/arrow/smart/smart-docs.factor b/basis/models/arrow/smart/smart-docs.factor new file mode 100644 index 0000000000..45faf52b97 --- /dev/null +++ b/basis/models/arrow/smart/smart-docs.factor @@ -0,0 +1,21 @@ +IN: models.arrow.smart +USING: help.syntax help.markup models.product ; + +HELP: +{ $values { "quot" { $quotation "( ... -- output )" } } } +{ $description "A macro that expands into a form with the stack effect of the quotation. The form constructs a model which applies the quotation to values from an underlying " { $link product } " model having as many components as the quotation has inputs." } +{ $examples + "A model which adds the values of two existing models:" + { $example + "USING: models models.arrows.smart accessors math prettyprint ;" + "1 2 [ + ] " + "[ activate-model ] [ value>> ] bi ." + "3" + } +} ; + +ARTICLE: "models.arrows.smart" "Smart arrow models" +"The " { $vocab-link "models.arrows.smart" } " vocabulary generalizes arrows to arbitrary input arity. They're called “smart” because they resemble " { $link "combinators.smart" } "." +{ $subsection } ; + +ABOUT: "models.arrows.smart" \ No newline at end of file diff --git a/basis/tools/annotations/annotations-tests.factor b/basis/tools/annotations/annotations-tests.factor index f47852aca7..9fa9d1e2aa 100644 --- a/basis/tools/annotations/annotations-tests.factor +++ b/basis/tools/annotations/annotations-tests.factor @@ -43,6 +43,6 @@ GENERIC: blah-generic ( a -- b ) M: string blah-generic ; -{ string blah-generic } watch +[ ] [ M\ string blah-generic watch ] unit-test [ "hi" ] [ "hi" blah-generic ] unit-test diff --git a/basis/tools/deploy/test/14/14.factor b/basis/tools/deploy/test/14/14.factor new file mode 100644 index 0000000000..f21afc13d6 --- /dev/null +++ b/basis/tools/deploy/test/14/14.factor @@ -0,0 +1,17 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: alien threads ; +IN: tools.deploy.test.14 + +: (callback-yield-test) ( -- ) + "void" { } "cdecl" [ yield ] alien-callback + "void" { } "cdecl" alien-indirect ; + +: callback-yield-test ( -- ) + + "void" { } "cdecl" [ + (callback-yield-test) + ] alien-callback + "void" { } "cdecl" alien-indirect ; + +MAIN: callback-yield-test \ No newline at end of file diff --git a/basis/tools/deploy/test/14/authors.txt b/basis/tools/deploy/test/14/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/basis/tools/deploy/test/14/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/basis/tools/deploy/test/14/deploy.factor b/basis/tools/deploy/test/14/deploy.factor new file mode 100644 index 0000000000..0fe268822c --- /dev/null +++ b/basis/tools/deploy/test/14/deploy.factor @@ -0,0 +1,15 @@ +USING: tools.deploy.config ; +H{ + { deploy-name "tools.deploy.test.14" } + { deploy-threads? t } + { deploy-math? f } + { deploy-word-props? f } + { deploy-ui? f } + { deploy-io 1 } + { deploy-compiler? t } + { deploy-reflection 1 } + { "stop-after-last-window?" t } + { deploy-unicode? f } + { deploy-word-defs? f } + { deploy-c-types? f } +} diff --git a/basis/ui/traverse/traverse-docs.factor b/basis/ui/traverse/traverse-docs.factor new file mode 100644 index 0000000000..e69de29bb2 diff --git a/basis/ui/traverse/traverse-tests.factor b/basis/ui/traverse/traverse-tests.factor index e18637a652..4d2072db1c 100644 --- a/basis/ui/traverse/traverse-tests.factor +++ b/basis/ui/traverse/traverse-tests.factor @@ -62,4 +62,4 @@ M: object (flatten-tree) , ; { 0 1 } { 2 0 1 } { { "a" "b" "c" "d" } { "e" "f" "g" } { { "h" "i" } "j" } } gadgets-in-range ] unit-test -[ { array children>> } forget ] with-compilation-unit +[ M\ array children>> forget ] with-compilation-unit diff --git a/core/classes/tuple/tuple-tests.factor b/core/classes/tuple/tuple-tests.factor index 6de1810a51..75d733b213 100644 --- a/core/classes/tuple/tuple-tests.factor +++ b/core/classes/tuple/tuple-tests.factor @@ -559,7 +559,7 @@ DEFER: subclass-reset-test-3 GENERIC: break-me ( obj -- ) -[ ] [ [ { integer break-me } forget ] with-compilation-unit ] unit-test +[ ] [ [ M\ integer break-me forget ] with-compilation-unit ] unit-test [ ] [ "IN: classes.tuple.tests TUPLE: subclass-reset-test ;" "subclass-reset-test" parse-stream drop ] unit-test [ ] [ "IN: classes.tuple.tests TUPLE: subclass-reset-test-1 < subclass-reset-test ;" eval ] unit-test diff --git a/core/definitions/definitions-tests.factor b/core/definitions/definitions-tests.factor index b2d265a2e3..558b259103 100644 --- a/core/definitions/definitions-tests.factor +++ b/core/definitions/definitions-tests.factor @@ -20,14 +20,11 @@ TUPLE: some-class ; M: some-class some-generic ; -TUPLE: another-class some-generic ; - [ ] [ [ - { - some-generic - some-class - { another-class some-generic } - } forget-all + \ some-generic + \ some-class + 2array + forget-all ] with-compilation-unit ] unit-test diff --git a/core/generic/generic-tests.factor b/core/generic/generic-tests.factor index 151c2f52fa..f28332353e 100755 --- a/core/generic/generic-tests.factor +++ b/core/generic/generic-tests.factor @@ -161,7 +161,7 @@ M: sequence generic-forget-test-2 = ; ] unit-test [ ] [ - [ { sequence generic-forget-test-2 } forget ] with-compilation-unit + [ M\ sequence generic-forget-test-2 forget ] with-compilation-unit ] unit-test [ f ] [ @@ -231,7 +231,7 @@ M: number c-n-m-cache ; [ 3 ] [ 2 c-n-m-cache ] unit-test -[ ] [ [ { integer c-n-m-cache } forget ] with-compilation-unit ] unit-test +[ ] [ [ M\ integer c-n-m-cache forget ] with-compilation-unit ] unit-test [ 2 ] [ 2 c-n-m-cache ] unit-test From cb9e4a40692fdd55c6e9616be903510c3276d3a5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 05:22:43 -0500 Subject: [PATCH 30/65] Oops --- basis/tools/deploy/test/14/14.factor | 17 ----------------- basis/tools/deploy/test/14/authors.txt | 1 - basis/tools/deploy/test/14/deploy.factor | 15 --------------- 3 files changed, 33 deletions(-) delete mode 100644 basis/tools/deploy/test/14/14.factor delete mode 100644 basis/tools/deploy/test/14/authors.txt delete mode 100644 basis/tools/deploy/test/14/deploy.factor diff --git a/basis/tools/deploy/test/14/14.factor b/basis/tools/deploy/test/14/14.factor deleted file mode 100644 index f21afc13d6..0000000000 --- a/basis/tools/deploy/test/14/14.factor +++ /dev/null @@ -1,17 +0,0 @@ -! Copyright (C) 2009 Slava Pestov. -! See http://factorcode.org/license.txt for BSD license. -USING: alien threads ; -IN: tools.deploy.test.14 - -: (callback-yield-test) ( -- ) - "void" { } "cdecl" [ yield ] alien-callback - "void" { } "cdecl" alien-indirect ; - -: callback-yield-test ( -- ) - - "void" { } "cdecl" [ - (callback-yield-test) - ] alien-callback - "void" { } "cdecl" alien-indirect ; - -MAIN: callback-yield-test \ No newline at end of file diff --git a/basis/tools/deploy/test/14/authors.txt b/basis/tools/deploy/test/14/authors.txt deleted file mode 100644 index d4f5d6b3ae..0000000000 --- a/basis/tools/deploy/test/14/authors.txt +++ /dev/null @@ -1 +0,0 @@ -Slava Pestov \ No newline at end of file diff --git a/basis/tools/deploy/test/14/deploy.factor b/basis/tools/deploy/test/14/deploy.factor deleted file mode 100644 index 0fe268822c..0000000000 --- a/basis/tools/deploy/test/14/deploy.factor +++ /dev/null @@ -1,15 +0,0 @@ -USING: tools.deploy.config ; -H{ - { deploy-name "tools.deploy.test.14" } - { deploy-threads? t } - { deploy-math? f } - { deploy-word-props? f } - { deploy-ui? f } - { deploy-io 1 } - { deploy-compiler? t } - { deploy-reflection 1 } - { "stop-after-last-window?" t } - { deploy-unicode? f } - { deploy-word-defs? f } - { deploy-c-types? f } -} From dd43df655f6707b693b5cccc85e3c8d5ad951cb5 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 10:45:39 -0500 Subject: [PATCH 31/65] fix unit test for new method syntax --- basis/tools/disassembler/disassembler-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/tools/disassembler/disassembler-tests.factor b/basis/tools/disassembler/disassembler-tests.factor index 96f5a04378..49cfb054a1 100644 --- a/basis/tools/disassembler/disassembler-tests.factor +++ b/basis/tools/disassembler/disassembler-tests.factor @@ -3,4 +3,4 @@ USING: math classes.tuple prettyprint.custom tools.disassembler tools.test strings ; [ ] [ \ + disassemble ] unit-test -[ ] [ { string pprint* } disassemble ] unit-test +[ ] [ M\ string pprint* disassemble ] unit-test From adc764efa3238b8a75b1f3715a631bdbea8e8baa Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 13:26:07 -0500 Subject: [PATCH 32/65] Cleanup --- core/definitions/definitions.factor | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/core/definitions/definitions.factor b/core/definitions/definitions.factor index c95c5816ac..636067e04b 100644 --- a/core/definitions/definitions.factor +++ b/core/definitions/definitions.factor @@ -3,8 +3,6 @@ USING: kernel sequences namespaces assocs graphs math math.order ; IN: definitions -MIXIN: definition - ERROR: no-compilation-unit definition ; SYMBOLS: inlined-dependency flushed-dependency called-dependency ; @@ -42,7 +40,7 @@ GENERIC: set-where ( loc defspec -- ) GENERIC: forget* ( defspec -- ) -M: object forget* drop ; +M: f forget* drop ; SYMBOL: forgotten-definitions @@ -53,8 +51,6 @@ SYMBOL: forgotten-definitions : forget-all ( definitions -- ) [ forget ] each ; -GENERIC: synopsis* ( defspec -- ) - GENERIC: definer ( defspec -- start end ) GENERIC: definition ( defspec -- seq ) From 1d563edcd90495e5bbb174a9396fb79c5c449852 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 13:34:38 -0500 Subject: [PATCH 33/65] Oops --- core/definitions/definitions.factor | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/definitions/definitions.factor b/core/definitions/definitions.factor index 636067e04b..7463a863e5 100644 --- a/core/definitions/definitions.factor +++ b/core/definitions/definitions.factor @@ -3,6 +3,8 @@ USING: kernel sequences namespaces assocs graphs math math.order ; IN: definitions +MIXIN: definition + ERROR: no-compilation-unit definition ; SYMBOLS: inlined-dependency flushed-dependency called-dependency ; From 37e5d502f1869d18ccb8ea06a925d1f88bfebedd Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 13:39:55 -0500 Subject: [PATCH 34/65] Fix shift-drag losing focus in listener --- basis/ui/gadgets/editors/editors.factor | 1 + 1 file changed, 1 insertion(+) diff --git a/basis/ui/gadgets/editors/editors.factor b/basis/ui/gadgets/editors/editors.factor index 3eb40a5135..9461b2348f 100755 --- a/basis/ui/gadgets/editors/editors.factor +++ b/basis/ui/gadgets/editors/editors.factor @@ -452,6 +452,7 @@ editor "caret-motion" f { editor "selection" f { { T{ button-down f { S+ } 1 } extend-selection } + { T{ button-up f { S+ } 1 } com-copy-selection } { T{ drag } drag-selection } { gain-focus focus-editor } { lose-focus unfocus-editor } From cbd6b0ed3b11f427a59416802e5655637bf8b075 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Mon, 6 Apr 2009 15:18:35 -0400 Subject: [PATCH 35/65] fix documentation typo --- basis/ui/gadgets/buttons/buttons-docs.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/ui/gadgets/buttons/buttons-docs.factor b/basis/ui/gadgets/buttons/buttons-docs.factor index 6042a39886..a28a6aef84 100644 --- a/basis/ui/gadgets/buttons/buttons-docs.factor +++ b/basis/ui/gadgets/buttons/buttons-docs.factor @@ -26,7 +26,7 @@ HELP: { $description "Creates a new " { $link button } " derived from a " { $link } " which calls the quotation every 100 milliseconds as long as the mouse button is held down." } ; HELP: button-pen -{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " gneeric words by delegating to an object in one of four slots which depend on the state of the button being drawn:" +{ $class-description "A class implementing the " { $link draw-boundary } " and " { $link draw-interior } " generic words by delegating to an object in one of four slots which depend on the state of the button being drawn:" { $list { { $snippet "plain" } " - the button is inactive" } { { $snippet "rollover" } " - the button is under the mouse" } From 77f99eb70cda805feb463f1e77c0eb34fb25cc7a Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 17:32:20 -0500 Subject: [PATCH 36/65] use map-reduce instead of unclip reduce, "Why do we need this?" --> we don't --- basis/regexp/ast/ast.factor | 4 ++-- basis/regexp/transition-tables/transition-tables.factor | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/basis/regexp/ast/ast.factor b/basis/regexp/ast/ast.factor index be657227e5..2916ef7c32 100644 --- a/basis/regexp/ast/ast.factor +++ b/basis/regexp/ast/ast.factor @@ -21,12 +21,12 @@ CONSTANT: epsilon T{ tagged-epsilon { tag t } } TUPLE: concatenation first second ; : ( seq -- concatenation ) - [ epsilon ] [ unclip [ concatenation boa ] reduce ] if-empty ; + [ epsilon ] [ [ ] [ concatenation boa ] map-reduce ] if-empty ; TUPLE: alternation first second ; : ( seq -- alternation ) - unclip [ alternation boa ] reduce ; + [ ] [ alternation boa ] map-reduce ; TUPLE: star term ; C: star diff --git a/basis/regexp/transition-tables/transition-tables.factor b/basis/regexp/transition-tables/transition-tables.factor index 3c33ae8846..f452e3d24a 100644 --- a/basis/regexp/transition-tables/transition-tables.factor +++ b/basis/regexp/transition-tables/transition-tables.factor @@ -11,12 +11,7 @@ TUPLE: transition-table transitions start-state final-states ; H{ } clone >>transitions H{ } clone >>final-states ; -: maybe-initialize-key ( key hashtable -- ) - ! Why do we have to do this? - 2dup key? [ 2drop ] [ [ H{ } clone ] 2dip set-at ] if ; - :: (set-transition) ( from to obj hash -- ) - to condition? [ to hash maybe-initialize-key ] unless from hash at [ [ to obj ] dip set-at ] [ to obj associate from hash set-at ] if* ; @@ -25,7 +20,6 @@ TUPLE: transition-table transitions start-state final-states ; transitions>> (set-transition) ; :: (add-transition) ( from to obj hash -- ) - to hash maybe-initialize-key from hash at [ [ to obj ] dip push-at ] [ to 1vector obj associate from hash set-at ] if* ; From b6064813c92acb6ad64985258995dd2479356248 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 17:39:44 -0500 Subject: [PATCH 37/65] construct a glob-matching quote for robots.txt files --- extra/robots/robots.factor | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/extra/robots/robots.factor b/extra/robots/robots.factor index 1b2422f06e..242aa1dea2 100644 --- a/extra/robots/robots.factor +++ b/extra/robots/robots.factor @@ -3,11 +3,21 @@ USING: accessors http.client kernel unicode.categories sequences urls splitting combinators splitting.monotonic combinators.short-circuit assocs unicode.case arrays -math.parser calendar.format make ; +math.parser calendar.format make fry present globs +multiline regexp.combinators regexp ; IN: robots ! visit-time is GMT, request-rate is pages/second ! crawl-rate is seconds + +TUPLE: robots site sitemap rules rules-quot ; + +: ( site sitemap rules -- robots ) + \ robots new + swap >>rules + swap >>sitemap + swap >>site ; + TUPLE: rules user-agents allows disallows visit-time request-rate crawl-delay unknowns ; @@ -40,8 +50,8 @@ visit-time request-rate crawl-delay unknowns ; H{ } clone >>unknowns ; : add-user-agent ( rules agent -- rules ) over user-agents>> push ; -: add-allow ( rules allow -- rules ) over allows>> push ; -: add-disallow ( rules disallow -- rules ) over disallows>> push ; +: add-allow ( rules allow -- rules ) >url over allows>> push ; +: add-disallow ( rules disallow -- rules ) >url over disallows>> push ; : parse-robots.txt-line ( rules seq -- rules ) first2 swap { @@ -57,12 +67,26 @@ visit-time request-rate crawl-delay unknowns ; [ pick unknowns>> push-at ] } case ; +: derive-urls ( url seq -- seq' ) + [ derive-url present ] with { } map-as ; + +: robot-rules-quot ( robots -- quot ) + [ + [ site>> ] [ rules>> allows>> ] bi + derive-urls [ ] map + + ] [ + [ site>> ] [ rules>> disallows>> ] bi + derive-urls [ ] map + ] bi 2array '[ _ matches? ] ; + PRIVATE> : parse-robots.txt ( string -- sitemaps rules-seq ) normalize-robots.txt [ [ dup ] dip [ parse-robots.txt-line drop ] with each - ] map ; + ] map first ; -: robots ( url -- sitemaps rules-seq ) - get-robots.txt nip parse-robots.txt ; +: robots ( url -- robots ) + >url + dup get-robots.txt nip parse-robots.txt ; From e9b9907ef9a1217dd58d9be430fd9054ea74e24a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 17:49:34 -0500 Subject: [PATCH 38/65] Factor out site-watcher.email, start work on site-watcher.spider --- extra/benchmark/fib6/deploy.factor | 15 +++++++++++++++ extra/site-watcher/db/db.factor | 23 +++++++++++++++++++---- extra/site-watcher/email/authors.txt | 1 + extra/site-watcher/email/email.factor | 14 ++++++++++++++ extra/site-watcher/site-watcher.factor | 23 ++++++++--------------- extra/site-watcher/spider/authors.txt | 1 + extra/site-watcher/spider/spider.factor | 22 ++++++++++++++++++++++ extra/spider/report/report.factor | 24 +++++++++++++++++------- 8 files changed, 97 insertions(+), 26 deletions(-) create mode 100644 extra/benchmark/fib6/deploy.factor create mode 100644 extra/site-watcher/email/authors.txt create mode 100644 extra/site-watcher/email/email.factor create mode 100644 extra/site-watcher/spider/authors.txt create mode 100644 extra/site-watcher/spider/spider.factor diff --git a/extra/benchmark/fib6/deploy.factor b/extra/benchmark/fib6/deploy.factor new file mode 100644 index 0000000000..3a367dcd51 --- /dev/null +++ b/extra/benchmark/fib6/deploy.factor @@ -0,0 +1,15 @@ +USING: tools.deploy.config ; +H{ + { deploy-name "benchmark.fib6" } + { deploy-threads? f } + { deploy-math? f } + { deploy-word-props? f } + { deploy-ui? f } + { deploy-io 1 } + { deploy-compiler? t } + { deploy-reflection 1 } + { "stop-after-last-window?" t } + { deploy-unicode? f } + { deploy-word-defs? f } + { deploy-c-types? f } +} diff --git a/extra/site-watcher/db/db.factor b/extra/site-watcher/db/db.factor index 148e5b96f9..26d05441f3 100644 --- a/extra/site-watcher/db/db.factor +++ b/extra/site-watcher/db/db.factor @@ -47,9 +47,26 @@ watching-site "WATCHING_SITE" { { "site-id" "SITE_ID" INTEGER +user-assigned-id+ } } define-persistent -TUPLE: reporting-site email url up? changed? last-up? error last-error ; +TUPLE: spidering-site < watching-site max-depth max-count ; -> + site-id>> site new swap >>site-id select-tuple ; + +SLOT: account + +M: watching-site account>> + account-name>> account new swap >>account-name select-tuple ; + +spidering-site "SPIDERING_SITE" { + { "account-name" "ACCOUNT_NAME" VARCHAR +user-assigned-id+ } + { "site-id" "SITE_ID" INTEGER +user-assigned-id+ } + { "max-depth" "MAX_DEPTH" INTEGER } + { "max-count" "MAX_COUNT" INTEGER } +} define-persistent + +TUPLE: reporting-site site-id email url up? changed? last-up? error last-error ; : set-notify-site-watchers ( site new-up? -- site ) [ over up?>> = [ t >>changed? ] unless ] keep >>up? ; @@ -82,8 +99,6 @@ TUPLE: reporting-site email url up? changed? last-up? error last-error ; : select-account/site ( username url -- account site ) insert-site site-id>> ; -PRIVATE> - : watch-site ( username url -- ) select-account/site insert-tuple ; diff --git a/extra/site-watcher/email/authors.txt b/extra/site-watcher/email/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/extra/site-watcher/email/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/extra/site-watcher/email/email.factor b/extra/site-watcher/email/email.factor new file mode 100644 index 0000000000..d028788e26 --- /dev/null +++ b/extra/site-watcher/email/email.factor @@ -0,0 +1,14 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: smtp namespaces accessors kernel arrays ; +IN: site-watcher.email + +SYMBOL: site-watcher-from +site-watcher-from [ "factor-site-watcher@gmail.com" ] initialize + +: send-site-email ( watching-site body subject -- ) + [ account>> email>> ] 2dip + pick [ + [ site-watcher-from get >>from ] 3dip + [ 1array >>to ] [ >>body ] [ >>subject ] tri* send-email + ] [ 3drop ] if ; \ No newline at end of file diff --git a/extra/site-watcher/site-watcher.factor b/extra/site-watcher/site-watcher.factor index 114cdf3259..c2ec2ada79 100644 --- a/extra/site-watcher/site-watcher.factor +++ b/extra/site-watcher/site-watcher.factor @@ -3,13 +3,9 @@ USING: accessors alarms arrays calendar combinators combinators.smart continuations debugger http.client fry init io.streams.string kernel locals math math.parser db -namespaces sequences site-watcher.db site-watcher.db.private -smtp ; +namespaces sequences site-watcher.db site-watcher.email ; IN: site-watcher -SYMBOL: site-watcher-from -"factor-site-watcher@gmail.com" site-watcher-from set-global - SYMBOL: site-watcher-frequency 5 minutes site-watcher-frequency set-global @@ -23,22 +19,19 @@ SYMBOL: running-site-watcher [ dup url>> http-get 2drop site-good ] [ site-bad ] recover ] each ; -: site-up-email ( email site -- email ) +: site-up-email ( site -- body ) last-up>> now swap time- duration>minutes 60 /mod [ >integer number>string ] bi@ [ " hours, " append ] [ " minutes" append ] bi* append - "Site was down for (at least): " prepend >>body ; + "Site was down for (at least): " prepend ; -: site-down-email ( email site -- email ) error>> >>body ; +: site-down-email ( site -- body ) error>> ; : send-report ( site -- ) - [ ] dip - { - [ email>> 1array >>to ] - [ drop site-watcher-from get "factor.site.watcher@gmail.com" or >>from ] - [ dup up?>> [ site-up-email ] [ site-down-email ] if ] - [ [ url>> ] [ up?>> "up" "down" ? ] bi " is " glue >>subject ] - } cleave send-email ; + [ ] + [ dup up?>> [ site-up-email ] [ site-down-email ] if ] + [ [ url>> ] [ up?>> "up" "down" ? ] bi " is " glue ] tri + send-site-email ; : send-reports ( seq -- ) [ ] [ [ send-report ] each ] if-empty ; diff --git a/extra/site-watcher/spider/authors.txt b/extra/site-watcher/spider/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/extra/site-watcher/spider/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/extra/site-watcher/spider/spider.factor b/extra/site-watcher/spider/spider.factor new file mode 100644 index 0000000000..1b3a96a018 --- /dev/null +++ b/extra/site-watcher/spider/spider.factor @@ -0,0 +1,22 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: site-watcher.db site-watcher.email +spider spider.report +accessors kernel sequences +xml.writer ; +IN: site-watcher.spider + +: ( spidering-site -- spider ) + [ max-depth>> ] + [ max-count>> ] + [ site>> url>> ] + tri + + swap >>max-count + swap >>max-depth ; + +: spider-and-email ( spidering-site -- ) + [ ] + [ run-spider spider-report xml>string ] + [ site>> url>> "Spidered " prefix ] tri + send-site-email ; diff --git a/extra/spider/report/report.factor b/extra/spider/report/report.factor index 43952701d5..48620cac55 100644 --- a/extra/spider/report/report.factor +++ b/extra/spider/report/report.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs combinators kernel math math.statistics namespaces sequences sorting xml.syntax -spider ; +spider urls html ; IN: spider.report SYMBOL: network-failures @@ -87,27 +87,37 @@ SYMBOL: time-std slowest-pages-table timing-summary-table [XML -

Slowest pages

+

Slowest pages

<-> -

Summary

+

Summary

<-> XML] ; : generate-report ( -- html ) + url get dup report-broken-pages report-network-failures report-timings [XML -

Broken pages

+

Spider report

+ URL: ><-> + +

Broken pages

<-> -

Network failures

+

Network failures

<-> -

Load times

+

Load times

<-> XML] ; : spider-report ( spider -- html ) - [ spidered>> process-results generate-report ] with-scope ; + [ "Spider report" f ] dip + [ + [ base>> url set ] + [ spidered>> process-results ] bi + generate-report + ] with-scope + simple-page ; From 37e278ed02d020451869af91e77fd48849381293 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 17:50:54 -0500 Subject: [PATCH 39/65] Use [ ] [ ] map-reduce instead of unclip [ ] reduce --- basis/compiler/cfg/linear-scan/allocation/allocation.factor | 2 +- basis/compiler/tree/propagation/info/info.factor | 2 +- basis/hints/hints.factor | 2 +- core/classes/builtin/builtin.factor | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/basis/compiler/cfg/linear-scan/allocation/allocation.factor b/basis/compiler/cfg/linear-scan/allocation/allocation.factor index 8d00a14ea2..908bf2475b 100644 --- a/basis/compiler/cfg/linear-scan/allocation/allocation.factor +++ b/basis/compiler/cfg/linear-scan/allocation/allocation.factor @@ -99,7 +99,7 @@ SYMBOL: spill-counts : interval-to-spill ( active-intervals current -- live-interval ) #! We spill the interval with the most distant use location. start>> '[ dup _ [ >= ] find-use nip ] { } map>assoc - unclip-slice [ [ [ second ] bi@ > ] most ] reduce first ; + [ ] [ [ [ second ] bi@ > ] most ] map-reduce first ; : assign-spill ( before after -- before after ) #! If it has been spilled already, reuse spill location. diff --git a/basis/compiler/tree/propagation/info/info.factor b/basis/compiler/tree/propagation/info/info.factor index c56db570b2..a22b7aa172 100644 --- a/basis/compiler/tree/propagation/info/info.factor +++ b/basis/compiler/tree/propagation/info/info.factor @@ -238,7 +238,7 @@ DEFER: (value-info-union) : value-infos-union ( infos -- info ) [ null-info ] - [ unclip-slice [ value-info-union ] reduce ] if-empty ; + [ [ ] [ value-info-union ] map-reduce ] if-empty ; : literals<= ( info1 info2 -- ? ) { diff --git a/basis/hints/hints.factor b/basis/hints/hints.factor index 6fece31d88..2534e0121f 100644 --- a/basis/hints/hints.factor +++ b/basis/hints/hints.factor @@ -25,7 +25,7 @@ M: object specializer-declaration class ; [ drop object eq? not ] assoc-filter [ [ t ] ] [ [ swap specializer-predicate append ] { } assoc>map - unclip [ swap [ f ] \ if 3array append [ ] like ] reduce + [ ] [ swap [ f ] \ if 3array append [ ] like ] map-reduce ] if-empty ; : specializer-cases ( quot word -- default alist ) diff --git a/core/classes/builtin/builtin.factor b/core/classes/builtin/builtin.factor index 0e4a3b56fd..f95d66fd05 100644 --- a/core/classes/builtin/builtin.factor +++ b/core/classes/builtin/builtin.factor @@ -55,7 +55,7 @@ M: anonymous-intersection (flatten-class) [ builtins get sift [ (flatten-class) ] each ] [ - unclip [ assoc-intersect ] reduce [ swap set ] assoc-each + [ ] [ assoc-intersect ] map-reduce [ swap set ] assoc-each ] if-empty ; M: anonymous-complement (flatten-class) From 2c08376cd53058a81e589a9a229210fbcd5515d4 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 17:52:14 -0500 Subject: [PATCH 40/65] Minor doc updates --- basis/colors/colors-docs.factor | 2 +- basis/help/home/home.factor | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/colors/colors-docs.factor b/basis/colors/colors-docs.factor index 8881d89711..5e2b09380d 100644 --- a/basis/colors/colors-docs.factor +++ b/basis/colors/colors-docs.factor @@ -23,7 +23,7 @@ $nl ARTICLE: "colors" "Colors" "The " { $vocab-link "colors" } " vocabulary defines a protocol for colors, with a concrete implementation for RGBA colors. This vocabulary is used by " { $vocab-link "io.styles" } ", " { $vocab-link "ui" } " and other vocabularies, but it is independent of them." $nl -"RGBA colors:" +"RGBA colors with floating point components in the range " { $snippet "[0,1]" } ":" { $subsection rgba } { $subsection } "Converting a color to RGBA:" diff --git a/basis/help/home/home.factor b/basis/help/home/home.factor index f32c0db30d..9cb3c6f1bb 100644 --- a/basis/help/home/home.factor +++ b/basis/help/home/home.factor @@ -21,7 +21,7 @@ M: apropos add-recent-where recent-searches ; M: object add-recent-where f ; : $recent ( element -- ) - first get [ nl ] [ 1array $pretty-link ] interleave ; + first get reverse [ nl ] [ 1array $pretty-link ] interleave ; : $recent-searches ( element -- ) drop recent-searches get [ <$link> ] map $list ; From c91712bea0d28c158a47222816553e919edd069f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 18:10:49 -0500 Subject: [PATCH 41/65] clean up a combinator in id3 parser --- extra/id3/id3.factor | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/extra/id3/id3.factor b/extra/id3/id3.factor index 8e824d689f..5076a4a8ab 100644 --- a/extra/id3/id3.factor +++ b/extra/id3/id3.factor @@ -163,17 +163,13 @@ TUPLE: id3v1-info title artist album year comment genre ; } cond ] with-mapped-uchar-file ; -: (find-id3-frame) ( id3 name quot: ( obj -- obj' ) -- obj' ) - [ swap frames>> at* ] dip - [ data>> ] prepose [ drop f ] if ; inline - PRIVATE> : mp3>id3 ( path -- id3v2-info/f ) dup file-info size>> 0 <= [ drop f ] [ (mp3>id3) ] if ; inline : find-id3-frame ( id3 name -- obj/f ) - [ ] (find-id3-frame) ; inline + swap frames>> at* [ data>> ] when ; inline : title ( id3 -- title/f ) "TIT2" find-id3-frame ; inline @@ -186,7 +182,7 @@ PRIVATE> : comment ( id3 -- comment/f ) "COMM" find-id3-frame ; inline : genre ( id3 -- genre/f ) - "TCON" [ parse-genre ] (find-id3-frame) ; inline + "TCON" find-id3-frame parse-genre ; inline : find-mp3s ( path -- seq ) [ >lower ".mp3" tail? ] find-all-files ; inline From a380ae223985d74b9570b8498f52c8c48e42c6c1 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 18:47:46 -0500 Subject: [PATCH 42/65] refactor spider --- extra/spider/spider.factor | 45 ++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/extra/spider/spider.factor b/extra/spider/spider.factor index 49d6c33f8f..17e91473c3 100644 --- a/extra/spider/spider.factor +++ b/extra/spider/spider.factor @@ -5,12 +5,12 @@ http.client kernel tools.time sets assocs sequences concurrency.combinators io threads namespaces math multiline math.parser inspector urls logging combinators.short-circuit continuations calendar prettyprint dlists deques locals -spider.unique-deque ; +spider.unique-deque combinators concurrency.semaphores ; IN: spider TUPLE: spider base count max-count sleep max-depth initial-links filters spidered todo nonmatching quiet currently-spidering -#threads follow-robots? robots ; +#threads semaphore follow-robots? robots ; TUPLE: spider-result url depth headers fetched-in parsed-html links processed-in fetched-at ; @@ -26,7 +26,12 @@ fetched-in parsed-html links processed-in fetched-at ; 0 >>count 1/0. >>max-count H{ } clone >>spidered - 1 >>#threads ; + 1 [ >>#threads ] [ >>semaphore ] bi ; + +: ( url depth -- spider-result ) + spider-result new + swap >>depth + swap >>url ; > ] [ depth>> ] bi "depth: " write number>string write ", spidering: " write . yield ; -:: new-spidered-result ( spider url depth -- spider-result ) - f url spider spidered>> set-at - [ url http-get ] benchmark :> fetched-at :> html :> headers +:: fill-spidered-result ( spider spider-result -- ) + f spider-result url>> spider spidered>> set-at + [ spider-result url>> http-get ] benchmark :> fetched-in :> html :> headers [ html parse-html spider currently-spidering>> over find-all-links normalize-hrefs - ] benchmark :> processing-time :> links :> parsed-html - url depth headers fetched-at parsed-html links processing-time - now spider-result boa ; + ] benchmark :> processed-in :> links :> parsed-html + spider-result + headers >>headers + fetched-in >>fetched-in + parsed-html >>parsed-html + links >>links + processed-in >>processed-in + now >>fetched-at drop ; -:: spider-page ( spider url depth -- ) - spider quiet>> [ url depth print-spidering ] unless - spider url depth new-spidered-result :> spidered-result - spider quiet>> [ spidered-result describe ] unless - spider spidered-result add-spidered ; +:: spider-page ( spider spider-result -- ) + spider quiet>> [ spider-result print-spidering ] unless + spider spider-result fill-spidered-result + spider quiet>> [ spider-result describe ] unless + spider spider-result add-spidered ; \ spider-page ERROR add-error-logging @@ -94,9 +105,9 @@ fetched-in parsed-html links processed-in fetched-at ; [ [ count>> ] [ max-count>> ] bi < ] } 1&& ; -: setup-next-url ( spider -- spider url depth ) +: setup-next-url ( spider -- spider spider-result ) dup todo>> peek-url url>> >>currently-spidering - dup todo>> pop-url [ url>> ] [ depth>> ] bi ; + dup todo>> pop-url [ url>> ] [ depth>> ] bi ; : spider-next-page ( spider -- ) setup-next-url spider-page ; From fb37e0eacae2f365aa8cb99da133318554f858ff Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 6 Apr 2009 19:43:50 -0500 Subject: [PATCH 43/65] unbreak regexp --- basis/regexp/dfa/dfa.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/regexp/dfa/dfa.factor b/basis/regexp/dfa/dfa.factor index d137ee3e4f..2de4e8b0e0 100644 --- a/basis/regexp/dfa/dfa.factor +++ b/basis/regexp/dfa/dfa.factor @@ -51,10 +51,13 @@ IN: regexp.dfa [ condition-states ] 2dip '[ _ _ add-todo-state ] each ; +: ensure-state ( key table -- ) + 2dup key? [ 2drop ] [ [ H{ } clone ] 2dip set-at ] if ; inline + :: new-transitions ( nfa dfa new-states visited-states -- nfa dfa ) new-states [ nfa dfa ] [ pop :> state - state dfa transitions>> maybe-initialize-key + state dfa transitions>> ensure-state state nfa find-transitions [| trans | state trans nfa find-closure :> new-state From 9f08e3a6bf57a87e4c4ca5bdbcd5e76e6c99dfec Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 21:59:27 -0500 Subject: [PATCH 44/65] Working on site-watcher --- extra/site-watcher/db/db.factor | 37 +++++++--- extra/site-watcher/site-watcher.factor | 6 +- extra/site-watcher/spider/spider.factor | 7 +- extra/spider/report/report.factor | 9 +-- extra/webapps/site-watcher/common/authors.txt | 1 + .../webapps/site-watcher/common/common.factor | 6 ++ extra/webapps/site-watcher/common/main.xml | 13 ++++ .../webapps/site-watcher/common/site-list.xml | 28 ++++++++ .../{ => common}/site-watcher.xml | 0 .../site-watcher/common/spider-list.xml | 28 ++++++++ .../{ => common}/update-notify.xml | 0 extra/webapps/site-watcher/main.xml | 7 -- extra/webapps/site-watcher/site-list.xml | 32 --------- .../webapps/site-watcher/site-watcher.factor | 72 ++++--------------- .../site-watcher/spidering/authors.txt | 1 + .../site-watcher/spidering/spidering.factor | 52 ++++++++++++++ .../webapps/site-watcher/watching/authors.txt | 1 + .../site-watcher/watching/watching.factor | 52 ++++++++++++++ 18 files changed, 234 insertions(+), 118 deletions(-) create mode 100644 extra/webapps/site-watcher/common/authors.txt create mode 100644 extra/webapps/site-watcher/common/common.factor create mode 100644 extra/webapps/site-watcher/common/main.xml create mode 100644 extra/webapps/site-watcher/common/site-list.xml rename extra/webapps/site-watcher/{ => common}/site-watcher.xml (100%) create mode 100644 extra/webapps/site-watcher/common/spider-list.xml rename extra/webapps/site-watcher/{ => common}/update-notify.xml (100%) delete mode 100644 extra/webapps/site-watcher/main.xml delete mode 100644 extra/webapps/site-watcher/site-list.xml create mode 100644 extra/webapps/site-watcher/spidering/authors.txt create mode 100644 extra/webapps/site-watcher/spidering/spidering.factor create mode 100644 extra/webapps/site-watcher/watching/authors.txt create mode 100644 extra/webapps/site-watcher/watching/watching.factor diff --git a/extra/site-watcher/db/db.factor b/extra/site-watcher/db/db.factor index 26d05441f3..003b6bb58b 100644 --- a/extra/site-watcher/db/db.factor +++ b/extra/site-watcher/db/db.factor @@ -2,10 +2,10 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors continuations db db.sqlite db.tuples db.types io.directories io.files.temp kernel io.streams.string calendar -debugger combinators.smart sequences ; +debugger combinators.smart sequences arrays ; IN: site-watcher.db -TUPLE: account account-id account-name email twitter sms ; +TUPLE: account account-name email twitter sms ; : ( account-name email -- account ) account new @@ -25,6 +25,12 @@ TUPLE: site site-id url up? changed? last-up error last-error ; site new swap >>url ; +: site-with-url ( url -- site ) + select-tuple ; + +: site-with-id ( id -- site ) + site new swap >>site-id select-tuple ; + site "SITE" { { "site-id" "SITE_ID" INTEGER +db-assigned-id+ } { "url" "URL" VARCHAR } @@ -49,10 +55,12 @@ watching-site "WATCHING_SITE" { TUPLE: spidering-site < watching-site max-depth max-count ; +C: spidering-site + SLOT: site M: watching-site site>> - site-id>> site new swap >>site-id select-tuple ; + site-id>> site-with-id ; SLOT: account @@ -60,12 +68,25 @@ M: watching-site account>> account-name>> account new swap >>account-name select-tuple ; spidering-site "SPIDERING_SITE" { - { "account-name" "ACCOUNT_NAME" VARCHAR +user-assigned-id+ } - { "site-id" "SITE_ID" INTEGER +user-assigned-id+ } { "max-depth" "MAX_DEPTH" INTEGER } { "max-count" "MAX_COUNT" INTEGER } } define-persistent +: spidering-sites ( username -- sites ) + spidering-site new swap >>account-name select-tuples ; + +: insert-site ( url -- site ) + dup select-tuple [ ] [ dup t >>up? insert-tuple ] ?if ; + +: select-account/site ( username url -- account site ) + insert-site site-id>> ; + +: add-spidered-site ( username url -- ) + select-account/site 10 10 insert-tuple ; + +: remove-spidered-site ( username url -- ) + select-account/site 10 10 delete-tuples ; + TUPLE: reporting-site site-id email url up? changed? last-up? error last-error ; : set-notify-site-watchers ( site new-up? -- site ) @@ -89,16 +110,10 @@ TUPLE: reporting-site site-id email url up? changed? last-up? error last-error ; [ [ reporting-site boa ] input dup select-tuple [ ] [ dup t >>up? insert-tuple ] ?if ; - : insert-account ( account-name email -- ) insert-tuple ; : find-sites ( -- seq ) f select-tuples ; -: select-account/site ( username url -- account site ) - insert-site site-id>> ; - : watch-site ( username url -- ) select-account/site insert-tuple ; diff --git a/extra/site-watcher/site-watcher.factor b/extra/site-watcher/site-watcher.factor index c2ec2ada79..535c8cd626 100644 --- a/extra/site-watcher/site-watcher.factor +++ b/extra/site-watcher/site-watcher.factor @@ -38,12 +38,12 @@ SYMBOL: running-site-watcher PRIVATE> -: watch-sites ( db -- ) - [ find-sites check-sites sites-to-report send-reports ] with-db ; +: watch-sites ( -- ) + find-sites check-sites sites-to-report send-reports ; : run-site-watcher ( db -- ) [ running-site-watcher get ] dip '[ - [ _ watch-sites ] site-watcher-frequency get every + [ _ [ watch-sites ] with-db ] site-watcher-frequency get every running-site-watcher set ] unless ; diff --git a/extra/site-watcher/spider/spider.factor b/extra/site-watcher/spider/spider.factor index 1b3a96a018..335f1f11f9 100644 --- a/extra/site-watcher/spider/spider.factor +++ b/extra/site-watcher/spider/spider.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: site-watcher.db site-watcher.email +USING: site-watcher.db site-watcher.email site-watcher.spider spider spider.report accessors kernel sequences -xml.writer ; +xml.writer concurrency.combinators ; IN: site-watcher.spider : ( spidering-site -- spider ) @@ -20,3 +20,6 @@ IN: site-watcher.spider [ run-spider spider-report xml>string ] [ site>> url>> "Spidered " prefix ] tri send-site-email ; + +: spider-sites ( -- ) + f spidering-sites [ spider-and-email ] parallel-each ; \ No newline at end of file diff --git a/extra/spider/report/report.factor b/extra/spider/report/report.factor index 48620cac55..7779b233f9 100644 --- a/extra/spider/report/report.factor +++ b/extra/spider/report/report.factor @@ -39,10 +39,11 @@ SYMBOL: time-std timings get sort-values [ slowest short tail* reverse slowest-pages set ] [ - values - [ mean 1000000 /f mean-time set ] - [ median 1000000 /f median-time set ] - [ std 1000000 /f time-std set ] tri + values [ + [ mean 1000000 /f mean-time set ] + [ median 1000000 /f median-time set ] + [ std 1000000 /f time-std set ] tri + ] unless-empty ] bi ; : process-results ( results -- ) diff --git a/extra/webapps/site-watcher/common/authors.txt b/extra/webapps/site-watcher/common/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/extra/webapps/site-watcher/common/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/extra/webapps/site-watcher/common/common.factor b/extra/webapps/site-watcher/common/common.factor new file mode 100644 index 0000000000..b27cbf3f7f --- /dev/null +++ b/extra/webapps/site-watcher/common/common.factor @@ -0,0 +1,6 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: http.server.dispatchers ; +IN: webapps.site-watcher.common + +TUPLE: site-watcher-app < dispatcher ; diff --git a/extra/webapps/site-watcher/common/main.xml b/extra/webapps/site-watcher/common/main.xml new file mode 100644 index 0000000000..35a0ccb6d1 --- /dev/null +++ b/extra/webapps/site-watcher/common/main.xml @@ -0,0 +1,13 @@ + + + + +

SiteWatcher is a free service for web masters. It periodically tries fetching your web site via HTTP, and sends you an e-mail, SMS or Tweet if this fails. Sign up now!

+ +
    +
  • Your contact info
  • +
  • Watched sites
  • +
  • Spidered sites
  • +
+ +
diff --git a/extra/webapps/site-watcher/common/site-list.xml b/extra/webapps/site-watcher/common/site-list.xml new file mode 100644 index 0000000000..765381a4c4 --- /dev/null +++ b/extra/webapps/site-watcher/common/site-list.xml @@ -0,0 +1,28 @@ + + + + +

Add some sites to watch

+ + + + +
URL:
+
+ +

Keep track of your sites

+ + + + + + + + + +
URL
Remove
+

+ Check now +

+ +
diff --git a/extra/webapps/site-watcher/site-watcher.xml b/extra/webapps/site-watcher/common/site-watcher.xml similarity index 100% rename from extra/webapps/site-watcher/site-watcher.xml rename to extra/webapps/site-watcher/common/site-watcher.xml diff --git a/extra/webapps/site-watcher/common/spider-list.xml b/extra/webapps/site-watcher/common/spider-list.xml new file mode 100644 index 0000000000..89d191ab41 --- /dev/null +++ b/extra/webapps/site-watcher/common/spider-list.xml @@ -0,0 +1,28 @@ + + + + +

Add a site to spider

+ + + + +
URL:
+
+ +

Spidered sites

+ + + + + + + + + +
URL
Remove
+

+ Spider now +

+ +
diff --git a/extra/webapps/site-watcher/update-notify.xml b/extra/webapps/site-watcher/common/update-notify.xml similarity index 100% rename from extra/webapps/site-watcher/update-notify.xml rename to extra/webapps/site-watcher/common/update-notify.xml diff --git a/extra/webapps/site-watcher/main.xml b/extra/webapps/site-watcher/main.xml deleted file mode 100644 index 938ff09825..0000000000 --- a/extra/webapps/site-watcher/main.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - -

SiteWatcher is a free service for web masters. It periodically tries fetching your web site via HTTP, and sends you an e-mail, SMS or Tweet if this fails. Sign up now!

- -
diff --git a/extra/webapps/site-watcher/site-list.xml b/extra/webapps/site-watcher/site-list.xml deleted file mode 100644 index c96a25f443..0000000000 --- a/extra/webapps/site-watcher/site-list.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - -

Don't you hate it when your web site goes down, and all your users go buy that slanket from your competitor instead. Now using SiteWatcher, you can ensure this will never happen again!

- -Contact info - -

Step 2: add some sites to watch

- - - - -
URL:
-
- -

Step 3: keep track of your sites

- - - - - - - - - -
URL
Remove
-

- Check now -

- -
diff --git a/extra/webapps/site-watcher/site-watcher.factor b/extra/webapps/site-watcher/site-watcher.factor index f173edb814..7651afa4e6 100644 --- a/extra/webapps/site-watcher/site-watcher.factor +++ b/extra/webapps/site-watcher/site-watcher.factor @@ -8,65 +8,14 @@ furnace.auth.features.registration furnace.auth.login furnace.boilerplate furnace.redirection html.forms http.server http.server.dispatchers kernel namespaces site-watcher site-watcher.db site-watcher.private urls validators io.sockets.secure.unix.debug -io.servers.connection db db.tuples sequences ; +io.servers.connection db db.tuples sequences webapps.site-watcher.common +webapps.site-watcher.watching webapps.site-watcher.spidering ; QUALIFIED: assocs IN: webapps.site-watcher -TUPLE: site-watcher-app < dispatcher ; - -CONSTANT: site-list-url URL" $site-watcher-app/" - : ( -- action ) - [ - logged-in? - [ URL" $site-watcher-app/list" ] - [ { site-watcher-app "main" } ] if - ] >>display ; - -: ( -- action ) - - { site-watcher-app "site-list" } >>template - [ - ! Silly query - username watching-sites - "sites" set-value - ] >>init - - "list watched sites" >>description ; - -: ( -- action ) - - [ - { { "url" [ v-url ] } } validate-params - ] >>validate - [ - username "url" value watch-site - site-list-url - ] >>submit - - "add a watched site" >>description ; - -: ( -- action ) - - [ - { { "url" [ v-url ] } } validate-params - ] >>validate - [ - username "url" value unwatch-site - site-list-url - ] >>submit - - "remove a watched site" >>description ; - -: ( -- action ) - - [ - watch-sites - site-list-url - ] >>submit - - "check watched sites" >>description ; + { site-watcher-app "main" } >>template ; : ( -- action ) @@ -95,10 +44,14 @@ CONSTANT: site-list-url URL" $site-watcher-app/" : ( -- dispatcher ) site-watcher-app new-dispatcher "" add-responder - "list" add-responder - "add" add-responder - "remove" add-responder + "watch-list" add-responder + "add-watch" add-responder + "remove-watch" add-responder "check" add-responder + "spider-list" add-responder + "add-spider" add-responder + "remove-spider" add-responder + "spider" add-responder "update-notify" add-responder ; : ( responder -- responder' ) @@ -125,12 +78,13 @@ site-watcher-db main-responder set-global M: site-watcher-app init-user-profile - drop + drop B "username" value "email" value insert-tuple ; : init-db ( -- ) site-watcher-db [ - { site account watching-site } [ ensure-table ] each + { site account watching-site spidering-site } + [ ensure-table ] each ] with-db ; : start-site-watcher ( -- ) diff --git a/extra/webapps/site-watcher/spidering/authors.txt b/extra/webapps/site-watcher/spidering/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/extra/webapps/site-watcher/spidering/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/extra/webapps/site-watcher/spidering/spidering.factor b/extra/webapps/site-watcher/spidering/spidering.factor new file mode 100644 index 0000000000..d0116a7f2d --- /dev/null +++ b/extra/webapps/site-watcher/spidering/spidering.factor @@ -0,0 +1,52 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions furnace.auth +furnace.redirection html.forms validators webapps.site-watcher.common +site-watcher.db site-watcher.spider kernel urls sequences ; +IN: webapps.site-watcher.spidering + +CONSTANT: site-list-url URL" $site-watcher-app/spider-list" + +: ( -- action ) + + { site-watcher-app "spider-list" } >>template + [ + ! Silly query + username B spidering-sites [ site>> ] map + "sites" set-value + ] >>init + + "list spidered sites" >>description ; + +: ( -- action ) + + [ + { { "url" [ v-url ] } } validate-params + ] >>validate + [ + username "url" value add-spidered-site + site-list-url + ] >>submit + + "add a spidered site" >>description ; + +: ( -- action ) + + [ + { { "url" [ v-url ] } } validate-params + ] >>validate + [ + username "url" value remove-spidered-site + site-list-url + ] >>submit + + "remove a spidered site" >>description ; + +: ( -- action ) + + [ + spider-sites + site-list-url + ] >>submit + + "spider sites" >>description ; \ No newline at end of file diff --git a/extra/webapps/site-watcher/watching/authors.txt b/extra/webapps/site-watcher/watching/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/extra/webapps/site-watcher/watching/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file diff --git a/extra/webapps/site-watcher/watching/watching.factor b/extra/webapps/site-watcher/watching/watching.factor new file mode 100644 index 0000000000..414595a12a --- /dev/null +++ b/extra/webapps/site-watcher/watching/watching.factor @@ -0,0 +1,52 @@ +! Copyright (C) 2009 Slava Pestov. +! See http://factorcode.org/license.txt for BSD license. +USING: accessors furnace.actions furnace.auth +furnace.redirection html.forms site-watcher site-watcher.db +validators webapps.site-watcher.common urls ; +IN: webapps.site-watcher.watching + +CONSTANT: site-list-url URL" $site-watcher-app/watch-list" + +: ( -- action ) + + { site-watcher-app "site-list" } >>template + [ + ! Silly query + username watching-sites + "sites" set-value + ] >>init + + "list watched sites" >>description ; + +: ( -- action ) + + [ + { { "url" [ v-url ] } } validate-params + ] >>validate + [ + username "url" value watch-site + site-list-url + ] >>submit + + "add a watched site" >>description ; + +: ( -- action ) + + [ + { { "url" [ v-url ] } } validate-params + ] >>validate + [ + username "url" value unwatch-site + site-list-url + ] >>submit + + "remove a watched site" >>description ; + +: ( -- action ) + + [ + watch-sites + site-list-url + ] >>submit + + "check watched sites" >>description ; \ No newline at end of file From 959e659cdc67daff6b64e53bc2a94873c5b90e76 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 21:59:52 -0500 Subject: [PATCH 45/65] Makefile: clean target should delete libfactor.dylib too --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5e63017218..35a5ba58bf 100644 --- a/Makefile +++ b/Makefile @@ -166,7 +166,7 @@ factor-ffi-test: vm/ffi_test.o clean: rm -f vm/*.o - rm -f factor*.dll libfactor.{a,so,dylib} libfactor-ffi-test.{a,so,dylib} + rm -f factor*.dll libfactor.{a,so,dylib} libfactor-ffi-test.{a,so,dylib} Factor.app/Contents/Frameworks/libfactor.dylib vm/resources.o: $(WINDRES) vm/factor.rs vm/resources.o From 2e03bd5cc0d7ef52fc8ff5aa93e1bbac8c1651bd Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 22:00:08 -0500 Subject: [PATCH 46/65] db.errors.sqlite: don't give up on bad inputs --- basis/db/errors/sqlite/sqlite.factor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/basis/db/errors/sqlite/sqlite.factor b/basis/db/errors/sqlite/sqlite.factor index c247a36257..c73409b850 100644 --- a/basis/db/errors/sqlite/sqlite.factor +++ b/basis/db/errors/sqlite/sqlite.factor @@ -4,7 +4,8 @@ USING: accessors combinators db kernel sequences peg.ebnf strings db.errors ; IN: db.errors.sqlite -ERROR: unparsed-sqlite-error error ; +TUPLE: unparsed-sqlite-error error ; +C: unparsed-sqlite-error SINGLETONS: table-exists table-missing ; @@ -22,4 +23,6 @@ SqliteError = => [[ table >string message sqlite-table-error ]] | "no such table: " .+:table => [[ table >string ]] + | .*:error + => [[ error >string ]] ;EBNF From 6f53db568fcf0b25d40e97c0d332eea927084e5a Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 22:00:18 -0500 Subject: [PATCH 47/65] furnace.redirection: load urls.secure --- basis/furnace/redirection/redirection.factor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis/furnace/redirection/redirection.factor b/basis/furnace/redirection/redirection.factor index 01297288dc..ff81d73f7f 100644 --- a/basis/furnace/redirection/redirection.factor +++ b/basis/furnace/redirection/redirection.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel accessors combinators namespaces fry urls http -http.server http.server.redirection http.server.responses +USING: kernel accessors combinators namespaces fry urls urls.secure +http http.server http.server.redirection http.server.responses http.server.remapping http.server.filters furnace.utilities ; IN: furnace.redirection From cb675cfe477c456d5bac689dd0f0c43204f69629 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 22:05:17 -0500 Subject: [PATCH 48/65] furnace.actions: load chloe tags --- basis/furnace/actions/actions.factor | 1 + basis/furnace/furnace.factor | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/furnace/actions/actions.factor b/basis/furnace/actions/actions.factor index a582755dc4..c7893117d1 100644 --- a/basis/furnace/actions/actions.factor +++ b/basis/furnace/actions/actions.factor @@ -9,6 +9,7 @@ http.server.responses furnace.utilities furnace.redirection furnace.conversations +furnace.chloe-tags html.forms html.components html.components diff --git a/basis/furnace/furnace.factor b/basis/furnace/furnace.factor index adafb21524..37b2f40e82 100644 --- a/basis/furnace/furnace.factor +++ b/basis/furnace/furnace.factor @@ -17,7 +17,6 @@ USE: vocabs.loader "furnace.auth.providers.db" require "furnace.auth.providers.null" require "furnace.boilerplate" require -"furnace.chloe-tags" require "furnace.conversations" require "furnace.db" require "furnace.json" require From 1032e57e8e79781d97de4634f7a7bad0b3574fda Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Mon, 6 Apr 2009 23:32:21 -0500 Subject: [PATCH 49/65] Fix bootstrap --- basis/delegate/protocols/protocols.factor | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/basis/delegate/protocols/protocols.factor b/basis/delegate/protocols/protocols.factor index f568a3e388..40054bc4b0 100644 --- a/basis/delegate/protocols/protocols.factor +++ b/basis/delegate/protocols/protocols.factor @@ -1,7 +1,6 @@ ! Copyright (C) 2007 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. -USING: delegate sequences.private sequences assocs -io definitions kernel continuations ; +USING: delegate sequences.private sequences assocs io ; IN: delegate.protocols PROTOCOL: sequence-protocol @@ -19,7 +18,3 @@ stream-read-until ; PROTOCOL: output-stream-protocol stream-flush stream-write1 stream-write stream-nl ; - -PROTOCOL: definition-protocol -where set-where forget uses -synopsis* definer definition ; From 5b5acf165cf65c1e7964472c51abff01aa0bc611 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 03:04:25 -0500 Subject: [PATCH 50/65] Fix site-watcher tests --- extra/site-watcher/site-watcher-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/site-watcher/site-watcher-tests.factor b/extra/site-watcher/site-watcher-tests.factor index b067504e2e..e58d5a79d5 100644 --- a/extra/site-watcher/site-watcher-tests.factor +++ b/extra/site-watcher/site-watcher-tests.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: db.tuples locals site-watcher site-watcher.db site-watcher.private kernel db io.directories io.files.temp -continuations site-watcher.db.private db.sqlite +continuations db.sqlite sequences tools.test ; IN: site-watcher.tests From 2c1f7b9293ade5d1c16ebe8b3534238bfe026f43 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 03:37:29 -0500 Subject: [PATCH 51/65] Static responder now works when the root is a file rather than a directory --- basis/http/http-tests.factor | 23 ++++++++++++++++++----- basis/http/server/static/static.factor | 4 ++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/basis/http/http-tests.factor b/basis/http/http-tests.factor index bc906fad44..52763c4f18 100644 --- a/basis/http/http-tests.factor +++ b/basis/http/http-tests.factor @@ -1,8 +1,8 @@ -USING: http http.server http.client http.client.private tools.test multiline -io.streams.string io.encodings.utf8 io.encodings.8-bit -io.encodings.binary io.encodings.string kernel arrays splitting -sequences assocs io.sockets db db.sqlite continuations urls -hashtables accessors namespaces xml.data ; +USING: http http.server http.client http.client.private tools.test +multiline io.streams.string io.encodings.utf8 io.encodings.8-bit +io.encodings.binary io.encodings.string io.encodings.ascii kernel +arrays splitting sequences assocs io.sockets db db.sqlite +continuations urls hashtables accessors namespaces xml.data ; IN: http.tests [ "text/plain" latin1 ] [ "text/plain" parse-content-type ] unit-test @@ -359,4 +359,17 @@ SYMBOL: a ! Test basic auth [ "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" ] [ "Aladdin" "open sesame" set-basic-auth "Authorization" header ] unit-test +! Test a corner case with static responder +[ ] [ + + add-quit-action + "vocab:http/test/foo.html" >>default + test-httpd +] unit-test +[ t ] [ + "http://localhost/" add-port http-get nip + "vocab:http/test/foo.html" ascii file-contents = +] unit-test + +[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test \ No newline at end of file diff --git a/basis/http/server/static/static.factor b/basis/http/server/static/static.factor index bbca70d845..f80a3cc7cd 100644 --- a/basis/http/server/static/static.factor +++ b/basis/http/server/static/static.factor @@ -47,8 +47,8 @@ TUPLE: file-responder root hook special allow-listings ; if ; : serving-path ( filename -- filename ) - [ file-responder get root>> trim-tail-separators "/" ] dip - "" or trim-head-separators 3append ; + [ file-responder get root>> trim-tail-separators ] dip + [ "/" swap trim-head-separators 3append ] unless-empty ; : serve-file ( filename -- response ) dup mime-type From e12f0f22807b7ee7df0575b41655834d5574be05 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 04:11:56 -0500 Subject: [PATCH 52/65] Treat a limit of f as unlimited instead of throwing an error --- basis/io/streams/limited/limited-tests.factor | 6 ++++++ basis/io/streams/limited/limited.factor | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/basis/io/streams/limited/limited-tests.factor b/basis/io/streams/limited/limited-tests.factor index 36c257fb5e..86d652d17c 100644 --- a/basis/io/streams/limited/limited-tests.factor +++ b/basis/io/streams/limited/limited-tests.factor @@ -76,3 +76,9 @@ IN: io.streams.limited.tests [ decoder? ] both? ] with-destructors ] unit-test + +[ "HELL" ] [ + "HELLO" + [ f stream-throws limit-input 4 read ] + with-string-reader +] unit-test \ No newline at end of file diff --git a/basis/io/streams/limited/limited.factor b/basis/io/streams/limited/limited.factor index fe3dd9ad93..b1b07a08c0 100755 --- a/basis/io/streams/limited/limited.factor +++ b/basis/io/streams/limited/limited.factor @@ -22,7 +22,7 @@ M: decoder limit ( stream limit mode -- stream' ) [ clone ] 2dip '[ _ _ limit ] change-stream ; M: object limit ( stream limit mode -- stream' ) - ; + over [ ] [ 2drop ] if ; GENERIC: unlimited ( stream -- stream' ) @@ -32,9 +32,11 @@ M: decoder unlimited ( stream -- stream' ) M: object unlimited ( stream -- stream' ) stream>> stream>> ; -: limit-input ( limit mode -- ) input-stream [ -rot limit ] change ; +: limit-input ( limit mode -- ) + [ input-stream ] 2dip '[ _ _ limit ] change ; -: unlimited-input ( -- ) input-stream [ unlimited ] change ; +: unlimited-input ( -- ) + input-stream [ unlimited ] change ; : with-unlimited-stream ( stream quot -- ) [ clone unlimited ] dip call ; inline From 63cf5b04e13570737f8e92e8b5a732bedd41831e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 04:19:21 -0500 Subject: [PATCH 53/65] http.client: fix 307 redirect behavior (reported by Chris Double) --- basis/http/client/client.factor | 9 +++++---- basis/http/http-tests.factor | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/basis/http/client/client.factor b/basis/http/client/client.factor index 4099e3d84c..805929d27b 100644 --- a/basis/http/client/client.factor +++ b/basis/http/client/client.factor @@ -6,7 +6,7 @@ math.order hashtables byte-arrays destructors io io.sockets io.streams.string io.files io.timeouts io.pathnames io.encodings io.encodings.string io.encodings.ascii io.encodings.utf8 io.encodings.8-bit io.encodings.binary io.crlf -io.streams.duplex fry ascii urls urls.encoding present +io.streams.duplex fry ascii urls urls.encoding present locals http http.parsers http.client.post-data ; IN: http.client @@ -77,12 +77,13 @@ SYMBOL: redirects : redirect? ( response -- ? ) code>> 300 399 between? ; -: do-redirect ( quot: ( chunk -- ) response -- response ) +:: do-redirect ( quot: ( chunk -- ) response -- response ) redirects inc redirects get max-redirects < [ request get clone - swap "location" header redirect-url - "GET" >>method swap (with-http-request) + response "location" header redirect-url + response code>> 307 = [ "GET" >>method ] unless + quot (with-http-request) ] [ too-many-redirects ] if ; inline recursive : read-chunk-size ( -- n ) diff --git a/basis/http/http-tests.factor b/basis/http/http-tests.factor index 52763c4f18..da50a6f85f 100644 --- a/basis/http/http-tests.factor +++ b/basis/http/http-tests.factor @@ -372,4 +372,24 @@ SYMBOL: a "vocab:http/test/foo.html" ascii file-contents = ] unit-test +[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test + +! Check behavior of 307 redirect (reported by Chris Double) +[ ] [ + + add-quit-action + + [ "b" ] >>submit + "a" add-responder + + [ + request get post-data>> data>> "data" = + [ "OK" "text/plain" ] [ "OOPS" throw ] if + ] >>submit + "b" add-responder + test-httpd +] unit-test + +[ "OK" ] [ "data" "http://localhost/a" add-port http-post nip ] unit-test + [ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test \ No newline at end of file From 65802b6aaa7e9a1e251e0f363958bbe410af2c73 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Tue, 7 Apr 2009 10:08:01 -0500 Subject: [PATCH 54/65] fix unit test in robots --- extra/robots/robots-tests.factor | 645 ++++++++++++++++--------------- extra/robots/robots.factor | 2 +- 2 files changed, 324 insertions(+), 323 deletions(-) diff --git a/extra/robots/robots-tests.factor b/extra/robots/robots-tests.factor index a590d9eee0..54b4892680 100644 --- a/extra/robots/robots-tests.factor +++ b/extra/robots/robots-tests.factor @@ -1,334 +1,335 @@ ! Copyright (C) 2009 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: calendar io.encodings.utf8 io.files robots tools.test ; +USING: calendar io.encodings.utf8 io.files robots tools.test +urls ; IN: robots.tests [ -{ "http://www.chiplist.com/sitemap.txt" } -{ - T{ rules - { user-agents V{ "*" } } - { allows V{ } } - { disallows - V{ - "/cgi-bin/" - "/scripts/" - "/ChipList2/scripts/" - "/ChipList2/styles/" - "/ads/" - "/ChipList2/ads/" - "/advertisements/" - "/ChipList2/advertisements/" - "/graphics/" - "/ChipList2/graphics/" + { "http://www.chiplist.com/sitemap.txt" } + { + T{ rules + { user-agents V{ "*" } } + { allows V{ } } + { disallows + V{ + URL" /cgi-bin/" + URL" /scripts/" + URL" /ChipList2/scripts/" + URL" /ChipList2/styles/" + URL" /ads/" + URL" /ChipList2/ads/" + URL" /advertisements/" + URL" /ChipList2/advertisements/" + URL" /graphics/" + URL" /ChipList2/graphics/" + } } - } - { visit-time - { - T{ timestamp { hour 2 } } - T{ timestamp { hour 5 } } + { visit-time + { + T{ timestamp { hour 2 } } + T{ timestamp { hour 5 } } + } } + { request-rate 1 } + { crawl-delay 1 } + { unknowns H{ } } } - { request-rate 1 } - { crawl-delay 1 } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "UbiCrawler" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "DOC" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Zao" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "sitecheck.internetseer.com" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Zealbot" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "MSIECrawler" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "SiteSnagger" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "WebStripper" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "WebCopier" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Fetch" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Offline Explorer" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Teleport" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "TeleportPro" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "WebZIP" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "linko" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "HTTrack" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Microsoft.URL.Control" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Xenu" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "larbin" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "libwww" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "ZyBORG" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "Download Ninja" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "wget" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "grub-client" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "k2spider" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "NPBot" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents V{ "WebReaper" } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } - } - T{ rules - { user-agents - V{ - "abot" - "ALeadSoftbot" - "BeijingCrawler" - "BilgiBot" - "bot" - "botlist" - "BOTW Spider" - "bumblebee" - "Bumblebee" - "BuzzRankingBot" - "Charlotte" - "Clushbot" - "Crawler" - "CydralSpider" - "DataFountains" - "DiamondBot" - "Dulance bot" - "DYNAMIC" - "EARTHCOM.info" - "EDI" - "envolk" - "Exabot" - "Exabot-Images" - "Exabot-Test" - "exactseek-pagereaper" - "Exalead NG" - "FANGCrawl" - "Feed::Find" - "flatlandbot" - "Gigabot" - "GigabotSiteSearch" - "GurujiBot" - "Hatena Antenna" - "Hatena Bookmark" - "Hatena RSS" - "HatenaScreenshot" - "Helix" - "HiddenMarket" - "HyperEstraier" - "iaskspider" - "IIITBOT" - "InfociousBot" - "iVia" - "iVia Page Fetcher" - "Jetbot" - "Kolinka Forum Search" - "KRetrieve" - "LetsCrawl.com" - "Lincoln State Web Browser" - "Links4US-Crawler" - "LOOQ" - "Lsearch/sondeur" - "MapoftheInternet.com" - "NationalDirectory" - "NetCarta_WebMapper" - "NewsGator" - "NextGenSearchBot" - "ng" - "nicebot" - "NP" - "NPBot" - "Nudelsalat" - "Nutch" - "OmniExplorer_Bot" - "OpenIntelligenceData" - "Oracle Enterprise Search" - "Pajaczek" - "panscient.com" - "PeerFactor 404 crawler" - "PeerFactor Crawler" - "PlantyNet" - "PlantyNet_WebRobot" - "plinki" - "PMAFind" - "Pogodak!" - "QuickFinder Crawler" - "Radiation Retriever" - "Reaper" - "RedCarpet" - "ScorpionBot" - "Scrubby" - "Scumbot" - "searchbot" - "Seeker.lookseek.com" - "SeznamBot" - "ShowXML" - "snap.com" - "snap.com beta crawler" - "Snapbot" - "SnapPreviewBot" - "sohu" - "SpankBot" - "Speedy Spider" - "Speedy_Spider" - "SpeedySpider" - "spider" - "SquigglebotBot" - "SurveyBot" - "SynapticSearch" - "T-H-U-N-D-E-R-S-T-O-N-E" - "Talkro Web-Shot" - "Tarantula" - "TerrawizBot" - "TheInformant" - "TMCrawler" - "TridentSpider" - "Tutorial Crawler" - "Twiceler" - "unwrapbot" - "URI::Fetch" - "VengaBot" - "Vonna.com b o t" - "Vortex" - "Votay bot" - "WebAlta Crawler" - "Webbot" - "Webclipping.com" - "WebCorp" - "Webinator" - "WIRE" - "WISEbot" - "Xerka WebBot" - "XSpider" - "YodaoBot" - "Yoono" - "yoono" + T{ rules + { user-agents V{ "UbiCrawler" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "DOC" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Zao" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "sitecheck.internetseer.com" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Zealbot" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "MSIECrawler" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "SiteSnagger" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "WebStripper" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "WebCopier" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Fetch" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Offline Explorer" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Teleport" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "TeleportPro" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "WebZIP" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "linko" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "HTTrack" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Microsoft.URL.Control" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Xenu" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "larbin" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "libwww" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "ZyBORG" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "Download Ninja" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "wget" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "grub-client" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "k2spider" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "NPBot" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents V{ "WebReaper" } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } + } + T{ rules + { user-agents + V{ + "abot" + "ALeadSoftbot" + "BeijingCrawler" + "BilgiBot" + "bot" + "botlist" + "BOTW Spider" + "bumblebee" + "Bumblebee" + "BuzzRankingBot" + "Charlotte" + "Clushbot" + "Crawler" + "CydralSpider" + "DataFountains" + "DiamondBot" + "Dulance bot" + "DYNAMIC" + "EARTHCOM.info" + "EDI" + "envolk" + "Exabot" + "Exabot-Images" + "Exabot-Test" + "exactseek-pagereaper" + "Exalead NG" + "FANGCrawl" + "Feed::Find" + "flatlandbot" + "Gigabot" + "GigabotSiteSearch" + "GurujiBot" + "Hatena Antenna" + "Hatena Bookmark" + "Hatena RSS" + "HatenaScreenshot" + "Helix" + "HiddenMarket" + "HyperEstraier" + "iaskspider" + "IIITBOT" + "InfociousBot" + "iVia" + "iVia Page Fetcher" + "Jetbot" + "Kolinka Forum Search" + "KRetrieve" + "LetsCrawl.com" + "Lincoln State Web Browser" + "Links4US-Crawler" + "LOOQ" + "Lsearch/sondeur" + "MapoftheInternet.com" + "NationalDirectory" + "NetCarta_WebMapper" + "NewsGator" + "NextGenSearchBot" + "ng" + "nicebot" + "NP" + "NPBot" + "Nudelsalat" + "Nutch" + "OmniExplorer_Bot" + "OpenIntelligenceData" + "Oracle Enterprise Search" + "Pajaczek" + "panscient.com" + "PeerFactor 404 crawler" + "PeerFactor Crawler" + "PlantyNet" + "PlantyNet_WebRobot" + "plinki" + "PMAFind" + "Pogodak!" + "QuickFinder Crawler" + "Radiation Retriever" + "Reaper" + "RedCarpet" + "ScorpionBot" + "Scrubby" + "Scumbot" + "searchbot" + "Seeker.lookseek.com" + "SeznamBot" + "ShowXML" + "snap.com" + "snap.com beta crawler" + "Snapbot" + "SnapPreviewBot" + "sohu" + "SpankBot" + "Speedy Spider" + "Speedy_Spider" + "SpeedySpider" + "spider" + "SquigglebotBot" + "SurveyBot" + "SynapticSearch" + "T-H-U-N-D-E-R-S-T-O-N-E" + "Talkro Web-Shot" + "Tarantula" + "TerrawizBot" + "TheInformant" + "TMCrawler" + "TridentSpider" + "Tutorial Crawler" + "Twiceler" + "unwrapbot" + "URI::Fetch" + "VengaBot" + "Vonna.com b o t" + "Vortex" + "Votay bot" + "WebAlta Crawler" + "Webbot" + "Webclipping.com" + "WebCorp" + "Webinator" + "WIRE" + "WISEbot" + "Xerka WebBot" + "XSpider" + "YodaoBot" + "Yoono" + "yoono" + } } + { allows V{ } } + { disallows V{ URL" /" } } + { unknowns H{ } } } - { allows V{ } } - { disallows V{ "/" } } - { unknowns H{ } } } -} ] [ "vocab:robots/robots.txt" utf8 file-contents parse-robots.txt ] unit-test diff --git a/extra/robots/robots.factor b/extra/robots/robots.factor index 242aa1dea2..3c0eb045f7 100644 --- a/extra/robots/robots.factor +++ b/extra/robots/robots.factor @@ -85,7 +85,7 @@ PRIVATE> : parse-robots.txt ( string -- sitemaps rules-seq ) normalize-robots.txt [ [ dup ] dip [ parse-robots.txt-line drop ] with each - ] map first ; + ] map ; : robots ( url -- robots ) >url From 7a9c0ce069a8d6a53fe81d52907cc838679e2550 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Tue, 7 Apr 2009 16:55:00 -0400 Subject: [PATCH 55/65] Solution to Project Euler problem 58 --- extra/project-euler/058/058-tests.factor | 3 ++ extra/project-euler/058/058.factor | 68 ++++++++++++++++++++++++ extra/project-euler/project-euler.factor | 15 +++--- 3 files changed, 79 insertions(+), 7 deletions(-) create mode 100644 extra/project-euler/058/058-tests.factor create mode 100644 extra/project-euler/058/058.factor diff --git a/extra/project-euler/058/058-tests.factor b/extra/project-euler/058/058-tests.factor new file mode 100644 index 0000000000..13a2aafa94 --- /dev/null +++ b/extra/project-euler/058/058-tests.factor @@ -0,0 +1,3 @@ +USING: project-euler.058 tools.test ; + +{ 26241 } [ euler058 ] unit-test diff --git a/extra/project-euler/058/058.factor b/extra/project-euler/058/058.factor new file mode 100644 index 0000000000..133175f2a8 --- /dev/null +++ b/extra/project-euler/058/058.factor @@ -0,0 +1,68 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +USING: fry kernel math math.primes math.ranges project-euler.common sequences ; +IN: project-euler.058 + +! http://projecteuler.net/index.php?section=problems&id=58 + +! DESCRIPTION +! ----------- + +! Starting with 1 and solveling anticlockwise in the following way, a square +! solve with side length 7 is formed. + +! 37 36 35 34 33 32 31 +! 38 17 16 15 14 13 30 +! 39 18 5 4 3 12 29 +! 40 19 6 1 2 11 28 +! 41 20 7 8 9 10 27 +! 42 21 22 23 24 25 26 +! 43 44 45 46 47 48 49 + +! It is interesting to note that the odd squares lie along the bottom right +! diagonal, but what is more interesting is that 8 out of the 13 numbers lying +! along both diagonals are prime; that is, a ratio of 8/13 ≈ 62%. + +! If one complete new layer is wrapped around the solve above, a square solve +! with side length 9 will be formed. If this process is continued, what is the +! side length of the square solve for which the ratio of primes along both +! diagonals first falls below 10%? + + +! SOLUTION +! -------- + + + +: euler058 ( -- answer ) + 8 7 solve ; + +! [ euler058 ] 10 ave-time +! 12974 ms ave run time - 284.46 SD (10 trials) + +SOLUTION: euler058 diff --git a/extra/project-euler/project-euler.factor b/extra/project-euler/project-euler.factor index 62f6a56c65..d60ae60126 100644 --- a/extra/project-euler/project-euler.factor +++ b/extra/project-euler/project-euler.factor @@ -15,13 +15,14 @@ USING: definitions io io.files io.pathnames kernel math math.parser project-euler.041 project-euler.042 project-euler.043 project-euler.044 project-euler.045 project-euler.046 project-euler.047 project-euler.048 project-euler.049 project-euler.052 project-euler.053 project-euler.054 - project-euler.055 project-euler.056 project-euler.057 project-euler.059 - project-euler.067 project-euler.071 project-euler.073 project-euler.075 - project-euler.076 project-euler.079 project-euler.092 project-euler.097 - project-euler.099 project-euler.100 project-euler.116 project-euler.117 - project-euler.134 project-euler.148 project-euler.150 project-euler.151 - project-euler.164 project-euler.169 project-euler.173 project-euler.175 - project-euler.186 project-euler.190 project-euler.203 project-euler.215 ; + project-euler.055 project-euler.056 project-euler.057 project-euler.058 + project-euler.059 project-euler.067 project-euler.071 project-euler.073 + project-euler.075 project-euler.076 project-euler.079 project-euler.092 + project-euler.097 project-euler.099 project-euler.100 project-euler.116 + project-euler.117 project-euler.134 project-euler.148 project-euler.150 + project-euler.151 project-euler.164 project-euler.169 project-euler.173 + project-euler.175 project-euler.186 project-euler.190 project-euler.203 + project-euler.215 ; IN: project-euler Date: Tue, 7 Apr 2009 18:34:20 -0400 Subject: [PATCH 56/65] Add documentation for poker vocab --- extra/poker/poker-docs.factor | 30 ++++++++++++++++++++++++++++++ extra/poker/poker.factor | 32 ++++++++++++++++---------------- 2 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 extra/poker/poker-docs.factor diff --git a/extra/poker/poker-docs.factor b/extra/poker/poker-docs.factor new file mode 100644 index 0000000000..09019a29d7 --- /dev/null +++ b/extra/poker/poker-docs.factor @@ -0,0 +1,30 @@ +USING: help.markup help.syntax strings ; +IN: poker + +HELP: +{ $values { "str" string } { "hand" "a new hand" } } +{ $description "Creates a new poker hand containing the cards specified in " { $snippet "str" } "." } +{ $examples + { $example "USING: kernel math.order poker prettyprint ;" + "\"AC KC QC JC TC\" \"7C 6D 5H 4S 2C\" [ ] bi@ <=> ." "+lt+" } + { $example "USING: kernel poker prettyprint ;" + "\"TC 9C 8C 7C 6C\" \"TH 9H 8H 7H 6H\" [ ] bi@ = ." "t" } +} +{ $notes "Cards may be specified in any order. Hands are directly comparable to each other on the basis of their computed value. Two hands are considered equal when they would tie in a game (despite being composed of different cards)." } ; + +HELP: >cards +{ $values { "hand" "a hand" } { "str" string } } +{ $description "Outputs a string representation of a hand's cards." } +{ $examples + { $example "USING: poker prettyprint ;" + "\"AC KC QC JC TC\" >cards ." "\"AC KC QC JC TC\"" } +} ; + +HELP: >value +{ $values { "hand" "a hand" } { "str" string } } +{ $description "Outputs a string representation of a hand's value." } +{ $examples + { $example "USING: poker prettyprint ;" + "\"AC KC QC JC TC\" >value ." "\"Straight Flush\"" } +} +{ $notes "This should not be used as a basis for hand comparison." } ; diff --git a/extra/poker/poker.factor b/extra/poker/poker.factor index ca999dbf6e..2a7fe73762 100644 --- a/extra/poker/poker.factor +++ b/extra/poker/poker.factor @@ -155,6 +155,19 @@ CONSTANT: VALUE_STR { "" "Straight Flush" "Four of a Kind" "Full House" "Flush" [ drop "S" ] } cond ; +: hand-rank ( hand -- rank ) + value>> { + { [ dup 6185 > ] [ drop HIGH_CARD ] } ! 1277 high card + { [ dup 3325 > ] [ drop ONE_PAIR ] } ! 2860 one pair + { [ dup 2467 > ] [ drop TWO_PAIR ] } ! 858 two pair + { [ dup 1609 > ] [ drop THREE_OF_A_KIND ] } ! 858 three-kind + { [ dup 1599 > ] [ drop STRAIGHT ] } ! 10 straights + { [ dup 322 > ] [ drop FLUSH ] } ! 1277 flushes + { [ dup 166 > ] [ drop FULL_HOUSE ] } ! 156 full house + { [ dup 10 > ] [ drop FOUR_OF_A_KIND ] } ! 156 four-kind + [ drop STRAIGHT_FLUSH ] ! 10 straight-flushes + } cond ; + PRIVATE> TUPLE: hand @@ -169,23 +182,10 @@ M: hand equal? " " split [ >ckf ] map dup hand-value hand boa ; -: hand-rank ( hand -- rank ) - value>> { - { [ dup 6185 > ] [ drop HIGH_CARD ] } ! 1277 high card - { [ dup 3325 > ] [ drop ONE_PAIR ] } ! 2860 one pair - { [ dup 2467 > ] [ drop TWO_PAIR ] } ! 858 two pair - { [ dup 1609 > ] [ drop THREE_OF_A_KIND ] } ! 858 three-kind - { [ dup 1599 > ] [ drop STRAIGHT ] } ! 10 straights - { [ dup 322 > ] [ drop FLUSH ] } ! 1277 flushes - { [ dup 166 > ] [ drop FULL_HOUSE ] } ! 156 full house - { [ dup 10 > ] [ drop FOUR_OF_A_KIND ] } ! 156 four-kind - [ drop STRAIGHT_FLUSH ] ! 10 straight-flushes - } cond ; - -: >value ( hand -- str ) - hand-rank VALUE_STR nth ; - : >cards ( hand -- str ) cards>> [ [ >card-rank ] [ >card-suit ] bi append ] map " " join ; + +: >value ( hand -- str ) + hand-rank VALUE_STR nth ; From 41e3e0acb4ab113be54fef6ec46593064cc99a22 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 18:49:54 -0500 Subject: [PATCH 57/65] Fix alien.fortran for NetBSD x86.64 --- basis/alien/fortran/fortran.factor | 7 ++++++- basis/math/blas/config/config.factor | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/basis/alien/fortran/fortran.factor b/basis/alien/fortran/fortran.factor index 71efa1aa24..c617efc26c 100644 --- a/basis/alien/fortran/fortran.factor +++ b/basis/alien/fortran/fortran.factor @@ -8,7 +8,7 @@ io.encodings.ascii io.encodings.string shuffle effects math.ranges math.order sorting strings system alien.libraries ; IN: alien.fortran -SINGLETONS: f2c-abi gfortran-abi intel-unix-abi intel-windows-abi ; +SINGLETONS: f2c-abi g95-abi gfortran-abi intel-unix-abi intel-windows-abi ; << : add-f2c-libraries ( -- ) @@ -42,30 +42,35 @@ library-fortran-abis [ H{ } clone ] initialize HOOK: fortran-c-abi fortran-abi ( -- abi ) M: f2c-abi fortran-c-abi "cdecl" ; +M: g95-abi fortran-c-abi "cdecl" ; M: gfortran-abi fortran-c-abi "cdecl" ; M: intel-unix-abi fortran-c-abi "cdecl" ; M: intel-windows-abi fortran-c-abi "cdecl" ; HOOK: real-functions-return-double? fortran-abi ( -- ? ) M: f2c-abi real-functions-return-double? t ; +M: g95-abi real-functions-return-double? f ; M: gfortran-abi real-functions-return-double? f ; M: intel-unix-abi real-functions-return-double? f ; M: intel-windows-abi real-functions-return-double? f ; HOOK: complex-functions-return-by-value? fortran-abi ( -- ? ) M: f2c-abi complex-functions-return-by-value? f ; +M: g95-abi complex-functions-return-by-value? f ; M: gfortran-abi complex-functions-return-by-value? t ; M: intel-unix-abi complex-functions-return-by-value? f ; M: intel-windows-abi complex-functions-return-by-value? f ; HOOK: character(1)-maps-to-char? fortran-abi ( -- ? ) M: f2c-abi character(1)-maps-to-char? f ; +M: g95-abi character(1)-maps-to-char? f ; M: gfortran-abi character(1)-maps-to-char? f ; M: intel-unix-abi character(1)-maps-to-char? t ; M: intel-windows-abi character(1)-maps-to-char? t ; HOOK: mangle-name fortran-abi ( name -- name' ) M: f2c-abi mangle-name lowercase-name-with-extra-underscore ; +M: f95-abi mangle-name lowercase-name-with-extra-underscore ; M: gfortran-abi mangle-name lowercase-name-with-underscore ; M: intel-unix-abi mangle-name lowercase-name-with-underscore ; M: intel-windows-abi mangle-name >upper ; diff --git a/basis/math/blas/config/config.factor b/basis/math/blas/config/config.factor index 8ed515625d..327c546963 100644 --- a/basis/math/blas/config/config.factor +++ b/basis/math/blas/config/config.factor @@ -15,6 +15,7 @@ blas-fortran-abi [ { { [ os macosx? ] [ intel-unix-abi ] } { [ os windows? cpu x86.32? and ] [ f2c-abi ] } + { [ os netbsd? cpu x86.64? and ] [ g95-abi ] } { [ os windows? cpu x86.64? and ] [ gfortran-abi ] } { [ os freebsd? ] [ gfortran-abi ] } { [ os linux? cpu x86.32? and ] [ gfortran-abi ] } From 409b3317161159fe34e0a8e2f612d881bcd1e599 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 20:06:28 -0500 Subject: [PATCH 58/65] Fix typo --- basis/alien/fortran/fortran.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basis/alien/fortran/fortran.factor b/basis/alien/fortran/fortran.factor index c617efc26c..b27c62b9a1 100644 --- a/basis/alien/fortran/fortran.factor +++ b/basis/alien/fortran/fortran.factor @@ -70,7 +70,7 @@ M: intel-windows-abi character(1)-maps-to-char? t ; HOOK: mangle-name fortran-abi ( name -- name' ) M: f2c-abi mangle-name lowercase-name-with-extra-underscore ; -M: f95-abi mangle-name lowercase-name-with-extra-underscore ; +M: g95-abi mangle-name lowercase-name-with-extra-underscore ; M: gfortran-abi mangle-name lowercase-name-with-underscore ; M: intel-unix-abi mangle-name lowercase-name-with-underscore ; M: intel-windows-abi mangle-name >upper ; From e78476a51eeb95edad2ceeaadd62b07a4a872cc9 Mon Sep 17 00:00:00 2001 From: Aaron Schaefer Date: Tue, 7 Apr 2009 21:36:38 -0400 Subject: [PATCH 59/65] Solution to Project Euler problem 63 --- extra/project-euler/063/063-tests.factor | 3 ++ extra/project-euler/063/063.factor | 37 ++++++++++++++++++++++++ extra/project-euler/project-euler.factor | 14 ++++----- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 extra/project-euler/063/063-tests.factor create mode 100644 extra/project-euler/063/063.factor diff --git a/extra/project-euler/063/063-tests.factor b/extra/project-euler/063/063-tests.factor new file mode 100644 index 0000000000..0cff44db5e --- /dev/null +++ b/extra/project-euler/063/063-tests.factor @@ -0,0 +1,3 @@ +USING: project-euler.063 tools.test ; + +{ 49 } [ euler063 ] unit-test diff --git a/extra/project-euler/063/063.factor b/extra/project-euler/063/063.factor new file mode 100644 index 0000000000..80e3990a24 --- /dev/null +++ b/extra/project-euler/063/063.factor @@ -0,0 +1,37 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel math math.functions math.ranges project-euler.common sequences ; +IN: project-euler.063 + +! http://projecteuler.net/index.php?section=problems&id=63 + +! DESCRIPTION +! ----------- + +! The 5-digit number, 16807 = 7^5, is also a fifth power. Similarly, the +! 9-digit number, 134217728 = 8^9, is a ninth power. + +! How many n-digit positive integers exist which are also an nth power? + + +! SOLUTION +! -------- + +! Only have to check from 1 to 9 because 10^n already has too many digits. +! In general, x^n has n digits when: + +! 10^(n-1) <= x^n < 10^n + +! ...take the left side of that equation, solve for n to see where they meet: + +! n = log(10) / [ log(10) - log(x) ] + +! Round down since we already know that particular value of n is no good. + +: euler063 ( -- answer ) + 9 [1,b] [ log [ 10 log dup ] dip - /i ] sigma ; + +! [ euler063 ] 100 ave-time +! 0 ms ave run time - 0.0 SD (100 trials) + +SOLUTION: euler063 diff --git a/extra/project-euler/project-euler.factor b/extra/project-euler/project-euler.factor index d60ae60126..5d46d7f1fd 100644 --- a/extra/project-euler/project-euler.factor +++ b/extra/project-euler/project-euler.factor @@ -16,13 +16,13 @@ USING: definitions io io.files io.pathnames kernel math math.parser project-euler.045 project-euler.046 project-euler.047 project-euler.048 project-euler.049 project-euler.052 project-euler.053 project-euler.054 project-euler.055 project-euler.056 project-euler.057 project-euler.058 - project-euler.059 project-euler.067 project-euler.071 project-euler.073 - project-euler.075 project-euler.076 project-euler.079 project-euler.092 - project-euler.097 project-euler.099 project-euler.100 project-euler.116 - project-euler.117 project-euler.134 project-euler.148 project-euler.150 - project-euler.151 project-euler.164 project-euler.169 project-euler.173 - project-euler.175 project-euler.186 project-euler.190 project-euler.203 - project-euler.215 ; + project-euler.059 project-euler.063 project-euler.067 project-euler.071 + project-euler.073 project-euler.075 project-euler.076 project-euler.079 + project-euler.092 project-euler.097 project-euler.099 project-euler.100 + project-euler.116 project-euler.117 project-euler.134 project-euler.148 + project-euler.150 project-euler.151 project-euler.164 project-euler.169 + project-euler.173 project-euler.175 project-euler.186 project-euler.190 + project-euler.203 project-euler.215 ; IN: project-euler Date: Tue, 7 Apr 2009 21:32:45 -0500 Subject: [PATCH 60/65] opengl.textures: use GL_ARB_texture_non_power_of_two if available --- basis/opengl/textures/textures.factor | 13 ++++++++++--- basis/ui/backend/backend.factor | 8 ++++---- basis/ui/gadgets/worlds/worlds.factor | 12 +++++++++--- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/basis/opengl/textures/textures.factor b/basis/opengl/textures/textures.factor index bb232affa4..e13e99e10f 100755 --- a/basis/opengl/textures/textures.factor +++ b/basis/opengl/textures/textures.factor @@ -3,9 +3,11 @@ USING: accessors assocs cache colors.constants destructors fry kernel opengl opengl.gl combinators images images.tesselation grouping specialized-arrays.float sequences math math.vectors -math.matrices generalizations fry arrays ; +math.matrices generalizations fry arrays namespaces ; IN: opengl.textures +SYMBOL: non-power-of-2-textures? + : gen-texture ( -- id ) [ glGenTextures ] (gen-gl-object) ; : delete-texture ( id -- ) [ glDeleteTextures ] (delete-gl-object) ; @@ -29,9 +31,14 @@ GENERIC: draw-scaled-texture ( dim texture -- ) TUPLE: single-texture image dim loc texture-coords texture display-list disposed ; +: adjust-texture-dim ( dim -- dim' ) + non-power-of-2-textures? get [ + [ next-power-of-2 ] map + ] unless ; + : (tex-image) ( image -- ) [ GL_TEXTURE_2D 0 GL_RGBA ] dip - [ dim>> first2 [ next-power-of-2 ] bi@ 0 ] + [ dim>> adjust-texture-dim first2 0 ] [ component-order>> component-order>format f ] bi glTexImage2D ; @@ -81,7 +88,7 @@ TUPLE: single-texture image dim loc texture-coords texture display-list disposed ] with-texturing ; : texture-coords ( texture -- coords ) - [ [ dim>> ] [ image>> dim>> [ next-power-of-2 ] map ] bi v/ ] + [ [ dim>> ] [ image>> dim>> adjust-texture-dim ] bi v/ ] [ image>> upside-down?>> { { 0 1 } { 1 1 } { 1 0 } { 0 0 } } diff --git a/basis/ui/backend/backend.factor b/basis/ui/backend/backend.factor index d72ef13b44..9c844d3663 100755 --- a/basis/ui/backend/backend.factor +++ b/basis/ui/backend/backend.factor @@ -1,6 +1,6 @@ -! Copyright (C) 2006, 2007 Slava Pestov. +! Copyright (C) 2006, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: kernel namespaces opengl opengl.gl ; +USING: kernel namespaces opengl opengl.gl fry ; IN: ui.backend SYMBOL: ui-backend @@ -28,7 +28,7 @@ GENERIC: flush-gl-context ( handle -- ) HOOK: offscreen-pixels ui-backend ( world -- alien w h ) : with-gl-context ( handle quot -- ) - swap [ select-gl-context call ] keep - flush-gl-context gl-error ; inline + '[ select-gl-context @ ] + [ flush-gl-context gl-error ] bi ; inline HOOK: (with-ui) ui-backend ( quot -- ) \ No newline at end of file diff --git a/basis/ui/gadgets/worlds/worlds.factor b/basis/ui/gadgets/worlds/worlds.factor index 655c9ba49d..f671add531 100644 --- a/basis/ui/gadgets/worlds/worlds.factor +++ b/basis/ui/gadgets/worlds/worlds.factor @@ -1,9 +1,10 @@ ! Copyright (C) 2005, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays assocs continuations kernel math models -namespaces opengl sequences io combinators combinators.short-circuit -fry math.vectors math.rectangles cache ui.gadgets ui.gestures -ui.render ui.backend ui.gadgets.tracks ui.commands ; +namespaces opengl opengl.capabilities opengl.textures sequences io +combinators combinators.short-circuit fry math.vectors math.rectangles +cache ui.gadgets ui.gestures ui.render ui.backend ui.gadgets.tracks +ui.commands ; IN: ui.gadgets.worlds TUPLE: world < track @@ -76,8 +77,13 @@ SYMBOL: flush-layout-cache-hook flush-layout-cache-hook [ [ ] ] initialize +: check-extensions ( -- ) + "2.0" { "GL_ARB_texture_non_power_of_two" } has-gl-version-or-extensions? + non-power-of-2-textures? set ; + : (draw-world) ( world -- ) dup handle>> [ + check-extensions { [ init-gl ] [ draw-gadget ] From ba61b8215275bb6ea605169d291f133b8d5db711 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 21:47:57 -0500 Subject: [PATCH 61/65] Pass vocab roots onto deployed app. Fixes deployment of apps outside the built-in roots. Reported by Alec Berryman --- basis/command-line/command-line.factor | 1 - basis/tools/deploy/backend/backend.factor | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/basis/command-line/command-line.factor b/basis/command-line/command-line.factor index 73a01aa352..56d7fbd207 100644 --- a/basis/command-line/command-line.factor +++ b/basis/command-line/command-line.factor @@ -60,7 +60,6 @@ SYMBOL: main-vocab-hook : default-cli-args ( -- ) global [ "quiet" off - "script" off "e" off "user-init" on embedded? "quiet" set diff --git a/basis/tools/deploy/backend/backend.factor b/basis/tools/deploy/backend/backend.factor index 28a32790dc..6ca54ca36b 100755 --- a/basis/tools/deploy/backend/backend.factor +++ b/basis/tools/deploy/backend/backend.factor @@ -8,7 +8,7 @@ debugger io.streams.c io.files io.files.temp io.pathnames io.directories io.directories.hierarchy io.backend quotations io.launcher words.private tools.deploy.config tools.deploy.config.editor bootstrap.image io.encodings.utf8 -destructors accessors ; +destructors accessors hashtables ; IN: tools.deploy.backend : copy-vm ( executable bundle-name -- vm ) @@ -88,7 +88,7 @@ DEFER: ?make-staging-image [ drop ] [ make-staging-image ] if ; : make-deploy-config ( vocab -- file ) - [ deploy-config unparse-use ] + [ deploy-config vocab-roots get vocab-roots associate assoc-union unparse-use ] [ "deploy-config-" prepend temp-file ] bi [ utf8 set-file-contents ] keep ; From 6082a98c7c075dbfc03d9a3c720e0fcccfda4eb5 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 7 Apr 2009 22:30:13 -0500 Subject: [PATCH 62/65] If (open-window) or similar fails, don't enter an infinite loop of opening error windows, just try to open one and then give up --- basis/ui/ui.factor | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/basis/ui/ui.factor b/basis/ui/ui.factor index bf17e455f8..dff7726d08 100644 --- a/basis/ui/ui.factor +++ b/basis/ui/ui.factor @@ -2,9 +2,9 @@ ! See http://factorcode.org/license.txt for BSD license. USING: arrays assocs io kernel math models namespaces make dlists deques sequences threads sequences words continuations init -combinators hashtables concurrency.flags sets accessors calendar fry -destructors ui.gadgets ui.gadgets.private ui.gadgets.worlds -ui.gadgets.tracks ui.gestures ui.backend ui.render ; +combinators combinators.short-circuit hashtables concurrency.flags +sets accessors calendar fry destructors ui.gadgets ui.gadgets.private +ui.gadgets.worlds ui.gadgets.tracks ui.gestures ui.backend ui.render ; IN: ui : find-window ( quot -- world ) - windows get values - [ gadget-child swap call ] with find-last nip ; inline + [ windows get values ] dip '[ gadget-child @ ] find-last nip ; inline : ui-running? ( -- ? ) \ ui-running get-global ; @@ -142,9 +139,15 @@ PRIVATE> Date: Wed, 8 Apr 2009 02:41:02 -0400 Subject: [PATCH 63/65] Solutions to Project Euler problem 69 --- extra/project-euler/007/007.factor | 3 - extra/project-euler/069/069-tests.factor | 4 ++ extra/project-euler/069/069.factor | 87 ++++++++++++++++++++++++ extra/project-euler/071/071.factor | 7 -- extra/project-euler/common/common.factor | 19 ++++-- extra/project-euler/project-euler.factor | 16 ++--- 6 files changed, 113 insertions(+), 23 deletions(-) create mode 100644 extra/project-euler/069/069-tests.factor create mode 100644 extra/project-euler/069/069.factor diff --git a/extra/project-euler/007/007.factor b/extra/project-euler/007/007.factor index f9208e11b3..1827d0fa06 100644 --- a/extra/project-euler/007/007.factor +++ b/extra/project-euler/007/007.factor @@ -17,9 +17,6 @@ IN: project-euler.007 ! SOLUTION ! -------- -: nth-prime ( n -- n ) - 1- lprimes lnth ; - : euler007 ( -- answer ) 10001 nth-prime ; diff --git a/extra/project-euler/069/069-tests.factor b/extra/project-euler/069/069-tests.factor new file mode 100644 index 0000000000..97741c0ee3 --- /dev/null +++ b/extra/project-euler/069/069-tests.factor @@ -0,0 +1,4 @@ +USING: project-euler.069 tools.test ; + +{ 510510 } [ euler069 ] unit-test +{ 510510 } [ euler069a ] unit-test diff --git a/extra/project-euler/069/069.factor b/extra/project-euler/069/069.factor new file mode 100644 index 0000000000..eae1d82ece --- /dev/null +++ b/extra/project-euler/069/069.factor @@ -0,0 +1,87 @@ +! Copyright (c) 2009 Aaron Schaefer. +! See http://factorcode.org/license.txt for BSD license. +USING: combinators fry kernel math math.primes math.primes.factors math.ranges + project-euler.common sequences ; +IN: project-euler.069 + +! http://projecteuler.net/index.php?section=problems&id=69 + +! DESCRIPTION +! ----------- + +! Euler's Totient function, φ(n) [sometimes called the phi function], is used +! to determine the number of numbers less than n which are relatively prime to +! n. For example, as 1, 2, 4, 5, 7, and 8, are all less than nine and +! relatively prime to nine, φ(9)=6. + +! +----+------------------+------+-----------+ +! | n | Relatively Prime | φ(n) | n / φ(n) | +! +----+------------------+------+-----------+ +! | 2 | 1 | 1 | 2 | +! | 3 | 1,2 | 2 | 1.5 | +! | 4 | 1,3 | 2 | 2 | +! | 5 | 1,2,3,4 | 4 | 1.25 | +! | 6 | 1,5 | 2 | 3 | +! | 7 | 1,2,3,4,5,6 | 6 | 1.1666... | +! | 8 | 1,3,5,7 | 4 | 2 | +! | 9 | 1,2,4,5,7,8 | 6 | 1.5 | +! | 10 | 1,3,7,9 | 4 | 2.5 | +! +----+------------------+------+-----------+ + +! It can be seen that n = 6 produces a maximum n / φ(n) for n ≤ 10. + +! Find the value of n ≤ 1,000,000 for which n / φ(n) is a maximum. + + +! SOLUTION +! -------- + +! Brute force + + + +: euler069 ( -- answer ) + 2 1000000 [a,b] [ totient-ratio ] map + [ supremum ] keep index 2 + ; + +! [ euler069 ] 10 ave-time +! 25210 ms ave run time - 115.37 SD (10 trials) + + +! ALTERNATE SOLUTIONS +! ------------------- + +! In order to obtain maximum n / φ(n), φ(n) needs to be low and n needs to be +! high. Hence we need a number that has the most factors. A number with the +! most unique factors would have fewer relatively prime. + + + +: euler069a ( -- answer ) + 1000000 primorial-upto ; + +! [ euler069a ] 100 ave-time +! 0 ms ave run time - 0.01 SD (100 trials) + +SOLUTION: euler069a diff --git a/extra/project-euler/071/071.factor b/extra/project-euler/071/071.factor index cccf6bf708..0fd93a8f2d 100644 --- a/extra/project-euler/071/071.factor +++ b/extra/project-euler/071/071.factor @@ -32,13 +32,6 @@ IN: project-euler.071 ! repeatedly until the denominator is as close to 1000000 as possible without ! going over. - - : euler071 ( -- answer ) 2/5 [ dup denominator 1000000 <= ] [ 3/7 mediant dup ] produce nip penultimate numerator ; diff --git a/extra/project-euler/common/common.factor b/extra/project-euler/common/common.factor index ba8c81fbf4..c2ffe26d94 100644 --- a/extra/project-euler/common/common.factor +++ b/extra/project-euler/common/common.factor @@ -1,9 +1,10 @@ -! Copyright (c) 2007-2008 Aaron Schaefer. +! Copyright (c) 2007-2009 Aaron Schaefer. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays kernel make math math.functions math.matrices math.miller-rabin - math.order math.parser math.primes.factors math.ranges math.ratios - sequences sorting strings unicode.case parser accessors vocabs.parser - namespaces vocabs words quotations prettyprint ; +USING: accessors arrays kernel lists make math math.functions math.matrices + math.miller-rabin math.order math.parser math.primes.factors + math.primes.lists math.ranges math.ratios namespaces parser prettyprint + quotations sequences sorting strings unicode.case vocabs vocabs.parser + words ; IN: project-euler.common ! A collection of words used by more than one Project Euler solution @@ -16,11 +17,13 @@ IN: project-euler.common ! log10 - #25, #134 ! max-path - #18, #67 ! mediant - #71, #73 +! nth-prime - #7, #69 ! nth-triangle - #12, #42 ! number>digits - #16, #20, #30, #34, #35, #38, #43, #52, #55, #56, #92 ! palindrome? - #4, #36, #55 ! pandigital? - #32, #38 ! pentagonal? - #44, #45 +! penultimate - #69, #71 ! propagate-all - #18, #67 ! sum-proper-divisors - #21 ! tau* - #12 @@ -78,6 +81,9 @@ PRIVATE> : number-length ( n -- m ) log10 floor 1+ >integer ; +: nth-prime ( n -- n ) + 1- lprimes lnth ; + : nth-triangle ( n -- n ) dup 1+ * 2 / ; @@ -90,6 +96,9 @@ PRIVATE> : pentagonal? ( n -- ? ) dup 0 > [ 24 * 1+ sqrt 1+ 6 / 1 mod zero? ] [ drop f ] if ; +: penultimate ( seq -- elt ) + dup length 2 - swap nth ; + ! Not strictly needed, but it is nice to be able to dump the triangle after the ! propagation : propagate-all ( triangle -- new-triangle ) diff --git a/extra/project-euler/project-euler.factor b/extra/project-euler/project-euler.factor index 5d46d7f1fd..95d3644215 100644 --- a/extra/project-euler/project-euler.factor +++ b/extra/project-euler/project-euler.factor @@ -1,4 +1,4 @@ -! Copyright (c) 2007, 2008, 2009 Aaron Schaefer, Samuel Tardieu. +! Copyright (c) 2007-2009 Aaron Schaefer, Samuel Tardieu. ! See http://factorcode.org/license.txt for BSD license. USING: definitions io io.files io.pathnames kernel math math.parser prettyprint project-euler.ave-time sequences vocabs vocabs.loader @@ -16,13 +16,13 @@ USING: definitions io io.files io.pathnames kernel math math.parser project-euler.045 project-euler.046 project-euler.047 project-euler.048 project-euler.049 project-euler.052 project-euler.053 project-euler.054 project-euler.055 project-euler.056 project-euler.057 project-euler.058 - project-euler.059 project-euler.063 project-euler.067 project-euler.071 - project-euler.073 project-euler.075 project-euler.076 project-euler.079 - project-euler.092 project-euler.097 project-euler.099 project-euler.100 - project-euler.116 project-euler.117 project-euler.134 project-euler.148 - project-euler.150 project-euler.151 project-euler.164 project-euler.169 - project-euler.173 project-euler.175 project-euler.186 project-euler.190 - project-euler.203 project-euler.215 ; + project-euler.059 project-euler.063 project-euler.067 project-euler.069 + project-euler.071 project-euler.073 project-euler.075 project-euler.076 + project-euler.079 project-euler.092 project-euler.097 project-euler.099 + project-euler.100 project-euler.116 project-euler.117 project-euler.134 + project-euler.148 project-euler.150 project-euler.151 project-euler.164 + project-euler.169 project-euler.173 project-euler.175 project-euler.186 + project-euler.190 project-euler.203 project-euler.215 ; IN: project-euler Date: Wed, 8 Apr 2009 05:04:58 -0500 Subject: [PATCH 64/65] Fix poker tests --- extra/poker/poker-tests.factor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/poker/poker-tests.factor b/extra/poker/poker-tests.factor index 1862974084..ad371a6bff 100644 --- a/extra/poker/poker-tests.factor +++ b/extra/poker/poker-tests.factor @@ -1,4 +1,4 @@ -USING: accessors poker poker.private tools.test ; +USING: accessors poker poker.private tools.test math.order kernel ; IN: poker.tests [ 134236965 ] [ "KD" >ckf ] unit-test From 30191f87e5d06749a4c8c0c317a5ad09ad8381cc Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Wed, 8 Apr 2009 05:13:06 -0500 Subject: [PATCH 65/65] descriptive: add make-descriptive word to enable this functionality to be used as an annotation; improve docs --- extra/descriptive/descriptive-docs.factor | 22 +++++++++++++++------- extra/descriptive/descriptive.factor | 11 +++++++++-- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/extra/descriptive/descriptive-docs.factor b/extra/descriptive/descriptive-docs.factor index dc02f8bd9d..6ced201c13 100755 --- a/extra/descriptive/descriptive-docs.factor +++ b/extra/descriptive/descriptive-docs.factor @@ -1,20 +1,28 @@ -USING: help.syntax help.markup ; +USING: help.syntax help.markup words ; IN: descriptive HELP: DESCRIPTIVE: { $syntax "DESCRIPTIVE: word ( inputs -- outputs ) definition ;" } -{ $description "Defines a word such that, if an error is thrown from within it, that error is wrapped in a descriptive tag including the arguments to that word." } ; +{ $description "Defines a word such that, if an error is thrown from within it, that error is wrapped in a " { $link descriptive-error } " with the arguments to that word." } ; HELP: DESCRIPTIVE:: { $syntax "DESCRIPTIVE:: word ( inputs -- outputs ) definition ;" } -{ $description "Defines a word which uses locals such that, if an error is thrown from within it, that error is wrapped in a descriptive tag including the arguments to that word." } ; +{ $description "Defines a word which uses locals such that, if an error is thrown from within it, that error is wrapped in a " { $link descriptive-error } " with the arguments to that word." } ; -HELP: descriptive -{ $class-description "The class of errors wrapping another error (in the underlying slot) which were thrown in a word (in the word slot) with a given set of arguments (in the args slot)." } ; +HELP: descriptive-error +{ $error-description "The class of errors wrapping another error (in the underlying slot) which were thrown in a word (in the word slot) with a given set of arguments (in the args slot)." } ; + +HELP: make-descriptive +{ $values { "word" word } } +{ $description "Makes the word wrap errors in " { $link descriptive-error } " instances." } ; ARTICLE: "descriptive" "Descriptive errors" -"This vocabulary defines automatic descriptive errors. Using it, you can define a word which acts as normal, except when it throws an error, the error is wrapped in a special descriptor declaring that an error was thrown from inside that word, and including the arguments given to that word. The error is of the following class:" -{ $subsection descriptive } +"This vocabulary defines automatic descriptive errors. Using it, you can define a word which acts as normal, except when it throws an error, the error is wrapped in an instance of a class:" +{ $subsection descriptive-error } +"The wrapper contains the word itself, the input parameters, as well as the original error." +$nl +"To annotate an existing word with descriptive error checking:" +{ $subsection make-descriptive } "To define words which throw descriptive errors, use the following words:" { $subsection POSTPONE: DESCRIPTIVE: } { $subsection POSTPONE: DESCRIPTIVE:: } ; diff --git a/extra/descriptive/descriptive.factor b/extra/descriptive/descriptive.factor index ceadc9fe6e..9af94aa4ed 100755 --- a/extra/descriptive/descriptive.factor +++ b/extra/descriptive/descriptive.factor @@ -1,6 +1,9 @@ -USING: words kernel sequences locals locals.parser +! Copyright (c) 2008 Daniel Ehrenberg. +! See http://factorcode.org/license.txt for BSD license. +USING: words kernel sequences locals locals.parser fry locals.definitions accessors parser namespaces continuations -summary definitions generalizations arrays prettyprint debugger io ; +summary definitions generalizations arrays prettyprint debugger io +effects tools.annotations ; IN: descriptive ERROR: descriptive-error args underlying word ; @@ -23,6 +26,10 @@ M: descriptive-error error. PRIVATE> +: make-descriptive ( word -- ) + dup [ ] [ def>> ] [ stack-effect ] tri [descriptive] + '[ drop _ ] annotate-methods ; + : define-descriptive ( word def effect -- ) [ drop "descriptive-definition" set-word-prop ] [ [ [ dup ] 2dip [descriptive] ] keep define-declared ]