# HG changeset patch # User Matti Hamalainen # Date 1425763011 -7200 # Node ID 3193bf205f5b41418afcc5e44bdcb1b8388b985f # Parent caad98cd707a684b48f866d8dc30cae86120bc9a Remove old file. diff -r caad98cd707a -r 3193bf205f5b materials/alloy.php --- a/materials/alloy.php Sat Mar 07 23:12:57 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,282 +0,0 @@ -".htmlentities($mat).""; -} - - -function addValueStyle($n) -{ - if ($n >= 20) $s = 20; - else - if ($n >= 10) $s = 10; - else - if ($n >= 5) $s = 5; - else - if ($n > 0) $s = 0; - else - return ""; - - return " class=\"hits".$s."\""; -} - - -printPageHeader($pageTitle, " - - -"); -?> -

-
- - - - - - - - - - - -
Show type - [Reset/Clear] [Material browser] -
-
    -
  • Also available in ASCII plaintext format.
  • -
  • Only 2-material alloys are currently supported by this browser. - Yes, I know some you think that this project is "useless".
  • -
  • There may be bugs and lots of combinations are not researched yet.
  • - -
  • The cell colour reflects how "reliable" the information is: 1-4 tries, 5-9 tries, - 10-19 tries, 20 or more.
  • -
-
- -
-
-Error! No such material '".$showMatName."'\n". - "

Material is not known. Check spelling.

\n"; - } else { - echo "

".$showMatName."

\n". - "\n". - ""; - - $n = 0; - foreach ($matTable[$showMat] as $key => $val) { - echo ""; - if ($n++ >= 2) { echo "\n"; $n = 0; } - } - - echo "\n
".htmlentities($transNameTable[$key+1]).""; - if (is_array($val)) { - reset($val); - if (list($nam, $lode) = each($val)) - echo htmlentities($transTable[$key][$lode]); - - while (list($nam, $lode) = each($val)) - echo ", ".htmlentities($transTable[$key][$lode]); - } else { - echo htmlentities($transTable[$key][$val]); - } - echo "
\n"; - - echo "

Alloy combinations

\n"; - if (isset($alloyRevTable[$showMat])) { - echo "\n"; - } else { - echo "

No known alloy combinations.

\n"; - } - -/* - $typeMats = array(); - foreach ($matTable as $name => $data) { - if ($data[14] == $matTable[$showMat][14] && $name != $showMat) - $typeMats[] = $name; - } - - echo "Full mix: "; - if (list($a, $b) = each($typeMats)) - echo matLink($b); - - while (list($a, $b) = each($typeMats)) - echo " + ".matLink($b); - echo "
\n"; -*/ - - echo "

Mixtable

\n"; - if (count($alloyTable[$showMat]) > 0) { - echo - "". - " \n". - " \n"; - foreach ($alloyTable[$showMat] as $key => $value) { - echo "\n"; - } - echo " \n". - " "; - foreach ($alloyTable[$showMat] as $key => $value) - if (list($a, $b) = each($value)) { - echo ""; - } - echo "
+".matLink($key)."
".htmlentities($showMat)."".matLink($a)."
\n"; - } else { - echo "

No mixtable entries.

\n"; - } - } -} -else -{ - /* - * Print alloy table for given material type - */ - // Filter table from maintable matching desired material type(s) - $currTable = array(); - foreach ($matTable as $name => $data) { - if ($data[14] == $typeTable[$showOnly][1] || $data[14] == $typeTable[$showOnly][2]) - $currTable[] = $name; - } - - // Swap desired rows - if (count($swapRows) > 0) { - $str = ""; - $nkeys = count($currTable); - foreach ($swapRows as $from => $to) - if ($from >= 0 && $from < $nkeys && $to >= 0 && $to < $nkeys && $to != $from) { - if ($str != "") $str .= ", "; - $str .= "$from <=> $to"; - $tmp = $currTable[$from]; - $currTable[$from] = $currTable[$to]; - $currTable[$to] = $tmp; - } - if ($str != "") - echo "

Swapped rows: ".$str."

\n"; - } - - - // Print out the table - echo "". - " \n". - " \n"; - - foreach ($currTable as $name) { - echo " \n"; - } - echo " \n"; - - foreach ($currTable as $mat1) { - echo " "; - foreach ($currTable as $mat2) { - - if (isset($alloyTable[$mat1][$mat2])) - $tmp = $alloyTable[$mat1][$mat2]; - else if (isset($alloyTable[$mat2][$mat1])) - $tmp = $alloyTable[$mat2][$mat1]; - else - unset($tmp); - - $tag = ($mat1 == $mat2) ? "th" : "td"; - - if (isset($tmp)) { - arsort($tmp); - $value = 0; - foreach ($tmp as $a => $b) - $value += $b; - - $note = count($tmp) > 1 ? " [UNSTABLE]" : ""; - - echo "<".$tag.addValueStyle($value). - (count($tmp) > 1 ? " style=\"font-style:italic;\">" : ">"); - - foreach ($tmp as $a => $b) { - echo matLink($a, $b." successful alloys (".$mat1." + ".$mat2." = ".$a.")".$note)." "; - } - - echo ""; - - } else - echo "<".$tag." class=\"nohits\">-"; - } - echo "\n"; - } - echo "
-".matLink($name)."
".matLink($mat1)."
\n"; -} - -printPageFooter(); -?>