-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpracticetest.py
57 lines (52 loc) · 1.15 KB
/
practicetest.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#Turtle Art Drawing Practice Test
#November 24, 2016
#Import Area---
import turtle
import random
#--------------
#Variables----------------
length = (25)
hexturn = (60)
move = (length*1.75)
turn = (90)
notimes = (2)
michael = turtle.Turtle()
#--------------------------
def wholefunction(michael):
michael.left(turn)
for i in range(notimes):
for i in range(4):
turtle.colormode(255)
r = random.randint(0,255)
g = random.randint(0,255)
b = random.randint(0,255)
michael.color(r,g,b)
michael.begin_fill()
for i in range(6):
michael.forward(length)
michael.right(hexturn)
michael.end_fill()
turtle.colormode(255)
r = random.randint(0,255)
g = random.randint(0,255)
b = random.randint(0,255)
michael.color(r,g,b)
for i in range(6):
michael.forward(length)
michael.right(hexturn)
michael.pu()
michael.right(turn)
michael.forward(move)
michael.left(turn)
michael.pd()
michael.pu()
michael.left(turn)
michael.forward(move*4)
michael.left(30)
michael.forward(length)
michael.left(hexturn)
michael.forward(length)
michael.right(180)
michael.pd()
wholefunction(michael)
turtle.done()