Заготовка CellularAutomaton

This commit is contained in:
2024-12-03 14:14:43 +03:00
parent dea4067621
commit 7e9540f10c
5 changed files with 58 additions and 1 deletions

View File

@@ -1,9 +1,45 @@
#include <iostream>
#include "io.h"
#include "CellularAutomaton.h"
using namespace std;
void clear() {
system("cls");
}
int main()
{
std::cout << "Hello World!\n";
setlocale(LC_ALL, "Russian");
while (true) {
skipIter:
clear();
cout << "Выберите способ вычисления функции:\n"
"Запустить клеточный автомат (0)\n"
"Завершить работу (1)\n\n";
int actionId = inputNumber(0, 1);
clear();
if (actionId == 1) {
cout << "Выйти из программы? (yes/no)\n";
if (userApprove()) return 0;
goto skipIter;
}
cout << "Укажите ширину поля (min 1): ";
int fieldWidth = inputNumber(1);
cout << "Укажите высоту поля (min 1): ";
int fieldHeight = inputNumber(1);
cout << "Укажите количество итераций (min 1): ";
int iterationsCount = inputNumber(1);
CellularAutomaton(fieldWidth, fieldHeight);
}
}