Выбор заполнения

This commit is contained in:
2024-12-03 15:22:40 +03:00
parent 7b1b2dd62b
commit 07d8a83ebe
3 changed files with 8 additions and 6 deletions

View File

@@ -1,12 +1,12 @@
#include "CellularAutomaton.h"
CellularAutomaton::CellularAutomaton(int width, int height) : m_fieldWidth(width), m_fieldHeight(height)
CellularAutomaton::CellularAutomaton(int width, int height, bool fillWithRandom) : m_fieldWidth(width), m_fieldHeight(height)
{
field.resize(m_fieldHeight, std::vector<int>(m_fieldWidth, 0));
fieldNextState.resize(m_fieldHeight, std::vector<int>(m_fieldWidth, 0));
//initializeRandom();
initializeManual();
if (fillWithRandom) initializeRandom();
else initializeManual();
}