Косметические правки
This commit is contained in:
@@ -12,7 +12,7 @@ enum BoundaryCondition {
|
||||
|
||||
class CellularAutomaton
|
||||
{
|
||||
static const unsigned int functionValues = 0b00000110100000000010110010110110;
|
||||
static const unsigned int functionValues = 25 * 11 * 2003 * 18 * 11;
|
||||
|
||||
int m_fieldWidth, m_fieldHeight;
|
||||
std::vector<std::vector<int>> field;
|
||||
|
||||
@@ -6,6 +6,7 @@ using namespace std;
|
||||
|
||||
void clear() {
|
||||
system("cls");
|
||||
cout << "Вариант: 00000110100000000010110010110110\n\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -16,20 +17,23 @@ int main()
|
||||
while (true) {
|
||||
clear();
|
||||
|
||||
cout << "Выберите способ вычисления функции:\n"
|
||||
"Запустить клеточный автомат (0)\n"
|
||||
"Завершить работу (1)\n\n";
|
||||
|
||||
int actionId = inputNumber(0, 1);
|
||||
cout << "Выберите граничные условия:\n"
|
||||
"Единичные (0)\n"
|
||||
"Нулевые (1)\n"
|
||||
"Торроидальные (2)\n"
|
||||
"Завершить работу (3)\n\n";
|
||||
int actionId = inputNumber(0, 3);
|
||||
|
||||
clear();
|
||||
|
||||
if (actionId == 1) {
|
||||
if (actionId == 3) {
|
||||
cout << "Выйти из программы? (yes/no)\n";
|
||||
if (userApprove()) return 0;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
BoundaryCondition boundaryCondition = static_cast<BoundaryCondition>(actionId);
|
||||
|
||||
cout << "Укажите ширину поля (min 1): ";
|
||||
int fieldWidth = inputNumber(1);
|
||||
|
||||
@@ -42,12 +46,6 @@ int main()
|
||||
cout << "Заполнить поле случайными значениями? (yes/no)\n";
|
||||
bool fillWithRandom = userApprove();
|
||||
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user