You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
985 B

## repeatalpha
### Instructions
Write a program called `repeat_alpha` that takes a `string` and displays it
repeating each alphabetical character as many times as its alphabetical index.
5 years ago
The result must be followed by a newline (`'\n'`).
`'a'` becomes `'a'`, `'b'` becomes `'bb'`, `'e'` becomes `'eeeee'`, etc...
The case remains unchanged.
5 years ago
If the number of arguments is different from 1, the program displays a newline (`'\n'`).
### Usage
```console
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$ go build
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abc" | cat -e
abbccc
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "Alex." | cat -e
Alllllllllllleeeeexxxxxxxxxxxxxxxxxxxxxxxx.$
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "abacadaba 42!" | cat -e
abbacccaddddabba 42!$
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha | cat -e
$
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$ ./repeatalpha "" | cat -e
$
5 years ago
student@ubuntu:~/piscine-go/repeatalpha$
```