Jump to content

Nesty

Newbie
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Nesty

  1. У меня есть код самой простой игры домино, мне нужно его перевести на js Без вашей помощи мне не обойтись...)
  2. Спасибо большое, очень помогли... но это не все... еще нужно классы описать... Пожалуйста) <?php class Player { public $hand=array(); public $numHand; public $countDominoInHand; public $score; public function printHand() { //var_dump($this->getHand()); foreach($this->getHand() as $ff) echo ' '.$ff; echo '<br/>getcountDominoInHand() - '; echo $this->getcountDominoInHand(); echo '<br/>getnumHand() -'; echo $this->getnumHand(); echo '<br/>--end printHand()<br/>'; } function __construct($numHand) { $this->setnumHand($numHand); $this->score=0; } public function getScore() { return $this->score; } public function setScore($score){ $this->score=$score; } public function removeFromHand($domino) { unset($this->hand[$domino]); } public function shuffleHand() { shuffle($this->hand); } public function getHand() { return $this->hand; } public function setHand($domino){ $this->hand[]=$domino->getDomino(); } public function getnumHand() { return $this->numHand; } public function setnumHand($numHand){ $this->numHand=$numHand; } public function getcountDominoInHand() { return count($this->hand); } public function clearHand() { $this->hand=NULL; } } ?>
  3. <?php class Domino { public $domino; function __construct($domino) { $this->domino=$domino; } public function getDomino(){ return $this->domino; } public function setDomino($domino){ $this->domino=$domino; } public function printDomino(){ echo $this->getDomino().'<br/>'; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy