Page 1 of 1

Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-09, 5:57 pm
by Manna5
I written a calculator in C called Moomin (after moomintrolls) that uses the prefix notation. It is like Scheme, but without brackets (and less functional). Main features:
- arithmetical operators (+, -, *, /)
- bitwise operators (~, &, |, ^)
- relational operators (<, >, =)
- conditional operator (?)
- recall operator (#)
- boolean constants (t = -1, f = 0)

A package containing the base version (source, executable, logotype and BNF schema) is available from: https://files.catbox.moe/r6bv9a.zip
Newer version that emits a bell character in case of invalid operator: https://files.catbox.moe/g1fzj3.zip

Sum of 4 and 6:

Code: Select all

+ 4 6
Difference of 7 and 2:

Code: Select all

- 7 2
Product of 8 and 5:

Code: Select all

* 8 5
Quotient of 64 and 16:

Code: Select all

/ 64 16
Exclusive or of true and false:

Code: Select all

^ t f
Generate Mersenne numbers:

Code: Select all

? > # 1 - * 2 # 1 2

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-09, 6:20 pm
by Simon Sheppard
Interesting, is this command line based or a GUI?

A couple of examples would be helpful to see what it can do.

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-09, 6:45 pm
by Manna5
I used command line to make it smaller and more portable. For example, + 5 - / 14 2 * 1 3 will return 9 (tomorrow I will add more examples).

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-11, 4:10 pm
by Manna5
Latest news:
I launched a project website at manna5.c1.biz/moomin [edit Archive.org copy]

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-13, 7:37 pm
by Simon Sheppard
Suggestion: make the download button on your website much bigger, its too easy to miss buried in the footer text.

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2021-Aug-21, 4:36 pm
by Manna5
These four links in the footer are the menu, and clicking Download tooks you to the download page with the download link immediately under the header.

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2022-Nov-07, 5:12 am
by Clara36
Manna5 wrote: 2021-Aug-21, 4:36 pm These four links in the footer are the menu, and clicking Download tooks you to the download page with the download link immediately under the header.
Thank you so much for sharing your creative project with us:)

Re: Moomin Calculator - my prefix notation calculator written in C

Posted: 2022-Nov-10, 10:56 am
by efrain15
This is useful information