2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

第6回

Last updated at Posted at 2020-12-01

!Mac OS X-10.15.7 !ruby-2.7.1p83

変数

rubyの変数は型宣言不要.

name="bob"

引数にはARGV[]を用いる.

#文字列
num1=ARGV[0]
#intにキャスト
num1=ARGV[0].to_i

メソッド

def メソッド名(引数1,引数2)
  処理1
  処理2
end

以下が例.

def hello name
  puts "Hello #{name}"
end
name=ARGV[0]
hello(name)


  • source ~/grad_members_20f/members/Kenny0704/c6.org
2
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?