diff --git a/GPA675Lab1GOL/GOLTeamH.h b/GPA675Lab1GOL/GOLTeamH.h index 8c5aa89..b2b77e0 100644 --- a/GPA675Lab1GOL/GOLTeamH.h +++ b/GPA675Lab1GOL/GOLTeamH.h @@ -1,9 +1,7 @@ #pragma once #include -#include #include -#include #include #include "GridTeamH.h" diff --git a/GPA675Lab1GOL/GridTeamH.cpp b/GPA675Lab1GOL/GridTeamH.cpp index 135000b..f510943 100644 --- a/GPA675Lab1GOL/GridTeamH.cpp +++ b/GPA675Lab1GOL/GridTeamH.cpp @@ -1,6 +1,6 @@ #include "GridTeamH.h" #include "GOL.h" -#include +#include // Constructeur Grid par défaut GridTeamH::GridTeamH() @@ -25,8 +25,8 @@ void GridTeamH::resize(size_t width, size_t height, CellType initValue) { mWidth = width; mHeight = height; - mData.resize((width * height) + width); - mIntermediateData.resize((width * height) + width); + mData.resize(width * height); + mIntermediateData.resize(width * height); fill(initValue, false); } @@ -170,21 +170,21 @@ void GridTeamH::fillBorder(CellType value) } // DROITE - e_ptr += mWidth * mHeight; + e_ptr += mWidth * (mHeight - 1); while (ptr < e_ptr) { *ptr = value; ptr += mWidth; } // DESSOUS - e_ptr -= mWidth; + e_ptr -= (mWidth - 1); while (ptr > e_ptr) { *ptr = value; ptr--; } // GAUCHE - e_ptr -= mWidth * mHeight; + e_ptr -= mWidth * (mHeight - 1); while (ptr > e_ptr) { *ptr = value; ptr -= mWidth; diff --git a/GPA675Lab1GOL/GridTeamH.h b/GPA675Lab1GOL/GridTeamH.h index 724242b..eb7315f 100644 --- a/GPA675Lab1GOL/GridTeamH.h +++ b/GPA675Lab1GOL/GridTeamH.h @@ -1,6 +1,5 @@ #pragma once -#include #include #include #include "GOL.h"