Merge: doc: fixed some typos and other misc. corrections
[nit.git] / examples / rosettacode / caesar_cipher.nit
1 #!/usr/bin/env nit
2 #
3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
5
6 # Task: Ceasar cipher
7 # SEE: <http://rosettacode.org/wiki/Caesar_cipher>
8 module caesar_cipher
9
10 import crypto
11
12 var key = 31
13 var msg = "Batman's hood is called a \"cowl\" (old meaning)."
14 var cipher = msg.rot(key)
15
16 print "Caesar cypher key: {key}"
17 print "plain text: {msg}"
18 print "cyphered: {cipher}"
19 print "uncyphered: {cipher.rot(-key)}"