Purpose of CodeFights
-
Upload
inez-harmon -
Category
Documents
-
view
39 -
download
1
description
Transcript of Purpose of CodeFights
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
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
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
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
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!