Skip to content

Piece sight outside legal moves? #70

@axolotl-logic

Description

@axolotl-logic

Hello,

I am trying to convert a Position to a network graph of attackers/defenders so that I may measure centrality with gonum/graph.

I can accomplish this if I can, for each occupied square, retrieve what a piece "sees". In the case of the pawn this would cover left/right diagonal from the pawn's square (not picky about en passant). This would allow me to easily build a network graph.

Is this currently a feature? Looking at legal moves is insufficient because I want defender pieces as well and not consider status of check.

Currently if forced to implement based on what I know, I'd retrieve a pos.Board().SquareMap(), switch on piece, and in each case of the switch calculate the sight manually after converting the square to an integer or some such.

If this requires a new feature being added, I need it bad enough that if you can point me in the right direction I'd maybe contribute it myself as I need to implement it anyways!

Take care,
Autumn.

Labels: feature request, question

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions