Commit da2aea7b authored by Louis Bahrman's avatar Louis Bahrman
parents dc9afd6f 4f5ab9d7
<<<<<<< HEAD
<<<<<<< HEAD
compile.on.save=true
do.depend=false
do.jar=true
......@@ -13,3 +14,20 @@ javac.debug=true
javadoc.preview=true
user.properties.file=/home/louis/.netbeans/11.3/build.properties
>>>>>>> 4dd14568c244c833d17b679f8f3b340f997c8d04
=======
<<<<<<< HEAD
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\timot\\AppData\\Roaming\\NetBeans\\11.2\\build.properties
=======
compile.on.save=true
do.depend=false
do.jar=true
javac.debug=true
javadoc.preview=true
user.properties.file=C:\\Users\\theo\\AppData\\Roaming\\NetBeans\\8.0.2\\build.properties
>>>>>>> 4dd14568c244c833d17b679f8f3b340f997c8d04
>>>>>>> 4f5ab9d710d3dfdc1fe71236031395a85db95bec
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Coup.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/CoupTicTacToe.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Player.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/AlgoRecherMinMax1.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Joueur.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/JoueurOrdi.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/AlgoRecherche.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/JoueurHumain.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Jeton.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Case.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Plateau.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Arbitre.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/AlgoRechercheAleatoire.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Generator.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/GrilleTicTacToe3x3.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/GrilleTicTacToe9x9.java</file>
<file>file:/C:/Users/theo/Documents/Ecole/IMT%20Lille%20Douai/L3/Projet%20Info/groupe3-tictactoe/src/tictactoecodingame/Piece.java</file>
</group>
</open-files>
</project-private>
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package tictactoecodingame;
/**
*
* @author Théo
*/
public class Generator {
public static int random_tests(Plateau plateau, int nb_tests) {
int c = 0;
JoueurOrdi player = new JoueurOrdi("player");
JoueurOrdi opponent = new JoueurOrdi("oppo");
AlgoRechercheAleatoire alea = new AlgoRechercheAleatoire( );
player.setAlgoRecherche(alea);
opponent.setAlgoRecherche(alea);
Joueur currentPlayer = player;
int i=((CoupTicTacToe)plateau.getDernierCoup()).getJeton().getJoueur().getIdJoueur();
player.forceId(1-i);
opponent.forceId(i);
Coup coup;
plateau.sauvegardePosition(0);
for(i=0; i<nb_tests;i++){
while (!plateau.partieTerminee()) {
coup = currentPlayer.joue(plateau);
plateau.joueCoup(coup);
if (currentPlayer == player) {
currentPlayer = opponent;
} else {
currentPlayer = player;
}
}
Joueur vainqueur = plateau.vainqueur();
if ( vainqueur == player )
c++;
else if ( vainqueur == player )
c--;
plateau.restaurePosition(0);
}
return c;
}
}
......@@ -33,4 +33,8 @@ public abstract class Joueur {
public String toString() {
return nom;
}
public void forceId(int id){
idJoueur = id;
}
}
......@@ -24,9 +24,9 @@ public class Player {
GrilleTicTacToe3x3 grille = new GrilleTicTacToe3x3();
Arbitre a = new Arbitre(grille, joueurOrdi , joueurOrdi );
//Arbitre a = new Arbitre(grille, joueurOrdi , joueurOrdi );
// Arbitre a = new Arbitre(grille, joueurOrdi , humain );
Arbitre a = new Arbitre(grille, joueurOrdi , humain );
a.startNewGame(true); // Demarre une partie en affichant la grille du jeu
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment