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

domakas/nodeSDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Test repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published