View Single Post
  #2 (permalink)  
Old 01-07-2008, 11:14 AM
tim's Avatar
tim tim is offline
Senior Member
 
Join Date: Dec 2007
Location: South Africa
Posts: 334
tim is on a distinguished road
Problematic structure
Hello Torque.

The problem is how you defined your data structure. It worked fine up to know (looks like it), but now that you need to find on element in your data structure, it will need more code.
Currently you defined your data structure according to this example:
Code:
round player score 0 0 12 1 31 2 45 1 0 12 1 48 2 67
This means that every round is an array of players.
I would rather define it so that every player is an array of rounds.
Code:
player round score 0 0 12 1 12 1 0 31 1 48 2 0 45 1 67
So, your array would be defined:
Code:
int[][]strokes =new int[numberOfRounds][numberOfPlayers];
Always draw a picture of your data structure before you start. I'm sorry for the inconvenience. There might still be a way of fixing this.
__________________
If your ship has not come in yet then build a lighthouse.
Reply With Quote