@EdgarArcia/

Turtle 1-2

Python (with Turtle)

No description

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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# The following code creates a square of different colors
#

import turtle

t = turtle.Turtle()

for c in ['red', 'green', 'yellow', 'blue']:
    t.color(c)
    t.forward(75)
    t.left(90)

t.penup()
t.goto(1,1)
t.pendown()
for a in ['green', 'yellow', 'blue', 'red']:
    t.color(a)
    t.forward(70)
    t.left(90)
   
t.penup()
t.goto
t.pen()
for a in ['yellow', 'blue', 'red', 'green']:
    t.color(a)
    t.forward(65)
    t.left(90)
t.penup()
t.goto
t.pen()
for a in ['blue', 'red', 'green', 'yellow']:
    t.color(a)
    t.forward(60)
    t.left(90)
t.penup()
t.goto
t.pen()
for c in ['red', 'green', 'yellow', 'blue']:
    t.color(c)
    t.forward(55)
    t.left(90)
t.penup()
t.goto
t.pen()
for a in ['green', 'yellow', 'blue', 'red']:
    t.color(a)
    t.forward(50)
    t.left(90)
   
t.penup()
t.goto
t.pen()
for a in ['yellow', 'blue', 'red', 'green']:
    t.color(a)
    t.forward(45)
    t.left(90)
t.penup()
t.goto
t.pen()
for a in ['blue', 'red', 'green', 'yellow']:
    t.color(a)
    t.forward(40)
    t.left(90)
t.penup()
t.goto
t.pen()
for c in ['red', 'green', 'yellow', 'blue']:
    t.color(c)
    t.forward(35)
    t.left(90)
t.penup()
t.goto
t.pen()
for a in ['green', 'yellow', 'blue', 'red']:
    t.color(a)
    t.forward(30)
    t.left(90)
   

# Write a program that creates 10 squares of different colors, each one 
# inside of the others, alternating the color of the sides
#
result
console