This GitHub repository is your Rust programming playground, no matter your skill level! Beginners can start with easy programs to learn the ropes. Intermediate coders can tackle trickier problems to test their knowledge. And for the Rust experts, there are complex programs to push your limits. But it's more than just exercises! Share your own programs, challenge others, and learn together as a team.
So come explore the world of Rust - it's fast, safe, and lets you write awesome code! ️✨
-
Download Installer:
- 📥 Go to the Rust website: Rust Website.
- 🖱️ Click to get the installer for Windows.
-
Run Installer:
- 💻 Double-click the installer you downloaded.
- 🔄 Follow the steps shown on the screen.
- 🛠️ Rustup, Rust's tool manager, will install with Rust.
-
Using Rustup:
- 🐧 Open your terminal.
- ⌨️ Put this in the terminal and press enter:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- 📋 Follow the directions on your screen.
- 🛠️ Rustup will get Rust and take care of it for you.
-
Environment Variable:
- 🔧 You need to add rustc to your environment variables.
-
Install Cargo:
-
Compilation:
- 🖥️ Open your terminal and go to your project folder.
- 📝 Type this command, replacing
your_file.rs
with your file's name:rustc your_file.rs
- 🚀 This makes an executable file named
your_file
.
-
Execution:
- 🏃♂️ After it compiles without errors, run this in the terminal:
./your_file
- 🏃♂️ After it compiles without errors, run this in the terminal:
-
Creating a New Project:
- 🖥️ Open your terminal.
- 📝 Type this to make a new Rust project:
cargo new my_project
- 📂 This creates a new folder called
my_project
with stuff inside.
-
Navigating to Your Project:
- 🚶♂️ Go into your project folder:
cd my_project
- 🚶♂️ Go into your project folder:
-
Writing Code:
- ✍️ Use a text editor to open
src/main.rs
. - 📝 Write your Rust code here.
- ✍️ Use a text editor to open
-
Running Your Project:
- 🏃♂️ Type this to build and run your Rust project:
cargo run
- 🚚 Cargo handles everything for you, like getting what your project needs and running it.
- 🏃♂️ Type this to build and run your Rust project: