]> git.mxchange.org Git - friendica-addons.git/commitdiff
fix errors in tictac addon
authorArt4 <art4@wlabs.de>
Sat, 30 Nov 2024 20:36:07 +0000 (20:36 +0000)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 12 Dec 2024 21:37:42 +0000 (22:37 +0100)
tictac/tictac.php

index 10103835517f1668d921d653f6985e09f55845bc..082b58c161e4822e0e2bd0a9a80c073d10f2f917 100644 (file)
@@ -7,7 +7,6 @@
  * Status: unsupported
  */
 
-use Friendica\App;
 use Friendica\Core\Hook;
 use Friendica\DI;
 
@@ -30,7 +29,12 @@ function tictac_module() {}
 
 function tictac_content() {
 
-       $o = '';
+  $o        = '';
+  $dimen    = 3;
+  $handicap = 0;
+  $mefirst  = 0;
+  $yours    = '';
+  $mine     = '';
 
   if($_POST['move']) {
     $handicap = DI::args()->get(1);
@@ -45,9 +49,6 @@ function tictac_content() {
     $handicap = DI::args()->get(1);
     $dimen = 3;
   }
-  else {
-   $dimen = 3;
-  }
 
   $o .=  '<h3>' . DI::l10n()->t('3D Tic-Tac-Toe') . '</h3><br />';
 
@@ -163,7 +164,7 @@ class tictac {
   ];
 
   function __construct($dimen, $handicap, $mefirst, $yours, $mine) {
-    $this->dimen = 3;
+    $this->dimen = $dimen;
     $this->handicap = $handicap ? 1 : 0;
     $this->mefirst = $mefirst ? 1 : 0;
     $this->yours = str_replace('XXX','',$yours);
@@ -228,6 +229,8 @@ class tictac {
   }
 
   function parse_moves($player) {
+    $str = '';
+
     if($player == 'me')
       $str = $this->mine;
     if($player == 'you')