From c1e0777fdf3fd8084a9fd2eff4735584ad1e633c Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 6 May 2022 10:01:22 +0300 Subject: Autocommit at 06.05.2022 @ 10:01 --- src/ConsoleInterface/Toolbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ConsoleInterface/Toolbox.cpp') diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp index 31e5277..402711f 100644 --- a/src/ConsoleInterface/Toolbox.cpp +++ b/src/ConsoleInterface/Toolbox.cpp @@ -53,14 +53,14 @@ void __printTableLine(unsigned columns) { void table(unsigned startNumber, unsigned columns, const char* items) { __printTableColumnHeader(startNumber, columns); - for (unsigned i = 0, colInd = 0, rowCnt = startNumber; items[i] != '\0'; i++, (++colInd) %= columns) { + for (unsigned i = 0, colInd = 0, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) { if (colInd == 0) { + std::cout << "|" << std::endl; __printTableLine(columns); - __printTableHeaderNumber(rowCnt++); - continue; + __printTableHeaderNumber((rowInd++) + startNumber); } - std::cout << items[rowCnt * columns + colInd] << std::endl; + std::cout << "| " << items[rowInd * columns + colInd] << " "; } } -- cgit v1.3.1-23-gd82d