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.
This commit is contained in:
tsmith37
2025-09-24 22:50:43 -04:00
parent 2fe25e20b8
commit 0619ab9f76
3 changed files with 63 additions and 9 deletions

Binary file not shown.

View File

@@ -5,15 +5,51 @@
# (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
def square(size):
"Draws a square of side length `size`"
for side in range(4):
forward(size)
right(90)
blue_coin(10)
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)
board(400)
def black_row(side_length):
repeat = [1, 2, 3, 4]
for repeat in repeat:
forward(50)
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()
right(90)
forward(50)
right(90)
forward(400)
left(180)
square(50)
forward(50)
black_row(50)
input()
input()

View File

@@ -13,13 +13,14 @@ def square(size):
"Draws a square of side length `size`"
for side in range(4):
forward(size)
left(90)
right(90)
def black_tile(size):
begin_fill()
fillcolor('black')
square(size)
end_fill()
input()
def white_tile(size):
@@ -40,4 +41,21 @@ def blue_coin(size):
begin_fill()
fillcolor('blue')
circle(size)
end_fill()
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()