24 game/Solve: Difference between revisions

→‎{{header|REXX}}: supported rational arithmetic for solutions to such numbers as 3388.
(→‎{{header|REXX}}: fixed program to generate all manner of groupings.)
(→‎{{header|REXX}}: supported rational arithmetic for solutions to such numbers as 3388.)
Line 5,886:
└───────────────────────────────────────────────────────────────────────┘
end-of-help */
numeric digits 12 /*where rational arithmetic is needed. */
parse arg orig /*get the guess from the command line*/
orig= space(orig, 0) /*remove all blanks from ORIG. */
Line 6,058 ⟶ 6,059:
x.e= 1 /*mark this expression as being used. */
end
interpret 'x=(' e ") / 1" /*have REXX do the heavy lifting here. */
if x\==?? then iteratedo /*Not correct? Then try again. */
finds= finds + 1 numeric digits 9; x= x /*bump number1 of found solutions. /*re-do evaluation.*/
numeric digits 12 /*re-instate digits*/
if x\==?? then iterate /*Not correct? Then try again. */
end
finds= finds + 1 /*bump number of found solutions. */
if \show | negatory then return finds
_= translate(origE, '][', ")(") /*show [], not (). */