mirror of https://github.com/01-edu/public.git
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.
120 lines
3.7 KiB
120 lines
3.7 KiB
5 years ago
|
## ascii-art
|
||
|
|
||
|
### Objectives
|
||
|
|
||
5 years ago
|
Ascii-art consists on receiving a `string` as an argument and outputting the `string` in a graphic representation of ASCII.
|
||
5 years ago
|
|
||
5 years ago
|
- This project should handle numbers, letters, spaces, special characters and `\n`.
|
||
5 years ago
|
- Take a look at the ASCII manual.
|
||
5 years ago
|
|
||
5 years ago
|
This project will help you learn about :
|
||
|
|
||
5 years ago
|
- Client utilities.
|
||
|
- The Go file system(**fs**) API.
|
||
|
- Ways to receive data.
|
||
|
- Ways to output data.
|
||
|
- Manipulation of strings.
|
||
5 years ago
|
- Manipulation of structures.
|
||
|
|
||
|
### Instructions
|
||
|
|
||
5 years ago
|
- Your project must be written in **Go**.
|
||
5 years ago
|
- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en).
|
||
5 years ago
|
- It is recommended that the code present a **test file**.
|
||
5 years ago
|
|
||
5 years ago
|
- It will be given some [**banner**](https://github.com/01-edu/public/blob/master/subjects/ascii-art) files with a specific graphical template representation of ASCII. The files are formatted in a way that it is not necessary to change them.
|
||
5 years ago
|
|
||
|
### Banner Format
|
||
|
|
||
5 years ago
|
- Each character has an height of 8 lines.
|
||
5 years ago
|
- Characters are separated by a new line `\n`.
|
||
5 years ago
|
- Here is an example of ' ', '!' and '"'(one dot represents one space) :
|
||
5 years ago
|
|
||
|
```console
|
||
|
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
|
||
|
._..
|
||
|
|.|.
|
||
|
|.|.
|
||
|
|.|.
|
||
|
|_|.
|
||
|
(_).
|
||
|
....
|
||
|
....
|
||
|
|
||
|
._._..
|
||
|
(.|.).
|
||
|
.V.V..
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
......
|
||
|
|
||
|
etc
|
||
|
```
|
||
5 years ago
|
|
||
5 years ago
|
### Allowed packages
|
||
|
|
||
|
- Only the [standard go](https://golang.org/pkg/) packages are allowed
|
||
|
|
||
5 years ago
|
### Usage
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/ascii-art$ go build
|
||
|
student@ubuntu:~/ascii-art$ ./ascii-art "hello"
|
||
5 years ago
|
_ _ _
|
||
|
| | | | | |
|
||
|
| |__ ___ | | | | ___
|
||
|
| _ \ / _ \ | | | | / _ \
|
||
|
| | | | | __/ | | | | | (_) |
|
||
|
|_| |_| \___| |_| |_| \___/
|
||
|
|
||
|
|
||
5 years ago
|
student@ubuntu:~/ascii-art$ ./ascii-art "HeLlO"
|
||
5 years ago
|
_ _ _ _ ____
|
||
|
| | | | | | | | / __ \
|
||
|
| |__| | ___ | | | | | | | |
|
||
|
| __ | / _ \ | | | | | | | |
|
||
|
| | | | | __/ | |____ | | | |__| |
|
||
|
|_| |_| \___| |______| |_| \____/
|
||
|
|
||
|
|
||
5 years ago
|
student@ubuntu:~/ascii-art$ ./ascii-art "Hello There"
|
||
5 years ago
|
_ _ _ _ _______ _
|
||
|
| | | | | | | | |__ __| | |
|
||
|
| |__| | ___ | | | | ___ | | | |__ ___ _ __ ___
|
||
|
| __ | / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \
|
||
|
| | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/
|
||
|
|_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___|
|
||
|
|
||
|
|
||
5 years ago
|
student@ubuntu:~/ascii-art$ ./ascii-art "1Hello 2There"
|
||
5 years ago
|
_ _ _ _ _______ _
|
||
|
_ | | | | | | | | ____ |__ __| | |
|
||
|
/ | | |__| | ___ | | | | ___ |___ \ | | | |__ ___ _ __ ___
|
||
|
| | | __ | / _ \ | | | | / _ \ __) | | | | _ \ / _ \ | '__| / _ \
|
||
|
| | | | | | | __/ | | | | | (_) | / __/ | | | | | | | __/ | | | __/
|
||
|
|_| |_| |_| \___| |_| |_| \___/ |_____| |_| |_| |_| \___| |_| \___|
|
||
|
|
||
|
|
||
5 years ago
|
student@ubuntu:~/ascii-art$ ./ascii-art "{Hello There}"
|
||
5 years ago
|
__ _ _ _ _ _______ _ __
|
||
|
/ / | | | | | | | | |__ __| | | \ \
|
||
|
| | | |__| | ___ | | | | ___ | | | |__ ___ _ __ ___ | |
|
||
|
/ / | __ | / _ \ | | | | / _ \ | | | _ \ / _ \ | '__| / _ \ \ \
|
||
|
\ \ | | | | | __/ | | | | | (_) | | | | | | | | __/ | | | __/ / /
|
||
|
| | |_| |_| \___| |_| |_| \___/ |_| |_| |_| \___| |_| \___| | |
|
||
|
\_\ /_/
|
||
|
|
||
5 years ago
|
student@ubuntu:~/ascii-art$
|
||
|
```
|