Skip to content

Instantly share code, notes, and snippets.

@tompng tompng/rubypuzzle1.rb
Last active May 17, 2019

Embed
What would you like to do?
puzzle for okinawarb 201905 "HelloWorld" を出力するように、何文字か(なるべく少ない文字数)追加してください
s = %w(Goodbye World Hello)
t = %w(Hello World Goodbye)
tap {
$> << s[-1] # Hello
}
tap {
$> << t[-1] # Goodbye
.to_str
}
tap {
$>.<<(t[s.size - 2 % 4]) # World
}
tap {
$>.<<(s[t.size - 3 % 5]) # Goodbye
.to_io
}
s = %w(Hello Goodbye World)
3.times do |i|
print s[(i-2).abs-1]
end
defined? $><<'World'<<($><<'Hello')<<'GoodBye'
send def say
$> << 'Goodbye' << ($> << 'Hello' << 'World'; 'World')
end
@tompng

This comment has been minimized.

Copy link
Owner Author

tompng commented May 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.