-
Notifications
You must be signed in to change notification settings - Fork 0
/
chessboard.py
50 lines (41 loc) · 866 Bytes
/
chessboard.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
import turtle
from turtle import *
t= Turtle()
t.speed(0)
t.hideturtle()
def square():
for i in range(4):
t.forward(20)
t.left(90)
t.goto(-75,0)
y=0
for i in range(8):
if i%2==0:
for j in range(8):
if j%2==0:
t.begin_fill()
t.fillcolor("black")
square()
t.end_fill()
else:
square()
t.forward(20)
else:
for j in range(8):
if j%2!=0:
t.begin_fill()
t.fillcolor("black")
square()
t.end_fill()
else:
square()
t.forward(20)
y+=20
t.penup()
t.goto(-75,y)
t.pendown()
t.penup()
t.goto(0, y+40)
t.pendown()
t.write("yeah bro Done!", align="center", font= 40)
turtle.done()