Skip to content

Instantly share code, notes, and snippets.

@jehoshua02
Created December 9, 2011 11:28
Show Gist options
  • Save jehoshua02/1451182 to your computer and use it in GitHub Desktop.
Save jehoshua02/1451182 to your computer and use it in GitHub Desktop.
Just monkeying around...
<?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