gcj-helper 0.2.0

A helper library for Google Code Jam solutions.
Documentation

gcj-helper

Travis AppVeyor Crates.io Docs.rs

gcj-helper is a Rust library for writing Google Code Jam solutions. It handles the boilerplate so you can focus on writing solutions instead.

Example

extern crate gcj_helper;

use gcj_helper::TestEngine;
use std::io::Write;

fn main() {
    TestEngine::new("./foo.in", "./foo.out").run(|io_helper| {
        let line = io_helper.read_line();
        writeln!(io_helper, " {}", line).unwrap();
    });
}

Usage

Via cargo new --template

For brand-new crates, the quickest way to get started is to use the following command:

cargo new --template https://github.com/FaultyRAM/gcj-template-rust.git foobar

This creates a new binary crate named foobar that is set up to use gcj-helper. No additional work is needed; just open src/main.rs and start writing your solution.

By hand

You can also manually add gcj-helper to your crate, though doing so is slower than using cargo new --template. To do this, add the following line to your [dependencies] in Cargo.toml:

gcj-helper = "0.1"

And add the following line to your crate root:

extern crate gcj_helper;

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.