Re: Caesar Cipher Cracking

2016-08-15 Thread Antonio Corbi via Digitalmars-d-learn
On Sunday, 14 August 2016 at 18:36:02 UTC, Stefan wrote: same code, just a little shorter. usage of ".array" more UFCS replaced cast with ".to" Wow Stefan! Thanks for your time, I'll have a look at it! Antonio

Re: Caesar Cipher Cracking

2016-08-14 Thread Stefan via Digitalmars-d-learn
same code, just a little shorter. usage of ".array" more UFCS replaced cast with ".to" ---8><--- import std.stdio, std.conv; import std.algorithm, std.algorithm.searching, std.range; import std.ascii, std.string : countchars; int let2int(char c)

Caesar Cipher Cracking

2016-08-14 Thread Antonio Corbi via Digitalmars-d-learn
Hi folks, I was just following Graham Hutton's excellent book "Programming in Haskell" (http://www.cs.nott.ac.uk/~pszgmh/book.html) and in chapter 5 He implements a Caesar-Cipher cracking algorithm in a few lines of Haskell code (http://www.cs.nott.ac.uk/~pszgmh/cipher.lhs).