Play a 1D chess variant
in this king-of-the-hill challenge, you must create a bot that plays a 1d chess variant I created, featuring all leaper pieces, and a 15 long board.
Esolangs are encouraged to participate
Game Rules
Goal
To capture the opponents royal (king/queen).
Board
The board is 15 squares long
Player _______________________________ Player
one |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| two
player1 side player2 side
Each player has their side of the board. (note that while playing, you will always be on the left side of the board). You have six squares that belong to you, the opponent has six of their squares, and three squares in the middle are unowned.
Setting up
At the start of the game, you will place your pieces into a configuration of your choice. The pieces will be set independently of each other; this game does not have perfect information. When setting up, you will pick where to place your four pieces, and whether they will be reversed (see next section). You may only place your pieces in your owned squares.
Pieces
There are 4 / 8 pieces; there are 4 distinct pieces, which you can have reversed, and unreversed. I have given them distinct names. Their movements are detailed here.
reversed
reversed means that all the moves of these pieces are reversed in their direction; 2 forward becomes 2 back, three back becomes three forward.
Capture means to move to a space occupied by an enemy piece, and remove that piece from the game.
Move means to move to a space occupied by no pieces.
Ascii "diagrams" have been provided. P denotes the piece being showed, $ denotes a space the piece can move to, X a place the piece can capture on, # a piece can move and capture on. Diagrams are the same for both pieces in a pair, because one simply executes the moves backwards.
You must have exactly 4 pieces on the board, and have exactly one from each of the pairs below.
Footman (f)/Coward (c)
The footman may move to an empty space one (1) forward, and capture two (2) forward.
The coward may move to an empty space one (1) backward, and capture two (2) backward.
P$X
Horse (h)/spider (s)
The horse may move to an empty space two (2) or three (3) forward, and move or capture one (1) backward.
The spider may move to an empty space two (2) or three (3) backward, and move or capture one (1) forward.
#P $$
Archer (a)/Trickster (t)
(I doubt anyone will use trickster unironically)
The archer may move two (2) squares backward, one (1) forward, and may capture four (4) steps forward
The trickster may move two (2) squares forward, one (1) backward, and may capture four (4) steps backward
I have included some black and white squares for clarity in distance
# # # #
$ P$ X
King (k)/Queen (q)
Both Royal pieces will end the game when captured.
The king may move or capture one (1) backward
The queen may move or capture one (1) forward
#P
Misc.
Check does not exist: Royal pieces may be left en prise, capture of them results in a win for the capturing side.
There is no (pawn) promotion of any kind
A piece may not attempt to move of the board; the board is a fixed size and does not wrap.
Programs
Programs will take input. When they take input of "0", or a specific input of your choosing, they will output a setup for the game.
when they take input "1", or a specific input of your choosing, they will then receive input of the board, and output a move. (the program will be run multiple times)
Moving
To move, you will output the square that the piece is currently on, and the space where you wish to move the piece to, or have the piece capture on. The format is as so (in regex):
[0-9a-e]\n?[0-9a-e]\n?
The board is zero indexed, a piece on the first square is on square 0.
There should be exactly 2 non-newline characters in the output
Input
when it is your turn to move, you will receive input. The input you receive will represent the pieces in the playing field. The input will fit the regex here:
[fFcChHsSaAtTkKqQ ]{15}
Caps represent enemy pieces, lowercase represent your pieces.
when you receive the board positions, you will always have the perspective of player one
WIP, will do more later
Sandbox
What should happen if bots enter an infinite loop? I could just make a draw on a time limit, but that seems not so great, since it is hard for bots to know when they are doing this.
Also just other feedback in general