Top Banner
22

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

Dec 17, 2015

Download

Documents

Lorena Lambert
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.
Page 2: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Purpose of CodeFights

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

Page 3: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

History

Page 5: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Supported languages

• Java• PHP• C#• Javascript• More to come…

Page 6: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Basics

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

Page 7: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Attack areas and Points

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

Page 8: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

MyFighter Class

• Class must implement IFighter interface• Method makeNextMove must return Move object• Each round makeNextMove is called with

these params:• opponentsLastMove (except first round)

• myLastScore

• opponentsLastScore

Page 9: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Move API

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

Page 10: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Sample Class

Page 11: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Javascript fighter

Page 12: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

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

Page 13: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

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

Page 14: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

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

Page 15: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

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

Page 16: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

JAVA

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

Page 17: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

C#

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

Page 18: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

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

Page 19: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Javacsript & NodeJs

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

Page 20: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Try it!

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

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

• my-fighter.exe <fight_mode>

• node index.js <fight_mode>

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

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

Page 21: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.

Grab SDK and prepare fighter for tournament!

Website:codefights.net

Page 22: Purpose of CodeFights Prove that You are better developer. Testers sometime win as well… Coding can be fun too.