Python Forum

Full Version: turtle begin_fill()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have coded a picture of Bart Simpson using the goto() methods. One of the final setps is to draw the left eye, followed by the right eye. As Python completes the right eye (as you look at Bart), it draws a line across the nose to the left eye (as you look at Bart). I cannot get rid of it. I think I have closed shapes using my co-ordinates, so the fill should finish as I complete the right eye. It is very frustrating.

Be aware, the full code has a yellow head and other features. I am hoping I have successfully shared the code with you using this link: https://trinket.io/python/73b54cc24e

The code for just the eyes is:
#eyeballs left eye
bs.pu()
bs.goto(-30,-10)
bs.pd()
bs.pensize(3)
bs.circle(5)
bs.pu()

#eyeballs - right eye
#eyeballs left eye
bs.pu()
bs.goto(50,-10)
bs.pd()
bs.pensize(3)
bs.circle(5)
bs.pu()
The problem is not with the eyes. They work fine.
Switch lines 116 and 117 so that you do bs.goto(30,-40) before your bs.begin_fill().
Oh my - I have looked and looked at this code! Thank you so much. Very frustrating!
Use input('1') to zoom in on these kinds of errors. I downloaded you code and added an input right after the eyes were drawn and a few others here and there, ran the program and stopped pressing <enter> right after the line appeared. I then knew within a few lines were the problem occurred. And then GOTO beat me to it.
(Aug-18-2020, 08:43 PM)deanhystad Wrote: [ -> ]Use input('1') to zoom in on these kinds of errors. I downloaded you code and added an input right after the eyes were drawn and a few others here and there, ran the program and stopped pressing <enter> right after the line appeared. I then knew within a few lines were the problem occurred. And then GOTO beat me to it.

I did exactly what deanhystad suggests, using an input statement to stop at key points in the code. I just did it slightly earlier than he did. Tongue
(Aug-18-2020, 08:43 PM)deanhystad Wrote: [ -> ]Use input('1') to zoom in on these kinds of errors. I downloaded you code and added an input right after the eyes were drawn and a few others here and there, ran the program and stopped pressing <enter> right after the line appeared. I then knew within a few lines were the problem occurred. And then GOTO beat me to it.