mirror of
https://github.com/notohh/rustlings.git
synced 2025-10-08 11:38:39 -04:00
First quiz and its related modules
This commit is contained in:
parent
36e66b545e
commit
52ed5dbcf9
22 changed files with 60 additions and 98 deletions
|
@ -2,9 +2,7 @@
|
|||
// Make me compile!
|
||||
// Execute `rustlings hint variables1` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
x = 5;
|
||||
let x = 5;
|
||||
println!("x has the value {}", x);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
// variables2.rs
|
||||
// Execute `rustlings hint variables2` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let x;
|
||||
let x = 12;
|
||||
if x == 10 {
|
||||
println!("x is ten!");
|
||||
} else {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
// variables3.rs
|
||||
// Execute `rustlings hint variables3` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let x: i32;
|
||||
let x: i32 = 12;
|
||||
println!("Number {}", x);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
// variables4.rs
|
||||
// Execute `rustlings hint variables4` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let x = 3;
|
||||
let mut x = 3;
|
||||
println!("Number {}", x);
|
||||
x = 5; // don't change this line
|
||||
println!("Number {}", x);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
// variables5.rs
|
||||
// Execute `rustlings hint variables5` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
fn main() {
|
||||
let number = "T-H-R-E-E"; // don't change this line
|
||||
println!("Spell a Number : {}", number);
|
||||
number = 3; // don't rename this variable
|
||||
let number = 3; // don't rename this variable
|
||||
println!("Number plus two is : {}", number + 2);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
// variables6.rs
|
||||
// Execute `rustlings hint variables6` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
const NUMBER = 3;
|
||||
const NUMBER: i32 = 3;
|
||||
fn main() {
|
||||
println!("Number {}", NUMBER);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue