feat: added input (player_one and player_two now can place on board)
This commit is contained in:
+7
-1
@@ -3,9 +3,15 @@
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
void Window::update_display() {
|
||||
void Window::update_display(Tile (&tile_list)[9], Border (&border_list)[16]) {
|
||||
for(std::array<char, COL> &row : m_board) { row.fill('.'); }
|
||||
// Modify board
|
||||
for(int i = 0; i < 9; i++) {
|
||||
m_board[tile_list[i].m_pos.m_row][tile_list[i].m_pos.m_col] = tile_list[i].m_symbol;
|
||||
}
|
||||
for(int i = 0; i < 16; i++) {
|
||||
m_board[border_list[i].m_pos.m_row][border_list[i].m_pos.m_col] = border_list[i].m_symbol;
|
||||
}
|
||||
|
||||
// Refresh and draw screen
|
||||
std::cout << "\033[H" << std::flush;
|
||||
|
||||
Reference in New Issue
Block a user