aboutsummaryrefslogtreecommitdiffhomepage
path: root/9.php
blob: 266a67987e18f80679639c1b013514ec67ba21f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php $z='bcdefghia';eval(strtr($s='$M="array_map";$S="st
r_split";$C="chr";$zp=strpos($z,"a");[$dx,$dy]=match($arg
v[1               ]??               nul               l){
"h"               =>[               1,0               ],"
j"=         >[0   ,-1   ],"k"=>[0   ,1]   ,"l"=>[-1   ,0]
,de         fau   lt=   >[0,0],};   $zx   =$zp%3;$z   y=i
ntd         iv(   $zp         ,3)   ;$s         x=$   zx+
$dx         ;$s   y=$         zy+   $dy         ;if   ($s
x<0         ||2   <$s   x)$sx=$zx   ;if   ($sy<0||2   <$s
y)$         sy=   $zy   ;$sp=$sy*   3+$   sx;[$z[$s   p],
$z[         $zp   ]]=   [$z         [$z         p],   $z[
$sp         ]];   ech   o("         <?p         hp"   .$C
(32         ).$   C(3   6)."z=".$   C(3   9).$z.$C(   39)
.";         eva   l(s   trtr(".$C   (36   )."s=".$C   (39
));               $n=               $M(               $S,
$S(               "00               000               111
1141424414143341142414424344111143434",5));$m=$M($S,$S("0
00001100101111",3));$i=(new("ArrayObject")($S(strtr($s."/
/".               $s,               [$C               (32
)=>               "",               $C(               10)
=>"   "])   )))   ->g   etIterato   r()   ;$B=fn($_   =1)
=>$   M(f   n()   =>p   rint([$i-   >cu   rrent(),$   i->
nex   t()   ][0   ]),   ran         ge(   1,$         _*3
));   $W=   fn(   $_=   1)=         >pr   int         (st
r_r   epeat($C(   32)   ,$_*3));$   N=f   n()=>prin   t($
C(1   0));$B(7)   ;$N   ();for($y   =0;   $y<3;$y++   ){$
B(1         9);   $N(         );$   B()   ;$W   (5)   ;$B
();         $W(   5);         $B(   );$   W(5   );$   B()
;$N         ();   $B(   );$W(5);$   B()   ;$W(5);$B   ();
$W(         5);   $B(   );$N();fo   r($   l=0;$l<10   ;$l
++)               {$B               ();               for
($x               =0;               $x<               3;$
x++){$W(1);$M(fn($_)=>$_?$B():$W(),$m[$n[$M("ord",$S($z))
[$y*3+$x]-97][intdiv($l,2)]]);$W(1);$B();}$N();}$B();$W(5
);$               B()               ;$W               (5)
;$B               ();               $W(               5);
$B(   );$N();$B   ();   $W(5);$B(   );$               W(5
);$   B();$W(5)   ;$B   ();$N();$   B(1               9);
$N(         );}   $B(   9);   ech   o($               C(3
9).         ",[   $C(   32)   =>"   .$C               (34
).$         C(3   4).   ",$C(10)=   >".               $C(
34)         .$C   (34   )."]));")   ;//               $M=
"ar         ray   _ma   p";   $S=   "st               r_s
pli         t";   $C=   "ch   r";   $zp               =st
rpo         s($   z,"   a");[$dx,   $dy               ]=m
atc         h($   arg   v[1]??nul   l){               "h"
=>[               1,0               ],"               j"=
>[0               ,-1               ],"               k"=
>[0,1],"l"=>[-1,0],default=>[0,0],};$zx=$zp%3;$zy=intdiv(
$zp,3);$sx=$zx+$dx;$sy=$zy+',[chr(32)=>"",chr(10)=>""]));