summaryrefslogtreecommitdiff
path: root/functions/functions3.rs
diff options
context:
space:
mode:
authorCarol (Nichols || Goulding) <carol.nichols@gmail.com>2015-09-17 21:12:00 -0400
committerCarol (Nichols || Goulding) <carol.nichols@gmail.com>2015-09-17 21:12:00 -0400
commit6324eeafe74867011d901f8e0c4ff74c0311771a (patch)
tree6c46a403d4ad3b3276ee1bdd63e3f52677aeeb50 /functions/functions3.rs
parentdbfab88e610746118b8a0c26340fb677b70e9e75 (diff)
Add some exercises about functions!
Diffstat (limited to 'functions/functions3.rs')
-rw-r--r--functions/functions3.rs41
1 files changed, 41 insertions, 0 deletions
diff --git a/functions/functions3.rs b/functions/functions3.rs
new file mode 100644
index 0000000..3dba67c
--- /dev/null
+++ b/functions/functions3.rs
@@ -0,0 +1,41 @@
+// Make me compile! Scroll down for hints :)
+
+fn main() {
+ call_me();
+}
+
+fn call_me(num: i32) {
+ for i in 0..num {
+ println!("Ring! Call number {}", i + 1);
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// This time, the function *declaration* is okay, but there's something wrong
+// with the place where we're calling the function.