corewars is both an executable binary that can be run, and a library that can be used in Rust programs.
Installing the command-line executable
Assuming you have Rust/Cargo installed , run this command in a terminal:
cargo install corewars
It will make the corewars command available in your PATH if you've allowed the PATH to be modified when installing Rust . cargo uninstall corewars uninstalls.
Adding corewars library as a dependency
Run this command in a terminal, in your project's directory:
cargo add corewars
To add it manually, edit your project's Cargo.toml file and add to the [dependencies] section:
corewars = "0.2.0"
The corewars library will be automatically available globally.
Read the corewars library documentation .
Back to the crate overview .
Readme
corewars
A CLI interface for playing the classic programming battle game
Core Wars .
See the website or the Github repo for more details.
Usage
Parse, assemble, and save Redcode files
USAGE:
corewars <input-file> <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
ARGS:
<input-file> Input file; use "-" to read from stdin
SUBCOMMANDS:
dump Save/print a program in "load file" format
help Prints this message or the help of the given subcommand(s)
dump Usage
Save/print a program in "load file" format
USAGE:
corewars <input-file> dump [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
-E, --no-expand Whether labels, expressions, macros, etc. should be resolved and expanded in the output
-V, --version Prints version information
OPTIONS:
-o, --output-file <output-file> Output file; defaults to stdout ("-") [default: -]