Permalink
Browse files

データをシャッフルする用のRubyスクリプトを追加

  • Loading branch information...
1 parent be98d04 commit 46b7af5b8b568ce15ab750240d4860b3c2882059 @syou6162 committed Feb 29, 2012
Showing with 18 additions and 0 deletions.
  1. +18 −0 shuffle
View
18 shuffle
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+
+array = []
+
+ARGV.each{|filename|
+ File.open(filename, "r"){|file|
+ file.each{|line|
+ line.chomp!
+ array.push line
+ }
+ }
+}
+
+array.shuffle!
+
+array.each{|elem|
+ puts elem
+}

0 comments on commit 46b7af5

Please sign in to comment.