Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Groupe3-TicTacToe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BAHRMAN Louis
Groupe3-TicTacToe
Commits
3415d259
Commit
3415d259
authored
Apr 20, 2020
by
Le noob du 53
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
arbre fraction et l'algo de recherche incomplet
parent
e6b0d9e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
0 deletions
+136
-0
AlgoRecherMinMax1.java
src/tictactoecodingame/AlgoRecherMinMax1.java
+29
-0
Arbre.java
src/tictactoecodingame/Arbre.java
+93
-0
Fraction.java
src/tictactoecodingame/Fraction.java
+14
-0
No files found.
src/tictactoecodingame/AlgoRecherMinMax1.java
0 → 100644
View file @
3415d259
/*
* 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
;
import
java.util.ArrayList
;
/**
*
* @author senda
*/
public
class
AlgoRecherMinMax1
extends
AlgoRecherche
{
ArrayList
ListCoup
;
public
AlgoRecherMinMax1
()
{
}
@Override
public
Coup
meilleurCoup
(
Plateau
_plateau
,
Joueur
_joueur
,
boolean
_ponder
)
{
ListCoup
=
_plateau
.
getListeCoups
(
_joueur
);
return
;
}
}
src/tictactoecodingame/Arbre.java
0 → 100644
View file @
3415d259
/*
* 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
;
import
java.util.ArrayList
;
/**
*
* @author senda
*/
public
class
Arbre
{
private
int
value
;
private
ArrayList
<
Coup
>
coups
;
private
ArrayList
<
Arbre
>
fils
;
// Les constructeurs :
public
Arbre
(
int
value
,
ArrayList
coups
,
ArrayList
fils
){
this
.
value
=
value
;
this
.
fils
=
fils
;
this
.
coups
=
coups
;
}
public
Arbre
(
int
value
,
Plateau
_plateau
,
Joueur
_joueur
){
this
.
value
=
value
;
this
.
coups
=
_plateau
.
getListeCoups
(
_joueur
)
;
int
a
=
coups
.
size
();
fils
=
new
ArrayList
();
for
(
int
i
=
0
;
i
<
a
;
i
++){
Arbre
Arbre_i
=
new
Arbre
(
0
);
// Attention ! Ce constructeur initialise donc avec des valeurs nulles en racine !
fils
.
add
(
Arbre_i
);
}
}
public
Arbre
(
int
value
){
this
.
value
=
value
;
}
// Les accesseurs :
public
double
getvalue
(){
return
(
value
);
}
public
ArrayList
getfils
(){
return
(
fils
);
}
public
ArrayList
getcoups
(){
return
(
coups
);
}
//Des choses sans nom :
public
void
setvalue
(
int
value
){
this
.
value
=
value
;
}
public
void
setfils
(
ArrayList
fils
){
this
.
fils
=
fils
;
}
public
void
setcoups
(
ArrayList
coups
){
this
.
coups
=
coups
;
}
//Fonctions auxiliaires :
public
boolean
estFeuille
(){
return
(
fils
==
null
);
}
public
boolean
estNoeud
(){
return
(
fils
!=
null
);
}
public
int
hauteur
(){
if
(
this
.
estFeuille
()){
return
1
;
}
else
{
int
a
=
this
.
fils
.
size
();
Arbre
fils0
=
this
.
fils
.
get
(
0
);
int
maxfils
=
fils0
.
hauteur
();
for
(
int
i
=
1
;
i
<
a
;
i
++){
Arbre
next
=
this
.
fils
.
get
(
i
);
maxfils
=
Math
.
max
(
next
.
hauteur
(),
maxfils
);
}
return
(
1
+
maxfils
);
}
}
}
src/tictactoecodingame/Fraction.java
0 → 100644
View file @
3415d259
/*
* 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 senda
*/
public
class
Fraction
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment