/*Dale Swanson Feburary 12 2007*/ #include
#include
#include
#include
//#include
double startm = 0; //stores staring money double goalm = 0; //stores goal money double curm = 0; //stores current money double bet[10]; //stores the bets 1 - 8, then 9 will store the multiplier to use from there. int x; int y; int z; //my general use varibles, used for answering questions, loops, any temp need. double tested = 0; //stores number of patterns tested double good = 0; //stores number of patterns that where above the threshold double thres = 0; //stores the threshold to consider a pattern good, as a 2 digit % of times reached goal double numtests = 0; //stores how many times to test each betting pattern before recording results int mode; //stores auto - 1, or manual mode - 2 double odds = 0; //stores the odds, as in 1 out of x, thus 2 will be a coin toss, a double to allow for slightly in favor of the house odds, 2.1 double pay = 0; //stores the payoff if you win as in x times your bet back, so 2 would be a normal bet int test; double results[14][10000]; double pattest = 0; //the number of patterns to test double goodres = 0; //will store the number of good results //time_t seconds; //should seed the random number generator //time(&seconds); using namespace std; ofstream resfile; //makes our stream to output to our text file //ofstream results; /* double ran(double b, double a) //returns a random number between b min, and a max { double c; //c=double(rand() % int((a-b)+b)+1); c=rand() % int(a); cout<<"\n(a-b)+b)+1 = "<<((a-b)+b)+1<<", a - "<
rand() * 5) { for (k = ((rand() / 1000) + (rand() % 28) + 7); k > 3; k--) { rand(); } } double c = 0; c=(rand() % int(b - a + 1)) + a; /* I wrote this forumla, basicly takes a random number from 1 - 32k, from rand and finds the remainder when divided by the result of the second part. Note you subtract a, then find the remainder, then add a back. */ return c; } void genpat() //will generate a betting pattern { double sumbets = 1; //a place to store the sum of all previous bets for (x=1; x<9; x++) //will go through the 8 spots in the bet array { //sumbets = 1; //clears out temp so we can start totaling up the sums bet[x]=ran(sumbets, (sumbets + 5) * 5); //comes up with a random number with a min of the sum of the bets and the max of the sum plus 5 then times 5, trying to make the window pretty big as the huge number should just fail fast and weed themselves out anyway. sumbets = sumbets + bet[x]; //adding the latest bet to the sum } //now that it set 8 bets, it needs to come up with the repeater, past experience shows this should almost always be 2, but I'm going to allow it up to 5, don't want to limit it much at all. bet[9]=ran(1, 5); for (x=1; x<10; x++) { //cout<<"\n Bet "<
0; count--) //will count down the number of tests { curm = startm; //sets your current money to the starting ammount //z = 0; if (test < count) { //cin>>test; //cout<<"\n Count - "<
goalm) //tests to see if you are at your goal before placing the bet { z=1; //1 for a win //cout<<"\nGoal - "<
40) { early = wins / (wins + loses); early = early * 100; if (early < thres - 10) { cout<<"! "; //cout<<"Wins - "<
10) cout<<" *"; count = 0; } } }//moves on the the next round //we will only get here once all the tests are done, so we should be able to record the results if (mode == 2) cout<<"\nWins - "<
10) cout<<" *"; if (thres < (wins / (wins + loses)) * 100) //tests to see if the number of wins was above threshold { //cout<<"Should write here"; goodres++; //results[1][int(goodres)] = startm; //results[2][int(goodres)] = goalm; //results[3][int(goodres)] = wins; //results[4][int(goodres)] = loses; resfile << goodres<<", "; resfile << startm<<", "; resfile << goalm<<", "; resfile << wins<<", "; resfile << loses<<", "; cout<<"\nGood result # "<
0; x--) //this will display the results { cout<<"\nPattern # "<
>startm>>goalm; //getting the starting and goal money if (startm == 0) startm = 50000; if (goalm == 0) goalm = 60000; cout<<"\nEnter the odds followed by the payoff, odds are in 1 out of x form, payoff is x times your bet, 2 is normal for both."; cin>>odds>>pay; if (odds == 0) odds = 2; if (pay == 0) pay = 2; cout<<"\nEnter the number of times to test each betting pattern before recording results. "; cin>>numtests; //getting the number of times to test each pattern if (numtests == 0) numtests = 10000; cout<<"\nDo you want automatic of manual mode 1 - Auto, 2 - Manual? "; cin>>mode; //setting auto or manual mode if (mode == 0) mode = 1; cout<<"\nEnter the threshold, as a percentage. "; cin>>thres; //getting the threshold if (thres == 0) thres = 80; cout<<"\nEnter the number of patterns to test. "; cin>>pattest; //getting the number of patterns to test if (pattest == 0) pattest = 300000; //end getting the varibles //Displaying the varibles cout<<"\nStaring money - "<
0; x--) if (mode == 1) cout<<"\nTesting...\n"; for (; int(goodres) < pattest; ) { if (mode == 1) //if it's auto mode then generate a pattern { genpat(); } else //if it's not auto then ask for the pattern { cout<<"\nEnter eight bets, then a multiplier.\n"; for (x=1; x<10; x++) //gets 8 bets then the last number will be the multiplier { if (x>8) { cout<<"And now the multiplier.\n"; } cin>>bet[x]; if (bet[1] == 138) { for (x=1; x<9; x++) { bet[x] = pow(2,(x-1)); //cout<<" Bet # "<