fork download
  1. #include <iostream>
  2. #include <windows.h>
  3. using namespace std;
  4.  
  5. void clearboard (void)
  6. {
  7. char board[5][5] = {{' ','|',' ','|',' '},
  8. {'-','-','-','-','-'},
  9. {' ','|',' ','|',' '},
  10. {'-','-','-','-','-'},
  11. {' ','|',' ','|',' '}};
  12.  
  13. }
  14.  
  15. void printboard(char board[5][5])
  16. {
  17.  
  18. for(int n=0;n<5;n++)
  19. {
  20. for(int m=0;m<5;m++)
  21. {
  22. std::cout << board[n][m];
  23. }
  24. std::cout << std::endl;
  25. }
  26. }
  27.  
  28.  
  29.  
  30. int main()
  31. {
  32. srand (time(NULL)); //makes 5 traps random
  33. HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); //enables us to change text and background color
  34.  
  35.  
  36.  
  37. cout<<" ";
  38. SetConsoleTextAttribute(hConsole, ( BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY | FOREGROUND_BLUE | FOREGROUND_INTENSITY));
  39. cout<<" TIC TAC TOE "<<endl;
  40. SetConsoleTextAttribute(hConsole, (FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY));
  41. system("pause");
  42.  
  43. clearboard();
  44. printboard();
  45.  
  46. system("pause");
  47. return 0;
  48. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:21: fatal error: windows.h: No such file or directory
compilation terminated.
stdout
Standard output is empty