BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnushogi.bbk\"
-# The language file describes capabilities of the program. It may
-# be useful for customizing gnushogi for non-English-speaking players.
-
-LANGF = -DLANGFILE=\"../misc/gnushogi.lng\"
-
-
# The pattern file contains various opening patterns. The program tries to
# obtain such a pattern in the opening stage. Sequences of opening
# patterns may be described in order to support the correct order of moves.
$(CC) $(CFLAGS) -c $<
init.o: init.c
- $(CC) $(CFLAGS) $(LANGF) -c $<
+ $(CC) $(CFLAGS) -c $<
main.o: main.c
$(CC) $(CFLAGS) $(BINBOOK) -c $<
# Files specific to particular targets.
pat2inc.o: pat2inc.c
- $(CC) $(CFLAGS) $(LANGF) $(BINBOOK) $(PATTERN) -c $<
+ $(CC) $(CFLAGS) $(BINBOOK) $(PATTERN) -c $<
sizetest.o: sizetest.c
$(CC) $(CFLAGS) -c $<
UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
/* Illegal move in check */
#if !defined QUIETBOOKGEN
- /* 077: "Illegal move (in check) %s" */
- puts(CP[77]);
+ puts("Illegal move (in check) %s");
bkdisplay(s, cnt, moveno);
#endif
return false;
/* Illegal move */
#if !defined QUIETBOOKGEN
- /* 075: "Illegal move (no match)%s\n" */
- printf(CP[75], s);
+ printf("Illegal move (no match) %s\n", s);
bkdisplay(s, cnt, moveno);
#endif
return false;
}
- /* 213: "Book used %d(%d)." */
- sprintf(msg, CP[213], B.bookcount, B.booksize);
+ sprintf(msg, "Book used %d(%d).", B.bookcount, B.booksize);
ShowMessage(msg);
}
/* Now get ready to play .*/
if (!B.bookcount)
{
- /* 212: "Can't find book." */
- ShowMessage(CP[212]);
+ ShowMessage("Can't find book.");
Book = 0;
}
}
if (SqAttacked(PieceList[opponent][0], computer, &blocked))
{
UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
- AlwaysShowMessage(CP[77], s);
+ AlwaysShowMessage("Illegal move (in check) %s", s);
return false;
}
else
}
}
- AlwaysShowMessage(CP[76], s);
+ AlwaysShowMessage("Illegal move (no match) %s", s);
if (!barebones && (cnt > 1))
{
- sprintf(buffer, CP[32], s);
+ sprintf(buffer, "Ambiguous Move %s!", s);
ShowMessage(buffer);
}
if (savefile[0]) {
strcpy(fname, savefile);
} else {
- /* Enter file name */
- ShowMessage(CP[63]);
+ ShowMessage("Enter file name: ");
RequestInputString(fname, sizeof(fname)-1);
}
- /* shogi.000 */
if (fname[0] == '\0')
- strcpy(fname, CP[137]);
+ strcpy(fname, "shogi.000");
if ((fd = fopen(fname, "r")) != NULL)
{
}
skip();
- g->color = ((*InPtr == CP[119][0]) ? white : black);
+ g->color = ((*InPtr == 'W') ? white : black);
skip();
g->piece = (*InPtr == '+'
? promoted[piece]
if (savefile[0]) {
strcpy(fname, savefile);
} else {
- /* Enter file name */
- ShowMessage(CP[63]);
+ ShowMessage("Enter file name: ");
RequestInputString(fname, sizeof(fname)-1);
}
- if (fname[0] == '\0') /* shogi.000 */
- strcpy(fname, CP[137]);
+ if (fname[0] == '\0')
+ strcpy(fname, "shogi.000");
if ((fd = fopen(fname, "w")) != NULL)
{
char *b, *w;
- b = w = CP[74];
+ b = w = "Human ";
if (computer == white)
- w = CP[141];
+ w = "computer";
if (computer == black)
- b = CP[141];
+ b = "computer";
- fprintf(fd, CP[37], w, b, Game50,
+ fprintf(fd, "White %s Black %s %d %s\n", w, b, Game50,
flag.force ? "force" : "");
fputs(empty, fd);
- fprintf(fd, CP[111], TCflag, OperatorTime);
- fprintf(fd, CP[117],
+ fprintf(fd, "TimeControl %d Operator Time %d\n", TCflag, OperatorTime);
+ fprintf(fd, "Black Clock %ld Moves %d\nWhite Clock %ld Moves %d\n",
TimeControl.clock[black], TimeControl.moves[black],
TimeControl.clock[white], TimeControl.moves[white]);
fputs(empty, fd);
}
fputs(empty, fd);
- fputs(CP[126], fd);
+ fputs(" move score depth nodes time flags capture\n", fd);
for (i = 1; i <= GameCnt; i++)
{
fclose(fd);
- /* Game saved */
- ShowMessage(CP[70]);
+ ShowMessage("Game saved");
}
else
{
- /* ShowMessage("Could not open file"); */
- ShowMessage(CP[48]);
+ ShowMessage("Could not open file");
}
}
short sq;
short side, isp;
- /* Enter file name */
- ShowMessage(CP[63]);
+ ShowMessage("Enter file name: ");
RequestInputString(fname, sizeof(fname)-1);
- if (fname[0] == '\0') /* XSHOGI.position.read */
- strcpy(fname, CP[205]);
+ if (fname[0] == '\0')
+ strcpy(fname, "xshogi.position.read");
if ((fd = fopen(fname, "r")) != NULL)
{
#ifdef notdef
fname[6] = '\0';
- if (strcmp(fname, CP[206]))
+ if (strcmp(fname, "xshogi"))
return;
#endif
short sq, piece;
short side, isp;
- /* Enter file name */
- ShowMessage(CP[63]);
+ ShowMessage("Enter file name: ");
RequestInputString(fname, sizeof(fname)-1);
- if (fname[0] == '\0') /* XSHOGI.position.read */
- strcpy(fname, CP[205]);
+ if (fname[0] == '\0')
+ strcpy(fname, "xshogi.position.read");
if ((fd = fopen(fname, "w")) != NULL)
{
- /* xshogi position file ... */
fputs("# xshogi position file -- \n", fd);
- /* -- empty line -- */
fputs("\n", fd);
- /* -- empty line -- */
fputs("\n", fd);
for (i = NO_ROWS - 1; i > -1; i--)
strcpy(fname, savefile);
} else {
/* Enter file name */
- ShowMessage(CP[63]);
+ ShowMessage("Enter file name: ");
RequestInputString(fname, sizeof(fname)-1);
}
fclose(fd);
- /* Game saved */
- ShowMessage(CP[70]);
+ ShowMessage("Game saved");
}
else
{
- /* ShowMessage("Could not open file"); */
- ShowMessage(CP[48]);
+ ShowMessage("Could not open file");
}
}
if (!fd)
{
- printf(CP[219], fname);
+ printf("Open failure for file: %s", fname);
exit(1);
}
- /* fprintf(fd, "gnushogi game %d\n", u); */
- fprintf(fd, CP[161], version, patchlevel);
- fputs(CP[10], fd);
- fputs(CP[11], fd);
+ fprintf(fd, "gnushogi %sp%s game\n", version, patchlevel);
+ fputs(" score depth nodes time ", fd);
+ fputs(" score depth nodes time\n", fd);
for (i = 1; i <= GameCnt; i++)
{
if (GameList[GameCnt].flags & draw)
{
- fprintf(fd, CP[54], DRAW);
+ fprintf(fd, "Draw %s\n", DRAW);
- if (DRAW == CP[101])
+ if (DRAW == DRAW_REPETITION)
{
short j;
int m, t, sec;
sec = 0;
- time = &s[strlen(CP[228])];
+ time = &s[strlen("otime")];
t = (int)strtol(time, &time, 10);
if (*time == ':')
char *time;
int m, t, sec;
- time = &s[strlen(CP[197])];
+ time = &s[strlen("time")];
sec = 0;
t = (int)strtol(time, &time, 10);
if (s[0] == '\0')
continue;
- if (strcmp(s, CP[131]) == 0) /* bd -- display board */
+ if (strcmp(s, "bd") == 0) /* bd -- display board */
{
/* FIXME: Hack alert! */
short old_xshogi = XSHOGI;
{
flag.post = !flag.post;
}
- else if (strcmp(s, CP[129]) == 0)
+ else if (strcmp(s, "alg") == 0)
{
/* noop */ ; /* alg */
}
- else if ((strcmp(s, CP[180]) == 0)
- || (strcmp(s, CP[216]) == 0)) /* quit exit */
+ else if ((strcmp(s, "quit") == 0)
+ || (strcmp(s, "exit") == 0))
{
flag.quit = true;
}
#if !defined NOPOST
- else if (strcmp(s, CP[178]) == 0) /* post */
+ else if (strcmp(s, "post") == 0)
{
flag.post = !flag.post;
}
#endif
- else if ((strcmp(s, CP[191]) == 0)
- || (strcmp(s, CP[154]) == 0)) /* set edit */
+ else if ((strcmp(s, "set") == 0)
+ || (strcmp(s, "edit") == 0))
{
EditBoard();
}
- else if ((strcmp(s, CP[190]) == 0)) /* setup */
+ else if ((strcmp(s, "setup") == 0))
{
SetupBoard();
}
- else if (strcmp(s, CP[156]) == 0) /* first */
+ else if (strcmp(s, "first") == 0)
{
ok = true;
}
- else if (strcmp(s, CP[162]) == 0) /* go */
+ else if (strcmp(s, "go") == 0)
{
ok = true;
flag.force = false;
opponent = white;
}
}
- else if (strcmp(s, CP[166]) == 0) /* help */
+ else if (strcmp(s, "help") == 0)
{
help();
}
- else if (strcmp(s, CP[221]) == 0) /* material */
+ else if (strcmp(s, "material") == 0)
{
flag.material = !flag.material;
}
- else if (strcmp(s, CP[157]) == 0) /* force */
+ else if (strcmp(s, "force") == 0)
{
if (XSHOGI)
{
flag.bothsides = false;
}
}
- else if (strcmp(s, CP[134]) == 0) /* book */
+ else if (strcmp(s, "book") == 0)
{
Book = Book ? 0 : BOOKFAIL;
}
- else if (strcmp(s, CP[172]) == 0) /* new */
+ else if (strcmp(s, "new") == 0)
{
NewGame();
UpdateDisplay(0, 0, 1, 0);
}
- else if (strcmp(s, CP[171]) == 0) /* list */
+ else if (strcmp(s, "list") == 0)
{
ListGame();
}
- else if ((strcmp(s, CP[169]) == 0)
- || (strcmp(s, CP[217]) == 0)) /* level clock */
+ else if ((strcmp(s, "level") == 0)
+ || (strcmp(s, "clock") == 0))
{
SelectLevel(sx);
}
- else if (strcmp(s, CP[165]) == 0) /* hash */
+ else if (strcmp(s, "hash") == 0)
{
flag.hash = !flag.hash;
}
- else if (strcmp(s, CP[227]) == 0) /* gamein */
+ else if (strcmp(s, "gamein") == 0)
{
flag.gamein = !flag.gamein;
}
- else if (strcmp(s, CP[226]) == 0) /* beep */
+ else if (strcmp(s, "beep") == 0)
{
flag.beep = !flag.beep;
}
- else if (strcmp(s, CP[197]) == 0) /* time */
+ else if (strcmp(s, "time") == 0)
{
SetMachineTime(sx);
}
- else if (strcmp(s, CP[228]) == 0) /* otime */
+ else if (strcmp(s, "otime") == 0)
{
SetOppTime(sx);
}
- else if (strcmp(s, CP[33]) == 0) /* Awindow */
+ else if (strcmp(s, "Awindow") == 0)
{
ChangeAlphaWindow();
}
- else if (strcmp(s, CP[39]) == 0) /* Bwindow */
+ else if (strcmp(s, "Bwindow") == 0)
{
ChangeBetaWindow();
}
- else if (strcmp(s, CP[183]) == 0) /* rcptr */
+ else if (strcmp(s, "rcptr") == 0)
{
flag.rcptr = !flag.rcptr;
}
- else if (strcmp(s, CP[168]) == 0) /* hint */
+ else if (strcmp(s, "hint") == 0)
{
GiveHint();
}
- else if (strcmp(s, CP[135]) == 0) /* both */
+ else if (strcmp(s, "both") == 0)
{
flag.bothsides = !flag.bothsides;
flag.force = false;
SelectMove(opponent, FOREGROUND_MODE);
ok = true;
}
- else if (strcmp(s, CP[185]) == 0) /* reverse */
+ else if (strcmp(s, "reverse") == 0)
{
flag.reverse = !flag.reverse;
ClearScreen();
UpdateDisplay(0, 0, 1, 0);
}
- else if (strcmp(s, CP[195]) == 0) /* switch */
+ else if (strcmp(s, "switch") == 0)
{
computer = computer ^ 1;
opponent = opponent ^ 1;
Sdepth = 0;
ok = true;
}
- else if (strcmp(s, CP[203]) == 0) /* black */
+ else if (strcmp(s, "black") == 0)
{
computer = white;
opponent = black;
* ok = true; don't automatically start with black command
*/
}
- else if (strcmp(s, CP[133]) == 0) /* white */
+ else if (strcmp(s, "white") == 0)
{
computer = black;
opponent = white;
* ok = true; don't automatically start with white command
*/
}
- else if (strcmp(s, CP[201]) == 0 && GameCnt > 0) /* undo */
+ else if (strcmp(s, "undo") == 0 && GameCnt > 0)
{
Undo();
}
- else if (strcmp(s, CP[184]) == 0 && GameCnt > 1) /* remove */
+ else if (strcmp(s, "remove") == 0 && GameCnt > 1)
{
Undo();
Undo();
}
/* CHECKME: are these next three correct? */
- else if (!XSHOGI && strcmp(s, CP[207]) == 0) /* xget */
+ else if (!XSHOGI && strcmp(s, "xget") == 0)
{
GetXGame();
}
- else if (!XSHOGI && strcmp(s, "xsave") == 0) /* xsave */
+ else if (!XSHOGI && strcmp(s, "xsave") == 0)
{
SaveXGame();
}
- else if (!XSHOGI && strcmp(s, "bsave") == 0) /* bsave */
+ else if (!XSHOGI && strcmp(s, "bsave") == 0)
{
BookSave();
}
{
FlagMove(*s);
}
- else if (strcmp(s, CP[160]) == 0) /* get */
+ else if (strcmp(s, "get") == 0)
{
GetGame();
}
- else if (strcmp(s, CP[189]) == 0) /* save */
+ else if (strcmp(s, "save") == 0)
{
SaveGame();
}
- else if (strcmp(s, CP[151]) == 0) /* depth */
+ else if (strcmp(s, "depth") == 0)
{
ChangeSearchDepth();
}
- else if (strcmp(s, CP[164]) == 0) /* hashdepth */
+ else if (strcmp(s, "hashdepth") == 0)
{
ChangeHashDepth();
}
- else if (strcmp(s, CP[182]) == 0) /* random */
+ else if (strcmp(s, "random") == 0)
{
dither = DITHER;
}
- else if (strcmp(s, CP[229]) == 0) /* hard */
+ else if (strcmp(s, "hard") == 0)
{
flag.easy = false;
}
- else if (strcmp(s, CP[152]) == 0) /* easy */
+ else if (strcmp(s, "easy") == 0)
{
flag.easy = !flag.easy;
}
- else if (strcmp(s, CP[230]) == 0) /* tsume */
+ else if (strcmp(s, "tsume") == 0)
{
flag.tsume = !flag.tsume;
}
- else if (strcmp(s, CP[143]) == 0) /* contempt */
+ else if (strcmp(s, "contempt") == 0)
{
SetContempt();
}
- else if (strcmp(s, CP[209]) == 0) /* xwndw */
+ else if (strcmp(s, "xwndw") == 0)
{
ChangeXwindow();
}
- else if (strcmp(s, CP[186]) == 0) /* rv */
+ else if (strcmp(s, "rv") == 0)
{
flag.rv = !flag.rv;
UpdateDisplay(0, 0, 1, 0);
}
- else if (strcmp(s, CP[145]) == 0) /* coords */
+ else if (strcmp(s, "coords") == 0)
{
flag.coords = !flag.coords;
UpdateDisplay(0, 0, 1, 0);
}
- else if (strcmp(s, CP[193]) == 0) /* stars */
+ else if (strcmp(s, "stars") == 0)
{
flag.stars = !flag.stars;
UpdateDisplay(0, 0, 1, 0);
}
- else if (!XSHOGI && strcmp(s, CP[5]) == 0) /* moves */
+ else if (!XSHOGI && strcmp(s, "moves") == 0)
{
short temp;
#endif
SwagHt = 0;
- ShowMessage(CP[108]); /* test movelist */
+ ShowMessage("Testing MoveList Speed");
temp = generate_move_flags;
generate_move_flags = true;
TestSpeed(MoveList, 1);
generate_move_flags = temp;
- ShowMessage(CP[107]); /* test capturelist */
+ ShowMessage("Testing CaptureList Speed");
TestSpeed(CaptureList, 1);
- ShowMessage(CP[85]); /* test score position */
+ ShowMessage("Testing Eval Speed");
ExaminePosition(opponent);
TestPSpeed(ScorePosition, 1);
}
- else if (!XSHOGI && strcmp(s, CP[196]) == 0) /* test */
+ else if (!XSHOGI && strcmp(s, "test") == 0)
{
#ifdef SLOW_CPU
- ShowMessage(CP[108]); /* test movelist */
+ ShowMessage("Testing MoveList Speed");
TestSpeed(MoveList, 2000);
- ShowMessage(CP[107]); /* test capturelist */
+ ShowMessage("Testing CaptureList Speed");
TestSpeed(CaptureList, 3000);
- ShowMessage(CP[85]); /* test score position */
+ ShowMessage("Testing Eval Speed");
ExaminePosition(opponent);
TestPSpeed(ScorePosition, 1500);
#else
- ShowMessage(CP[108]); /* test movelist */
+ ShowMessage("Testing MoveList Speed");
TestSpeed(MoveList, 20000);
- ShowMessage(CP[107]); /* test capturelist */
+ ShowMessage("Testing CaptureList Speed");
TestSpeed(CaptureList, 30000);
- ShowMessage(CP[85]); /* test score position */
+ ShowMessage("Testing Eval Speed");
ExaminePosition(opponent);
TestPSpeed(ScorePosition, 15000);
#endif
}
- else if (!XSHOGI && strcmp(s, CP[179]) == 0) /* p */
+ else if (!XSHOGI && strcmp(s, "p") == 0)
{
ShowPostnValues();
}
- else if (!XSHOGI && strcmp(s, CP[148]) == 0) /* debug */
+ else if (!XSHOGI && strcmp(s, "debug") == 0)
{
DoDebug();
}
if (rpt >= 3)
{
- DRAW = CP[101];
+ DRAW = DRAW_REPETITION;
ShowMessage(DRAW);
GameList[GameCnt].flags |= draw;
Curses_ShowDepth(char ch)
{
gotoXY(TAB, 4);
- printw(CP[53], Sdepth, ch); /* Depth = %d%c */
+ printw("Depth= %d%c ", Sdepth, ch);
ClearEoln();
}
ShowHeader(void)
{
gotoXY(TAB, 2);
- printw(CP[69], version, patchlevel);
+ printw("GNU Shogi %s (pl %s)", version, patchlevel);
}
Curses_ShowNodeCnt(long NodeCnt)
{
gotoXY(TAB, 22);
- /* printw(CP[90], NodeCnt, (et > 100) ? NodeCnt / (et / 100) : 0); */
+ /* printw("Nodes = %8ld, Nodes/Sec = %5ld", NodeCnt, (et > 100) ? NodeCnt / (et / 100) : 0); */
printw("n = %ld n/s = %ld",
NodeCnt, (et > 100) ? NodeCnt / (et / 100) : 0);
ClearEoln();
ShowPlayers(void)
{
gotoXY(5, ((flag.reverse) ? (5 + 2*NO_ROWS) : 2));
- printw("%s", (computer == white) ? CP[218] : CP[74]);
+ printw("%s", (computer == white) ? "Computer" : "Human ");
gotoXY(5, ((flag.reverse) ? 2 : (5 + 2*NO_ROWS)));
- printw("%s", (computer == black) ? CP[218] : CP[74]);
+ printw("%s", (computer == black) ? "Computer" : "Human ");
}
{
Curses_ShowSidetoMove();
gotoXY(TAB, 17);
- printw(CP[121]); /* Your move is? */
+ printw("Your move is? ");
ClearEoln();
}
{
short TCC = TCcount;
gotoXY(TAB, 21);
- /* printw("RT = %ld TCC = %d TCL = %ld EX = %ld ET = %ld TO = %d",
- ResponseTime, TCC, TCleft, ExtraTime, et, flag.timeout); */
printw("%ld, %d, %ld, %ld, %ld, %d",
ResponseTime, TCC, TCleft, ExtraTime, et, flag.timeout);
ClearEoln();
ShowScore(short score)
{
gotoXY(TAB, 5);
- printw(CP[104], score);
+ printw("Score= %d", score);
ClearEoln();
}
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
- Curses_ShowMessage(CP[31]); /* Abort? */
+ Curses_ShowMessage("Abort? ");
FLUSH_SCANW("%s", s);
- if (strcmp(s, CP[210]) == 0) /* yes */
+ if (strcmp(s, "yes") == 0)
Curses_ExitShogi();
signal(SIGINT, Curses_Die);
Curses_help(void)
{
Curses_ClearScreen();
- /* printw("GNU Shogi ??p? command summary\n"); */
- printw(CP[40], version, patchlevel);
+ printw("GNU Shogi %sp%s command summary\n", version, patchlevel);
printw("-------------------------------"
"---------------------------------\n");
- /* printw("7g7f move from 7g to 7f quit
- * Exit Shogi\n"); */
- printw(CP[158]);
- /* printw("S6h move silver to 6h beep
- * turn %s\n", (flag.beep) ? "off" : "on"); */
- printw(CP[86], (flag.beep) ? CP[92] : CP[93]);
- /* printw("2d2c+ move to 2c and promote\n"); */
- printw(CP[128], (flag.material) ? CP[92] : CP[93]);
- /* printw("P*5e drop a pawn to 5e easy
- * turn %s\n", (flag.easy) ? "off" : "on"); */
- printw(CP[173], (flag.easy) ? CP[92] : CP[93]);
- /* printw(" hash
- * turn %s\n", (flag.hash) ? "off" : "on"); */
- printw(CP[174], (flag.hash) ? CP[92] : CP[93]);
- /* printw("bd redraw board reverse
- * board display\n"); */
- printw(CP[130]);
- /* printw("list game to shogi.lst book
- * turn %s used %d of %d\n", (Book) ? "off" : "on", book
- count, booksize); */
- printw(CP[170], (Book) ? CP[92] : CP[93], bookcount, BOOKSIZE);
- /* printw("undo undo last ply remove
- * take back a move\n"); */
- printw(CP[200]);
- /* printw("edit edit board force
- * enter game moves\n"); */
- printw(CP[153]);
- /* printw("switch sides with computer both
- * computer match\n"); */
- printw(CP[194]);
- /* printw("black computer plays black white
- * computer plays white\n"); */
- printw(CP[202]);
- /* printw("depth set search depth clock
- * set time control\n"); */
- printw(CP[149]);
- /* printw("hint suggest a move post
- * turn %s principle variation\n", (flag.post) ? "off" :
- * "on"); */
- printw(CP[177], (flag.post) ? CP[92] : CP[93]);
- /* printw("save game to file get
- * game from file\n"); */
- printw(CP[188]);
- /* printw("random randomize play new
- * start new game\n"); */
- printw(CP[181]);
+ printw("7g7f move from 7g to 7f quit Exit Shogi\n");
+ printw("S6h move silver to 6h beep turn %s\n", (flag.beep) ? "OFF" : "ON");
+ printw("2d2c+ move to 2c and promote material turn %s\n", (flag.material) ? "OFF" : "ON");
+ printw("P*5e drop pawn to 5e easy turn %s\n", (flag.easy) ? "OFF" : "ON");
+ printw("tsume toggle tsume mode hash turn %s\n", (flag.hash) ? "OFF" : "ON");
+ printw("bd redraw board reverse board display\n");
+ printw("list game to shogi.lst book turn %s used %d of %d\n", (Book) ? "OFF" : "ON", bookcount, BOOKSIZE);
+ printw("undo undo last ply remove take back a move\n");
+ printw("edit edit board force toggle manual move mode\n");
+ printw("switch sides with computer both computer match\n");
+ printw("black computer plays black white computer plays white\n");
+ printw("depth set search depth clock set time control\n");
+ printw("post principle variation hint suggest a move\n", (flag.post) ? "OFF" : "ON");
+ printw("save game to file get game from file\n");
+ printw("random randomize play new start new game\n");
gotoXY(10, 20);
- printw(CP[47], ColorStr[computer]);
+ printw("Computer: %s", ColorStr[computer]);
gotoXY(10, 21);
- printw(CP[97], ColorStr[opponent]);
+ printw("Opponent: %s", ColorStr[opponent]);
gotoXY(10, 22);
- printw(CP[79], MaxResponseTime/100);
+ printw("Level: %ld", MaxResponseTime/100);
gotoXY(10, 23);
- printw(CP[59], (flag.easy) ? CP[93] : CP[92]);
+ printw("Easy mode: %s", (flag.easy) ? "ON" : "OFF");
gotoXY(25, 23);
- printw(CP[231], (flag.tsume) ? CP[93] : CP[92]);
+ printw("Tsume: %s", (flag.tsume) ? "ON" : "OFF");
gotoXY(40, 20);
- printw(CP[52], MaxSearchDepth);
+ printw("Depth: %d", MaxSearchDepth);
gotoXY(40, 21);
- printw(CP[100], (dither) ? CP[93] : CP[92]);
+ printw("Random: %s", (dither) ? "ON" : "OFF");
gotoXY(40, 22);
- printw(CP[112], (flag.hash) ? CP[93] : CP[92]);
+ printw("Transposition table: %s", (flag.hash) ? "ON" : "OFF");
gotoXY(40, 23);
- printw(CP[73]);
+ printw("Hit <RET> to return: ");
gotoXY(10, 24);
- printw(CP[110], (TCflag) ? CP[93] : CP[92],
+ printw("Time Control %s %d moves %d sec %d add %d depth\n", (TCflag) ? "ON" : "OFF",
TimeControl.moves[black],
TimeControl.clock[black] / 100,
OperatorTime, MaxSearchDepth);
Curses_ClearScreen();
Curses_UpdateDisplay(0, 0, 1, 0);
gotoXY(TAB, 3);
- printw(CP[29]);
+ printw(". Exit to main\n");
gotoXY(TAB, 4);
- printw(CP[28]);
+ printw("# Clear board\n");
gotoXY(TAB, 5);
- printw(CP[136]);
+ printw("c Change sides\n");
gotoXY(TAB, 7);
- printw(CP[64]);
+ printw("Enter piece & location: ");
a = black;
do
{
gotoXY(TAB, 6);
- printw(CP[60], ColorStr[a]); /* Editing %s */
+ printw("Editing: %s", ColorStr[a]);
gotoXY(TAB + 24, 7);
ClearEoln();
FLUSH_SCANW("%s", s);
- if (s[0] == CP[28][0]) /* # */
+ if (s[0] == '#')
{
for (sq = 0; sq < NO_SQUARES; sq++)
{
UpdateCatched();
}
- if (s[0] == CP[136][0]) /* c */
+ if (s[0] == 'c')
a = otherside[a];
if (s[1] == '*')
DrawPiece(sq);
}
}
- while (s[0] != CP[29][0]); /* . */
+ while (s[0] != '.');
for (sq = 0; sq < NO_SQUARES; sq++)
Mvboard[sq] = ((board[sq] != Stboard[sq]) ? 10 : 0);
if (flag.illegal)
{
- printw(CP[225]);
+ printw("Illegal position.");
return;
}
- printw(CP[84], mvstr[0]); /* My move is %s */
+ printw("My move is: %5s", mvstr[0]);
if (flag.beep)
putchar(7);
gotoXY(TAB, 18);
if (root->flags & draw)
- printw(CP[58]);
+ printw("Drawn game!");
else if (root->score == -(SCORE_LIMIT + 999))
- printw(CP[95]);
+ printw("Opponent mates!");
else if (root->score == SCORE_LIMIT + 998)
- printw(CP[44]);
+ printw("Computer mates!");
#ifdef VERYBUGGY
else if (root->score < -SCORE_LIMIT)
- printw(CP[96], SCORE_LIMIT + 999 + root->score - 1);
+ printw("Opp: mate in %d!", SCORE_LIMIT + 999 + root->score - 1);
else if (root->score > SCORE_LIMIT)
- printw(CP[45], SCORE_LIMIT + 998 - root->score - 1);
+ printw("Comp: mate in %d!", SCORE_LIMIT + 998 - root->score - 1);
#endif /* VERYBUGGY */
ClearEoln();
ShowNodeCnt(NodeCnt);
gotoXY(TAB, 23);
- printw(CP[81], t); /* Max Tree= */
+ printw("Max Tree = %5d", t);
ClearEoln();
}
score = ScorePosition(opponent);
gotoXY(TAB, 5);
- printw(CP[103], score,
+ printw("S%d m%d ps%d gt%c m%d ps%d gt%c", score,
mtl[computer], pscore[computer], GameType[computer],
mtl[opponent], pscore[opponent], GameType[opponent]);
printw(" ");
if (flag.reverse)
- printw(CP[16]);
+ printw(" 1 2 3 4 5 6 7 8 9");
else
- printw(CP[15]);
+ printw(" 9 8 7 6 5 4 3 2 1");
for (sq = 0; sq < NO_SQUARES; sq++)
DrawPiece(sq);
void
Curses_ChangeAlphaWindow(void)
{
- Curses_ShowMessage(CP[114]);
+ Curses_ShowMessage("WAwindow = ");
FLUSH_SCANW("%hd", &WAwindow);
- Curses_ShowMessage(CP[34]);
+ Curses_ShowMessage("BAwindow = ");
FLUSH_SCANW("%hd", &BAwindow);
}
void
Curses_ChangeBetaWindow(void)
{
- Curses_ShowMessage(CP[115]);
+ Curses_ShowMessage("WBwindow = ");
FLUSH_SCANW("%hd", &WBwindow);
- Curses_ShowMessage(CP[35]);
+ Curses_ShowMessage("BBwindow = ");
FLUSH_SCANW("%hd", &BBwindow);
}
if (hint)
{
algbr((short) (hint >> 8), (short) (hint & 0xFF), false);
- strcpy(s, CP[198]); /* try */
+ strcpy(s, "try ");
strcat(s, mvstr[0]);
Curses_ShowMessage(s);
}
else
{
- Curses_ShowMessage(CP[223]);
+ Curses_ShowMessage("I have no idea.\n");
}
}
void
Curses_ChangeSearchDepth(void)
{
- Curses_ShowMessage(CP[150]);
+ Curses_ShowMessage("depth = ");
FLUSH_SCANW("%hd", &MaxSearchDepth);
TCflag = !(MaxSearchDepth > 0);
}
void
Curses_ChangeHashDepth(void)
{
- Curses_ShowMessage(CP[163]);
+ Curses_ShowMessage("hashdepth = ");
FLUSH_SCANW("%hd", &HashDepth);
- Curses_ShowMessage(CP[82]);
+ Curses_ShowMessage("MoveLimit = ");
FLUSH_SCANW("%hd", &HashMoveLimit);
}
void
Curses_SetContempt(void)
{
- Curses_ShowMessage(CP[142]);
+ Curses_ShowMessage("contempt = ");
FLUSH_SCANW("%hd", &contempt);
}
void
Curses_ChangeXwindow(void)
{
- Curses_ShowMessage(CP[208]);
+ Curses_ShowMessage("xwndw= ");
FLUSH_SCANW("%hd", &xwndw);
}
Curses_ClearScreen();
gotoXY(32, 2);
- printw(CP[41], version, patchlevel);
+ printw("GNU Shogi %sp%s", version, patchlevel);
gotoXY(20, 4);
- printw(CP[18]);
+ printw(" 1. 40 moves in 5 minutes");
gotoXY(20, 5);
- printw(CP[19]);
+ printw(" 2. 40 moves in 15 minutes");
gotoXY(20, 6);
- printw(CP[20]);
+ printw(" 3. 40 moves in 30 minutes");
gotoXY(20, 7);
- printw(CP[21]);
+ printw(" 4. all moves in 15 minutes");
gotoXY(20, 8);
- printw(CP[22]);
+ printw(" 5. all moves in 30 minutes");
gotoXY(20, 9);
- printw(CP[23]);
+ printw(" 6. all moves in 15 minutes, 30 seconds fischer clock");
gotoXY(20, 10);
- printw(CP[24]);
+ printw(" 7. all moves in 30 minutes, 30 seconds fischer clock");
gotoXY(20, 11);
- printw(CP[25]);
+ printw(" 8. 1 move in 1 minute");
gotoXY(20, 12);
- printw(CP[26]);
+ printw(" 9. 1 move in 15 minutes");
gotoXY(20, 13);
- printw(CP[27]);
+ printw("10. 1 move in 30 minutes");
OperatorTime = 0;
TCmoves = 40;
TCseconds = 0;
gotoXY(20, 17);
- printw(CP[62]);
+ printw("Enter Level: ");
refresh();
FLUSH_SCANW("%d", &item);
char s[40];
ExaminePosition(opponent);
- Curses_ShowMessage(CP[65]);
+ Curses_ShowMessage("Enter piece: ");
FLUSH_SCANW("%s", s);
c = neutral;
- if ((s[0] == CP[9][0]) || (s[0] == CP[9][1])) /* b B */
+ if ((s[0] == 'b') || (s[0] == 'B'))
c = black;
- if ((s[0] == CP[9][2]) || (s[0] == CP[9][3])) /* w W */
+ if ((s[0] == 'w') || (s[0] == 'W'))
c = white;
for (p = king; p > no_piece; p--)
score = ScorePosition(opponent);
gotoXY(TAB, 5);
- printw(CP[103], score,
+ printw("S%d m%d ps%d gt%c m%d ps%d gt%c", score,
mtl[computer], pscore[computer], GameType[computer],
mtl[opponent], pscore[opponent], GameType[opponent]);
unsigned int ttblsize = ttblsz;
struct hashentry *ttable[2] = { NULL, NULL };
#endif
+
+char *DRAW;
+char *DRAW_REPETITION = "Repetition";
+char *DRAW_MAXMOVES = "Max Moves";
+char *DRAW_JUSTDRAW = "Drawn game!";
#endif
/* move symbols */
-#define pxx (CP[2])
-#define qxx (CP[1])
-#define rxx (CP[4])
-#define cxx (CP[3])
+#define pxx (" PLNSGBRPLNSBRK ")
+#define qxx (" plnsgbrplnsbrk ")
+#define rxx ("ihgfedcba")
+#define cxx ("987654321")
/***************** Table limits ********************************************/
extern hashcode_array *hashcode;
extern drop_hashcode_array *drop_hashcode;
-extern char *CP[];
#ifdef QUIETBACKGROUND
extern short background;
extern short rpthash[2][256];
extern char *DRAW;
+extern char* DRAW_REPETITION;
+extern char *DRAW_MAXMOVES;
+extern char *DRAW_JUSTDRAW;
+
#define row(a) ((a) / NO_COLS)
#define column(a) ((a) % NO_COLS)
#define locn(a, b) (((a) * NO_COLS) + b)
};
-#if !defined EXTLANGFILE
-
-char *CP[CPSIZE] =
-
-{
-/* 000: eng: */ "",
-#ifdef LANGFILE
-#include LANGFILE
-#else
-#include "gnushogi.lng"
-#endif
-};
-
-#else
-
-char *CP[CPSIZE];
-
-#endif
-
-
/*
* Determine the minimum number of moves for a piece from
* square "f" to square "t". If the piece cannot reach "t",
if (!InitFlag)
{
char sx[256];
- strcpy(sx, CP[169]);
+ strcpy(sx, "level");
if (TCflag)
SetTimeControl();
}
-#if defined EXTLANGFILE
-
-#ifdef OLDLANGFILE
-
-void
-InitConst(char *lang)
-{
- FILE *constfile;
- char s[256];
- char sl[5];
- char buffer[120];
- int len, entry;
- char *p, *q;
- constfile = fopen(LANGFILE, "r");
-
- if (!constfile)
- {
- ShowMessage("NO LANGFILE");
- exit(1);
- }
-
- while (fgets(s, sizeof(s), constfile))
- {
- if (s[0] == '!')
- continue;
-
- len = strlen(s);
-
- for (q = &s[len]; q > &s[8]; q--)
- if (*q == '}')
- break;
-
- if (q == &s[8])
- {
- ShowMessage("{ error in cinstfile");
- exit(1);
- }
-
- *q = '\0';
-
- if ((s[3] != ':') || (s[7] != ':') || (s[8] != '{'))
- {
- sprintf(buffer, "Langfile format error %s", s);
- ShowMessage(buffer);
- exit(1);
- }
-
- s[3] = s[7] = '\0';
-
- if (lang == NULL)
- {
- lang = sl;
- strcpy(sl, &s[4]);
- }
-
- if (strcmp(&s[4], lang))
- continue;
-
- entry = atoi(s);
-
- if ((entry < 0) || (entry >= CPSIZE))
- {
- ShowMessage("Langfile number error");
- exit(1);
- }
-
- for (q = p = &s[9]; *p; p++)
- {
- if (*p != '\\')
- {
- *q++ = *p;
- }
- else if (*(p + 1) == 'n')
- {
- *q++ = '\n';
- p++;
- }
- }
-
- *q = '\0';
-
- if ((entry < 0) || (entry > 255))
- {
- sprintf(buffer, "Langfile error %d\n", entry);
- ShowMessage(buffer);
- exit(0);
- }
-
- CP[entry] = (char *)GLOBAL_ALLOC((unsigned) strlen(&s[9]) + 1);
-
- if (CP[entry] == NULL)
- {
- char buffer[80];
- sprintf(buffer, "CP MALLOC, entry %d", entry);
- perror(buffer);
- exit(0);
- }
-
- strcpy(CP[entry], &s[9]);
- }
-
- fclose(constfile);
-}
-
-#else
-
-void
-InitConst(char *lang)
-{
- FILE *constfile;
- char s[256];
- char sl[5];
- char buffer[120];
- int len, entry;
- char *p, *q;
- constfile = fopen(LANGFILE, "r");
-
- if (!constfile)
- {
- ShowMessage("NO LANGFILE");
- exit(1);
- }
-
- while (fgets(s, sizeof(s), constfile))
- {
- if (s[0] == '!')
- continue;
-
- len = strlen(s);
-
- if ((len > 3) && (s[3] == ':') || (len > 7) && (s[7] == ':'))
- {
- ShowMessage("old Langfile error");
- exit(1);
- }
-
- if (len <= 15)
- {
- ShowMessage("length error in Langfile");
- exit(1);
- }
-
- for (q = &s[len]; q > &s[15]; q--)
- {
- if (*q == '"')
- break;
- }
-
- if (q == &s[15])
- {
- ShowMessage("\" error in Langfile");
- exit(1);
- }
-
- *q = '\0';
-
- if ((s[6] != ':') || (s[10] != ':') || (s[15] != '"'))
- {
- sprintf(buffer, "Langfile format error %s", s);
- ShowMessage(buffer);
- exit(1);
- }
-
- s[6] = s[10] = '\0';
-
- if (lang == NULL)
- {
- lang = sl;
- strcpy(sl, &s[7]);
- }
-
- if (strcmp(&s[7], lang))
- continue;
-
- entry = atoi(&s[3]);
-
- if ((entry < 0) || (entry >= CPSIZE))
- {
- ShowMessage("Langfile number error");
- exit(1);
- }
-
- for (q = p = &s[16]; *p; p++)
- {
- if (*p != '\\')
- {
- *q++ = *p;
- }
- else if (*(p + 1) == 'n')
- {
- *q++ = '\n';
- p++;
- }
- }
-
- *q = '\0';
-
- if ((entry < 0) || (entry > 255))
- {
- sprintf(buffer, "Langfile error %d\n", entry);
- ShowMessage(buffer);
- exit(0);
- }
-
- CP[entry] = (char *)GLOBAL_ALLOC((unsigned)strlen(&s[16]) + 1);
-
- if (CP[entry] == NULL)
- {
- char buffer[80];
- sprintf(buffer, "CP MALLOC, entry %d", entry);
- perror(buffer);
- exit(0);
- }
-
- strcpy(CP[entry], &s[16]);
- }
-
- fclose(constfile);
-}
-
-#endif
-
-#endif
-
-
int
InitMain(void)
{
if (Initialize_data() != 0)
return 1;
-#if defined EXTLANGFILE
- InitConst(Lang);
-#endif
-
- strcpy(ColorStr[0], CP[118]);
- strcpy(ColorStr[1], CP[119]);
+ strcpy(ColorStr[0], "Black");
+ strcpy(ColorStr[1], "White");
XC = 0;
MaxResponseTime = 0;
long j;
struct fileentry n;
- fputs(CP[66], stdout);
+ fputs("Filling transposition file, wait!\n", stdout);
n.f = n.t = 0;
n.flags = 0;
n.depth = 0;
}
else
{
- printf(CP[50], HASHFILE);
+ printf("Create failed for %s\n", HASHFILE);
}
return 0;
int nr[MAXDEPTH];
struct fileentry n;
- fputs(CP[49], stdout);
+ fputs("Counting transposition file entries, wait!\n", stdout);
for (i = 0; i < MAXDEPTH; i++)
nr[i] = 0;
}
}
- printf(CP[109], nr[0], i);
+ printf("The file contains %d entries out of max %d\n", nr[0], i);
for (j = 1; j < MAXDEPTH; j++)
printf("%d ", nr[j]);
#endif /* ttblsz */
case 'v':
- fprintf(stderr, CP[102], version, patchlevel);
+ fprintf(stderr, "gnushogi version %s patchlevel %s\n", version, patchlevel);
exit(1);
default:
- fputs(CP[113], stderr);
+ fputs("Usage: gnushogi [-a] [-t] [-c size] [-s savefile][-l listfile] [-x xwndw]\n", stderr);
exit(1);
}
if (argc > 9)
{
- printf("%s\n", CP[220]);
+ printf("Time Control Error\n");
exit(1);
}
XC++;
else
{
- printf("%s\n", CP[220]);
+ printf("Time Control Error\n");
exit(1);
}
* an error message and quit.
*/
- printf("%s\n", CP[233]);
+ printf("Invalid command-line arguments:\n");
print_arglist(argc, argv);
exit(1);
}
short sq, side, max_pattern_data;
-#if defined(EXTLANGFILE)
- char *Lang = NULL;
-#endif
-
#ifdef TEST_DISTANCE
short d;
char s[80];
display_type = DISPLAY_RAW;
-#if defined(EXTLANGFILE)
- InitConst(Lang);
-#endif
-
Initialize_data();
for (sq = 0; sq < NO_SQUARES; sq++)
{
if (!barebones && !XSHOGI)
{
- /* printf("\nYour move is? "); */
- fputs(CP[124], stdout);
+ fputs("\nYour move is? ", stdout);
}
}
{
if (!barebones && !XSHOGI)
{
- printf(CP[53], Sdepth, ch); /* Depth = %d%c */
+ printf("Depth= %d%c ", Sdepth, ch);
printf("\n");
}
}
void
Raw_ShowNodeCnt(long NodeCnt)
{
- printf(CP[91],
+ printf("Nodes = %ld Nodes/sec = %ld\n",
NodeCnt, (((et) ? ((NodeCnt * 100) / et) : 0)));
}
{
char s[80];
- Raw_ShowMessage(CP[31]); /* Abort? */
+ Raw_ShowMessage("Abort? ");
scanf("%s", s);
- if (strcmp(s, CP[210]) == 0) /* yes */
+ if (strcmp(s, "yes") == 0)
Raw_ExitShogi();
}
Raw_help(void)
{
Raw_ClearScreen();
- /* printf("SHOGI command summary\n"); */
- printf(CP[40], version, patchlevel);
+ printf("GNU Shogi %sp%s command summary\n", version, patchlevel);
printf("----------------------------------"
"------------------------------\n");
- /* printf("7g7f move from 7g to 7f quit
- * Exit Shogi\n"); */
- fputs(CP[158], stdout);
- /* printf("S6h move silver to 6h beep
- * turn %s\n", (flag.beep) ? "off" : "on"); */
- printf(CP[86], (flag.beep) ? CP[92] : CP[93]);
- /* printf("2d2c+ move from 2d to 2c and promote\n"); */
- printf(CP[128], (flag.material) ? CP[92] : CP[93]);
- /* printf("P*5e drop pawn to 5e easy
- * turn %s\n", (flag.easy) ? "off" : "on"); */
- printf(CP[173], (flag.easy) ? CP[92] : CP[93]);
- /* printf(" hash
- * turn %s\n", (flag.hash) ? "off" : "on"); */
- printf(CP[174], (flag.hash) ? CP[92] : CP[93]);
- /* printf("bd redraw board reverse
- * board display\n"); */
- fputs(CP[130], stdout);
- /* printf("list game to shogi.lst book
- * turn %s used %d of %d\n", (Book) ? "off" : "on", bookcount); */
- printf(CP[170], (Book) ? CP[92] : CP[93], bookcount, booksize);
- /* printf("undo undo last ply remove
- * take back a move\n"); */
- fputs(CP[200], stdout);
- /* printf("edit edit board force
- * enter game moves\n"); */
- fputs(CP[153], stdout);
- /* printf("switch sides with computer both
- * computer match\n"); */
- fputs(CP[194], stdout);
- /* printf("black computer plays black white
- * computer plays white\n"); */
- fputs(CP[202], stdout);
- /* printf("depth set search depth clock
- * set time control\n"); */
- fputs(CP[149], stdout);
- /* printf("post principle variation hint
- * suggest a move\n"); */
- fputs(CP[177], stdout);
- /* printf("save game to file get
- * game from file\n"); */
- fputs(CP[188], stdout);
+ fputs ("7g7f move from 7g to 7f quit Exit Shogi\n", stdout);
+ printf("S6h move silver to 6h beep turn %s\n", (flag.beep) ? "OFF" : "ON");
+ printf("2d2c+ move to 2c and promote material turn %s\n", (flag.material) ? "OFF" : "ON");
+ printf("P*5e drop pawn to 5e easy turn %s\n", (flag.easy) ? "OFF" : "ON");
+ printf("tsume toggle tsume mode hash turn %s\n", (flag.hash) ? "OFF" : "ON");
+ fputs ("bd redraw board reverse board display\n", stdout);
+ printf("list game to shogi.lst book turn %s used %d of %d\n", (Book) ? "OFF" : "ON", bookcount, booksize);
+ fputs ("undo undo last ply remove take back a move\n", stdout);
+ fputs ("edit edit board force toggle manual move mode\n", stdout);
+ fputs ("switch sides with computer both computer match\n", stdout);
+ fputs ("black computer plays black white computer plays white\n", stdout);
+ fputs ("depth set search depth clock set time control\n", stdout);
+ fputs ("post principle variation hint suggest a move\n", stdout);
+ fputs ("save game to file get game from file\n", stdout);
printf("xsave pos. to xshogi file xget"
" pos. from xshogi file\n");
- /* printf("random randomize play new
- * start new game\n"); */
- fputs(CP[181], stdout);
+ fputs("random randomize play new start new game\n", stdout);
printf("--------------------------------"
"--------------------------------\n");
- /* printf("Computer: %-12s Opponent: %s\n", */
- printf(CP[46],
+ printf("Computer: %-12s Opponent: %s\n",
ColorStr[computer], ColorStr[opponent]);
- /* printf("Depth: %-12d Response time: %d sec\n", */
- printf(CP[51],
+ printf("Depth: %-12d Response time: %d sec\n",
MaxSearchDepth, MaxResponseTime/100);
- /* printf("Random: %-12s Easy mode: %s\n", */
- printf(CP[99],
- (dither) ? CP[93] : CP[92], (flag.easy) ? CP[93] : CP[92]);
- /* printf("Beep: %-12s Transposition file: %s\n", */
- printf(CP[36],
- (flag.beep) ? CP[93] : CP[92], (flag.hash) ? CP[93] : CP[92]);
- /* printf("Tsume: %-12s Force: %s\n")*/
- printf(CP[232],
- (flag.tsume) ? CP[93] : CP[92], (flag.force) ? CP[93] : CP[92]);
- /* printf("Time Control %s %d moves %d seconds %d opr %d
- * depth\n", (TCflag) ? "ON" : "OFF", */
- printf(CP[110],
- (TCflag) ? CP[93] : CP[92],
+ printf("Random: %-12s Easy mode: %s\n",
+ (dither) ? "ON" : "OFF", (flag.easy) ? "ON" : "OFF");
+ printf("Beep: %-12s Transposition file: %s\n",
+ (flag.beep) ? "ON" : "OFF", (flag.hash) ? "ON" : "OFF");
+ printf("Tsume: %-12s Force: %s\n",
+ (flag.tsume) ? "ON" : "OFF", (flag.force) ? "ON" : "OFF");
+ printf("Time Control %s %d moves %d sec %d add %d depth\n",
+ (TCflag) ? "ON" : "OFF",
TimeControl.moves[black], TimeControl.clock[black] / 100,
TCadd/100, MaxSearchDepth);
}
Book = BOOKFAIL;
Raw_ClearScreen();
Raw_UpdateDisplay(0, 0, 1, 0);
- /* printf(". exit to main\n"); */
- fputs(CP[29], stdout);
- /* printf("# clear board\n"); */
- fputs(CP[28], stdout);
- /* printf("c change sides\n"); */
- fputs(CP[136], stdout);
- /* printf("enter piece & location: \n"); */
- fputs(CP[155], stdout);
+ fputs(". Exit to main\n", stdout);
+ fputs("# Clear board\n", stdout);
+ fputs("c Change sides\n", stdout);
+ fputs("enter piece & location: \n", stdout);
a = black;
scanf("%s", s);
found = 0;
- if (s[0] == CP[28][0]) /*#*/
+ if (s[0] == '#')
{
for (sq = 0; sq < NO_SQUARES; sq++)
{
ClearCaptured();
}
- if (s[0] == CP[136][0]) /*c*/
+ if (s[0] == 'c')
a = otherside[a];
if (s[1] == '*')
color[sq] = neutral;
}
}
- while (s[0] != CP[29][0]);
+ while (s[0] != '.');
for (sq = 0; sq < NO_SQUARES; sq++)
Mvboard[sq] = ((board[sq] != Stboard[sq]) ? 10 : 0);
InitializeStats();
Raw_ClearScreen();
Raw_UpdateDisplay(0, 0, 1, 0);
- /* printf("Setup successful\n"); */
- fputs(CP[106], stdout);
+ fputs("Setup successful\n", stdout);
}
{
if (flag.post)
{
- printf(CP[123],
+ printf("\nMove# %d Target = %ld Clock: %ld\n",
GameCnt/2 + 1,
ResponseTime, TimeControl.clock[side]);
}
{
if (flag.illegal)
{
- printf("%s\n", CP[225]);
+ printf("Illegal position.\n");
return;
}
t = (l + h) >> 1;
}
- /* printf("Nodes %ld Tree %d Eval %ld
- * Rate %ld RS high %ld low %ld\n", */
- printf(CP[89], GenCnt, NodeCnt, t, EvalNodes,
+ printf("Gen %ld Node %ld Tree %d Eval %ld Rate %ld EC %d/%d RS hi %ld lo %ld \n", GenCnt, NodeCnt, t, EvalNodes,
(et > 100) ? (NodeCnt / (et / 100)) : 0,
EADD, EGET, reminus, replus);
- /* printf("Hin/Hout/Coll/Fin/Fout =
- * %ld/%ld/%ld/%ld/%ld\n", */
- printf(CP[71],
+ printf("Hin/Hout/Tcol/Coll/Fin/Fout = %ld/%ld/%ld/%ld/%ld/%ld\n",
HashAdd, HashCnt, THashCol, HashCol, FHashCnt, FHashAdd);
}
if (!XSHOGI)
{
- /* printf("My move is: %s\n", mvstr[0]); */
- printf(CP[83], mvstr[0]);
+ printf("My move is: %5s\n", mvstr[0]);
if (flag.beep)
printf("%c", 7);
summary:
if (root->flags & draw)
{
- /* printf("Drawn game!\n"); */
- fputs(CP[57], stdout);
+ fputs("Drawn game!\n", stdout);
}
else if (root->score == -(SCORE_LIMIT + 999))
{
c = (short)((TimeControl.clock[black] % 6000) / 100);
l = (short)(TimeControl.clock[white] / 6000);
m = (short)((TimeControl.clock[white] % 6000) / 100);
- /* printf("Black %d:%02d White %d:%02d\n", r, c, l, m); */
- printf(CP[116], r, c, l, m);
+ printf("Black %d:%02d White %d:%02d\n", r, c, l, m);
printf("\n");
for (r = (NO_ROWS - 1); r >= 0; r--)
if (hint)
{
algbr((short) (hint >> 8), (short) (hint & 0xFF), false);
- printf(CP[72], mvstr[0]); /*hint*/
+ printf("Hint: %s\n", mvstr[0]);
}
else
- fputs(CP[223], stdout);
+ fputs("I have no idea.\n", stdout);
}
char T[NO_SQUARES + 1], *p, *q;
- if ((p = strstr(sx, CP[169])) != NULL)
- p += strlen(CP[169]);
- else if ((p = strstr(sx, CP[217])) != NULL)
- p += strlen(CP[217]);
+ if ((p = strstr(sx, "level")) != NULL)
+ p += strlen("level");
+ else if ((p = strstr(sx, "clock")) != NULL)
+ p += strlen("clock");
strcat(sx, "XX");
q = T;
/* line empty ask for input */
if (!T[0])
{
- fputs(CP[61], stdout);
+ fputs("Enter #moves #minutes: ", stdout);
fgets(T, NO_SQUARES + 1, stdin);
strcat(T, "XX");
}
TCseconds = 0;
#ifdef OPERATORTIME
- fputs(CP[94], stdout);
+ fputs("Operator time (hundredths) = ", stdout);
scanf("%hd", &OperatorTime);
#endif
char s[40];
ExaminePosition(opponent);
- Raw_ShowMessage(CP[65]);
+ Raw_ShowMessage("Enter piece: ");
scanf("%s", s);
c = neutral;
- if ((s[0] == CP[9][0]) || (s[0] == CP[9][1])) /* w W */
+ if ((s[0] == 'b') || (s[0] == 'B'))
c = black;
- if ((s[0] == CP[9][2]) || (s[0] == CP[9][3])) /* b B */
+ if ((s[0] == 'w') || (s[0] == 'W'))
c = white;
for (p = king; p > no_piece; p--)
}
printf("stage = %d\n", stage);
- printf(CP[103], score,
+ printf("S%d m%d ps%d gt%c m%d ps%d gt%c", score,
mtl[computer], pscore[computer], GameType[computer],
mtl[opponent], pscore[opponent], GameType[opponent]);
}
}
score = ScorePosition(opponent);
- printf(CP[103], score,
+ printf("S%d m%d ps%d gt%c m%d ps%d gt%c", score,
mtl[computer], pscore[computer], GameType[computer],
mtl[opponent], pscore[opponent], GameType[opponent]);
printf("\nhung black %d hung white %d\n", hung[black], hung[white]);
if (rpt >= 3)
{
root->flags |= draw;
- DRAW = CP[101]; /* Repetition */
+ DRAW = DRAW_REPETITION;
}
else
{
if (GameCnt == MAXMOVES)
{
root->flags |= draw;
- DRAW = CP[80]; /* Max Moves */
+ DRAW = DRAW_MAXMOVES;
}
}
&& !ChkFlag[ply])))
{
node->flags |= (draw | exact);
- DRAW = CP[58]; /* Draw */
+ DRAW = DRAW_JUSTDRAW;
node->score = ((side == computer) ? contempt : -contempt);
}
if (!barebones)
{
- ShowMessage(CP[199]); /* ttable collision detected */
+ ShowMessage("ttable collision detected");
ShowBD(ptbl->bd);
printf("hashkey = 0x%x, hashbd = 0x%x\n",
hashkey, hashbd);
+++ /dev/null
-/* 001: eng: */ " plnsgbrplnsbrk ",
-/* 002: eng: */ " PLNSGBRPLNSBRK ",
-/* 003: eng: */ "987654321",
-/* 004: eng: */ "ihgfedcba",
-/* 005: eng: */ "moves",
-/* 006: eng: */ "",
-/* 007: eng: */ "",
-/* 008: eng: */ "",
-/* 009: eng: */ "bBwW",
-/* 010: eng: */ " score depth nodes time ",
-/* 011: eng: */ " score depth nodes time\n",
-/* 012: eng: */ " ",
-/* 013: eng: */ " ",
-/* 014: eng: */ " %s\n",
-/* 015: eng: */ " 9 8 7 6 5 4 3 2 1",
-/* 016: eng: */ " 1 2 3 4 5 6 7 8 9",
-/* 017: eng: */ " -",
-/* 018: eng: */ " 1. 40 moves in 5 minutes",
-/* 019: eng: */ " 2. 40 moves in 15 minutes",
-/* 020: eng: */ " 3. 40 moves in 30 minutes",
-/* 021: eng: */ " 4. all moves in 15 minutes",
-/* 022: eng: */ " 5. all moves in 30 minutes",
-/* 023: eng: */ " 6. all moves in 15 minutes, 30 seconds fischer clock",
-/* 024: eng: */ " 7. all moves in 30 minutes, 30 seconds fischer clock",
-/* 025: eng: */ " 8. 1 move in 1 minute",
-/* 026: eng: */ " 9. 1 move in 15 minutes",
-/* 027: eng: */ "10. 1 move in 30 minutes",
-/* 028: eng: */ "# Clear board\n",
-/* 029: eng: */ ". Exit to main\n",
-/* 030: eng: */ "gnushogi.tbk",
-/* 031: eng: */ "Abort? ",
-/* 032: eng: */ "Ambiguous Move %s!",
-/* 033: eng: */ "Awindow",
-/* 034: eng: */ "BAwindow = ",
-/* 035: eng: */ "BBwindow = ",
-/* 036: eng: */ "Beep: %-12s Transposition file: %s\n",
-/* 037: eng: */ "White %s Black %s %d %s\n",
-/* 038: eng: */ "Bwindow: ",
-/* 039: eng: */ "Bwindow",
-/* 040: eng: */ "GNU Shogi %sp%s command summary\n",
-/* 041: eng: */ "GNU Shogi %sp%s",
-/* 042: eng: */ "Castled Black %s White %s\n",
-/* 043: eng: */ "",
-/* 044: eng: */ "Computer mates!",
-/* 045: eng: */ "Comp: mate in %d!",
-/* 046: eng: */ "Computer: %-12s Opponent: %s\n",
-/* 047: eng: */ "Computer: %s",
-/* 048: eng: */ "Could not open file",
-/* 049: eng: */ "Counting transposition file entries, wait!\n",
-/* 050: eng: */ "Create failed for %s\n",
-/* 051: eng: */ "Depth: %-12d Response time: %d sec\n",
-/* 052: eng: */ "Depth: %d",
-/* 053: eng: */ "Depth= %d%c ",
-/* 054: eng: */ "Draw %s\n",
-/* 055: eng: */ "DrawPiece: color[sq] err",
-/* 056: eng: */ "Drawn game! %s",
-/* 057: eng: */ "Drawn game!\n",
-/* 058: eng: */ "Drawn game!",
-/* 059: eng: */ "Easy mode: %s",
-/* 060: eng: */ "Editing: %s",
-/* 061: eng: */ "Enter #moves #minutes: ",
-/* 062: eng: */ "Enter Level: ",
-/* 063: eng: */ "Enter file name: ",
-/* 064: eng: */ "Enter piece & location: ",
-/* 065: eng: */ "Enter piece: ",
-/* 066: eng: */ "Filling transposition file, wait!\n",
-/* 067: eng: */ "GNU Shogi display (MS-DOS, Mar 90)",
-/* 068: eng: */ "GNU Shogi display (Nov 89)",
-/* 069: eng: */ "GNU Shogi %s (pl %s)",
-/* 070: eng: */ "Game saved",
-/* 071: eng: */ "Hin/Hout/Tcol/Coll/Fin/Fout = %ld/%ld/%ld/%ld/%ld/%ld\n",
-/* 072: eng: */ "Hint: %s\n",
-/* 073: eng: */ "Hit <RET> to return: ",
-/* 074: eng: */ "Human ",
-/* 075: eng: */ "Illegal move (no match) %s\n",
-/* 076: eng: */ "Illegal move (no match) %s",
-/* 077: eng: */ "Illegal move (in check) %s",
-/* 078: eng: */ "Illegal move.\n",
-/* 079: eng: */ "Level: %ld",
-/* 080: eng: */ "Max Moves",
-/* 081: eng: */ "Max Tree = %5d",
-/* 082: eng: */ "MoveLimit = ",
-/* 083: eng: */ "My move is: %5s\n",
-/* 084: eng: */ "My move is: %5s",
-/* 085: eng: */ "Testing Eval Speed",
-/* 086: eng: */ "S6h move silver to 6h beep turn %s\n",
-/* 087: eng: */ "No moves",
-/* 088: eng: */ "No pieces",
-/* 089: eng: */ "Gen %ld Node %ld Tree %d Eval %ld Rate %ld EC %d/%d RS hi %ld lo %ld \n",
-/* 090: eng: */ "Nodes = %8ld, Nodes/Sec = %5ld",
-/* 091: eng: */ "Nodes = %ld Nodes/sec = %ld\n",
-/* 092: eng: */ "OFF",
-/* 093: eng: */ "ON",
-/* 094: eng: */ "Operator time (hundredths) = ",
-/* 095: eng: */ "Opponent mates!",
-/* 096: eng: */ "Opp: mate in %d!",
-/* 097: eng: */ "Opponent: %s",
-/* 098: eng: */ "Playing without hashfile",
-/* 099: eng: */ "Random: %-12s Easy mode: %s\n",
-/* 100: eng: */ "Random: %s",
-/* 101: eng: */ "Repetition",
-/* 102: eng: */ "gnushogi version %s patchlevel %s\n",
-/* 103: eng: */ "S%d m%d ps%d gt%c m%d ps%d gt%c",
-/* 104: eng: */ "Score= %d",
-/* 105: eng: */ "Score",
-/* 106: eng: */ "Setup successful\n",
-/* 107: eng: */ "Testing CaptureList Speed",
-/* 108: eng: */ "Testing MoveList Speed",
-/* 109: eng: */ "The file contains %d entries out of max %d\n",
-/* 110: eng: */ "Time Control %s %d moves %d sec %d add %d depth\n",
-/* 111: eng: */ "TimeControl %d Operator Time %d\n",
-/* 112: eng: */ "Transposition table: %s",
-/* 113: eng: */ "Usage: gnushogi [-a] [-t] [-c size] [-s savefile][-l listfile] [-x xwndw]\n",
-/* 114: eng: */ "WAwindow = ",
-/* 115: eng: */ "WBwindow = ",
-/* 116: eng: */ "Black %d:%02d White %d:%02d\n",
-/* 117: eng: */ "Black Clock %ld Moves %d\nWhite Clock %ld Moves %d\n",
-/* 118: eng: */ "Black",
-/* 119: eng: */ "White",
-/* 120: eng: */ "Wwindow: ",
-/* 121: eng: */ "Your move is? ",
-/* 122: eng: */ "\n ",
-/* 123: eng: */ "\nMove# %d Target = %ld Clock: %ld\n",
-/* 124: eng: */ "\nYour move is? ",
-/* 125: eng: */ "\n\n",
-/* 126: eng: */ " move score depth nodes time flags capture\n",
-/* 127: eng: */ "\n",
-/* 128: eng: */ "2d2c+ move to 2c and promote material turn %s\n",
-/* 129: eng: */ "alg",
-/* 130: eng: */ "bd redraw board reverse board display\n",
-/* 131: eng: */ "bd",
-/* 132: eng: */ "beep",
-/* 133: eng: */ "white",
-/* 134: eng: */ "book",
-/* 135: eng: */ "both",
-/* 136: eng: */ "c Change sides\n",
-/* 137: eng: */ "shogi.000",
-/* 138: eng: */ "shogi.lst.%d",
-/* 139: eng: */ "computer mates!\n",
-/* 140: eng: */ "computer will soon mate!\n",
-/* 141: eng: */ "computer",
-/* 142: eng: */ "contempt = ",
-/* 143: eng: */ "contempt",
-/* 144: eng: */ "coords show coords rv reverse video\n",
-/* 145: eng: */ "coords",
-/* 146: eng: */ "debuglevel = ",
-/* 147: eng: */ "debuglevel",
-/* 148: eng: */ "debug",
-/* 149: eng: */ "depth set search depth clock set time control\n",
-/* 150: eng: */ "depth = ",
-/* 151: eng: */ "depth",
-/* 152: eng: */ "easy",
-/* 153: eng: */ "edit edit board force toggle manual move mode\n",
-/* 154: eng: */ "edit",
-/* 155: eng: */ "enter piece & location: \n",
-/* 156: eng: */ "first",
-/* 157: eng: */ "force",
-/* 158: eng: */ "7g7f move from 7g to 7f quit Exit Shogi\n",
-/* 159: eng: */ "game file = ",
-/* 160: eng: */ "get",
-/* 161: eng: */ "gnushogi %sp%s game\n",
-/* 162: eng: */ "go",
-/* 163: eng: */ "hashdepth = ",
-/* 164: eng: */ "hashdepth",
-/* 165: eng: */ "hash",
-/* 166: eng: */ "help",
-/* 167: eng: */ "hint suggest a move post turn %s principle variation\n",
-/* 168: eng: */ "hint",
-/* 169: eng: */ "level",
-/* 170: eng: */ "list game to shogi.lst book turn %s used %d of %d\n",
-/* 171: eng: */ "list",
-/* 172: eng: */ "new",
-/* 173: eng: */ "P*5e drop pawn to 5e easy turn %s\n",
-/* 174: eng: */ "tsume toggle tsume mode hash turn %s\n",
-/* 175: eng: */ "opponent mates!\n",
-/* 176: eng: */ "opponent will soon mate!\n",
-/* 177: eng: */ "post principle variation hint suggest a move\n",
-/* 178: eng: */ "post",
-/* 179: eng: */ "p",
-/* 180: eng: */ "quit",
-/* 181: eng: */ "random randomize play new start new game\n",
-/* 182: eng: */ "random",
-/* 183: eng: */ "rcptr",
-/* 184: eng: */ "remove",
-/* 185: eng: */ "reverse",
-/* 186: eng: */ "rv",
-/* 187: eng: */ "r",
-/* 188: eng: */ "save game to file get game from file\n",
-/* 189: eng: */ "save",
-/* 190: eng: */ "setup",
-/* 191: eng: */ "set",
-/* 192: eng: */ "shade toggle shade white stars toggle stars\n",
-/* 193: eng: */ "stars",
-/* 194: eng: */ "switch sides with computer both computer match\n",
-/* 195: eng: */ "switch",
-/* 196: eng: */ "test",
-/* 197: eng: */ "time",
-/* 198: eng: */ "try ",
-/* 199: eng: */ "ttable collision detected",
-/* 200: eng: */ "undo undo last ply remove take back a move\n",
-/* 201: eng: */ "undo",
-/* 202: eng: */ "black computer plays black white computer plays white\n",
-/* 203: eng: */ "black",
-/* 204: eng: */ "w",
-/* 205: eng: */ "xshogi.position.read",
-/* 206: eng: */ "xshogi",
-/* 207: eng: */ "xget",
-/* 208: eng: */ "xwndw= ",
-/* 209: eng: */ "xwndw",
-/* 210: eng: */ "yes",
-/* 211: eng: */ "Illegal move in book %d %s %s",
-/* 212: eng: */ "Can't find book.",
-/* 213: eng: */ "Book used %d(%d).",
-/* 214: eng: */ "true",
-/* 215: eng: */ "false",
-/* 216: eng: */ "exit",
-/* 217: eng: */ "clock",
-/* 218: eng: */ "Computer",
-/* 219: eng: */ "Open failure for file: %s",
-/* 220: eng: */ "Time Control Error",
-/* 221: eng: */ "material",
-/* 222: eng: */ "time %d %d\n",
-/* 223: eng: */ "I have no idea.\n",
-/* 224: eng: */ "Not Enough Material.",
-/* 225: eng: */ "Illegal position.",
-/* 226: eng: */ "beep",
-/* 227: eng: */ "gamein",
-/* 228: eng: */ "otime",
-/* 229: eng: */ "hard",
-/* 230: eng: */ "tsume",
-/* 231: eng: */ "Tsume: %s",
-/* 232: eng: */ "Tsume: %-12s Force: %s\n",
-/* 233: eng: */ "Invalid command-line arguments:",
-/* 234: eng: */ "",