aboutsummaryrefslogtreecommitdiffstats
path: root/exercises/functions
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-08-09 15:33:56 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-08-09 15:33:56 -0500
commit7a5f1e0c9d30749c325d61f1c9771ba4f1a68750 (patch)
treef3458e7a150e9b38618594e5bd89891f1cf6b5fe /exercises/functions
parentb3890a15b255760865f1601779ed280e3737e935 (diff)
feat: complete functions and variablesHEADmain
Diffstat (limited to 'exercises/functions')
-rw-r--r--exercises/functions/functions1/main.go5
-rw-r--r--exercises/functions/functions2/main.go3
-rw-r--r--exercises/functions/functions3/main.go3
-rw-r--r--exercises/functions/functions4/main.go3
4 files changed, 7 insertions, 7 deletions
diff --git a/exercises/functions/functions1/main.go b/exercises/functions/functions1/main.go
index 9ad8e8a..cf47e93 100644
--- a/exercises/functions/functions1/main.go
+++ b/exercises/functions/functions1/main.go
@@ -1,9 +1,12 @@
// functions1
// Make me compile!
-// I AM NOT DONE
package main
func main() {
call_me()
}
+
+func call_me() {
+
+}
diff --git a/exercises/functions/functions2/main.go b/exercises/functions/functions2/main.go
index a8ab96e..39915b5 100644
--- a/exercises/functions/functions2/main.go
+++ b/exercises/functions/functions2/main.go
@@ -1,7 +1,6 @@
// functions2
// Make me compile!
-// I AM NOT DONE
package main
import "fmt"
@@ -10,7 +9,7 @@ func main() {
callMe(10)
}
-func callMe(num) {
+func callMe(num int) {
for n := 0; n <= num; n++ {
fmt.Printf("Num is %d\n", n)
}
diff --git a/exercises/functions/functions3/main.go b/exercises/functions/functions3/main.go
index 5559841..69301b0 100644
--- a/exercises/functions/functions3/main.go
+++ b/exercises/functions/functions3/main.go
@@ -1,13 +1,12 @@
// functions3
// Make me compile!
-// I AM NOT DONE
package main
import "fmt"
func main() {
- call_me()
+ call_me(5)
}
func call_me(num int) {
diff --git a/exercises/functions/functions4/main.go b/exercises/functions/functions4/main.go
index 2931b93..87ca90a 100644
--- a/exercises/functions/functions4/main.go
+++ b/exercises/functions/functions4/main.go
@@ -1,7 +1,6 @@
// functions4
// Make me compile!
-// I AM NOT DONE
package main
import "fmt"
@@ -10,6 +9,6 @@ func main() {
fmt.Println("1 + 2 is: ", addNumbers(1, 2)) // don't change this line
}
-func addNumbers(a int, b int) {
+func addNumbers(a int, b int) int {
return a + b
}