七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
369: 365 [sage] 2006/01/22(日) 16:39:32 ID:??? use Storable;$f='file';$s=8;$c='Shift_JIS';%p=qw/-1 〇 0 _ 1 ●/;@m=map([map 0 ,0..$s+2],0..$s+2);($x,$y)=map param($_)%($s+1),qw/x y/;$r=1;use CGI':all';sub f2{my($w,$y,$x,$c)=@_;$u=1;if(0>$r*$m[$y][$x]){$c++;$m[$y][$x]*=$u=f2($w,$y+$w ->[0],$x+$w->[1],$c)}elsif(0<$c&&0<$r*$m[$y][$x]){$u*=-1}$u}sub r{if($y&&$x&&! $m[$y][$x]){for(0..7){$i=$_*atan2 1,1;$l=[map int(sprintf'%f',$_*sqrt 2),sin$i, cos$i];$z++if 0>f2$l,$y+$l->[0],$x+$l->[1]}if($z){$m[$y][$x]=$r;$r*=-1}}}$m[$s/ 2+(0<($_&2))][$s/2+(0<($_&1))]=$_%3?1:-1 for 0..3;($r,@m)=@{retrieve$f}if-s$f;r ;store[$r,@m],$f;print header(-charset=>$c),start_html(-encoding=>$c,-lang=> 'ja'),table(Tr[map{$i=$_;td[map a({-href=>"o.cgi?y=$i&x=$_"},$p{$m[$i][$_]}),1 ..$s]}1..$s]),$p{$r},end_html; 7オセロ? o.cgiで保存。 同じディレクトリに記録用ファイルの "file" を作成。 要 Storable.pm (Active Perl なら最初から入っているはず) リセットは手動で "file" を空にするw 7行に収まると思ったけど見込みが甘かった。 http://medaka.5ch.net/test/read.cgi/php/1036141603/369
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 83 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.012s