in reply to PerlSol (solitaire in Perl)

Greg Bacon has written a solitaire game in Perl/Tk. I don't propose that you copy him, but his solution may be of some help to you. Regards,
Helgi Briem