mirror of
https://github.com/maaslalani/gambit.git
synced 2024-12-26 20:54:07 +02:00
doc: add note about flipped flipped
This commit is contained in:
parent
630fd8dc1b
commit
197fac15de
@ -29,6 +29,15 @@ func Cell(x, y int, flipped bool) string {
|
||||
col := (x - marginLeft) / cellWidth
|
||||
row := (y - marginTop) / cellHeight
|
||||
if !flipped {
|
||||
// Careful: `flipped` is a bit strange here.
|
||||
//
|
||||
// `flipped` represents whether the _chess board_ is flipped.
|
||||
// Normally, the order of the rows will be from 8 (top) to 1 (bottom).
|
||||
// If the board is flipped (i.e. black's turn) then the order of the rows
|
||||
// would be how one would normally print of the rows: 1 (top) to 8 (bottom).
|
||||
//
|
||||
// In other words, flipped is flipped. This trade-off is for consistency
|
||||
// with the other parts of the code base, namely the model.flipped property
|
||||
row = board.LastRow - row
|
||||
}
|
||||
return position.ToSquare(row, col)
|
||||
|
Loading…
Reference in New Issue
Block a user