Skip to content

umcconnell/changers

Test Lint Docs

change.rs

Make Change. In Rust.

Quickly calculate monetary change for a desired amount, all while benefitting from Rust's speed and safety.

Change.rs provides an easy-to-use CLI (command line interface) to calculate change directly from the command line. Supports ouputing to stdout for results and stderr for possible errors.

Table of Contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

Before you get started, make sure you've got rust and cargo installed on your machine. If not, installation via rustup is quick and easy. See the rust website for installation instructions: https://www.rust-lang.org/tools/install

Initial setup

First, clone the repo with git:

git clone https://github.com/umcconnell/changers.git
cd changers

Then, you can run change.rs using cargo:

cargo run <my_amount> examples/coins.txt

... or build a binary:

cargo build --release

Check out the examples folder for some example coin files you can pass.

Happy coding!

Usage

changers [amount] [optional: coin_file]

The change.rs CLI accepts two arguments to calculate change:

  • amount: The monetary amount to make change for
  • coin_file, optional: An optional coin file (see examples folder) containing a list of coins seperated by a newline. If no file is passed, coins are read from stdin.

Contributing

Please read CONTRIBUTING.md and CODE_OF_CONDUCT.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

Ulysse McConnell - umcconnell

See also the list of contributors who participated in this project.

License

Change.rs is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Acknowledgments

A huge thanks goes to the open and welcoming rust community and their great documentation effort.