So I'm writing code for a virtual battleship game. The ships need to be placed randomly and can not overlap. The ships are placed by their "bow" and then are incremented or decremented in a random direction and do not go out of bounds and are represented by the char 'O'. I wrote a function to check if the chars that represent the ships in the arrays are where the program is trying to place them with a bool check. If check is false the program should keep trying to place until true is returned. When I encapsulated my place ship functions into do while loops to accomplish this my program would compile and not execute. When i only encapsulate one function I get an output of 1's and 0's. I don't know if the problem is in my loop or my check function. Both are listed below. Thanks.