code: func Encode(x, y int32) int64 {
  	var rx, ry int32
  	var d int64
  	for s := int32(n / 2); s > 0; s /= 2 {
  		rx = boolToInt(x&s > 0)
  		ry = boolToInt(y&s > 0)
  		d += int64(int64(s) * int64(s) * int64(((3 * rx) ^ ry)))
  		rotate(s, rx, ry, &x, &y)
  	}
  
  	return d
  }
docs: // Encode will encode the provided x and y coordinates into a Hilbert
  // distance.