precompute mask of king locations