#include "web_match.h" #include #include struct match_state *state; void free_state() { state->legs[1]->n_visits += state->boat_undone; // avoid memory leak leg_free(state->legs[0]); leg_free(state->legs[1]); free(state); state = NULL; } bool match_is_over() { return state->legs[0]->rem <= 0 || state->legs[1]->rem <= 0; }