24 game: Difference between revisions
Correction: the input is not an equation, but an arithmetic expression. An equation requires two sides joined by the = operator, which is explicitly disallowed.
(→{{header|C}}: Remove ucontext.h abuse (and use setjmp.h instead).) |
(Correction: the input is not an equation, but an arithmetic expression. An equation requires two sides joined by the = operator, which is explicitly disallowed.) |
||
Line 2:
The [[wp:24 Game|24 Game]] tests one's mental arithmetic.
Write a program that [[task feature::Rosetta Code:randomness|randomly]] chooses and [[task feature::Rosetta Code:user output|displays]] four digits, each from one to nine, with repetitions allowed. The program should prompt for the player to enter an
* Only multiplication, division, addition, and subtraction operators/functions are allowed.
* Division should use floating point or rational arithmetic, etc, to preserve remainders.
|