I brute-forced my way through a solution to the Solitaire cipher quiz
challenge last night:
http://mult.ifario.us/articles/2006/10/25/solitaire-cipher-in-haskell
Full source is linked from the entry, or look here:
http://mult.ifario.us/files/solitaire.hs
I think (i.e., know) that my
Paul, other Haskell Cafe guests,
About
http://mult.ifario.us/articles/2006/10/25/solitaire-cipher-in-haskell:
Remove the ']' from the line:
show_face f = (take 1) (drop (fromEnum f) A23456789TJQK$)]
An easier way to write this:
show_face f = A23456789TJQK$ !! fromEnum f
Other
I was to fast:
On Thu, 26 Oct 2006 22:29:56 +0200, I wrote:
-
show_suit s = head (show s)
or:
show_suit (s:_) = show s
The last one is nonsense
head (reverse l)
-
init l
Should be:
last l
--
Met vriendelijke groet,
Henk-Jan van Tuyl
--
http://Van.Tuyl.eu/
--
Using
I'm a beginner having a go at implementing the Solitaire cipher
(http://www.rubyquiz.com/quiz1.html as mentioned in another post) and I'd be
really grateful if you could help me improve the code to be neater use
more functions from the Prelude etc, or errors (eg at the moment I can't
work out
There are several problems with the behavior:
*Main encrypt
X
*Main decrypt $ encrypt
TANZP X
So fixing this case would be the first thing to do, followed by:
*Main encrypt hello
LBVJW X
*Main decrypt $ encrypt hello
HELLO YFRTQ X
Chris Kuklewicz wrote:
There are several problems with the behavior:
*Main encrypt
X
*Main decrypt $ encrypt
TANZP X
So fixing this case would be the first thing to do, followed by:
*Main encrypt hello
LBVJW X
*Main decrypt $ encrypt hello
HELLO YFRTQ X
Jón Fairbairn-2 wrote:
jim burton [EMAIL PROTECTED] writes:
In addition to Chris's comments, here are some more:
[snip]
Thanks for your comments Jon. I thought about making Cards an instance of
Enum but didn't realise how helpful it would be in various places.
I will use the shorter