45 lines
953 B
C++
45 lines
953 B
C++
#include <iostream>
|
|
#include "io.h"
|
|
#include "CellularAutomaton.h"
|
|
|
|
using namespace std;
|
|
|
|
void clear() {
|
|
system("cls");
|
|
}
|
|
|
|
|
|
int main()
|
|
{
|
|
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);
|
|
}
|
|
} |