Created
March 11, 2013 16:32
-
-
Save imduffy15/5135508 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
string blackSquare = "\033[0;37;40m \033[0m"; | |
string whiteSquare = "\033[0;37;47m \033[0m"; | |
string currentColor = blackSquare; | |
for(int rows=0;rows<8;rows++) { | |
for(int cols=0;cols<8;cols++) { | |
cout << currentColor; | |
currentColor = currentColor == blackSquare ? whiteSquare : blackSquare; | |
} | |
currentColor = currentColor == blackSquare ? whiteSquare : blackSquare; | |
cout << "\n"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment