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

繰り返し文

Last updated at Posted at 2020-01-13

hair_long_man_73,jpeg.png
       ザッキーさん

繰り返し文を学習して引っかかった部分

while true do

while i <== do
の違いについて

全部 while true doではダメ?

ダメ。

●数の選別などには

while i <==  □□ do
  puts △△
  i += 1
end
(有限の処理を行う場面をイメージ?)

●ユーザーの登録情報を表示する時などには

while true do
  puts (" ○○ ")
  num = gets.to_i
  if num == 0
   ×× (users)
  elsif num == 1
   -- (users)
  elsif num == 2
    ~~ (users)
   else
  puts "無効"
end

(蓄積した情報を集約する場面をイメージ?)

終わり

0
0
0

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?