generated from HaQadosch/RustBook
Initial commit
This commit is contained in:
BIN
Projects/01_HelloWorld/main
Executable file
BIN
Projects/01_HelloWorld/main
Executable file
Binary file not shown.
3
Projects/01_HelloWorld/main.rs
Normal file
3
Projects/01_HelloWorld/main.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, World!");
|
||||
}
|
8
Projects/guessing_game/Cargo.toml
Normal file
8
Projects/guessing_game/Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "guessing_game"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["HaQadosch Berraka <haqadosc+rusth@pm.me>"]
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
14
Projects/guessing_game/src/main.rs
Normal file
14
Projects/guessing_game/src/main.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use std::io;
|
||||
|
||||
fn main() {
|
||||
println!("Guess the number:");
|
||||
println!("Please enter your guess");
|
||||
|
||||
let mut guess = String::new(); // Creates a mutable variable as empty string.
|
||||
|
||||
io::stdin()
|
||||
.read_line(&mut guess)
|
||||
.expect("Failed to read line");
|
||||
|
||||
println!("You guessed: {guess}");
|
||||
}
|
13
Projects/hello_cargo/Cargo.toml
Normal file
13
Projects/hello_cargo/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "hello_cargo"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
authors = ["HaQadosch Berraka <haqadosch+rust@pm.me>"]
|
||||
description = "displays hello world"
|
||||
documentation = "./docs/ref.org"
|
||||
readme = "./docs/readme.org"
|
||||
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
3
Projects/hello_cargo/src/main.rs
Normal file
3
Projects/hello_cargo/src/main.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
Reference in New Issue
Block a user