Questions tagged [turtle-graphics]

A method for drawing computer graphics using a cursor, known as a turtle. Turtle-graphics supports game development, visualizations, animation, etc.

A method for drawing graphics, which uses a cursor (known as a turtle) for specifying the position, the direction and the attributes (color, line width, etc.) of the lines being drawn. It was popularized by the Logo programming language. Similar functionality can currently be found in Python's turtle module, which is part of its standard library.

The turtle runs commands sent to it sequentially, including moving forwards or backwards, turning/rotating, and raising or lowering "the pen" determining if the turtle is currently drawing a line while moving. This output pathway of the turtle can additionally be post-processed into 3-dimensional models. Depending upon the implementation, the turtle may traverse 2D, 3D, or N-dimensional coordinate spaces.

3188 questions
5
votes
1 answer

How do you use ColabTurtle?

Although I know I can install ColabTurtle to use Turtle on a Colab Notebook, I cannot figure out how. Could someone please give me an example on how to run Turtle codes on Colab?
midicool
  • 53
  • 1
  • 3
5
votes
1 answer

Drawing this pattern using Python’s turtle module. Some squares on top of each other but tilted sort of like a spiral

I’m new to programming and I’m reading a book called How To Think Like A Computer Scientist. In the fourth chapter, it talks about functions. At the end of the chapter, there’s an exercise that asks me to draw the following pattern using Python’s…
Gabriel Sales
  • 100
  • 3
  • 8
5
votes
2 answers

How to fix inconsistent frame rate (speed) in python turtle

I a made pong game by following this tutorial https://youtu.be/C6jJg9Zan7w The problem I'm having is that speed of the ball (turtle object) is not the same on different computers. For example, on the tutorial instructor's computer the value of…
Saadat
  • 163
  • 4
  • 15
5
votes
2 answers

Don't understand this AttributeError: module 'turtle' has no attribute 'Turtle'

#archimedes spiral by rays import math import turtle def spiral(t, a, b): diff=5 number=500 for i in range(number): t.penup() t.fd(a+b*i*diff*math.pi/180) t.pendown() t.lt(90) t.fd(10) …
Manish Kumar
  • 135
  • 1
  • 1
  • 8
5
votes
1 answer

Python Turtle how to draw a marker inside a cell in a 7x7 grid

I'm new to using Turtle graphics in Python 3, and I'm at a loss on what to do. One of my problems is that I have no idea where to begin with creating a function that will draw a marker inside of a grid cell based on a data set called 'path'…
Listerbean
  • 53
  • 4
5
votes
1 answer

Determine the window size turtle python setup

In Python 3+, I am trying to run turtle.setup(400, 500) but it is not working. There is no reference named setup. How can I use the screen setup in Python 3?
Mamunur Rashid
  • 1,095
  • 17
  • 28
5
votes
1 answer

Integrate turtle module with tkinter canvas

I am trying to integrate the Turtle module into an interface I have created with TKInter, currently I have a canvas where I would like for the turtle to draw to (see example 1). However I am lost in how to get the draw to it.
E J
  • 81
  • 1
  • 1
  • 6
5
votes
3 answers

How to move multiple turtles at the same time?

I have an assignment which is asked to set two turtles in a race track (same size but separate track). I am able to make them move, but the second one moves only when the first one moved a half of the track. I'm not sure how to make the turtles move…
CodeLearner
  • 51
  • 1
  • 1
  • 2
5
votes
1 answer

Python turtle stamp mysteriously disappears after turtle shape's image manipulation

Orientation: I have created the following functions to allow the user to change the turtle to an image of the his/her choosing and then stamp it to the canvas at any point: def TurtleShape(): try: # Tkinter buttons related to turtle…
R. Kap
  • 599
  • 1
  • 10
  • 33
5
votes
5 answers

Are there any open source/free LOGO implementations that support dynaturtles?

I'm looking for an implementation of the LOGO programming language that supports 'dynaturtles' - animated turtles that can programmatically change shape, speed and direction as well as detect collisions with each other or other objects in the…
feoh
  • 1,281
  • 1
  • 14
  • 19
5
votes
6 answers

Use Python turtle to make circles wtihout the circle function

I have this assignment for school: Build a Snowman without turtle circle function The snowman should be on a blue background, and should be drawn filled with white. The outline of the snowman should be in black. The snowman’s body should be made of…
Quinn
  • 51
  • 1
  • 1
  • 3
5
votes
3 answers

Set no animation in Turtle - Python 3.4?

The code below creates a fractal tree. I want to draw it as quick as possible -- I don't want any animation to occur, otherwise it takes a long time to draw. In earlier versions of python, this is achieved with turtle.speed(0), as shown below. This…
Lillz
  • 283
  • 2
  • 5
  • 19
5
votes
4 answers

Python Turtle: Draw concentric circles using circle() method

I was showing a grandson patterns drawn with Python's Turtle module, and he asked to see concentric circles. I thought it would be faster to use the turtle's circle() to draw them than to write my own code for generating a circle. Ha! I am stuck. I…
thelma
  • 193
  • 1
  • 1
  • 8
5
votes
1 answer

Find the cursor's current position in Python turtle

How can I find the current mouse position in Python that can be integrated into turtle? I would prefer if you did not use any non-builtin modules (downloadable modules) Any answers would be appreciated
ndurvasula
  • 185
  • 5
  • 18
5
votes
7 answers

Python Turtle Opacity?

Just wondering, is it possible to make a turtle draw/fill with semi-transparent ink? Something like: turtle.setfillopacity(50) # Would set it to 50% transparency Running python 2.7
Brennan Wilkes
  • 213
  • 3
  • 4
  • 13