I need help with a C++ Solitare Battleship Game/solver. You are given a board of a certain
Question:
I need help with a C++ Solitare Battleship Game/solver. You are given a board of a certain size, as well as the ships that need to be placed on the board. You are also given the fill count for each row and column. The solution that should be output is the upper leftmost corner of each ship and its orientation(vertical or horizontal). If more than one solution exists they should both be output. This should use recursion in some manner. I am using a board class that stores the information about the board size and what the row and columnt counts are. I am also using a ship class that stores the ship type name, size and row/column location for final output as well as orientation. What I am having trouble with is figuring out how to write a recursive function that checks if a ship can be placed and determines the orientation. I know how to output the board once I know where the ships are placed. I also know how to parse the input file correctly.
I am mainly having issues with the basic operation, not the constraints.
Business Law Text and Cases
ISBN: 978-0324655223
11th Edition
Authors: Kenneth W. Clarkson, Roger LeRoy Miller, Gaylord A. Jentz, F