mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
16 lines
243 B
Diff
16 lines
243 B
Diff
--- sample.rb
|
|
+++ sample.rb
|
|
@@ -2,7 +2,13 @@
|
|
a + b
|
|
end
|
|
|
|
+def sub(a, b)
|
|
+ a - b
|
|
+end
|
|
+
|
|
if __FILE__ == $0
|
|
result = add(3, 5)
|
|
puts "Three plus five is #{ result }"
|
|
+ result = sub(5, 3)
|
|
+ puts "five minus three is #{ result }"
|
|
end
|