No description
Find a file
2017-03-12 15:49:16 -05:00
src Use retry crate to retry http requests, since the hyper connection may be closed when we try to use it. 2017-03-12 15:49:16 -05:00
Cargo.toml Use retry crate to retry http requests, since the hyper connection may be closed when we try to use it. 2017-03-12 15:49:16 -05:00
README.md initial commit 2017-02-18 23:34:41 -06:00

Pirate vs Ninja Client Library

This is a client for Pirate vs Ninja written in Rust. It can be used standalone or as a library.

Usage

Command Line

cargo run <pirate_name> <ninja_name>

Example

malacoda@kraken:~/Projects/pvn$ cargo run Pie "Windows 98"
    Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
    Running `target/debug/pvn Pie Windows\ 98`
Pirate { name: "Captain Pie", swashbuckling: 19, drunkenness: 9, booty: 15, weapons: ["Cannon", "Broken Bottle", "Belaying Pin"] } => 46
Ninja { name: "Ninja Master Windows 98", sneakiness: 9, pajamas: 15, pointy_things: 19, weapons: ["Poison Dart", "Thousand Blossom Finger", "Death Touch"] } => 46
It's a tie!

Library

The library provides the Pirates and Ninjas types, which each keep a cache of Pirate and Ninja objects. Given a Pirates object, you can call pirates.get(&str) to obtain a reference to the Pirate with the given name. Or, you can create a Pirate or Ninja by passing in HTML to Pirate::from_html(&str).

Example

See src/main.rs