projects
/
sgk-go
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WIP commit for two player mode.
[sgk-go]
/
interface
/
play_ascii.c
diff --git
a/interface/play_ascii.c
b/interface/play_ascii.c
index
f091af9
..
a89a9d4
100644
(file)
--- a/
interface/play_ascii.c
+++ b/
interface/play_ascii.c
@@
-178,13
+178,6
@@
set_handicap_spots(int boardsize)
return;
}
return;
}
-#define WHITECOLOR "\x1B[41m"
-#define BLACKCOLOR "\x1B[44m"
-#define RESETCOLOR "\x1B[0m"
-
-#define BACK1COLOR "\x1B[43m"
-#define BACK2COLOR "\x1B[47m"
-
/*
* Display the board position when playing in ASCII.
*/
/*
* Display the board position when playing in ASCII.
*/
@@
-203,8
+196,8
@@
ascii_showboard(void)
set_handicap_spots(board_size);
printf("\n");
set_handicap_spots(board_size);
printf("\n");
- printf(" White (
" WHITECOLOR " " RESETCOLOR "
) has captured %d pieces\n", black_captured);
- printf(" Black (
" BLACKCOLOR " " RESETCOLOR "
) has captured %d pieces\n", white_captured);
+ printf(" White (
O
) has captured %d pieces\n", black_captured);
+ printf(" Black (
X
) has captured %d pieces\n", white_captured);
if (showscore) {
if (current_score_estimate == NO_SCORE)
printf(" No score estimate is available yet.\n");
if (showscore) {
if (current_score_estimate == NO_SCORE)
printf(" No score estimate is available yet.\n");
@@
-244,59
+237,35
@@
ascii_showboard(void)
switch (BOARD(i, j) + pos_is_move + last_pos_was_move) {
case EMPTY + 128:
case EMPTY:
switch (BOARD(i, j) + pos_is_move + last_pos_was_move) {
case EMPTY + 128:
case EMPTY:
- if (i % 2 == 0) {
- if (j % 2 == 0) {
- printf(BACK1COLOR " " RESETCOLOR);
- } else {
- printf(BACK2COLOR " " RESETCOLOR);
- }
- } else {
- if (j % 2 == 0) {
- printf(BACK2COLOR " " RESETCOLOR);
- } else {
- printf(BACK1COLOR " " RESETCOLOR);
- }
- }
+ printf(" %c", hspots[i][j]);
last_pos_was_move = 0;
break;
case BLACK:
last_pos_was_move = 0;
break;
case BLACK:
- printf(
BLACKCOLOR " " RESETCOLOR
);
+ printf(
" %c", dead ? 'x' : 'X'
);
last_pos_was_move = 0;
break;
case WHITE:
last_pos_was_move = 0;
break;
case WHITE:
- printf(
WHITECOLOR " " RESETCOLOR
);
+ printf(
" %c", dead ? 'o' : 'O'
);
last_pos_was_move = 0;
break;
case BLACK + 128:
last_pos_was_move = 0;
break;
case BLACK + 128:
- printf(
BLACKCOLOR "()" RESETCOLOR
);
- last_pos_was_move =
0
;
+ printf(
"(%c)", 'X'
);
+ last_pos_was_move =
256
;
break;
case WHITE + 128:
break;
case WHITE + 128:
- printf(
WHITECOLOR "()" RESETCOLOR
);
- last_pos_was_move =
0
;
+ printf(
"(%c)", 'O'
);
+ last_pos_was_move =
256
;
break;
case EMPTY + 256:
break;
case EMPTY + 256:
- if (i % 2 == 0) {
- if (j % 2 == 0) {
- printf(BACK1COLOR " " RESETCOLOR);
- } else {
- printf(BACK2COLOR " " RESETCOLOR);
- }
- } else {
- if (j % 2 == 0) {
- printf(BACK2COLOR " " RESETCOLOR);
- } else {
- printf(BACK1COLOR " " RESETCOLOR);
- }
- }
+ printf("%c", hspots[i][j]);
last_pos_was_move = 0;
break;
case BLACK + 256:
last_pos_was_move = 0;
break;
case BLACK + 256:
- printf(
BLACKCOLOR " " RESETCOLOR
);
+ printf(
"%c", dead ? 'x' : 'X'
);
last_pos_was_move = 0;
break;
case WHITE + 256:
last_pos_was_move = 0;
break;
case WHITE + 256:
- printf(
WHITECOLOR " " RESETCOLOR
);
+ printf(
"%c", dead ? 'o' : 'O'
);
last_pos_was_move = 0;
break;
default:
last_pos_was_move = 0;
break;
default: