Created
December 9, 2011 11:28
-
-
Save jehoshua02/1451182 to your computer and use it in GitHub Desktop.
Just monkeying around...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this is an example paste | |
class Monkey { | |
public $banana; | |
private $hp; | |
private $tummy; | |
public function __construct() | |
{ | |
$this->tummy = new Tummy('20'); | |
$this->hp = new HP('200'); | |
} | |
public function fetch_banana() | |
{ | |
$this->banana = new Banana(); | |
} | |
public function eat($food) | |
{ | |
$this->hp->add($food->hp()); | |
$this->tummy->fill($food->volume()); | |
if ($this->tummy->full()) {$this->poo();} | |
} | |
public function throw($stuff) | |
{ | |
$object->fly(); | |
} | |
public function poo() | |
{ | |
$poo = new Poo($this->tummy->excess()); | |
// nice paste! | |
if (rand(0,1)) | |
{ | |
$this->throw($poo); | |
} | |
else | |
{ | |
$this->eat($poo); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment