1 words = []
2 IO.foreach("hangul_words.txt") do |line|
3 next if $. <= 295 #374
4 h, k, *j = line.scan(/[\w()]+/)
5 words << [h, k, j.join(",")]
6 end
7
8 t = Time.now
9 title = "Hangul Exam on #{t.year}.#{t.month}.#{t.day} "
10
11 puts title + "--Answer Sheet"
12 puts
13 questions = {0 => []} #, 1 => [], 2 => []}
14 words.shuffle.each do |set|
15 print "#{set[0]} : #{set[1]} : #{set[2]}\n"
16 1.times do |n|
17 questions[n] << "#{set[n]}"
18 end
19 end
20 puts "_______________________________________________"
21 puts
22 questions.each do |i, v|
23 puts title + "--Question Sheet(#{i+1})"
24 puts
25 puts v
26 puts "_____________________________________________"
27 puts
28 end
No comments:
Post a Comment