Working Calculator! --- Dameria -
12-10-2009, 08:08 PM
I know this is very recent to my last world I just created, tic-tac-toe 2.0, but I just had an idea recently while in school: "What if I could actually create a calculator with Alice in which things could be equated in like a real calculator?"
I began thinking about it, and I started to put the ideas together and it all started to make sense, and suddenly I couldn't wait to work on it. Well here I am about 4 hours later after starting on it, and I have gotten a considerable amount done already. So far, the number buttons work and you can click on each one, 0-9 and they will add up like in a real calculator (can only go up to 9,999,999).
And although that part was hard enough, before giving up for the day I also went ahead and added a few methods to make addition work accurately! Also the Clear button works normally, so instead of restarting the program to get a clean 0, just press the big C button.
Download my first version of it, Calculator 1.1, and tell me what you think. The only problem is that sometimes when you add things together, the text will go out of place (you can avoid this by putting in smaller numbers first, and then add a larger number). Again I repeat, do not try to get a number over 9,999,999 or bad things will happen...
Hope you like it, please feel free to comment or give advise for my next version where I will add more things to do. I like it when people leave comments on my posts. Thanks.
P.S. Its only 340 KB!! From now on I am going to try to make all of my worlds as basic as they need to be while still allowing all of the functionality that I want it to have, so that I can save as much file size as possible. This will teach me to be wary of the things I do, so I can keep my file size very low, therefore lag-free if I ever decide to make big projects and games.
That's exactly how I feel about making games and stuff. My problem is I have a short attention span, so I like shifting projects a lot. Doesn't make for a productive environment, I'll tell you.
I'm really glad you decided to use a picture of the Microsoft calculator instead of the Alice calculator, I've always thought the Alice calculator was kind of ugly.
The program seems nicely functional and the coding is very nice for additions and numerical entry, but compound additions don't work, it seems. 45+45=(90+5=(5?)) Still, great work. I do think it's neat that you're making all these gadget-like programs, like the clock and the calculator, I hope we can one day have them be standalone projects.
Ya I have not yet implemented the result variable into addition, so until next version you will just have to re enter the number you want to. Also, any ideas on how to make the numbers not go off the screen?
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
All needed functions now work. -
12-11-2009, 06:38 PM
OK, I felt like doing some to it, finish it your own way if you want, but it now functions:
- all numbers
- decimal point
- swap to negative number
- cancel button
- + - * / (plus, minus, multiply, divide all now work).
- buttons each highlight for 0.2 seconds when clicked to show that the right button has actually been pressed.
NOTE: type your number THEN click +/- button to switch to negative on a one way basis.
Thanks, now I see that it can do division, multiplication, and so on. Also, although I do not like the covers, I did like the fact that when you click on the buttons they flash a certain color. Thanks for expanding on my program, now I don't have to do it
If you want, you can keep working on it and post your work on this thread, and if you every make a new version, I will put it onto the first below the other versions, as I have done with this one.
One thing I would like to see changed that I have not figured out yet it to keep the text in the correct place when something is equated. Oh, and also for some reason you left the methods of button= on EVERY single cover, which when I deleted them, it decreased your file size by about 150 KB. Also, another bug is when you click the button+- more than one time, it will create several - signs, and it will also create a negative 0 if you click it when 0. A few bugs, and if you want to fix it be my guest, just make sure to give me credit for the stuff that I did.
Check out my best projects so far and please comment:
Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
Thanks, now I see that it can do division, multiplication, and so on. Also, although I do not like the covers, I did like the fact that when you click on the buttons they flash a certain color. Thanks for expanding on my program, now I don't have to do it
If you want, you can keep working on it and post your work on this thread, and if you every make a new version, I will put it onto the first below the other versions, as I have done with this one.
One thing I would like to see changed that I have not figured out yet it to keep the text in the correct place when something is equated. Oh, and also for some reason you left the methods of button= on EVERY single cover, which when I deleted them, it decreased your file size by about 150 KB. Also, another bug is when you click the button+- more than one time, it will create several - signs, and it will also create a negative 0 if you click it when 0. A few bugs, and if you want to fix it be my guest, just make sure to give me credit for the stuff that I did.
Will do that if you want, thanks for posting bugs.
Forgot to post this, not been doin Alice for a while, but here is Calculator version 1.3, with ALL FUNCTIONS WORKING, EXCEPT PERCENTAGE AND BACKSPACE.
Even the memory functions work, but remember this, I didnt know until I looked at the help;
MS to save the currently displayed number to memory.
MR to replace the number on screen with the saved number.
MC to clear the number in memory.
M+ to add the number displayed on screen to the number in memory and save as the memory number, but in the background without affecting the current calculation.
M is displayed in the box when there is a number in memory.
Also for those who dont know;
1/x divides 1 by the number on screen and displays the result.