September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -1,12 +1,12 @@
func s2v(s) { s.uc.scan(/[A-Z]/)»ord»() »-» 65 };
func v2s(v) { (v »%» 26 »+» 65)»chr»().join };
func blacken (red, key) { v2s(s2v(red) »+« s2v(key)) };
func redden (blk, key) { v2s(s2v(blk) »-« s2v(key)) };
var red = "Beware the Jabberwock, my son! The jaws that bite, the claws that catch!";
var key = "Vigenere Cipher!!!";
say red;
say (var black = blacken(red, key));
say redden(black, key);
func s2v(s) { s.uc.scan(/[A-Z]/).map{.ord} »-» 65 }
func v2s(v) { v »%» 26 »+» 65 -> map{.chr}.join }
 
func blacken (red, key) { v2s(s2v(red) »+« s2v(key)) }
func redden (blk, key) { v2s(s2v(blk) »-« s2v(key)) }
 
var red = "Beware the Jabberwock, my son! The jaws that bite, the claws that catch!"
var key = "Vigenere Cipher!!!"
 
say red
say (var black = blacken(red, key))
say redden(black, key)