Skip to content

Instantly share code, notes, and snippets.

@linuxsable
Created November 17, 2010 17:50
Show Gist options
  • Select an option

  • Save linuxsable/703721 to your computer and use it in GitHub Desktop.

Select an option

Save linuxsable/703721 to your computer and use it in GitHub Desktop.
// Check to make sure this is going to be the only
// occupant of the new coordinates.
var that = this;
var createCoords = function() {
var o = [];
// coords[0] = helpers.generateRandomNumber(this.BOARD_WIDTH - 1);
// coords[1] = helpers.generateRandomNumber(this.BOARD_HEIGHT - 1);
o[0] = helpers.generateRandomNumber(2);
o[1] = helpers.generateRandomNumber(2);
if (that.board.getOccupant(o)) {
console.log('first:' + o);
createCoords();
} else {
console.log('sec:' + o);
return o;
}
};
var coords = createCoords();
console.log('third:' + coords);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment