title: How do I make chess pieces move (array)?
body: <p>I'm working on a chess game as my school project. I'm a beginner, so I thought I would challenge myself, but I underestimated the difficulty. So far I have made the board, and now I'm trying to make the knight. This is what I made so far (springer = knight (ignore the danish notes)):</p>
  
  <pre><code>Public Class Form1
  
  Dim x_board(7) As Integer
  Dim y_board(7) As Integer
  
  
  'Prøver at lave boardarrayet
  Private board(7, 7) As String
  
  'Den her vil jeg bruge til at lave brikkerne til en form for kategori
  Dim brik(17) As String
  
  
  
  'Springer koordinater og position
  Dim x_springer As Integer = 90
  Dim y_springer As Integer = 0
  
  
  
  Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  
  
  
      Dim name As Integer
  
      'Lave boardet med to forloops
  
      For j = 0 To 7
          For i = 0 To 7
  
  
  
              'Definerer boardet
              Dim btn As New PictureBox
  
  
  
              name += 1 'Tæller en op. Den her bruger jeg til at navngive knapperne
  
              btn.Height = 90
              btn.Width = 90
              btn.Name = name
              btn.Visible = True
  
  
  
              btn.Location = New System.Drawing.Point(i * 90, j * 90)
  
              'Definere boardet
              If i = 0 And j = 0 Then
                  board(0, 0) = "springer"
  
              End If
  
              'Definere boardet 
              If i = 1 And j = 0 Then
                  board(1, 0) = 1
  
              End If
  
              'Definere boardet 
              If i = 2 And j = 0 Then
                  board(2, 0) = 2
  
              End If
  
              'Definere boardet 
              If i = 3 And j = 0 Then
                  board(3, 0) = 3
  
              End If
  
              'Definere boardet 
              If i = 4 And j = 0 Then
                  board(4, 0) = 4
  
              End If
  
  
  
  
  
  
              'Jeg dividere det vandrette+lodrette nummer med 2. På den her måde ved jeg, at hvis jeg får 1 tilbage, så er det et ullige nummer. (Til rapporten: Først tog jeg tallets, og det lavede rækkerne hvid-sort-hvid-sort osv.)
              If (i + j) Mod 2 = 1 Then
  
                  btn.BackColor = Color.White
              Else
                  btn.BackColor = Color.Black
              End If
  
  
  
              ' Tilføj knapperne så de kan ses
              Me.Controls.Add(btn)
  
  
  
  
              ' Me.Controls.Add(board(7, 7))
  
              'Definerer springerbrikken 
              Dim springer As New PictureBox
  
  
              springer.Height = 90
              springer.Width = 90
              springer.Visible = True
              springer.BackColor = Color.Yellow
              springer.Enabled = True
  
              'Tilføj springeren
              Me.Controls.Add(springer)
  
  
  
  
  
              'Giver springer en position
              springer.Location = New  System.Drawing.Point(x_springer,y_springer)
  
  
  
              'Jeg laver en addhandler for click-eventet som kommer senere
              AddHandler springer.Click, AddressOf springer_click
  
          Next
      Next
  
  
  End Sub
  
   'Springerens click-event
      Private Sub springer_click(ByVal sender As System.Object, ByVal e As System.EventArgs)
  
  
  End Class
  </code></pre>
  
  <p>My teacher told me to make the board(7,7) a string. But my knight is a picturebox, and cannot be stored in a string. How can I do it?</p>