[Haskell-beginners] Help!!

Lyndon Maydwell maydwell at gmail.com
Thu Mar 10 12:46:15 CET 2011


Interesting! What is the book called? I ran through many examples like
this in ruby once upon a time, but I just tried to crack various
cyphers from their wikipedia descriptions.

On Thu, Mar 10, 2011 at 12:23 AM, aditya siram <aditya.siram at gmail.com> wrote:
> What do you have so far? Or how are you thinking of attacking the problem?
> -deech
>
> On Wed, Mar 9, 2011 at 10:00 AM, Jessica Baker
> <jessicamaybaker at gmail.com> wrote:
>> 3.1 Step 1
>> Create a Haskell script le called crypt.hs and enter the code for he Caesar
>> cipher from
>> Section 5.5 of the text book (Hutton). Make sure you understand how all the
>> functions
>> work.
>>
>> 3.2 Step 2
>> Transform your script le (from Step 1) into a Haskell program that reads
>> text from the
>> standard input, encrypts the text using the Caesar cipher, and writes the
>> result to the
>> standard output. Your program should take a command-line argument that speci
>> es the
>> shift factor to be used. So, for example:
>> cat poem.txt | ./crypt 3
>> Eqvdqjxlqlqj wkh vnb
>> Hrz khdylob lw glhv
>> Iqwr wkh Whvw dzdb
>> Pdvw wrxfk dqg vljkw dqg vrxqg
>> Nr orqjhu wr eh irxqg
>> Hrz krshohvv xqghujurxqg
>> Fdoov wkh uhpruvhixo gdb
>>
>> If the command-line argument is 0 (zero) then the program should crack the
>> code and
>> output the deciphered text. So, the following command pipeline should echo
>> the original
>> message:
>> cat poem.txt | ./crypt 3 | ./crypt 0
>> Ensanguining the sky
>> How heavily it dies
>> Into the West away
>> Past touch and sight and sound
>> No longer to be found
>> How hopeless underground
>> Falls the remorseful day
>>
>> _______________________________________________
>> Beginners mailing list
>> Beginners at haskell.org
>> http://www.haskell.org/mailman/listinfo/beginners
>>
>>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>



More information about the Beginners mailing list