Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Toolbox.cpp
diff options
context:
space:
mode:
Commite3e26c2e27d4fbd0c1af683ea2248b8e61e6663e (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:31:31 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-05-06 10:31:31 +0300
Files38caadf96dc563b990c351b2d625cd18550144f0 /src/ConsoleInterface/Toolbox.cpp
FMI-OOP-P1_TicketSystem-e3e26c2e27d4fbd0c1af683ea2248b8e61e6663e.tar
FMI-OOP-P1_TicketSystem-e3e26c2e27d4fbd0c1af683ea2248b8e61e6663e.tar.gz
FMI-OOP-P1_TicketSystem-e3e26c2e27d4fbd0c1af683ea2248b8e61e6663e.zip
Parentebe5e280c9fc35b4937804ad9fd0bec600da4158 (diff)
Autocommit at 06.05.2022 @ 10:31
1 files changed, 8 insertions, 8 deletions
-rw-r--r--src/ConsoleInterface/Toolbox.cpp16
diff --git a/src/ConsoleInterface/Toolbox.cpp b/src/ConsoleInterface/Toolbox.cpp
index d534337..a47d004 100644
--- a/src/ConsoleInterface/Toolbox.cpp
+++ b/src/ConsoleInterface/Toolbox.cpp
@@ -43,29 +43,29 @@ void __printTableColumnHeader(unsigned start, unsigned count) {
std::cout << ":" << std::endl;
for (unsigned i = 0; i <= count; i++)
- std::cout << "++++";
- std::cout << "+" << std::endl;
+ std::cout << "====";
+ std::cout << "=" << std::endl;
}
void __printTableLine(unsigned columns) {
- std::cout << "++++";
+ std::cout << ":---";
for (unsigned i = 0; i < columns; i++)
- std::cout << " ";
- std::cout << "+" << std::endl;
+ std::cout << "----";
+ std::cout << ":" << std::endl;
}
void table(unsigned startNumber, unsigned columns, const char* items) {
__printTableColumnHeader(startNumber, columns);
__printTableHeaderNumber(startNumber);
- for (unsigned i = 0, colInd = 1, rowInd = 1; items[i] != '\0'; i++, (++colInd) %= (columns + 1)) {
+ for (unsigned i = 0, colInd = 1, rowInd = 0; items[i] != '\0'; i++, (++colInd) %= columns) {
if (colInd == 0) {
std::cout << ":" << std::endl;
__printTableLine(columns);
- __printTableHeaderNumber((rowInd++) + startNumber);
+ __printTableHeaderNumber((++rowInd) + startNumber);
}
- std::cout << "| " << items[rowInd * columns + colInd] << " ";
+ std::cout << ((colInd == 0) ? ": " : "| ") << items[rowInd * columns + colInd] << " ";
}
}