Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,12 @@ int Dice::roll()
vector <int> Dice::get_distribution(){
return roll_counter;
}
vector <int> Dice::get_percentage()
{
vector<int> percentage;
for(int i = 0; i < FACES; i++)
{
percentage.push_back(roll_counter[i]);
}
return percentage;
}
1 change: 1 addition & 0 deletions Dice.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Dice
Dice(unsigned int);
int roll();
vector <int> get_distribution();
vector <int> get_percentage();

private:
vector <int> roll_counter;
Expand Down