Skip to content

Instantly share code, notes, and snippets.

@bdemeshev
Last active March 29, 2019 20:13
Show Gist options
  • Save bdemeshev/209aa0385278e37f8947590abbb023dc to your computer and use it in GitHub Desktop.
Save bdemeshev/209aa0385278e37f8947590abbb023dc to your computer and use it in GitHub Desktop.
[Черепашка рисует фрактал] #code #math
import turtle
import tkinter as tk
scale = 0.05 # choose 1, 0.05
power = 1 # nice one: 1, 0.9, 2, 0.8
root = tk.Tk()
canvas = tk.Canvas(master=root, width=2000, height=1500)
canvas.pack()
t = turtle.RawTurtle(canvas)
t.speed(speed=0) # 0 = fastest
for i in range(10000000):
t.forward(scale * i)
t.right(i**power)
from turtle import *
scale = 0.05 # choose 1, 0.05
power = 1 # nice one: 1, 0.9, 2, 0.8
speed(0) # 0 = fastest
for i in range(10000000):
forward(scale * i)
right(i**power)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment