Updated result to function

This commit is contained in:
2020-10-29 09:15:05 -04:00
parent 74b4233af0
commit ad458278d4
6 changed files with 32 additions and 25 deletions

View File

@@ -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