Skip to content

Instantly share code, notes, and snippets.

@tompng
Last active May 17, 2019 02:24
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 tompng/07c8e8b8f04626d104fff1c33bb7a094 to your computer and use it in GitHub Desktop.
Save tompng/07c8e8b8f04626d104fff1c33bb7a094 to your computer and use it in GitHub Desktop.
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
Copy link
Author

tompng commented May 17, 2019

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