#include "gnugo.h"
#include <ctype.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
enum mode {
MODE_UNKNOWN = 0,
MODE_ASCII,
+ MODE_ANSI,
+ MODE_STRICTANSI,
+ MODE_TWOPLAYER,
MODE_GTP,
MODE_GMP,
MODE_SGMP,
case OPT_MODE:
if (strcmp(gg_optarg, "ascii") == 0)
playmode = MODE_ASCII;
+ else if (strcmp(gg_optarg, "ansi") == 0)
+ playmode = MODE_ANSI;
+ else if (strcmp(gg_optarg, "strictansi") == 0)
+ playmode = MODE_STRICTANSI;
+ else if (strcmp(gg_optarg, "twoplayer") == 0)
+ playmode = MODE_TWOPLAYER;
else if (strcmp(gg_optarg, "gtp") == 0)
playmode = MODE_GTP;
else if (strcmp(gg_optarg, "gmp") == 0)
if (infilename)
playmode = MODE_LOAD_AND_ANALYZE;
else
- playmode = (isatty(0)) ? MODE_ASCII : MODE_GMP;
+ playmode = (isatty(0)) ? MODE_ANSI : MODE_GMP;
}
if (outfile && playmode != MODE_LOAD_AND_PRINT) {
break;
+ case MODE_TWOPLAYER:
+ play_twoplayer(&sgftree, &gameinfo, infilename, untilstring);
+ break;
+
+ case MODE_STRICTANSI:
+ if (mandated_color != EMPTY) gameinfo.computer_player = OTHER_COLOR(mandated_color);
+#if ORACLE
+ if (metamachine) {
+ summon_oracle();
+ oracle_loadsgf(infilename, untilstring);
+ }
+#endif
+ play_ansi(&sgftree, &gameinfo, infilename, untilstring, true);
+ break;
+
+ case MODE_ANSI:
+ if (mandated_color != EMPTY) gameinfo.computer_player = OTHER_COLOR(mandated_color);
+#if ORACLE
+ if (metamachine) {
+ summon_oracle();
+ oracle_loadsgf(infilename, untilstring);
+ }
+#endif
+ play_ansi(&sgftree, &gameinfo, infilename, untilstring, false);
+ break;
+
case MODE_ASCII:
default:
if (mandated_color != EMPTY)
/* Display copyright message in ASCII mode unless --quiet option used. */
if (!quiet) {
- show_version();
- show_copyright();
+ show_version();
+ show_copyright();
}
#if ORACLE
static void
show_version(void)
{
- printf("GNU Go %s\n", VERSION);
+ printf("GNU Go %s\n with SGK modifications", VERSION);
}
/* Set the parameters which determine the depth to which