▲ | TZubiri 3 hours ago | |
>If you have an algorithm for generating the list of legal moves in a position that always generates them in the same order, you can just use the index at which the move is in the list. Right, that's exactly what I'm saying, the algorithm that generates the list of legal moves would be an encoder (maps a move into an index), and the reverse would be a decoder (maps the index into a move). You don't necessarily need to generate the list of legal moves, though. Consider a 16 bit encoding where the first 4 bits represent the piece moved, and the next 5 bits represent the direction, and the next 4 bits represent the distance and so on. |