diff options
-rw-r--r-- | exercises/arrays/arrays1/main.go | 18 | ||||
-rw-r--r-- | info.toml | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/exercises/arrays/arrays1/main.go b/exercises/arrays/arrays1/main.go new file mode 100644 index 0000000..2782058 --- /dev/null +++ b/exercises/arrays/arrays1/main.go @@ -0,0 +1,18 @@ +// arrays1 +// Make me compile! + +// I AM NOT DONE +package main + +import "fmt" + +func main() { + var colors [3]string + + colors[0] = "red" + colors[1] = "green" + colors[2] = "blue" + + fmt.Printf("First color is %s:\n", colors[]) + fmt.Printf("Last color is %s:\n", colors[]) +} @@ -125,3 +125,10 @@ path = "exercises/primitive_types/primitive_types4/main.go" mode = "compile" hint = """ byte can hold from 0 to 255. Could it store a character?""" + +[[exercises]] +name = "arrays1" +path = "exercises/arrays/arrays1/main.go" +mode = "compile" +hint = """ +Arrays are zero-based indexing.""" |