Skip to content

codefights/node-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeFights SDK for NodeJS

Instalation: npm install codefights.net [-g]

Sample bot:

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

function MyFighter() {

  this.makeNextMove = function(opponentsLastMove, myLastScore, opponentsLastScore) {
    // Do stuff 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

Packages

No packages published

Languages

  • JavaScript 100.0%