For the problem with the initial position, I think its FEN is always fixed. So you can compare the FEN to the one of the initial position and decide about single or double move based on that.Evert wrote:You know, I think I could make Sjaak play this with relatively little extra work. Flipping the side to move is handled by a field within the move struct, so it would already be easy to make it not flip the side to move. The extra difficulty is doing it every other move instead, but I think I've thought of a way to do it that isn't too hacky.
EDIT: wait, so what is the rule on how turns progress? Does white get two moves on his first turn, or not? I always thought he didn't, but it does raise a problem: when I am fed a position, can I assume that the side to move has the right to make two moves? If I can, do I have to check if the position I receive is the starting position? Or do we need a way to indicate this in the FEN itself? Say, "W" means white can play 2 moves, "w" means white has already played the first move and only gets one (that way the standard chess startup FEN is the same for Marseillaise: white gets a single move at the beginning of the game). Or perhaps a more general "w2" meaning "white to move, 2 legs remaining" with "w1" simply being written as "w".
Note also that the side to move must be switched after a check in the first leg as well.
Furthermore, I don't think the solution is as easy as you say. I think a correct search in a "Marseillais Chess" engine needs to find the best "move pair". That can mean to generate as much as, say, 40x40 "move pairs" in a position with 40 moves that are legal in orthodox chess, which is of course a huge addition of complexity. Negamax-based alpha-beta search won't work otherwise since the algorithm negates from one ply to the next. So one ply would be a "move pair", or only a single move in the exceptional cases like the initial position or a move giving check. Therefore I think we really need a different move generator and a different move data structure. You can't just start to search one of the 40 "first moves", how would you continue in the next ply where the turn is at the same player? Alpha-beta would fail here. The decision you make at each node is a decision between all available move pairs, so these need to be generated.
Apart from this complexity issue, the big challenge might be the evaluation. I think that a lot of our orthodox chess evaluation principles are simply wrong in Marseillais chess. For instance a rook on an open file can effectively be a loss, even if defended, since the opponent can reach many squares in two moves. The game is very tactical, so I would propose, for a start, to skip *all* evaluation features except material (where good material scores still have to be found step by step), and fully rely on the search until you know more about the inner workings of the game.
Sven