mirror of
https://bitbucket.org/Mattrixwv/projecteulercpp.git
synced 2025-12-06 17:13:59 -05:00
Refactored to make benchmark part of the main program
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -8,9 +8,9 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include "benchmark.hpp"
|
||||
#include "Algorithms.hpp"
|
||||
#include "Headers/Problem.hpp"
|
||||
#include "Problems.hpp"
|
||||
#include "ProblemSelection.hpp"
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ unsigned int getProblemNumber(); //A helper function to error check the problem
|
||||
void listProblems(); //Lists the problem numbers that you can choose
|
||||
|
||||
//Setup the menu options
|
||||
enum MenuOptions {SOLVE = 1, DESCRIPTION, LIST, EXIT, SIZE};
|
||||
enum MenuOptions {SOLVE = 1, DESCRIPTION, LIST, BENCHMARK, EXIT, SIZE};
|
||||
|
||||
int main(){
|
||||
int selection = 0; //Holds the menu selection of the user
|
||||
@@ -37,10 +37,11 @@ int main(){
|
||||
selection = getMenuSelection();
|
||||
|
||||
switch(selection){
|
||||
case SOLVE : solveMenu(); break;
|
||||
case DESCRIPTION : descriptionMenu(); break;
|
||||
case LIST : listProblems(); break;
|
||||
case EXIT : break;
|
||||
case MenuOptions::SOLVE : solveMenu(); break;
|
||||
case MenuOptions::DESCRIPTION : descriptionMenu(); break;
|
||||
case MenuOptions::LIST : listProblems(); break;
|
||||
case MenuOptions::BENCHMARK : benchmarkMenu(); break;
|
||||
case MenuOptions::EXIT : break;
|
||||
}
|
||||
}while(selection != EXIT);
|
||||
|
||||
@@ -51,7 +52,8 @@ void printMenu(){
|
||||
std::cout << "1. Solve a problem\n"
|
||||
<< "2. Print a problem description\n"
|
||||
<< "3. List valid problem numbers\n"
|
||||
<< "4. Exit" << std::endl;
|
||||
<< "4. Benchmark\n"
|
||||
<< "5. Exit" << std::endl;
|
||||
}
|
||||
|
||||
int getMenuSelection(){
|
||||
|
||||
Reference in New Issue
Block a user