Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- char spots[]{'X','X','X','O','X','O','X','O','O'};
- void color(int num)
- {
- HANDLE color=GetStdHandle(STD_OUTPUT_HANDLE);
- SetConsoleTextAttribute(color, num);
- }
- void boardCase1()
- {
- cout<<endl;
- cout<<"\t\t ";
- color(10);
- cout<<spots[0];
- color(7);
- cout<<" | ";
- color(10);
- cout<<spots[1];
- color(7);
- cout<<" | ";
- color(10);
- cout<<spots[2];
- color(7);
- cout<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase2()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase3()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase4()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase5()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase6()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase7()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase8()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase9()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase10()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase11()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase12()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase13()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase14()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase15()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase16()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase17()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase18()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase19()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- void boardCase20()
- {
- cout<<endl;
- cout<<"\t\t "<<spots[0]<<" | "<<spots[1]<<" | "<<spots[2]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[3]<<" | "<<spots[4]<<" | "<<spots[5]<<" "<<endl;
- cout<<"\t\t---+---+---"<<endl;
- cout<<"\t\t "<<spots[6]<<" | "<<spots[7]<<" | "<<spots[8]<<" "<<endl;
- cout<<endl;
- }
- int main()
- {
- boardCase1();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement