I assume that empty spots on the board are represented by zero in the matrix

Check to see if along each diagonal there is a piece and an open space

This will check for moves relative to the queens position X,Y in the matrix

In the +,+ direction

```
If [H](x+1,Y+1) and not([H](x+2,Y+2))
Then
If 1=[H](x+1,Y+1)
Then
(what to do if it can jump over a white pawn)
End
If 2=[H](x+1,Y+1)
Then
(what to do if it can jump over a black pawn)
End
If 3=[H](x+1,Y+1)
Then
(what to do if it can jump over a white queen)
End
If 4=[H](x+1,Y+1)
Then
(what to do if it can jump over a black queen)
End
End
```

In the +,- direction

```
If [H](x+1,Y-1) and not([H](x+2,Y-2))
Then
If 1=[H](x+1,Y-1)
Then
(what to do if it can jump over a white pawn)
End
If 2=[H](x+1,Y-1)
Then
(what to do if it can jump over a black pawn)
End
If 3=[H](x+1,Y-1)
Then
(what to do if it can jump over a white queen)
End
If 4=[H](x+1,Y-1)
Then
(what to do if it can jump over a black queen)
End
End
```

In the -,+ direction

```
If [H](x-1,Y+1) and not([H](x-2,Y+2))
Then
If 1=[H](x-1,Y+1)
Then
(what to do if it can jump over a white pawn)
End
If 2=[H](x-1,Y+1)
Then
(what to do if it can jump over a black pawn)
End
If 3=[H](x-1,Y+1)
Then
(what to do if it can jump over a white queen)
End
If 4=[H](x-1,Y+1)
Then
(what to do if it can jump over a black queen)
End
End
```

In the -,- direction

```
If [H](x-1,Y-1) and not([H](x-2,Y-2))
Then
If 1=[H](x-1,Y-1)
Then
(what to do if it can jump over a white pawn)
End
If 2=[H](x-1,Y-1)
Then
(what to do if it can jump over a black pawn)
End
If 3=[H](x-1,Y-1)
Then
(what to do if it can jump over a white queen)
End
If 4=[H](x-1,Y-1)
Then
(what to do if it can jump over a black queen)
End
End
```

You will have to make another conditional to make sure that you do not get a domain error, but hopefully this helps