aboutsummaryrefslogtreecommitdiff
path: root/challenge-140/abigail/ruby/ch-1.rb
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-140/abigail/ruby/ch-1.rb')
-rw-r--r--challenge-140/abigail/ruby/ch-1.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-140/abigail/ruby/ch-1.rb b/challenge-140/abigail/ruby/ch-1.rb
new file mode 100644
index 0000000000..bc95be2323
--- /dev/null
+++ b/challenge-140/abigail/ruby/ch-1.rb
@@ -0,0 +1,15 @@
+#!/usr/bin/ruby
+
+#
+# See ../README.md
+#
+
+#
+# Run as: ruby ch-1.rb < input-file
+#
+
+ARGF . each_line do
+ | line |
+ a, b = line . strip() . split (" ")
+ puts (a . to_i(2) + b . to_i(2)) . to_s(2)
+end