Ruby Learning # 12 Building a Mad Libs Game

Dialogue with String

puts "Enter a color: " color = gets.chomp() puts "Enter a plural noun: " plural_noun = gets.chomp() puts "Enter a celebrity: " celebrity = gets.chomp()

puts ("Roses are " + color) puts (plural_noun + "are blue") puts ("I Love" + celebrity)

Enter a color: magenta

Enter a plural noun: Microwaves

Enter a celebrity Tom Hanks

Roses are magenta Microwaves are blue I love Tom Hanks

Recommended Posts

Ruby Learning # 12 Building a Mad Libs Game
Ruby Learning # 22 Building a Guessing Game
Ruby Learning # 11 Building a Calculator
Ruby Learning # 32 Building a Quiz
Ruby Learning # 19 Building a Better Calculator
Ruby Learning # 2 Drawing a Shape
Make a typing game with ruby
Ruby learning 4
Ruby learning 5
Ruby learning 3
Ruby learning 2
Ruby learning 6
Ruby learning 1
Building a Deep Learning environment (Ubuntu 20.04 LTS)
[Ruby] Building a Ruby development environment on Ubuntu
Ruby Learning # 25 Comments
Ruby Learning # 13 Arrays
Ruby Learning # 34 Modules
Building a Ruby environment for classes on Mac
Ruby Learning # 14 Hashes
Ruby Learning # 15 Methods
Creating a Cee-lo game with Ruby 4th Creating a game progress process
Ruby Learning # 30 Initialize Method
Ruby Learning # 29 Classes & Objects
Ruby Learning # 20 Case Expressions
Ruby Learning # 24 Exponent Method
Ruby Learning # 17 If Statements
Ruby Learning # 21 While Loops
Ruby Learning # 31 Object Methods
Ruby Learning # 27 Writing Files
Ruby Learning # 35 Interactive Ruby (irb)
Ruby Learning # 9 Math & Numbers
Ruby Learning # 28 Handling Errors
Ruby Learning # 26 Reading Files
Ruby Learning # 23 For Loops
Ruby Learning # 16 Return Statement
Difficulties in building a Ruby on Rails environment (Windows 10) (SQLite3)
Learning Ruby with AtCoder 13 How to make a two-dimensional array