/* mainsai.c The slightly more sensible AI search */ #include "utilities.h" #include "data.h" #include "aiutils.h" #include "ai.h" void main(void) { city_record *a, *b; list_of_roads *solution; randomise(); read_data(); // print_data(); // just to check all read correctly printf("\nStarting place: "); a=read_city(stdin); printf("Destination: "); b=read_city(stdin); controlled_ai_find_route(a,b); 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(); }