Nurta, you should program something really wierd to happen if you divide by 0, like flash 100 pics in 1 sec or make a wormhole thingy, that would be sweet!
This is good, but for the next release, I have some ideas:
A ^ button for doing exponents
Making a shortcut to = with like, play/pause or something
Have the back button be the delete or clear (when tapped, it doesn't exit the app)
Perhaps cos, sin, and tan?
( and ) (I mean the parentheses)
etc., etc.
Thank you for making this, but I don't think I will use it very often, because I have Alg. II and then Pre Calc next year, and this is really basic.
The new version is much better, well done!
In the future maybe you can decrease lag and the highlighted buttons.
I also agree that when someone tried to divide by zero a wormhole is created showing the credits.
This is good, but for the next release, I have some ideas:
A ^ button for doing exponents
doable
Quote:
Making a shortcut to = with like, play/pause or something
it already is
Quote:
Have the back button be the delete or clear (when tapped, it doesn't exit the app)
yeah, jsut have to figure out how to do it exactly
Quote:
Perhaps cos, sin, and tan?
do-able, I'll probably add in a menus system (constants, trig, exponents, etc)
Quote:
( and ) (I mean the parentheses)
etc., etc.
That's a little more work, I'd have to put in order of ops and stuff
Although I already have a system for this in Java, C# isn't too different, maybe I can copy paste and modify significantly
Quote:
Originally Posted by mojo
The new version is much better, well done!
In the future maybe you can decrease lag and the highlighted buttons.
I also agree that when someone tried to divide by zero a wormhole is created showing the credits.
the lag is actually programmed in, since at first you'd hit right and it would go right 5 times even if you do it fast. I'll play with the numbers some
if (gps.Buttons.Back == ButtonState.Pressed)
this.Exit();
yeah, that says if the button is pressed exit, it doesn't say if button is held for X seconds exit but if for less than that, backspace
I'll probably just have it if button is pressed, start timer while(button is pressed) do nothing, on un pressing end timer, if timer.time>X do this, otherwise do this.
I knew I'd have to do it there, I'm not an idiot, just have to look up the easiest way to do a timer and stuff.
Here's a skin I made for the calculator. Download the two images below (right click and save as) and replace them with the two image files of the same name found in the content folder.
calc shell.png:
blank.png: <--there is an image there
I can do other colors by request.
__________________
Last edited by bjmiller121; 05-11-2008 at 07:21 PM.
the lag is actually programmed in, since at first you'd hit right and it would go right 5 times even if you do it fast. I'll play with the numbers some
Theres an easy way to have it only do the button action once.
Declare a boolean and set it to false
Code:
bool i = false;
then when you have this code
Code:
if (GamePad.GetState(PlayerIndex.One).DPad.**** == buttonState.Pressed)
change it to
Code:
if (!i && GamePad.GetState(PlayerIndex.One).DPad.**** == buttonState.Pressed)
Then in the same block of code add
Code:
i = true;
and lastly make another block of code for
Code:
if (GamePad.GetState(PlayerIndex.One).DPad.**** == buttonState.Released)
Yea im in the process of making solitaire and i was stumped for an hour trying to figure out how to only make it move 1 space instead of a random number
if your looking for an easy way to make a calculator the best advice i can give is take a look at the shunting yard algorithm (check wiki)
this is a infix to postfix converter (which should be about 30 lines of code if done properly with functions), its just a matter of setting up operand precdence as well having good knowledge on stacks and knowning when to push and when to pop. once you have it in postfix, a simple postfix parser can easily compute the equation. the beauty with SYA algorithm once you convert, order of operators is basically removed and so are brackets,