engine 0.4 rev12 (flop part 9)

This commit is contained in:
doitux
2007-03-23 19:12:49 +00:00
parent 10f242059a
commit 92a1b65afd
2 changed files with 297 additions and 217 deletions
+261 -217
View File
@@ -662,215 +662,27 @@ void LocalPlayer::flopEngine() {
}
// ################### ENGINE 0.4 #################
else {
// cout << "Engine 0.4" << endl;
int tempArray[5];
int boardCards[5];
int info[4];
int cBluff;
int sBluff;
int bet = 0;
int raise = 0;
int handCode;
int i;
Tools myTools;
for(i=0; i<2; i++) tempArray[i] = myCards[i];
actualBoard->getMyCards(boardCards);
for(i=0; i<3; i++) tempArray[2+i] = boardCards[i];
for(i=0; i<4; i++) info[i] = -1;
// for(i=0; i<5; i++) cout << tempArray[i] << " ";
// cout << endl;
cout << myID << ": ";
flopCardsValue(tempArray);
for(i=0; i<5; i++) cout << tempArray[i] << " ";
cout << "\t";
// aktive Situation --> check / bet
if(actualHand->getFlop()->getHighestSet() == 0) {
handCode = flopCardsValue(tempArray);
switch(info[0]) {
case 9: {}
case 8: {}
case 7: {}
case 6: {}
case 5: {}
case 4: {
myTools.getRandNumber(0,100,1,&cBluff,0);
if(cBluff < 35) {
myAction = 2;
}
else {
if(myCash/(2*actualHand->getSmallBlind()) <= 8) {
myAction = 6;
} else {
if(cBluff < 60) {
bet = (7-myDude4)*2*actualHand->getSmallBlind();
} else {
bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
}
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
}
break;
case 3: {
switch(info[3]) {
case 2: {
myTools.getRandNumber(0,100,1,&cBluff,0);
if(cBluff < 35) {
myAction = 2;
}
else {
if(myCash/(2*actualHand->getSmallBlind()) <= 8) {
myAction = 6;
} else {
if(cBluff < 60) {
bet = (5-myDude4)*2*actualHand->getSmallBlind();
} else {
bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
}
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
}
break;
case 1: {
myTools.getRandNumber(0,100,1,&cBluff,0);
if(cBluff < 40) {
myAction = 2;
}
else {
if(myCash/(2*actualHand->getSmallBlind()) <= 6) {
myAction = 6;
} else {
if(cBluff < 60) {
bet = (3-myDude4)*2*actualHand->getSmallBlind();
} else {
bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
}
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
}
break;
default: {
myTools.getRandNumber(0,100,1,&sBluff,0);
if(info[1] >= 10 && sBluff <= 40) {
bet = (sBluff/10)*2*actualHand->getSmallBlind();
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
else {
myAction = 2;
}
}
}
}
break;
case 2: {
switch(info[3]) {
case 2: {
myTools.getRandNumber(0,100,1,&cBluff,0);
if(cBluff > 80) {
myAction = 2;
}
else {
if(myCash/(2*actualHand->getSmallBlind()) <= 6) {
myAction = 6;
} else {
bet = (cBluff/20)*2*actualHand->getSmallBlind();
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
}
break;
default: {
myTools.getRandNumber(0,100,1,&cBluff,0);
if(cBluff > 90) {
myAction = 2;
}
else {
if(myCash/(2*actualHand->getSmallBlind()) <= 5) {
myAction = 6;
} else {
bet = (cBluff/30)*2*actualHand->getSmallBlind();
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
}
}
}
break;
case 1: {
if(!info[2]) {
myTools.getRandNumber(0,100,1,&sBluff,0);
switch(info[3]) {
case 2: {}
case 1: {
if(actualHand->getActualQuantityPlayers() == 2) {
bet = (1-myDude4)*2*actualHand->getSmallBlind();
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
else {
switch(info[1]) {
case 3: {
if(sBluff <= 10) {
bet = (sBluff/5 + 2)*actualHand->getSmallBlind();
myAction = 4;
}
else {
myAction = 2;
}
}
break;
case 2: {
if(sBluff <= 15) {
bet = (sBluff/5 + 2)*actualHand->getSmallBlind();
myAction = 4;
}
else {
myAction = 2;
}
}
break;
case 1: {
if(sBluff <= 50) {
bet = (sBluff/15 + 2)*actualHand->getSmallBlind();
myAction = 4;
}
else {
myAction = 2;
}
}
break;
default: {
if(myCash/(2*actualHand->getSmallBlind()) <= 5) {
myAction = 6;
} else {
bet = (sBluff/15)*2*actualHand->getSmallBlind();
if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
myAction = 4;
}
}
break;
}
}
}
break;
default: {
}
}
}
cout << "\t" << handCode << endl;
@@ -880,28 +692,246 @@ void LocalPlayer::flopEngine() {
}
break;
default: {}
}
}
// passive Situation --> fold / call / raise
else {
}
// cout << "Engine 0.4" << endl;
// int tempArray[5];
// int boardCards[5];
// int info[4];
// int cBluff;
// int sBluff;
// int bet = 0;
// int raise = 0;
//
// int i;
//
// Tools myTools;
//
// for(i=0; i<2; i++) tempArray[i] = myCards[i];
// actualBoard->getMyCards(boardCards);
// for(i=0; i<3; i++) tempArray[2+i] = boardCards[i];
//
// for(i=0; i<4; i++) info[i] = -1;
//
// // for(i=0; i<5; i++) cout << tempArray[i] << " ";
// // cout << endl;
//
// cout << myID << ": ";
//
// flopCardsValue(tempArray);
//
// // aktive Situation --> check / bet
// if(actualHand->getFlop()->getHighestSet() == 0) {
//
// switch(info[0]) {
// case 9: {}
// case 8: {}
// case 7: {}
// case 6: {}
// case 5: {}
// case 4: {
// myTools.getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) {
// myAction = 2;
// }
// else {
// if(myCash/(2*actualHand->getSmallBlind()) <= 8) {
// myAction = 6;
// } else {
// if(cBluff < 60) {
// bet = (7-myDude4)*2*actualHand->getSmallBlind();
// } else {
// bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
// }
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// }
// break;
// case 3: {
// switch(info[3]) {
// case 2: {
// myTools.getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) {
// myAction = 2;
// }
// else {
// if(myCash/(2*actualHand->getSmallBlind()) <= 8) {
// myAction = 6;
// } else {
// if(cBluff < 60) {
// bet = (5-myDude4)*2*actualHand->getSmallBlind();
// } else {
// bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
// }
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// }
// break;
// case 1: {
// myTools.getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 40) {
// myAction = 2;
// }
// else {
// if(myCash/(2*actualHand->getSmallBlind()) <= 6) {
// myAction = 6;
// } else {
// if(cBluff < 60) {
// bet = (3-myDude4)*2*actualHand->getSmallBlind();
// } else {
// bet = (((100-cBluff)/20)+2)*actualHand->getSmallBlind();
// }
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// }
// break;
// default: {
// myTools.getRandNumber(0,100,1,&sBluff,0);
// if(info[1] >= 10 && sBluff <= 40) {
// bet = (sBluff/10)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// else {
// myAction = 2;
// }
// }
// }
// }
// break;
// case 2: {
// switch(info[3]) {
// case 2: {
// myTools.getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 80) {
// myAction = 2;
// }
// else {
// if(myCash/(2*actualHand->getSmallBlind()) <= 6) {
// myAction = 6;
// } else {
// bet = (cBluff/20)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// }
// break;
// default: {
// myTools.getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 90) {
// myAction = 2;
// }
// else {
// if(myCash/(2*actualHand->getSmallBlind()) <= 5) {
// myAction = 6;
// } else {
// bet = (cBluff/30)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// }
// }
// }
// break;
// case 1: {
// if(!info[2]) {
// myTools.getRandNumber(0,100,1,&sBluff,0);
// switch(info[3]) {
// case 2: {}
// case 1: {
// if(actualHand->getActualQuantityPlayers() == 2) {
// bet = (1-myDude4)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
//
// }
// else {
// switch(info[1]) {
// case 3: {
// if(sBluff <= 10) {
// bet = (sBluff/5 + 2)*actualHand->getSmallBlind();
// myAction = 4;
// }
// else {
// myAction = 2;
// }
// }
// break;
// case 2: {
// if(sBluff <= 15) {
// bet = (sBluff/5 + 2)*actualHand->getSmallBlind();
// myAction = 4;
// }
// else {
// myAction = 2;
// }
// }
// break;
// case 1: {
// if(sBluff <= 50) {
// bet = (sBluff/15 + 2)*actualHand->getSmallBlind();
// myAction = 4;
// }
// else {
// myAction = 2;
// }
// }
// break;
// default: {
// if(myCash/(2*actualHand->getSmallBlind()) <= 5) {
// myAction = 6;
// } else {
// bet = (sBluff/15)*2*actualHand->getSmallBlind();
// if(bet < 2*actualHand->getSmallBlind()) bet = 2*actualHand->getSmallBlind();
// myAction = 4;
// }
// }
// break;
// }
// }
// }
// break;
// default: {
// }
// }
// }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
// }
// break;
// default: {}
// }
//
//
//
// }
// // passive Situation --> fold / call / raise
// else {
//
//
//
// }
}
@@ -1861,6 +1891,14 @@ int LocalPlayer::flopCardsValue(int* cards) {
}
}
// Anteil 1
else {
if(temp2Array[0] = array[j1][1]) {
return 21100 + array[j1][1];
} else {
return 21000 + array[j1][1];
}
}
}
}
}
@@ -1875,18 +1913,22 @@ int LocalPlayer::flopCardsValue(int* cards) {
cout << "Paar";
// ohne Straight- und Flush-Draw
if(!breakLoop) {
// Anteil ermitteln
for(j2=0; j2<2; j2++) {
if(array[j1+j2][2] <= 1) temp++;
}
// Anteil 2
if(temp == 2) {
return (12000 + j1*100 + array[j1][1]);
} else {
// Anteil 1
if(temp == 1) {
for(j2=0; j2<5; j2++) {
if(array[j2][2] >= 2 && array[j2][1] > array[j1][1]) temp1++;
}
return (11000 + temp1*100 + array[j1][1]);
}
// Anteil 0
else {
for(j2=0; j2<5; j2++) {
if(array[j2][2] <= 1 && array[j2][1] > temp1) temp1 = array[j2][1];
@@ -1894,6 +1936,8 @@ int LocalPlayer::flopCardsValue(int* cards) {
for(j2=0; j2<5; j2++) {
if(array[j2][2] >= 2 && array[j2][1] > temp1) temp2++;
}
if(temp2 == 2) temp2 = 1;
if(temp2 == 3) temp2 = 2;
return (10000 + temp2*100 + temp1);
}
}
+36
View File
@@ -122,6 +122,42 @@
11011|0.843975|0.713083|0.610900|0.520750
11111|0.807163|0.651467|0.525225|0.432100
11012|0.866263|0.749767|0.655075|0.569900
12300|0.446325|0.224100|0.133125|0.097100
12201|0.541987|0.314517|0.195500|0.133600
12301|0.460913|0.241117|0.145000|0.097950
12102|0.641775|0.424583|0.289350|0.206500
12202|0.565462|0.330867|0.212075|0.148150
12202|0.481162|0.253533|0.154325|0.106450
12103|0.655763|0.442417|0.305875|0.222850
12203|0.576050|0.347733|0.221600|0.146250
12303|0.499538|0.274933|0.163900|0.111500
12104|0.667987|0.449733|0.310625|0.223550
12204|0.595762|0.367533|0.240700|0.169500
12304|0.529400|0.299100|0.185825|0.123600
12005|0.709287|0.502400|0.365725|0.270400
12105|0.673400|0.460317|0.323550|0.229950
12205|0.613313|0.387950|0.257175|0.181950
12305|0.544462|0.309800|0.191700|0.129750
12006|0.719650|0.522967|0.382550|0.291200
12106|0.692875|0.482733|0.345825|0.253050
12206|0.633238|0.413717|0.276850|0.195200
12306|0.562913|0.339250|0.215550|0.147250
12007|0.759613|0.584300|0.446275|0.344550
12107|0.709600|0.507483|0.371300|0.274150
12207|0.666238|0.449700|0.310075|0.219450
12307|0.583650|0.356250|0.224450|0.155600
12008|0.767475|0.593817|0.463025|0.370750
12108|0.718925|0.524250|0.385325|0.294600
12208|0.695125|0.486433|0.349075|0.250250
12009|0.787362|0.623250|0.502500|0.397000
12109|0.740750|0.552867|0.412425|0.317100
12209|0.712725|0.509083|0.365475|0.262950
12010|0.826462|0.686000|0.570850|0.483000
12110|0.766262|0.589100|0.456425|0.356700
12210|0.729612|0.533183|0.393700|0.292100
12011|0.833638|0.701600|0.588350|0.496800
12111|0.778250|0.605767|0.477175|0.380450
12012|0.863613|0.751683|0.652550|0.561100
21000|0.625838|0.410617|0.270925|0.190000
21001|0.648913|0.439150|0.299050|0.207200
21101|0.660925|0.451067|0.324350|0.240950