changed version, polished gtp-start a bit
Minclude/simple-go/simple-go.h
| @@ -15,6 +15,8 @@ | |||
|---|---|---|---|
| 15 | 15 | #define NO_FIELD '\0' | |
| 16 | 16 | #define COUNTED '+' | |
| 17 | 17 | ||
| 18 | + | #define VERSIONSTR "1.1" | |
| 19 | + | ||
| 18 | 20 | typedef size_t go_coordinate; | |
| 19 | 21 | typedef char go_symbol; | |
| 20 | 22 | ||
Msrc/gtp-start.c
| @@ -4,12 +4,12 @@ | |||
|---|---|---|---|
| 4 | 4 | int main(int argc, char** argv) | |
| 5 | 5 | { | |
| 6 | 6 | game_state* game = create_game(19, 6.5); | |
| 7 | - | char input[50] = {0}; | |
| 7 | + | char input[50]; | |
| 8 | 8 | char* answer; | |
| 9 | 9 | ||
| 10 | 10 | while(1) | |
| 11 | 11 | { | |
| 12 | - | fgets(input, 49, stdin); | |
| 12 | + | fgets(input, 50, stdin); | |
| 13 | 13 | if(strcmp(input, "quit\n") == 0) | |
| 14 | 14 | break; | |
| 15 | 15 | answer = handle_gtp_cmd(input, game); | |
| @@ -17,5 +17,6 @@ int main(int argc, char** argv) | |||
|---|---|---|---|
| 17 | 17 | free(answer); | |
| 18 | 18 | } | |
| 19 | 19 | ||
| 20 | + | puts("Bye!"); | |
| 20 | 21 | delete_game(game); | |
| 21 | 22 | } | |
Msrc/meson.build
| @@ -1,4 +1,4 @@ | |||
|---|---|---|---|
| 1 | 1 | src = ['simple-go.c', 'simple-gtp.c', 'simple-gtp-func.c'] | |
| 2 | 2 | ||
| 3 | 3 | executable('test_go', src + ['test.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS ) | |
| 4 | - | executable('gtp-start', src + ['gtp-start.c'], include_directories : inc, dependencies : cutils_dep, c_args: CFLAGS ) | |
| 4 | + | 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) | |||
|---|---|---|---|
| 54 | 54 | ||
| 55 | 55 | char* version_func(const Vector* arguments, const char* id, game_state* game) | |
| 56 | 56 | { | |
| 57 | - | return cmd_success("0.1", id); | |
| 57 | + | return cmd_success(VERSIONSTR, id); | |
| 58 | 58 | } | |
| 59 | 59 | ||
| 60 | 60 | char* known_command_func(const Vector* arguments, const char* id, game_state* game) | |