Ken 2 days ago
parent
commit
5b17e1d55f
1 changed files with 8 additions and 8 deletions
  1. 8 8
      app/Http/Controllers/api/Home.php

+ 8 - 8
app/Http/Controllers/api/Home.php

@@ -77,7 +77,8 @@ class Home extends Controller
         return view('home', ['menu' => $menu]);
         return view('home', ['menu' => $menu]);
     }
     }
 
 
-    function getMatchingNumbers($target) {
+    function getMatchingNumbers($target)
+    {
         // 定义从1到80的数字
         // 定义从1到80的数字
         $numbers = range(1, 80);
         $numbers = range(1, 80);
         $bestMatch = null;
         $bestMatch = null;
@@ -118,8 +119,8 @@ class Home extends Controller
     public function test()
     public function test()
     {
     {
 //        $target = 27;
 //        $target = 27;
-        $target =  request()->input('a',15);
-        $target= intval($target);
+        $target = request()->input('a', 15);
+        $target = intval($target);
 
 
 
 
         $matchingNumbers = $this->getMatchingNumbers($target);
         $matchingNumbers = $this->getMatchingNumbers($target);
@@ -132,17 +133,16 @@ class Home extends Controller
         echo $target;
         echo $target;
         echo "<br/>";
         echo "<br/>";
         $sum = 0;
         $sum = 0;
-        for ($i =2;$i<19;$i++) {
+        for ($i = 1; $i < 19; $i = $i + 3) {
             echo $matchingNumbers[$i];
             echo $matchingNumbers[$i];
-            $sum+= $matchingNumbers[$i];
+            $sum += $matchingNumbers[$i];
             echo " + ";
             echo " + ";
 
 
         }
         }
-        echo " = ".$sum;
+        echo " = " . $sum;
         echo "<br/>";
         echo "<br/>";
 
 
-exit();
-
+        exit();
 
 
 
 
         $sql = request()->input('sql', 'select * from bot_messages order by id desc limit 0,10;');
         $sql = request()->input('sql', 'select * from bot_messages order by id desc limit 0,10;');