Next j
Next i
For i = 1 To 15 '扫描己方活四棋形
For j = 1 To 15
If PieceTar(i, j) = 0 Then
t = DoGen(PieceTar, i, j, Flag)
If t = FFDL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FFDL: Exit Function
If t = FFSL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FFSL: Exit Function
If t = FTDL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FTDL: Exit Function
If t = FL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FL: Exit Function
End If
Next j
Next i
For i = 1 To 15 '扫描己方成四伴随棋形
For j = 1 To 15
If PieceTar(i, j) = 0 Then
t = DoGen(PieceTar, i, j, Flag)
If t = FTSL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FTSL: Exit Function
If t = FFNL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FFNL: Exit Function
End If
Next j
Next i
For i = 1 To 15 '扫描对方活四伴随棋形
For j = 1 To 15
If PieceTar(i, j) = 0 Then
t = DoGen(PieceTar, i, j, FlagX)
If t = FFDL Then GetVitalStep = i + (j - 1) * 15: Exit Function
If t = FTDL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FTDL: Exit Function
If t = FFSL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FFSL: Exit Function
If t = FL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FL: Exit Function
End If
Next j
Next i
For i = 1 To 15 '扫描己方成四伴随棋形
For j = 1 To 15
If PieceTar(i, j) = 0 Then
t = DoGen(PieceTar, i, j, Flag)
If t = FTSL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FTSL: Exit Function
If t = FFNL Then GetVitalStep = i + (j - 1) * 15: ScoreTar = FFNL: Exit Function
End If
Next j
Next i
For i = 1 To 15 '扫描己方双活三棋形
For j = 1 To 15
If PieceTar(i, j) = 0 Then
|