Permalink
Browse files

Child math.

  • Loading branch information...
1 parent 2f11ca2 commit f97923c773301be27a61f72e0df6c48df3e9a7e7 @ktlacaelel committed Mar 29, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 child_math
View
@@ -0,0 +1,20 @@
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'rot'
+
+mappings = {
+ '0' => '1',
+ '1' => '0',
+ '2' => '0',
+ '3' => '0',
+ '4' => '1',
+ '5' => '0',
+ '6' => '1',
+ '7' => '0',
+ '8' => '2',
+ '9' => '1'
+}
+
+rot = Rot.new mappings, '?', /./, /./
+puts rot.decrypt(STDIN.read).scan(/./).inject(0) { |sum, char| sum += char.to_i; sum }

0 comments on commit f97923c

Please sign in to comment.