Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Game of life Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
L3_InfoAMU
S3
Programmation 2
Game of life Template
Commits
ccafc31c
Commit
ccafc31c
authored
4 months ago
by
SAEZ Theo
Browse files
Options
Downloads
Patches
Plain Diff
Finalisation des cellules rouges et bleu - Fin du TP
parent
6a0efa4e
No related branches found
No related tags found
No related merge requests found
Pipeline
#48176
failed
4 months ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/model/Grid.java
+2
-2
2 additions, 2 deletions
src/main/java/model/Grid.java
with
2 additions
and
2 deletions
src/main/java/model/Grid.java
+
2
−
2
View file @
ccafc31c
...
@@ -114,7 +114,7 @@ public class Grid implements Iterable<Cell> {
...
@@ -114,7 +114,7 @@ public class Grid implements Iterable<Cell> {
return
countAliveNeighbors
;
return
countAliveNeighbors
;
}
}
/** TEST A FAIRE */
/** TEST A FAIRE
prbl lorsque je lance le programme, les cellules bleus disparaissent
*/
public
CellState
calculateNextState
(
int
rowIndex
,
int
columnIndex
)
{
public
CellState
calculateNextState
(
int
rowIndex
,
int
columnIndex
)
{
int
aliveNeighbors
=
countAliveNeighbors
(
rowIndex
,
columnIndex
);
int
aliveNeighbors
=
countAliveNeighbors
(
rowIndex
,
columnIndex
);
...
@@ -130,7 +130,7 @@ public class Grid implements Iterable<Cell> {
...
@@ -130,7 +130,7 @@ public class Grid implements Iterable<Cell> {
if
(
getCell
(
rowIndex
,
columnIndex
).
isAlive
())
{
if
(
getCell
(
rowIndex
,
columnIndex
).
isAlive
())
{
if
(
aliveNeighbors
==
2
||
aliveNeighbors
==
3
)
{
if
(
aliveNeighbors
==
2
||
aliveNeighbors
==
3
)
{
if
(
getCell
(
rowIndex
,
columnIndex
).
getColor
()
==
Color
.
RED
)
return
CellState
.
ALIVE_RED
;
if
(
getCell
(
rowIndex
,
columnIndex
).
getColor
()
==
Color
.
RED
)
return
CellState
.
ALIVE_RED
;
else
if
(
getCell
(
rowIndex
,
columnIndex
).
getColor
()
==
Color
.
RED
)
return
CellState
.
ALIVE_
RED
;
else
if
(
getCell
(
rowIndex
,
columnIndex
).
getColor
()
==
Color
.
BLUE
)
return
CellState
.
ALIVE_
BLUE
;
}
}
}
}
else
{
else
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment