Option Explicit
Dim mintLastBox As Integer 'Variable for selected box
Dim mintLeft As Integer 'Variable to initiate left trapping function
Dim mintRight As Integer 'Variable to initiate right trapping function
Dim mintUp As Integer 'Variable to initiate up trapping function
Dim mintDown As Integer 'Variable to initiate down trapping function
Dim mintDL As Integer 'Variable to initiate DL trapping function
Dim mintDR As Integer 'Variable to initiate DR trapping function
Dim mintUL As Integer 'Variable to initiate UL trapping function
Dim mintUR As Integer 'Variable to initiate UR trapping function
Private Sub cmdMikeWins_Click()
Dim i As Integer
Dim j As Integer
If lblPlayer1.Caption = "Mike" Or lblPlayer1.Caption = "Mike Paradiso" Or lblPlayer1.Caption = "Paradiso" Then
For i = 1 To 100
Image1(i).Picture = Image2.Picture
Next i
MsgBox vbCrLf & "Game Over." & vbCrLf & lblPlayer1.Caption & " Wins!", vbOKOnly
End If
If lblPlayer2.Caption = "Mike" Or lblPlayer2.Caption = "Mike Paradiso" Or lblPlayer2.Caption = "Paradiso" Then
For j = 1 To 100
Image1(j).Picture = Image3.Picture
Next j
MsgBox vbCrLf & "Game Over." & vbCrLf & lblPlayer2.Caption & " Wins!", vbOKOnly
End If
End Sub
Private Sub cmdPass_Click()
If lblPlayer1.Font.Bold = True Then
lblPlayer1.Font.Bold = False
lblPlayer2.Font.Bold = True
ElseIf lblPlayer2.Font.Bold = True Then
lblPlayer2.Font.Bold = False
lblPlayer1.Font.Bold = True
End If
End Sub
Private Sub Form_Load()
Image1(45).Picture = Image2.Picture
Image1(46).Picture = Image3.Picture
Image1(55).Picture = Image3.Picture
Image1(56).Picture = Image2.Picture
End Sub
Private Sub image1_click(index As Integer)
Dim intCounter As Integer
Dim intBlack As Integer
Dim intWhite As Integer
Dim n As Integer
mintLastBox = index
If lblPlayer1.Font.Bold = True Then
If Image1(mintLastBox).Picture = Image2.Picture Then
MsgBox "You Have Already Moved Here." & vbCrLf & "Please Choose A Different Square.", vbOKOnly, "Invalid Move"
Exit Sub
ElseIf Image1(mintLastBox).Picture = Image3.Picture Then
MsgBox "This Square Is Already Taken." & vbCrLf & "Please Choose A Different Square.", vbOKOnly, "Invalid Move"
Exit Sub
ElseIf Image1(mintLastBox).Picture = Image4.Picture Then
Image1(mintLastBox).Picture = Image2.Picture
Call ValidMove1
Call ValidMove2
If mintUp = 0 Then
Call UpTrap
End If
If mintDown = 0 Then
Call DownTrap
End If
If mintLeft = 0 Then
Call LeftTrap
End If
If mintRight = 0 Then
Call RightTrap
End If
If mintUL = 0 Then
Call ULTrap
End If
If mintDL = 0 Then
Call DLTrap
End If
If mintUR = 0 Then
Call URTrap
End If
If mintDR = 0 Then
Call DRTrap
End If
If mintUp = 1 And mintDown = 1 And mintLeft = 1 And mintRight = 1 And mintUL = 1 _
And mintDL = 1 And mintUR = 1 And mintDR = 1 Then
Image1(mintLastBox).Picture = Image4.Picture
MsgBox "Invalid Move" & vbCrLf & "Please Choose Another Square.", vbOKOnly, ""
Exit Sub
End If
End If
End If
If lblPlayer2.Font.Bold = True Then
If Image1(mintLastBox).Picture = Image3.Picture Then
MsgBox "You Have Already Moved Here." & vbCrLf & "Please Choose A Different Square.", vbOKOnly, "Invalid Move"
Exit Sub
ElseIf Image1(mintLastBox).Picture = Image2.Picture Then
MsgBox "This Square Is Already Taken." & vbCrLf & "Please Choose A Different Square.", vbOKOnly, "Invalid Move"
Exit Sub
ElseIf Image1(mintLastBox).Picture = Image4.Picture Then
Image1(mintLastBox).Picture = Image3.Picture
Call ValidMove1
Call ValidMove2
If mintUp = 0 Then
Call UpTrap
End If
If mintDown = 0 Then
Call DownTrap
End If
If mintLeft = 0 Then
Call LeftTrap
End If
If mintRight = 0 Then
Call RightTrap
End If
If mintUL = 0 Then
Call ULTrap
End If
If mintDL = 0 Then
Call DLTrap
End If
If mintUR = 0 Then
Call URTrap
End If
If mintDR = 0 Then
Call DRTrap
End If
If mintUp = 1 And mintDown = 1 And mintLeft = 1 And mintRight = 1 And mintUL = 1 _
And mintDL = 1 And mintUR = 1 And mintDR = 1 Then
Image1(mintLastBox).Picture = Image4.Picture
MsgBox "Invalid Move" & vbCrLf & "Please Choose Another Square.", vbOKOnly, ""
Exit Sub
End If
End If
End If
If lblPlayer1.Font.Bold = True Then
lblPlayer1.Font.Bold = False
lblPlayer2.Font.Bold = True
ElseIf lblPlayer2.Font.Bold = True Then
lblPlayer2.Font.Bold = False
lblPlayer1.Font.Bold = True
End If
For n = 0 To 100
If Image1(n).Picture = Image2.Picture Then
intBlack = intBlack + 1
ElseIf Image1(n).Picture = Image3.Picture Then
intWhite = intWhite + 1
End If
Next n
intCounter = intBlack + intWhite
If intCounter = 100 Then
If intBlack > intWhite Then
MsgBox vbCrLf & "Game Over." & vbCrLf & lblPlayer1.Caption & " Wins!", vbOKOnly
ElseIf intWhite > intBlack Then
MsgBox vbCrLf & "Game Over." & vbCrLf & lblPlayer2.Caption & " Wins!", vbOKOnly
End If
End If
'MsgBox intCounter
End Sub
Private Sub cmdEnd_Click()
Dim x As Integer
For x = 1 To 100
Image1(x).Picture = Image4.Picture
Next x
Image1(45).Picture = Image2.Picture
Image1(56).Picture = Image2.Picture
Image1(46).Picture = Image3.Picture
Image1(55).Picture = Image3.Picture
lblPlayer1.Caption = ""
lblPlayer2.Caption = ""
lblPlayer1.Font.Bold = False
lblPlayer2.Font.Bold = False
cmdNewGame.SetFocus
End Sub
Private Sub cmdNewGame_Click()
'Begin a new game
'Show the Names form
cmdEnd_Click
frmNames.Show vbModal
End Sub
Private Sub cmdScore_Click()
Dim intBlack As Integer
Dim intWhite As Integer
Dim n As Integer
'Score counter
For n = 1 To 100
If Image1(n).Picture = Image2.Picture Then
intBlack = intBlack + 1
ElseIf Image1(n).Picture = Image3.Picture Then
intWhite = intWhite + 1
End If
Next n
'Display the score for each player
MsgBox lblPlayer1.Caption & " -- " & intBlack & vbCrLf & lblPlayer2.Caption & " -- " & intWhite, vbOKOnly, ""
End Sub
Private Sub Label1_Click()
End Sub
Private Sub lblMikeWins_Click()
cmdMikeWins_Click
End Sub
Private Sub mnuFileExit_Click()
End
Unload frmNames
Unload Me
End Sub
Private Sub mnuFileScore_Click()
cmdScore_Click
End Sub
Private Sub mnuFileNewGame_Click()
cmdNewGame_Click
End Sub
Private Sub mnuHelpAbout_Click()
Load frmAbout
frmAbout.Show vbModal
End Sub
Private Sub mnuHelpRules_Click()
Load frmRules
frmRules.Show vbModal
End Sub
Private Function LeftTrap()
'This code traps to the left, and will work for both colors
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 11 And mintLastBox <> 12 _
And mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 31 And mintLastBox <> 32 _
And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 51 And mintLastBox <> 52 _
And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And mintLastBox <> 72 _
And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 91 And mintLastBox <> 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 2).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 11 And _
mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 21 And mintLastBox <> 22 And _
mintLastBox <> 23 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 51 And _
mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And _
mintLastBox <> 63 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And _
mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 91 And _
mintLastBox <> 92 And mintLastBox <> 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 3).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And _
mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And _
mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 24 And _
mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 34 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And _
mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And _
mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And _
mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And _
mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 4).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox > 5 And mintLastBox < 10 Or mintLastBox > 15 And mintLastBox < 20 Or _
mintLastBox > 25 And mintLastBox < 30 Or mintLastBox > 35 And mintLastBox < 40 Or _
mintLastBox > 45 And mintLastBox < 50 Or mintLastBox > 55 And mintLastBox < 60 Or _
mintLastBox > 65 And mintLastBox < 70 Or mintLastBox > 75 And mintLastBox < 80 Or _
mintLastBox > 85 And mintLastBox < 90 Or mintLastBox > 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 5).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 4).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox > 6 And mintLastBox < 10 Or mintLastBox > 16 And mintLastBox < 20 Or _
mintLastBox > 26 And mintLastBox < 30 Or mintLastBox > 36 And mintLastBox < 40 Or _
mintLastBox > 46 And mintLastBox < 50 Or mintLastBox > 56 And mintLastBox < 60 Or _
mintLastBox > 66 And mintLastBox < 70 Or mintLastBox > 76 And mintLastBox < 80 Or _
mintLastBox > 86 And mintLastBox < 90 Or mintLastBox > 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 6).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 5).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 7 And mintLastBox < 10 Or mintLastBox > 17 And mintLastBox < 20 Or _
mintLastBox > 27 And mintLastBox < 30 Or mintLastBox > 37 And mintLastBox < 40 Or _
mintLastBox > 47 And mintLastBox < 50 Or mintLastBox > 57 And mintLastBox < 60 Or _
mintLastBox > 67 And mintLastBox < 70 Or mintLastBox > 77 And mintLastBox < 80 Or _
mintLastBox > 87 And mintLastBox < 90 Or mintLastBox > 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 7).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 6).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 9 Or mintLastBox = 19 Or mintLastBox = 29 Or mintLastBox = 39 Or _
mintLastBox = 49 Or mintLastBox = 59 Or mintLastBox = 69 Or mintLastBox = 79 Or _
mintLastBox = 89 Or mintLastBox = 99 Or mintLastBox = 10 Or mintLastBox = 20 Or _
mintLastBox = 30 Or mintLastBox = 40 Or mintLastBox = 50 Or mintLastBox = 60 Or _
mintLastBox = 70 Or mintLastBox = 80 Or mintLastBox = 90 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 7).Picture And Image1(mintLastBox - 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 8).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 6).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 7).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 10 Or mintLastBox = 20 Or mintLastBox = 30 Or mintLastBox = 40 Or _
mintLastBox = 50 Or mintLastBox = 60 Or mintLastBox = 70 Or mintLastBox = 80 Or _
mintLastBox = 90 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 7).Picture And Image1(mintLastBox - 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 8).Picture And Image1(mintLastBox - 8).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 9).Picture Then
Image1(mintLastBox - 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 6).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 7).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 8).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function RightTrap()
'This code traps to the right, and will work for both colors
If mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 19 And mintLastBox <> 20 And mintLastBox <> 29 And _
mintLastBox <> 30 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 99 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 2).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 18 And mintLastBox <> 19 And _
mintLastBox <> 20 And mintLastBox <> 28 And mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 38 And _
mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 88 And _
mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 98 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 3).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox <> 7 And mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 17 And _
mintLastBox <> 18 And mintLastBox <> 19 And mintLastBox <> 20 And mintLastBox <> 27 And mintLastBox <> 28 And _
mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 37 And mintLastBox <> 38 And mintLastBox <> 39 And _
mintLastBox <> 40 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 67 And _
mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 87 And mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And _
mintLastBox < 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 4).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox <> 6 And mintLastBox <> 7 And mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And _
mintLastBox <> 16 And mintLastBox <> 17 And mintLastBox <> 18 And mintLastBox <> 19 And mintLastBox <> 20 And _
mintLastBox <> 26 And mintLastBox <> 27 And mintLastBox <> 28 And mintLastBox <> 29 And mintLastBox <> 30 And _
mintLastBox <> 36 And mintLastBox <> 37 And mintLastBox <> 38 And mintLastBox <> 39 And mintLastBox <> 40 And _
mintLastBox <> 46 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 56 And mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And _
mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And _
mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 5).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 4).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox < 5 Or mintLastBox > 10 And mintLastBox < 15 Or mintLastBox > 20 And mintLastBox < 25 Or _
mintLastBox > 30 And mintLastBox < 35 Or mintLastBox > 40 And mintLastBox < 45 Or mintLastBox > 50 And _
mintLastBox < 55 Or mintLastBox > 60 And mintLastBox < 65 Or mintLastBox > 70 And mintLastBox < 75 Or _
mintLastBox > 80 And mintLastBox < 85 Or mintLastBox > 90 And mintLastBox < 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 6).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 5).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 4 Or mintLastBox > 10 And mintLastBox < 14 Or mintLastBox > 20 And mintLastBox < 24 Or _
mintLastBox > 30 And mintLastBox < 34 Or mintLastBox > 40 And mintLastBox < 44 Or mintLastBox > 50 And _
mintLastBox < 54 Or mintLastBox > 60 And mintLastBox < 64 Or mintLastBox > 70 And mintLastBox < 74 Or _
mintLastBox > 80 And mintLastBox < 84 Or mintLastBox > 90 And mintLastBox < 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 7).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 6).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 3 Or mintLastBox > 10 And mintLastBox < 13 Or mintLastBox > 20 And mintLastBox < 23 Or _
mintLastBox > 30 And mintLastBox < 33 Or mintLastBox > 40 And mintLastBox < 43 Or mintLastBox > 50 And _
mintLastBox < 53 Or mintLastBox > 60 And mintLastBox < 63 Or mintLastBox > 70 And mintLastBox < 73 Or _
mintLastBox > 80 And mintLastBox < 83 Or mintLastBox > 90 And mintLastBox < 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 7).Picture And Image1(mintLastBox + 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 8).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 6).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 7).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 1 Or mintLastBox = 21 Or mintLastBox = 31 Or mintLastBox = 41 Or mintLastBox = 51 Or _
mintLastBox = 61 Or mintLastBox = 71 Or mintLastBox = 81 Or mintLastBox = 91 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 7).Picture And Image1(mintLastBox + 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 8).Picture And Image1(mintLastBox + 8).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 9).Picture Then
Image1(mintLastBox + 1).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 2).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 3).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 4).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 5).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 6).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 7).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 8).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function UpTrap()
'This code traps upward, and will work for both colors
If mintLastBox > 20 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox > 30 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox > 40 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox > 50 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox > 60 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox - 60).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 70 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox - 70).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 60).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 80 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 70).Picture And Image1(mintLastBox - 70).Picture <> Image4.Picture Then
If Image1(mintLastBox - 80).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 60).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 70).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 90 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 70).Picture And Image1(mintLastBox - 70).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 80).Picture And Image1(mintLastBox - 80).Picture <> Image4.Picture Then
If Image1(mintLastBox - 90).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 60).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 70).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 80).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function DownTrap()
'This code traps downward, and will work for both colors
If mintLastBox < 81 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox < 71 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox < 61 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox < 51 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox < 41 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox + 60).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 31 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox + 70).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 60).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 21 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 70).Picture And Image1(mintLastBox + 70).Picture <> Image4.Picture Then
If Image1(mintLastBox + 80).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 60).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 70).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 11 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 70).Picture And Image1(mintLastBox + 70).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 80).Picture And Image1(mintLastBox + 80).Picture <> Image4.Picture Then
If Image1(mintLastBox + 90).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox + 10).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 60).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 70).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 80).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function ULTrap()
'This code traps diagonally from bottom right to top left, and will work for both colors
If mintLastBox > 22 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 91 And mintLastBox <> 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 22).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox > 33 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 33).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox > 44 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 44).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox > 55 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And mintLastBox <> 65 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 And mintLastBox <> 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 55).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 44).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox > 66 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 And mintLastBox <> 95 And mintLastBox <> 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 66).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 55).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 78 Or mintLastBox = 79 Or mintLastBox = 80 Or mintLastBox = 88 Or mintLastBox = 89 = mintLastBox = 90 Or mintLastBox = 98 Or mintLastBox = 99 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 77).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 66).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 89 Or mintLastBox = 90 Or mintLastBox = 99 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 77).Picture And Image1(mintLastBox - 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 88).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 66).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 77).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 77).Picture And Image1(mintLastBox - 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 88).Picture And Image1(mintLastBox - 88).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 99).Picture Then
Image1(mintLastBox - 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 66).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 77).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 88).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function DLTrap()
'This code traps diagonally from top right to bottom left, and will work for both colors
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 21 And _
mintLastBox <> 22 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 41 And mintLastBox <> 42 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And _
mintLastBox <> 72 And mintLastBox < 81 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 18).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 11 And mintLastBox <> 12 And _
mintLastBox <> 13 And mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 31 And _
mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And _
mintLastBox <> 63 And mintLastBox < 71 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 27).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And mintLastBox <> 11 And _
mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And mintLastBox <> 21 And mintLastBox <> 22 And _
mintLastBox <> 23 And mintLastBox <> 24 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And _
mintLastBox <> 34 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And mintLastBox < 61 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 36).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And mintLastBox <> 5 And _
mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And mintLastBox <> 15 And _
mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 24 And mintLastBox <> 25 And _
mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 34 And mintLastBox <> 35 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And mintLastBox <> 45 And _
mintLastBox < 51 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 45).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 36).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox = 7 Or mintLastBox = 8 Or mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 17 Or _
mintLastBox = 18 Or mintLastBox = 19 Or mintLastBox = 20 Or mintLastBox = 37 Or mintLastBox = 38 Or _
mintLastBox = 39 Or mintLastBox = 40 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 54).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 45).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 8 Or mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 18 Or mintLastBox = 19 Or _
mintLastBox = 20 Or mintLastBox = 28 Or mintLastBox = 29 Or mintLastBox = 30 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 63).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 54).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 19 Or mintLastBox = 20 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 63).Picture And Image1(mintLastBox + 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 72).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 54).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 63).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 10 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 63).Picture And Image1(mintLastBox + 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 72).Picture And Image1(mintLastBox + 72).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 81).Picture Then
Image1(mintLastBox + 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 54).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 63).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 72).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function URTrap()
'This code traps diagonally from bottom left to top right, and will work for both colors
If mintLastBox > 20 And mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 49 And _
mintLastBox <> 50 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox <> 99 And mintLastBox <> 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 18).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox > 30 And mintLastBox <> 38 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 48 And mintLastBox <> 49 And _
mintLastBox <> 50 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 88 And mintLastBox <> 89 And _
mintLastBox <> 90 And mintLastBox < 98 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 27).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox > 40 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And mintLastBox <> 57 And _
mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 36).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox > 50 And mintLastBox <> 56 And mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And _
mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 76 And _
mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 45).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 36).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox > 60 And mintLastBox <> 65 And mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 87 And mintLastBox <> 88 And mintLastBox <> 89 And _
mintLastBox <> 90 And mintLastBox < 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox - 54).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 45).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 70 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 77 And mintLastBox <> 78 And _
mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox - 63).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 54).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 81 Or mintLastBox = 82 Or mintLastBox = 91 Or mintLastBox = 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 63).Picture And Image1(mintLastBox - 63).Picture <> Image4.Picture Then
If Image1(mintLastBox - 72).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 54).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 63).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 91 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 63).Picture And Image1(mintLastBox - 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 72).Picture And Image1(mintLastBox - 72).Picture <> Image4.Picture Then
If Image1(mintLastBox - 81).Picture = Image1(mintLastBox).Picture Then
Image1(mintLastBox - 9).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 18).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 27).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 36).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 45).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 54).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 63).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox - 72).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function DRTrap()
'This code traps diagonally from top left to bottom right, and will work for both colors
If mintLastBox < 79 And mintLastBox <> 70 And mintLastBox <> 69 And mintLastBox <> 60 And mintLastBox <> 59 And _
mintLastBox <> 50 And mintLastBox <> 49 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 30 And _
mintLastBox <> 29 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 10 And mintLastBox <> 9 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
End If
End If
End If
If mintLastBox < 68 And mintLastBox <> 60 And mintLastBox <> 59 And mintLastBox <> 58 And mintLastBox <> 50 And _
mintLastBox <> 49 And mintLastBox <> 48 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And _
mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 28 And mintLastBox <> 20 And _
mintLastBox <> 19 And mintLastBox <> 18 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 33).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
If mintLastBox < 57 And mintLastBox <> 50 And mintLastBox <> 49 And mintLastBox <> 48 And mintLastBox <> 47 And _
mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And mintLastBox <> 37 And mintLastBox <> 30 And _
mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And mintLastBox <> 20 And mintLastBox <> 19 And _
mintLastBox <> 18 And mintLastBox <> 17 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And _
mintLastBox <> 7 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 44).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
If mintLastBox < 46 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And mintLastBox <> 37 And _
mintLastBox <> 36 And mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And _
mintLastBox <> 26 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 18 And mintLastBox <> 17 And _
mintLastBox <> 16 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And mintLastBox <> 7 And mintLastBox <> 6 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 55).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 44).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
If mintLastBox < 35 And mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And _
mintLastBox <> 26 And mintLastBox <> 25 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 18 And _
mintLastBox <> 17 And mintLastBox <> 16 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And _
mintLastBox <> 7 And mintLastBox <> 6 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 66).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 55).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 23 Or mintLastBox = 22 Or mintLastBox = 21 Or mintLastBox = 13 Or mintLastBox = 12 Or mintLastBox = 11 Or mintLastBox = 3 Or mintLastBox = 2 Or mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 77).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 66).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 12 Or mintLastBox = 11 Or mintLastBox = 2 Or mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 77).Picture And Image1(mintLastBox + 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 88).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 66).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 77).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 77).Picture And Image1(mintLastBox + 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 88).Picture And Image1(mintLastBox + 88).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(100).Picture Then
Image1(mintLastBox + 11).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 22).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 33).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 44).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 55).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 66).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 77).Picture = Image1(mintLastBox).Picture
Image1(mintLastBox + 88).Picture = Image1(mintLastBox).Picture
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function ValidMove1()
'Testing the traps.
'If the variable = 1 then there is no trap in that direction.
'If the variable = 0 then the trap is good and it will execute.
mintUp = 1
mintDown = 1
mintLeft = 1
mintRight = 1
'This code traps upward, and will work for both colors
If mintLastBox > 20 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox - 20).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
If mintLastBox > 30 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox - 30).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
If mintLastBox > 40 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox - 40).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
If mintLastBox > 50 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox - 50).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
End If
If mintLastBox > 60 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox - 60).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 70 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox - 70).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 80 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 70).Picture And Image1(mintLastBox - 70).Picture <> Image4.Picture Then
If Image1(mintLastBox - 80).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 90 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 10).Picture And Image1(mintLastBox - 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 20).Picture And Image1(mintLastBox - 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 30).Picture And Image1(mintLastBox - 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 40).Picture And Image1(mintLastBox - 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 50).Picture And Image1(mintLastBox - 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 60).Picture And Image1(mintLastBox - 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 70).Picture And Image1(mintLastBox - 70).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 80).Picture And Image1(mintLastBox - 80).Picture <> Image4.Picture Then
If Image1(mintLastBox - 90).Picture = Image1(mintLastBox).Picture Then
mintUp = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps downward, and will work for both colors
If mintLastBox < 81 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox + 20).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
If mintLastBox < 71 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox + 30).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
If mintLastBox < 61 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox + 40).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
If mintLastBox < 51 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox + 50).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
End If
If mintLastBox < 41 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox + 60).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 31 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox + 70).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 21 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 70).Picture And Image1(mintLastBox + 70).Picture <> Image4.Picture Then
If Image1(mintLastBox + 80).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 11 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 10).Picture And Image1(mintLastBox + 10).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 20).Picture And Image1(mintLastBox + 20).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 30).Picture And Image1(mintLastBox + 30).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 40).Picture And Image1(mintLastBox + 40).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 50).Picture And Image1(mintLastBox + 50).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 60).Picture And Image1(mintLastBox + 60).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 70).Picture And Image1(mintLastBox + 70).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 80).Picture And Image1(mintLastBox + 80).Picture <> Image4.Picture Then
If Image1(mintLastBox + 90).Picture = Image1(mintLastBox).Picture Then
mintDown = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps to the left, and will work for both colors
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 11 And mintLastBox <> 12 _
And mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 31 And mintLastBox <> 32 _
And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 51 And mintLastBox <> 52 _
And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And mintLastBox <> 72 _
And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 91 And mintLastBox <> 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 2).Picture Then
mintLeft = 0
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 11 And _
mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 21 And mintLastBox <> 22 And _
mintLastBox <> 23 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 51 And _
mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And _
mintLastBox <> 63 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And _
mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 91 And _
mintLastBox <> 92 And mintLastBox <> 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 3).Picture Then
mintLeft = 0
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And _
mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And _
mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 24 And _
mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 34 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And _
mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And _
mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And _
mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And _
mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 4).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
If mintLastBox > 5 And mintLastBox < 10 Or mintLastBox > 15 And mintLastBox < 20 Or _
mintLastBox > 25 And mintLastBox < 30 Or mintLastBox > 35 And mintLastBox < 40 Or _
mintLastBox > 45 And mintLastBox < 50 Or mintLastBox > 55 And mintLastBox < 60 Or _
mintLastBox > 65 And mintLastBox < 70 Or mintLastBox > 75 And mintLastBox < 80 Or _
mintLastBox > 85 And mintLastBox < 90 Or mintLastBox > 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 5).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
End If
If mintLastBox > 6 And mintLastBox < 10 Or mintLastBox > 16 And mintLastBox < 20 Or _
mintLastBox > 26 And mintLastBox < 30 Or mintLastBox > 36 And mintLastBox < 40 Or _
mintLastBox > 46 And mintLastBox < 50 Or mintLastBox > 56 And mintLastBox < 60 Or _
mintLastBox > 66 And mintLastBox < 70 Or mintLastBox > 76 And mintLastBox < 80 Or _
mintLastBox > 86 And mintLastBox < 90 Or mintLastBox > 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 6).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 7 And mintLastBox < 10 Or mintLastBox > 17 And mintLastBox < 20 Or _
mintLastBox > 27 And mintLastBox < 30 Or mintLastBox > 37 And mintLastBox < 40 Or _
mintLastBox > 47 And mintLastBox < 50 Or mintLastBox > 57 And mintLastBox < 60 Or _
mintLastBox > 67 And mintLastBox < 70 Or mintLastBox > 77 And mintLastBox < 80 Or _
mintLastBox > 87 And mintLastBox < 90 Or mintLastBox > 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 7).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 9 Or mintLastBox = 19 Or mintLastBox = 29 Or mintLastBox = 39 Or _
mintLastBox = 49 Or mintLastBox = 59 Or mintLastBox = 69 Or mintLastBox = 79 Or _
mintLastBox = 89 Or mintLastBox = 99 Or mintLastBox = 10 Or mintLastBox = 20 Or _
mintLastBox = 30 Or mintLastBox = 40 Or mintLastBox = 50 Or mintLastBox = 60 Or _
mintLastBox = 70 Or mintLastBox = 80 Or mintLastBox = 90 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 7).Picture And Image1(mintLastBox - 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 8).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 10 Or mintLastBox = 20 Or mintLastBox = 30 Or mintLastBox = 40 Or _
mintLastBox = 50 Or mintLastBox = 60 Or mintLastBox = 70 Or mintLastBox = 80 Or _
mintLastBox = 90 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 1).Picture And Image1(mintLastBox - 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 2).Picture And Image1(mintLastBox - 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 3).Picture And Image1(mintLastBox - 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 4).Picture And Image1(mintLastBox - 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 5).Picture And Image1(mintLastBox - 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 6).Picture And Image1(mintLastBox - 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 7).Picture And Image1(mintLastBox - 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 8).Picture And Image1(mintLastBox - 8).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 9).Picture Then
mintLeft = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps to the right, and will work for both colors
If mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 19 And mintLastBox <> 20 And mintLastBox <> 29 And _
mintLastBox <> 30 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 99 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 2).Picture Then
mintRight = 0
End If
End If
End If
If mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 18 And mintLastBox <> 19 And _
mintLastBox <> 20 And mintLastBox <> 28 And mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 38 And _
mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 88 And _
mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 98 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 3).Picture Then
mintRight = 0
End If
End If
End If
End If
If mintLastBox <> 7 And mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And mintLastBox <> 17 And _
mintLastBox <> 18 And mintLastBox <> 19 And mintLastBox <> 20 And mintLastBox <> 27 And mintLastBox <> 28 And _
mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 37 And mintLastBox <> 38 And mintLastBox <> 39 And _
mintLastBox <> 40 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 67 And _
mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 87 And mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And _
mintLastBox < 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 4).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
If mintLastBox <> 6 And mintLastBox <> 7 And mintLastBox <> 8 And mintLastBox <> 9 And mintLastBox <> 10 And _
mintLastBox <> 16 And mintLastBox <> 17 And mintLastBox <> 18 And mintLastBox <> 19 And mintLastBox <> 20 And _
mintLastBox <> 26 And mintLastBox <> 27 And mintLastBox <> 28 And mintLastBox <> 29 And mintLastBox <> 30 And _
mintLastBox <> 36 And mintLastBox <> 37 And mintLastBox <> 38 And mintLastBox <> 39 And mintLastBox <> 40 And _
mintLastBox <> 46 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And _
mintLastBox <> 56 And mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And _
mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And _
mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 5).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
End If
If mintLastBox < 5 Or mintLastBox > 10 And mintLastBox < 15 Or mintLastBox > 20 And mintLastBox < 25 Or _
mintLastBox > 30 And mintLastBox < 35 Or mintLastBox > 40 And mintLastBox < 45 Or mintLastBox > 50 And _
mintLastBox < 55 Or mintLastBox > 60 And mintLastBox < 65 Or mintLastBox > 70 And mintLastBox < 75 Or _
mintLastBox > 80 And mintLastBox < 85 Or mintLastBox > 90 And mintLastBox < 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 6).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 4 Or mintLastBox > 10 And mintLastBox < 14 Or mintLastBox > 20 And mintLastBox < 24 Or _
mintLastBox > 30 And mintLastBox < 34 Or mintLastBox > 40 And mintLastBox < 44 Or mintLastBox > 50 And _
mintLastBox < 54 Or mintLastBox > 60 And mintLastBox < 64 Or mintLastBox > 70 And mintLastBox < 74 Or _
mintLastBox > 80 And mintLastBox < 84 Or mintLastBox > 90 And mintLastBox < 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 7).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox < 3 Or mintLastBox > 10 And mintLastBox < 13 Or mintLastBox > 20 And mintLastBox < 23 Or _
mintLastBox > 30 And mintLastBox < 33 Or mintLastBox > 40 And mintLastBox < 43 Or mintLastBox > 50 And _
mintLastBox < 53 Or mintLastBox > 60 And mintLastBox < 63 Or mintLastBox > 70 And mintLastBox < 73 Or _
mintLastBox > 80 And mintLastBox < 83 Or mintLastBox > 90 And mintLastBox < 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 7).Picture And Image1(mintLastBox + 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 8).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 1 Or mintLastBox = 21 Or mintLastBox = 31 Or mintLastBox = 41 Or mintLastBox = 51 Or _
mintLastBox = 61 Or mintLastBox = 71 Or mintLastBox = 81 Or mintLastBox = 91 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 1).Picture And Image1(mintLastBox + 1).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 2).Picture And Image1(mintLastBox + 2).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 3).Picture And Image1(mintLastBox + 3).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 4).Picture And Image1(mintLastBox + 4).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 5).Picture And Image1(mintLastBox + 5).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 6).Picture And Image1(mintLastBox + 6).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 7).Picture And Image1(mintLastBox + 7).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 8).Picture And Image1(mintLastBox + 8).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 9).Picture Then
mintRight = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
Private Function ValidMove2()
mintUL = 1
mintDL = 1
mintUR = 1
mintDR = 1
'This code traps diagonally from bottom right to top left, and will work for both colors
If mintLastBox > 22 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 91 And mintLastBox <> 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 22).Picture Then
mintUL = 0
End If
End If
End If
If mintLastBox > 33 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 33).Picture Then
mintUL = 0
End If
End If
End If
End If
If mintLastBox > 44 And mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 44).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
If mintLastBox > 55 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 63 And mintLastBox <> 64 And mintLastBox <> 65 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 And mintLastBox <> 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 55).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
End If
If mintLastBox > 66 And mintLastBox <> 71 And mintLastBox <> 72 And mintLastBox <> 73 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 81 And mintLastBox <> 82 And mintLastBox <> 83 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 91 And mintLastBox <> 92 And mintLastBox <> 93 And mintLastBox <> 94 And mintLastBox <> 95 And mintLastBox <> 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 66).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 78 Or mintLastBox = 79 Or mintLastBox = 80 Or mintLastBox = 88 Or mintLastBox = 89 = mintLastBox = 90 Or mintLastBox = 98 Or mintLastBox = 99 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 77).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 89 Or mintLastBox = 90 Or mintLastBox = 99 Or mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 77).Picture And Image1(mintLastBox - 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 88).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 11).Picture And Image1(mintLastBox - 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 22).Picture And Image1(mintLastBox - 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 33).Picture And Image1(mintLastBox - 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 44).Picture And Image1(mintLastBox - 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 55).Picture And Image1(mintLastBox - 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 66).Picture And Image1(mintLastBox - 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 77).Picture And Image1(mintLastBox - 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 88).Picture And Image1(mintLastBox - 88).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 99).Picture Then
mintUL = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps diagonally from top right to bottom left, and will work for both colors
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 21 And _
mintLastBox <> 22 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 41 And mintLastBox <> 42 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 61 And mintLastBox <> 62 And mintLastBox <> 71 And _
mintLastBox <> 72 And mintLastBox < 81 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 18).Picture Then
mintDL = 0
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 11 And mintLastBox <> 12 And _
mintLastBox <> 13 And mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 31 And _
mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 61 And mintLastBox <> 62 And _
mintLastBox <> 63 And mintLastBox < 71 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 27).Picture Then
mintDL = 0
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And mintLastBox <> 11 And _
mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And mintLastBox <> 21 And mintLastBox <> 22 And _
mintLastBox <> 23 And mintLastBox <> 24 And mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And _
mintLastBox <> 34 And mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And _
mintLastBox <> 51 And mintLastBox <> 52 And mintLastBox <> 53 And mintLastBox <> 54 And mintLastBox < 61 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 36).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
If mintLastBox <> 1 And mintLastBox <> 2 And mintLastBox <> 3 And mintLastBox <> 4 And mintLastBox <> 5 And _
mintLastBox <> 11 And mintLastBox <> 12 And mintLastBox <> 13 And mintLastBox <> 14 And mintLastBox <> 15 And _
mintLastBox <> 21 And mintLastBox <> 22 And mintLastBox <> 23 And mintLastBox <> 24 And mintLastBox <> 25 And _
mintLastBox <> 31 And mintLastBox <> 32 And mintLastBox <> 33 And mintLastBox <> 34 And mintLastBox <> 35 And _
mintLastBox <> 41 And mintLastBox <> 42 And mintLastBox <> 43 And mintLastBox <> 44 And mintLastBox <> 45 And _
mintLastBox < 51 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 45).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
End If
If mintLastBox = 7 Or mintLastBox = 8 Or mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 17 Or _
mintLastBox = 18 Or mintLastBox = 19 Or mintLastBox = 20 Or mintLastBox = 37 Or mintLastBox = 38 Or _
mintLastBox = 39 Or mintLastBox = 40 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 54).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 8 Or mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 18 Or mintLastBox = 19 Or _
mintLastBox = 20 Or mintLastBox = 28 Or mintLastBox = 29 Or mintLastBox = 30 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 63).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 9 Or mintLastBox = 10 Or mintLastBox = 19 Or mintLastBox = 20 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 63).Picture And Image1(mintLastBox + 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 72).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 10 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 9).Picture And Image1(mintLastBox + 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 18).Picture And Image1(mintLastBox + 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 27).Picture And Image1(mintLastBox + 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 36).Picture And Image1(mintLastBox + 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 45).Picture And Image1(mintLastBox + 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 54).Picture And Image1(mintLastBox + 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 63).Picture And Image1(mintLastBox + 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 72).Picture And Image1(mintLastBox + 72).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 81).Picture Then
mintDL = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps diagonally from bottom left to top right, and will work for both colors
If mintLastBox > 20 And mintLastBox <> 29 And mintLastBox <> 30 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 49 And _
mintLastBox <> 50 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox <> 99 And mintLastBox <> 100 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 18).Picture Then
mintUR = 0
End If
End If
End If
If mintLastBox > 30 And mintLastBox <> 38 And mintLastBox <> 39 And mintLastBox <> 40 And mintLastBox <> 48 And mintLastBox <> 49 And _
mintLastBox <> 50 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 88 And mintLastBox <> 89 And _
mintLastBox <> 90 And mintLastBox < 98 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 27).Picture Then
mintUR = 0
End If
End If
End If
End If
If mintLastBox > 40 And mintLastBox <> 47 And mintLastBox <> 48 And mintLastBox <> 49 And mintLastBox <> 50 And mintLastBox <> 57 And _
mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 97 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 36).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
If mintLastBox > 50 And mintLastBox <> 56 And mintLastBox <> 57 And mintLastBox <> 58 And mintLastBox <> 59 And mintLastBox <> 60 And _
mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And mintLastBox <> 70 And mintLastBox <> 76 And _
mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 96 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox - 45).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
End If
If mintLastBox > 60 And mintLastBox <> 65 And mintLastBox <> 66 And mintLastBox <> 67 And mintLastBox <> 68 And mintLastBox <> 69 And _
mintLastBox <> 70 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 77 And mintLastBox <> 78 And mintLastBox <> 79 And _
mintLastBox <> 80 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 87 And mintLastBox <> 88 And mintLastBox <> 89 And _
mintLastBox <> 90 And mintLastBox < 95 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox - 54).Picture = Image1(mintLastBox).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox > 70 And mintLastBox <> 74 And mintLastBox <> 75 And mintLastBox <> 76 And mintLastBox <> 77 And mintLastBox <> 78 And _
mintLastBox <> 79 And mintLastBox <> 80 And mintLastBox <> 84 And mintLastBox <> 85 And mintLastBox <> 86 And mintLastBox <> 87 And _
mintLastBox <> 88 And mintLastBox <> 89 And mintLastBox <> 90 And mintLastBox < 94 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox - 63).Picture = Image1(mintLastBox).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 81 Or mintLastBox = 82 Or mintLastBox = 91 Or mintLastBox = 92 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 63).Picture And Image1(mintLastBox - 63).Picture <> Image4.Picture Then
If Image1(mintLastBox - 72).Picture = Image1(mintLastBox).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 91 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 9).Picture And Image1(mintLastBox - 9).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 18).Picture And Image1(mintLastBox - 18).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 27).Picture And Image1(mintLastBox - 27).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 36).Picture And Image1(mintLastBox - 36).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 45).Picture And Image1(mintLastBox - 45).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 54).Picture And Image1(mintLastBox - 54).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 63).Picture And Image1(mintLastBox - 63).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox - 72).Picture And Image1(mintLastBox - 72).Picture <> Image4.Picture Then
If Image1(mintLastBox - 81).Picture = Image1(mintLastBox).Picture Then
mintUR = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
'This code traps diagonally from top left to bottom right, and will work for both colors
If mintLastBox < 79 And mintLastBox <> 70 And mintLastBox <> 69 And mintLastBox <> 60 And mintLastBox <> 59 And _
mintLastBox <> 50 And mintLastBox <> 49 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 30 And _
mintLastBox <> 29 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 10 And mintLastBox <> 9 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
mintDR = 0
End If
End If
End If
If mintLastBox < 68 And mintLastBox <> 60 And mintLastBox <> 59 And mintLastBox <> 58 And mintLastBox <> 50 And _
mintLastBox <> 49 And mintLastBox <> 48 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And _
mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 28 And mintLastBox <> 20 And _
mintLastBox <> 19 And mintLastBox <> 18 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 33).Picture Then
mintDR = 0
End If
End If
End If
End If
If mintLastBox < 57 And mintLastBox <> 50 And mintLastBox <> 49 And mintLastBox <> 48 And mintLastBox <> 47 And _
mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And mintLastBox <> 37 And mintLastBox <> 30 And _
mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And mintLastBox <> 20 And mintLastBox <> 19 And _
mintLastBox <> 18 And mintLastBox <> 17 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And _
mintLastBox <> 7 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 44).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
If mintLastBox < 46 And mintLastBox <> 40 And mintLastBox <> 39 And mintLastBox <> 38 And mintLastBox <> 37 And _
mintLastBox <> 36 And mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And _
mintLastBox <> 26 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 18 And mintLastBox <> 17 And _
mintLastBox <> 16 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And mintLastBox <> 7 And mintLastBox <> 6 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 55).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
End If
If mintLastBox < 35 And mintLastBox <> 30 And mintLastBox <> 29 And mintLastBox <> 28 And mintLastBox <> 27 And _
mintLastBox <> 26 And mintLastBox <> 25 And mintLastBox <> 20 And mintLastBox <> 19 And mintLastBox <> 18 And _
mintLastBox <> 17 And mintLastBox <> 16 And mintLastBox <> 10 And mintLastBox <> 9 And mintLastBox <> 8 And _
mintLastBox <> 7 And mintLastBox <> 6 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 66).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 23 Or mintLastBox = 22 Or mintLastBox = 21 Or mintLastBox = 13 Or mintLastBox = 12 Or mintLastBox = 11 Or mintLastBox = 3 Or mintLastBox = 2 Or mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 77).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 12 Or mintLastBox = 11 Or mintLastBox = 2 Or mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 77).Picture And Image1(mintLastBox + 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(mintLastBox + 88).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
If mintLastBox = 1 Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 11).Picture And Image1(mintLastBox + 11).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 22).Picture And Image1(mintLastBox + 22).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 33).Picture And Image1(mintLastBox + 33).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 44).Picture And Image1(mintLastBox + 44).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 55).Picture And Image1(mintLastBox + 55).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 66).Picture And Image1(mintLastBox + 66).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 77).Picture And Image1(mintLastBox + 77).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture <> Image1(mintLastBox + 88).Picture And Image1(mintLastBox + 88).Picture <> Image4.Picture Then
If Image1(mintLastBox).Picture = Image1(100).Picture Then
mintDR = 0
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function