Nice simulation work! Initially I thought this was a one dimensional random walk problem where the answer is a function of n (as other comments have pointed out). In that case, there (n choose k) paths that take k steps in a single direction of n total steps, and each occurs with p(0.5^n). In this problem we are given n, but not k. Given a starting point, we can easily calculate the probability of crossing 0.
So my question is, how are you dealing with the initial condition?