From 6b678e08163c6fab38465cdba522d13edffc80e3 Mon Sep 17 00:00:00 2001 From: Christopher Fremond Date: Fri, 6 Nov 2020 02:53:56 +0000 Subject: [PATCH] Adding of a new exercise printalphabetalt. The goal: printing the alphabet alternatively in lowercase and in uppercase from a to Z, and then from z to A. --- go/tests/prog/printalphabetalt_prog/main.go | 8 ++++++++ go/tests/prog/printalphabetalt_test/main.go | 9 +++++++++ subjects/printalphabetalt/README.md | 20 ++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 go/tests/prog/printalphabetalt_prog/main.go create mode 100644 go/tests/prog/printalphabetalt_test/main.go create mode 100644 subjects/printalphabetalt/README.md diff --git a/go/tests/prog/printalphabetalt_prog/main.go b/go/tests/prog/printalphabetalt_prog/main.go new file mode 100644 index 000000000..5d2fc0c96 --- /dev/null +++ b/go/tests/prog/printalphabetalt_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/printalphabetalt_test/main.go b/go/tests/prog/printalphabetalt_test/main.go new file mode 100644 index 000000000..3f0c6890f --- /dev/null +++ b/go/tests/prog/printalphabetalt_test/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "lib" +) + +func main() { + lib.ChallengeMain("printalphabetalt") +} diff --git a/subjects/printalphabetalt/README.md b/subjects/printalphabetalt/README.md new file mode 100644 index 000000000..2f18a828a --- /dev/null +++ b/subjects/printalphabetalt/README.md @@ -0,0 +1,20 @@ +## printalphabetalt + +### Instructions + +Write a program that: + +- first prints the Latin alphabet alternatively in lowercase and uppercase in order (from `'a'` to `'Z'`) on a single line. +- second prints the Latin alphabet alternatively in lowercase and uppercase 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]]/printalphabetalt$ go build +student@ubuntu:~/[[ROOT]]/printalphabetalt$ ./printalphabetalt +aBcDeFgHiJkLmNoPqRsTuVwXyZ +zYxWvUtSrQpOnMlKjIhGfEdCbA +student@ubuntu:~/[[ROOT]]/printalphabetalt$ +```