返回顶部

收藏

like while, you have another form you can use with untila€¡±that is, with begin/end:

更多
weight = 150

begin
  puts 'Weight: ' + weight.to_s
  weight += 5
end until weight == 200

标签:Ruby,Statement

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2016-12-25 09:38:00unless can work in exactly the same way because unless is just the opposite of if: by Loli控
  2. 2016-01-02 10:26:21Catch and Throw by zetaliang
  3. 2016-09-06 17:38:22downto method with integer by 胡晋
  4. 2016-09-06 20:45:33begin by Loli控
  5. 2016-11-01 09:24:09If vs Case by digua
  6. 2015-12-06 17:14:38All Ruby expressions return a result by 胡晋
  7. 2016-02-09 11:56:59use curly braces ({}): by Loli控
  8. 2016-02-17 20:44:19The if Statement with constant by Jamin
  9. 2016-03-29 16:55:30Nested for loop by 杨洋
  10. 2016-09-06 17:58:38general form of the for loop by Loli控
  11. 2016-09-06 20:50:38throw sends a message to catch if n is less than or equal to 0. by Loli控

发表评论