Skip to content

Instantly share code, notes, and snippets.

@niyari

niyari/comike_space2map

Last active Aug 29, 2015
Embed
What would you like to do?
コミケに参加するサークルが、どのホールに配置されたのかを調べるやつ
//最新の配置地図に合わせて修正してください
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