Alice Community  

Go Back   Alice Community > Alice 2 > Share Worlds

Reply
 
Thread Tools Display Modes
Working Calculator! --- Dameria
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default Working Calculator! --- Dameria - 12-10-2009, 09: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.
Attached Files
File Type: a2w Calculator 1.1.a2w (339.5 KB, 78 views)
File Type: a2w Calculator 1.2 (Arty-fishL edit).a2w (1.10 MB, 34 views)
File Type: a2w Calculator 1.3 (Arty-fishL edit).a2w (2.42 MB, 98 views)

Last edited by Dameria; 02-03-2010 at 05:29 PM.
   
Reply With Quote
Old
dubastot
Senior Member
 
dubastot's Avatar
 
Status: Offline
Posts: 661
Join Date: Apr 2009
Location: Two Steps From Hell
Default 12-10-2009, 10:12 PM

You just never stop creating Dameria. Don't you have homework? This world was quite good.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 12-10-2009, 10: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


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
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 12-10-2009, 11: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=(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.


(')>

Last edited by x2495iiii; 12-11-2009 at 07:30 AM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 12-11-2009, 02: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?


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
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 12-11-2009, 02:47 PM

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


(')>
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default 12-11-2009, 02: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.


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
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 12-11-2009, 03: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.


(')>
   
Reply With Quote
All needed functions now work.
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Arrow All needed functions now work. - 12-11-2009, 07: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.

File is attached to this post below image.

Hope it helps
Attached Images
File Type: jpg Finished calc world.jpg (72.7 KB, 197 views)
Attached Files
File Type: a2w Calculator 1.2 (Arty-fishL edit).a2w (1.25 MB, 6 views)


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]

Last edited by arty-fishL; 12-11-2009 at 07:53 PM.
   
Reply With Quote
arty-fishL
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 978
Join Date: Sep 2009
Location: United States
Default arty-fishL - 12-11-2009, 08:21 PM

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

Last edited by Dameria; 12-11-2009 at 08:28 PM.
   
Reply With Quote
Reply

Tags
add, calculator, code, math

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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