Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Matching a value to value of picturebox in an array

$
0
0
*PROGRAM IS ATTACHED AT THE BOTTOM OF THE POST*

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 added together from row and column to the the picturebox in the array to check if any ship or part of a ship is in that picturebox.

Thank You for time.

battleship.zip
Attached Files

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>