Giter Club home page Giter Club logo

Comments (4)

takluyver avatar takluyver commented on August 23, 2024

I think it's this line that decides when it has reached one point, so that it can go onto the next. You're probably running into floating point issues. Maybe it needs to check with a tolerance.

from mobilechelonian.

t3rodrig avatar t3rodrig commented on August 23, 2024

I have the same problem:

bob = Turtle()
n = 7
ang = round(360/n, 1)
ds = 50
for i in range(2):
    bob.forward(ds)
    bob.left(ang)

does not work properly. The angle has just 1 decimal number, but the turtle does not draw the second line.

from mobilechelonian.

takluyver avatar takluyver commented on August 23, 2024

I think the turtle's angle changes in steps, and it overshoots the correct angle and then gets stuck turning one degree left and one degree right. Here's the code for that:

https://github.com/takluyver/mobilechelonian/blob/0.5/mobilechelonian/mobilechelonianjs/turtlewidget.js#L232-L248

Pull requests welcome :-)

from mobilechelonian.

 avatar commented on August 23, 2024

I would like to speed up drawing circle
I use speed(10) method but not work.
As I know, drawing circle is using n-side line to finish this job
speed method only can help line section.
why?

from mobilechelonian.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.