Code:
int screen[10][8] = {1, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0, 0, 0,
1, 1, 1, 0, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 0, 0, 0, 0,
1, 1, 1, 1, 1, 0, 0, 0,
1, 1, 1, 1, 1, 0, 0, 0,
1, 1, 1, 1, 1, 1, 0, 0,
1, 1, 1, 1, 1, 1, 1, 0,
1, 1, 1, 1, 1, 1, 1, 1}; //[row][column] 10 down eight across
//"draw" your triangle
for (int row = 0; row < 9; row++){
for (int column = 0; column < 7; column++){
if (screen[row][column] == 1){
cout << "#";
}
else{
cout << "-";
}
}
cout << "\n";
}
cout << "\n";
//flip # into - and vice versa
for (int row = 1; row < 10; row++){ // for some reason 0 and 9 was making this get offset by one line? however this should make it go out of the array... but it doesn't...
for (int column = 7; column > 0; column--){//draw last column first and first column last, thus flipping the image horizontally
if (screen[row][column] == 1){
cout << "#";
}
else{
cout << "-";
}
}
cout << "\n";
}
cout << "\n";