Skip to content

Instantly share code, notes, and snippets.

@robmiller
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robmiller/11408754 to your computer and use it in GitHub Desktop.
Save robmiller/11408754 to your computer and use it in GitHub Desktop.
Yammer Ruby Hacknight Golf
class<<Golf=Class.new
n=0;'a.reduce :*
(?a..?z).to_a
(1..a).reduce :*
a.map{|s|z=s[0];z==?m?"hat(#{s})":z==?d?s[0..-2]+"(bone))":"dead"+s[3..-1]}
(1..4).flat_map{|n|a.each_cons(n).to_a}
(1..a).map{|a|a%15<1?"fizzbuzz":a%3<1?"fizz":a%5<1?"buzz":a}
p=0;a.slice_before{|n|t=p+1<n;p=n;t}.map{|n|z="#{n[0]}";n.size>1?z+?-+"#{n[-1]}":z}
i,j=0,1;(1..a).map{i=j+j=i}
a.split.map{|s|s.size>10?s[0,4]+?.*3+s[-3,3]:s}.join" "'
.split(?\n).map{|m|n+=1;eval "def hole#{n} a=0
#{m}
end"}
end
@robmiller
Copy link
Author

570 now!

@robmiller
Copy link
Author

562…

@robmiller
Copy link
Author

538

@robmiller
Copy link
Author

477

@robmiller
Copy link
Author

476

@robmiller
Copy link
Author

474

@robmiller
Copy link
Author

464

@robmiller
Copy link
Author

462

@supermarin
Copy link

@robmiller you can save 5 characters on line 10 by removing (" ") since that's the default :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment