Skip to content

(feature request) Square.index or Square.file / Square.rank #6

@jamespayor

Description

@jamespayor

It would be nice to be able to manipulate Squares by their rank and file as ints.

My suggestion here would be to add Square.file : int and Square.rank : int fields accessible from python, that give numbers in the [0, 7] range for manipulation.

I also think it would be nice to add Square.from_coordinates or something to make it easier to pick out a square from file/rank coordinates. This could also be rigged up as a __new__/__call__ for Square, so calling Square(file=3, rank=2) would return one of the pre-made square objects.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions