Qbasicnews.com

Qbasic "like" compilers/interpreters => FB Projects => Topic started by: Rattrapmax6 on April 10, 2005, 02:45:47 PM



Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 10, 2005, 02:45:47 PM
File Updated: Fixed more bugs than I knew about.. Enjoy!

http://members.aol.com/rattrapmax6/fbfiles/ncalc.zip


:) Heh, the standard computer calculator that comes with Windows looks sorta not like calculator.. with the "/", "*", & "sqrt" on the buttons...  :lol: So I got a better looking layout...

(http://members.aol.com/rattrapmax6/fbfiles/calc.png)

Download: Test: Play with: Give Bug reports: GO GO GO!!! ^_-

Edit: Working well,.. save a few bugs that pop up here and there.. working on that,.. none that I can see atm,..  :roll:  :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Mitth'raw'nuruodo on April 10, 2005, 07:37:39 PM
Nice, but I don't think you'll need the solar panals....lol


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 10, 2005, 07:53:01 PM
No? You mean all that code to render light into power was a waste? :o  Then that one,. that one that simulates batteries? :cry:  :rotfl:

Eh? "Real Calculator", I want it to look more real than the Windows calculator.. :wink: ..  :lol: Anyway, I was thinking that might activate a help file or something when you click it.. :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: SJ Zero on April 10, 2005, 07:56:49 PM
I think it should make the calculator explode when you click on it.

Here's my thinking:

Explosions+Math=Rennisance


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 10, 2005, 08:55:15 PM
:D Explode? ^_^ I like this guy!!! :D

 :lol: I was thinking of a Sun poping up and saying "HAY!", then the calc exits... :wink: Maybe I can put a explode in there somewhere, sounds fun...  :roll:  :rotfl:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Mitth'raw'nuruodo on April 10, 2005, 10:22:24 PM
Hey, expolsions are my specialty....ummm....not on the computer mind you. :lol:

You rendered light into it?!?!? No jk never mind. :rotfl:

I liked MS's Calc. It gets the job done.
Rattra...is it possible to make it a window? So you don't half to flip back and forth?

Also can you make it a Scientific calcultor, that would be great! :bounce:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 11, 2005, 05:39:44 PM
:lol: It is in a window,..  :rotfl: ,.. minus the consel (Dos box || FBC temp), but I'm not bothing to remove it since its just being coded and debuged atm.. ^_^

Scientific? :barf: I prefer using them atm, not making 'em... :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 14, 2005, 06:39:54 PM
Status thus far:

-All functions work & transfer back and forth,..

-I inserted a lock buffer so if you hold the mouse, it want add, mult, ect, 100 times over.. :wink:

-Needs more debuging

-Need to make a display renderer

Future needs (Not yet, but hopefuly sone):

-Need some ppl to try and break it (aka: Debug (Just download, find something, report it here, don't risk trying to email me))

-Sleep,.. :rotfl: jk

There ya go,. info on the current status report.. Enjoy! :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Antoni Gual on April 14, 2005, 07:04:27 PM
where is it?


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 14, 2005, 07:09:50 PM
Quote from: "Rattrapmax6"
Future needs (Not yet, but hopefuly sone):


 :rotfl: Ah, you didn't pass the reading exam.. jk

Working on it, yes.. :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Mitth'raw'nuruodo on April 14, 2005, 11:26:20 PM
Quote from: "Rattrapmax6"

-I inserted a lock buffer so if you hold the mouse, it want add, mult, ect, 100 times over.. :wink:


Just wait for the mouse button to go up before you alow the possiblility of input  :wink:

Quote from: "Rattra"

-Needs more debuging
-Need to make a display renderer

Need help? I'm your guy.

Quote from: "Rattra"

-Need some ppl to try and break it (aka: Debug (Just download, find something, report it here, don't risk trying to email me))

 :bounce: oooh, me, me.....pick me!  :rotfl:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Zip on April 15, 2005, 12:58:59 AM
Know what'd be super-sexy? A graphing feature. And perhaps a solver for various types of equations. And an RPG. And an OS. And a billion dollars... Nevermind.  :)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 15, 2005, 01:33:08 PM
Quote from: "Mitth'raw'nuruodo"
Quote from: "Rattrapmax6"

-I inserted a lock buffer so if you hold the mouse, it want add, mult, ect, 100 times over.. :wink:


Just wait for the mouse button to go up before you alow the possiblility of input  :wink:


Um, yeah:

Code:
DO: GETMOUSE x, y, , buttons: LOOP UNTIL buttons = 0

 :wink:

Quote from: "Mitth'raw'nuruodo"
Quote from: "Rattra"

-Need some ppl to try and break it (aka: Debug (Just download, find something, report it here, don't risk trying to email me))

 :bounce: oooh, me, me.....pick me!  :rotfl:


 :rotfl: I was going to just release a beta,. Maybe I'll send ya the one in debug mode,. :) ,. Then when ever I get the dysplay render going, I'll release the beta..


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 01:10:11 PM
*drum roll*

 :) Here is my near realease beta version.. The display is nothing fancy yet, but its now there for you to try and break it.. :wink:

http://members.aol.com/rattrapmax6/fbfiles/calc.zip

Enjoy!


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Anonymous on April 16, 2005, 01:18:15 PM
nice, not too bad. couple suggestions:

make so when theres a number and you start an operation, such as "+", the original number is displayed until theres a new keypress, instead of 0

make numbers work to input numbers, and "/" for division, "*" or "x" for multi, etc... (bonus: make "\" for integer division and you beat mscalc ;) )

if you do an operation like 10 + .5 then hit "=", you can then hit decimal and add more numbers onto the end of the 10.5 . this shouldnt be so. otherwise, not too bad man :)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 01:46:36 PM
Thanks, first attemt at a calculator,. you should of seen the mess it was when I began.. :lol:

Right, I'll see about those modifications.. :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 03:08:42 PM
Update:

Fixed=Display errors.. :wink:

Added=Better Display buffer, flicker removed..

Not Added (yet)=Key inputs..

Removed=DOS Box.. (Thanks to Mistik(Helped me fix my screwwed up IDE when I did so. :lol: ))

Here is the new 1, or should be if I zipped it right (cept having to redo it)... :wink:
http://members.aol.com/rattrapmax6/fbfiles/calc2.zip

Enjoy! :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: KiZ on April 16, 2005, 03:11:47 PM
you should add:

Code:
IF INKEY$ = CHR$(255)+ "X" THEN END


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 03:22:58 PM
:???: I have:

Code:
IF press$ = CHR$(27) THEN END


Why, whats wrong on your end?


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 03:29:26 PM
dark_prevail's code also ends the program when you click the window cross in windows.

Since you haven't implemented that, the program won't quit when you press X on the window =)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 03:41:00 PM
Found some weird things already though.

First of all, your calculator states the following:
Code:
Sqr(-a) = b / 0   { with a >= 0, b >= 0 }

note that Sqr(-1) is definetly not equal to Sqr(-2) or 4 / 0 ;)
(the answers to these are btw: i, sqr(2) * i, and infinity respectively).

Secondly, when I press the +/- sign first, then type a number, the zero stays attached on front, so I could type numbers like 0482.

^_^


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 04:08:37 PM
@Neo (Post 1)
Right, I had tried it thinking that it activate the X, must have not done it right, got it to work tho... :wink:

@Neo (Post 2, Error found 1)
Not exacly following you on that error. But what it seems,. when I divide something by 0, I get "1.#INF".. And when I square root a negetive, I get the same thing... You do know standard calcs, or any as far as I know, can't SQR a negative right? :???:

(.. Error found 2)
Oh, heh, I'll try and figure that out,. :roll:  :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 04:27:58 PM
The square root of a negative number is defined as the square root of the absolute value of that number, times i, the complex constant.

So:

Sqr(-a) = Sqr(a) * i          { for a >= 0 }

Most simple calculators don't have this implemented though (which actually makes them faulty, but ok). =)
^_^

I'm glad you fixed the errors =)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 04:43:25 PM
:) Oh, so you ment you wanted me to add support for squaring negatives..

IF num <= 0 THEN 'Check for negative
-(num) 'Change to positive
SQR(num) 'Square
dspl$ = STR$(num) + " * i" 'Display

Output (number * i)

Is this what you mean?

Yeah, I fixed the:

0444, & exit on pressing X,. :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 05:07:22 PM
Good good =)

About i...
Note that there's more on i than just that :)
First of all:
Quote
i^0=1
i^1=i
i^2=-1
i^3=-i
i^4=1
and so on

Simply because i = sqr(-1) so i^2 = -1

Also it has been proven that
e^(i * y) = cos(y) + i * sin(y)   { with y being any real number  }
(e is the mathematical constant of differential equality... or something, it's 2.7182818284590452353602875... (infinite numbers like PI).

If you want more about complex numbers... =) http://www.clarku.edu/~djoyce/complex/ or any other googled link ;)

Hehe, just details ;) Would be fun if it were implemented though.
But first make sure it works very good ^_^


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 05:14:56 PM
:rotfl:

Isn't that a bit much for a simple calc? So if I add that i support like I did above, I need all that other stuff to render too? :???: Or just the trailling "i" good enough for my calc?

 :lol: Funny, Algebra never bothered to mention all that on "i",. oh well.. :wink: .. Thats a higher math isn't it tho? :)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: KiZ on April 16, 2005, 05:16:41 PM
Neo, I think he just wanted to make a simple calculator. Imaginary numbers aint exactly simple  :)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 05:30:51 PM
Hehe I was just saying it existed :D
And yes, there is a lot about complex (I don't like calling them imaginary) numbers, and it's not easy no =)

And yeah... it's relatively higher math. In what I study (Aerospace Engineering) the complex numbers are essential, as with many other university studies.

:) Fun to see you like it though ;)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: shiftLynx on April 16, 2005, 07:59:14 PM
Rather than just supporting real or imaginary numbers, it would be better to support complex numbers (which have both a real and imaginary part).

If you did this, you could also add stuff like a complex conjugate button, etc.

When you first made this post, I wasn't going to say anything, but you haven't noticed yet so I suppose I should: you've mis-spelt 'calculator' on your main window. :)

I agree with Neo: it would be cool to have e.

These buttons would be good additions (no pun intended ;)):

* pi
* e
* ln
* log
* x^y
* 10^x (normally this button is labelled 'EXP' on calculators)


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 09:57:55 PM
Quote from: "Neo"
And yeah... it's relatively higher math. In what I study (Aerospace Engineering) the complex numbers are essential, as with many other university studies.

 :) Fun to see you like it though  :wink:  


lol,. I'm going for Automotive Designer, but I read I need to know Engineering also,.  :lol: ,. so a engineer doesn't have to redesign what I've done... :wink:

And high in math intrests me, yes.. :)  :wink:

@Shift.. Really,. *goes looks*.... AH! darn,.. oh well, can fix that quick,. lol. :wink:

Hmm,. thinks I'll do a scientific calc later on with those opps..  :wink: I'd have to redesign everthing for such modifictions..


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Neo on April 16, 2005, 10:11:40 PM
If I may extend shiftLynx's list with a small amount of words...

  • PI
  • e
  • support for complex numbers
  • Arctan, tan, arctanh and tanh
  • Arccos, cos, arccosh and cosh
  • Arcsin, sin, arcsinh and sinh
  • x-th Root (or just y^(1/x))
  • 10^x
  • e^x
  • y^x

A lot of trigonometric functions can be written as function of some powers of e.

Anyway, only do this if you really want to ;) It's a lot of work. I like it now already, you are already very far ^_^


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 16, 2005, 10:51:56 PM
Yeah, lol,. A simple calc isn't as simple as it might sound.. or getting it to work like one isn't... I'll do this one, and when I get the hang of inputing, and all the other stuff to get it to go.. I'll try my hand at a scientific.. :D  :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 17, 2005, 09:11:43 AM
Update:

Added: Better display || Exit on [X] || Ability to sqr a negative || Error support..

Fixed: Positive/Negetive error || Spelling Error on Calc's face

Here it is:
http://members.aol.com/rattrapmax6/fbfiles/calc3.zip

Enjoy! :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Mitth'raw'nuruodo on April 17, 2005, 09:42:37 AM
Hey Neo why not just say make it a scientific calculator?

 
Quote from: "Rattra"
Funny, Algebra never bothered to mention all that on "i",. oh well..  .. Thats a higher math isn't it tho?


Imgainary Numbers? Oooh there so cool, yet I hated them. I learned them last year. Did you take Algebra 2? I learned them in there.


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Zip on April 17, 2005, 06:16:31 PM
It would be nice to be able to use the numeric keypad to enter numbers & operations to the calculator (like mscalc allows). It makes things go much faster.


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 17, 2005, 09:55:49 PM
*grumbles* :lol: j_k

Yeah, that comes later, still some bugs to work out.... Then I'll add the key support.. :wink:

Working on:
Change-able Skins, Errors and bugs (Memory(fixed), Updating display, automated input..)  :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Zip on April 17, 2005, 11:02:04 PM
Are you going to get rid of that ugly title bar at the top of the window to make it look more calculator-like?  :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 17, 2005, 11:05:04 PM
:o What? Its a windows app, besides, how would you remove it anyway? :roll:  :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Zip on April 17, 2005, 11:34:12 PM
I don't know, but some programs do.


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: xteraco on April 18, 2005, 03:04:20 AM
um, wow, thats pretty cool.. can i have the src? :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 18, 2005, 01:00:52 PM
Quote from: "xteraco"
um, wow, thats pretty cool.. can i have the src? :D


It will be open,. but not till I finish it ofcourse.. :wink:

cool now? wait tell you see the one with new skin options.. :D


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 18, 2005, 06:25:37 PM
Update!:

Added: Updating display.. Automated input.. Skins!!!

Fixed: Memory func probs, and heading zero after subtracting to it..

Note: It can't count or do powers (e.i. Press: [1] >
  • > [=] > [=] ect..)

| 805kb |
http://members.aol.com/rattrapmax6/fbfiles/calculator.zip

Enjoy!  :D

Skins
{
Colors
{
Blue
Red
Green
Silver(Org.)
Purple
Pink
}
Textures
{
Sonic/Tales/Knuckles
StarWars: Naboo Planet
Ford GT-40
Lancer Evolution VII
}
}


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: KiZ on April 19, 2005, 11:13:47 AM
Not bad, but one really simple, REALLY effective suggestion -
use txt files for the readmes. noone wants to wait 6-10 secs for word to load up just so they can read something that could just have easily be written as a txt file and opened up and read in 0.2 secs.

Also, I would recommend actually creating a function to change skins, rather than having to copy across the files yourself. Perhaps you could create a skins data file with the names and locations of all the skin files, so that other people could add their own in, and the program would read the file and be able to use the skin.


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 19, 2005, 12:58:08 PM
:o It realy takes that long to load,.. I thought it was just my slow comp.... :roll:

WPs are cleaner,. but I'll switch if its better.. :wink:

Yeah, I'll look into the skin thing.. :wink: .. was thinking that myself, but working more on the bugs atm.. :) .. one left,.... I hope.. :roll:  :lol:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: KiZ on April 19, 2005, 01:08:14 PM
All programmers who knwo their sh1t use txt. It is the all knowing, all encompassing, all platform, universal document type. Nothing beats it.


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 19, 2005, 01:16:03 PM
:lol: right, okay.. no need for quick haste.. :wink:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: KiZ on April 19, 2005, 04:36:34 PM
sorry if I seemed pushy  :P  Im sure many people would agree with me though...


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 19, 2005, 07:09:05 PM
Nah, I think speaking your mind is good done the right way.. :wink: ..

Ah, think I got the answer to the conting bug.. :D .. off I go if there are no more intresting post to read! :lol:


Title: Better Looking Calculator. (File Updated 04/26/05)
Post by: Rattrapmax6 on April 26, 2005, 09:13:16 PM
File Updated,.. go back to first post,.. its there save confusion,.. or getting lost.. :wink: