Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _WIN32_WINNT 0x0600
- #define STRICT
- #include <vector>
- #include <dos.h>
- #include <dir.h>
- #include <iostream>
- #include <stdio.h>
- #include <stdlib.h>
- #include <conio.h>
- #include <io.h>
- #include <shlwapi.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <windows.h>
- #include <cwchar>
- #include <winreg.h>
- #include <Wincon.h>
- #define _O_U16TEXT 0x20000
- #define _O_U8TEXT 0x40000
- #define SVETLO 0
- #define TAMNO 1
- #define SIVO 2
- #define BELO 0
- #define CRNO 1
- #define NEUTRALNO 0
- #define IZABRANO 1
- #define NAPADNUTO 2
- #define TOP L"♜ "
- #define KONJ L"♞ "
- #define LOVAC L"♝ "
- #define KRALJICA L"♛ "
- #define KRALJ L"♚ "
- #define PIJUN L"♟ "
- #define PRAZNO L" "
- #define TACKA L"" // ● ꞏ ⚫
- using namespace std;
- typedef struct _CONSOLE_SCREEN_BUFFER_INFOEX
- {
- ULONG cbSize;
- COORD dwSize;
- COORD dwCursorPosition;
- WORD wAttributes;
- SMALL_RECT srWindow;
- COORD dwMaximumWindowSize;
- WORD wPopupAttributes;
- BOOL bFullscreenSupported;
- COLORREF ColorTable[16];
- } CONSOLE_SCREEN_BUFFER_INFOEX, *PCONSOLE_SCREEN_BUFFER_INFOEX;
- typedef struct _CONSOLE_FONT_INFOEX
- {
- ULONG cbSize;
- DWORD nFont;
- COORD dwFontSize;
- UINT FontFamily;
- UINT FontWeight;
- WCHAR FaceName[LF_FACESIZE];
- } CONSOLE_FONT_INFOEX, *PCONSOLE_FONT_INFOEX;
- #ifdef __cplusplus
- extern "C" {
- #endif
- BOOL WINAPI SetCurrentConsoleFontEx(HANDLE hConsoleOutput, BOOL bMaximumWindow, PCONSOLE_FONT_INFOEX lpConsoleCurrentFontEx);
- #ifdef __cplusplus
- }
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- BOOL WINAPI GetConsoleScreenBufferInfoEx(HANDLE hConsoleOutput, PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx);
- #ifdef __cplusplus
- }
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- BOOL WINAPI SetConsoleScreenBufferInfoEx(HANDLE hConsoleOutput, PCONSOLE_SCREEN_BUFFER_INFOEX lpConsoleScreenBufferInfoEx);
- #ifdef __cplusplus
- }
- #endif
- void SakriKursor();
- void ObrisiEkran();
- void gotoxy(int x, int y);
- int UcitajKlik(int &x, int &y);
- void CentrirajKonzolu();
- short boja = SVETLO;
- typedef struct
- {
- short bojaPolja;
- short stanjePolja;
- wchar_t figura[10];
- short bojaFigure;
- } Polje;
- typedef struct
- {
- Polje polje[8][8];
- } Tabla;
- void PodesiVelicinu(int i);
- void PodesiKonzolu();
- void PodesiKonzolu2();
- void NapraviTablu(Tabla &tabla);
- void OdstampajTablu(Tabla tabla);
- void ObrisiKonzoluPodesavanja()
- {
- RegDeleteKeyA(HKEY_CURRENT_USER, "Console\\C:_Program Files (x86)_CodeBlocks_cb_console_runner.exe");
- RegDeleteKeyA(HKEY_CURRENT_USER, "Console\\");
- RegDeleteKeyA(HKEY_CURRENT_USER, "Console");
- }
- void OdstampajKonzolu()
- {
- // gear
- HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
- _setmode(_fileno(stdout), _O_U8TEXT);
- gotoxy(0, 0);
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 45);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 93);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 141);
- wprintf(L""); // save
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 46);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 94);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 142);
- wprintf(L""); // open
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 44);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 92);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 140);
- wprintf(L""); // restart
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 36);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 87);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 138);
- wprintf(L""); // color
- wprintf(L""); // resize
- // if(boja == SVETLO)
- // SetConsoleTextAttribute(console, 43);
- // else if(boja == TAMNO)
- // SetConsoleTextAttribute(console, 91);
- // else if(boja == SIVO)
- // SetConsoleTextAttribute(console, 139);
- wprintf(L""); // back
- wprintf(L" "); // space
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 47);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 95);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 143);
- wprintf(L""); // info
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 44);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 92);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 140);
- wprintf(L"\n"); // quit
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 36);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 87);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 138);
- wprintf(L"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
- wprintf(L"┏━━━━━┓ ┏━━━━━┓ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┃ ┃ ┃ ┃ \n");
- wprintf(L"┗━━━━━┛ ┗━━━━━┛ \n");
- wprintf(L"┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ \n");
- wprintf(L"┃ ┃ \n");
- wprintf(L"┃ ┃ \n");
- wprintf(L"┃ ┃ \n");
- wprintf(L"┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ");
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 85);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 102);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 153);
- gotoxy(2, 13);
- wprintf(L"████████████████████████████████");
- gotoxy(2, 14);
- wprintf(L"████████████████████████████████");
- gotoxy(2, 15);
- wprintf(L"████████████████████████████████");
- gotoxy(2, 3);
- wprintf(L"████");
- gotoxy(2, 4);
- wprintf(L"████");
- gotoxy(2, 5);
- wprintf(L"████");
- gotoxy(2, 6);
- wprintf(L"████");
- gotoxy(2, 7);
- wprintf(L"████");
- gotoxy(2, 8);
- wprintf(L"████");
- gotoxy(2, 9);
- wprintf(L"████");
- gotoxy(2, 10);
- wprintf(L"████");
- gotoxy(30, 3);
- wprintf(L"████");
- gotoxy(30, 4);
- wprintf(L"████");
- gotoxy(30, 5);
- wprintf(L"████");
- gotoxy(30, 6);
- wprintf(L"████");
- gotoxy(30, 7);
- wprintf(L"████");
- gotoxy(30, 8);
- wprintf(L"████");
- gotoxy(30, 9);
- wprintf(L"████");
- gotoxy(30, 10);
- wprintf(L"████");
- if(boja == SVETLO)
- SetConsoleTextAttribute(console, 68);
- else if(boja == TAMNO)
- SetConsoleTextAttribute(console, 119);
- else if(boja == SIVO)
- SetConsoleTextAttribute(console, 170);
- gotoxy(8, 2);
- wprintf(L"████████████████████");
- gotoxy(8, 3);
- wprintf(L"██");
- gotoxy(8, 4);
- wprintf(L"██");
- gotoxy(8, 5);
- wprintf(L"██");
- gotoxy(8, 6);
- wprintf(L"██");
- gotoxy(8, 7);
- wprintf(L"██");
- gotoxy(8, 8);
- wprintf(L"██");
- gotoxy(8, 9);
- wprintf(L"██");
- gotoxy(8, 10);
- wprintf(L"██");
- gotoxy(26, 3);
- wprintf(L"██");
- gotoxy(26, 4);
- wprintf(L"██");
- gotoxy(26, 5);
- wprintf(L"██");
- gotoxy(26, 6);
- wprintf(L"██");
- gotoxy(26, 7);
- wprintf(L"██");
- gotoxy(26, 8);
- wprintf(L"██");
- gotoxy(26, 9);
- wprintf(L"██");
- gotoxy(26, 10);
- wprintf(L"██");
- gotoxy(8, 11);
- wprintf(L"████████████████████");
- }
- int main()
- {
- Tabla tabla;
- NapraviTablu(tabla);
- vector<Tabla> istorija(0);
- istorija.push_back(tabla);
- ObrisiKonzoluPodesavanja();
- PodesiKonzolu();
- CentrirajKonzolu();
- PodesiKonzolu2();
- OdstampajKonzolu();
- OdstampajTablu(istorija[0]);
- int x, y, i = 35;
- HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
- _setmode(_fileno(stdout), _O_U8TEXT);
- SetConsoleTextAttribute(console, 2);
- do
- {
- UcitajKlik(x, y);
- if(y == 0 && (x == 6 || x == 7))
- {
- boja++;
- if(boja == 3)
- boja = 0;
- OdstampajKonzolu();
- OdstampajTablu(istorija[0]);
- }
- else if(y == 0 && (x == 8 || x == 9))
- {
- PodesiVelicinu(i);
- if(i == 35)
- i = 20;
- else if(i == 20)
- i = 29;
- else if(i == 29)
- i = 35;
- CentrirajKonzolu();
- CentrirajKonzolu();
- system("MODE 36, 18");
- PodesiKonzolu2();
- OdstampajKonzolu();
- OdstampajTablu(istorija[0]);
- }
- }
- while(1);
- // int x, y;
- // int i = 0, j = 0;
- //
- //
- // while(1)
- // {
- // SakriKursor();
- // //ObrisiEkran();
- // UcitajKlik(x, y);
- //// gotoxy(x,y);
- // //SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 238);
- //// _setmode(_fileno(stdout), _O_U8TEXT);
- //// wprintf(L"█");//}
- // //system("cls");
- //
- // gotoxy(3, 4);
- // printf("1");
- // gotoxy(8, 10);
- // printf("2");
- // gotoxy(12, 3);
- // printf("3");
- // gotoxy(17, 6);
- // printf("4");
- //
- // gotoxy(0, 0);
- // printf(" ", x, y);
- // gotoxy(0, 0);
- // printf("%d , %d", x, y); //}
- // gotoxy(i, 1);
- //
- // if(x == 3 && y == 4)
- // printf("a");
- //
- // if(x == 8 && y == 10)
- // printf("b");
- //
- // if(x == 12 && y == 3)
- // printf("c");
- //
- // if(x == 17 && y == 6)
- // printf("d");
- //
- // i++;
- // }
- SakriKursor();
- ObrisiKonzoluPodesavanja();
- Sleep(999999999);
- return 0;
- }
- void NapraviTablu(Tabla &tabla)
- {
- for(int i = 0; i < 8; i++)
- for(int j = 0; j < 8; j++)
- {
- tabla.polje[i][j].stanjePolja = NEUTRALNO;
- if((i + j) % 2 == 0)
- tabla.polje[i][j].bojaPolja = BELO;
- else
- tabla.polje[i][j].bojaPolja = CRNO;
- }
- for(int i = 0; i < 2; i++)
- for(int j = 0; j < 8; j++)
- {
- tabla.polje[i][j].bojaFigure = CRNO;
- tabla.polje[i + 6][j].bojaFigure = BELO;
- }
- for(int j = 0; j < 8; j++)
- {
- wcscpy(tabla.polje[1][j].figura, PIJUN);
- wcscpy(tabla.polje[6][j].figura, PIJUN);
- }
- wcscpy(tabla.polje[0][0].figura, TOP);
- wcscpy(tabla.polje[0][7].figura, TOP);
- wcscpy(tabla.polje[7][0].figura, TOP);
- wcscpy(tabla.polje[7][7].figura, TOP);
- wcscpy(tabla.polje[0][1].figura, KONJ);
- wcscpy(tabla.polje[0][6].figura, KONJ);
- wcscpy(tabla.polje[7][1].figura, KONJ);
- wcscpy(tabla.polje[7][6].figura, KONJ);
- wcscpy(tabla.polje[0][2].figura, LOVAC);
- wcscpy(tabla.polje[0][5].figura, LOVAC);
- wcscpy(tabla.polje[7][2].figura, LOVAC);
- wcscpy(tabla.polje[7][5].figura, LOVAC);
- wcscpy(tabla.polje[0][3].figura, KRALJICA);
- wcscpy(tabla.polje[7][3].figura, KRALJICA);
- wcscpy(tabla.polje[0][4].figura, KRALJ);
- wcscpy(tabla.polje[7][4].figura, KRALJ);
- for(int i = 2; i < 6; i++)
- for(int j = 0; j < 8; j++)
- {
- tabla.polje[i][j].bojaFigure = BELO;
- wcscpy(tabla.polje[i][j].figura, PRAZNO);
- }
- }
- void SakriKursor()
- {
- HANDLE consoleHandle = GetStdHandle(STD_OUTPUT_HANDLE);
- CONSOLE_CURSOR_INFO info;
- info.dwSize = 100;
- info.bVisible = FALSE;
- SetConsoleCursorInfo(consoleHandle, &info);
- }
- void ObrisiEkran()
- {
- HANDLE hStdOut;
- CONSOLE_SCREEN_BUFFER_INFO csbi;
- DWORD count;
- DWORD cellCount;
- COORD homeCoords = {0, 0};
- hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
- if (hStdOut == INVALID_HANDLE_VALUE)
- return;
- GetConsoleScreenBufferInfo(hStdOut, &csbi);
- cellCount = csbi.dwSize.X * csbi.dwSize.Y;
- FillConsoleOutputCharacter(hStdOut, (TCHAR) ' ', cellCount, homeCoords, &count);
- FillConsoleOutputAttribute(hStdOut, csbi.wAttributes, cellCount, homeCoords, &count);
- SetConsoleCursorPosition(hStdOut, homeCoords);
- }
- void gotoxy(int x, int y)
- {
- COORD koordinate;
- koordinate.X = x;
- koordinate.Y = y;
- SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), koordinate);
- }
- int UcitajKlik(int &x, int &y)
- {
- DWORD info;
- INPUT_RECORD input;
- HANDLE in = GetStdHandle(STD_INPUT_HANDLE);
- SetConsoleMode(in, ENABLE_PROCESSED_INPUT | ENABLE_MOUSE_INPUT);
- ReadConsoleInput(in, &input, 1, &info);
- if(input.Event.MouseEvent.dwButtonState != 0x0001)
- {
- GOBACK:
- ReadConsoleInput(in, &input, 1, &info);
- if(input.Event.MouseEvent.dwButtonState == 0x0001)
- {
- GOBACK2:
- ReadConsoleInput(in, &input, 1, &info);
- if(input.Event.MouseEvent.dwButtonState != 0x0001)
- {
- x = input.Event.MouseEvent.dwMousePosition.X;
- y = input.Event.MouseEvent.dwMousePosition.Y;
- }
- else
- goto GOBACK2;
- }
- else
- goto GOBACK;
- }
- else
- UcitajKlik(x, y);
- return 0;
- }
- void CentrirajKonzolu()
- {
- RECT rectClient, rectWindow;
- HWND hWnd = GetConsoleWindow();
- GetClientRect(hWnd, &rectClient);
- GetWindowRect(hWnd, &rectWindow);
- int posx, posy;
- posx = GetSystemMetrics(SM_CXSCREEN) / 2 - (rectWindow.right - rectWindow.left) / 2;
- posy = GetSystemMetrics(SM_CYSCREEN) / 2 - (rectWindow.bottom - rectWindow.top) / 2;
- SetWindowPos(GetConsoleWindow(), HWND_TOP, posx, posy, 0, 0, SWP_NOSIZE);
- }
- void PodesiKonzolu()
- {
- HWND consoleWindow = GetConsoleWindow();
- SetWindowLong(consoleWindow, GWL_STYLE, GetWindowLong(consoleWindow, GWL_STYLE) & ~WS_MAXIMIZEBOX & ~WS_SIZEBOX);
- SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS);
- SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE), ENABLE_EXTENDED_FLAGS);
- _setmode(_fileno(stdout), _O_U8TEXT);
- SetConsoleTitleW(L"ŠAH");
- _setmode(_fileno(stdout), _O_TEXT);
- if(boja == SVETLO)
- system("color 23");
- else if(boja == TAMNO)
- system("color 56");
- else if(boja == SIVO)
- system("color 89");
- _CONSOLE_SCREEN_BUFFER_INFOEX info;
- info.cbSize = sizeof(info);
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- GetConsoleScreenBufferInfoEx(hConsole, &info);
- info.dwSize = {36, 19};
- info.ColorTable[0] = RGB(242, 242, 242);
- info.ColorTable[1] = RGB(10, 10, 10);
- info.ColorTable[2] = RGB(198, 175, 141);
- info.ColorTable[3] = RGB(114, 71, 56);
- info.ColorTable[4] = RGB(50, 31, 26);
- info.ColorTable[5] = RGB(132, 94, 73);
- info.ColorTable[6] = RGB(73, 47, 37);
- info.ColorTable[7] = RGB(22, 11, 4);
- info.ColorTable[8] = RGB(158, 158, 158);
- info.ColorTable[9] = RGB(102, 102, 102);
- info.ColorTable[10] = RGB(43, 43, 43);
- info.ColorTable[11] = RGB(0, 119, 65);
- info.ColorTable[12] = RGB(126, 33, 35);
- info.ColorTable[13] = RGB(10, 10, 130);
- info.ColorTable[14] = RGB(240, 191, 40);
- info.ColorTable[15] = RGB(255, 255, 255);
- SetConsoleScreenBufferInfoEx(hConsole, &info);
- PodesiVelicinu(29);
- SakriKursor();
- system("MODE 36, 18");
- }
- void PodesiKonzolu2()
- {
- _CONSOLE_SCREEN_BUFFER_INFOEX info;
- info.cbSize = sizeof(info);
- HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- GetConsoleScreenBufferInfoEx(hConsole, &info);
- info.dwSize = {36, 17};
- SetConsoleScreenBufferInfoEx(hConsole, &info);
- }
- void PodesiVelicinu(int i)
- {
- CONSOLE_FONT_INFOEX cfi;
- cfi.cbSize = sizeof(cfi);
- cfi.nFont = 0;
- cfi.dwFontSize.X = 0;
- cfi.dwFontSize.Y = i;
- cfi.FontFamily = TMPF_TRUETYPE;
- cfi.FontWeight = FW_NORMAL;
- std::wcscpy(cfi.FaceName, L"MS Gothic");
- SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
- }
- void OdstampajTablu(Tabla tabla)
- {
- HANDLE console = GetStdHandle(STD_OUTPUT_HANDLE);
- _setmode(_fileno(stdout), _O_U8TEXT);
- for(int i = 0; i < 8; i++)
- for(int j = 0; j < 8; j++)
- {
- if(tabla.polje[i][j].stanjePolja == IZABRANO && tabla.polje[i][j].bojaFigure == CRNO)
- SetConsoleTextAttribute(console, 177);
- else if(tabla.polje[i][j].stanjePolja == IZABRANO && tabla.polje[i][j].bojaFigure == BELO)
- SetConsoleTextAttribute(console, 176);
- else if(tabla.polje[i][j].stanjePolja == NAPADNUTO && tabla.polje[i][j].bojaFigure == CRNO)
- SetConsoleTextAttribute(console, 193);
- else if(tabla.polje[i][j].stanjePolja == NAPADNUTO && tabla.polje[i][j].bojaFigure == BELO)
- SetConsoleTextAttribute(console, 192);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == SVETLO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 32);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == SVETLO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 33);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == TAMNO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 80);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == TAMNO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 81);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == SIVO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 128);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == SIVO && tabla.polje[i][j].bojaPolja == BELO)
- SetConsoleTextAttribute(console, 129);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == SVETLO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 48);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == SVETLO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 49);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == TAMNO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 96);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == TAMNO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 97);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == BELO && boja == SIVO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 144);
- else if(tabla.polje[i][j].stanjePolja == NEUTRALNO && tabla.polje[i][j].bojaFigure == CRNO && boja == SIVO && tabla.polje[i][j].bojaPolja == CRNO)
- SetConsoleTextAttribute(console, 145);
- gotoxy(10 + j * 2, 3 + i);
- wprintf(tabla.polje[i][j].figura);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement