Changed dice to a template class and updated ifdef statements

This commit is contained in:
2019-02-12 00:02:47 -05:00
parent 9466ef4f0d
commit 45f6d69507
2 changed files with 14 additions and 12 deletions

View File

@@ -22,6 +22,7 @@
#include <iostream>
#include <vector>
#include <cinttypes>
#include "Dice.hpp"
const int LENGTH_OF_TEST = 100; //How many times the dice will get rolled * the number of sides
@@ -30,7 +31,7 @@ const int LENGTH_OF_TEST = 100; //How many times the dice will get rolled * the
int main(){
//Check the default constructor
std::cout << "Checking the default constructor of the Dice class:\n";
mee::Dice die1;
mee::Dice<int> die1;
if(die1.getSides() == 6){
std::cout << "Default constructor passes the test\n";
}
@@ -40,7 +41,7 @@ int main(){
//Check the constructor with a high side number
std::cout << "\nChecking a constructor with a high number of sides\n";
mee::Dice die2(50);
mee::Dice<uint64_t> die2(50);
if(die2.getSides() == 50){
std::cout << "Parameterized constructor passed the test\n";
}