diff options
| author | apogeeoak <59737221+apogeeoak@users.noreply.github.com> | 2021-04-24 13:15:34 -0400 |
|---|---|---|
| committer | apogeeoak <59737221+apogeeoak@users.noreply.github.com> | 2021-04-24 13:15:34 -0400 |
| commit | 21c9f44168394e08338fd470b5f49b1fd235986f (patch) | |
| tree | 922b1c5a1cb7a8842d50398f8a26d38c31d12e86 /exercises/intro | |
| parent | 6b6dc9dd48ed0f97be02263ee45267af361fd029 (diff) | |
feat(intro): Add intro section.
Diffstat (limited to 'exercises/intro')
| -rw-r--r-- | exercises/intro/README.md | 8 | ||||
| -rw-r--r-- | exercises/intro/intro1.rs | 19 | ||||
| -rw-r--r-- | exercises/intro/intro2.rs | 9 |
3 files changed, 36 insertions, 0 deletions
diff --git a/exercises/intro/README.md b/exercises/intro/README.md new file mode 100644 index 0000000..d32e4a8 --- /dev/null +++ b/exercises/intro/README.md @@ -0,0 +1,8 @@ +# Intro + +Rust uses the `print!` and `println!` macros to print text to the console. + +## Further information + +- [Hello World](https://doc.rust-lang.org/rust-by-example/hello.html) +- [Formatted print](https://doc.rust-lang.org/rust-by-example/hello/print.html) diff --git a/exercises/intro/intro1.rs b/exercises/intro/intro1.rs new file mode 100644 index 0000000..83a78e6 --- /dev/null +++ b/exercises/intro/intro1.rs @@ -0,0 +1,19 @@ +// intro1.rs +// About this `I AM NOT DONE` thing: +// We sometimes encourage you to keep trying things on a given exercise, even +// after you already figured it out. If you got everything working and feel +// ready for the next exercise, remove the `I AM NOT DONE` comment below. +// Execute the command `rustlings hint intro1` for a hint. + +// I AM NOT DONE + +fn main() { + println!("Hello and"); + println!(r#" welcome to... "#); + println!(r#" _ _ _ "#); + println!(r#" _ __ _ _ ___| |_| (_)_ __ __ _ ___ "#); + println!(r#" | '__| | | / __| __| | | '_ \ / _` / __| "#); + println!(r#" | | | |_| \__ \ |_| | | | | | (_| \__ \ "#); + println!(r#" |_| \__,_|___/\__|_|_|_| |_|\__, |___/ "#); + println!(r#" |___/ "#); +} diff --git a/exercises/intro/intro2.rs b/exercises/intro/intro2.rs new file mode 100644 index 0000000..97a073f --- /dev/null +++ b/exercises/intro/intro2.rs @@ -0,0 +1,9 @@ +// intro2.rs +// Make the code print a greeting to the world. +// Execute `rustlings hint intro2` for a hint. + +// I AM NOT DONE + +fn main() { + println!("Hello {}!"); +} |
