Re: [Tutor] Random equation generator

2008-12-06 Thread TexasJerky100
I think this maybe will work out. I might have to just go with the generalized form as you suggest and forget about the random aspect. In a message dated 12/6/2008 10:05:16 A.M. Central Standard Time, [EMAIL PROTECTED] writes: Please use the reply-all button when responding, so tha

Re: [Tutor] Random equation generator

2008-12-06 Thread Rich Lovely
Please use the reply-all button when responding, so that your message gets sent to the list as well. If that's the sort of equation you're after, than the easiest way would probably to decide on a generalised form: y=(2x-1)*4x y = 4*x**2 - 4x y=2+5(x-1) y = 5*x - 3 y=(2x+5)+(5x-25) y =

Re: [Tutor] Random equation generator

2008-12-06 Thread Paul McGuire
I would say, though, that you should be careful in your implementation of is_on_line, for floating point round-off errors. Try this at the command prompt (Python 2.5.2, with __future__ division imported): >>> 49 * (1/49) == 1 False >>> 1 - 49 * (1/49) 1.1102230246251565e-016 I would suggest a sl

Re: [Tutor] Random equation generator

2008-12-05 Thread Rich Lovely
When you say linear, I'm assuming fitting y=mx+c, and passing through points? The line through points (x1, y1) and (x2,y2) is y - y1 = (y2-y1) / (x2-x1) * (x-x1) That multiplies out to: y = (y2-y1)/(x2-x1) * x - (y2-y1)/(x2-x1) + y1 That gives m = (y2-y1)/(x2-x1) and c = y1 - (y2-y1)/(x2-x1

Re: [Tutor] random equation generator

2008-10-23 Thread W W
www.google.com/search?q=pygtk+tutorial www.google.com/search?q=python+random+generator www.google.com/search?q=python+dict If you would like to develop the game, you should first try to develop the game, and then ask when you get stuck. If you can't figure out how to get a user to guess between o