turtle circle drawing
from turtle import *
screensize(canvwidth=200,canvheight=200)
speed("fastest")
hideturtle()
for i in range(10):
for j in range(10):
if i % 2 ==0 and j%2 ==0:
fillcolor("green")
elif i % 2 == 0 and j%2 ==1:
fillcolor("yellow")
elif i % 2 == 1 and j%2 ==0:
fillcolor("pink")
elif i % 2 == 1 and j%2 ==1:
fillcolor("blue")
up()
setx(i*20)
sety(j*20)
down()
begin_fill()
circle(10)
end_fill()
コメント
コメントを投稿