Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
7a8d5d0a
Verified
Commit
7a8d5d0a
authored
Jun 11, 2021
by
Romain De Laage De Bellefaye
🌳
Browse files
Two dimensions were inverted
parent
471ae7b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Automate.cpp
View file @
7a8d5d0a
...
...
@@ -12,7 +12,7 @@ void Automate::nextTimer() {
for
(
size_t
j
=
0
;
j
<
l
;
++
j
)
{
Voisinage
voisinage
(
&
(
*
(
--
buffer
.
end
())).
getReseau
()[
i
][
j
]);
regleVoisinage
->
calculVoisinage
(
voisinage
,
*
(
--
buffer
.
end
()));
const
Etat
e
=
fonction
->
getEtatSuivant
(
voisinage
,
r
.
getReseau
()[
i
][
j
]);
const
Etat
e
=
fonction
->
getEtatSuivant
(
voisinage
,
(
*
(
--
buffer
.
end
()))
.
getReseau
()[
i
][
j
]);
while
(
r
.
getReseau
()[
i
][
j
].
getIndEtat
()
!=
e
.
getIndice
())
r
.
getReseau
()[
i
][
j
].
incrementerEtat
();
}
...
...
src/voisinage.cpp
View file @
7a8d5d0a
...
...
@@ -20,7 +20,7 @@ void RegleVoisinageNeumann::calculVoisinage(Voisinage& v, const Reseau& r) const
int
y
=
(
cellX
+
j
)
%
largeur
;
if
(
y
<
0
)
y
=
hauteur
+
y
;
v
.
voisinage
.
push_back
(
new
Cellule
(
r
.
getReseau
()[
x
][
y
]));
v
.
voisinage
.
push_back
(
new
Cellule
(
r
.
getReseau
()[
y
][
x
]));
}
}
...
...
@@ -41,7 +41,7 @@ void RegleVoisinageMoore::calculVoisinage(Voisinage& v, const Reseau& r) const {
int
y
=
(
cellX
+
j
)
%
largeur
;
if
(
y
<
0
)
y
=
hauteur
+
y
;
v
.
voisinage
.
push_back
(
new
Cellule
(
r
.
getReseau
()[
x
][
y
]));
v
.
voisinage
.
push_back
(
new
Cellule
(
r
.
getReseau
()[
y
][
x
]));
}
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment