Advertisement
Just_Tom

Untitled

Mar 24th, 2024
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VisualBasic 0.53 KB | Source Code | 0 0
  1. Private Sub PrecomputedMoveData()
  2.     'Generates the squares from the edge of the board in each direction for each square
  3.    For File = 0 To 7
  4.         For Rank = 0 To 7
  5.             Dim NSWE() As Byte = {7 - Rank, Rank, 7 - File, File}
  6.             Dim SquareIndex As Byte = Rank * 8 + File
  7.             NumSquaresToEdgeSliding(SquareIndex) = New Byte() {NSWE(0), NSWE(1), NSWE(2), NSWE(3), Math.Min(NSWE(0), NSWE(2)), Math.Min(NSWE(1), NSWE(3)), Math.Min(NSWE(0), NSWE(3)), Math.Min(NSWE(1), NSWE(2))}
  8.         Next
  9.     Next
  10. End Sub
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement