repl.it
@jessenaomi1/

jesse23-1

Python (with Turtle)

jesseamaya

fork
loading
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#inspired by Brad Miller's illustration for how to think like a 
#computer scientist:
#http://interactivepython.org/runestone/static/thinkcspy/index.html

import turtle
from myturtles import Myturtles, create_turtles, move_turtles, writer

number_of_turtles = 10

screen = turtle.Screen()

def draw_shape(x, y, n = 20, clear = True):
	if clear:
		writer.clear()
	screen.tracer(0)
	# for turtle in screen.turtles():
	# 	turtle.penup()
	# 	turtle.goto(x,y)
	# 	turtle.pendown()
	screen.tracer(1)
	for i in range(n):
		screen.tracer(0)
		move_turtle(screen)
		screen.tracer(1)

# create_turtles(screen, number_of_turtles)

draw_shape(0,-150, clear = False)

screen.onclick(draw_shape)

screen.listen()
turtle.done()
result
console
?