From 259c727658485ea00d6ef8617ecab579be871470 Mon Sep 17 00:00:00 2001 From: venomade Date: Thu, 27 Feb 2025 17:25:46 +0000 Subject: Initial Commit --- src/inspector/main.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/inspector/main.c (limited to 'src/inspector/main.c') diff --git a/src/inspector/main.c b/src/inspector/main.c new file mode 100644 index 0000000..ed035c5 --- /dev/null +++ b/src/inspector/main.c @@ -0,0 +1,37 @@ +#include +#include +#include + +#include "../game.h" + +Game game = {0}; + +// Tsoding is now a 3-Star Developer! +const char *tsoding_shift(int *argc, char ***argv) { + assert(*argc > 0); + const char* result = **argv; + *argc -= 1; + *argv += 1; + return result; +} + +void usage(FILE *stream) { + fprintf(stream, "Usage: ./gp_inspector \n"); +} + +int main(int argc, char *argv[]) { + + tsoding_shift(&argc, &argv); //Skip Program Name + + if (argc == 0) { + usage(stderr); + fprintf(stderr, "ERROR: No input file provided\n"); + exit(1); + } + const char *input_filepath = tsoding_shift(&argc, &argv); + + load_game(input_filepath, &game); + + static_assert(AGENTS_COUNT > 0, "We need to have at least 1 agent to print"); + print_chromo(stdout, &game.agents[0].chromo); +} -- cgit 1.4.1-2-gfad0