Hey people , i need some help in order to complete my game.

Explanation:
Think we have 4*4 matrices 1 2 3
4 5 6
7 8 9

if we pressed 1 , 2 and 4 , i mean neighbours of the numbers,will be lighted.
if the number which we pressed and neighbours is ligthed but if no lighted , they will be lighted.We try to fill all blanks in N*N matrices.

Neigbours of 1 = 2-4
Neighbours of 5=2-4--6-8
Neighbours of 8 = 5 -7-9
EXAMPLE SCREEN SHOT İN THE ATTACHMENTS.

DO YOU KNOW THERE İS ANY ALGORİTM OF İT ?

If you want to get help please show some effort, write some code and post it or ask very specific questions such as: How do you initialize an array?