blob: ed035c532a76465d2de36110d4bf5149b552e7e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#include <stdio.h>
#include <assert.h>
#include <SDL2/SDL.h>
#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 <input.bin>\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);
}
|