get nullptr'd lol

This commit is contained in:
2024-03-09 23:17:44 -06:00
parent 5088bded35
commit 756d08231a
107 changed files with 9646 additions and 1888 deletions

View File

@@ -143,6 +143,9 @@ std::vector<int> getRowMap(std::vector<std::tuple<int, int>> locationVector, int
std::string printVector(std::vector<int> arr, std::vector<int> locationVector = {-1}) {
std::string output = "{";
std::map<std::string, int> columnMap;
if (locationVector[0] != -1) {
printf("%s", printVector(locationVector).c_str());
}
for (int i = 0; i < arr.size(); ++i) {
// check if iteration value matches one of the locationVector values. If it does, append an ASCII color sequence.
if (binarySearch(locationVector, i) == i) {
@@ -153,6 +156,7 @@ std::string printVector(std::vector<int> arr, std::vector<int> locationVector =
output.append(", ");
}
if (binarySearch(locationVector, i) == i) {
output.append(COLOR_WHITE.c_str());
}
}
@@ -187,3 +191,17 @@ std::vector<std::vector<int>> random2DArray(int x, int y) {
}
return array;
}
std::vector<std::tuple<int, int>> highlightEveryOther(int x, int y) {
std::vector<std::tuple<int, int>> returnVector;
for (int i = 0; i < x; ++i) {
for (int j = 0; j < y; ++j) {
if ((j + i) % 2 == 0) {
//printf("(%i, %i), ", i, j);
returnVector.push_back({i, j});
}
}
}
printf("\n");
return returnVector;
}