mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-09 20:29:18 +00:00
fix: worked on intro and variables
This commit is contained in:
parent
f2de12aa34
commit
593780df6b
@ -9,7 +9,6 @@
|
|||||||
// when you change one of the lines below! Try adding a `println!` line, or try changing
|
// when you change one of the lines below! Try adding a `println!` line, or try changing
|
||||||
// what it outputs in your terminal. Try removing a semicolon and see what happens!
|
// what it outputs in your terminal. Try removing a semicolon and see what happens!
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello and");
|
println!("Hello and");
|
||||||
|
|||||||
@ -2,8 +2,7 @@
|
|||||||
// Make the code print a greeting to the world.
|
// Make the code print a greeting to the world.
|
||||||
// Execute `rustlings hint intro2` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint intro2` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello {}!");
|
println!("Hello World!");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,7 @@
|
|||||||
// Make me compile!
|
// Make me compile!
|
||||||
// Execute `rustlings hint variables1` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables1` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
x = 5;
|
let x = 5;
|
||||||
println!("x has the value {}", x);
|
println!("x has the value {}", x);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
// variables2.rs
|
// variables2.rs
|
||||||
// Execute `rustlings hint variables2` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables2` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x;
|
let x :u32;
|
||||||
|
let x = 10;
|
||||||
if x == 10 {
|
if x == 10 {
|
||||||
println!("x is ten!");
|
println!("x is ten!");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
// variables3.rs
|
// variables3.rs
|
||||||
// Execute `rustlings hint variables3` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables3` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: i32;
|
let x: i32;
|
||||||
|
let x = 10;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
// variables4.rs
|
// variables4.rs
|
||||||
// Execute `rustlings hint variables4` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables4` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = 3;
|
let mut x = 3;
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
x = 5; // don't change this line
|
x = 5; // don't change this line
|
||||||
println!("Number {}", x);
|
println!("Number {}", x);
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
// variables5.rs
|
// variables5.rs
|
||||||
// Execute `rustlings hint variables5` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables5` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let number = "T-H-R-E-E"; // don't change this line
|
let number = "T-H-R-E-E"; // don't change this line
|
||||||
println!("Spell a Number : {}", number);
|
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);
|
println!("Number plus two is : {}", number + 2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
// variables6.rs
|
// variables6.rs
|
||||||
// Execute `rustlings hint variables6` or use the `hint` watch subcommand for a hint.
|
// Execute `rustlings hint variables6` or use the `hint` watch subcommand for a hint.
|
||||||
|
|
||||||
// I AM NOT DONE
|
const NUMBER: i32 = 3;
|
||||||
|
|
||||||
const NUMBER = 3;
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Number {}", NUMBER);
|
println!("Number {}", NUMBER);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user