From 45172556e64edac54a85f17d13a8bc6cb4f4f9d1 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 6 May 2022 10:36:33 +0300 Subject: Autocommit at 06.05.2022 @ 10:36 --- src/ConsoleInterface/Toolbox.cpp | 10 +++++----- src/VenueConsoleUI.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp index a47d004..5331be9 100644 --- a/src/ConsoleInterface/Toolbox.cpp +++ b/src/ConsoleInterface/Toolbox.cpp @@ -48,9 +48,9 @@ void __printTableColumnHeader(unsigned start, unsigned count) { } void __printTableLine(unsigned columns) { - std::cout << ":---"; + std::cout << ":==="; for (unsigned i = 0; i < columns; i++) - std::cout << "----"; + std::cout << "+---"; std::cout << ":" << std::endl; } @@ -58,14 +58,14 @@ void table(unsigned startNumber, unsigned columns, const char* items) { __printTableColumnHeader(startNumber, columns); __printTableHeaderNumber(startNumber); - for (unsigned i = 0, colInd = 1, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) { - if (colInd == 0) { + for (unsigned i = 0, colInd = 0, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) { + if (colInd == 0 && i != 0) { std::cout << ":" << std::endl; __printTableLine(columns); __printTableHeaderNumber((++rowInd) + startNumber); } - std::cout << ((colInd == 0) ? ": " : "| ") << items[rowInd * columns + colInd] << " "; + std::cout << "| " << items[rowInd * columns + colInd] << " "; } } diff --git a/src/VenueConsoleUI.cpp b/src/VenueConsoleUI.cpp index 42cca85..c18d0cd 100644 --- a/src/VenueConsoleUI.cpp +++ b/src/VenueConsoleUI.cpp @@ -33,7 +33,7 @@ void handleStatusCode(StatusCode sc, Menu menu) { /* Ticket Management */ void command_freeSeats() { - table(0, 10, " A B C D E F G "); + table(0, 11, " A B C D E F G "); /* char name[MAX_LINE_WIDTH]; inputLineBox("Enter event name: ", name, MAX_LINE_WIDTH); -- cgit v1.3.1-26-gb76a