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
To capture the opponents royal (king/queen).
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.
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.
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 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.
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.
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
King (k)/Queen (q)
# # # #
$ P$ X
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
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 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)
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):
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
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:
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
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