ssjskipp on DeviantArthttps://www.deviantart.com/ssjskipp/art/Calculator-AS3-66450490ssjskipp

Deviation Actions

ssjskipp's avatar

Calculator - AS3 -

By
Published:
5.6K Views

Description

This is just an Über awesome calculator thinggy I made using Flash CS3 (hence AS3).

There's nothing REALLY amazing, and maybe I'll add ()s if I get bored. Other than that, I actually made a function that takes in a string (since this is what the challenge was), and calculated it. IE:
This: will Return:
2+2+2 6
2*2-3 1
2/2+1 2
2^2-2 2
So, basically it works with (P)EMDAS....nifty, eh? After that, all I had to do was:
1. Generate a string (like so: 1+2+4-5*3/5^5)
2. Make the string replace Ans with whatever the last answer was
3. Evaluate. If there's a syntax error, report it.

Yup...nifty, eh? I'll add ()s now that I think about it (won't be too hard...just nest the function!), and mayhaps a graphing side...iunno.

That's it for me -- I'm tired now, g'night all.
Image size
285x315px 2.94 KB
© 2007 - 2024 ssjskipp
Comments20
Join the community to add your comment. Already a deviant? Log In
how can i download this file ( not able to download it is just opening the file in new tab that's all pls let me know how to download this.......)