I need help making a lights out game using a regular command prompt.
It is 5 rows by 5 columns using a matrix and by showing to the user the results using “cout” statements and two different characters, one for ON and one for OFF. The user has to enter the row and column to change.
Code:
0 0 0 0 0
0 0 1 0 0
0 1 1 1 0
0 0 1 0 0
0 0 0 0 0
Col: 2
Row: 2
lights on (1) : 5
lights off (0) : 20
Number of moves: 1
This is what I have so far, but I don't know where to go from there.
Thank You!
Code:
#include <iostream>
using namespace std;
main ()
{
int row1, col1
const int size = 5;
char on[5][5] ={{'0','0','0','0','0'},
{'0','0','0','0','0'},
{'0','0','0','0','0'},
{'0','0','0','0','0'},
{'0','0','0','0','0'}};
for (int row = 0; row < size; row ++)
{
for(int col = 0; col < size; col++)
{
cout << on[row][col];
}
cout << endl;
}
return 0;
}