Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Files

Latest commit

8493531 · Aug 27, 2014

History

History
41 lines (30 loc) · 832 Bytes

README.md

File metadata and controls

41 lines (30 loc) · 832 Bytes

CodeFights SDK for NodeJS

Instalation: npm install domakas-codefights [-g]

Sample bot:

var CodeFights = require('domakas-codefights');
var Area = CodeFights.Area;
var Move = CodeFights.Move;
var SDK = CodeFights.SDK;

function MyFighter() {
  // Do stuff here
}

MyFighter.prototype.makeNextMove = function(opponentsLastMove, myLastScore, opponentsLastScore) {
  // Or here
  var move = new Move();

  move.addAttack(Area.NOSE)
      .addAttack(Area.JAW)
      .addBlock(Area.NOSE);

  return move;
};

module.exports = MyFighter;

// Do not delete these lines
var sdk = new SDK(MyFighter);
sdk.run(process.argv);

To manually fight your bot: node MyFighter.js --fight-me

To fight boxer bot: node MyFighter.js --fight-bot boxer

To fight kickboxer bot: node MyFighter.js --fight-bot kickboxer