24 game/Solve: Difference between revisions

m
→‎{{header|REXX}}: removed the need for the commas function.
(→‎{{header|REXX}}: supported rational arithmetic for solutions to such numbers as 3388.)
m (→‎{{header|REXX}}: removed the need for the commas function.)
Line 6,001:
if negatory & sols\==0 then wols='A' /*found only the first solution? */
say
say commas(wols) 'solution's(sols) "found for" g
if ??\==24 then say 'for answers that equal' ??
end
Line 6,103:
return \errCode
/*──────────────────────────────────────────────────────────────────────────────────────*/
commas: parse arg _; do j=length(_)-3 to 1 by -3; _= insert(',', _, j); end; return _
div: procedure; parse arg q; if q=0 then q=1e9; return q /*tests if dividing by zero.*/
ger: say= '***error*** for argument:' y; say arg(1); errCode= 1; return 0