Currently, I"m trying to make a stat roller for D&D DMs to make NPCs faster and easier.
Thus far, I've managed to generate, add, and display four numbers and their sum.
However, I'm trying to detect whichever is the lowest number, and then exclude it from the sum. I imagine that I need to NULL it somehow.
From my code, you can see that I've made all four numbers floats.
I appreciate any help rendered, and that you all stay happy and safe.
int lowest;
lowest = randomNumber1 = (rand() % 6) + 1;
randomNumber2 = (rand() % 6) + 1;
if(randomNumber2 < lowest) lowest = randomNumber2;
repeat...
add them up, subtract lowest, and you have the sum of the highest 3 of 4.
its inefficient but less code you can also store the 4 values in a vector / array, sort them, and use the 3 highest.