Случайная инициализация и вывод поля
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include <random>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
class CellularAutomaton
|
||||
{
|
||||
int m_fieldWidth, m_fieldHeight;
|
||||
std::vector<std::vector<int>> field;
|
||||
std::vector<std::vector<int>> fieldNextState;
|
||||
|
||||
void initializeRandom();
|
||||
public:
|
||||
CellularAutomaton(int width, int height);
|
||||
|
||||
void displayField() const;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user