Algorithm to find tiling harmonic functions