Im not sure about this, its my first actual functioning and cool project i made yeah its not really a big project, but its a start, well here it is:
// Online C++ compiler to run C++ program online
#include <iostream>
#include <string>
int main() {
int arr[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
while (true){
for(int i = 0; i < 9; i++){
std::cout << arr[i] << " \n";
}
int choice;
int temp;
std::cout << "choose which to turn on (1-9): ";
std::cin >> choice;
switch (choice){
case 1:
arr[0] = temp;
arr[0] = 1;
break;
case 2:
arr[1] = temp;
arr[1] = 1;
break;
case 3:
arr[2] = temp;
arr[2] = 1;
break;
case 4:
arr[3] = temp;
arr[3] = 1;
break;
case 5:
arr[4] = temp;
arr[4] = 1;
break;
case 6:
arr[5] = temp;
arr[5] = 1;
break;
case 7:
arr[6] = temp;
arr[6] = 1;
break;
case 8:
arr[7] = temp;
arr[7] = 1;
break;
case 9:
arr[8] = temp;
arr[8] = 1;
break;
}
}
}
code is messy i guess but its nice to see that it works, adding switching off functions soon though.