Заготовка CellularAutomaton
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user