Makefile: add pickrand
[cmccabe-bin] / silly-encoder.rb
1 #!/usr/bin/ruby
2
3 #
4 # Silly single letter-for-glyph substitution cipher.
5 # Tested with ruby 1.8
6 #
7 # Colin McCabe
8 #
9
10 ctable = {
11   97 => '☏',
12   98 => '✄',
13   99 => '❶',
14   100 => '⑧',
15   101 => '✡',
16   102 => '☾',
17   103 => '✠',
18   104 => '⚐',
19   105 => '⦿',
20   106 => '☯',
21   107 => '◈',
22   108 => '⬟',
23   109 => '✈',
24   110 => '♈',
25   111 => '⁂',
26   112 => '※',
27   113 => '¢',
28   114 => '®',
29   115 => '⍓',
30   116 => '¶',
31   117 => '»',
32   118 => 'Ñ',
33   119 => '§',
34   120 => '∑',
35   121 => '☺',
36   122 => '☹',
37   123 => '☠'
38 }
39
40 STDIN.read.each_byte do |c|
41   if ctable.has_key?(c)
42     printf ctable[c]
43   else
44     printf c.chr
45   end
46 end