Ruby Learning # 10 Getting User Input

From Atom Preferense Install platformio-ide-terminal

Dos windows are added to the ATM.

Run with ruby ​​giraffe.rb

puts "Enter Your Name" name = gets put ("Hello " + name)

Enter Your Name Mike

Hello Mike

puts "Enter Your Name" name = gets put ("Hello " + name ", you are cool!")

Enter Your Name Mike

Hello Mike , you are cool!

Line breaks occur. To avoid this, chomp ()

puts "Enter Your Name" name = gets.chomp() age = gets.chomp() put ("Hello " + name ", you are" + age)

Enter Your Name Mike

Hello Mike, you are cool!

Recommended Posts

Ruby Learning # 10 Getting User Input
Ruby learning 4
Ruby learning 5
Ruby learning 3
Ruby learning 2
Ruby learning 6
Ruby learning 1
Ruby input / output
Ruby Learning # 25 Comments
Ruby Learning # 13 Arrays
Ruby Learning # 34 Modules
Ruby Learning # 14 Hashes
Ruby Learning # 15 Methods
Ruby standard input
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
Getting Started with Ruby
Ruby Learning # 27 Writing Files
Ruby Learning # 35 Interactive Ruby (irb)
Ruby Learning # 9 Math & Numbers
Ruby receives multi-line input
Ruby Learning # 28 Handling Errors
Ruby Learning # 26 Reading Files
Ruby Learning # 23 For Loops
Ruby Learning # 16 Return Statement
Ruby Learning # 2 Drawing a Shape
Ruby on rails learning record -2020.10.03
Ruby on rails learning record -2020.10.04
Ruby on rails learning record -2020.10.05
Ruby on rails learning record -2020.10.09
Ruby Learning # 18 If Statements (Con't)
Ruby Learning # 11 Building a Calculator
Ruby Learning # 99 Personal Programming Notebook
Ruby Learning # 32 Building a Quiz
Ruby Learning # 8 Working With String
[Ruby] Receive input from console
Ruby on rails learning record-2020.10.07 ①
Ruby on rails learning record -2020.10.06
Getting Started with Ruby Modules
Learning Ruby with AtCoder 11 How to receive frequently used standard input
Ruby Learning # 19 Building a Better Calculator
Completed Progate Ruby Learning Course III
Learning Ruby with AtCoder 6 [Contest 168 Therefore]
Ruby standard input and various methods
Encoding when getting in Windows + Ruby
Ruby Learning # 22 Building a Guessing Game