diff --git a/place.py b/place.py index 5411d5c..f597ff5 100644 --- a/place.py +++ b/place.py @@ -1,101 +1,22 @@ -from turtle import * -import random +# draw square in Python Turtle +import turtle -Screen().setup(width=1.0, height=1.0) -speed(0) +t = turtle.Turtle() -fillcolor('#1793d1') -begin_fill() -penup() -sety(-170) -setpos((-640, 512)) -setx(640) -setpos((0, -170)) -end_fill() +s = int(input("Enter the length of the side of the Square: ")) -fillcolor('#d70a53') -begin_fill() -sety(-512) -setx(640) -sety(512) -end_fill() +# drawing first side +t.forward(s) # Forward turtle by s units +t.left(90) # Turn turtle by 90 degree -setx(-640) +# drawing second side +t.forward(s) # Forward turtle by s units +t.left(90) # Turn turtle by 90 degree -fillcolor('#072c61') -begin_fill() -sety(-512) -setx(0) -sety(-170) -end_fill() +# drawing third side +t.forward(s) # Forward turtle by s units +t.left(90) # Turn turtle by 90 degree -fillcolor('#00ff00') -begin_fill() -penup() -sety(-17) -setpos((-64, 5)) -setx(16) -setpos((0, -7)) -end_fill() - -fillcolor('#08fee5') -begin_fill() -circle(23) -end_fill() - -# my code - -forward(20) -right(200) -forward(260) - - -# ------- -------- # -# Nee shooperada! # -#------------------# -pen = Turtle() -pen.color("black") -pen.pensize(3) -pen.speed(10) -pen.hideturtle() -pen.penup() -pen.goto(-500,100) -pen.pendown() -pen.write(" _ _", align="left", font=("monospace", 16, "bold")) -pen.penup() -pen.goto(-500,80) -pen.pendown() -pen.write(" _ __ ___ ___ ___| |__ ___ ___ _ __ ___ _ __ __ _ __| | __ _ ", align="left", font=("monospace", 16, "bold")) -pen.penup() -pen.goto(-500,60) -pen.pendown() -pen.write("| '_ \\ / _ \\ / _ \\ / __| '_ \\ / _ \\ / _ \\| '_ \\ / _ \\ '__/ _` |/ _` |/ _` |", align="left", font=("monospace", 16, "bold")) -pen.penup() -pen.goto(-500,40) -pen.pendown() -pen.write("| | | | __/ __/ \\__ \\ | | | (_) | (_) | |_) | __/ | | (_| | (_| | (_| |", align="left", font=("monospace", 16, "bold")) -pen.penup() -pen.goto(-500,20) -pen.pendown() -pen.write("|_| |_|\\___|\\___| |___/_| |_|\\___/ \\___/| .__/ \\___|_| \\__,_|\\__,_|\\__,_|", align="left", font=("monospace", 16, "bold")) -pen.penup() -pen.goto(-500,0) -pen.pendown() -pen.write(" |_| ", align="left", font=("monospace", 16, "bold")) - -# ------- -------- # -# end # -# nee shooperada # -#------------------# - - -#Ashwin -red =Turtle() - -red.right(1) -red.forward(2) -red.right(2) -red.forward(2) -red.right(2) -red.forward(2) -red.right(2) \ No newline at end of file +# drawing fourth side +t.forward(s) # Forward turtle by s units +t.left(90) # Turn turtle by 90 degree