七行プログラミング (452レス)
七行プログラミング http://medaka.5ch.net/test/read.cgi/php/1036141603/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
2: マリモーマ ◆jbBCmetwgw [] 02/11/01 18:28 ID:HKLNcbVm 2GET 7行だけなら 何もできない罠 http://medaka.5ch.net/test/read.cgi/php/1036141603/2
166: 保守 [sage] 03/10/04 05:54 ID:??? $$_=1for"@ARGV"=~/\w/g;for('0019'..9999){my%c;$n=$_;next if$h{"@{[sort@v=/./g]} "}++&&$o||$z&&/0/||$d&&(grep$c{$_}++,@v);O:for(map[@{[qw(+ - * /)]}[$_&3,$_>>2& 3,$_>>4&3]],0..63){@x=(@$_,@v);eval==10&&do{print"$n:$_\n";$c&&last O}for grep s/(\d)/$x[$1]/g,qw/(304)1(526) ((304)15)26 30(41(526)) 30((415)26) (30(415))26/ }} http://medaka.5ch.net/test/read.cgi/php/1036141603/166
167: nobodyさん [sage] 03/10/05 03:33 ID:??? 本家スレで出てた切符問題の CGI プログラム版。 選択された4つの数字のみを調べる。 #!/usr/local/bin/perl use CGI':all';@n=param n;for(map[@{[qw(+ - * /)]}[$_&3,$_>>2&3,$_>>4&3]],0..63) {@x=(@$_,@n);for$t(qw/(304)1(526) ((304)15)26 30(41(526)) 30((415)26)/,'(30(41' .'5))26'){$_=$t;s/(\d)/$x[$1]/g;eval==10&&push@e,$_.br}}put header,start_html( -title=>7410),startform(0,script_name),p(scrolling_list(qw(-name n -size 10), -values=>[0..9])x4,submit),endform,p(@e),end_html >>166 は 5.005_03 なら動いたけど 5.8.0 だと不可。 http://medaka.5ch.net/test/read.cgi/php/1036141603/167
168: nobodyさん [sage] 03/10/05 20:23 ID:??? コマンドライン・CGI 両対応版。 #--- 7410.cgi --- #!/usr/local/bin/perl use CGI':all';sub e{for(map[@{[qw(+ - * /)]}[$_&3,$_>>2&3,$_>>4&3]],0..63){@x=( @$_,@n);for$t(qw/(304)1(526) ((304)15)26 30(41(526)) 30((415)26) (30(415))26/){ $_=$t;s/(\d)/$x[$1]/g;eval==10&&do{$r?push@e,$_.br:print"$n:$_\n";$c&&return}}} @e}if($r=$ENV{'REMOTE_ADDR'}){@n=param n;put header,start_html(-title=>7410), startform(0,script_name),p(scrolling_list(qw(-name n -size 10 -values),[0..9])x 4,submit),endform,p(e),end_html}else{$$_=1for"@ARGV"=~/\w/g;$n=$_,$h{"@{[sort@n =/./g]}"}++&&$o||$z&&/0/||$d&&do{my%c;grep$c{$_}++,@n}or e for'0019'..9999} __END__ usage: ./7410.cgi [ -cdoz ] -c : 1組の数字に対し1つの計算式のみ出力 -d : 同じ数字を使わない -o : 1組の数字に対し1つの出現順序のみ出力 -z : 0を含めない http://medaka.5ch.net/test/read.cgi/php/1036141603/168
169: nobodyさん [sage] 03/10/08 01:14 ID:??? 5.005_03 と 5.8.0 の両方でマジメにチェック & 縮め。 #!/usr/local/bin/perl use CGI':all';sub e{my@e;for(0..63){@x=(@{[qw(+ - * /)]}[$_&3,$_>>2&3,$_>>4&3], @n,param n);for$t(qw/(304)1(526) ((304)15)26 30(41(526)) 30((415)26) (30(415))26/){$_=$t;s/(\d)/$x[$1]/g;10-eval or$r?push@e,$_.br:put("$n:$_\n"),$c &&return}}@e}($r=$ENV{REMOTE_ADDR})?put(header,start_html(-title=>7410), startform(0,script_name),p(scrolling_list(-values=>[0..9],name,n,size,10)x4, submit),endform,p(e),end_html):do{$$_=1for"@ARGV"=~/\w/g;$n=$_,$h{"@{[sort@n= /./g]}"}++&&$o||$z&&/0/||$d&&4>keys%{{map{$_,1}@n}}or e for'0019'..'9999'} http://medaka.5ch.net/test/read.cgi/php/1036141603/169
216: nobodyさん [sage] 03/12/13 16:17 ID:??? ご自由に編集して下さい。(´ω` http://cm.xrea.cc/techinfo.cgi #--- 7memo.cgi --- #!/usr/local/bin/perl chdir"D";use CGI":all";charset$c='EUC-JP';($_)=path_info=~m|[^/]+|g;s/^\s+|[<>| ]|\s+$//g;tr/\x00-\x1F.\x7F/./;$F=length>2?escape CGI$_:Top;open F,($m=param w) ?">$F":$F;flock F,2;$/='';print F$m||=<F>;sub U($){unescape CGI@_}opendir D,'.' ;put header,start_html(-title=>U$F,lang,ja,encoding,$c),ul(map{li"".localtime(( stat)[9]),a{href,url."/$_"},U$_}sort grep!/^\./,readdir D),h1(U$F),startform(0, url."/$F"),p(textarea(w,$m,25,70),submit),endform,end_html __END__ 7wiki を参考に色々いぢってみました。 http://medaka.5ch.net/test/read.cgi/php/1036141603/216
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
1.210s*