Next / Previous / Contents / TCC Help System / NM Tech homepage

7. Manifest constants

Python does not have constants per se, so we use variables whose names are all capital letters.

mazeratty
# - - - - -   M a n i f e s t   c o n s t a n t s

7.1. Constants for the canvas

These constants regulate the rendering of the maze onto the Tkinter Canvas widget.

7.1.1. CAN_HIGH

Height of the canvas in pixels.

mazeratty
CAN_HIGH = 800

7.1.2. CAN_WIDE

Width of the canvas in pixels.

mazeratty
CAN_WIDE = 800

7.1.3. WALL_THICK

Thickness of (solid) walls in pixels.

mazeratty
WALL_THICK = 1

7.1.4. MARGIN

Specifies the width of a margin of blank pixels around the outside of the maze proper.

mazeratty
MARGIN = 50

7.1.5. PATH_THICK

Thickness of the path as drawn. This may be adjusted downward if the cell size is small.

mazeratty
PATH_THICK = 5

7.1.6. WALL_TAG

Canvas tag for walls.

mazeratty
WALL_TAG = "w"

7.1.7. PATH_TAG

Canvas tag for the solution path.

mazeratty
PATH_TAG = "p"

7.1.8. INFO_TAG

Canvas tag for annotation.

mazeratty
INFO_TAG = "i"

7.2. Colors

7.2.1. WALL_COLOR

Color of the wall as rendered; currently a middle gray.

mazeratty
WALL_COLOR = "#aaa"

7.2.2. START_COLOR

Color of the blob that indicates the starting cell.

mazeratty
START_COLOR = "red"

7.2.3. GOAL_COLOR

Color of the blob that indicates the goal cell.

mazeratty
GOAL_COLOR = "green"

7.2.4. PATH_COLOR

Color of the solution path: a darkish teal.

mazeratty
PATH_COLOR = "#00ddcc"

7.2.5. INFO_COLOR

Color of the text annotation below the maze.

mazeratty
INFO_COLOR = "black"

7.3. Fonts

7.3.1. BUTTON_FONT

Tkinter font for buttons.

mazeratty
BUTTON_FONT = ("Helvetica", 20)

7.3.2. LABEL_FONT

Font for labels on Tkinter controls.

mazeratty
LABEL_FONT = ("Helvetica", 12)

7.3.3. MONO_FONT

Monospaced font for use inside Tkinter Entry widgets.

mazeratty
MONO_FONT = ("DejaVu Sans Mono", 12)

7.3.4. SMALL_FONT

Font for the small annotation line below the maze.

mazeratty
SMALL_FONT = ("Helvetica", 8)