Moomin Calculator - my prefix notation calculator written in C

A place to share and discuss technical news items, security breaches, new hardware/software etc.
Post Reply
User avatar
Manna5
Posts: 11
Joined: 2021-Aug-03, 7:54 am
Contact:

Moomin Calculator - my prefix notation calculator written in C

Post 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
Last edited by Manna5 on 2021-Aug-10, 8:34 am, edited 3 times in total.
User avatar
Simon Sheppard
Posts: 102
Joined: 2021-Jul-10, 7:46 pm
Contact:

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

Post 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.
User avatar
Manna5
Posts: 11
Joined: 2021-Aug-03, 7:54 am
Contact:

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

Post 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).
User avatar
Manna5
Posts: 11
Joined: 2021-Aug-03, 7:54 am
Contact:

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

Post by Manna5 »

Latest news:
I launched a project website at manna5.c1.biz/moomin [edit Archive.org copy]
Last edited by Simon Sheppard on 2022-Nov-03, 10:33 am, edited 1 time in total.
Reason: dead link
User avatar
Simon Sheppard
Posts: 102
Joined: 2021-Jul-10, 7:46 pm
Contact:

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

Post by Simon Sheppard »

Suggestion: make the download button on your website much bigger, its too easy to miss buried in the footer text.
User avatar
Manna5
Posts: 11
Joined: 2021-Aug-03, 7:54 am
Contact:

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

Post 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.
Clara36
Posts: 1
Joined: 2022-Nov-03, 7:31 am

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

Post 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:)
efrain15
Posts: 1
Joined: 2022-Nov-10, 10:52 am

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

Post by efrain15 »

This is useful information
Post Reply