Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions minewalker.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __init__(self):
self.minePos = []
self.scanChar = "*"
self.powerups = 0
self.count = 0
self.score = 0


Expand Down Expand Up @@ -168,15 +169,15 @@ def verify_path(self):
# Function to calculate score
def calculate_score(self):
timeTaken = int(time.time() - self.startTime)
score = 1000
score = score * self.nMines^2
score += self.length*1.5
score -= timeTaken*1000
score = 0
score += self.count
score -= timeTaken*(1/10)
score += self.powerups *15
self.restrict(score,0,1000000000)
self.score = score
return score


# Checks current game state using player position
def game_state(self):

Expand Down