From c8752481246c485f265c33501bf6d56d79bfbe21 Mon Sep 17 00:00:00 2001 From: OGordoo Date: Fri, 25 Jun 2021 18:19:49 +0100 Subject: [PATCH] ascii-art Renewed --- subjects/ascii-art/README.md | 44 ++++++++++++++++++++-------- subjects/ascii-art/color/README.md | 25 +++++++--------- subjects/ascii-art/fs/README.md | 15 ++++------ subjects/ascii-art/justify/README.md | 28 +++++++++++------- subjects/ascii-art/output/README.md | 17 +++++------ subjects/ascii-art/reverse/README.md | 20 +++++-------- 6 files changed, 80 insertions(+), 69 deletions(-) diff --git a/subjects/ascii-art/README.md b/subjects/ascii-art/README.md index 34696297..5d875d45 100644 --- a/subjects/ascii-art/README.md +++ b/subjects/ascii-art/README.md @@ -2,26 +2,40 @@ ### Objectives -Ascii-art consists on receiving a `string` as an argument and outputting the `string` in a graphic representation of ASCII. - -- This project should handle numbers, letters, spaces, special characters and `\n`. +Ascii-art is a program which consists on receiving a `string` as an argument and outputting the `string` in a graphic representation using ASCII. Time to write big. + +What we mean by a graphic representation using ASCII is to write the `string` received using ASCII characters as you can see in the example below: + +```````````console +@@@@@@BB@@@@``^^``^^``@@BB$$@@BB$$ +@@%%$$$$^^^^WW&&8888&&^^""BBBB@@@@ +@@@@@@""WW8888&&WW888888WW``@@@@$$ +BB$$``&&&&WWWW8888&&&&8888&&``@@@@ +$$``&&WW88&&88&&&&8888&&88WW88``$$ +@@""&&&&&&&&88888888&&&&&&88&&``$$ +``````^^``^^^^^^````""^^``^^``^^`` +""WW^^@@@@^^``````^^BB@@^^``^^&&`` +^^&&^^@@````^^``&&``@@````^^^^&&`` +``WW&&^^""``^^WW&&&&""``^^^^&&88`` +^^8888&&&&&&WW88&&88WW&&&&88&&WW`` +@@``&&88888888WW&&WW88&&88WW88^^$$ +@@""88&&&&&&&&888888&&``^^&&88``$$ +@@@@^^&&&&&&""``^^^^^^8888&&^^@@@@ +@@@@@@^^888888&&88&&&&MM88^^BB$$$$ +@@@@@@BB````&&&&&&&&88""``BB@@BB$$ +$$@@$$$$$$$$``````````@@$$@@$$$$$$ +``````````` + +- This project should handle an input with numbers, letters, spaces, special characters and `\n`. - Take a look at the ASCII manual. -This project will help you learn about : - -- The Go file system(**fs**) API. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Manipulation of structures. - ### Instructions - Your project must be written in **Go**. - The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices/). - It is recommended that the code present a **test file**. -- 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. +- It will be given some [**banner**](https://github.com/01-edu/public/blob/master/subjects/ascii-art) files (.txt files) with a specific graphical template representation using ASCII. The files are formatted in a way that it is not necessary to change them. ### Banner Format @@ -58,7 +72,6 @@ This project will help you learn about : ...... ...... -etc ``` ### Allowed packages @@ -115,3 +128,8 @@ $ go run . "{Hello There}" $ ``` + +This project will help you learn about : + +- The Go file system(**fs**) API +- Data manipulation diff --git a/subjects/ascii-art/color/README.md b/subjects/ascii-art/color/README.md index e929ff05..e537aab8 100644 --- a/subjects/ascii-art/color/README.md +++ b/subjects/ascii-art/color/README.md @@ -2,25 +2,13 @@ ### Objectives -You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject but with colors. +You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject but this time with colors. + +The output should manipulate colors using the **flag** `--color=`, in which `--color` is the flag and `` is the color desired by the user. These colors can be achieved using different notations (color code systems, like `RGB`, `hsl`, `ANSI`...), its up to you to choose which one you want to use. -- The output should manipulate colors using the **flag** `--color=`, in which `--color` is the flag and `` is the color - desired by the user. -- The colors can be done using different notations (color code systems, like `RGB`, `hsl`, `ANSI`, ...), its up to you to - choose which one you want to use. - You should be able to specify a single or a set of letters you want to be colored (use your imagination for this one). - If the letter isn't specified, the whole `string` should be colored. -This project will help you learn about : - -- The Go file system(**fs**) API. -- Color converters. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Manipulation of colors on the terminal. -- Manipulation of structures. - ### Instructions - Your project must be written in **Go**. @@ -30,3 +18,10 @@ This project will help you learn about : ### Allowed packages - Only the [standard go](https://golang.org/pkg/) packages are allowed + +This project will help you learn about : + +- The Go file system(**fs**) API +- Color converters +- Data manipulation +- Terminal display diff --git a/subjects/ascii-art/fs/README.md b/subjects/ascii-art/fs/README.md index 9fafef05..a49c4cd7 100644 --- a/subjects/ascii-art/fs/README.md +++ b/subjects/ascii-art/fs/README.md @@ -2,15 +2,7 @@ ### Objectives -You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject but the second argument must be the name of the template. - -This project will help you learn about : - -- The Go file system(**fs**) API. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Manipulation of structures. +You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject but the second argument must be the name of the template. I know some templates may be hard to read, just don't obsess about it. Please. ### Instructions @@ -58,3 +50,8 @@ o o o-o o o o-o o o o o-o o o-o $ ``` + +This project will help you learn about : + +- The Go file system(**fs**) API +- Data manipulation diff --git a/subjects/ascii-art/justify/README.md b/subjects/ascii-art/justify/README.md index 3b6cb656..da8ce356 100644 --- a/subjects/ascii-art/justify/README.md +++ b/subjects/ascii-art/justify/README.md @@ -2,7 +2,15 @@ ### Objectives -You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/ascii-art.en) as in the first subject but the representation should be formatted using a **flag** `--align=`, in which `type` can be : +You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art) as in the first subject but the alignment can be changed. + +```console +We + will + explain! +``` + +To change the alignment of the output it must be possible to use a **flag** `--align=`, in which `type` can be : - center - left @@ -11,18 +19,10 @@ You must follow the same [instructions](https://public.01-edu.org/subjects/ascii - You must adapt your representation to the terminal size. If you reduce the terminal window the graphical representation should be adapted to the terminal size. -This project will help you learn about : - -- The Go file system(**fs**) API. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Manipulation of structures. - ### Instructions - Your project must be written in **Go**. -- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices.en). +- The code must respect the [**good practices**](https://public.01-edu.org/subjects/good-practices). - It is recommended that the code should present a **test file**. ### Allowed packages @@ -31,6 +31,8 @@ This project will help you learn about : ### Usage +Assume the bars in the display below are the terminal borders: + ```console |$ go run . "hello" standard --align=center | | _ _ _ | @@ -70,3 +72,9 @@ This project will help you learn about : | _|_| | |$ | ``` + +This project will help you learn about : + +- The Go file system(**fs**) API +- Data manipulation +- Terminal display diff --git a/subjects/ascii-art/output/README.md b/subjects/ascii-art/output/README.md index 68afb1a6..cd5df987 100644 --- a/subjects/ascii-art/output/README.md +++ b/subjects/ascii-art/output/README.md @@ -2,17 +2,9 @@ ### Objectives -- You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject **while** writing the result into a file. +- You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject **while** writing the result into a file. Yep, you will read from one file and write to another. -- The file must be named by using the flag `--output=`, in which `--output` is the flag and `` is the file name. - -This project will help you learn about : - -- The Go file system(**fs**) API. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Choices of outputs. +The file must be named by using the flag `--output=`, in which `--output` is the flag and `` is the file name which will contain the output. ### Instructions @@ -51,3 +43,8 @@ _| _| _|_|_| _| _| _|_| _| _| _| _|_|_| _| _ $ ``` + +This project will help you learn about : + +- The Go file system(**fs**) API +- Data manipulation diff --git a/subjects/ascii-art/reverse/README.md b/subjects/ascii-art/reverse/README.md index e46ebdc3..812e1c5f 100644 --- a/subjects/ascii-art/reverse/README.md +++ b/subjects/ascii-art/reverse/README.md @@ -2,20 +2,11 @@ ### Objectives -You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject. +You must follow the same [instructions](https://public.01-edu.org/subjects/ascii-art/) as in the first subject but this time the process will be reversed. desrever fo dnik siht toN -- Ascii-reverse consists on reversing the process, converting the graphic representation into a text. -- You will have to create a text file containing a graphic representation of a random `string`. -- The argument will be a **flag**, `--reverse=`, in which `--reverse` is the flag and `` is the file name. -- The program must print this `string` in **normal text**. +Ascii-reverse consists on reversing the process, converting the graphic representation into a text. You will have to create a text file containing a graphic representation of a random `string` given as an argument. -This project will help you learn about : - -- The Go file system(**fs**) API. -- Ways to receive data. -- Ways to output data. -- Manipulation of strings. -- Manipulation of structures. +The argument will be a **flag**, `--reverse=`, in which `--reverse` is the flag and `` is the file name. The program must then print this `string` in **normal text**. ### Instructions @@ -44,3 +35,8 @@ $ go run . --reverse=file.txt hello $ ``` + +This project will help you learn about : + +- The Go file system(**fs**) API +- Data manipulation