View Single Post
Old 01-12-2004, 10:01 PM   #3
Kon-Tiki
[BANNED]

 
Join Date: Sep 2004
Location: Dentergem, Belgium
Posts: 1,811
Default

My documentation? As in what which calculation does?
Code:
Public Sub NESWDiagonaal(intLastSpot, bytChecking, intPosition)
 intLastSpot = intPosition
Dim intKolom As Integer
Dim intRij As Integer
Dim intMultiply As Integer
Dim intMultiplyFinal As Integer

' * Geen doorvallen langs beneden
intLastSpot = intLastSpot - 24
Do Until intLastSpot >= 0
 *intLastSpot = intLastSpot + 8
Loop

 Select Case intPosition
 *Case 14
 * *intLastSpot = 14
 *Case 21
 * *intLastSpot = 21
 *Case 28
 * *intLastSpot = 28
 *Case 35
 * *intLastSpot = 35
End Select

' * Aantal keren dat ge naar rechtsboven kunt

intKolom = 6 - intLastSpotKolom
MsgBox "intKolom = " & intKolom & "."

If intKolom < 3 Then
 *intMultiply = intKolom
Else
 *intMultiply = 3
End If

intMultiplyFinal = intMultiply * 8
MsgBox "Final = " & intMultiplyFinal & "."
Do
Call WinCheck(intLastSpot, bytChecking)

 If intMultiply > 0 Then
 * intLastSpot = intLastSpot + 8
 * intMultiply = intMultiply - 1
 * MsgBox "intMultiply = " & intMultiply & "."
 End If
Loop Until intLastSpot = (intPosition + intMultiplyFinal)
End Sub
This part of the code's the one where the bug's in. The problem, is that the loop gets stuck. The + 8 is to jump to the square one NE of the last one, and it starts three squares SW of the one a disc is dropped in (hence the -24). If that turns out to be under the playfield, it counts up 8 until it's above 0 again (thus being in the playfield)

The intKolom and intMultiply are there to take care of the wrapping around. We don't want people to win when they have two discs diagonal from each other on the right edge and two on the left.
Kon-Tiki is offline                         Send a private message to Kon-Tiki
Reply With Quote