Fix errors in tictac addon

pull/1575/head
Art4 2024-11-24 19:51:37 +00:00
parent 348c44c972
commit e9d3afb483
1 changed files with 5 additions and 3 deletions

View File

@ -70,6 +70,7 @@ class tictac {
private $dimen; private $dimen;
private $first_move = true; private $first_move = true;
private $handicap = 0; private $handicap = 0;
private $mefirst;
private $yours; private $yours;
private $mine; private $mine;
private $winning_play; private $winning_play;
@ -161,10 +162,10 @@ class tictac {
]; ];
function __construct($dimen,$handicap,$mefirst,$yours,$mine) { function __construct($dimen, $handicap, $mefirst, $yours, $mine) {
$this->dimen = 3; $this->dimen = 3;
$this->handicap = (($handicap) ? 1 : 0); $this->handicap = $handicap ? 1 : 0;
$this->mefirst = (($mefirst) ? 1 : 0); $this->mefirst = $mefirst ? 1 : 0;
$this->yours = str_replace('XXX','',$yours); $this->yours = str_replace('XXX','',$yours);
$this->mine = $mine; $this->mine = $mine;
$this->you = $this->parse_moves('you'); $this->you = $this->parse_moves('you');
@ -175,6 +176,7 @@ class tictac {
} }
function play() { function play() {
$o = '';
if($this->first_move) { if($this->first_move) {
if(rand(0,1) == 1) { if(rand(0,1) == 1) {