From 20498ae56ed5578f12c3b8c3a30d516bcac20868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Leclaire-Fournier?= Date: Sat, 10 Feb 2024 16:41:43 -0500 Subject: [PATCH] =?UTF-8?q?Change=20le=20fonctionnement=20de=20notre=20bor?= =?UTF-8?q?der=20pour=20matcher=20celui=20de=20r=C3=A9f=C3=A9rence=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GPA675Lab1GOL/GOLTeamH.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index 0df310b..1104c63 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -333,6 +333,7 @@ bool GOLTeamH::setFromPattern(std::string const& pattern, int centerX, int cente return false; fillDataFromPattern(sq.value(), centerX + 1, centerY + 1); + setBorder(); mIteration = 0; countLifeStatusCells(); @@ -358,6 +359,7 @@ bool GOLTeamH::setFromPattern(std::string const& pattern) return false; fillDataFromPattern(sq.value(), (mData.width() / 2) + 1, (mData.height() / 2) + 1); + setBorder(); mIteration = 0; countLifeStatusCells(); @@ -561,7 +563,7 @@ std::optional GOLTeamH::parsePattern(std::string const& p void GOLTeamH::fillDataFromPattern(sizeQueried& sq, int centerX, int centerY) { - mData.fill(State::dead, false); + mData.fill(State::dead, true); // Remplissage de la grille aux positions spécifiées par le patron for (size_t y = 0; y < sq.height; ++y) {