From: yasuoka@kudpc.kyoto-u.ac.jp (Koichi Yasuoka)
Newsgroups: fj.comp.image,fj.lang.awk
Subject: Re: Random Character Stereogram
Date: 8 Oct 92 05:00:58 GMT
Reply-To: yasuoka@kudpc.kyoto-u.ac.jp (Koichi Yasuoka)
Distribution: fj
Organization: Data Processing Center, Kyoto University, Kyoto, JAPAN

$@!!5~ETBg3XBg7?7W;;5!%;%s%?!<$N0B2,$G$9!#(J

$@!!6e=#9)6HBg3X$N8E@n$5$s$O=q$-$^$7$?!#(J
>$@!V%i%s%@%`%-%c%i%/%?!&%9%F%l%*%0%i%`!W$H$$$&$N$r(J
>$@:n$C$F$_$^$7$?!J$b$&C/$+$9$G$K$d$C$F$k$+$J!)!K!#(J

$@!!$9$4$$!*(J $@;d$N%^%7%s$K$O(Jperl$@$,$J$$$N$G!"$^$M$7$F(Jawk$@$G=q$-D>$7$F(J
$@$_$^$7$?!#$?$@$7!"85%G!<%?$K$O(J0$@$H(J1$@$7$+;H$($^$;$s!#(J

gAVrOmLdgAVrOmLdgAVrOmLdgAVrOmLdgAVrOLdgAVryOLdgAVryOLdgAVryOLdgAVryOLdgA
SnJgEdvOSnJgEdvOSnJgEdvOSnJgEdvOSnJgdvOSnJgdkvOSnJgdkvOSnJgdkvOSnJgdkvOSn
FbyWvNgAFbyWvNgAFbyWvNgAFbyWvNgAFbyvNgAFbyvNgXAFbyvNgXAFbyvNgXAFbyvNgXAFb
tQoNfySntQoNfySntQoNfySntQoNfySntQNfySntQNfySnLtQNfySnLtQNfySnLtQNfySnLtQ
iGfxQkFbiGfxQkFbiGfxQkFbiGfxQkFbifxQkFbifxQkFbiftxQkFbiftxQkFbiftxQkFbift
RqIbvQmJRqIbvQmJRqIbvQmJRqIbvQmJqIbvQmJqIbvQmJqIbcvQmJqIbcvQmJqIbcvQmJqIb
BTmGbxUsBTmGbxsBTmGbxsBTmGbxsBTmGbxsBTmGbxsBTmGbxsBTmGbxsBTmGbxsBTmNGbxsB
fySnJgEdfySnJgEdySnJgEdySnJgEdySnJgEdySnJgEdySnJgEdySnJgEdySnJgEdwySnJgEd
PjEaxVuMPjEaxVuMPjaxVuMPjaxVuMPjaxVuMPjaxVuMPjaxVuMPjaxVuMPjaxVluMPjaxVlu
FawTrQiBFawTrQiBFawTQiBFawTQiBFa$@!|(JQiBFa$@!|(JQiBFawTQiBFawTQiBFawYTQiBFawYTQi
tPmKjBUotPmKjBUotPmKjBotPmKjBotPmKjBotPmKjBotPmKjBotPmKjBotJPmKjBotJPmKjB
fCazRkEZfCazRkEZfCazRkEZCazRkEZCazRkEZCazRkEZCazRkEZCazRksEZCazRksEZCazRk
PnMexRmIPnMexRmIPnMexRmIPnexRmIPnexRmIPnexRmIPnexRmIPnehxRmIPnehxRmIPnehx
FewPjEaxFewPjEaxFewPjEaxFwPjEaxFwPjEaxFwPjEaxFwPjEaxFwPjQEaxFwPjQEaxFwPjQ
pHauPlIgpHauPlIgpHauPlIgHauPlIgHauPlIgHauPlIgHauPlIgHauPlzIgHauPlzIgHauPl
RkEZvSqPRkEZvSqPRkEZvSqRkEZvSqRkEZvSqRkEZvSqRkEZvSqRkEZvSqjRkEZvSqjRkEZvS
CWrNkIhzCWrNkIhzCWrNkIzCWrNkIzCWrNkIzCWrNkIzCWrNkIzCWrNkIzCUWrNkIzCUWrNkI
oJfCazRkoJfCazRkoJfCaRkoJfCaRkoJfCaRkoIJfCRkoIJfCRkoIJfCRkoIeJfCRkoIeJfCR
zVsQpHauzVsQpHauzVsQHauzVsQHauzVsQHPauzVsQHPazVsQHPazVsQHPazVmsQHPazVmsQH
IfDcuNhCIfDcuNhCIfDuNhCIfDuNhCIfDVuNhCIfDVuNhCIDVuNhCIDVuNhCIDtVuNhCIDtVu

$@!!Cf$N!|$,5$$KF~$C$F$k$N$G$9$,!"$I$&$G$7$g!)(J
=============================================================================
  $@#J#A#Z#Z%a!<%j%s%0%j%9%H4IM}<T(J       $@0B2,9'0l!w5~ETBg3XBg7?7W;;5!%;%s%?!<(J
                                         yasuoka@kudpc.kyoto-u.ac.jp
=============================================================================
$@!!;d?.(J: $@$$$A$g$&:W$K$O5"$C$F$/$k$N$G$9$+!)(J > $@8E@n$5$s(J

######## $@$A$g$-$A$g$-(J ######## $@$A$g$-$A$g$-(J ######## $@$A$g$-$A$g$-(J ########
#! /bin/awk -f
# "stereo" Version 1.0
#	Original perl script by Tetsuo Furukawa
#	awk translation by Koichi Yasuoka 
BEGIN{
#  m="##";				# ASCII
  m=sprintf("%c$@!|%c(J",27,27);	# JIS
#  m=sprintf("%c%c",161,252);		# EUC
#  m=sprintf("%c%c",129,156);		# Shift-JIS
  for(i=0;i<26;i++){
    a[i]=sprintf("%c",i+65);
    a[i+26]=sprintf("%c",i+97);
  }
}
{
  if(t<length(buf[NR]=$0))
    r+=t=length($0);
}
END{
  for(i=1;i<=NR;i++){
    s="";
    for(j=0;j<8;j++){
      c[j]=r=(r+(i+j)%8+18)%52;
      s=s a[r];
    }
    for(j=8;j<t+8;j++){
      if(substr(buf[i],j-7,1)==1)
	c[j]=c[j-7];
      else if(substr(buf[i],j-8,1)==1){
	r=(r+j%8+18)%52;
	while(index(s,a[r]))
	  r=(r+1)%52;
	c[j]=r;
      }
      else
	c[j]=c[j-8];
      s=s a[c[j]];
    }
    if(i==int((NR+1)/2)){
      k=int((t-1)/2);
      if(substr(buf[i],k+1,1)==1)
	l=5;
      else
	l=6;
      printf("%s%s%s%s%s\n",substr(s,1,k),m,substr(s,k+3,l),m,substr(s,k+l+5));
    }
    else
      printf("%s\n",s);
  }
}