Log In  

Cart #25816 | 2016-07-24 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Cart #25464 | 2016-07-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Cart #25453 | 2016-07-17 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

Cart #25429 | 2016-07-16 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
10

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
P#25430 2016-07-16 18:00 ( Edited 2016-07-24 15:05)

This is a great idea! I'm ashamed to admit how difficult it is for me hahaha D:

P#25434 2016-07-16 19:02 ( Edited 2016-07-16 23:02)

Hey. This is an awesome idea. But shouldn't this one be correct?

http://screencast.com/t/W5ooWCS3Rr

P#25454 2016-07-17 13:40 ( Edited 2016-07-17 17:40)

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.

P#25455 2016-07-17 14:00 ( Edited 2016-07-17 18:00)

I fixed the bug, all the operations should be evaluated correctly now!

P#25465 2016-07-17 16:22 ( Edited 2016-07-17 20:22)

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.

P#25467 2016-07-17 16:38 ( Edited 2016-07-17 20:40)

@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.

P#25475 2016-07-18 00:44 ( Edited 2016-07-18 04:44)

In my opinion, the other button really needs to be backspace. (maybe leave the soft button for full reset?)

P#25476 2016-07-18 01:13 ( Edited 2016-07-18 05:13)

@tyroney You are right, it plays better this way (except for a bug when deleting a repeated operator or digit)

P#25483 2016-07-18 05:17 ( Edited 2016-07-18 09:17)

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 :)

P#25814 2016-07-24 08:23 ( Edited 2016-07-24 12:23)

@jayminer, good catch! I fixed the issue in v.1.4, typing multiple numbers will give you an "invalid calculation" error.

P#25817 2016-07-24 11:05 ( Edited 2016-07-24 15:05)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-28 22:08:46 | 0.022s | Q:39