File tree Expand file tree Collapse file tree 5 files changed +54
-6
lines changed Expand file tree Collapse file tree 5 files changed +54
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Intro
2
+
3
+ Rust uses the ` print! ` and ` println! ` macros to print text to the console.
4
+
5
+ ## Further information
6
+
7
+ - [ Hello World] ( https://doc.rust-lang.org/rust-by-example/hello.html )
8
+ - [ Formatted print] ( https://doc.rust-lang.org/rust-by-example/hello/print.html )
Original file line number Diff line number Diff line change
1
+ // intro1.rs
2
+ // About this `I AM NOT DONE` thing:
3
+ // We sometimes encourage you to keep trying things on a given exercise, even
4
+ // after you already figured it out. If you got everything working and feel
5
+ // ready for the next exercise, remove the `I AM NOT DONE` comment below.
6
+ // Execute the command `rustlings hint intro1` for a hint.
7
+
8
+ // I AM NOT DONE
9
+
10
+ fn main ( ) {
11
+ println ! ( "Hello and" ) ;
12
+ println ! ( r#" welcome to... "# ) ;
13
+ println ! ( r#" _ _ _ "# ) ;
14
+ println ! ( r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "# ) ;
15
+ println ! ( r#" | '__| | | / __| __| | | '_ \ / _` / __| "# ) ;
16
+ println ! ( r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "# ) ;
17
+ println ! ( r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "# ) ;
18
+ println ! ( r#" |___/ "# ) ;
19
+ }
Original file line number Diff line number Diff line change
1
+ // intro2.rs
2
+ // Make the code print a greeting to the world.
3
+ // Execute `rustlings hint intro2` for a hint.
4
+
5
+ // I AM NOT DONE
6
+
7
+ fn main ( ) {
8
+ println ! ( "Hello {}!" ) ;
9
+ }
Original file line number Diff line number Diff line change 1
1
// variables1.rs
2
- // Make me compile! Execute the command `rustlings hint variables1` if you want a hint :)
3
-
4
- // About this `I AM NOT DONE` thing:
5
- // We sometimes encourage you to keep trying things on a given exercise,
6
- // even after you already figured it out. If you got everything working and
7
- // feel ready for the next exercise, remove the `I AM NOT DONE` comment below.
2
+ // Make me compile!
3
+ // Execute the command `rustlings hint variables1` if you want a hint :)
8
4
9
5
// I AM NOT DONE
10
6
Original file line number Diff line number Diff line change
1
+ # INTRO
2
+
3
+ [[exercises ]]
4
+ name = " intro1"
5
+ path = " exercises/intro/intro1.rs"
6
+ mode = " compile"
7
+ hint = """
8
+ Remove the I AM NOT DONE comment to move on to the next exercise."""
9
+
10
+ [[exercises ]]
11
+ name = " intro2"
12
+ path = " exercises/intro/intro2.rs"
13
+ mode = " compile"
14
+ hint = """
15
+ Add an argument after the format string."""
16
+
1
17
# VARIABLES
2
18
3
19
[[exercises ]]
You can’t perform that action at this time.
0 commit comments