um... i found this somewhere, i think it works. I use Java, so i
dont know how it works. I think you can compile it in Microsoft
Excel. (if you are a mac user, you wont be able to.
anyway, here it is:
Dim CX As Integer
Dim CY As Integer
Dim started As Boolean
Dim playerdead As Boolean
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If CX = 0 Then
CX = Cells(1, 1)
End If
If CY = 0 Then
CY = Cells(1, 2)
End If
If playerdead = True Then
Cells(CY, CX) = ""
playerdead = False
CX = Cells(1, 1)
CY = Cells(1, 2)
End If
If Target.Row = 2 Then
If Target.Column = 1 Then
If Cells(2, 1) = ">" Then
Cells(2, 1) = "ll"
ElseIf Cells(2, 1) = "ll" Then
Cells(2, 1) = ">"
Else
Cells(2, 1) = ">"
End If
End If
End If
If Cells(2, 1) = ">" Then Exit Sub
If Target.Row = CY - 1 Then
If Target.Borders(xlEdgeBottom).LineStyle > 0 Then
Cells(CY, CX).Select
ElseIf Cells(CY, CX).Borders(xlEdgeTop).LineStyle > 0
Then
Cells(CY, CX).Select
Else
Cells(CY, CX) = ""
CY = CY - 1
If Cells(CY, CX) = "F" Then
Cells(CY, CX) = "F"
CX = Cells(1, 1)
CY = Cells(1, 2)
Cells(2, 2) = "yippee!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "R" Then
Cells(CY, CX) = "R"
CX = Cells(CY, 1)
CY = Cells(CY, 2)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "C" Then
Cells(CY, CX) = "C"
CY = Cells(2, CX)
CX = Cells(1, CX)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
End If
Cells(CY, CX) = "J"
End If
End If
If Target.Row = CY + 1 Then
If Target.Borders(xlEdgeTop).LineStyle > 0 Then
Cells(CY, CX).Select
ElseIf Cells(CY, CX).Borders(xlEdgeBottom).LineStyle > 0
Then
Cells(CY, CX).Select
Else
Cells(CY, CX) = ""
CY = CY + 1
If Cells(CY, CX) = "F" Then
Cells(CY, CX) = "F"
CX = Cells(1, 1)
CY = Cells(1, 2)
Cells(2, 2) = "yippee!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "R" Then
Cells(CY, CX) = "R"
CX = Cells(CY, 1)
CY = Cells(CY, 2)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "C" Then
Cells(CY, CX) = "C"
CY = Cells(2, CX)
CX = Cells(1, CX)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
End If
Cells(CY, CX) = "J"
End If
End If
If Target.Column = CX + 1 Then
If Target.Borders(xlEdgeLeft).LineStyle > 0 Then
Cells(CY, CX).Select
ElseIf Cells(CY, CX).Borders(xlEdgeRight).LineStyle > 0
Then
Cells(CY, CX).Select
Else
Cells(CY, CX) = ""
CX = CX + 1
If Cells(CY, CX) = "F" Then
Cells(CY, CX) = "F"
CX = Cells(1, 1)
CY = Cells(1, 2)
Cells(2, 2) = "yippee!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "R" Then
Cells(CY, CX) = "R"
CX = Cells(CY, 1)
CY = Cells(CY, 2)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "C" Then
Cells(CY, CX) = "C"
CY = Cells(2, CX)
CX = Cells(1, CX)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
End If
Cells(CY, CX) = "J"
End If
End If
If Target.Column = CX - 1 Then
If Target.Borders(xlEdgeRight).LineStyle > 0 Then
Cells(CY, CX).Select
ElseIf Cells(CY, CX).Borders(xlEdgeLeft).LineStyle > 0
Then
Cells(CY, CX).Select
Else
Cells(CY, CX) = ""
CX = CX - 1
If Cells(CY, CX) = "F" Then
Cells(CY, CX) = "F"
CX = Cells(1, 1)
CY = Cells(1, 2)
Cells(2, 2) = "yippee!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "R" Then
Cells(CY, CX) = "R"
CX = Cells(CY, 1)
CY = Cells(CY, 2)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
ElseIf Cells(CY, CX) = "C" Then
Cells(CY, CX) = "C"
CY = Cells(2, CX)
CX = Cells(1, CX)
Cells(2, 2) = "poof!"
Cells(2, 2).Speak
End If
Cells(CY, CX) = "J"
End If
End If
Cells(CY, CX).Select
If Cells(CY, CX).Font.Bold = True Then
playerdead = True
End If
If playerdead = True Then
Cells(CY, CX) = "N"
Cells(2, 2) = "ouch!"
Cells(2, 2).Speak
Else
Cells(CY, CX) = "J"
End If
End Sub