Omnimaga

General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Scipi on February 27, 2014, 10:38:39 pm

Title: Quadratic Burd Solver
Post by: Scipi on February 27, 2014, 10:38:39 pm
Does your teacher hate it when you play Flappy Bird because you are not doing enough work?
Ever wish you could do your math homework while playing your favorite handheld game?
Ever feel solving quadratic equations is just too easy and boring?

Well look no further than the Quadratic Burd Solver.

Using the latest Quantum Technology, I have merged together both a Flappy Bird clone and a Quadratic Solver.

Score points to set your A, B and C variables.

Die three times to see your answer.

Supports imaginary values, because we all have ADHD and imaginary things are just SO much better :D

(Disclaimer, graphics are in progress)

Jokes aside, some known issues so far:

-You do not yet die when you go above or below the map
-Graphics are barebones
-Acceleration is a work in progress (if someone could supply me with getting the physics nailed down, that's be amazing)


So what are you waiting for? Download today and solve all your Flappy Bird and Quadratic needs!
Title: Re: Quadratic Burd Solver
Post by: DJ Omnimaga on February 27, 2014, 11:03:49 pm
Lol, now someone should do this for calcs. :P
Title: Re: Quadratic Burd Solver
Post by: Scipi on February 27, 2014, 11:05:37 pm
I would have done it, but I don't know enough with Z80 or Axe.

Can do it for the Nspire, though.
Title: Re: Quadratic Burd Solver
Post by: aeTIos on February 28, 2014, 12:24:09 am
My life... It's complete.
Title: Re: Quadratic Burd Solver
Post by: DJ Omnimaga on February 28, 2014, 12:47:11 am
How to run it btw? I get "A java exception error has occured" ???
Title: Re: Quadratic Burd Solver
Post by: ben_g on February 28, 2014, 03:26:38 am
How to run it btw? I get "A java exception error has occured" ???
Unzip it before running. Then it should work.
Title: Re: Quadratic Burd Solver
Post by: Streetwalrus on February 28, 2014, 04:43:15 am
ROFL this is totally awesome. XD
Title: Re: Quadratic Burd Solver
Post by: Sorunome on February 28, 2014, 08:30:41 am
What if you want to set one of the vars a negative value :P
Title: Re: Quadratic Burd Solver
Post by: Scipi on February 28, 2014, 10:15:40 am
What if you want to set one of the vars a negative value :P

I'm probably going to have a flag to where you start going in reverse.

If I wanted to be REALLY evil, I'd do it as the difference between your score and high score :P

Edit:
How to run it btw? I get "A java exception error has occured" ???

You need to make sure you run the jar with all the contents of the zip file extracted. It needs both the lib folder and res.
Title: Re: Quadratic Burd Solver
Post by: JWinslow23 on February 28, 2014, 12:11:43 pm
Genius! :D
Now, if only it prompted you "Positive or Negative?" in the beginning of each round and "Is this value correct?" at the end... ^-^
-Acceleration is a work in progress (if someone could supply me with getting the physics nailed down, that's be amazing)
Pseudocode I used for my game (assuming Y_Pos=0 is on the top):
Code: [Select]
Y_Pos = 0
Accel_Value = 0
bool Bird_Is_Flying = false
Repeat (collision(bird,pipe)) or (quit_game = true) or (Y_Pos < 0) or (Y_Pos > (max_y_pos))
//Replace (max_y_pos) with an actual maximum y position, i.e. the minimum y-value needed in order for the bird not to be visible
   If Bird_Is_Flying = true
      Y_Pos = Y_Pos - Accel_Value
      Accel_Value = Accel_Value - (constant1)
      //Replace (constant) with any constant, tweak to taste (and it must be bigger than (constant2) shown later)
      If Accel_Value <= 0
      //Less than or equal to 0
            Accel_Value = 0
            Bird_Is_Flying = false
      EndIf
   Else
      Y_Pos = Y_Pos + Accel_Value
      Accel_Value = Accel_Value + (constant2)
      //Replace (constant) with any constant, tweak to taste (and it must be smaller than (constant1) shown earlier)
   EndIf
   If (flap_button_pressed = true) and (flap_button_held = false)
   //Debounce it, or else you would fly higher than expected
      Bird_Is_Flying = true
      Accel_Value = (constant3)
      //(constant3) must be WAY bigger than the other two constants; the bigger it is, the higher the jump
   EndIf

//drawing, scrolling, and other stuff here

EndRepeat

//dying code goes here
Hope it helps!
Lol, now someone should do this for calcs. :P
If I could only get a quad solver for Axe, I'd already be ahead of everyone...
Title: Re: Quadratic Burd Solver
Post by: Scipi on February 28, 2014, 12:17:01 pm
I'll take a look and refactor my code later on. Thanks ^_^

Why do you need a quadratic solver? The equation is simple enough.

Code: [Select]
private static void quadEqu(){
    results = new String[2];
    if(b*b - 4 * a * c >= 0){
results[0] = "" + (float)(-b + Math.sqrt(b*b - 4 * a * c))/(2*a);
results[1] = "" + (float)(-b - Math.sqrt(b*b - 4 * a * c))/(2*a);
    }else{
negRoot = true;
results[0] = "" + (float)-b/(2*a) + " + " + (float)Math.sqrt(Math.abs(b*b - 4 * a * c))/(2*a) + "i";
results[1] = "" + (float)-b/(2*a) + " - " + (float)Math.sqrt(Math.abs(b*b - 4 * a * c))/(2*a) + "i";
    }
}
Title: Re: Quadratic Burd Solver
Post by: JWinslow23 on February 28, 2014, 12:25:50 pm
I'll take a look and refactor my code later on. Thanks ^_^
Thank you for considering. It works perfectly on my calc; it should work for you, too. ;)
Why do you need a quadratic solver? The equation is simple enough.
Floating point numbers in Axe Parser is not supported. :P I know how to do one; I just need help with actually "supporting" floating points (it's not possible in pure Axe). Otherwise, I got the game engine down if I wanna do it on-calc.
EDIT: Found a solution! It'll be in development soon.
Title: Re: Quadratic Burd Solver
Post by: Joshuasm32 on March 01, 2014, 02:54:23 am
The creator of FlappyBird removed it from the app stores, but a JS version of the game (with an HTML5 canvas) is still up on his web site at flappybird.nl - maybe the source code could help you with the graphics and such, considering that JS is pretty similar to Java or C++...