summaryrefslogtreecommitdiff
path: root/info.toml
diff options
context:
space:
mode:
authorTorben Jonas <TorbenJ@users.noreply.github.com>2020-01-14 21:06:43 +0100
committerTorben Jonas <TorbenJ@users.noreply.github.com>2020-01-14 21:10:07 +0100
commit0c73609e6f2311295e95d6f96f8c747cfc4cba03 (patch)
tree07178cb70d801334aaedc6164b17b17ab6619913 /info.toml
parent19a93428b3c73d994292671f829bdc8e5b7b3401 (diff)
feat: Add variables5.rs exercise
closes #260
Diffstat (limited to 'info.toml')
-rw-r--r--info.toml14
1 files changed, 14 insertions, 0 deletions
diff --git a/info.toml b/info.toml
index 3ca1824..2e6b0b4 100644
--- a/info.toml
+++ b/info.toml
@@ -41,6 +41,20 @@ value. We can't print out something that isn't there; try giving x a value!
This is an error that can cause bugs that's very easy to make in any
programming language -- thankfully the Rust compiler has caught this for us!"""
+[[exercises]]
+name = "variables5"
+path = "exercises/variables/variables5.rs"
+mode = "compile"
+hint = """
+In variables3 we already learned how to make an immutable variable mutable
+using a special keyword. Unfortunately this doesn't help us much in this exercise
+because we want to assign a different typed value to an existing variable. Sometimes
+you may also like to reuse existing variable names because you are just converting
+values to different types like in this exercise.
+Fortunately Rust has a powerful solution to this problem: 'Shadowing'!
+You can read more about 'Shadowing' in the book's section 'Variables and Mutability'.
+Try to solve this exercise afterwards using this technique."""
+
# IF
[[exercises]]