Skip to content

A Coordinate on its own is not sufficient to describe a move. #2

@ikyman

Description

@ikyman

I'm looking at what I currently have.
The board returns a list of possible moves for a colour. (Actually, It throws a "Not Implemented" Error, but humor me for a bit.)

The No-Linear Algebra Chess AI choses the best coordinate to move a piece to. Coordinate (C,4) is a fantastic coordinate to move to: Moving a piece there kills the opposing queen, it's near the center of the board, and is also rather close to king, too (see issue #1 )

Great: Target sighted! Problem: "Go to C4" is a meaningless command. Go C4 yourself. All the AI has is C4. In order to move to C4, it has to have a piece to move to C4. This can be done by looping through all the pieces on the board again to find one that can move to C4. A sloppy extra for loop.

Or, alternatively, the Move Generator could return items that describe not only where to move, but either the ♟️piece♟️ to move or the current location of said ♟️piece♟️ (Figuring out the ♟️piece♟️ itself thus being only a simple hash table lookup).

A Potential Sticky Wicket: The Move Generators are attached to units. I.E. "A Bishop can move 1 diagonally, recursively"
If Move generators are to generate any potential "Move" object, it either has to have a parameter for taking in it's owning piece, or continue to only return coordinates, with a name-change required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions