finalisation de la selection
This commit is contained in:
parent
6cb6b2f71a
commit
d07587c654
13
main.c
13
main.c
@ -2,6 +2,7 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#define FG_DEFAULT_BG_WHITE "\x1b[30;48;5;255m"
|
#define FG_DEFAULT_BG_WHITE "\x1b[30;48;5;255m"
|
||||||
#define FG_DEFAULT_BG_136 "\x1b[30;48;5;136m"
|
#define FG_DEFAULT_BG_136 "\x1b[30;48;5;136m"
|
||||||
@ -111,7 +112,7 @@ int print_tab() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int piece_selection() {
|
void piece_selection() {
|
||||||
|
|
||||||
if (y % 2 == 1) {
|
if (y % 2 == 1) {
|
||||||
if (x % 2 == 0) {
|
if (x % 2 == 0) {
|
||||||
@ -129,12 +130,10 @@ int piece_selection() {
|
|||||||
printf(FG_DEFAULT_BG_136"\x1b[%d;%dH%s", y - y_direction + 1 , (x - x_direction) * 2 + 1, piece_to_str(board[y - y_direction][x - x_direction]));
|
printf(FG_DEFAULT_BG_136"\x1b[%d;%dH%s", y - y_direction + 1 , (x - x_direction) * 2 + 1, piece_to_str(board[y - y_direction][x - x_direction]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
printf("\x1b[%d;%dH\x1b[39;106m%s", y + 1 , x * 2 + 1, piece_to_str(board[y][x]));
|
||||||
|
|
||||||
printf("\x1b[%d;%dH\x1b[39;49ma", y + 1 , x * 2 + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int controls() {
|
void controls() {
|
||||||
piece_selection();
|
piece_selection();
|
||||||
|
|
||||||
|
|
||||||
@ -194,10 +193,12 @@ int controls() {
|
|||||||
piece_selection();
|
piece_selection();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 113:
|
||||||
|
printf("\x1b[?25h");
|
||||||
|
exit(0);
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user