Skip to content

Instantly share code, notes, and snippets.

@bgerstle
bgerstle / jswarrior
Created October 5, 2013 16:05
Beat JS Warrior!
var extensions = {
low_hp: 9,
check_actions: {
'enemy': 'attack',
'diamond': 'collect'
},
check_and_act: function (direction) {
var status = this.check(direction);
if(this.check_actions.hasOwnProperty(status)) {
var method = this.check_actions[status];