I am recreating battleship in Visual Basic 6, and I am almost complete. The one part that I am unable to complete, is matching an input value to the value of the picturebox. To better explain...
I have 100 Pictureboxes in a control array, and the ships are placed among the 100 spots based off of a generated number. Now, the program is singleplayer instead of multiplayer, so the objective of the game is to find the ships. In order to find the ships, the user is required to input the column value and a row value, which is added together to represent a picturebox in the array. For example, Column 4, row six would be i=53. From there, I wanted the program to use that to check the value of the picture1(i) to see if there was a small, medium, or large ship within that picturebox.
My problem is that I am having trouble matching the value that is inputted from the user to the picturebox in the array to check if any ship or part of a ship is in that picturebox. Also, if the user input value matches a picturebox that contains a piece of a ship, how do I eliminate all of the pieces of that ship?
Thank You for time.
Number of downloads: 32