<?php
$ary[] = array(0,0,0,0,1); $ary[] = array(0,0,0,0,0); $ary[] = array(0,0,0,0,0); $ary[] = array(0,1,0,0,0); $ary[] = array(0,0,0,0,0);
//[3][1]は固定でいいのか?
$flg = false;
for($i = count($ary)*-1; $i <= count($ary); $i++){ if($i ==0){
continue;
}
if($ary[3+$i][1+$i] == 1){
$flg = true;
break;
}
if($ary[3+$i][1-$i] == 1){
$flg = true;
break;
}
}
if($flg){
echo "見つかったよ!";
}else{
echo "みつからなかった";
}
?>
PD9waHAKICAgICRhcnlbXSA9IGFycmF5KDAsMCwwLDAsMSk7CgkkYXJ5W10gPSBhcnJheSgwLDAsMCwwLDApOwoJJGFyeVtdID0gYXJyYXkoMCwwLDAsMCwwKTsKCSRhcnlbXSA9IGFycmF5KDAsMSwwLDAsMCk7CgkkYXJ5W10gPSBhcnJheSgwLDAsMCwwLDApOwoJCgkvL1szXVsxXeOBr+WbuuWumuOBp+OBhOOBhOOBruOBi++8nwoJJGZsZyA9IGZhbHNlOwoJZm9yKCRpID0gY291bnQoJGFyeSkqLTE7ICRpIDw9IGNvdW50KCRhcnkpOyAkaSsrKXsKCQlpZigkaSA9PTApewoJCQljb250aW51ZTsKCQl9CgkJaWYoJGFyeVszKyRpXVsxKyRpXSA9PSAxKXsKCQkJJGZsZyA9IHRydWU7CgkJCWJyZWFrOwoJCX0KCQlpZigkYXJ5WzMrJGldWzEtJGldID09IDEpewoJCQkkZmxnID0gdHJ1ZTsKCQkJYnJlYWs7CgkJfQoJfQoJaWYoJGZsZyl7CgkJZWNobyAi6KaL44Gk44GL44Gj44Gf44KI77yBIjsKCX1lbHNlewoJCWVjaG8gIuOBv+OBpOOBi+OCieOBquOBi+OBo+OBnyI7Cgl9Cj8+