Last active
December 24, 2015 01:19
-
-
Save syusui-s/6722448 to your computer and use it in GitHub Desktop.
授業も始まったし、早速
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ary = [8,2,3,7,1,2,5,7,8,3,5,6] | |
| result = [] | |
| threads = [] | |
| ary.each{|e| | |
| threads.push Thread.new{ | |
| sleep e | |
| result.push e | |
| } | |
| } | |
| loop do | |
| if not threads.map{|e| e.alive? }.include?(true) | |
| puts result.to_s | |
| exit 0 | |
| end | |
| sleep 1 | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment