200 likes | 338 Views
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.
E N D
Purpose of CodeFights • Prove that You are better developer. • Testers sometime win as well… • Coding can be fun too.
Core • Fight engine – java • Web application backend – php • Front end – bootsrap
Supported languages • Java • PHP • C# • More to come…
Work in progress • Additional security layer • REST • AngularJs web app • Mobile client
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 implement IFighter interface • Method makeNextMove must return object of instance Move • Each round makeNextMove is called with these params: • opponentsLastMove (except first round) • myLastScore • opponentsLastScore
Move API • addAttack(AREA::X) • addBlock(AREA::X) • getAtacks() • getBlocks()
Points calculation • 1st round. • Challenger: • Opponent: • Calculation • Challenger: Nose (+), Groin (-). Total: 10 • Opponent: Groin (+), Legs (-), Legs (-). Total: 4
Points calculation • 2nd round. • Challenger: • Opponent: • Calculation • Challenger: Groin (+), Groin (+). Total: 4 + 4 = 8 • Opponent: Nose (-), Jaw (+), Belly (+). Total: 8 + 6 = 14
Build (PHP) • Requirements: PHP 5.4 • CLI php.ini has phar.readonly flag set to false • Command line: phpbox.phar build • Or simply execute build.bat or build.sh
Build (JAVA) • Requirements: JDK 1.7 • Simply execute build.bat or build.sh
Try it! • Command line • php my-fighter.phar<fight_mode> • java –jar my-fighter.jar <fight_mode> • Fight manually (--fight-me) • Fight against sample bots Kickboxer and Boxer (--fight-bot <bot_name>) • Enroll Your fighter to tournament!