Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include "conio2.h"
- using namespace std;
- #define SUDOKU_BOARD 18
- #define SUDOKU_SIZE 9
- #define HORIZONTAL_LINE 196
- #define VERTICAL_LINE 179
- #define PLUS_SIGN 197
- ////RYSOWANIE/////
- void rysuj_sudoku()
- {
- for (int i = 0; i <=SUDOKU_BOARD; i++)
- {
- for (int j = 0; j <=SUDOKU_BOARD; j++)
- {
- if (i == 0 || i == 6 || i == 12 || i == 18 || j == 0 || j == 6 || j == 12 || j == 18)
- putch('#');
- else if (i % 2 == 0 && j % 2 == 0)
- putch(197);
- else if (i % 2 == 0)
- putch(196);
- else if (j % 2 == 0)
- putch(179);
- else cputs(" ");
- }
- cout << endl;
- }
- };
- int main()
- {
- int zn, x=40, y=12, attr = 7;
- settitle("imie nazwisko nr_indeksu");
- textbackground(BLACK);
- do {
- textcolor(7);
- clrscr();
- rysuj_sudoku();
- gotoxy(55, 1);
- cputs("q = wyjscie");
- gotoxy(55, 2);
- cputs("strzalki = poruszanie");
- gotoxy(55, 3);
- cputs("spacja = zmiana koloru");
- gotoxy(x,y);
- textcolor(attr);
- putch('@');
- zn = getch();
- if (zn == 0) {
- zn = getch();
- if (zn == 0x48) y--;
- else if (zn == 0x50) y++;
- else if (zn == 0x4b) x--;
- else if (zn == 0x4d) x++;
- }
- else if (zn == ' ') attr = (attr + 1) % 16;
- } while (zn != 'q');
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement