Releases: mohammadzainabbas/rust-from-dust
🎲 Rustic Riddles: Guessing Games 🎉💻
Guessing Games
Overview
A Rust program to play two guessing games:
Guess the number
and
Guess the word
- built via Cargo
: a Rust’s build system and package manager.
Key Concepts
- Create new binary project using
cargo new guessing-game
- Use of external libraries
rand
,colored
anddialoguer
- Check program without running
cargo check
- Fix issues with program without running
cargo fix
- Build & run the project using
cargo run
Prerequisites
Important
Make sure you have Rust
(stable, with cargo) installed on your system. If not, follow the instructions here.
Quick Start
Note
Follow below mentioned steps to run the project on your local machine.
- Clone the repository and navigate to
guessing-game
directory:
git clone https://github.com/mohammadzainabbas/rust-from-dust.git
cd rust-from-dust/guessing-game
or
gh repo clone mohammadzainabbas/rust-from-dust
cd rust-from-dust/guessing-game
- Run the project using
cargo run
:
cargo run
Tip
Run cargo run --help
or cargo help run
to see detailed options of cargo run
command.
You should see the following output:
Finished dev [unoptimized + debuginfo] target(s) in 0.08s
Running `target/debug/guessing-game`
Let's play some guessing games
? Do you want to continue? (y/n) › yes
And you are good to go! 🎉 Enjoy the games.
Full Changelog: v1.0...v2.0
🚀 Hello, Cargo! ✨
Hello World (with Cargo)
Overview
A tutorial for
Hello World!
based program built via Cargo
: a Rust’s build system and package manager.
Tip
This tutorial is based on Rust Book and Rust By Example.
Key Concepts
- Create new binary project using
cargo new hello-world
- Build & run the project using
cargo run
Prerequisites
Rust
(stable, with cargo installed)
Quick Start
Setup
- Create a new binary project using
cargo new hello-world
:
cargo new hello-world
or
cargo new hello-world --bin
Note
By default, cargo new
creates a binary (application) template. You can use --bin
flag to explicitly specify it.
- Build & run the project using
cargo run
:
cd hello-world
cargo run
Tip
Run cargo run --help
or cargo help run
to see detailed options of cargo run
command.
You should see the following output:
Finished dev [unoptimized + debuginfo] target(s) in 0.04s
Running `target/debug/hello-world`
Hello, world!
Important
cargo run
compiles/builds the code and then run the resultant executable all in one command.
Full Changelog: https://github.com/mohammadzainabbas/rust-from-dust/commits/v1.0