Here is a fun math game, inspired by the game "24", where you have to make mental calculation to obtain a target number with only the 4 integers given to you.
You can use parenthesis and standard operators (+,-,*,/) to get to the result.
Good luck!
The fun part in this cartridge is the calculator which includes a parsing Shunting-yard algorithm to generate and evaluate an RPN expression.
1.4 Update :
- Fix an issue when there was still numbers on the stack when evaluating an expression (like "829" evaluated to "9", instead of giving an error)
1.3 Update :
- Button X deletes the last character
- The delete button is replaced by a "c" (like in a calculator) to reset the guess
1.2 Update :
- Fixed a bug with the shunting yard algorithm (the test for operator precedence was incorrect)
- Added a debug/test mode for RPN calculation (set the scene=2)
1.1 Update :
- Score, timer and difficulty indicator
- Fireworks when a correct solution is guessed (from the Fireworks effects by Saccharine)
- Some invalid calculations are detected (not all)
- Fixed some other bugs
This is a great idea! I'm ashamed to admit how difficult it is for me hahaha D:
Hey. This is an awesome idea. But shouldn't this one be correct?
Thanks, I'll see what is going on with this one.
I know there are some issues with the calculations sometimes, but I haven't found the cause.
I fixed the bug, all the operations should be evaluated correctly now!
That reads as 8 - 2 - (5/5) = 6 - 1 = 5 to me. Shouldn't it be 8 - (2 - 5/5)?
I haven't done this type of problem in years, it's more fun than I remember - great work :)
However, one of the buttons (z or x, don't remember which) 'skips' the current question.
Maybe add a confirmation prompt before doing that - being halfway through entering a solution and losing it all due to an errant keystroke kind of put me off a little.
@Catatafish Thanks, I have great fun playing it too with my kids!
I removed the ability to skip a problem in the last version (1.2).
You now have 60 to 80 seconds to solve a problem, after that it displays the solution and you can get a new one.
In my opinion, the other button really needs to be backspace. (maybe leave the soft button for full reset?)
@tyroney You are right, it plays better this way (except for a bug when deleting a repeated operator or digit)
I noticed a strange behaviour, if you type multiple numbers directly after one another without any operator only the first number is evaluated. for example 11 + 8 + 2 = 11
Anyway, really like this one, way more fun than I thought it would be :)
@jayminer, good catch! I fixed the issue in v.1.4, typing multiple numbers will give you an "invalid calculation" error.
[Please log in to post a comment]