feat: first time using setw but its interesting; used in window for numbers

This commit is contained in:
DarthMooMancer
2025-09-08 20:06:57 -04:00
parent 63344fb83b
commit 4c1d4d5185
5 changed files with 34 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
#include "window.hpp"
#include <iomanip>
#include <iostream>
#include <thread>
void Window::draw_window() {
// for(std::array<int, COL> &row : m_board) { row.fill(0); }
std::cout << "\033[H" << std::flush;
for(int i = 0; i < ROW; i++) {
for(int j = 0; j < COL; j++) {
if(m_board[i][j] == 0) std::cout << std::setw(4) << '.';
else std::cout << std::setw(4) << m_board[i][j];
}
std::cout << "\r\n";
}
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}