mirror of
https://bitbucket.org/Mattrixwv/projecteulerpython.git
synced 2025-12-06 17:43:58 -05:00
Updated result to function
This commit is contained in:
@@ -33,7 +33,6 @@ class Problem(metaclass=abc.ABCMeta):
|
||||
def __init__(self, description: str):
|
||||
#Instance variables
|
||||
self.timer = Stopwatch()
|
||||
self.result = ""
|
||||
self.description = description
|
||||
self.solved = False
|
||||
#Gets
|
||||
@@ -41,11 +40,9 @@ class Problem(metaclass=abc.ABCMeta):
|
||||
def getDescription(self) -> str:
|
||||
return self.description
|
||||
#Returns the result of solving the problem
|
||||
@abc.abstractmethod
|
||||
def getResult(self) -> str:
|
||||
#If the problem hasn't been solved throw an exception
|
||||
if(not self.solved):
|
||||
raise Unsolved("You must solve the problem before you can see the result")
|
||||
return self.result
|
||||
pass
|
||||
#Returns the time taken to run the problem as a string
|
||||
def getTime(self) -> str:
|
||||
#If the problem hasn't been solved throw an exception
|
||||
|
||||
Reference in New Issue
Block a user