This section imports necessary functions and defines constant # values used for creating the drawing canvas. You should NOT change # any of the code in this section. # # Import standard Python modules...

This section imports necessary functions and defines constant # values used for creating the drawing canvas. You should NOT change # any of the code in this section. # # Import standard Python modules needed to complete this assignment. # You should not need to use any other modules for your solution. # In particular, your solution must NOT rely on any non-standard # Python modules that need to be downloaded and installed separately, # because the markers will not have access to such modules. from turtle import * from math import * from random import * from sys import exit as abort from os.path import isfile # Define constant values used in the main program that sets up # the drawing canvas. Do not change any of these values unless # instructed. cell_size = 100 # pixels (default is 100) grid_width = 9 # squares (default is 9) grid_height = 7 # squares (default is 7) x_margin = cell_size * 2.75 # pixels, the size of the margin left/right of the grid y_margin = cell_size // 2 # pixels, the size of the margin below/above the grid window_height = grid_height * cell_size + y_margin * 2 window_width = grid_width * cell_size + x_margin * 2 small_font = ('Arial', cell_size // 5, 'normal') # font for the coords big_font = ('Arial', cell_size // 4, 'normal') # font for any other text # Validity checks on grid size - do not change this code assert cell_size >= 80, 'Cells must be at least 80x80 pixels in size' assert grid_width >= 8, 'Grid must be at least 8 squares wide' assert grid_height >= 6, 'Grid must be at least 6 squares high'
Nov 24, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here