$ ./dl.rb ./fib.rb
e b( )
ret a f <=
fib(a - 2) + fib(a - 1)
e d
p s ( )
$ D=50 ./dl.rb ./fib.rb
f fi (a)
r a f <=
b( 2 f b a 1
n
puts b )
$ D=100 ./dl.rb ./fib.rb
$ ./dl.rb ./fib.rb | ruby
55
$ ./dl.rb ./fib.rb | ./dl.rb | ruby
55
Last active
May 30, 2016 00:32
-
-
Save uu59/3d68ea2d1e2b59434cfb04c2961c49b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
percent = (ENV["D"] || "50").to_i | |
content = ARGF.read | |
if STDOUT.tty? | |
print content.chars.map{|c| next c unless c.match(/[\x20-\x7f]/); rand(1..100) <= percent ? " " : c}.join | |
else | |
print content | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fib(a) | |
return a if a <= 1 | |
fib(a - 2) + fib(a - 1) | |
end | |
puts fib(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment