mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Updated to work with the new libraries
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
//ProjectEuler/ProjectEulerCPP/headers/Problem.hpp
|
||||
//Matthew Ellison
|
||||
// Created: 07-04-19
|
||||
//Modified: 08-28-20
|
||||
//Modified: 07-02-21
|
||||
//This is an abstract base class to allow polymorphism for the individual problems
|
||||
/*
|
||||
Copyright (C) 2020 Matthew Ellison
|
||||
Copyright (C) 2021 Matthew Ellison
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -19,14 +19,13 @@
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef PROBLEM_HPP
|
||||
#define PROBLEM_HPP
|
||||
|
||||
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "Stopwatch.hpp"
|
||||
#include "mee/Stopwatch.hpp"
|
||||
#include "Unsolved.hpp"
|
||||
|
||||
|
||||
@@ -69,11 +68,16 @@ public:
|
||||
timer.reset();
|
||||
solved = false;
|
||||
}
|
||||
void solvedCheck(std::string str) const{
|
||||
if(!solved){
|
||||
throw new Unsolved("You must solve the problem before you can see the " + str);
|
||||
}
|
||||
}
|
||||
//Pure virtual functions
|
||||
//Solve the problem
|
||||
virtual void solve() = 0;
|
||||
//Return a string with the solution to the problem
|
||||
virtual std::string getResult() = 0;
|
||||
virtual std::string getResult() const = 0;
|
||||
};
|
||||
|
||||
#endif //PROBLEM_HPP
|
||||
|
||||
Reference in New Issue
Block a user