strange results
I am having a problem with a graphics program that I created. Actually, I don't know if it is the program or a bug in Python. The code for the program is as follows; from gasp import * begin_graphics(width=640, height=480, title='Houses at Night', background=color.BLACK) def draw_house(x, y): a = (x, y + 100) b = (x +50, y +140) c = (x +100, y + 100) Box((x, y), 100, 100, filled=True, color=color.BLUE)# the house Box((x + 35, y), 30, 50, filled=True, color=color.GREEN)# the door Circle((x + 62, y + 16), 1, filled=True, color=color.GOLD) # the door knob Box((x + 20, y + 60), 20, 20, filled=True, color=color.YELLOW)# the left window Line((x + 20, y + 71), (x + 40, y + 71), color=color.ORANGE)# horizontal line (left window) Line((x + 29, y + 60), (x + 29, y + 80), color=color.ORANGE)# vertical line (left window) Box((x + 60, y + 60), 20, 20, filled=True, color=color.YELLOW)# the right window Line((x + 60, y + 71), (x + 80, y + 71), color=color.ORANGE)# horizontal line (right window) Line((x + 69, y + 60), (x + 69, y + 80), color=color.ORANGE)# vertical line (right window) Polygon([a, b, c], filled=True, color=color.RED)# the roof draw_house(20, 20) draw_house(270, 20) draw_house(520, 20) draw_house(145, 180) draw_house(395, 180) draw_house(270, 340) update_when('key_pressed') end_graphics() ends here, but it When I run the program, I do not get any error messages but there are parts of the 'draw_house' function missing on the canvas. Each call to 'draw_house has different things missing, they are not all the exact same. There are some parts that show in one call to 'draw_house' that do not show in others and visa versa. Does anyone have any idea what may be going on? -- http://mail.python.org/mailman/listinfo/python-list
unexpected results
I am having a problem when I run a graphics program that I created. I do not get an error when I run the program, there are just some weird things going on. I do not know if it is the program causing the problem or a bug in Python. Here is the code for the program: from gasp import * begin_graphics(width=640, height=480, title='Houses at Night', background=color.BLACK) def draw_house(x, y):# function for drawing a house a = (x, y + 100)# 'a' coordinate for Polygon b = (x +50, y +140)# 'b' coordinate for Polygon c = (x +100, y + 100)# 'c' coordinate for Polygon Box((x, y), 100, 100, filled=True, color=color.BLUE)# the house Box((x + 35, y), 30, 50, filled=True, color=color.GREEN)# the door Circle((x + 62, y + 16), 1, filled=True, color=color.GOLD) # the door knob Box((x + 20, y + 60), 20, 20, filled=True, color=color.YELLOW)# the left window Line((x + 20, y + 71), (x + 40, y + 71), color=color.ORANGE)# horizontal line (left window) Line((x + 29, y + 60), (x + 29, y + 80), color=color.ORANGE)# vertical line (left window) Box((x + 60, y + 60), 20, 20, filled=True, color=color.YELLOW)# the right window Line((x + 60, y + 71), (x + 80, y + 71), color=color.ORANGE)# horizontal line (right window) Line((x + 69, y + 60), (x + 69, y + 80), color=color.ORANGE)# vertical line (right window) Polygon([a, b, c], filled=True, color=color.RED)# the roof draw_house(20, 20) draw_house(270, 20) draw_house(520, 20) draw_house(145, 180) draw_house(395, 180) draw_house(270, 340) update_when('key_pressed') end_graphics() The program launches just fine, bringing up the gasp window like it should. The problem is that almost all of the calls to 'draw_house' are different. Some features will show up in one house but not in another and visa versa. Does anyone have any idea what the problem may be? -- http://mail.python.org/mailman/listinfo/python-list
Re: unexpected results
Sorry, Everyone. I got an error when posting the first post and did'nt come in to see if it had actually posted before I tried another post. -- http://mail.python.org/mailman/listinfo/python-list
Re: strange results
I took out all of the color commands that were in the shape functions and all of the features to the 'draw_house' function showed showed up. I started putting the color commands back into the shape functions and have no problems with some of them but when I put the color command back into others, some of the features start to disappear. As far as I can see, all of the code is right but I'm just a beginner so I am not for sure. Can anyone tell me why this is doing what it is. -- http://mail.python.org/mailman/listinfo/python-list
Re: strange results
On Sep 17, 1:59 am, Alexander Kapps wrote: > On 17.09.2011 01:09, Fig wrote: > > > I took out all of the color commands that were in the shape functions > > and all of the features to the 'draw_house' function showed showed up. > > I started putting the color commands back into the shape functions and > > have no problems with some of them but when I put the color command > > back into others, some of the features start to disappear. As far as I > > can see, all of the code is right but I'm just a beginner so I am not > > for sure. Can anyone tell me why this is doing what it is. > > Just tried your program on Ubuntu 10.04 with Python 2.6.5 and GASP > 0.3.3 and it worked fine. What OS, Python version and GASP version > are you using? > > If you don't get an answer here, try asking on the Launchpad project > site: > > https://launchpad.net/gasp My OS is Windows 7, Python 2.7.2, I downloaded and installed the python-gasp-0.2.0beta1.win32.exe file, and I also have these installed: Python 2.7 pygame-1.9.2a0 and Python 2.7 pywin32-216 -- http://mail.python.org/mailman/listinfo/python-list