Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CellulutLO21
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
6e2e99f3
Commit
6e2e99f3
authored
3 years ago
by
Anthony Noir
Browse files
Options
Downloads
Patches
Plain Diff
LifeGameTransition
parent
9666e1b5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#78339
passed
3 years ago
Stage: test
Stage: deploy
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
cellulut.pro
+0
-3
0 additions, 3 deletions
cellulut.pro
include/lifegametransition.h
+14
-0
14 additions, 0 deletions
include/lifegametransition.h
src/lifegametransition.cpp
+21
-0
21 additions, 0 deletions
src/lifegametransition.cpp
src/src.pro
+7
-2
7 additions, 2 deletions
src/src.pro
with
42 additions
and
5 deletions
cellulut.pro
+
0
−
3
View file @
6e2e99f3
...
...
@@ -5,6 +5,3 @@ CONFIG += ordered
SUBDIRS
+=
\
src
\
tests
HEADERS
+=
\
include
/
transitionrule
.
hpp
This diff is collapsed.
Click to expand it.
include/lifegametransition.h
0 → 100644
+
14
−
0
View file @
6e2e99f3
#ifndef LIFEGAMETRANSITION_H
#define LIFEGAMETRANSITION_H
#include
"transitionrule.hpp"
class
LifeGameTransition
:
TransitionRule
{
public:
LifeGameTransition
();
bool
acceptFormat
(
const
std
::
vector
<
NeighborhoodFormat
>&
)
const
;
unsigned
int
getState
(
unsigned
int
,
const
Neighborhood
&
)
const
;
};
#endif // LIFEGAMETRANSITION_H
This diff is collapsed.
Click to expand it.
src/lifegametransition.cpp
0 → 100644
+
21
−
0
View file @
6e2e99f3
#include
"lifegametransition.h"
#include
"neighborhoodrule.hpp"
LifeGameTransition
::
LifeGameTransition
()
{
}
bool
LifeGameTransition
::
acceptFormat
(
const
std
::
vector
<
NeighborhoodFormat
>&
formats
)
const
{
for
(
auto
format
=
formats
.
begin
();
format
!=
formats
.
end
();
++
format
)
{
if
(
format
->
positions
.
size
()
!=
8
)
{
return
false
;
}
}
return
true
;
}
unsigned
int
LifeGameTransition
::
getState
(
unsigned
int
,
const
Neighborhood
&
neighborhood
)
const
{
unsigned
int
nb
=
neighborhood
.
getNb
(
1
);
return
(
nb
<=
1
||
nb
>=
4
)
?
0
:
1
;
}
This diff is collapsed.
Click to expand it.
src/src.pro
+
7
−
2
View file @
6e2e99f3
...
...
@@ -16,6 +16,7 @@ SOURCES += \
arbitraryneighborhoodrule
.
cpp
\
automaton
.
cpp
\
gridview
.
cpp
\
lifegametransition
.
cpp
\
main
.
cpp
\
mooreNeighborhoodRule
.
cpp
\
propertyvisitors
.
cpp
\
...
...
@@ -25,14 +26,17 @@ SOURCES += \
interface
.
cpp
\
grid
.
cpp
\
history
.
cpp
\
lifegametransition
.
h
\
vonNeumannNeighborhoodRule
.
cpp
\
structurewriter
.
cpp
\
structuresavingdialog
.
cpp
\
structurelibraryview
.
cpp
structurelibraryview
.
cpp
\
transitionrule
.
hpp
HEADERS
+=
\
..
/
include
/
automaton
.
hpp
\
..
/
include
/
coord
.
hpp
\
..
/
include
/
lifegametransition
.
h
\
..
/
include
/
neighborhoodrule
.
hpp
\
..
/
include
/
arbitraryneighborhoodrule
.
hpp
\
..
/
include
/
mooreNeighborhoodrule
.
hpp
\
...
...
@@ -52,7 +56,8 @@ HEADERS += \
..
/
include
/
state
.
hpp
\
..
/
include
/
history
.
h
\
..
/
include
/
structuresavingdialog
.
hpp
\
..
/
include
/
structurelibraryview
.
hpp
..
/
include
/
structurelibraryview
.
hpp
\
..
/
include
/
lifegametransition
.
cpp
FORMS
+=
\
..
/
forms
/
interface
.
ui
\
...
...
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