primitive_types done

This commit is contained in:
stephan.klauberg 2023-10-06 07:21:46 +02:00
parent e8961a89de
commit 78a4f7215e
3 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@
// Execute `rustlings hint primitive_types1` or use the `hint` watch subcommand // Execute `rustlings hint primitive_types1` or use the `hint` watch subcommand
// for a hint. // for a hint.
// I AM NOT DONE // I AM DONE
fn main() { fn main() {
// Booleans (`bool`) // Booleans (`bool`)
@ -16,7 +16,7 @@ fn main() {
println!("Good morning!"); println!("Good morning!");
} }
let // Finish the rest of this line like the example! Or make it be false! let is_evening= true;// Finish the rest of this line like the example! Or make it be false!
if is_evening { if is_evening {
println!("Good evening!"); println!("Good evening!");
} }

View File

@ -6,7 +6,7 @@
// Execute `rustlings hint primitive_types2` or use the `hint` watch subcommand // Execute `rustlings hint primitive_types2` or use the `hint` watch subcommand
// for a hint. // for a hint.
// I AM NOT DONE // I AM DONE
fn main() { fn main() {
// Characters (`char`) // Characters (`char`)
@ -22,7 +22,7 @@ fn main() {
println!("Neither alphabetic nor numeric!"); println!("Neither alphabetic nor numeric!");
} }
let // Finish this line like the example! What's your favorite character? let your_character='@';// Finish this line like the example! What's your favorite character?
// Try a letter, try a number, try a special character, try a character // Try a letter, try a number, try a special character, try a character
// from a different language than your own, try an emoji! // from a different language than your own, try an emoji!
if your_character.is_alphabetic() { if your_character.is_alphabetic() {

View File

@ -2,14 +2,14 @@
// //
// Create an array with at least 100 elements in it where the ??? is. // Create an array with at least 100 elements in it where the ??? is.
// //
// Execute `rustlings hint primitive_types3` or use the `hint` watch subcommand // Execute `r'ustlings hint primitive_types3` or use the `hint` watch subcommand
// for a hint. // for a hint.
// I AM NOT DONE // I AM DONE
fn main() { fn main() {
let a = ??? let a = ['?';101];
if a.len() >= 100 { if a.len() >= 100 {
println!("Wow, that's a big array!"); println!("Wow, that's a big array!");
} else { } else {