Peg game
So... I was curious one evening comming back from Cracker Barrel...
How many ways were there to win at that infamous
peg game?

So, being the computer guy I am, I wrote PegGame.java
to figure it out. (n pegs left means there's no possible moves)
Possible boards: 13935
Total ways to play: 7335390
1 peg left (win): 438984
2 pegs left: 1776648
3 pegs left: 3302124
4 pegs left: 1605348
5 pegs left: 197670
6 pegs left: 11160
7 pegs left: 3438
8 pegs left: 12
9 pegs left: 0
10 pegs left: 6
11 pegs left: 0
13 pegs left: 0
12 pegs left: 0
14 pegs left: 0
And here is the entire game tree in a very simple graphical format.
(It might take a couple seconds to generate.) Navigate by
clicking on the boards.
Source: PegGraphics.java, PegGameApplet.java.