#include <iostream>
#include <vector>
enum Piece {
EMPTY,
BLACK,
WHITE
};
class Gobang {
public:
Gobang() : board(19, std::vector<Piece>(19, EMPTY)) {}
void set(int row, int col, Piece piece) {
board[row][col] = piece;
}
Piece get(int row, int col) const {
return board[row][col];
}
bool isValidMove(int row, int col) const {
return get(row, col) == EMPTY;
}
void print() const {
for (int i = 0; i < 19; ++i) {
for (int j = 0; j < 19; ++j) {
switch (board[i][j]) {
case EMPTY: std::cout << "·"; break;
case BLACK: std::cout << "●"; break;
case WHITE: std::cout << "○"; break;
}
}
std::cout << std::endl;
}
}
private:
std::vector<std::vector<Piece>> board;
};
int main() {
Gobang game;
game.set(2, 3, BLACK);
game.set(3, 4, WHITE);
game.print();
return 0;
}
08-27