I am thinking of adding a ROR feature to the card counting computer on my web site. It would be a rough value, just to give a feeling to the user.
I am thinking of doing it as follows. If a person puts in that he wants a sim of 1,000,000 hands then I create a matrix amount[1000000] that keeps track of the bankroll at each of the 1000000 hands. I then use the following code:
int bankroll; //user will input his bankroll for the sim
int total = 0; //keeps track of the number of times bankroll is lost
int noh; //number of hands to be played
int amount[noh]; // bankroll at each hand, as played
for (int ctr = 0; ctr < noh; ctr++)
for (int ctr1 = ctr; ctr1 < noh; ctr1++) {
if(amount[ctr1] < (amt[ctr] - bankroll)) {
total++;
continue;
}
}
}
Risk of ruin is then 100*((float)total/noh) percent.
Does this work? Comments, please.
Thanks
--Mayor

