____ ___ __
/ __ \____ _________ _/ (_)___ ____/ /
/ /_/ / __ \/ ___/ __ `/ / / __ \/ __ /
/ _, _/ /_/ (__ ) /_/ / / / / / / /_/ /
/_/ |_|\____/____/\__,_/_/_/_/ /_/\__,_/
This project aims to solve Rosalind's problems and package them in a command-line interface (CLI) format.
rosalind-cli/
├── Cargo.toml
├── scripts/
├── src/
│ ├── main.rs
│ ├── lib.rs
│ └── problems/
│ ├── mod.rs
│ ├── prob1/
| | ├── mod.rs
| | ├── args.rs
| | ├── solve.rs
│ ├── prob2/
│ └── ...
└── README.md
-
solve.rs: It contains the code to solve the problems. -
mod.rs: It connects the args and solve modules to the problem folder, organizing internal references and making them accessible to the parent module. -
args.rs: It defines the command-line arguments specific to the problem, usually usingclapto parse and validate user inputs.
To make it easier to create new problems while maintaining the project's structure, the add_problems.rs script was designed. It checks the name of the problem to be created and automatically creates the (blank) files in the folder with the name of the problem.
Usage:
rustc scripts/add_problem.rs -o add_problem #check the path!
./add_problem PROB
Result:
src/problems/PROB/
├── args.rs
├── mod.rs
└── solve.rs