patch update from op21@squish.org (thanks)

["Classic" Gnu Chess]
This commit is contained in:
marc 1999-02-25 21:01:47 +00:00
parent 9eb0b1d8bb
commit 8a9e99bde3

View File

@ -1,97 +1,53 @@
*** src/gnuan.c.orig Mon Sep 28 02:41:21 1998
--- src/gnuan.c Wed Jan 13 20:50:50 1999
***************
*** 1348,1359 ****
fpout = stderr;
fprintf (fpout, "Input the file with the algebraic moves of the game.\n");
fflush (fpout);
! gets (infilename);
fprintf (fpout, "\n");
do
{
fprintf (fpout, "Input the search depth you want to use. (1 to 29)(- for depth from file)\n");
! gets (inbuf);
search_depth = atoi (inbuf);
if (search_depth < 0)
{
--- 1348,1359 ----
fpout = stderr;
fprintf (fpout, "Input the file with the algebraic moves of the game.\n");
fflush (fpout);
! fgets (infilename, 255, stdin);
fprintf (fpout, "\n");
do
{
fprintf (fpout, "Input the search depth you want to use. (1 to 29)(- for depth from file)\n");
! fgets (inbuf, 256, stdin);
search_depth = atoi (inbuf);
if (search_depth < 0)
{
***************
*** 1369,1375 ****
do
{
fprintf (fpout, "Input the maximum number of minutes per move you want to use.\n");
! gets (inbuf);
max_minutes = atoi (inbuf);
if (max_minutes < 0)
{
--- 1369,1375 ----
do
{
fprintf (fpout, "Input the maximum number of minutes per move you want to use.\n");
! fgets (inbuf, 256, stdin);
max_minutes = atoi (inbuf);
if (max_minutes < 0)
{
***************
*** 1379,1385 ****
}
while ((max_minutes + max_seconds) < 1);
fprintf (fpout, "Post the search results(y/n).\n");
! gets (inbuf);
if (inbuf[0] == 'y')
flag.post = true;
else
--- 1379,1385 ----
}
while ((max_minutes + max_seconds) < 1);
fprintf (fpout, "Post the search results(y/n).\n");
! fgets (inbuf, 256, stdin);
if (inbuf[0] == 'y')
flag.post = true;
else
***************
*** 1559,1565 ****
while (true)
{
printf (">");
! gets (GNUANinbuf1);
p = GNUANinbuf1;
q = GNUANinbuf;
while (true)
--- 1559,1565 ----
while (true)
{
printf (">");
! fgets (GNUANinbuf1, 128, stdin);
p = GNUANinbuf1;
q = GNUANinbuf;
while (true)
***************
*** 1724,1730 ****
move_percent[black] = ((float) same_moves[black]) * 200 / (float) (GNUANmovecnt + (GNUANmovecnt % 2 ? 1 : 0));
fprintf (fpout, "\n White's percentage was %5.2f%%. Black's percentage was %5.2f%%.\n", move_percent[white], move_percent[black]);
time (&end_time);
! elapsed_time = difftime(end_time - start_time);
fprintf (fpout, "\n Elapsed time was %ld seconds.\n", elapsed_time);
fclose (fpin);
fclose (fpout);
--- 1724,1730 ----
move_percent[black] = ((float) same_moves[black]) * 200 / (float) (GNUANmovecnt + (GNUANmovecnt % 2 ? 1 : 0));
fprintf (fpout, "\n White's percentage was %5.2f%%. Black's percentage was %5.2f%%.\n", move_percent[white], move_percent[black]);
time (&end_time);
! elapsed_time = difftime(end_time, start_time);
fprintf (fpout, "\n Elapsed time was %ld seconds.\n", elapsed_time);
fclose (fpin);
fclose (fpout);
--- gnuan.c.orig Sun Sep 27 23:41:21 1998
+++ gnuan.c Sun Feb 7 19:23:01 1999
@@ -1348,12 +1348,12 @@
fpout = stderr;
fprintf (fpout, "Input the file with the algebraic moves of the game.\n");
fflush (fpout);
- gets (infilename);
+ fgets (infilename, 255, stdin);
fprintf (fpout, "\n");
do
{
fprintf (fpout, "Input the search depth you want to use. (1 to 29)(- for depth from file)\n");
- gets (inbuf);
+ fgets (inbuf, 256, stdin);
search_depth = atoi (inbuf);
if (search_depth < 0)
{
@@ -1369,7 +1369,7 @@
do
{
fprintf (fpout, "Input the maximum number of minutes per move you want to use.\n");
- gets (inbuf);
+ fgets (inbuf, 256, stdin);
max_minutes = atoi (inbuf);
if (max_minutes < 0)
{
@@ -1379,7 +1379,7 @@
}
while ((max_minutes + max_seconds) < 1);
fprintf (fpout, "Post the search results(y/n).\n");
- gets (inbuf);
+ fgets (inbuf, 256, stdin);
if (inbuf[0] == 'y')
flag.post = true;
else
@@ -1559,7 +1559,7 @@
while (true)
{
printf (">");
- gets (GNUANinbuf1);
+ fgets (GNUANinbuf1, 128, stdin);
p = GNUANinbuf1;
q = GNUANinbuf;
while (true)
@@ -1724,7 +1724,7 @@
move_percent[black] = ((float) same_moves[black]) * 200 / (float) (GNUANmovecnt + (GNUANmovecnt % 2 ? 1 : 0));
fprintf (fpout, "\n White's percentage was %5.2f%%. Black's percentage was %5.2f%%.\n", move_percent[white], move_percent[black]);
time (&end_time);
- elapsed_time = difftime(end_time - start_time);
+ elapsed_time = difftime(end_time, start_time);
fprintf (fpout, "\n Elapsed time was %ld seconds.\n", elapsed_time);
fclose (fpin);
fclose (fpout);