I am trying to write the game code for 2 new pieces I want for my newest chess variants.
The first, a bent rider, called the lion should move like a bishop for 2 squares and then towards outside like a rook. It may also move like a dabbabah. I have written the code bellow that has the problem that allows the final rook moves without checking for the first bishop part of the move. Please take a look:
The second, it is also a bent rider, called the tiger should move like a rook for 3 squares and then towards outside like a bishop. It may also move like an alfil. In the same way as before the bishop moves are allowed by my code whitout checking the rook ride. Code so far:
def Tiger
fn (checkride #0 #1 1 1 and empty #0)
where #0 0 * 3 sign - rank #1 rank #0 #1
or fn (checkride #0 #1 1 1 and empty #0)
where #0 * 3 sign - file #1 file #0 0 #1
and not fn Knight #0 #1
or and checkride #0 #1 1 0 <= distance #0 #1 3
or fn Elephant #0 #1;
I could not find code that block the ride in the first part.
@Fergus
I am trying to write the game code for 2 new pieces I want for my newest chess variants. The first, a bent rider, called the lion should move like a bishop for 2 squares and then towards outside like a rook. It may also move like a dabbabah. I have written the code bellow that has the problem that allows the final rook moves without checking for the first bishop part of the move. Please take a look:
def Lyon
fn (checkride #0 #1 1 0 and empty #0)
where #0 2 sign - file #1 file #0 2 sign - rank #1 rank #0 #1
and not fn Knight #0 #1
or and checkride #0 #1 1 1 <= distance #0 #1 2
or fn Dabbabah #0 #1;
The second, it is also a bent rider, called the tiger should move like a rook for 3 squares and then towards outside like a bishop. It may also move like an alfil. In the same way as before the bishop moves are allowed by my code whitout checking the rook ride. Code so far:
def Tiger
fn (checkride #0 #1 1 1 and empty #0)
where #0 0 * 3 sign - rank #1 rank #0 #1
or fn (checkride #0 #1 1 1 and empty #0)
where #0 * 3 sign - file #1 file #0 0 #1
and not fn Knight #0 #1
or and checkride #0 #1 1 0 <= distance #0 #1 3
or fn Elephant #0 #1;
I could not find code that block the ride in the first part.