Выбор граничных условий

This commit is contained in:
2024-12-03 19:17:26 +03:00
parent a3b00e15e2
commit 1d5ed538c3
3 changed files with 30 additions and 6 deletions

View File

@@ -42,7 +42,13 @@ int main()
cout << "Заполнить поле случайными значениями? (yes/no)\n";
bool fillWithRandom = userApprove();
CellularAutomaton ca(fieldWidth, fieldHeight, fillWithRandom);
cout << "\nВыберите граничные условия:\n"
"Нулевые (0)\n"
"Единичные (1)\n"
"Торроидальные (2)\n\n";
BoundaryCondition boundaryCondition = static_cast<BoundaryCondition>(inputNumber(0, 2));
CellularAutomaton ca(fieldWidth, fieldHeight, fillWithRandom, boundaryCondition);
clear();
cout << "\nИтерация 0:\n";
@@ -55,7 +61,7 @@ int main()
ca.displayField();
}
cout << "Нажмите на enter, чтобы продолжить...";
cout << "\nНажмите на enter, чтобы продолжить...";
waitForEnter();
}
}