I changed the array into multiple structures so Quadrants and Klingons were stored as structs and Sectors was just an array of ints.
I moved the main function to the end of the file. The game is effectively two nested do while loops. The outer loop runs a complete game, while the inner loop shows the Enterprise location, processes commands from the player and after a Warp move, phasers fired or photon torpedo launch, checks to see if the Enterprise has moved near a starbase and does attacks from any Klingons in the same quadrant.
I tried to stay faithful to the original Basic source as much as possible but clearly 100% accuracy was not an option!
The complicated expressions are great for compact code but a real pain to maintain and debug.
Player Input
All input from the player is done by a call to gets a library function in <stdio.h>. This reads characters (until enter is pressed) into a character array. Note these have fixed limits so if you type in long strings you will crash the application! Feel free to improve on this. Nowadays it's not considered safe to use gets().On the next page : Notes about particular sections of code.

