Skip to content

Releases: mohammadzainabbas/rust-from-dust

🎲 Rustic Riddles: Guessing Games 🎉💻

13 Jan 16:15
Compare
Choose a tag to compare

Guessing Games

Rust Badge Rust Report Card MIT License

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.

Note

Below mentioned video on YouTube was used as a starting point for this project.
Programming a Guessing Game in Rust!

Key Concepts

  • Create new binary project using cargo new guessing-game
  • Use of external libraries rand, colored and dialoguer
  • 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.

  1. 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
  1. 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! ✨

09 Jan 03:22
Compare
Choose a tag to compare

Hello World (with Cargo)

Rust Badge Rust Report Card MIT License

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

  1. 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.

  1. 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