Skip to content

Instantly share code, notes, and snippets.

@niyari
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niyari/ecc8ae390aa91a2a6936 to your computer and use it in GitHub Desktop.
Save niyari/ecc8ae390aa91a2a6936 to your computer and use it in GitHub Desktop.
コミケに参加するサークルが、どのホールに配置されたのかを調べるやつ
//最新の配置地図に合わせて修正してください
function comikeSpace($space_a,$space_d){
if ($space_a == "A"){
$spaceNo = intval($space_d);
if($spaceNo < 37){
return "東1";
}elseif ($spaceNo < 53){
return "東2";
}else{
return "東3";
}
}
if ($space_a == "シ"){
$spaceNo = intval($space_d);
if($spaceNo < 37){
return "東4";
}elseif ($spaceNo < 53){
return "東5";
}else{
return "東6";
}
}
if (preg_match('/^[B-L]/', $space_a)) {
return "東1";
}
if (preg_match('/^[M-Z]/', $space_a)) {
return "東2";
}
if (preg_match('/^[ア-サ]/u', $space_a)) {
return "東3";
}
if (preg_match('/^[ム-ロ]/u', $space_a)) {
return "東4";
}
if (preg_match('/^[ネ-ミ]/u', $space_a)) {
return "東5";
}
if (preg_match('/^[ス-ヌ]/u', $space_a)) {
return "東6";
}
if (preg_match('/^[あ-な]/u', $space_a)) {
return "西1";
}
if (preg_match('/^[に-れ]/u', $space_a)) {
return "西2";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment