Files
project_drawing/shapes.py
tsmith37 0619ab9f76 start to put the shapes together
something i figured out was that i need to save my progress more often. I get close to
finishing the game but then i forget the changes i made and end up back at my last saved
point. Im also going to try and build the whole code then simplify it, seems to be easier
for me.
2025-09-24 22:50:43 -04:00

62 lines
1.0 KiB
Python

from turtle import *
def board(side_length):
"Out line of the board"
sides = [side_length, side_length, side_length, side_length]
for sides in sides:
pensize(4)
forward(sides)
right(90)
def square(size):
"Draws a square of side length `size`"
for side in range(4):
forward(size)
right(90)
def black_tile(size):
begin_fill()
fillcolor('black')
square(size)
end_fill()
input()
def white_tile(size):
begin_fill()
fillcolor('white')
square(size)
end_fill()
def red_coin(size):
begin_fill()
fillcolor('red')
circle(size)
end_fill()
def blue_coin(size):
begin_fill()
fillcolor('blue')
circle(size)
end_fill()
def black_row(size):
repeat = [1, 2, 3, 4]
for repeat in repeat:
forward(size)
right(90)
sizes = [50,50,50,50]
for size in sizes:
begin_fill()
fillcolor('black')
black_row(size)
end_fill()
penup()
forward(size * 2)
pendown()
input()