Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   Working Calculator! --- Dameria (http://www.alice.org/community/showthread.php?t=3588)

Dameria 12-10-2009 08:08 PM

Working Calculator! --- Dameria
 
3 Attachment(s)
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 ([B]can only go up to 9,999,999[/B]).

And although that part was hard enough, before giving up for the day I also went ahead and added a few methods to make [B]addition[/B] 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... :mad:;)

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.

dubastot 12-10-2009 09:12 PM

You just never stop creating Dameria. Don't you have homework? This world was quite good.

Dameria 12-10-2009 09:16 PM

Lol, I didn't have homework today, but I probably should have studied for the 3 tests and 2 quizzes tomorrow O.o Oh well.

It was worth it to make this world instead :)

x2495iiii 12-10-2009 10:43 PM

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=([B]5?[/B])) 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.

Dameria 12-11-2009 01:36 PM

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?

x2495iiii 12-11-2009 01:47 PM

Do you mean for numbers that are too long, or too "decimal heavy?"

Dameria 12-11-2009 01:52 PM

No, I meant for number when you add a larger number to a smaller number and the text goes off the screen, I don't know how to fix it.

x2495iiii 12-11-2009 02:12 PM

That's difficult to keep track of, as the 3d text has a weirdness about it which make resizing and resetting text somewhat erratic.

I suppose I'd find out exactly how long the text has to be to go off the screen by having a number variable set it's value to some too long text, then have a method which checks your text when it changes to make sure it's not too long, and resizes it from left to right if it is.

arty-fishL 12-11-2009 06:38 PM

All needed functions now work.
 
2 Attachment(s)
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.

File is attached to this post below image.

Hope it helps:D

Dameria 12-11-2009 07:21 PM

arty-fishL
 
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.


All times are GMT -5. The time now is 08:36 AM.

Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.