Monte Carlo program is described that calculates Dancoff factors in arbitrary arrangements of cylindrical or spherical fuel elements. The fuel elements can have different diameters and material compositions, and they are allowed to be black or partially transparent. Calculation of the Dancoff factor is based on its collision probability definition. The Monte Carlo approach is recommended because it is equally applicable in simple and in complicated geometries. It is shown that some of the commonly used algorithms are inaccurate even in infinite regular lattices. An example of application includes the Canada deuterium uranium (CANDU) 37-pin fuel bundle, which requires different Dancoff factors for the symmetrically different fuel pin positions.