Skip to content

Commit 3286000

Browse files
authored
Merge pull request #35 from Waahan/LoopOver
Loop over the sorting algorithms
2 parents 6461d79 + 74bdc99 commit 3286000

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ int main()
8484
system(CLEAR);
8585
std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl;
8686
}
87+
else {
88+
//Go to the first sorting algorithm
89+
sortType = 0;
90+
system(CLEAR);
91+
std::cout << "Sort changed to " << Utils::getSortType(sortType) << std::endl;
92+
}
8793
break;
8894

8995
// Change sort type (decrease)
@@ -93,6 +99,16 @@ int main()
9399
system(CLEAR);
94100
std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl;
95101
}
102+
else {
103+
//Go to the last sorting algorithm
104+
while(Utils::hasNextSortType(sortType))
105+
{
106+
sortType++;
107+
}
108+
109+
system(CLEAR);
110+
std::cout << "Sort changed to: " << Utils::getSortType(sortType) << std::endl;
111+
}
96112
break;
97113

98114
// Change number of elements

0 commit comments

Comments
 (0)