Skip to content

Instantly share code, notes, and snippets.

@mame

mame/README.md Secret

Last active April 23, 2019 11:57
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mame/357bab3d5dfb8e830c8656f07d28a468 to your computer and use it in GitHub Desktop.
Save mame/357bab3d5dfb8e830c8656f07d28a468 to your computer and use it in GitHub Desktop.
"Cookpad Daily Ruby Puzzles" in RubyKaigi 2019 - Extra Stage

Cookpad Daily Ruby Puzzles - Extra Stage

The Cookpad booth event in RubyKaigi 2019

See also the main problems (Day-1, Day-2, and Day-3)!

  • extra-1.rb: authored by @mame
  • extra-2.rb: authored by @mame
  • extra-3.rb: authored by @ko1
Hello = "Hello"
# Hint: Stop the recursion.
def Hello
Hello() +
" world"
end
puts Hello()
s = ""
# Hint: https://techlife.cookpad.com/entry/2018/12/25/110240
s == s.upcase or
s == s.downcase or puts "Hello world"
def say
s = 'Small'
t = 'world'
puts "#{s} #{t}"
end
TracePoint.new(:line){|tp|
tp.binding.local_variable_set(:s, 'Hello')
tp.binding.local_variable_set(:t, 'Ruby')
tp.disable
}.enable(target: method(:say))
say
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment