Skip to content
Snippets Groups Projects
Commit a5d41485 authored by FRANCOIS Julia's avatar FRANCOIS Julia
Browse files

int en unsigned int

parent acde703c
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,7 @@ Solver::Solver(Arbre a, PlayersLetters p, Board board) {
void Solver::initSolutions(int coordStart) {
currentCoord.push_back(coordStart);
string s;
for (int i = 0; i < player.hand.size(); i++) { // charge les lettres du joueur pour le solver
for (unsigned int i = 0; i < player.hand.size(); i++) { // charge les lettres du joueur pour le solver
s = s+player.hand[i].id;
}
playableLetters.push_back(s);
......@@ -80,7 +80,7 @@ void Solver::nextStep(int ref, int coordStart) {
if (temp->terminal) {
bool duplicateSolution = false;
for (int l = 0; l < solFinal.size(); l++) {
for (unsigned int l = 0; l < solFinal.size(); l++) {
if (solutions[ref] == solFinal[l]) {
duplicateSolution = true;
}
......@@ -96,7 +96,7 @@ void Solver::nextStep(int ref, int coordStart) {
if(b.spots[currentCoord[ref]].letter == 0) { // si la case actuelle est bien vide, on fait les etats pour chaque lettre jouable
//cout << "case vide" << endl;
for (int i = 0; i < playableLetters[ref].size(); i++) {
for (unsigned int i = 0; i < playableLetters[ref].size(); i++) {
// ETAT N LETTRES
int num = (int)playableLetters[ref][i] - 64;
//if (temp == nullptr) cout << "checks out" << endl;
......@@ -114,7 +114,7 @@ void Solver::nextStep(int ref, int coordStart) {
playableLetters.push_back(playableLetters[ref]);
currentCoord.push_back(currentCoord[ref]);
solutions.push_back(solutions[ref]);
sens.push_back(sens[ref]); // on garde le sens tant qu'on a pas pass +
sens.push_back(sens[ref]); // on garde le sens tant qu'on a pas pass +
bVec[ref+index].spots[currentCoord[ref+index]].letter = playableLetters[ref+index][i]; // on rajoute la lettre au plateau
solutions[ref+index] = solutions[ref+index]+playableLetters[ref+index][i];
......@@ -133,7 +133,7 @@ void Solver::nextStep(int ref, int coordStart) {
//et pour le gaddag
if (temp->child[0] != nullptr) { // mais qu'on a le +
if (!avoidDuplicateGaddag) {
//temp = temp->child[0]; // on voit ce qui a aprs, on se repositionne, etc
//temp = temp->child[0]; // on voit ce qui a aprs, on se repositionne, etc
if (b.spots[currentCoord[ref]+sens[ref]].letter != 0) { // si le spot d'apres est pris par une lettre
cout << "STOP spot apres pris par lettre" << endl;
//return;
......@@ -231,7 +231,7 @@ int Solver::calcScore(Board b, int coordStart) {
void Solver::calcScoreBoards(int coordStart) {
BagOfLetters bol;
for (int i = 0; i < bVecFinal.size(); i++) {
for (unsigned int i = 0; i < bVecFinal.size(); i++) {
scores.push_back(calcScore(bVecFinal[i], coordStart));
}
cout << "TOUS LES SCORES ONT ETE CALCULES" << endl;
......@@ -262,7 +262,7 @@ void Solver::Loop(int coordStart) {
calcScoreBoards(coordStart);
for (int i = 0; i < solFinal.size(); i++) {
for (unsigned int i = 0; i < solFinal.size(); i++) {
cout << "SOLUTION " << i << " : " << solFinal[i] << endl;
cout << "SCORE : " << scores[i] << endl;
cout << "LETTRES RESTANTES : " << handFinal[i] << endl;
......@@ -278,8 +278,8 @@ void Solver::Loop(int coordStart) {
cout << bVecFinal[indexBest] << endl;
b = bVecFinal[indexBest];
int j = 0;
for (int i = 0; i <= handFinal[indexBest].size(); i++) {
unsigned int j = 0;
for (unsigned int i = 0; i <= handFinal[indexBest].size(); i++) {
//cout << "i : " << i << " j : " << j << endl;
while (player.hand[j].id != handFinal[indexBest][i] && j < player.hand.size()) {
player.hand.erase(player.hand.begin()+i);
......@@ -314,7 +314,7 @@ void Solver::Loop(int coordStart) {
cout << "LETTRES RESTANTES : " << handFinalBySpot[indexBest] << endl;
cout << bVecFinalBySpot[indexBest] << endl;
// actualise le board et met jour la main du joueur (enleve les lettres utilisees)
// actualise le board et met jour la main du joueur (enleve les lettres utilisees)
b = bVecFinalBySpot[indexBest];
int j = 0;
for (int i = 0; i <= handFinalBySpot[indexBest].size(); i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment