From 6adf5b57c985287f8c1619577ea4408e72e172a1 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 1 Mar 2025 13:25:22 +0900 Subject: code golf --- 9.php | 68 +++++++++++++++++++++++++++++++++---------------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/9.php b/9.php index 266a679..996624f 100644 --- a/9.php +++ b/9.php @@ -1,4 +1,4 @@ -[ 1,0 ]," @@ -11,40 +11,40 @@ y)$ sy= $zy ;$sp=$sy* 3+$ sx;[$z[$s p], $z[ $zp ]]= [$z [$z p], $z[ $sp ]]; ech o(" "", $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 +00001100101111",3));$i=(new("ArrayObject")($S($s."//".$s, +))) ->g etI ter +ato r() ;$B =fn +($_ =1) =>$ M(f n()=>prin t([ $i->curre nt( +),$ i-> nex t() ][0]),ran ge( 1,$_*3)); $W= +fn( $_= 1)= >pr int (st r_r epe +at( $C( 32) ,$_ *3) );$ N=f n() +=>p rint($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(f n($ +_)= >$_ ?$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)=>""])); \ No newline at end of file +$N( );}$B(9); ech o($C(39). ",[ $C( +32) =>" .$C (34 ).$ C(3 4). +",$ C(1 0)= >". $C( 34) .$C +(34 )." ])) ;");//$M= "ar ray +_ma p"; $S= "str_spli t"; $C= +"ch r"; $zp =st rpo s($ z," +a") ;[$ dx, $dy ]=m atc h($ +arg v[1 ]?? null){"h" =>[ 1,0 +]," j"= >[0 ,-1],"k"= >[0 ,1] +,"l "=> [-1 ,0] +,de fau lt= >[0 +,0],};$zx=$zp%3;$zy=intdiv($zp,3);$sx=$zx+$dx;$sy=$zy+//$ +M="array_map";$S="str_split',[chr(32)=>"",chr(10)=>""])); \ No newline at end of file -- cgit v1.2.3-70-g09d2