a JavaScript 2 dimensional linked list
// create a 2 x 2 tile map
var tileMap = new TileMap(2, [1, 2, 3, 4]);
// internal representation null null ^ ^ | | + + +------+ +------+ | |<-----+| | null <---+| root | | |+---> null | |+----->| | +------+ +------+ + ^ + ^ | | | | v + v + +------+ +------+ | |<-----+| | null <---+| | | |+---> null | |+----->| | +------+ +------+ + + | | v v null null
data()
get(key) // gets data value at key
set(key, val) // set data value at key
getNode(key) // get a node at direction key, 'n', 'e', 's', 'w'
setNode(key, node) // set a node reference at key
hasNext()
next()
hasPrev()
prev()
hasUp()
up()
hasDown()
down()
root() // returns the root tile
size()
leftMost(tile) // returns the left most tile in relation to the given tile
topMost(tile) // returns the top most tile in relation to the given tile
each(function(tile){})
find(function(tile){ return true; })