changed version, polished gtp-start a bit

AuthorKonata <konata@posteo.jp>
Date
Commita2c6327b5659737b9262758a3bb6d3563a6a3122
Parentbeb1713
4 files changed, 7 insertions(+), 4 deletions(-)
▾Minclude/simple-go/simple-go.h
@@ -15,6 +15,8 @@
#define NO_FIELD '\0'
#define COUNTED '+'
#define VERSIONSTR "1.1"
typedef size_t go_coordinate;
typedef char go_symbol;
▾Msrc/gtp-start.c
@@ -4,12 +4,12 @@
int main(int argc, char** argv)
{
game_state* game = create_game(19, 6.5);
char input[50] = {0};
char input[50];
char* answer;
while(1)
{
fgets(input, 49, stdin);
fgets(input, 50, stdin);
if(strcmp(input, "quit\n") == 0)
break;
answer = handle_gtp_cmd(input, game);
@@ -17,5 +17,6 @@ int main(int argc, char** argv)
free(answer);
}
puts("Bye!");
delete_game(game);
}
▾Msrc/meson.build
@@ -1,4 +1,4 @@
src = ['simple-go.c', 'simple-gtp.c', 'simple-gtp-func.c']
executable('test_go', src + ['test.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS )
executable('gtp-start', src + ['gtp-start.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS )
executable('gtp-start', src + ['gtp-start.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS, install: true )
▾Msrc/simple-gtp-func.c
@@ -54,7 +54,7 @@ char* name_func(const Vector* arguments, const char* id, game_state* game)
char* version_func(const Vector* arguments, const char* id, game_state* game)
{
return cmd_success("0.1", id);
return cmd_success(VERSIONSTR, id);
}
char* known_command_func(const Vector* arguments, const char* id, game_state* game)