@mvaganov/

shapes2018example

Python (with Turtle)

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.05784468642723084","path":"main.py","file":{"path":"main.py","content":{"asEncoding":{"base64":"ZnJvbSB0dXJ0bGUgaW1wb3J0ICoKIyBpbml0aWFsaXplIHRoZSBUdXJ0bGUKdG9tbXkgPSBUdXJ0bGUoKQp0b21teS5zaGFwZSgidHVydGxlIikKdG9tbXkuc3BlZWQoNSkKIyBpbnN0cnVjdGlvbnMgZm9yIHRoZSB1c2VyCnRvbW15LnBlbnVwKCkKdG9tbXkuY29sb3IoImJsYWNrIikKdG9tbXkuZ290bygwLDEwMCkKdG9tbXkud3JpdGUoIkNoZWNrIG91dCB0aGVzZSBzd2VldCBzaGFwZXMhIiwgTm9uZSwgImNlbnRlciIsICIxNnB0IGJvbGQiKQojIHRyaWFuZ2xlIGxvZ2ljCnRvbW15LmNvbG9yKCIjMDBmZjAwIikKdG9tbXkucGVudXAoKQp0b21teS5nb3RvKDAsNTApCnRvbW15LnBlbmRvd24oKQojIGNvb3JkaW5hdGVzCnRvbW15LmdvdG8oNTAsLTUwKQp0b21teS5nb3RvKC01MCwtNTApCnRvbW15LmdvdG8oMCw1MCkKdG9tbXkucGVudXAoKQojIHNxdWFyZSBsb2dpYwp0b21teS5jb2xvciggKDAsMTUwLDI1NSkgKQp0b21teS5wZW51cCgpCnRvbW15LmdvdG8oMTc1LDUwKQp0b21teS5wZW5kb3duKCkKIyByZWxhdGl2ZSBkaXJlY3Rpb25zCnRvbW15LmJlZ2luX2ZpbGwoKQp0b21teS5yaWdodCg5MCkKdG9tbXkuZm9yd2FyZCgxMDApCnRvbW15LnJpZ2h0KDkwKQp0b21teS5mb3J3YXJkKDEwMCkKdG9tbXkucmlnaHQoOTApCnRvbW15LmZvcndhcmQoMTAwKQp0b21teS5yaWdodCg5MCkKdG9tbXkuZm9yd2FyZCgxMDApCnRvbW15LmVuZF9maWxsKCkKdG9tbXkucGVudXAoKQojIGRvbmUhCnRvbW15LmNvbG9yKCJibGFjayIpCnRvbW15LmdvdG8oMCwtMTUwKQp0b21teS53cml0ZSgiRG9uZSEiLCBOb25lLCAiY2VudGVyIiwgIjE2cHQgYm9sZCIpCnRvbW15LmdvdG8oMCwtMTcwKQo="},"asBuffer":null},"loaded":true}}
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
from turtle import *
# initialize the Turtle
tommy = Turtle()
tommy.shape("turtle")
tommy.speed(5)
# instructions for the user
tommy.penup()
tommy.color("black")
tommy.goto(0,100)
tommy.write("Check out these sweet shapes!", None, "center", "16pt bold")
# triangle logic
tommy.color("#00ff00")
tommy.penup()
tommy.goto(0,50)
tommy.pendown()
# coordinates
tommy.goto(50,-50)
tommy.goto(-50,-50)
tommy.goto(0,50)
tommy.penup()
# square logic
tommy.color( (0,150,255) )
tommy.penup()
tommy.goto(175,50)
tommy.pendown()
# relative directions
tommy.begin_fill()
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.right(90)
tommy.forward(100)
tommy.end_fill()
tommy.penup()
# done!
tommy.color("black")
tommy.goto(0,-150)
tommy.write("Done!", None, "center", "16pt bold")
tommy.goto(0,-170)
result
console