swordio
Version:
A medieval warrior-based programming language
14 lines (11 loc) • 341 B
JavaScript
function TangentCell(map) {
this.map = map;
}
TangentCell.type = "#";
TangentCell.prototype.encounter = function(enemy, vector) {
var sineValue = Math.tan(enemy.stack.pop());
this.map.set(enemy.x, enemy.y, String.fromCharCode(sineValue + 32));
enemy.x += vector.x;
enemy.y += vector.y;
};
module.exports = TangentCell;