From 942668979a13962f7a861ac75f85f72ad31dc1e1 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Fri, 6 Nov 2020 02:55:20 +0000 Subject: [PATCH] Adding of a new exercise printalphabetalt2. The goal: printing the alphabet alternatively in uppercase and in lowercase from A to z, and then from Z to a. --- go/tests/prog/printalphabetalt2_prog/main.go | 8 ++++++++ go/tests/prog/printalphabetalt2_test/main.go | 9 +++++++++ subjects/printalphabetalt2/README.md | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 go/tests/prog/printalphabetalt2_prog/main.go create mode 100644 go/tests/prog/printalphabetalt2_test/main.go create mode 100644 subjects/printalphabetalt2/README.md diff --git a/go/tests/prog/printalphabetalt2_prog/main.go b/go/tests/prog/printalphabetalt2_prog/main.go new file mode 100644 index 00000000..e5bea2b5 --- /dev/null +++ b/go/tests/prog/printalphabetalt2_prog/main.go @@ -0,0 +1,8 @@ +package main + +import "fmt" + +func main() { + fmt.Println("AbCdEfGhIjKlMnOpQrStUvWxYz") + fmt.Println("ZyXwVuTsRqPoNmLkJiHgFeDcBa") +} diff --git a/go/tests/prog/printalphabetalt2_test/main.go b/go/tests/prog/printalphabetalt2_test/main.go new file mode 100644 index 00000000..b786bd40 --- /dev/null +++ b/go/tests/prog/printalphabetalt2_test/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "lib" +) + +func main() { + lib.ChallengeMain("printalphabetalt2") +} diff --git a/subjects/printalphabetalt2/README.md b/subjects/printalphabetalt2/README.md new file mode 100644 index 00000000..8f9d238d --- /dev/null +++ b/subjects/printalphabetalt2/README.md @@ -0,0 +1,20 @@ +## printalphabetalt2 + +### Instructions + +Write a program that: + +- first prints the Latin alphabet alternatively in uppercase and lowercase in order (from `'A'` to `'z'`) on a single line. +- second prints the Latin alphabet alternatively in uppercase and lowercase in reverse order (from `'Z'` to `'a'`) on a single line. + +A line is a sequence of characters preceding the [end of line](https://en.wikipedia.org/wiki/Newline) character (`'\n'`). + +### Usage + +```console +student@ubuntu:~/[[ROOT]]/printalphabetalt2$ go build +student@ubuntu:~/[[ROOT]]/printalphabetalt2$ ./printalphabetalt2 +AbCdEfGhIjKlMnOpQrStUvWxYz +ZyXwVuTsRqPoNmLkJiHgFeDcBa +student@ubuntu:~/[[ROOT]]/printalphabetalt2$ +```