Skip to content

marceelrf/rosalind-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

    ____                   ___           __  
   / __ \____  _________ _/ (_)___  ____/ /  
  / /_/ / __ \/ ___/ __ `/ / / __ \/ __  /   
 / _, _/ /_/ (__  ) /_/ / / / / / / /_/ /    
/_/ |_|\____/____/\__,_/_/_/_/ /_/\__,_/   

This project aims to solve Rosalind's problems and package them in a command-line interface (CLI) format.

Repo structure

rosalind-cli/  
├── Cargo.toml           
├── scripts/  
├── src/  
│   ├── main.rs           
│   ├── lib.rs          
│   └── problems/       
│       ├── mod.rs      
│       ├── prob1/  
|       |    ├── mod.rs  
|       |    ├── args.rs  
|       |    ├── solve.rs    
│       ├── prob2/     
│       └── ...         
└── README.md

Structure of problem solving

  • 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 using clap to parse and validate user inputs.

Automatic problem structure generator

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  

Problems solved

Get in touch

Gmail  LinkedIn  Github 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages