Skip to content

A small framework for solvers for Facebook Hackercup

Notifications You must be signed in to change notification settings

vladmos/hackercup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hackercup solver framework

A simple framework which can make writing solvers to Facebook Hackercup problems a bit easier.

How to use

To add a solver for a problem you should:

  • Create a python file problemname.py somewhere in the problems directory with the following functions: solver and fetcher. The fetcher should have one input argument: an iterator of input file strings, it should read as many strings as required for one task for given problem, preformat it and return all the data needed. The solver gets the fetcher's output as input argument and should return the answer as a string or any object that can be formatted to a string.
  • Create a text file input_problemname.txt in the input directory as taken from the Hackercup problem site.
  • Run python runner.py problemname (it is possible to enter problemname in the command prompt).
  • See the result at output/output_problemname.txt

Notes

The problemname string in the text above is an identifier to a task and should match for a solver and a corresponding input file.

A fetcher function should not read more strings than it is required: iterators are not reversible.

Packing

To make a zip package containing all necessary scripts to solve the problem, launch python packager.py problemname. The package will be put in the packages directory.

About

A small framework for solvers for Facebook Hackercup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages