Crate otarustlings
source · [−]Expand description
otarustlings exercise platform. Clone of
rustlings.
The point of otarustlings is to learn Rust with hands on exercises and
small projects.
Updating & Installation
To install or update otarustlings, use:
cargo install --force otarustlingsHow to
First, initialize the exercises:
otarustlings initThis creates the folder
exerciseswith the latest exercises within.
Next, start testing the exercise you wish to solve:
otarustlings startYou can also start a specific exercise with:
otarustlings start week4
Finally, open the exercise in your favorite text editor, i.e. Emacs, and solve the exercise in the way which feels natural.
Once the exercise is compiles and passes the tests, it is marked with a
check mark ✓ in the menu. With ENTER you can select the next exercise
directly.
How to solve the exercises
The semantics of the exercises are usually written as comments. If you see a
_ in an invalid position, you need to replace it with something else. If
you see a // TODO or todo!() you are supposed to do what’s called
programming, or coding, at the comment.
Crate-like exercises, which are inside a folder, may have some additional files which you need to read or to modify in order to solve the exercise.
Don’t be afraid to search for solutions online. No real programmer could do their work without the internet and a search engine.
Subcommands
init
To create the initial exercise directory structure and write the exercises, use:
otarustlings initThe command creates a directory called exercises in the current directory.
Note:
initdoes not overwrite old exercises.
start
To start testing your changes, use:
otarustlings startThe command must be issued in the parent directory of exercises, i.e. the
same directory init was called in.
The first thing that is shown is a menu of the exercises. Using up and down arrows, one can change the selection and pressing enter will start testing it.
All changes to the file are monitored and tested. The test output is shown in the terminal.
To return to menu, press Q or ESC.
To quit otarustlings, press Q or ESC in the menu.
CTRL-Ccan also be used to exitotarustlings.
test
You can use otarustlings to directly test a particular exercise without
having to interact with it through the terminal user interface.
otarustlings test week4/B5The same path qualifier works in
starttoo.
state
NOTE: Only modify THE state if necessary!
To reset (remove) exercises/state.toml you can run:
otarustlings state resetDevelopment
otarustlings is updated each week to add new exercises.
Read the source code, star and fork the project and submit issues to the repository.
Modules
Enums
Error which composes all the crate’s errors together.
A message from the notify and input threads to the compile thread