Caesar Cipher

2018-02-11 Thread Mario via Digitalmars-d-learn
Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only use the heap memory. So I'm new to the wonderful world of low-level and the stack-heap. I started a week ago learning D (which by the moment is being easy for me) but I'm

Re: Caesar Cipher

2018-02-11 Thread Cym13 via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only use the heap memory. So I'm new to the wonderful world of low-level and the stack-heap. I started a week ago lea

Re: Caesar Cipher

2018-02-11 Thread Seb via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only use the heap memory. [...] If you want to cheap, have a look at https://github.com/dlang-tour/core/issues/227

Re: Caesar Cipher

2018-02-11 Thread Mario via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:31:35 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only use the heap memory. [...] If you want to cheap, have

Re: Caesar Cipher

2018-02-11 Thread Mario via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:28:08 UTC, Cym13 wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only use the heap memory. So I'm new to the wonderful world

Re: Caesar Cipher

2018-02-11 Thread Cym13 via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:50:25 UTC, Mario wrote: On Sunday, 11 February 2018 at 18:31:35 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only

Re: Caesar Cipher

2018-02-11 Thread Seb via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:50:25 UTC, Mario wrote: On Sunday, 11 February 2018 at 18:31:35 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you all probably know, that's high-level and most of them only

Re: Caesar Cipher

2018-02-11 Thread DanielG via Digitalmars-d-learn
Here's a newbie-friendly solution: https://run.dlang.io/is/4hi7wH

Re: Caesar Cipher

2018-02-11 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: char[] encrypt(char[] input, char shift) { auto result = input.dup; result[] += shift; return result; } What's wrong? I mean, I know that z is being converted into a symbol, but how should I fix this? If you take Z (25) a

Re: Caesar Cipher

2018-02-11 Thread Mario via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:55:14 UTC, Cym13 wrote: On Sunday, 11 February 2018 at 18:50:25 UTC, Mario wrote: On Sunday, 11 February 2018 at 18:31:35 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you

Re: Caesar Cipher

2018-02-11 Thread Mario via Digitalmars-d-learn
On Sunday, 11 February 2018 at 18:55:44 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:50:25 UTC, Mario wrote: On Sunday, 11 February 2018 at 18:31:35 UTC, Seb wrote: On Sunday, 11 February 2018 at 18:01:20 UTC, Mario wrote: Hello there! I know deep Java, JavaScript, PHP, etc. but as you al

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

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) {

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