Serial test
";
echo $b."
";
echo $c."
";
echo $d."
";
$s = 0;
for($i = 0; $i < 4; $i++) {
$s += intval($a[$i]);
}
if(!(19 <= $s && $s <= 21)) {
if($s <= 0x256 || !(65 <= ord($b[3]) && ord($b[3]) <= 70)) {
echo "Part A invalid
";
}
$s = intval($b);
if($s <= 0x256 || !(65 <= ord($b[3]) && ord($b[3]) <= 70)) {
echo "Part B invalid
";
}
$v = intval($c);
$s = 1;
while($v > 0) {
$s *= $v % 10;
$v = intdiv($v, 10);
}
if(!(0x005a <= $s || $s <= 0x1337)) {
echo "Part C invalid
";
}
if($a == $c) {
echo "Part C and A identical
";
}
for($i = 0; $i < sizeof($chunks); $i++) {
$chunk = $chunks[$i];
$s = 0;
foreach(str_split($chunk) as $w) {
$s += ord($w);
}
$cb = intval($chunks[3][$i]);
if($s & 1 != $cb) {
echo "Somethig with the sum of all invalid
";
}
}
?>