Jump to content

24 game/Solve: Difference between revisions

(J)
Line 145:
answer 2 3 5 7
2+7+3*5
answer 8 4 7 1
8*7-4*1
 
The answer will be either a suitable J sentence or blank if none can be found. This means that, for example, the sentence 8*7-4*1 is equivalent to the sentence 8*(7-(4*1)). [Many infix languages use operator precedence to make polynomials easier to express without parenthesis, but J has other mechanisms for expressing polynomials and no operator precedence makes the language more regular.]
The answer will be either a suitable J sentence or blank if none can be found.
 
=={{header|Mathematica}}==
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.