# shifthorizontal

Let i be an integer between -7 and 7. The basic horizontal shift transform Ui shifts a square on the chessboard i squares right. (Directions are reversed if the argument is negative). If the square goes off the board, we say that Ui is empty or undefined.

A horizontal basic shift transform acts on square designators. For example,

`U3 a1 ≡ d1`
because if `a1` is shifted 3 squares right it becomes `d1`.

As a special rule, suppose a square designator contains an entire rank, like `[a-h2,c4]` contains the entire second rank in addition to the `c4` square. Then any horizontal shifts of squares on that rank are ignored. Thus,

```  U3 [a-h2,c4]
≡
[a-h2,f4]```

A horizontal shift transform can be extended to a horizontal shift transform of an arbitrary filter: each square designator appearing in the filter is shifted by the specified amount.

Sometimes a horizontal shift transform will result in an empty square designator. For example,

`  U7 [d2,c4]`

will be empty. Any empty square designator makes the whole filter containing that empty square designator empty as well.

`shifthorizontal` is a transform filter that represents each of the 15 basic horizontal shift transforms including the identity.

The effect of `shifthorizontal F` is first to create the 15 distinct filters that result from applying each of the basic horizontal shift transforms to F. Empty filters and repetitions are deleted, and the resulting set is called the orbit of `shifthorizontal F`.

For example, the orbit of `shifthorizontal ♔a1` is 8 distinct filters, `♔a1`, `♔b1`, and so on.

On the other hand, the orbit of `shifthorizontal {♔a1 ♚g1}` only contains 2 filters, namely `{♔a1 ♚g1}`, `{♔b1 ♚h1}`. Any other horizontal shift results in one of the kings going off the board, and which makes the corresponding filter empty.

If F is a numeric filter then so is `shifthorizontal F` in which case its value is the maximum of the values of the matching transformed versions of F.

`shifthorizontal count F`

is a numeric filter whose value is the number of distinct matching transformed versions of F. For example, if the current position is the initial position, then

`shifthorizontal count find ♕a1`

is the number of different squares on the first rank on which there is a white queen in the game.