I have declared a few arrays, in these array we have the following values:
{0, 1, 1, 0, 0}
{1, 0, 0, 0, 1}
{0, 1, 0, 0, 0}
I have multiple arrays with the same number of values.
For my Android application I am going to have a set of buttons.
If Button 1 is pushed, I want to know if any 1's are in positions 1, 3, and 5 and how many. If Button 2 is pushed, I want to know if any 1's are in positions 1, 2, 3, and 4 and how many.
Everything I have searched shows how to find out if 1's exist in the array, but not at a specific position. Any suggestions/help?
Details on what I am trying to accomplish if you wish to read, though I should be able to figure everything out with a helpful solution to my above question:
I have 64 buttons arranged in an 8x8 grid to represent sections of the human torso, and 64 numbers (0's or 1's) in my 13 arrays. The arrays identify if an organ is present in one of the aforementioned torso sections (1 if the organ is present, 0 if not present).
I want to push a button, and search all of the arrays for a 1 at that position. If I push button 35, I want to know if the liver is present in that section.
My ultimate output will tell the user what percentage of the organ is likely to be in that section. If a section contains a piece of the organ it will be a 1, and then divided by the total number of sections containing that organ.
If you've read this far, am I attacking this problem from the correct angle, do you have additional ideas?