Correct field's initialization

This commit is contained in:
2025-07-07 02:33:19 +03:00
parent d4d3ade78b
commit f13bf95ba2
11 changed files with 265 additions and 14 deletions

29
include/Game.h Normal file
View File

@@ -0,0 +1,29 @@
#pragma once
#include "Player.h"
#include <cstdlib>
#include <iostream>
constexpr auto SIZE = 10;
constexpr auto SIZE_FOR_ARRAY = SIZE - 1;
class Game {
private:
char field[SIZE][SIZE];
std::unique_ptr<Player[]> gamers;
public:
Game() : gamers(std::make_unique<Player[]>(2)) {
for (int i = 0; i < SIZE; ++i) {
for (int j = 0; j < SIZE; ++j) {
field[i][j] = '*';
}
}
};
void info();
void init();
void play();
private:
void clearScreen();
void print_field();
};