#include <iostream>
#include <windows.h>
using namespace std;
void clearboard (void)
{
char board[5][5] = {{' ','|',' ','|',' '},
{'-','-','-','-','-'},
{' ','|',' ','|',' '},
{'-','-','-','-','-'},
{' ','|',' ','|',' '}};
}
void printboard(char board[5][5])
{
for(int n=0;n<5;n++)
{
for(int m=0;m<5;m++)
{
std::cout << board[n][m];
}
std::cout << std::endl;
}
}
int main()
{
srand (time(NULL)); //makes 5 traps random
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); //enables us to change text and background color
cout<<" ";
SetConsoleTextAttribute(hConsole, ( BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_INTENSITY));
cout<<" TIC TAC TOE "<<endl;
SetConsoleTextAttribute(hConsole, (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY));
system("pause");
clearboard();
printboard();
system("pause");
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPiAKI2luY2x1ZGUgPHdpbmRvd3MuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnZvaWQgY2xlYXJib2FyZCAodm9pZCkKewpjaGFyIGJvYXJkWzVdWzVdID0ge3snICcsJ3wnLCcgJywnfCcsJyAnfSwKICAgICAgICAgICAgICAgICAgIHsnLScsJy0nLCctJywnLScsJy0nfSwKICAgICAgICAgICAgICAgICAgIHsnICcsJ3wnLCcgJywnfCcsJyAnfSwKICAgICAgICAgICAgICAgICAgIHsnLScsJy0nLCctJywnLScsJy0nfSwKICAgICAgICAgICAgICAgICAgIHsnICcsJ3wnLCcgJywnfCcsJyAnfX07Cgp9Cgp2b2lkIHByaW50Ym9hcmQoY2hhciBib2FyZFs1XVs1XSkKewoKICAgIGZvcihpbnQgbj0wO248NTtuKyspIAogICAgewogICAgICAgIGZvcihpbnQgbT0wO208NTttKyspIAogICAgICAgIHsKICAgICAgICAgICAgc3RkOjpjb3V0IDw8IGJv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