You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Adrian Malacoda 89e3d91f54 Use retry crate to retry http requests, since the hyper connection may be closed when we try to use it. 2 years ago
src Use retry crate to retry http requests, since the hyper connection may be closed when we try to use it. 2 years ago
Cargo.toml Use retry crate to retry http requests, since the hyper connection may be closed when we try to use it. 2 years ago
README.md initial commit 2 years ago

README.md

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