mirror of
https://bitbucket.org/Mattrixwv/projecteulercs.git
synced 2025-12-07 01:33:58 -05:00
Added start of project
This commit is contained in:
38
src/Problems/Problem.cs
Normal file
38
src/Problems/Problem.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
//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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user