You can do this by pushing your guesses onto the stack. Each time you end up wanting to get zero, instead lay your last answer off the board and keep reading it.
So, if you guess 3 in (2,3), and then you look (3,3) and get to zero, go back to (2,3) and try 2, then 1, then press to your (2,3) conjecture etc.
source
share