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
7134556b
Commit
7134556b
authored
Mar 22, 2019
by
franck.tempet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppression de CoupTicTacToe3x3
parent
894ee3aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
15 deletions
+15
-15
CoupTicTacToe.java
src/tictactoecodingame/CoupTicTacToe.java
+3
-3
GrilleTicTacToe3x3.java
src/tictactoecodingame/GrilleTicTacToe3x3.java
+5
-5
GrilleTicTacToe9x9.java
src/tictactoecodingame/GrilleTicTacToe9x9.java
+7
-7
No files found.
src/tictactoecodingame/CoupTicTacToe.java
View file @
7134556b
...
...
@@ -10,11 +10,11 @@ package tictactoecodingame;
*
* @author franck.tempet
*/
public
class
CoupTicTacToe
9x9
extends
Coup
{
public
class
CoupTicTacToe
extends
Coup
{
private
int
colonne
,
ligne
;
private
Jeton
jeton
;
public
CoupTicTacToe
9x9
(
int
_colonne
,
int
_ligne
,
Jeton
_jeton
)
{
public
CoupTicTacToe
(
int
_colonne
,
int
_ligne
,
Jeton
_jeton
)
{
super
();
colonne
=
_colonne
;
ligne
=
_ligne
;
...
...
@@ -44,7 +44,7 @@ public class CoupTicTacToe9x9 extends Coup {
if
(
this
.
getClass
()
!=
obj
.
getClass
())
return
false
;
CoupTicTacToe
9x9
coup
=
(
CoupTicTacToe9x9
)
obj
;
CoupTicTacToe
coup
=
(
CoupTicTacToe
)
obj
;
return
colonne
==
coup
.
getColonne
()
&&
ligne
==
coup
.
ligne
&&
jeton
.
toString
().
equals
(
coup
.
getJeton
().
toString
());
...
...
src/tictactoecodingame/GrilleTicTacToe3x3.java
View file @
7134556b
...
...
@@ -16,7 +16,7 @@ public class GrilleTicTacToe3x3 extends Plateau {
Jeton
[][]
grille
=
new
Jeton
[
3
][
3
];
Jeton
[][][]
grilleSav
=
new
Jeton
[
100
][
3
][
3
];
// Pour sauvegardr la position. 100 au maximum
CoupTicTacToe
3x3
dernierCoup
;
CoupTicTacToe
dernierCoup
;
Joueur
vainqueur
;
@Override
...
...
@@ -36,7 +36,7 @@ public class GrilleTicTacToe3x3 extends Plateau {
@Override
public
void
joueCoup
(
Coup
_coup
)
{
CoupTicTacToe
3x3
coup
=
(
CoupTicTacToe3x3
)
_coup
;
CoupTicTacToe
coup
=
(
CoupTicTacToe
)
_coup
;
grille
[
coup
.
getColonne
()][
coup
.
getLigne
()]
=
coup
.
getJeton
();
...
...
@@ -137,7 +137,7 @@ public class GrilleTicTacToe3x3 extends Plateau {
for
(
int
c
=
0
;
c
<
this
.
getNbColonnes
();
c
++)
{
for
(
int
l
=
0
;
l
<
this
.
getNbLignes
();
l
++)
{
if
(
grille
[
c
][
l
]
==
null
)
listeCoups
.
add
(
new
CoupTicTacToe
3x3
(
c
,
l
,
new
Jeton
(
_joueur
)));
listeCoups
.
add
(
new
CoupTicTacToe
(
c
,
l
,
new
Jeton
(
_joueur
)));
}
}
...
...
@@ -146,7 +146,7 @@ public class GrilleTicTacToe3x3 extends Plateau {
@Override
public
boolean
isValide
(
Coup
_coup
)
{
CoupTicTacToe
3x3
coup
=
(
CoupTicTacToe3x3
)
_coup
;
CoupTicTacToe
coup
=
(
CoupTicTacToe
)
_coup
;
return
grille
[
coup
.
getColonne
()][
coup
.
getLigne
()]
==
null
;
}
...
...
@@ -156,7 +156,7 @@ public class GrilleTicTacToe3x3 extends Plateau {
int
colonne
=
Integer
.
valueOf
(
_coup
.
charAt
(
0
)+
""
);
int
ligne
=
Integer
.
valueOf
(
_coup
.
charAt
(
1
)+
""
);
return
new
CoupTicTacToe
3x3
(
colonne
,
ligne
,
new
Jeton
(
_joueur
)
);
return
new
CoupTicTacToe
(
colonne
,
ligne
,
new
Jeton
(
_joueur
)
);
}
@Override
...
...
src/tictactoecodingame/GrilleTicTacToe9x9.java
View file @
7134556b
...
...
@@ -20,8 +20,8 @@ public class GrilleTicTacToe9x9 extends Plateau {
Jeton
[][][]
grille3x3Sav
=
new
Jeton
[
100
][
3
][
3
];
// Pour sauvegarder la position
int
nbPostionSauvegarde
;
CoupTicTacToe
9x9
dernierCoup
;
CoupTicTacToe
9x9
dernierCoupSav
;
CoupTicTacToe
dernierCoup
;
CoupTicTacToe
dernierCoupSav
;
Joueur
vainqueur
;
boolean
grilleGagnee
,
grilleGagneeSav
;
// vrai si dernier coup gagne une grille
...
...
@@ -51,7 +51,7 @@ public class GrilleTicTacToe9x9 extends Plateau {
@Override
public
void
joueCoup
(
Coup
_coup
)
{
CoupTicTacToe
9x9
coup
=
(
CoupTicTacToe9x9
)
_coup
;
CoupTicTacToe
coup
=
(
CoupTicTacToe
)
_coup
;
grille9x9
[
coup
.
getColonne
()][
coup
.
getLigne
()]
=
coup
.
getJeton
();
dernierCoup
=
coup
;
...
...
@@ -225,7 +225,7 @@ public class GrilleTicTacToe9x9 extends Plateau {
if
(
grille3x3
[(
c
/
3
)][(
l
/
3
)]
!=
null
)
continue
;
// on ne peut pas jouer dans une grille gagnée
if
(
grille9x9
[
c
][
l
]
==
null
)
{
listeCoups
.
add
(
new
CoupTicTacToe
9x9
(
c
,
l
,
new
Jeton
(
_joueur
)));
listeCoups
.
add
(
new
CoupTicTacToe
(
c
,
l
,
new
Jeton
(
_joueur
)));
}
}
}
...
...
@@ -236,7 +236,7 @@ public class GrilleTicTacToe9x9 extends Plateau {
for
(
int
l
=
0
;
l
<
this
.
getNbLignes
();
l
++)
{
if
(
grille3x3
[(
c
/
3
)][(
l
/
3
)]
!=
null
)
continue
;
// on ne peut pas jouer dans une grille gagnée
if
(
grille9x9
[
c
][
l
]
==
null
)
{
listeCoups
.
add
(
new
CoupTicTacToe
9x9
(
c
,
l
,
new
Jeton
(
_joueur
)));
listeCoups
.
add
(
new
CoupTicTacToe
(
c
,
l
,
new
Jeton
(
_joueur
)));
}
}
}
...
...
@@ -246,7 +246,7 @@ public class GrilleTicTacToe9x9 extends Plateau {
@Override
public
boolean
isValide
(
Coup
_coup
)
{
CoupTicTacToe
9x9
coup
=
(
CoupTicTacToe9x9
)
_coup
;
CoupTicTacToe
coup
=
(
CoupTicTacToe
)
_coup
;
if
(
grille9x9
[
coup
.
getColonne
()][
coup
.
getLigne
()]
!=
null
)
return
false
;
...
...
@@ -280,7 +280,7 @@ public class GrilleTicTacToe9x9 extends Plateau {
int
colonne
=
Integer
.
valueOf
(
_coup
.
charAt
(
0
)
+
""
);
int
ligne
=
Integer
.
valueOf
(
_coup
.
charAt
(
1
)
+
""
);
return
new
CoupTicTacToe
9x9
(
colonne
,
ligne
,
new
Jeton
(
_joueur
));
return
new
CoupTicTacToe
(
colonne
,
ligne
,
new
Jeton
(
_joueur
));
}
@Override
...
...
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