Random walks with a general, nonlinear barrier have found recent applications
ranging from reionization topology to refinements in the excursion set theory
of halos. Here, we derive the first-crossing distribution of random walks with
a moving barrier of an arbitrary shape. Such a distribution is shown to satisfy
an integral equation that can be solved by a simple matrix inversion, without
the need for Monte Carlo simulations, making this useful for exploring a large
parameter space. We discuss examples in which common analytic approximations
fail, a failure which can be remedied using the method described here.Comment: 6 pages, 7 figures, submitted to Ap