From 74bdc99b6d1d4064524e6a892a5de87c46ede096 Mon Sep 17 00:00:00 2001 From: Waahan Date: Tue, 17 Oct 2023 16:43:33 -0400 Subject: [PATCH] Loop over the sorting algorithms instead of just stopping on the first and last --- src/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index ec706e7..95d7133 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,6 +84,12 @@ int main() system(CLEAR); std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl; } + else { + //Go to the first sorting algorithm + sortType = 0; + system(CLEAR); + std::cout << "Sort changed to " << Utils::getSortType(sortType) << std::endl; + } break; // Change sort type (decrease) @@ -93,6 +99,16 @@ int main() system(CLEAR); std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl; } + else { + //Go to the last sorting algorithm + while(Utils::hasNextSortType(sortType)) + { + sortType++; + } + + system(CLEAR); + std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl; + } break; // Change number of elements