The return from the getgrid() is an int between 1-9
this is then used in a long if / else statement.

A better way would be to use a math aproach.

If you use a combo of / (divide) and % (remainder) you can work out the grid refrence.

ie say 2 returned. This is array[0][1] in a zero based index.
So to get this refrence
1. Reduce the return from a one based to zero based index by subtracting 1 from it
->2-1 = 1
2. Divide by MAXCOLUMN to get the column
->1/3 = 0
3. Find the remainder for the row index
->1%3 = 1

This gives array[0][1] our answer.

say we have 9 returned
9-1 = 8
8/3 = 2
8%3 = 2

or Array[2][2] (remember is zero based eg 0-2)

Will reduce the lenght of the code.


PS Never, EVER, put msgbox's with comments like that in your code. It may be your work but...

One programmer working for Apple left one like that in a product and it was released. As soon as a customer saw it they were sacked. Better to be safe than sorry. (I have been working on the same program for over two years now. Can't remember all the msgbox's.)