hennesse has asked for the wisdom of the Perl Monks concerning the following question:
I'm working up to writing a Perl Freecell Solver - for no particular reason since it's been done a hundred times before, and I'm sure better than I could ever do. I'm just trying to keep my 65-year-old brain active. I'm about 3/4 of the way through writing a command-line player. Complicated! Jeez, what was I thinking?
My current problem is writing a Freecell Dealer. There's some pretty good code click here, but it produces some weird 4-character Unicode results.
The first character is always a Greek Gamma, the second is always a o-umlaut or o-diaeresis (or maybe it's a Greek Omicron?). The third character encodes the card's suit: u-acute = hearts, a-underscore(?) = diamonds, capital Enya = clubs, a-acute = spades. The fourth character is the correct rank: A=ace, T=10, J=Jack, Q=Queen, K=King. So it's working correctly - but I don't like the Unicode results.
How can I modify it so that the output is more "normal" - 9C = Nine of Clubs, JD = Jack of Diamonds, etc.
No sense reinventing the wheel. Just want to make the wheel round.
P.S. The code author chose game 11982 - the Impossible game - to illustrate his slightly obfuscated code. Run it with the parameter "1" on the command line, and you should get what's at the top of the linked page.
Thanks
Dave Hennessey
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Freecell Dealer
by Athanasius (Archbishop) on Jul 25, 2018 at 05:59 UTC | |
by hennesse (Beadle) on Jul 25, 2018 at 13:43 UTC | |
by Aldebaran (Curate) on Jul 25, 2018 at 18:13 UTC | |
|
Re: Freecell Dealer
by Anonymous Monk on Jul 25, 2018 at 07:18 UTC | |
|
Re: Freecell Dealer
by Anonymous Monk on Jul 25, 2018 at 09:20 UTC |