/* mainbai.c The basic AI search (almost entirely unintelligent really) */ #include "utilities.h" #include "data.h" #include "aiutils.h" #include "ai.h" void main(void) { city_record *a, *b; list_of_roads *solution; int target; randomise(); read_data(); // print_data(); // just to check all read correctly printf("\nStarting place: "); a=read_city(stdin); printf("Destination: "); b=read_city(stdin); printf("If you have a target distance, type it. Otherwise press Enter\n"); printf("Target distance: "); target=read_integer_with_default(-1); basic_ai_find_route(a,b,target); solution=ai_best_solution(); if (solution==NULL) { printf("\nNo solutions were found.\n"); } else { printf("\nBest solution has length %.1f, found after %d operations:\n", solution->total_length, ai_best_solution_time()); print_list_of_roads(solution); } dos_pause(); }