Browse Source

Adding of a new exercise printreversealphabetalt.

The goal: printing the alphabet alternatively in lowercase and in uppercase from z to A, and then from a to Z.
pull/686/head
Christopher Fremond 4 years ago committed by xpetit
parent
commit
82b019d320
  1. 8
      go/tests/prog/printreversealphabetalt_prog/main.go
  2. 9
      go/tests/prog/printreversealphabetalt_test/main.go
  3. 22
      subjects/printreversealphabetalt/README.md

8
go/tests/prog/printreversealphabetalt_prog/main.go

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

9
go/tests/prog/printreversealphabetalt_test/main.go

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

22
subjects/printreversealphabetalt/README.md

@ -0,0 +1,22 @@
## printreversealphabetalt
### Instructions
Write a program that:
- first prints the Latin alphabet alternatively in lowercase and uppercase in reverse order (from `'z'` to `'A'`) on a single line.
- second prints the Latin alphabet alternatively in lowercase and uppercase in order (from `'a'` to `'Z'`) on a single line.
A line is a sequence of characters preceding the [end of line](https://en.wikipedia.org/wiki/Newline) character (`'\n'`).
Please note that `casting` is not allowed for this exercise!
### Usage
```console
student@ubuntu:~/[[ROOT]]/printreversealphabetalt$ go build
student@ubuntu:~/[[ROOT]]/printreversealphabetalt$ ./printreversealphabetalt
zYxWvUtSrQpOnMlKjIhGfEdCbA
aBcDeFgHiJkLmNoPqRsTuVwXyZ
student@ubuntu:~/[[ROOT]]/printreversealphabetalt$
```
Loading…
Cancel
Save