Function Check_StartGrid() Dim Ngrid(10,10) Dim Ngridr(10,10) Dim Ngridc(10,10) For x=1 To 10 For y=1 To 10 Ngridr(x,y)=Grid(x,y) Ngridc(x,y)=Ngridr(x,y) NGrid(x,y)=Ngridr(x,y) Next Next numchains = 0 For y = 1 To 10 For compare = 1 To 10 thisspot = NGrid(compare, y) count = 1 If thisspot < 10 For iter = 1 To 9 If thisspot = NGrid((compare + iter) - 10 * ((compare + iter) > 10), y) count = count + 1 NGrid(compare, y) = 10 NGrid((compare + iter) - 10 * ((compare + iter) > 10), y) = 10 Else Exit EndIf Next EndIf If count > 2 numchains = numchains + 1 chainlength(numchains) = count EndIf Next Next For x=1 To 10 For y=1 To 10 Ngridr(x,y)=Ngrid(x,y) Ngrid(x,y)=Ngridc(x,y) Next Next For x = 1 To 10 For compare = 1 To 10 thisspot = NGrid(x,compare) count = 1 If thisspot < 10 For iter = 1 To 9 If thisspot = NGrid(x,(iter + compare) - 10 * ((iter + compare) > 10)) count = count + 1 NGrid(x,compare) = 10 NGrid(x,(iter + compare) - 10 * ((iter + compare) > 10)) = 10 Else Exit EndIf Next EndIf If count > 2 numchains = numchains + 1 chainlength(numchains) = count EndIf Next Next For x=1 To 10 For y=1 To 10 Ngridc(x,y)=Ngrid(x,y) If Ngridc(x,y)=10 Then Grid(x,y)=Ngridc(x,y) ElseIf Ngridr(x,y)=10 Then Grid(x,y)=Ngridr(x,y) EndIf Next Next End Function
does this seem allright to you my good friend Wolron thanks for the post :)