rileyjshaw / terra

:space_invader: JS library for simple biological simulations and cellular automata
http://rileyjshaw.com/terra/
MIT License
610 stars 46 forks source link

Some functions from util.js should be accessible within creature methods #11

Closed rileyjshaw closed 10 years ago

rileyjshaw commented 10 years ago

_.filter(), _.some(), and _.all(), for example, are very important for handling neighbors.

A bit strange since these functions should be available in some form on most modern browsers, but it'd be nice to have.

rileyjshaw commented 10 years ago

On second thought, people should be able to implement this however they want. Adding these as additional "special functions" would just add complexity.

Updated the docs to reflect this; for example,

_.filter(function (neighbors, spot) { ... });

has been changed to

neighbors.filter(function (spot) { ... });