An example of javascript representing a Fruit Tree
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README
fruit_tree.js

README

In order to execute call:

var tree = getFruitTree(3,'apple'),
	apple1 = tree.pick(),
	apple2 = tree.pick(),
	apple3 = tree.pick();

apple1.eat(); //mmm, good apple
apple1.eat(); //all gone. already ate apple