Talk:24 game: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎REXX only presenting digits with at least one solution: updated a statement with a number of non-unique solutions.)
(→‎REXX only presenting digits with at least one solution: updated some stats, most notably the 2,501 unsolvable numbers for the 24 game.)
Line 91: Line 91:
Please tell me the answer!!!
Please tell me the answer!!!
bupkis
bupkis
Some of the solvable digits (numbers) are hard enough to find a solution, and presenting an unsolvable problem doesn't seem to be fair or realistic, since this is a game, not a riddle, and the game is to find a solution, not none-solutions.
Some of the solvable digits (numbers) are hard enough to find a solution, and presenting an unsolvable problem doesn't seem to be fair or realistic, since this is a game, not a riddle, and the game is to find a solution, not   "none-solutions".




Of the   6,561   legal/valid numbers (with four digits) that can be presented   (numbers without any zeroes),   3,024 are solvable   (that represents about   '''46%'''   solvable).   This presumes that the REXX program correctly solved all possible (allowable) numbers.
Of the   6,561   legal/valid numbers (with four digits) that can be presented   (numbers without any zeroes),   2,501 are   unsolvable   (that represents about   '''38%'''   unsolvable).   This presumes that the REXX program correctly solved all possible (allowable) numbers.
  (I have a complete list of 10,982 non-unique solutions and I'm not afraid to use it.)   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 08:04, 15 March 2017 (UTC)
  (I have a complete list of the 2,501 unsolvable numbers for the '''24''' game.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 08:04, 15 March 2017 (UTC)

Here are the formatted (indexed) unsolvable numbers for the '''24''' game:
<pre>
1► 1111 1112 1113 1114 1115 1116 1117 1119 1121 1122 1123 1124 1125 1131 1132 1133 1141 1142 1143 1151
21► 1152 1153 1154 1159 1161 1162 1163 1164 1165 1167 1171 1172 1173 1174 1175 1176 1177 1178 1179 1181
41► 1182 1183 1184 1185 1186 1187 1189 1191 1192 1193 1194 1195 1196 1197 1198 1199 1211 1212 1213 1214
61► 1215 1216 1217 1218 1219 1221 1222 1223 1231 1232 1241 1242 1243 1251 1252 1253 1254 1261 1262 1263
81► 1264 1265 1271 1272 1273 1274 1275 1276 1281 1282 1283 1284 1285 1286 1287 1291 1292 1293 1294 1295
101► 1296 1297 1298 1299 1311 1312 1313 1314 1315 1316 1317 1318 1319 1321 1322 1323 1324 1325 1326 1327
121► 1328 1329 1331 1332 1341 1342 1343 1351 1352 1353 1354 1355 1361 1362 1363 1364 1365 1371 1372 1373
141► 1374 1375 1376 1381 1382 1383 1384 1385 1386 1387 1391 1392 1393 1394 1395 1396 1397 1398 1411 1412
161► 1413 1414 1415 1416 1417 1418 1419 1421 1422 1423 1424 1425 1426 1427 1428 1429 1431 1432 1433 1434
181► 1435 1436 1437 1438 1439 1441 1442 1443 1451 1452 1453 1454 1461 1462 1463 1464 1465 1471 1472 1473
201► 1474 1475 1476 1481 1482 1483 1484 1485 1486 1487 1491 1492 1493 1494 1495 1496 1497 1498 1499 1511
221► 1512 1513 1514 1515 1516 1517 1518 1519 1521 1522 1523 1524 1525 1526 1527 1528 1529 1531 1532 1533
241► 1534 1535 1536 1537 1538 1539 1541 1542 1543 1544 1545 1546 1547 1548 1549 1551 1552 1553 1554 1557
261► 1558 1561 1562 1563 1564 1565 1571 1572 1573 1574 1575 1576 1577 1581 1582 1583 1584 1585 1586 1587
281► 1591 1592 1593 1594 1595 1596 1597 1598 1611 1612 1613 1614 1615 1616 1617 1618 1619 1621 1622 1623
301► 1624 1625 1626 1627 1628 1629 1631 1632 1633 1634 1635 1636 1637 1638 1639 1641 1642 1643 1644 1645
321► 1646 1647 1648 1649 1651 1652 1653 1654 1655 1656 1657 1658 1659 1661 1662 1663 1664 1665 1667 1671
341► 1672 1673 1674 1675 1676 1677 1678 1681 1682 1683 1684 1685 1686 1687 1691 1692 1693 1694 1695 1696
361► 1697 1698 1711 1712 1713 1714 1715 1716 1717 1718 1719 1721 1722 1723 1724 1725 1726 1727 1728 1729
381► 1731 1732 1733 1734 1735 1736 1737 1738 1739 1741 1742 1743 1744 1745 1746 1747 1748 1749 1751 1752
401► 1753 1754 1755 1756 1757 1758 1759 1761 1762 1763 1764 1765 1766 1767 1768 1769 1771 1772 1773 1774
421► 1775 1776 1777 1778 1781 1782 1783 1784 1785 1786 1787 1791 1792 1793 1794 1795 1796 1797 1798 1811
441► 1812 1813 1814 1815 1816 1817 1818 1819 1821 1822 1823 1824 1825 1826 1827 1828 1829 1831 1832 1833
461► 1834 1835 1836 1837 1838 1839 1841 1842 1843 1844 1845 1846 1847 1848 1849 1851 1852 1853 1854 1855
481► 1856 1857 1858 1859 1861 1862 1863 1864 1865 1866 1867 1868 1869 1871 1872 1873 1874 1875 1876 1877
501► 1878 1879 1881 1882 1883 1884 1885 1886 1887 1891 1892 1893 1894 1895 1896 1897 1898 1899 1911 1912
521► 1913 1914 1915 1916 1917 1918 1919 1921 1922 1923 1924 1925 1926 1927 1928 1929 1931 1932 1933 1934
541► 1935 1936 1937 1938 1939 1941 1942 1943 1944 1945 1946 1947 1948 1949 1951 1952 1953 1954 1955 1956
561► 1957 1958 1959 1961 1962 1963 1964 1965 1966 1967 1968 1969 1971 1972 1973 1974 1975 1976 1977 1978
581► 1979 1981 1982 1983 1984 1985 1986 1987 1988 1989 1991 1992 1993 1994 1995 1996 1997 1998 1999 2111
601► 2112 2113 2114 2115 2116 2117 2118 2119 2121 2122 2123 2124 2125 2126 2127 2128 2129 2131 2132 2133
621► 2134 2135 2136 2137 2138 2139 2141 2142 2143 2144 2145 2146 2147 2148 2149 2151 2152 2153 2154 2155
641► 2156 2157 2158 2159 2161 2162 2163 2164 2165 2166 2167 2168 2169 2171 2172 2173 2174 2175 2176 2177
661► 2178 2179 2181 2182 2183 2184 2185 2186 2187 2188 2189 2191 2192 2193 2194 2195 2196 2197 2198 2199
681► 2211 2212 2213 2214 2215 2216 2217 2218 2219 2221 2222 2226 2231 2232 2241 2242 2243 2251 2252 2253
701► 2254 2261 2262 2263 2264 2265 2271 2272 2273 2274 2275 2276 2279 2281 2282 2283 2284 2285 2286 2287
721► 2291 2292 2293 2294 2295 2296 2297 2298 2299 2311 2312 2313 2314 2315 2316 2317 2318 2319 2321 2322
741► 2323 2324 2325 2326 2327 2328 2329 2331 2332 2334 2341 2342 2343 2351 2352 2353 2354 2361 2362 2363
761► 2364 2365 2371 2372 2373 2374 2375 2376 2381 2382 2383 2384 2385 2386 2387 2391 2392 2393 2394 2395
781► 2396 2397 2398 2411 2412 2413 2414 2415 2416 2417 2418 2419 2421 2422 2423 2424 2425 2426 2427 2428
801► 2429 2431 2432 2433 2434 2435 2436 2437 2438 2439 2441 2442 2443 2451 2452 2453 2454 2461 2462 2463
821► 2464 2465 2471 2472 2473 2474 2475 2476 2481 2482 2483 2484 2485 2486 2487 2491 2492 2493 2494 2495
841► 2496 2497 2498 2511 2512 2513 2514 2515 2516 2517 2518 2519 2521 2522 2523 2524 2525 2526 2527 2528
861► 2529 2531 2532 2533 2534 2535 2536 2537 2538 2539 2541 2542 2543 2544 2545 2546 2547 2548 2549 2551
881► 2552 2553 2554 2555 2556 2561 2562 2563 2564 2565 2571 2572 2573 2574 2575 2576 2581 2582 2583 2584
901► 2585 2586 2587 2591 2592 2593 2594 2595 2596 2597 2598 2599 2611 2612 2613 2614 2615 2616 2617 2618
921► 2619 2621 2622 2623 2624 2625 2626 2627 2628 2629 2631 2632 2633 2634 2635 2636 2637 2638 2639 2641
941► 2642 2643 2644 2645 2646 2647 2648 2649 2651 2652 2653 2654 2655 2656 2657 2658 2659 2661 2662 2663
961► 2664 2665 2671 2672 2673 2674 2675 2676 2677 2681 2682 2683 2684 2685 2686 2687 2691 2692 2693 2694
981► 2695 2696 2697 2698 2711 2712 2713 2714 2715 2716 2717 2718 2719 2721 2722 2723 2724 2725 2726 2727
1001► 2728 2729 2731 2732 2733 2734 2735 2736 2737 2738 2739 2741 2742 2743 2744 2745 2746 2747 2748 2749
1021► 2751 2752 2753 2754 2755 2756 2757 2758 2759 2761 2762 2763 2764 2765 2766 2767 2768 2769 2771 2772
1041► 2773 2774 2775 2776 2777 2779 2781 2782 2783 2784 2785 2786 2787 2791 2792 2793 2794 2795 2796 2797
1061► 2798 2799 2811 2812 2813 2814 2815 2816 2817 2818 2819 2821 2822 2823 2824 2825 2826 2827 2828 2829
1081► 2831 2832 2833 2834 2835 2836 2837 2838 2839 2841 2842 2843 2844 2845 2846 2847 2848 2849 2851 2852
1101► 2853 2854 2855 2856 2857 2858 2859 2861 2862 2863 2864 2865 2866 2867 2868 2869 2871 2872 2873 2874
1121► 2875 2876 2877 2878 2879 2881 2882 2883 2884 2885 2886 2887 2891 2892 2893 2894 2895 2896 2897 2898
1141► 2911 2912 2913 2914 2915 2916 2917 2918 2919 2921 2922 2923 2924 2925 2926 2927 2928 2929 2931 2932
1161► 2933 2934 2935 2936 2937 2938 2939 2941 2942 2943 2944 2945 2946 2947 2948 2949 2951 2952 2953 2954
1181► 2955 2956 2957 2958 2959 2961 2962 2963 2964 2965 2966 2967 2968 2969 2971 2972 2973 2974 2975 2976
1201► 2977 2978 2979 2981 2982 2983 2984 2985 2986 2987 2988 2989 2991 2992 2993 2994 2995 2996 2997 2998
1221► 2999 3111 3112 3113 3114 3115 3116 3117 3118 3119 3121 3122 3123 3124 3125 3126 3127 3128 3129 3131
1241► 3132 3133 3134 3135 3136 3137 3138 3139 3141 3142 3143 3144 3145 3146 3147 3148 3149 3151 3152 3153
1261► 3154 3155 3156 3157 3158 3159 3161 3162 3163 3164 3165 3166 3167 3168 3169 3171 3172 3173 3174 3175
1281► 3176 3177 3178 3179 3181 3182 3183 3184 3185 3186 3187 3188 3189 3191 3192 3193 3194 3195 3196 3197
1301► 3198 3199 3211 3212 3213 3214 3215 3216 3217 3218 3219 3221 3222 3223 3224 3225 3226 3227 3228 3229
1321► 3231 3232 3233 3234 3235 3236 3237 3238 3239 3241 3242 3243 3244 3245 3246 3247 3248 3249 3251 3252
1341► 3253 3254 3255 3256 3257 3258 3259 3261 3262 3263 3264 3265 3266 3267 3268 3269 3271 3272 3273 3274
1361► 3275 3276 3277 3278 3279 3281 3282 3283 3284 3285 3286 3287 3288 3289 3291 3292 3293 3294 3295 3296
1381► 3297 3298 3299 3311 3312 3313 3314 3315 3316 3317 3318 3319 3321 3322 3323 3324 3325 3326 3327 3328
1401► 3329 3331 3332 3341 3342 3343 3351 3352 3353 3354 3358 3361 3362 3363 3364 3365 3371 3372 3373 3374
1421► 3375 3376 3381 3382 3383 3384 3385 3386 3387 3391 3392 3393 3394 3395 3396 3397 3398 3411 3412 3413
1441► 3414 3415 3416 3417 3418 3419 3421 3422 3423 3424 3425 3426 3427 3428 3429 3431 3432 3433 3434 3435
1461► 3436 3437 3438 3439 3441 3442 3443 3451 3452 3453 3454 3461 3462 3463 3464 3465 3467 3471 3472 3473
1481► 3474 3475 3476 3481 3482 3483 3484 3485 3486 3487 3488 3491 3492 3493 3494 3495 3496 3497 3498 3511
1501► 3512 3513 3514 3515 3516 3517 3518 3519 3521 3522 3523 3524 3525 3526 3527 3528 3529 3531 3532 3533
1521► 3534 3535 3536 3537 3538 3539 3541 3542 3543 3544 3545 3546 3547 3548 3549 3551 3552 3553 3554 3555
1541► 3561 3562 3563 3564 3565 3571 3572 3573 3574 3575 3576 3577 3581 3582 3583 3584 3585 3586 3587 3591
1561► 3592 3593 3594 3595 3596 3597 3598 3611 3612 3613 3614 3615 3616 3617 3618 3619 3621 3622 3623 3624
1581► 3625 3626 3627 3628 3629 3631 3632 3633 3634 3635 3636 3637 3638 3639 3641 3642 3643 3644 3645 3646
1601► 3647 3648 3649 3651 3652 3653 3654 3655 3656 3657 3658 3659 3661 3662 3663 3664 3665 3671 3672 3673
1621► 3674 3675 3676 3681 3682 3683 3684 3685 3686 3687 3691 3692 3693 3694 3695 3696 3697 3698 3711 3712
1641► 3713 3714 3715 3716 3717 3718 3719 3721 3722 3723 3724 3725 3726 3727 3728 3729 3731 3732 3733 3734
1661► 3735 3736 3737 3738 3739 3741 3742 3743 3744 3746 3757 3764 3775 3835 3848 3853 3884 4111 4112 4121
1681► 4199 4211 4233 4323 4332 4361 4367 4376 4388 4429 4459 4466 4467 4476 4492 4495 4499 4549 4594 4613
1701► 4631 4637 4646 4647 4664 4673 4674 4736 4746 4763 4764 4772 4779 4797 4837 4838 4873 4883 4917 4919
1721► 4924 4942 4945 4949 4954 4971 4977 4991 4994 4999 5111 5112 5119 5121 5135 5146 5153 5157 5158 5164
1741► 5175 5177 5185 5191 5211 5255 5256 5265 5299 5315 5338 5351 5355 5377 5383 5416 5425 5449 5452 5461
1761► 5494 5513 5517 5518 5524 5525 5526 5531 5535 5542 5547 5548 5552 5553 5557 5558 5562 5569 5571 5574
1781► 5575 5579 5581 5584 5585 5596 5597 5614 5625 5641 5652 5659 5695 5715 5717 5737 5745 5751 5754 5755
1801► 5759 5771 5773 5777 5778 5787 5795 5799 5815 5833 5845 5851 5854 5855 5877 5899 5911 5914 5915 5917
1821► 5929 5941 5944 5951 5956 5957 5965 5971 5975 5979 5989 5992 5997 5998 5999 6111 6117 6134 6143 6145
1841► 6154 6167 6171 6176 6177 6178 6187 6222 6255 6277 6314 6341 6347 6374 6413 6415 6431 6437 6446 6447
1861► 6451 6464 6473 6474 6514 6525 6541 6552 6559 6595 6617 6644 6661 6667 6671 6676 6677 6678 6681 6687
1881► 6699 6711 6716 6717 6718 6727 6734 6743 6744 6759 6761 6766 6767 6768 6771 6772 6775 6776 6777 6778
1901► 6779 6781 6786 6787 6788 6795 6797 6816 6817 6861 6865 6867 6871 6876 6877 6878 6887 6917 6955 6957
1921► 6969 6971 6975 6977 6996 6999 7111 7116 7117 7118 7119 7149 7153 7155 7157 7159 7161 7166 7167 7168
1941► 7169 7171 7174 7175 7176 7177 7178 7181 7186 7187 7191 7194 7195 7196 7217 7229 7247 7267 7271 7274
1961► 7276 7277 7279 7292 7297 7299 7315 7346 7348 7351 7357 7364 7371 7375 7384 7417 7419 7427 7436 7438
1981► 7446 7455 7463 7464 7471 7472 7479 7483 7491 7497 7513 7515 7517 7519 7531 7537 7545 7551 7554 7555
2001► 7559 7567 7569 7571 7573 7576 7577 7578 7587 7591 7595 7596 7597 7599 7611 7616 7617 7618 7619 7627
2021► 7634 7643 7644 7657 7659 7661 7666 7667 7668 7671 7672 7675 7676 7677 7678 7679 7681 7686 7687 7688
2041► 7691 7695 7697 7711 7712 7713 7714 7715 7716 7717 7718 7721 7724 7726 7727 7729 7731 7735 7739 7741
2061► 7742 7744 7749 7751 7753 7756 7757 7758 7759 7761 7762 7765 7766 7767 7768 7769 7771 7772 7775 7776
2081► 7777 7778 7779 7781 7785 7786 7787 7788 7789 7792 7793 7794 7795 7796 7797 7798 7799 7811 7816 7817
2101► 7825 7834 7843 7852 7857 7861 7866 7867 7868 7869 7871 7875 7876 7877 7878 7879 7886 7887 7888 7896
2121► 7897 7899 7911 7914 7915 7916 7922 7927 7928 7929 7937 7941 7946 7947 7951 7955 7956 7957 7959 7961
2141► 7964 7965 7967 7968 7972 7973 7974 7975 7976 7977 7978 7979 7982 7986 7987 7989 7992 7994 7995 7997
2161► 7998 7999 8117 8119 8145 8154 8155 8166 8167 8171 8176 8177 8191 8199 8252 8257 8275 8279 8297 8335
2181► 8347 8348 8353 8374 8383 8384 8415 8437 8438 8451 8455 8473 8483 8514 8515 8522 8527 8533 8541 8545
2201► 8551 8554 8555 8558 8566 8572 8577 8585 8599 8616 8617 8656 8661 8665 8667 8671 8676 8677 8678 8679
2221► 8687 8697 8711 8716 8717 8725 8729 8734 8743 8752 8757 8761 8766 8767 8768 8769 8771 8775 8776 8777
2241► 8778 8779 8786 8787 8788 8792 8796 8797 8799 8833 8834 8843 8855 8867 8876 8877 8878 8887 8888 8889
2261► 8898 8899 8911 8919 8927 8959 8967 8972 8976 8977 8979 8987 8988 8989 8991 8994 8995 8997 8998 8999
2281► 9111 9115 9117 9118 9119 9129 9141 9145 9146 9147 9149 9151 9154 9155 9157 9164 9167 9171 9174 9175
2301► 9176 9181 9189 9191 9192 9194 9198 9199 9219 9227 9229 9244 9248 9259 9272 9277 9278 9279 9284 9287
2321► 9291 9292 9295 9297 9299 9377 9411 9415 9416 9417 9419 9424 9428 9442 9445 9449 9451 9454 9461 9467
2341► 9471 9476 9477 9479 9482 9489 9491 9494 9497 9498 9499 9511 9514 9515 9517 9529 9541 9544 9551 9556
2361► 9557 9559 9565 9567 9571 9575 9576 9577 9579 9589 9592 9595 9597 9598 9599 9611 9614 9617 9641 9647
2381► 9655 9657 9669 9671 9674 9675 9677 9678 9687 9696 9699 9711 9714 9715 9716 9722 9727 9728 9729 9737
2401► 9741 9746 9747 9749 9751 9755 9756 9757 9759 9761 9764 9765 9767 9768 9772 9773 9774 9775 9776 9777
2421► 9778 9779 9782 9786 9787 9788 9789 9792 9794 9795 9797 9798 9799 9811 9819 9824 9827 9842 9849 9858
2441► 9859 9867 9872 9876 9877 9878 9879 9885 9887 9888 9889 9891 9894 9895 9897 9898 9899 9911 9912 9914
2461► 9918 9919 9921 9922 9925 9927 9929 9941 9944 9945 9947 9948 9949 9952 9954 9955 9957 9958 9959 9966
2481► 9969 9972 9974 9975 9977 9978 9979 9981 9984 9985 9987 9988 9989 9991 9992 9994 9995 9996 9997 9998
2501► 9999
</pre>

I'd be interested if anyone would verify that all the numbers above are unsolvable for the '''24''' game. &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:31, 3 January 2019 (UTC)

Revision as of 23:33, 3 January 2019

Purpose

What's the theoretical or practical interest in this task? I'd be interested in a program that enumerated all the 4-tuples that have solutions or determined whether a given 4-tuple had a solution, but we've already got tasks for getting input from the user, parsing arithmetic expressions, and so on. —Underscore 19:22, 31 October 2009 (UTC)

Umm,
  1. Playing the game.
  2. We have a gazillion sorts for example, (some are very impractical); so we can stand some repetition.
  3. We don't have many games, (of any description). Some site grazers might be attracted just by the word 'game'.
  4. The input checking is novel.
  5. The task is more than the some of its parts! (We have tasks covering most statement types, and it would not make sense to use that as a reason for not doing any composite task).
  6. Prelude to possibly another task to solve the game.
(I don't like to write a task until I have a solution and so can better gauge its suitability, and so write a better task description). --Paddy3118 20:57, 31 October 2009 (UTC)
Without any official guidelines as to what's an appropriate Rosetta task and what isn't, I suppose it's all completely subjective, so I can't very well argue with you. Adding more games isn't such a bad idea; RCRPG is interesting from an implementation point of view but sorely lacking in the fun department. I wonder how hard it is to write a minimal Pong clone. —Underscore 22:24, 31 October 2009 (UTC)
Very easy, with modern hardware and programming languages.
FWIW, this task does strike me as being a somewhat useful one. I used to have a similar time waster game when I was a teen where you got 4 numbers and a goal, the end. (Except for the variable goal, identical to this task.) -- Eriksiers 02:23, 1 November 2009 (UTC)
Since there really is no body of multiple individuals to give any sort of official policy, any concept of "official" falls to whatever I say by fiat. Which sucks, because I'm nowhere near as knowledgeable on programming as many of RC's contributors are, regular or not. All I really know is that I have a good mental picture of the kinds of roles I want to the site to fill. Beyond that, I don't pretend to have expertise; Many of my early ideas and attempts at trying to come up with task descriptions were too specific, enforcing my own limited view of programming on the examples, so I've learned to stand back. I step in from time to time if I see discussion heading in a direction counter to where I'd like the site to go, but that's about it.
As for "redundant" tasks, it doesn't bother me. In fact, I can think of ways to take advantage of it, such as category tagging individual examples with techniques, features or principles they may illustrate, to offer another way to browse and search the site, and to be more illustrative of alternate approaches. --Michael Mol 17:12, 1 November 2009 (UTC)
Methinks you're turning into a Python-esque BDFL ;-)
--Paddy3118 18:49, 1 November 2009 (UTC)
It's also practical; I've got one paid 50hr/wk job coding, one 30+hr/wk job taking care of an elderly family member, and one 50hr/wk job sleeping. Not much time left to micromanage RC, as well as have any [other] hobbies. :) --Michael Mol 23:13, 1 November 2009 (UTC)

A game player was not too difficult so I created it as a separate (but linked), task. --Paddy3118 04:52, 1 November 2009 (UTC)

Autohotkey and Untested

Does untested mean that it has not been shown to run? If so, could we restrict ourselves to examples that have at least been run? (Or do you mean: "insufficiently tested but has at least been run")? --Paddy3118 05:37, 11 November 2009 (UTC)

I also agree (that the program should at least run (execute).   There have been entries that do not work at all for the computer programming language (category) entry that it was entered for.   It's a whole 'nother can of worms.   -- Gerard Schildberger (talk) 01:56, 10 May 2016 (UTC)

Floating point

Is recommending floating point wise? Precision and rounding errors would seem to defeat the purpose of preserving remainders. --Michael Mol 03:58, 8 December 2009 (UTC)

It isn't rigorous, (I'm an engineer, not a theoretical mathematician captain), but with the restricted range of single digit numbers, the given operators, and the precision of most FP implementations on a PC; I don't think it will matter. --Paddy3118 07:12, 8 December 2009 (UTC)
Certainly rationals are a better choice than floating point for this type of task, but I think you should be able to use floating point safely so long as you say something like if abs(ans - 24) < 1e-6 instead of if ans == 24. It's considered good practice, in general, to never test a floating-point variable for exact equality. That said, I'm at a loss for an input that the Python program would wrongly reject, so maybe floating point is better than I think it is. —Underscore (Talk) 12:49, 8 December 2009 (UTC)
If someone can exhibit a solution that a floating-point version won't find, that's when action becomes necessary. However, when I try out likely problems then I find I still cannot trigger any issues. For example:
<lang tcl>$ tclsh8.5

% expr {(((1.0/3.0)*9.0)*8.0) - 24.0} 0.0</lang>Despite a definitely non-representable intermediate (I know the implementation) the answer is exact. I just can't trigger the problem for anything that might be a solution. (Non-solutions… who cares about them?) Rationals might be theoretically better, but IEEE double seems good enough here. –Donal Fellows 13:32, 8 December 2009 (UTC)

You mentioned in Talk:24_game_Player#Should_we_enumerate_all_solutions.3F that it was practicable to identify all 7,860 solutions. That sounds like a pretty small test set. (Or am I misunderstanding your description of the enumeration?) --Michael Mol 18:49, 8 December 2009 (UTC)
Hi Donal, you might try 3 3 8 8 in the TCL example. Floating point won't work for this in Python. --Paddy3118 14:18, 15 February 2011 (UTC)
3 3 8 8 has different values depending on the Tcl versions it seems <lang>:> /opt/tcltk_8.0.3/bin/tclsh8.0

% expr 8.0 / ( 3.0 - 8.0 / 3.0 ) 24.0 %

> /opt/tcltk_8.3.4/bin/tclsh

% expr 8.0 / ( 3.0 - 8.0 / 3.0 ) 24.0 %

> /opt/tcltk_8.4.13/bin/tclsh

% expr 8.0 / ( 3.0 - 8.0 / 3.0 ) 24.0 %

> /opt/TWWfsw/bin/tclsh8.5

% expr 8.0 / ( 3.0 - 8.0 / 3.0 ) 23.99999999999999 %</lang> --Paddy3118 14:34, 15 February 2011 (UTC)

One potential problem with floating point, when you get to more than 4 digits, is that in some languages (not Python), division by 0.0 evaluates to infinity (which can be divided by again to get 0), instead of raising an error, so for example, this in Ruby: 3.0 * (8.0 + 4.0 / (2.0 / (5.0 - 5.0))) results in 24.0, which you might not want to allow. But I agree that this is not an issue with only 4 digits. --Spoon! 14:16, 8 December 2009 (UTC)
Precisely. That's why it matters that it is a “24-game player”. A solution with computation using rationals would be interesting though. –Donal Fellows 14:57, 8 December 2009 (UTC)

Does the Perl code work?

I have tryed to run the Perl code, and it seems that it doesn't recognise when the correct answer is given. --Blue Prawn 00:42, 26 January 2010 (UTC)

Scala only presenting numbers with solutions

I note that the impressive Scala example seems to only present a set of numbers guaranteed to have a solution. i can't help but think that from playing the game, some of the fun is lost, as we quite enjoyed trying the toughies - not knowing if they actually had a solution or not as most numbers do. I guess they don't have to add much for a solution to 24 game Player. --Paddy3118 06:43, 28 April 2010 (UTC)

I couldn't quite understand fully the meaning of the penultimate statement as it appears it may be missing an Oxford comma.   Most numbers don't have a solution.   (See the next talk section).   -- Gerard Schildberger (talk) 08:04, 15 March 2017 (UTC)


REXX only presenting digits with at least one solution

I have programmed the REXX example to also only present a set of digits that have a solution   (as does Scala).

From the task preamble:

The goal is for the player to enter an expression that (numerically) evaluates to 24. 

Nowhere does it imply that an impossible set of digits is to be determined and, somehow, the user is supposed to   not   enter a solution;   as it is, no computer programming entry checks for a   not possible   answer for a solution.

When presented with the digits     1 7 6 8,     what should a carbon-based life form (user) respond with for an answer (which is a non-solution)?

No such animal?
N/A
there ain't one
not possible
nope.
I give up.
I don't know
Please tell me the answer!!!
bupkis

Some of the solvable digits (numbers) are hard enough to find a solution, and presenting an unsolvable problem doesn't seem to be fair or realistic, since this is a game, not a riddle, and the game is to find a solution, not   "none-solutions".


Of the   6,561   legal/valid numbers (with four digits) that can be presented   (numbers without any zeroes),   2,501 are   unsolvable   (that represents about   38%   unsolvable).   This presumes that the REXX program correctly solved all possible (allowable) numbers.   (I have a complete list of the 2,501 unsolvable numbers for the 24 game.   -- Gerard Schildberger (talk) 08:04, 15 March 2017 (UTC)

Here are the formatted (indexed) unsolvable numbers for the 24 game:

   1► 1111 1112 1113 1114 1115 1116 1117 1119 1121 1122 1123 1124 1125 1131 1132 1133 1141 1142 1143 1151
  21► 1152 1153 1154 1159 1161 1162 1163 1164 1165 1167 1171 1172 1173 1174 1175 1176 1177 1178 1179 1181
  41► 1182 1183 1184 1185 1186 1187 1189 1191 1192 1193 1194 1195 1196 1197 1198 1199 1211 1212 1213 1214
  61► 1215 1216 1217 1218 1219 1221 1222 1223 1231 1232 1241 1242 1243 1251 1252 1253 1254 1261 1262 1263
  81► 1264 1265 1271 1272 1273 1274 1275 1276 1281 1282 1283 1284 1285 1286 1287 1291 1292 1293 1294 1295
 101► 1296 1297 1298 1299 1311 1312 1313 1314 1315 1316 1317 1318 1319 1321 1322 1323 1324 1325 1326 1327
 121► 1328 1329 1331 1332 1341 1342 1343 1351 1352 1353 1354 1355 1361 1362 1363 1364 1365 1371 1372 1373
 141► 1374 1375 1376 1381 1382 1383 1384 1385 1386 1387 1391 1392 1393 1394 1395 1396 1397 1398 1411 1412
 161► 1413 1414 1415 1416 1417 1418 1419 1421 1422 1423 1424 1425 1426 1427 1428 1429 1431 1432 1433 1434
 181► 1435 1436 1437 1438 1439 1441 1442 1443 1451 1452 1453 1454 1461 1462 1463 1464 1465 1471 1472 1473
 201► 1474 1475 1476 1481 1482 1483 1484 1485 1486 1487 1491 1492 1493 1494 1495 1496 1497 1498 1499 1511
 221► 1512 1513 1514 1515 1516 1517 1518 1519 1521 1522 1523 1524 1525 1526 1527 1528 1529 1531 1532 1533
 241► 1534 1535 1536 1537 1538 1539 1541 1542 1543 1544 1545 1546 1547 1548 1549 1551 1552 1553 1554 1557
 261► 1558 1561 1562 1563 1564 1565 1571 1572 1573 1574 1575 1576 1577 1581 1582 1583 1584 1585 1586 1587
 281► 1591 1592 1593 1594 1595 1596 1597 1598 1611 1612 1613 1614 1615 1616 1617 1618 1619 1621 1622 1623
 301► 1624 1625 1626 1627 1628 1629 1631 1632 1633 1634 1635 1636 1637 1638 1639 1641 1642 1643 1644 1645
 321► 1646 1647 1648 1649 1651 1652 1653 1654 1655 1656 1657 1658 1659 1661 1662 1663 1664 1665 1667 1671
 341► 1672 1673 1674 1675 1676 1677 1678 1681 1682 1683 1684 1685 1686 1687 1691 1692 1693 1694 1695 1696
 361► 1697 1698 1711 1712 1713 1714 1715 1716 1717 1718 1719 1721 1722 1723 1724 1725 1726 1727 1728 1729
 381► 1731 1732 1733 1734 1735 1736 1737 1738 1739 1741 1742 1743 1744 1745 1746 1747 1748 1749 1751 1752
 401► 1753 1754 1755 1756 1757 1758 1759 1761 1762 1763 1764 1765 1766 1767 1768 1769 1771 1772 1773 1774
 421► 1775 1776 1777 1778 1781 1782 1783 1784 1785 1786 1787 1791 1792 1793 1794 1795 1796 1797 1798 1811
 441► 1812 1813 1814 1815 1816 1817 1818 1819 1821 1822 1823 1824 1825 1826 1827 1828 1829 1831 1832 1833
 461► 1834 1835 1836 1837 1838 1839 1841 1842 1843 1844 1845 1846 1847 1848 1849 1851 1852 1853 1854 1855
 481► 1856 1857 1858 1859 1861 1862 1863 1864 1865 1866 1867 1868 1869 1871 1872 1873 1874 1875 1876 1877
 501► 1878 1879 1881 1882 1883 1884 1885 1886 1887 1891 1892 1893 1894 1895 1896 1897 1898 1899 1911 1912
 521► 1913 1914 1915 1916 1917 1918 1919 1921 1922 1923 1924 1925 1926 1927 1928 1929 1931 1932 1933 1934
 541► 1935 1936 1937 1938 1939 1941 1942 1943 1944 1945 1946 1947 1948 1949 1951 1952 1953 1954 1955 1956
 561► 1957 1958 1959 1961 1962 1963 1964 1965 1966 1967 1968 1969 1971 1972 1973 1974 1975 1976 1977 1978
 581► 1979 1981 1982 1983 1984 1985 1986 1987 1988 1989 1991 1992 1993 1994 1995 1996 1997 1998 1999 2111
 601► 2112 2113 2114 2115 2116 2117 2118 2119 2121 2122 2123 2124 2125 2126 2127 2128 2129 2131 2132 2133
 621► 2134 2135 2136 2137 2138 2139 2141 2142 2143 2144 2145 2146 2147 2148 2149 2151 2152 2153 2154 2155
 641► 2156 2157 2158 2159 2161 2162 2163 2164 2165 2166 2167 2168 2169 2171 2172 2173 2174 2175 2176 2177
 661► 2178 2179 2181 2182 2183 2184 2185 2186 2187 2188 2189 2191 2192 2193 2194 2195 2196 2197 2198 2199
 681► 2211 2212 2213 2214 2215 2216 2217 2218 2219 2221 2222 2226 2231 2232 2241 2242 2243 2251 2252 2253
 701► 2254 2261 2262 2263 2264 2265 2271 2272 2273 2274 2275 2276 2279 2281 2282 2283 2284 2285 2286 2287
 721► 2291 2292 2293 2294 2295 2296 2297 2298 2299 2311 2312 2313 2314 2315 2316 2317 2318 2319 2321 2322
 741► 2323 2324 2325 2326 2327 2328 2329 2331 2332 2334 2341 2342 2343 2351 2352 2353 2354 2361 2362 2363
 761► 2364 2365 2371 2372 2373 2374 2375 2376 2381 2382 2383 2384 2385 2386 2387 2391 2392 2393 2394 2395
 781► 2396 2397 2398 2411 2412 2413 2414 2415 2416 2417 2418 2419 2421 2422 2423 2424 2425 2426 2427 2428
 801► 2429 2431 2432 2433 2434 2435 2436 2437 2438 2439 2441 2442 2443 2451 2452 2453 2454 2461 2462 2463
 821► 2464 2465 2471 2472 2473 2474 2475 2476 2481 2482 2483 2484 2485 2486 2487 2491 2492 2493 2494 2495
 841► 2496 2497 2498 2511 2512 2513 2514 2515 2516 2517 2518 2519 2521 2522 2523 2524 2525 2526 2527 2528
 861► 2529 2531 2532 2533 2534 2535 2536 2537 2538 2539 2541 2542 2543 2544 2545 2546 2547 2548 2549 2551
 881► 2552 2553 2554 2555 2556 2561 2562 2563 2564 2565 2571 2572 2573 2574 2575 2576 2581 2582 2583 2584
 901► 2585 2586 2587 2591 2592 2593 2594 2595 2596 2597 2598 2599 2611 2612 2613 2614 2615 2616 2617 2618
 921► 2619 2621 2622 2623 2624 2625 2626 2627 2628 2629 2631 2632 2633 2634 2635 2636 2637 2638 2639 2641
 941► 2642 2643 2644 2645 2646 2647 2648 2649 2651 2652 2653 2654 2655 2656 2657 2658 2659 2661 2662 2663
 961► 2664 2665 2671 2672 2673 2674 2675 2676 2677 2681 2682 2683 2684 2685 2686 2687 2691 2692 2693 2694
 981► 2695 2696 2697 2698 2711 2712 2713 2714 2715 2716 2717 2718 2719 2721 2722 2723 2724 2725 2726 2727
1001► 2728 2729 2731 2732 2733 2734 2735 2736 2737 2738 2739 2741 2742 2743 2744 2745 2746 2747 2748 2749
1021► 2751 2752 2753 2754 2755 2756 2757 2758 2759 2761 2762 2763 2764 2765 2766 2767 2768 2769 2771 2772
1041► 2773 2774 2775 2776 2777 2779 2781 2782 2783 2784 2785 2786 2787 2791 2792 2793 2794 2795 2796 2797
1061► 2798 2799 2811 2812 2813 2814 2815 2816 2817 2818 2819 2821 2822 2823 2824 2825 2826 2827 2828 2829
1081► 2831 2832 2833 2834 2835 2836 2837 2838 2839 2841 2842 2843 2844 2845 2846 2847 2848 2849 2851 2852
1101► 2853 2854 2855 2856 2857 2858 2859 2861 2862 2863 2864 2865 2866 2867 2868 2869 2871 2872 2873 2874
1121► 2875 2876 2877 2878 2879 2881 2882 2883 2884 2885 2886 2887 2891 2892 2893 2894 2895 2896 2897 2898
1141► 2911 2912 2913 2914 2915 2916 2917 2918 2919 2921 2922 2923 2924 2925 2926 2927 2928 2929 2931 2932
1161► 2933 2934 2935 2936 2937 2938 2939 2941 2942 2943 2944 2945 2946 2947 2948 2949 2951 2952 2953 2954
1181► 2955 2956 2957 2958 2959 2961 2962 2963 2964 2965 2966 2967 2968 2969 2971 2972 2973 2974 2975 2976
1201► 2977 2978 2979 2981 2982 2983 2984 2985 2986 2987 2988 2989 2991 2992 2993 2994 2995 2996 2997 2998
1221► 2999 3111 3112 3113 3114 3115 3116 3117 3118 3119 3121 3122 3123 3124 3125 3126 3127 3128 3129 3131
1241► 3132 3133 3134 3135 3136 3137 3138 3139 3141 3142 3143 3144 3145 3146 3147 3148 3149 3151 3152 3153
1261► 3154 3155 3156 3157 3158 3159 3161 3162 3163 3164 3165 3166 3167 3168 3169 3171 3172 3173 3174 3175
1281► 3176 3177 3178 3179 3181 3182 3183 3184 3185 3186 3187 3188 3189 3191 3192 3193 3194 3195 3196 3197
1301► 3198 3199 3211 3212 3213 3214 3215 3216 3217 3218 3219 3221 3222 3223 3224 3225 3226 3227 3228 3229
1321► 3231 3232 3233 3234 3235 3236 3237 3238 3239 3241 3242 3243 3244 3245 3246 3247 3248 3249 3251 3252
1341► 3253 3254 3255 3256 3257 3258 3259 3261 3262 3263 3264 3265 3266 3267 3268 3269 3271 3272 3273 3274
1361► 3275 3276 3277 3278 3279 3281 3282 3283 3284 3285 3286 3287 3288 3289 3291 3292 3293 3294 3295 3296
1381► 3297 3298 3299 3311 3312 3313 3314 3315 3316 3317 3318 3319 3321 3322 3323 3324 3325 3326 3327 3328
1401► 3329 3331 3332 3341 3342 3343 3351 3352 3353 3354 3358 3361 3362 3363 3364 3365 3371 3372 3373 3374
1421► 3375 3376 3381 3382 3383 3384 3385 3386 3387 3391 3392 3393 3394 3395 3396 3397 3398 3411 3412 3413
1441► 3414 3415 3416 3417 3418 3419 3421 3422 3423 3424 3425 3426 3427 3428 3429 3431 3432 3433 3434 3435
1461► 3436 3437 3438 3439 3441 3442 3443 3451 3452 3453 3454 3461 3462 3463 3464 3465 3467 3471 3472 3473
1481► 3474 3475 3476 3481 3482 3483 3484 3485 3486 3487 3488 3491 3492 3493 3494 3495 3496 3497 3498 3511
1501► 3512 3513 3514 3515 3516 3517 3518 3519 3521 3522 3523 3524 3525 3526 3527 3528 3529 3531 3532 3533
1521► 3534 3535 3536 3537 3538 3539 3541 3542 3543 3544 3545 3546 3547 3548 3549 3551 3552 3553 3554 3555
1541► 3561 3562 3563 3564 3565 3571 3572 3573 3574 3575 3576 3577 3581 3582 3583 3584 3585 3586 3587 3591
1561► 3592 3593 3594 3595 3596 3597 3598 3611 3612 3613 3614 3615 3616 3617 3618 3619 3621 3622 3623 3624
1581► 3625 3626 3627 3628 3629 3631 3632 3633 3634 3635 3636 3637 3638 3639 3641 3642 3643 3644 3645 3646
1601► 3647 3648 3649 3651 3652 3653 3654 3655 3656 3657 3658 3659 3661 3662 3663 3664 3665 3671 3672 3673
1621► 3674 3675 3676 3681 3682 3683 3684 3685 3686 3687 3691 3692 3693 3694 3695 3696 3697 3698 3711 3712
1641► 3713 3714 3715 3716 3717 3718 3719 3721 3722 3723 3724 3725 3726 3727 3728 3729 3731 3732 3733 3734
1661► 3735 3736 3737 3738 3739 3741 3742 3743 3744 3746 3757 3764 3775 3835 3848 3853 3884 4111 4112 4121
1681► 4199 4211 4233 4323 4332 4361 4367 4376 4388 4429 4459 4466 4467 4476 4492 4495 4499 4549 4594 4613
1701► 4631 4637 4646 4647 4664 4673 4674 4736 4746 4763 4764 4772 4779 4797 4837 4838 4873 4883 4917 4919
1721► 4924 4942 4945 4949 4954 4971 4977 4991 4994 4999 5111 5112 5119 5121 5135 5146 5153 5157 5158 5164
1741► 5175 5177 5185 5191 5211 5255 5256 5265 5299 5315 5338 5351 5355 5377 5383 5416 5425 5449 5452 5461
1761► 5494 5513 5517 5518 5524 5525 5526 5531 5535 5542 5547 5548 5552 5553 5557 5558 5562 5569 5571 5574
1781► 5575 5579 5581 5584 5585 5596 5597 5614 5625 5641 5652 5659 5695 5715 5717 5737 5745 5751 5754 5755
1801► 5759 5771 5773 5777 5778 5787 5795 5799 5815 5833 5845 5851 5854 5855 5877 5899 5911 5914 5915 5917
1821► 5929 5941 5944 5951 5956 5957 5965 5971 5975 5979 5989 5992 5997 5998 5999 6111 6117 6134 6143 6145
1841► 6154 6167 6171 6176 6177 6178 6187 6222 6255 6277 6314 6341 6347 6374 6413 6415 6431 6437 6446 6447
1861► 6451 6464 6473 6474 6514 6525 6541 6552 6559 6595 6617 6644 6661 6667 6671 6676 6677 6678 6681 6687
1881► 6699 6711 6716 6717 6718 6727 6734 6743 6744 6759 6761 6766 6767 6768 6771 6772 6775 6776 6777 6778
1901► 6779 6781 6786 6787 6788 6795 6797 6816 6817 6861 6865 6867 6871 6876 6877 6878 6887 6917 6955 6957
1921► 6969 6971 6975 6977 6996 6999 7111 7116 7117 7118 7119 7149 7153 7155 7157 7159 7161 7166 7167 7168
1941► 7169 7171 7174 7175 7176 7177 7178 7181 7186 7187 7191 7194 7195 7196 7217 7229 7247 7267 7271 7274
1961► 7276 7277 7279 7292 7297 7299 7315 7346 7348 7351 7357 7364 7371 7375 7384 7417 7419 7427 7436 7438
1981► 7446 7455 7463 7464 7471 7472 7479 7483 7491 7497 7513 7515 7517 7519 7531 7537 7545 7551 7554 7555
2001► 7559 7567 7569 7571 7573 7576 7577 7578 7587 7591 7595 7596 7597 7599 7611 7616 7617 7618 7619 7627
2021► 7634 7643 7644 7657 7659 7661 7666 7667 7668 7671 7672 7675 7676 7677 7678 7679 7681 7686 7687 7688
2041► 7691 7695 7697 7711 7712 7713 7714 7715 7716 7717 7718 7721 7724 7726 7727 7729 7731 7735 7739 7741
2061► 7742 7744 7749 7751 7753 7756 7757 7758 7759 7761 7762 7765 7766 7767 7768 7769 7771 7772 7775 7776
2081► 7777 7778 7779 7781 7785 7786 7787 7788 7789 7792 7793 7794 7795 7796 7797 7798 7799 7811 7816 7817
2101► 7825 7834 7843 7852 7857 7861 7866 7867 7868 7869 7871 7875 7876 7877 7878 7879 7886 7887 7888 7896
2121► 7897 7899 7911 7914 7915 7916 7922 7927 7928 7929 7937 7941 7946 7947 7951 7955 7956 7957 7959 7961
2141► 7964 7965 7967 7968 7972 7973 7974 7975 7976 7977 7978 7979 7982 7986 7987 7989 7992 7994 7995 7997
2161► 7998 7999 8117 8119 8145 8154 8155 8166 8167 8171 8176 8177 8191 8199 8252 8257 8275 8279 8297 8335
2181► 8347 8348 8353 8374 8383 8384 8415 8437 8438 8451 8455 8473 8483 8514 8515 8522 8527 8533 8541 8545
2201► 8551 8554 8555 8558 8566 8572 8577 8585 8599 8616 8617 8656 8661 8665 8667 8671 8676 8677 8678 8679
2221► 8687 8697 8711 8716 8717 8725 8729 8734 8743 8752 8757 8761 8766 8767 8768 8769 8771 8775 8776 8777
2241► 8778 8779 8786 8787 8788 8792 8796 8797 8799 8833 8834 8843 8855 8867 8876 8877 8878 8887 8888 8889
2261► 8898 8899 8911 8919 8927 8959 8967 8972 8976 8977 8979 8987 8988 8989 8991 8994 8995 8997 8998 8999
2281► 9111 9115 9117 9118 9119 9129 9141 9145 9146 9147 9149 9151 9154 9155 9157 9164 9167 9171 9174 9175
2301► 9176 9181 9189 9191 9192 9194 9198 9199 9219 9227 9229 9244 9248 9259 9272 9277 9278 9279 9284 9287
2321► 9291 9292 9295 9297 9299 9377 9411 9415 9416 9417 9419 9424 9428 9442 9445 9449 9451 9454 9461 9467
2341► 9471 9476 9477 9479 9482 9489 9491 9494 9497 9498 9499 9511 9514 9515 9517 9529 9541 9544 9551 9556
2361► 9557 9559 9565 9567 9571 9575 9576 9577 9579 9589 9592 9595 9597 9598 9599 9611 9614 9617 9641 9647
2381► 9655 9657 9669 9671 9674 9675 9677 9678 9687 9696 9699 9711 9714 9715 9716 9722 9727 9728 9729 9737
2401► 9741 9746 9747 9749 9751 9755 9756 9757 9759 9761 9764 9765 9767 9768 9772 9773 9774 9775 9776 9777
2421► 9778 9779 9782 9786 9787 9788 9789 9792 9794 9795 9797 9798 9799 9811 9819 9824 9827 9842 9849 9858
2441► 9859 9867 9872 9876 9877 9878 9879 9885 9887 9888 9889 9891 9894 9895 9897 9898 9899 9911 9912 9914
2461► 9918 9919 9921 9922 9925 9927 9929 9941 9944 9945 9947 9948 9949 9952 9954 9955 9957 9958 9959 9966
2481► 9969 9972 9974 9975 9977 9978 9979 9981 9984 9985 9987 9988 9989 9991 9992 9994 9995 9996 9997 9998
2501► 9999

I'd be interested if anyone would verify that all the numbers above are unsolvable for the 24 game.     -- Gerard Schildberger (talk) 23:31, 3 January 2019 (UTC)