Verified Commit 1aed061d authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Bad conditions in neighbourhood compute

parent 41ef81d2
......@@ -12,7 +12,7 @@ void RegleVoisinageNeumann::calculVoisinage(Voisinage& v, const Reseau& r) const
for (int i = -static_cast<int>(rayon); i <= static_cast<int>(rayon); i++)
for (int j = -static_cast<int>(rayon); j <= static_cast<int>(rayon); j++)
if (abs(i) + abs(j) <= static_cast<int>(rayon) && i != 0 && j != 0)
if (abs(i) + abs(j) <= static_cast<int>(rayon) && (i != 0 || j != 0))
{
int x = (cellY+i)%hauteur;
if (x < 0)
......@@ -33,7 +33,7 @@ void RegleVoisinageMoore::calculVoisinage(Voisinage& v, const Reseau& r) const {
for (int i = -static_cast<int>(rayon); i <= static_cast<int>(rayon); i++)
for (int j = -static_cast<int>(rayon); j <= static_cast<int>(rayon); j++)
if (abs(i) <= static_cast<int>(rayon) && abs(j) <= static_cast<int>(rayon) && i != 0 && j != 0)
if (i != 0 || j != 0)
{
int x = (cellY+i)%hauteur;
if (x < 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment