mirror of
https://bitbucket.org/Mattrixwv/my-classes.git
synced 2025-12-06 18:23:57 -05:00
Changed dice to a template class and updated ifdef statements
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user