'Ruby syntax for while block in one line
Could you please tell, what is the Ruby syntax for while block in one line?
Solution 1:[1]
For example
puts a[i+=1] while i < 10
Solution 2:[2]
Simple:
while 1 do puts "hello" end
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Matt |
| Solution 2 | woz |
