First milestone is done

I finished writing the code for the checker board, the tiles on it, and the playing coins.
This part was pretty simple i was just making all the shapes i would need for the board game.
Something I figured out how to do was fill in color to what I draw.
This commit is contained in:
tsmith37
2025-09-23 14:31:54 -04:00
parent 1bad6ca566
commit 2fe25e20b8
3 changed files with 55 additions and 0 deletions

Binary file not shown.

View File

@@ -5,3 +5,15 @@
# (Briefly describe what this program does.)
from turtle import *
from shapes import board
from shapes import black_tile
from shapes import white_tile
from shapes import red_coin
from shapes import blue_coin
blue_coin(10)
input()

43
shapes.py Normal file
View File

@@ -0,0 +1,43 @@
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)
left(90)
def black_tile(size):
begin_fill()
fillcolor('black')
square(size)
end_fill()
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()