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 <unistd.h>
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define FG_DEFAULT_BG_WHITE "\x1b[30;48;5;255m"
|
||||
#define FG_DEFAULT_BG_136 "\x1b[30;48;5;136m"
|
||||
@ -111,7 +112,7 @@ int print_tab() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int piece_selection() {
|
||||
void piece_selection() {
|
||||
|
||||
if (y % 2 == 1) {
|
||||
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("\x1b[%d;%dH\x1b[39;49ma", y + 1 , x * 2 + 1);
|
||||
printf("\x1b[%d;%dH\x1b[39;106m%s", y + 1 , x * 2 + 1, piece_to_str(board[y][x]));
|
||||
}
|
||||
|
||||
int controls() {
|
||||
void controls() {
|
||||
piece_selection();
|
||||
|
||||
|
||||
@ -194,10 +193,12 @@ int controls() {
|
||||
piece_selection();
|
||||
}
|
||||
break;
|
||||
case 113:
|
||||
printf("\x1b[?25h");
|
||||
exit(0);
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user