Purpose of CodeFights

22

description

Purpose of CodeFights. Prove that You are better developer. Testers sometime win as well… Coding can be fun too. History. History. Core. Fight engine – java Web application backend – php Front end – bootsrap. Supported languages. Java PHP C# More to come…. Work in progress. - PowerPoint PPT Presentation

Transcript of Purpose of CodeFights

Purpose of CodeFights

• Prove that You are better developer.• Testers sometime win as well…• Coding can be fun too.

History

Supported languages

• Java• PHP• C#• Javascript (Node.js)• Python• More to come…

Basics

• Single Fighter Class• 3 actions per Move (Round)• Attacking / Blocking• Order doesn’t matter• 150 hit points

Attack areas and Points

• Area::NOSE – 10 pts• Area::JAW – 8 pts• Area::BELLY – 6 pts• Area::GROIN– 4 pts• Area::LEGS – 3 pts

MyFighter Class

• Class must be implemented according to example in SDK• Method makeNextMove must return Move object• Each round makeNextMove is called

with these params:• opponentsLastMove (except first round)

• myLastScore

• opponentsLastScore

Move API

• addAttack(AREA::X)• addBlock(AREA::X)• getAtacks()• getBlocks()

Sample Class

Node.js fighter

Points calculation (1)

Attack Nose

Attack Groin

Block Legs

+10 pt +4 pt

14 pt0 pt

Block Groin

Attack Legs

Attack Legs

0 pt +3 pt

6 pt+3 pt

Points calculation (1)

Attack Nose

Attack Groin

Block Legs

+10 pt +4 pt

10 pt0 pt

Block Groin

Attack Legs

Attack Legs

0 pt +3 pt

0 pt+3 pt

Points calculation (2)

Attack Groin

Attack Groin

Block Nose

+4 pt +4 pt

8 pt0 pt

Attack Nose

Attack Jaw

Attack Belly

+10 pt +8 pt

24 pt+6 pt

Points calculation (2)

Attack Groin

Attack Groin

Block Nose

+4 pt +4 pt

8 pt0 pt

Attack Nose

Attack Jaw

Attack Belly

0 pt +8 pt

14 pt+6 pt

JAVA

• Requirements: JDK 1.7• Simply execute build.bat or build.sh

C#

• Requirements: runs on mono 3.2• Build sdk’s project exe

PHP

• Requirements: PHP 5.4• CLI php.ini has phar.readonly flag set to

false• Command line: php box.phar build• Or simply execute build.bat or build.sh

Node.js

• Requirements: Node.js 0.10.x.• Install Node.js package:• npm install codefights.net [-g] 

Python

• Requirements: Python 2.7• Install Python package:• pip install codefights

• easy_install codefights

Try it!

• Command line• php my-fighter.phar <fight_mode>

• java –jar my-fighter.jar <fight_mode>

• my-fighter.exe <fight_mode>

• node my-fighter.js <fight_mode>

• python my-fighter.py <fight_mode>

• Fight manually (--fight-me)• Fight against sample bots Kickboxer and

Boxer (--fight-bot <bot_name>)• Enroll Your fighter to tournament!

Grab SDK and prepare fighter for tournament!

Website:codefights.net