title: Peg solitare recursion solution
body: <p>Everyone knows of the cracker barrel triangle peg solitaire game. You take one peg and jump it over another into an empty hole and the goal is to have only one peg left. </p>
  
  <p>In my code for the game board object I have a function <code>sCpeg(int a, int b)</code> which changes the peg you are currently using to jump. I connected this to a <code>moves</code> variable for the purpose of solving it. Every time you change the current peg and use it to jump that counts as a move. It's done as a very basic heuristic for what I hope to be a search algorithm: Explore all the possible jumps available with one peg. If a solution is not found backtrack, update the current peg and repeat the process.</p>
  
  <p>When I was writing this idea out it sounds like a perfect example to use recursion on except I don't know how to properly use recursion in this scenario. Between backtracking and updating the current peg I'm lost.</p>
  
  <p>Does all of this sound too complicated? Should I just remove the moves and <code>sCpeg()</code> options and have the search algorithm randomly jump until a solution is found? </p>
  
  <p>Is recursion a good method to solve this puzzle? My jump function currently works by only asking for the position you would want to jump to. I would have to change it to take the start and end position desired for each jump, which is easy enough to change, but I don't know if its better or worse for the algorithm. </p>
  
  <p>This is for a school project so I have to implement an uninformed search and a heuristic search algorithm. Changing my <code>jump()</code> function could potentially affect my heuristic. </p>
  
  <p>I'm coding in Java, but since this is a bit vague I'm only expecting pseudo code answers. Pseudo code alone is enough to put me on the right track. . </p>