Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
turtle begin_fill()
#1
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()
Reply
#2
The problem is not with the eyes. They work fine.
Reply
#3
Switch lines 116 and 117 so that you do bs.goto(30,-40) before your bs.begin_fill().
Reply
#4
Oh my - I have looked and looked at this code! Thank you so much. Very frustrating!
Reply
#5
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.
Reply
#6
(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
Reply
#7
(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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  wn = turtle.screen() AttributeError: module 'turtle' has no attribute 'screen' Shadower 1 4,136 Feb-06-2019, 01:25 AM
Last Post: woooee
  Help! Turtle not working, even when we click the turtle demo in IDLE nothing happens. BertyBee 3 2,726 Jan-04-2019, 02:44 AM
Last Post: SheeppOSU

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020