From ae5d160298d847530f03ec87e54a39d6c9424f37 Mon Sep 17 00:00:00 2001 From: foswret Date: Sun, 22 Jun 2025 09:30:49 -0500 Subject: added execution time --- gui.py | 4 ++-- main.py | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gui.py b/gui.py index 4363279..2a2cdde 100644 --- a/gui.py +++ b/gui.py @@ -14,9 +14,9 @@ GRID_WIDTH = 4 displaySurface = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT), 0, 32) -pygame.display.set_caption('Charlie Chunker GUI Ver. 0.1') +pygame.display.set_caption('tourob GUI') -displaySurface.fill(GRAY) +displaySurface.fill(WHITE) while True: for event in pygame.event.get(): diff --git a/main.py b/main.py index babd758..9da2b37 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,5 @@ +import time + # Constants MAPWIDTH = 4 MAPHEIGHT = 5 @@ -70,8 +72,14 @@ def getShortestPath(courseMap, startPos, endPos): def solveCourse(course, obstacles, checkpoints): for x in range(len(checkpoints) - 1): shortestPath = getShortestPath(course, checkpoints[x], checkpoints[x + 1]) + if x != len(checkpoints) - 2: + del shortestPath[-1] print(shortestPath) populateCourse(courseMap, MAPWIDTH, MAPHEIGHT) +startTime = time.time() solveCourse(courseMap, wallList, checkpointList) +endTime = time.time() +executionTime = endTime - startTime +print("Execution Time: %.4f seconds" % executionTime) -- cgit v1.2.3