From 5515d2a78db3c53faeff4d6f875377734ec582e3 Mon Sep 17 00:00:00 2001 From: MaurĂ­cio Antunes Date: Sat, 19 Nov 2022 17:14:31 -0300 Subject: feat: add more primitive types exercises --- exercises/primitive_types/primitive_types2/main.go | 11 ++++++++ exercises/primitive_types/primitive_types3/main.go | 11 ++++++++ exercises/primitive_types/primitive_types4/main.go | 15 +++++++++++ info.toml | 29 ++++++++++++++++------ 4 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 exercises/primitive_types/primitive_types2/main.go create mode 100644 exercises/primitive_types/primitive_types3/main.go create mode 100644 exercises/primitive_types/primitive_types4/main.go diff --git a/exercises/primitive_types/primitive_types2/main.go b/exercises/primitive_types/primitive_types2/main.go new file mode 100644 index 0000000..3350a4b --- /dev/null +++ b/exercises/primitive_types/primitive_types2/main.go @@ -0,0 +1,11 @@ +// primitive_types2 +// Make me compile! + +// I AM NOT DONE +package main + +import "fmt" + +func main() { + fmt.Printf("Hello, %s\n", who) // '%s' is used to format strings +} diff --git a/exercises/primitive_types/primitive_types3/main.go b/exercises/primitive_types/primitive_types3/main.go new file mode 100644 index 0000000..e73b5e4 --- /dev/null +++ b/exercises/primitive_types/primitive_types3/main.go @@ -0,0 +1,11 @@ +// primitive_types3 +// Make me compile! + +// I AM NOT DONE +package main + +import "fmt" + +func main() { + fmt.Printf("Hello, %s\n", who) +} diff --git a/exercises/primitive_types/primitive_types4/main.go b/exercises/primitive_types/primitive_types4/main.go new file mode 100644 index 0000000..a4180ca --- /dev/null +++ b/exercises/primitive_types/primitive_types4/main.go @@ -0,0 +1,15 @@ +// primitive_types3 +// Make me compile! + +// I AM NOT DONE +package main + +import "fmt" + +func main() { + var b1 byte = 110 + fmt.Println("byte value for b1:", b1) + + var b2 byte = '' + fmt.Println("representation for b2:", b2) +} diff --git a/info.toml b/info.toml index d8c9de6..fe87134 100644 --- a/info.toml +++ b/info.toml @@ -73,15 +73,13 @@ Functions that return values must have return types declared in the function sig name = "if1" path = "exercises/if/if1/main_test.go" mode = "test" -hint = """ -""" +hint = "No hints this time" [[exercises]] name = "if2" path = "exercises/if/if2/main_test.go" mode = "test" -hint = """ -""" +hint = "No hints this time" [[exercises]] name = "switch1" @@ -101,12 +99,29 @@ Switch without a condition is possible, but that case statement needs a boolean name = "switch3" path = "exercises/switch/switch3/main_test.go" mode = "test" -hint = """ -""" +hint = "No hints this time" [[exercises]] name = "primitive_types1" path = "exercises/primitive_types/primitive_types1/main.go" mode = "compile" +hint = "No hints this time" + +[[exercises]] +name = "primitive_types2" +path = "exercises/primitive_types/primitive_types2/main.go" +mode = "compile" +hint = "No hints this time" + +[[exercises]] +name = "primitive_types3" +path = "exercises/primitive_types/primitive_types3/main.go" +mode = "compile" +hint = "'%s' is used to format strings" + +[[exercises]] +name = "primitive_types4" +path = "exercises/primitive_types/primitive_types4/main.go" +mode = "compile" hint = """ -""" +byte can hold from 0 to 255. Could it store a character?""" -- cgit v1.2.3-70-g09d2