examples/blocks/blocks/piece.go
func (p *Piece) isBlocked(i, j int, angle Angle) bool {
	size := len(p.blocks)
	i2, j2 := i, j
	switch angle {
	case Angle0:
	case Angle90:
		i2 = j
		j2 = size - 1 - i
	case Angle180:
		i2 = size - 1 - i
		j2 = size - 1 - j
	case Angle270:
		i2 = size - 1 - j
		j2 = i
	}
	return p.blocks[i2][j2]
}
func (p *Piece) isBlocked(i, j int, angle Angle) bool {
	size := len(p.blocks)
	i2, j2 := i, j
	switch angle {
	case Angle0:
	case Angle90:
		i2 = j
		j2 = size - 1 - i
	case Angle180:
		i2 = size - 1 - i
		j2 = size - 1 - j
	case Angle270:
		i2 = size - 1 - j
		j2 = i
	}
	return p.blocks[i2][j2]
}
func ( p * Piece ) isBlocked ( i , j int , angle Angle ) bool { size := len ( p . blocks ) i2 , j2 := i , j switch angle { case Angle0 : case Angle90 : i2 = j j2 = size - 1 - i case Angle180 : i2 = size - 1 - i j2 = size - 1 - j case Angle270 : i2 = size - 1 - j j2 = i } return p . blocks [ i2 ] [ j2 ] }
// isBlocked returns a boolean value indicating whether
// there is a block at the position (x, y) of the piece with the given angle.
isBlocked returns a boolean value indicating whether there is a block at the position ( x y ) of the piece with the given angle .