Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SAHIN Game of life Template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SAHIN Melis damla
SAHIN Game of life Template
Commits
ef561484
Commit
ef561484
authored
5 months ago
by
SAHIN Melis damla
Browse files
Options
Downloads
Patches
Plain Diff
ajouté la correction avec if aussi
parent
85a4fe5f
No related branches found
No related tags found
No related merge requests found
Pipeline
#40924
failed
5 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/automata/GameOfLifeState.java
+19
-5
19 additions, 5 deletions
src/main/java/model/automata/GameOfLifeState.java
with
19 additions
and
5 deletions
src/main/java/model/automata/GameOfLifeState.java
+
19
−
5
View file @
ef561484
...
...
@@ -19,10 +19,18 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return
Color
.
RED
;
case
DEAD:
return
Color
.
WHITE
;
default
:
return
Color
.
WHITE
;
default
:
return
Color
.
WHITE
;
}
}
/* correction avec if :
if this.equals(ALIVE) {
return COLOR.RED;
else {
return COLOR.WHITE;
*/
@Override
public
GameOfLifeState
next
()
{
switch
(
this
)
{
...
...
@@ -30,9 +38,16 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return
DEAD
;
case
DEAD:
return
ALIVE
;
default
:
return
DEAD
;
default
:
return
DEAD
;
}
}
/* correction avec if :
if this.equals(ALIVE) {
return DEAD;
else {
return ALIVE;
*/
@Override
public
GameOfLifeState
update
(
List
<
GameOfLifeState
>
neighbours
)
{
...
...
@@ -54,4 +69,3 @@ public enum GameOfLifeState implements State<GameOfLifeState> {
return
DEAD
;
}
}
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