0
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 5 years have passed since last update.

caseで遊びたい

Last updated at Posted at 2015-08-22
caseで条件分岐をしてみよう
shingo = "桃色"
case shingo
when "赤"
	puts "止まれ"
when "青"
	puts "行け"
when "黄色"
	puts "止まれなければ注意して行け"
else
	puts "帰れ"
end

これ、止まれとか行けとかランダムかなんかで
代入されるような形ってどうやるんでしょう
この場合shingoの中身が変化するように

0
0
7

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
0
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?