#include #include #include #include #include "command.h" #include "loader.h" #define MAX_BUF_LENGTH 1024 #define MAX_COMBO_LENGTH 1024 int main(int argc, char *argv[]) { hashmap *elements = hashmap_create(); hashmap *inv = hashmap_create(); char *command = calloc(MAX_BUF_LENGTH, sizeof(char)); char *command_re = calloc(MAX_BUF_LENGTH, sizeof(char)); char **sort_tmp = calloc(MAX_COMBO_LENGTH, sizeof(char **)); load_elements(elements, "combos.txt"); while (1) { // todo: separate into functions command_re = get_command(command, command_re, sort_tmp); uintptr_t result; hashmap_get(elements, command_re, strlen(command_re), &result); printf("%s\n",command_re); if (result == 0) { printf("You didn't make anything.\n"); continue; } printf("You made %s!\n", (char *)result); } // free(command); }