Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getRow

Status
Not open for further replies.

vintl

Technical User
Jun 9, 2000
72
MY
can anyone have better way to do this? or help to to tweak it, it looks inefficient.

public int getRow(int pos, State s) {
for(int i = 1; i <= 3; i++)
for(int j = 1; j <= 3; j++)
if(s.p[j] == pos)
return i;
return 0;
}

this actually is a 3X3 puzzle, i'm trying to get the row.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top