Share your repls and programming experiences

← Back to all posts
An Actual Real GOOD Calculator
henryeth (184)

This is a calculator (:happy_noises:). But it is no ordinary calculator. It is not "I am a noob so I built a calculator to impress everyone, who cares if I used eval() to cheat". I did not use eval() at all (:gasps:). It also isn't a million lines of code so hooray for that. Basically, I have made a good calculator that doesn't cheat with eval() using HTML, CSS & JS that even remotely resembles a real calculator in appearance (I actually did a tiny bit of CSS for once!). This was actually part of another project I was invited to by @CaptinNeo but I thought it was good so I am posting it here anyway. Feel free to upvote if you think it is good. @RhinoRunner I read your description hehe.

FlaminHotValdez (690)

Ohh... Your calculator doesn't follow order of operations. I put 1+2*3 and it outputted 9, should be 7.

henryeth (184)

@FlaminHotValdez yh that is the one major problem... how did you not notice that before? It is much harder to do pemdas when it is progressive like this one instead of like yours where it is all entered at once.

FlaminHotValdez (690)

@henryeth because I was a dum-dum and didn't input statements that would have a different answer from left-right and PEMDAS. If you understand that you win a cookie!

henryeth (184)

@FlaminHotValdez haha :D. It doesn't have to be PEMDAS tho. Here is a full list of valid options:
1. B or P
2. E or I or O
3. MD or DM
4. AS or SA

FlaminHotValdez (690)

Sigh...and here I was with a 150 line code that did the exact same thing. Good job! Very concise code.


99% of the credit actually goes to @henryeth

henryeth (184)

@CaptinNeo you gave me the inspiration but yh I did most js and html. I wouldn’t have done it without you though.

LegendaryWolf (574)

CaptinNEo's ded. he left look, he deleted his account after getting banned