Skip to content

Commit

Permalink
hena15 golf
Browse files Browse the repository at this point in the history
  • Loading branch information
cielavenir committed Nov 3, 2013
1 parent 0dbbdd0 commit 9f12d97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tyama_hena15_golf.rb
@@ -0,0 +1,2 @@
#!/usr/bin/env ruby
puts$<.map{|e|a=e.split('/').map{|e|e.to_i(16)};31.downto(0).map{|e|a[0][e]|a[1][e]*2}.join.gsub('12','102').gsub('21','201').split('0').map{|e|{'32'=>'L','31'=>'R','23'=>'J','131'=>'T','323'=>'U','313'=>'N','231'=>'S','132'=>'Z'}[e]}*''}
3 changes: 2 additions & 1 deletion tyama_hena_validator.rb
Expand Up @@ -89,8 +89,9 @@ def sax_comment(text)
data=listener.content.each_slice(listener.fold).to_a
data=data.map{|e|e[(data[0][0]=='#')?1:0,2]}[1..-1]
IO.popen(ARGV[0],'r+b'){|io|
data.each{|e|io.puts e[0]}
io.close_write
data.each_with_index{|e,i|
io.puts e[0]
print 'Case '+(i).to_s+': '
puts (flag5 ? hena5(io.gets.chomp)==hena5(e[1]) : io.gets.chomp==e[1])?'OK':'NG'
}
Expand Down

0 comments on commit 9f12d97

Please sign in to comment.