Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges "Hello, {name}!"

Ruby, 24 21 18 bytes p"Hello, #{gets}!" Try it online! Golfed down 3 bytes thanks to @snail_'s advice. Golfed down 3 bytes thanks to @south's advice.

posted 3y ago by General Sebast1an‭  ·  edited 3y ago by General Sebast1an‭

Answer
#5: Post edited by user avatar General Sebast1an‭ · 2022-02-12T17:30:05Z (almost 3 years ago)
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_**](https://codegolf.codidact.com/users/53607)'s [solution](https://codegolf.codidact.com/comments/thread/4375#comment-13345). I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
  • # [Ruby], <s>24</s> <s>21</s> 18 bytes
  • <!-- language-all: lang-ruby -->
  • p"Hello, #{gets}!"
  • [Try it online!][TIO-kzk42fto]
  • Golfed down 3 bytes thanks to [**@snail_**](https://codegolf.codidact.com/users/53607)'s [advice](https://codegolf.codidact.com/comments/thread/4375#comment-13345). Golfed down 3 bytes thanks to [**@south**](https://codegolf.codidact.com/users/55339)'s [advice](https://codegolf.codidact.com/comments/thread/4375#comment-16517).
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kzk42fto]: https://tio.run/##KypNqvz/v0DJIzUnJ19HQbk6PbWkuFZR6f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
#4: Post edited by user avatar General Sebast1an‭ · 2021-09-04T08:32:04Z (about 3 years ago)
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_**](https://codegolf.codidact.com/users/53607)'s solution. I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_**](https://codegolf.codidact.com/users/53607)'s [solution](https://codegolf.codidact.com/comments/thread/4375#comment-13345). I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
#3: Post edited by user avatar General Sebast1an‭ · 2021-09-04T08:15:39Z (about 3 years ago)
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_](https://codegolf.codidact.com/users/53607)'s solution. I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_**](https://codegolf.codidact.com/users/53607)'s solution. I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
#2: Post edited by user avatar General Sebast1an‭ · 2021-09-04T08:14:40Z (about 3 years ago)
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
  • # [Ruby], 21 bytes
  • <!-- language-all: lang-ruby -->
  • puts"Hello, #{gets}!"
  • [Try it online!][TIO-kt5ieikf]
  • [**@snail_](https://codegolf.codidact.com/users/53607)'s solution. I'll be giving them the credit since I don't want to change the input.
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt5ieikf]: https://tio.run/##KypNqvz/v6C0pFjJIzUnJ19HQbk6PbWkuFZR6f//4rzEzBwA "Ruby – Try It Online"
  • # [Ruby], 24 bytes
  • <!-- language-all: lang-ruby -->
  • puts'Hello, '+gets()+'!'
  • [Try it online!][TIO-kt58rflb]
  • [Ruby]: https://www.ruby-lang.org/
  • [TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"
#1: Initial revision by user avatar General Sebast1an‭ · 2021-09-04T03:44:13Z (about 3 years ago)
# [Ruby], 24 bytes

<!-- language-all: lang-ruby -->

    puts'Hello, '+gets()+'!'

[Try it online!][TIO-kt58rflb]

[Ruby]: https://www.ruby-lang.org/
[TIO-kt58rflb]: https://tio.run/##KypNqvz/v6C0pFjdIzUnJ19HQV07PbWkWENTW11R/f9/38SibAX3zKLEtLRUAA "Ruby – Try It Online"