Skip to content

Commit

Permalink
incorporated Shuo's suggestion for hole 7
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-glenjamin committed May 10, 2011
1 parent e04e4e5 commit 4254212
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/golf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ class << self
s="#{s}buzz" if i%5==0
s || i
}',
'c = nil
'i = -1
m = []
a.map { |i|
i-1 != c ? m << [i] : m[-1] << i
c = i
}
m.map { |i|
i.size > 1 ? "#{i[0]}-#{i[-1]}" : i[0].to_s
}',
a.map{ |j| a[i] + 1 != a[i += 1] ? m << [j] : (m[-1] << j if a[i] + 1 != a[i + 1]) }
m.map{ |i| i * "-" }',
'b = [1,1]
(2..a-1).map {|i| b << b[-2] + b[-1] }
b',
Expand Down

0 comments on commit 4254212

Please sign in to comment.