Browse Source

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.
content-update
Christopher Fremond 4 years ago committed by xpetit
parent
commit
942668979a
  1. 8
      go/tests/prog/printalphabetalt2_prog/main.go
  2. 9
      go/tests/prog/printalphabetalt2_test/main.go
  3. 20
      subjects/printalphabetalt2/README.md

8
go/tests/prog/printalphabetalt2_prog/main.go

@ -0,0 +1,8 @@
package main
import "fmt"
func main() {
fmt.Println("AbCdEfGhIjKlMnOpQrStUvWxYz")
fmt.Println("ZyXwVuTsRqPoNmLkJiHgFeDcBa")
}

9
go/tests/prog/printalphabetalt2_test/main.go

@ -0,0 +1,9 @@
package main
import (
"lib"
)
func main() {
lib.ChallengeMain("printalphabetalt2")
}

20
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$
```
Loading…
Cancel
Save