func (b Board) sortedUsedTiles() []tile.Position {
	usedTiles := make([]tile.Position, 0, len(b.UsedTiles))
	for _, tp := range b.UsedTiles {
		usedTiles = append(usedTiles, tp)
	}
	sort.Slice(usedTiles, func(i, j int) bool {
		switch {
		case usedTiles[i].X != usedTiles[j].X:
			return usedTiles[i].X < usedTiles[j].X
		default:
			return usedTiles[i].Y < usedTiles[j].Y
		}
	})
	return usedTiles
}
// sortedUsedTiles returns a new array of the used tiles, sorted by x position, then y position.
sortedUsedTiles returns a new array of the used tiles, sorted by x position, then y position.
// sortedUsedTiles returns a new array of the used tiles sorted by x position then y position .
func (b Board) sortedUsedTiles() []tile.Position {
	usedTiles := make([]tile.Position, 0, len(b.UsedTiles))
	for _, tp := range b.UsedTiles {
		usedTiles = append(usedTiles, tp)
	}
	sort.Slice(usedTiles, func(i, j int) bool {
		switch {
		case usedTiles[i].X != usedTiles[j].X:
			return usedTiles[i].X < usedTiles[j].X
		default:
			return usedTiles[i].Y < usedTiles[j].Y
		}
	})
	return usedTiles
}
func ( b Board ) sortedUsedTiles ( ) [ ] tile . Position { usedTiles := make ( [ ] tile . Position , 0 , len ( b . UsedTiles ) ) for _ , tp := range b . UsedTiles { usedTiles = append ( usedTiles , tp ) } sort . Slice ( usedTiles , func ( i , j int ) bool { switch { case usedTiles [ i ] . X != usedTiles [ j ] . X : return usedTiles [ i ] . X < usedTiles [ j ] . X default : return usedTiles [ i ] . Y < usedTiles [ j ] . Y } } ) return usedTiles }
sortedUsedTiles returns a new array of the used tiles, sorted by x position, then y position.
sortedUsedTiles returns a new array of the used tiles sorted by x position then y position .