Last active
March 29, 2019 20:13
-
-
Save bdemeshev/209aa0385278e37f8947590abbb023dc to your computer and use it in GitHub Desktop.
[Черепашка рисует фрактал] #code #math
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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