#!/usr/local/bin/jperl #written by Seisei Yamaguchi #http://hp.vector.co.jp/authors/VA010205/ #seisei@usa.net $lr0 = ""; $lr1 = ""; $lr2 = ""; $x0 = 0; $x1 = 0; $x2 = 0; $y0 = 0; $y1 = 0; $y2 = 0; $base_base = 65; #'A' $base = $base_base; $base_add = 32; #'A' + 32 = 'a'. for 'a'-32 while( <> ) { if (/([¡¡-ô¤])[ ]*([LR])([0-9])([0-9])([LR])([0-9])([0-9])/i) { print $1; $lr1 = $2; $x1 = $3; $y1 = $4; $lr2 = $5; $x2 = $6; $y2 = $7; for $num (1..2) { $lr0 = eval( '$lr' . $num ); $x0 = eval( '$x' . $num ); $y0 = eval( '$y' . $num ); $base = $base_base; if ( $lr0 =~ /L/i ) { $x0 = 4 - $x0; #reverse x of left-handed $base = $base + $base_add; } print pack( "c", $base + $y0 * 5 + $x0 ); } print "\n"; } else { print; } }