A frequency array is simply going to be an array where the index is the value and the value stored at the index is the number of times that value has occured. For instance,
Code:
int[] frequencies = new int[6];
frequencies[0]; // represents the number of times a 1 was rolled
frequencies[1]; // represents the number of times a 2 was rolled
frequencies[2]; // represents the number of times a 3 was rolled
...
So, in your program when you roll a number you do something like this:
Code:
int rollValue = Die.roll(); // or however you are getting the value fo the roll
frequencies[rollValue-1]++; // increment the number of times that the value showed up.
Hope this helps.
Bookmarks