# Fill Algorithms

Home * Board Representation * Bitboards * Fill Algorithms

M. C. Escher, Plane Filling II, 1957 [1]

Fill algorithms perform the union of a set with their consecutive direction-wise shifts. The shifted intermediate sets are likely intersected with some mask to avoid board wraps of certain directions, and/or also to consider the occupancy or any reasonable taboo set (i.e. pawn attacks) as flood stopping obstruction.

For the non sliding pieces, pawn, knight and king, one fill cycle covers all potential moves in one certain direction, or even all moves in different directions. However, for the sliding pieces, bishop, rook and queen, one fill cycle covers a direction-wise move step for a union set of attacked squares reachable in one move. Often, the up to seven direction wise fill cycles may be performed in three parallel prefix steps.

Applications of fill algorithms are related to all kinds of pawn properties, progressive mobility and path finding algorithms, f.i. to find so called Trajectories [2] [3] .

# Pawn

Pawn fills are performed by north- or south steps, for span determination on the otherwise empty board. If it is about to consider obstructions, the north- or south Dumb7- or Kogge-Stone occluded fill might be applied.

# Sliding Pieces

Albeit intended as direction-wise attack generators, a surrounding loop may determine target in at least N moves sets of sliding pieces as well. One may pass not only pieces as argument, but their attacks repetitively, likely with alternating disjoint directions, i.e. file- versus ranks-attacks for rooks and diagonal versus anti-diagonal attacks for bishops.

AVX2 Dumb7Fill