aboutsummaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorfoswret <foswret@posteo.com>2025-06-22 09:30:49 -0500
committerfoswret <foswret@posteo.com>2025-06-22 09:30:49 -0500
commitae5d160298d847530f03ec87e54a39d6c9424f37 (patch)
tree3485ca57f19ec18437b5b7c49c9c5084e9e9c4f0 /main.py
parent090db6187c2255c68a4d155bf6851b5a4ee91352 (diff)
added execution time
Diffstat (limited to 'main.py')
-rw-r--r--main.py8
1 files changed, 8 insertions, 0 deletions
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)