[Haskell-cafe] Re: Pretty-printing peg solitaire boards

Maurí­cio briqueabraque at yahoo.com
Sun Nov 25 14:15:07 EST 2007


 >> Hi,
 >>
 >> I'm trying to pretty-print (with Text
 >> . PrettyPrint . HughesPJ) a set of peg
 >> solitaire boards. No matter what I try, I
 >> always get this: (...)
 >>
 >
 > Just curious. Are you working on the algorithm
 > also? :)

Sure. It's done already. I did generate a file
with all possible (i.e., solvable) positions, but
I have to rebuild it due to a bug. However, I'm
doing that because there's a single position which
my brother could not solve, and he believes it to
be impossible, so we want to check:

   #0#
###0###
#######
#######
   ###
   ###

If you are not interested in that very
particular situation, there are many solutions in
the net, including references for a math analysis
(textbook only, I could not find it on P2P).  Just
check for peg solitaire in wikipedia. If you ever
prefer my messy, Portuguese documented code to
that, just ask me and I'll send it with a few
explanations :)

Best,
Maurício



More information about the Haskell-Cafe mailing list