birthdayboy224Lvl 2
- Windows
A puzzle game where the answer is to press a keyboard button, but there's a puzzle that solves nothing.
A puzzle game where the answer is to press a keyboard button, but there's a puzzle that solves nothing.
How about something simple. Create a program which solves for all the zeros of a quadratic polynomial given the coeffecients. If you want a WAY harder challenge, try writing one for an n-degree polynomial.
DragonFireGames What? Time to do some mega google searching.
Captain_Jack_Sparrow I googled it and still have no idea what you are talking about.
Captain_Jack_Sparrow Try something like this:
print("enter the coeffecients of a polynomial of the form ax^2 + bx + c")
a = float(input("coeffecient a: "))
b = float(input("coeffecient b: "))
c = float(input("coeffecient c: "))
# Do math
# Print zeros of the polynomial
Here is an example:
2x2+16x+30
in this case, you can find the zeros by doing the following:
2x2-16x+30 = 0
2(x2-8x+15) = 0
2(x-5)(x-3) = 0
x-5 = 0
x = 5
x-3 = 0
x = 3
Therefore, if I input 2, 16, 30 as a, b, c respectively into your program it should print 5 & 3
DragonFireGames
isn't that just... quadratic formula?
ackvonhuelio shh... let him cook
FINALLY! I did it! I am now learning PyGame!
Captain_Jack_Sparrow Sorry that it took so long, I was trying (and failing) to figure out this Tkinter module
Captain_Jack_Sparrow
you need to replace the two instances of (-b+2)
with (-b+t)
for it to work properly