From 38c9ac36413d77fe844b97dc16603df1c619af38 Mon Sep 17 00:00:00 2001 From: miguel Date: Thu, 18 Jan 2024 16:33:02 +0000 Subject: [PATCH] fix(Checkpoints): add the mains for the exams exercises to work in the code editor --- subjects/printnbrbase/main.go | 20 ++++++++++++++++++++ subjects/splitwhitespaces/main.go | 10 ++++++++++ subjects/swap/main.go | 14 ++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 subjects/printnbrbase/main.go create mode 100644 subjects/splitwhitespaces/main.go create mode 100644 subjects/swap/main.go diff --git a/subjects/printnbrbase/main.go b/subjects/printnbrbase/main.go new file mode 100644 index 00000000..30d633b5 --- /dev/null +++ b/subjects/printnbrbase/main.go @@ -0,0 +1,20 @@ +package main + +import ( + "piscine" + + "github.com/01-edu/z01" +) + +func main() { + piscine.PrintNbrBase(125, "0123456789") + z01.PrintRune('\n') + piscine.PrintNbrBase(-125, "01") + z01.PrintRune('\n') + piscine.PrintNbrBase(125, "0123456789ABCDEF") + z01.PrintRune('\n') + piscine.PrintNbrBase(-125, "choumi") + z01.PrintRune('\n') + piscine.PrintNbrBase(125, "aa") + z01.PrintRune('\n') +} diff --git a/subjects/splitwhitespaces/main.go b/subjects/splitwhitespaces/main.go new file mode 100644 index 00000000..c5dcff6d --- /dev/null +++ b/subjects/splitwhitespaces/main.go @@ -0,0 +1,10 @@ +package main + +import ( + "fmt" + "piscine" +) + +func main() { + fmt.Printf("%#v\n", piscine.SplitWhiteSpaces("Hello how are you?")) +} diff --git a/subjects/swap/main.go b/subjects/swap/main.go new file mode 100644 index 00000000..3818de53 --- /dev/null +++ b/subjects/swap/main.go @@ -0,0 +1,14 @@ +package main + +import ( + "fmt" + "piscine" +) + +func main() { + a := 0 + b := 1 + piscine.Swap(&a, &b) + fmt.Println(a) + fmt.Println(b) +}