Cubewiki 情報館 ver.2.16

F = datas/testprog.php
2014-11-01 19:09:13 更新
INDEX
$encode = "UTF-8";
$title = "テストプログラム";
$thisprog = 'testprog.php';
$autherid = 'libra0977';
$lastupdate = date("Y-m-d H:i", filemtime($thisprog));

$br = '
';
$sp = ' ';

print '';
print '';
print '';
print '' . $title . '';
print '';
print '';
print 'Title = ' . $title . $br;
print 'This program = ' . $thisprog . ' ';
print 'Last update = ' . $lastupdate . $br;
print '編集
';
print 'Indexへ
';
print '
';

$uid = $_GET['uid'] ? $_GET['uid'] : ($_POST['uid'] ? $_POST['uid'] : "");
$y = $_GET['y'] ? $_GET['y'] : ($_POST['y'] ? $_POST['y'] : "");
$m = $_GET['m'] ? $_GET['m'] : ($_POST['m'] ? $_POST['m'] : "");

$unit = array(' ',
"U", "U'", "U2",
"R", "R'", "R2",
"F", "F'", "F2",
"L", "L'", "L2",
"B", "B'", "B2",
"D", "D'", "D2",
"M", "M'", "M2",
"S", "S'", "S2",
"E", "E'", "E2"
);
$unit2 = array(' ',
"U", "U'", "U2",
"R", "R'", "R2",
"F", "F'", "F2",
"L", "L'", "L2",
"B", "B'", "B2",
"D", "D'", "D2"
);

$aunit = $unit;
$bunit = $unit;
$cunit = $unit;
$sunit = $unit2;
$tunit = $unit2;
$num = 0;

foreach ($aunit as $a) {
$a = trim($a);
if ($a == '') continue;
$adash = $a;
$ax = jiku($a);
if (strpos($adash, "'")) {
$adash = substr($adash, 0, 1);
} else {
if (strlen($adash) == 1) {
$adash .= "'";
}
}
foreach ($bunit as $b) {
$b = trim($b);
if ($b == '') continue;
if (substr($a, 0, 1) == substr($b, 0, 1)) continue;
$bdash = $b;
$bx = jiku($b);
if ($ax == $bx) continue;
if (strpos($bdash, "'")) {
$bdash = substr($bdash, 0, 1);
} else {
if (strlen($bdash) == 1) {
$bdash .= "'";
}
}
foreach ($cunit as $c) {
$c = trim($c);
if (substr($a, 0, 1) == substr($c, 0, 1)) continue;
if (substr($b, 0, 1) == substr($c, 0, 1)) continue;
$cx = jiku($c);
if ($ax == $cx) continue;
if ($bx == $cx) continue;
$cdash = $c;
if (strpos($cdash, "'")) {
$cdash = substr($cdash, 0, 1);
} else {
if (strlen($cdash) == 1) {
$cdash .= "'";
}
}
foreach ($sunit as $s) {
$s = trim($s);
$sx = jiku($s);
$sdash = $s;
if (strpos($sdash, "'")) {
$sdash = substr($sdash, 0, 1);
} else {
if (strlen($sdash) == 1) {
$sdash .= "'";
}
}
foreach ($tunit as $t) {
$t = trim($t);
$tx = jiku($t);
if (($t != '') && ($sx == $tx)) continue;
if (($s == '') && ($t != '')) continue;
$tdash = $t;
if (strpos($tdash, "'")) {
$tdash = substr($tdash, 0, 1);
} else {
if (strlen($tdash) == 1) {
$tdash .= "'";
}
}

$str = '';
$str .= $t . $sp;
$str .= $s . $sp;
$str .= $a . $sp;
$str .= $c . $sp;
$str .= $b . $sp;
$str .= $cdash . $sp;
$str .= $adash . $sp;
$str .= $c . $sp;
$str .= $bdash . $sp;
$str .= $cdash . $sp;
$str .= $sdash . $sp;
$str .= $tdash . $sp;
$str = saiteki($str);
if ($str == '') continue;
$tesu = tesu($str);
if ($tesu < 4) continue;
if ($tesu > 14) continue;
$num++;
if ($num > 10000) break;
print $num;
print '[' . $a . ',' . $b . ',' . $c . ',' . $s . ',' . $t . ']';
print ':   ' . $str . ' (' . $tesu . ')' . $br;
}
}
}
}
}

print "
";
$f = $thisprog;
print "Copyright ©2014";
$ynow = date("Y");
if ($ynow > 2014) print "-" . $ynow;
print " Libra0977.   ";
print "All Rights Reserved.   ";
print "last updated " . $lastupdate . ".
";
if ($uid == $autherid) {
print '
';
print 'Filename:
';
print '
';
print 'print 'style="width:100px; height:50px">
';
print '';
print '
';
}
print "
";
print $ua;

print '';
print '';


function jiku($x) {
$ans = 'xyz';
$j = substr($x, 0, 1);
if (($j == 'R') || ($j == 'L') || ($j == 'M')) {
$ans = 'x';
}
if (($j == 'U') || ($j == 'D') || ($j == 'E')) {
$ans = 'y';
}
if (($j == 'F') || ($j == 'B') || ($j == 'S')) {
$ans = 'z';
}
return $ans;
}


function tesu($str) {
$te = 0;
$st = explode(' ', $str);
foreach ($st as $one) {
$one = trim($one);
$o = substr($one, 0, 1);
if ($o == 'U') $te++;
if ($o == 'R') $te++;
if ($o == 'F') $te++;
if ($o == 'L') $te++;
if ($o == 'B') $te++;
if ($o == 'D') $te++;
if ($o == 'M') $te += 2;
if ($o == 'S') $te += 2;
if ($o == 'E') $te += 2;
}
return $te;
}

function saiteki($str) {
$str = preg_replace("/U U'/", "", $str);
$str = preg_replace("/U' U/", "", $str);
$str = preg_replace("/U U/", "U2", $str);
$str = preg_replace("/R R'/", "", $str);
$str = preg_replace("/R' R/", "", $str);
$str = preg_replace("/R R/", "R2", $str);
$str = preg_replace("/R2 R'/", "R", $str);
$str = preg_replace("/R2 R/", "R'", $str);
$str = preg_replace("/F F'/", "", $str);
$str = preg_replace("/F' F/", "", $str);
$str = preg_replace("/F F/", "F2", $str);
$str = preg_replace("/F2 F'/", "F", $str);
$str = preg_replace("/F2 F/", "F'", $str);
return $str;
}

?>

▲ページトップへ
Copyright ©2013-2024 Libra0977.   All Rights Reserved.   last updated 1970-01-01 09:00.Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)