mirror of
https://bitbucket.org/Mattrixwv/projecteulercs.git
synced 2025-12-06 17:23:57 -05:00
39 lines
1023 B
C#
39 lines
1023 B
C#
//ProjectEuler/ProjectEulerCS/src/Problems/Problem.cs
|
|
//Matthew Ellison
|
|
// Created: 08-14-20
|
|
//Modified: 08-14-20
|
|
//This is the base class for the rest of the problems
|
|
|
|
|
|
namespace mee{
|
|
public abstract class Problem{
|
|
//Variables
|
|
//Instance variables
|
|
//protected const Stopwatch timer = new Stopwatch(); //To time how long it takes to run the algorithm
|
|
protected string _result = null; //Holds the results of the problem
|
|
public string result{
|
|
get{ return _result; }
|
|
}
|
|
protected readonly string _description; //Holds the description of the problem
|
|
public string description{
|
|
get{ return _description; }
|
|
}
|
|
protected bool solved; //Shows whether the problem has already been solved
|
|
|
|
//Constructor
|
|
public Problem(string description){
|
|
this._description = description;
|
|
}
|
|
|
|
//Operations functions
|
|
//Solve the problem
|
|
public abstract void solve();
|
|
//Reset the problem so it can be run again
|
|
public virtual void reset(){
|
|
//timer.reset();
|
|
solved = false;
|
|
_result = null;
|
|
}
|
|
}
|
|
}
|