The WW-II and Korean era ships used mechanical computers along with radar inputs and “stable element” gyroscopes to aim guns. Missiles hadn’t arrived yet.
It would make a pretty interesting book to put together all the ingenious solutions people have come up with over the years to solve this problem.