使用PHP在微信公共平台實現24點游戲,搭建服務器為SAE,所以很多語句和MYSQL不太一樣,24點的數據庫存儲在24data裡面,先用python計算出結果然後存儲在本地的txt文件最後倒入SAE的MYSQL,記錄了所有有解的4個數字。可以添加微信號:24點。
//define your token define("TOKEN", "ddwm"); define("INPUT_NAME", "1"); define("START_GAME", "2"); define("TIMING_START", "3"); define("TIMING_END", "4"); $wechatObj = new Why24Point(); if ($_GET["echostr"]) $wechatObj--->valid(); else $wechatObj->responseMsg(); class Why24Point { public function responseMsg() { //get post data, May be due to the different environments $postStr = $GLOBALS["HTTP_RAW_POST_DATA"]; //extract post data if (!empty($postStr)) { $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA); $fromUsername = $postObj->FromUserName; $toUsername = $postObj->ToUserName; if($postObj->Event == "subscribe"){ $time = time(); $textTpl = ""; $msgType = "text"; $contentStr = "喲你好親愛的小伙伴,歡迎來到24點~\n游戲規則:使用+-*/四則運算得出結果為24即可。\n任何時候輸入 主頁 返回主菜單,\n輸入 排名 查看當前排名喲~\n如果有情況反饋請發送語音信息!\n請輸入任意內容,開始我們的24點職業生涯!"; $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); echo $resultStr; } $keyword = trim($postObj->Content); $time = time(); $textTpl = " %s "; if (!empty($keyword)) { $msgType = "text"; $contentStr = $this->getData($fromUsername, $keyword); $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr); echo $resultStr; } else { echo "輸入點東西吧。。"; } } else { echo ""; exit; } } private function getData($fromUsername, $keyword) { if($keyword == "主頁"){ $this->setStep($fromUsername, constant("START_GAME")); return "歡迎來到24點的決戰現場。請輸入任意內容,開始我們的24點職業生涯!任何時候輸入 主頁 返回主菜單,輸入 排名 查看當前排名~"; } if($keyword == "排名"){ return "您的目前排名是:".$this->getRank($fromUsername); } if ($this->isFirst($fromUsername)) { return "這是你第一次參加游戲,請輸入你的用戶昵稱:"; } if ($this->getStep($fromUsername) == constant("INPUT_NAME")) { $this->setName($fromUsername, $keyword); $this->setStep($fromUsername, constant("START_GAME")); return "你好," . $keyword . "同學。請輸入任意內容,開始我們的24點職業生涯!任何時候輸入 主頁 返回主菜單,輸入 排名 查看當前排名~"; } if ($this->getStep($fromUsername) == constant("START_GAME")) { $numbers = $this->getNumbers(); $this->setStep($fromUsername, constant("TIMING_START")); return "游戲規則:使用+-*/四則運算得出結果為24即可。\n請聽題!" . $this->getNumbers(); } if ($this->getStep($fromUsername) == constant("TIMING_START")) { if ($this->calcStr($keyword)) { //$this->setStep($fromUsername, constant("TIMING_END")); $this->setGrade($fromUsername, 5); $this->setStep($fromUsername, constant("START_GAME")); return "結果等於24!你現在的分數是:".$this->getGrade($fromUsername); } return "結果錯誤!騙子,根本就不等於24!"; //$this->setStep($fromUsername, constant("TIMING_END")); } return "我擦,系統出問題了。抱了個歉哈!"; } //計算排名 private function getRank($fromUsername){ $mysql = new SaeMysql(); $grade = $this->getGrade($fromUsername); $sql = "SELECT COUNT( * ) FROM `24points` WHERE `grade` > ".$grade.""; $mysql->closeDb(); return intval($mysql->getVar($sql))+1; } //計算成績 private function setGrade($fromUsername, $add){ $mysql = new SaeMysql(); $sql = "SELECT grade FROM `24points` WHERE `userid` = '" . $fromUsername . "'"; $grade = intval($mysql->getVar($sql)) + $add; $sql = "UPDATE `24points` SET `grade` = '" . $grade . "' WHERE `userid` ='" . $fromUsername . "';"; $mysql->runSql($sql); $mysql->closeDb(); } //獲得成績 private function getGrade($fromUsername){ $mysql = new SaeMysql(); $sql = "SELECT grade FROM `24points` WHERE `userid` = '" . $fromUsername . "'"; $mysql->closeDb(); return intval($mysql->getVar($sql)); } //計算等式,返回正確或者錯誤 private function calcStr($keyword) { $keyword = str_replace("(","(",$keyword); $keyword = str_replace(")",")",$keyword); $keyword = str_replace("÷","/",$keyword); $keyword = str_replace("/","/",$keyword); $keyword = str_replace("×","*",$keyword); $atr_arr = str_split($keyword); $new_atr = ''; for ($i = 0; $i < strlen($keyword); $i++) { $new_atr = $new_atr . $atr_arr[$i]; } $s = eval("return $new_atr;"); if ($s == 24) { return true; } return false; } //是否是第一次 private function isFirst($fromUsername) { $mysql = new SaeMysql(); $sql = "SELECT * FROM `24points` WHERE `userid` = '" . $fromUsername . "'"; $data = $mysql->getData($sql); if (count($data) == 0) { $sql = "INSERT INTO `24points` (`userid`, `step`) VALUES ('" . $fromUsername . "', '" . constant("INPUT_NAME") . "');"; $mysql->runSql($sql); $mysql->closeDb(); return true; } return false; } //獲取當前的步驟 private function getStep($fromUsername) { $mysql = new SaeMysql(); $sql = "SELECT step FROM `24points` WHERE `userid` = '" . $fromUsername . "'"; $mysql->closeDb(); return $mysql->getVar($sql); } //獲取隨機的四個數字用空格隔開 private function getNumbers() { $rand_id = rand(1, 1362); $mysql = new SaeMysql(); $sql = "SELECT num1 FROM `24data` WHERE `id` = '" . $rand_id . "'"; $num1 = $mysql->getVar($sql); $sql = "SELECT num2 FROM `24data` WHERE `id` = '" . $rand_id . "'"; $num2 = $mysql->getVar($sql); $sql = "SELECT num3 FROM `24data` WHERE `id` = '" . $rand_id . "'"; $num3 = $mysql->getVar($sql); $sql = "SELECT num4 FROM `24data` WHERE `id` = '" . $rand_id . "'"; $num4 = $mysql->getVar($sql); $mysql->closeDb(); $numbers = $num1 . " " . $num2 . " " . $num3 . " " . $num4; return $numbers; } //設置當前操作的步數 private function setStep($fromUsername, $step) { $mysql = new SaeMysql(); $sql = "UPDATE `24points` SET `step` = '" . $step . "' WHERE `userid` ='" . $fromUsername . "';"; $mysql->runSql($sql); $mysql->closeDb(); } //設置用戶昵稱 private function setName($fromUsername, $username) { $mysql = new SaeMysql(); $sql = "UPDATE `24points` SET `username` = '" . $username . "' WHERE `userid` ='" . $fromUsername . "';"; $mysql->runSql($sql); $mysql->closeDb(); } //驗證微信 public function valid() { $echoStr = $_GET["echostr"]; //valid signature , option if ($this->checkSignature()) { echo $echoStr; exit; } } //檢查簽名 private function checkSignature() { $signature = $_GET["signature"]; $timestamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $token = TOKEN; $tmpArr = array($token, $timestamp, $nonce); sort($tmpArr); $tmpStr = implode($tmpArr); $tmpStr = sha1($tmpStr); if ($tmpStr == $signature) { return true; } else { return false; } } } %s
1 1 1 8 1 1 1 11 1 1 1 12 1 1 1 13 1 1 2 6 1 1 2 7 1 1 2 8 1 1 2 9 1 1 2 10 1 1 2 11 1 1 2 12 1 1 2 13 1 1 3 4 1 1 3 5 1 1 3 6 1 1 3 7 1 1 3 8 1 1 3 9 1 1 3 10 1 1 3 11 1 1 3 12 1 1 3 13 1 1 4 4 1 1 4 5 1 1 4 6 1 1 4 7 1 1 4 8 1 1 4 9 1 1 4 10 1 1 4 12 1 1 5 5 1 1 5 6 1 1 5 7 1 1 5 8 1 1 6 6 1 1 6 8 1 1 6 9 1 1 6 12 1 1 7 10 1 1 8 8 1 1 9 13 1 1 10 12 1 1 10 13 1 1 11 11 1 1 11 12 1 1 11 13 1 1 12 12 1 1 12 13 1 1 13 13 1 2 2 4 1 2 2 5 1 2 2 6 1 2 2 7 1 2 2 8 1 2 2 9 1 2 2 10 1 2 2 11 1 2 2 12 1 2 2 13 1 2 3 3 1 2 3 4 1 2 3 5 1 2 3 6 1 2 3 7 1 2 3 8 1 2 3 9 1 2 3 10 1 2 3 11 1 2 3 12 1 2 3 13 1 2 4 4 1 2 4 5 1 2 4 6 1 2 4 7 1 2 4 8 1 2 4 9 1 2 4 10 1 2 4 11 1 2 4 12 1 2 4 13 1 2 5 5 1 2 5 6 1 2 5 7 1 2 5 8 1 2 5 9 1 2 5 10 1 2 5 12 1 2 5 13 1 2 6 6 1 2 6 7 1 2 6 8 1 2 6 9 1 2 6 10 1 2 6 11 1 2 6 12 1 2 6 13 1 2 7 7 1 2 7 8 1 2 7 9 1 2 7 10 1 2 7 11 1 2 7 12 1 2 8 8 1 2 8 9 1 2 8 10 1 2 8 13 1 2 9 11 1 2 9 12 1 2 9 13 1 2 10 11 1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 5 6 13 1 5 7 8 1 5 7 9 1 5 7 10 1 5 7 11 1 5 7 12 1 5 7 13 1 5 8 8 1 5 8 9 1 5 8 10 1 5 8 11 1 5 8 12 1 5 8 13 1 5 9 9 1 5 9 10 1 5 9 11 1 5 9 12 1 5 9 13 1 5 10 10 1 5 10 11 1 5 10 12 1 5 10 13 1 5 11 11 1 5 11 12 1 5 12 12 1 6 6 6 1 6 6 8 1 6 6 9 1 6 6 10 1 6 6 11 1 6 6 12 1 6 6 13 1 6 7 9 1 6 7 10 1 6 7 11 1 6 7 12 1 6 8 8 1 6 8 9 1 6 8 10 1 6 8 11 1 6 8 12 1 6 8 13 1 6 9 9 1 6 9 10 1 6 9 12 1 6 9 13 1 6 10 12 1 6 10 13 1 6 11 12 1 6 11 13 1 6 12 12 1 6 12 13 1 7 7 9 1 7 7 10 1 7 7 11 1 7 7 12 1 7 8 8 1 7 8 9 1 7 8 10 1 7 8 11 1 7 8 12 1 7 9 9 1 7 9 10 1 7 9 11 1 7 9 12 1 7 9 13 1 7 10 12 1 7 10 13 1 7 12 12 1 7 12 13 1 7 13 13 1 8 8 8 1 8 8 9 1 8 8 10 1 8 8 11 1 8 8 12 1 8 9 11 1 8 9 12 1 8 9 13 1 8 10 11 1 8 10 12 1 8 10 13 1 8 11 12 1 8 11 13 1 8 12 12 1 9 9 12 1 9 10 12 1 9 10 13 1 9 11 11 1 9 11 12 1 9 11 13 1 9 12 12 1 10 10 12 1 10 11 12 1 10 12 12 1 10 12 13 1 11 11 12 1 11 11 13 1 11 12 12 1 11 12 13 1 11 13 13 1 12 12 12 1 12 12 13 1 12 13 13 2 2 2 3 2 2 2 4 2 2 2 5 2 2 2 7 2 2 2 8 2 2 2 9 2 2 2 10 2 2 2 11 2 2 2 12 2 2 2 13 2 2 3 3 2 2 3 4 2 2 3 5 2 2 3 6 2 2 3 7 2 2 3 8 2 2 3 9 2 2 3 10 2 2 3 11 2 2 3 12 2 2 3 13 2 2 4 4 2 2 4 5 2 2 4 6 2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 4 6 8 2 4 6 9 2 4 6 10 2 4 6 11 2 4 6 12 2 4 6 13 2 4 7 7 2 4 7 8 2 4 7 9 2 4 7 10 2 4 7 11 2 4 7 12 2 4 8 8 2 4 8 9 2 4 8 10 2 4 8 11 2 4 8 12 2 4 8 13 2 4 9 9 2 4 9 10 2 4 9 12 2 4 9 13 2 4 10 10 2 4 10 11 2 4 10 12 2 4 10 13 2 4 11 11 2 4 11 12 2 4 12 12 2 4 13 13 2 5 5 7 2 5 5 8 2 5 5 9 2 5 5 10 2 5 5 11 2 5 5 12 2 5 5 13 2 5 6 6 2 5 6 7 2 5 6 8 2 5 6 9 2 5 6 10 2 5 6 11 2 5 6 12 2 5 6 13 2 5 7 7 2 5 7 8 2 5 7 9 2 5 7 10 2 5 7 11 2 5 7 13 2 5 8 8 2 5 8 9 2 5 8 10 2 5 8 11 2 5 8 12 2 5 8 13 2 5 9 10 2 5 9 11 2 5 9 12 2 5 10 10 2 5 10 11 2 5 10 12 2 5 10 13 2 5 11 12 2 5 12 12 2 5 12 13 2 6 6 6 2 6 6 7 2 6 6 8 2 6 6 9 2 6 6 10 2 6 6 11 2 6 6 12 2 6 6 13 2 6 7 8 2 6 7 9 2 6 7 10 2 6 7 11 2 6 7 12 2 6 7 13 2 6 8 8 2 6 8 9 2 6 8 10 2 6 8 11 2 6 8 12 2 6 8 13 2 6 9 9 2 6 9 10 2 6 9 11 2 6 9 12 2 6 10 10 2 6 10 11 2 6 10 12 2 6 10 13 2 6 11 12 2 6 11 13 2 6 12 12 2 6 12 13 2 7 7 8 2 7 7 10 2 7 7 11 2 7 7 12 2 7 7 13 2 7 8 8 2 7 8 9 2 7 8 11 2 7 8 12 2 7 8 13 2 7 9 10 2 7 9 11 2 7 9 13 2 7 10 10 2 7 10 11 2 7 10 12 2 7 11 12 2 7 12 12 2 7 12 13 2 8 8 8 2 8 8 9 2 8 8 10 2 8 8 11 2 8 8 12 2 8 8 13 2 8 9 9 2 8 9 10 2 8 9 11 2 8 9 12 2 8 9 13 2 8 10 10 2 8 10 11 2 8 10 12 2 8 10 13 2 8 11 11 2 8 11 12 2 8 12 12 2 8 12 13 2 8 13 13 2 9 9 11 2 9 9 12 2 9 9 13 2 9 10 10 2 9 10 11 2 9 10 12 2 9 10 13 2 9 11 11 2 9 11 13 2 9 12 13 2 9 13 13 2 10 10 11 2 10 10 12 2 10 10 13 2 10 11 11 2 10 11 12 2 10 11 13 2 10 12 13 2 11 11 11 2 11 11 12 2 11 11 13 2 11 12 12 2 11 12 13 2 11 13 13 2 12 12 12 2 12 12 13 2 12 13 13 2 13 13 13 3 3 3 3 3 3 3 4 3 3 3 5 3 3 3 6 3 3 3 7 3 3 3 8 3 3 3 9 3 3 3 10 3 3 3 11 3 3 3 12 3 3 4 4 3 3 4 5 3 3 4 6 3 3 4 7 3 3 4 8 3 3 4 9 3 3 4 11 3 3 4 12 3 3 4 13 3 3 5 5 3 3 5 6 3 3 5 7 3 3 5 9 3 3 5 10 3 3 5 12 3 3 5 13 3 3 6 6 3 3 6 7 3 3 6 8 3 3 6 9 3 3 6 10 3 3 6 11 3 3 6 12 3 3 6 13 3 3 7 7 3 3 7 8 3 3 7 9 3 3 7 11 3 3 7 12 3 3 7 13 3 3 8 8 3 3 8 9 3 3 8 10 3 3 8 12 3 3 8 13 3 3 9 9 3 3 9 10 3 3 9 11 3 3 9 12 3 3 9 13 3 3 10 13 3 3 11 12 3 3 11 13 3 3 12 12 3 3 12 13 3 4 4 4 3 4 4 5 3 4 4 6 3 4 4 7 3 4 4 8 3 4 4 9 3 4 4 10 3 4 4 11 3 4 4 12 3 4 4 13 3 4 5 5 3 4 5 6 3 4 5 7 3 4 5 8 3 4 5 9 3 4 5 10 3 4 5 11 3 4 5 12 3 4 5 13 3 4 6 6 3 4 6 8 3 4 6 9 3 4 6 10 3 4 6 11 3 4 6 12 3 4 6 13 3 4 7 7 3 4 7 8 3 4 7 9 3 4 7 10 3 4 7 11 3 4 7 12 3 4 8 9 3 4 8 10 3 4 8 11 3 4 8 12 3 4 8 13 3 4 9 9 3 4 9 11 3 4 9 12 3 4 9 13 3 4 10 10 3 4 10 12 3 4 10 13 3 4 11 12 3 4 11 13 3 4 12 12 3 4 12 13 3 5 5 6 3 5 5 7 3 5 5 8 3 5 5 9 3 5 5 11 3 5 5 12 3 5 6 6 3 5 6 7 3 5 6 8 3 5 6 9 3 5 6 10 3 5 6 11 3 5 6 12 3 5 6 13 3 5 7 8 3 5 7 9 3 5 7 10 3 5 7 11 3 5 7 12 3 5 7 13 3 5 8 8 3 5 8 9 3 5 8 11 3 5 8 12 3 5 8 13 3 5 9 9 3 5 9 10 3 5 9 12 3 5 9 13 3 5 10 10 3 5 10 11 3 5 10 12 3 5 10 13 3 5 11 11 3 5 11 12 3 5 12 12 3 5 12 13 3 5 13 13 3 6 6 6 3 6 6 7 3 6 6 8 3 6 6 9 3 6 6 10 3 6 6 11 3 6 6 12 3 6 6 13 3 6 7 7 3 6 7 8 3 6 7 9 3 6 7 10 3 6 7 12 3 6 7 13 3 6 8 8 3 6 8 9 3 6 8 10 3 6 8 12 3 6 8 13 3 6 9 9 3 6 9 10 3 6 9 11 3 6 9 12 3 6 9 13 3 6 10 10 3 6 10 11 3 6 10 12 3 6 11 11 3 6 11 12 3 6 11 13 3 6 12 12 3 6 12 13 3 6 13 13 3 7 7 7 3 7 7 8 3 7 7 9 3 7 7 10 3 7 7 12 3 7 7 13 3 7 8 8 3 7 8 9 3 7 8 11 3 7 8 12 3 7 8 13 3 7 9 9 3 7 9 10 3 7 9 11 3 7 9 12 3 7 9 13 3 7 10 10 3 7 10 11 3 7 10 13 3 7 11 11 3 7 11 12 3 7 12 12 3 7 12 13 3 7 13 13 3 8 8 8 3 8 8 9 3 8 8 10 3 8 8 11 3 8 8 12 3 8 9 9 3 8 9 10 3 8 9 11 3 8 9 12 3 8 9 13 3 8 10 10 3 8 10 11 3 8 10 12 3 8 11 11 3 8 11 12 3 8 12 12 3 8 12 13 3 8 13 13 3 9 9 9 3 9 9 10 3 9 9 11 3 9 9 12 3 9 9 13 3 9 10 10 3 9 10 11 3 9 10 12 3 9 10 13 3 9 11 11 3 9 11 12 3 9 11 13 3 9 12 12 3 9 12 13 3 9 13 13 3 10 10 12 3 10 11 12 3 10 11 13 3 11 11 12 3 11 12 12 3 12 12 12 3 12 12 13 3 12 13 13 4 4 4 4 4 4 4 5 4 4 4 6 4 4 4 7 4 4 4 8 4 4 4 9 4 4 4 10 4 4 4 11 4 4 4 12 4 4 5 5 4 4 5 6 4 4 5 7 4 4 5 8 4 4 5 10 4 4 5 11 4 4 5 12 4 4 5 13 4 4 6 8 4 4 6 9 4 4 6 10 4 4 6 11 4 4 6 12 4 4 6 13 4 4 7 7 4 4 7 8 4 4 7 9 4 4 7 10 4 4 7 12 4 4 7 13 4 4 8 8 4 4 8 9 4 4 8 10 4 4 8 11 4 4 8 12 4 4 8 13 4 4 9 11 4 4 9 12 4 4 10 10 4 4 10 12 4 4 10 13 4 4 11 12 4 4 11 13 4 4 12 12 4 4 12 13 4 5 5 5 4 5 5 6 4 5 5 7 4 5 5 8 4 5 5 9 4 5 5 10 4 5 6 6 4 5 6 7 4 5 6 8 4 5 6 9 4 5 6 10 4 5 6 11 4 5 6 12 4 5 6 13 4 5 7 7 4 5 7 8 4 5 7 9 4 5 7 10 4 5 7 11 4 5 7 12 4 5 7 13 4 5 8 8 4 5 8 9 4 5 8 10 4 5 8 11 4 5 8 12 4 5 8 13 4 5 9 9 4 5 9 10 4 5 9 12 4 5 9 13 4 5 10 10 4 5 10 11 4 5 10 12 4 5 10 13 4 5 11 11 4 5 11 12 4 5 11 13 4 5 12 12 4 5 12 13 4 5 13 13 4 6 6 6 4 6 6 7 4 6 6 8 4 6 6 9 4 6 6 10 4 6 6 12 4 6 7 7 4 6 7 8 4 6 7 9 4 6 7 10 4 6 7 12 4 6 8 8 4 6 8 9 4 6 8 10 4 6 8 12 4 6 8 13 4 6 9 9 4 6 9 10 4 6 9 12 4 6 9 13 4 6 10 10 4 6 10 11 4 6 10 12 4 6 11 11 4 6 11 12 4 6 12 12 4 6 12 13 4 6 13 13 4 7 7 7 4 7 7 8 4 7 7 11 4 7 8 8 4 7 8 9 4 7 8 10 4 7 8 11 4 7 8 12 4 7 8 13 4 7 9 9 4 7 9 10 4 7 9 11 4 7 9 12 4 7 9 13 4 7 10 10 4 7 10 11 4 7 10 12 4 7 11 11 4 7 11 12 4 7 11 13 4 7 12 12 4 7 12 13 4 7 13 13 4 8 8 8 4 8 8 9 4 8 8 10 4 8 8 11 4 8 8 12 4 8 8 13 4 8 9 9 4 8 9 10 4 8 9 11 4 8 9 12 4 8 9 13 4 8 10 10 4 8 10 11 4 8 10 12 4 8 11 11 4 8 11 12 4 8 11 13 4 8 12 12 4 8 12 13 4 8 13 13 4 9 9 10 4 9 9 12 4 9 10 11 4 9 10 12 4 9 10 13 4 9 11 11 4 9 11 12 4 9 12 12 4 10 10 11 4 10 10 12 4 10 11 12 4 10 11 13 4 10 12 12 4 10 12 13 4 11 12 13 4 12 12 12 5 5 5 5 5 5 5 6 5 5 5 9 5 5 5 12 5 5 6 6 5 5 6 7 5 5 6 8 5 5 6 11 5 5 7 7 5 5 7 8 5 5 7 10 5 5 7 11 5 5 8 8 5 5 8 9 5 5 8 10 5 5 8 11 5 5 8 12 5 5 8 13 5 5 9 9 5 5 9 10 5 5 9 11 5 5 10 10 5 5 10 11 5 5 10 13 5 5 11 11 5 5 11 12 5 5 11 13 5 5 12 12 5 5 12 13 5 5 13 13 5 6 6 6 5 6 6 7 5 6 6 8 5 6 6 9 5 6 6 10 5 6 6 12 5 6 7 7 5 6 7 8 5 6 7 9 5 6 7 12 5 6 7 13 5 6 8 8 5 6 8 9 5 6 8 10 5 6 8 12 5 6 8 13 5 6 9 9 5 6 9 10 5 6 9 11 5 6 9 12 5 6 9 13 5 6 10 10 5 6 10 11 5 6 10 12 5 6 10 13 5 6 11 11 5 6 11 12 5 6 11 13 5 6 12 12 5 6 12 13 5 6 13 13 5 7 7 9 5 7 7 10 5 7 7 11 5 7 8 8 5 7 8 9 5 7 8 10 5 7 9 10 5 7 9 11 5 7 9 12 5 7 9 13 5 7 10 10 5 7 10 11 5 7 10 12 5 7 10 13 5 7 11 11 5 7 11 13 5 7 12 12 5 7 13 13 5 8 8 8 5 8 8 9 5 8 8 10 5 8 8 13 5 8 9 11 5 8 9 12 5 8 9 13 5 8 10 11 5 8 10 12 5 8 11 12 5 8 11 13 5 8 12 12 5 9 9 11 5 9 9 12 5 9 10 10 5 9 10 11 5 9 10 13 5 9 11 13 5 9 12 12 5 9 12 13 5 10 10 11 5 10 10 12 5 10 10 13 5 10 11 11 5 10 12 13 5 10 13 13 5 11 12 12 6 6 6 6 6 6 6 8 6 6 6 9 6 6 6 10 6 6 6 11 6 6 6 12 6 6 7 9 6 6 7 10 6 6 7 11 6 6 7 12 6 6 8 8 6 6 8 9 6 6 8 10 6 6 8 11 6 6 8 12 6 6 8 13 6 6 9 10 6 6 9 11 6 6 9 12 6 6 9 13 6 6 10 12 6 6 10 13 6 6 11 12 6 6 11 13 6 6 12 12 6 6 12 13 6 7 7 10 6 7 7 11 6 7 8 9 6 7 8 10 6 7 8 11 6 7 8 12 6 7 9 9 6 7 9 12 6 7 10 10 6 7 10 12 6 7 10 13 6 7 11 11 6 7 11 12 6 7 11 13 6 7 12 12 6 7 12 13 6 8 8 8 6 8 8 9 6 8 8 10 6 8 8 11 6 8 8 12 6 8 9 9 6 8 9 10 6 8 9 11 6 8 9 12 6 8 9 13 6 8 10 11 6 8 10 12 6 8 10 13 6 8 11 11 6 8 11 12 6 8 11 13 6 8 12 12 6 8 13 13 6 9 9 10 6 9 9 11 6 9 9 12 6 9 10 11 6 9 10 12 6 9 11 12 6 9 11 13 6 9 12 12 6 9 12 13 6 10 10 10 6 10 10 13 6 10 11 12 6 10 12 12 6 10 12 13 6 11 11 12 6 11 12 12 6 11 12 13 6 12 12 12 6 12 12 13 6 12 13 13 7 7 7 12 7 7 8 11 7 7 9 10 7 7 10 13 7 7 11 12 7 7 11 13 7 7 12 12 7 7 12 13 7 8 8 9 7 8 8 10 7 8 8 11 7 8 8 12 7 8 8 13 7 8 9 10 7 8 9 12 7 8 9 13 7 8 10 10 7 8 10 11 7 8 10 13 7 8 11 12 7 8 11 13 7 8 12 12 7 8 12 13 7 9 9 13 7 9 10 11 7 9 10 12 7 9 11 11 7 9 11 12 7 9 12 12 7 9 13 13 7 10 10 11 7 10 10 12 7 10 11 13 7 10 12 12 7 10 12 13 7 12 12 13 8 8 8 10 8 8 8 11 8 8 8 12 8 8 8 13 8 8 9 11 8 8 9 12 8 8 9 13 8 8 10 12 8 8 10 13 8 8 11 12 8 8 11 13 8 8 12 12 8 8 12 13 8 9 9 12 8 9 10 12 8 9 10 13 8 9 11 11 8 9 11 12 8 9 11 13 8 9 12 12 8 9 12 13 8 10 10 12 8 10 11 11 8 10 12 12 8 10 12 13 8 10 13 13 8 11 12 12 9 9 9 12 9 9 10 13 9 9 11 12 9 9 11 13 9 9 12 12 9 9 12 13 9 10 10 13 9 10 11 12 9 10 11 13 9 10 12 12 9 10 12 13 9 11 11 11 9 11 12 12 9 11 12 13 9 11 13 13 9 12 12 12 10 10 10 12 10 10 10 13 10 10 11 12 10 10 11 13 10 10 12 12 10 10 12 13 10 11 11 12 10 11 11 13 10 11 12 12 10 11 12 13 10 12 12 12 10 12 12 13 10 12 13 13 10 13 13 13 11 11 11 12 11 11 11 13 11 11 12 12 11 11 12 13 11 12 12 12 11 12 12 13 11 12 13 13 11 13 13 13 12 12 12 12 12 12 12 13 12 12 13 13 12 13 13 13