Open eucalypto opened 3 years ago
An ASCII generator is an awesome program that can output any document, picture, or text file in 2-D using only text symbols. It is often used to print signatures for various conferences and meetings. One example of a signature is a name tag, a small piece of paper with your name printed on it. In this project, you will write an ASCII generator that can print name tags.
Let's start with generating the simplest signature. A name tag usually consists of a name and a surname. Your task is to generate a tag for someone with the first name "Hyper" and the last name "Skill". You also need the text to be bordered by straight lines across all four sides, as shown in the example.
Note that left and right borders are marked with the symbol '|'
, the top border is marked with '_'
, and the bottom border is marked with '•'
.
_____________
| Hyper Skill |
•••••••••••••
At this stage, you will write a program that reads the first and last name from the input and generates a signature with the correct size.
The name tag should contain the full first and last name with a single whitespace in between, a single whitespace at the beginning, and another at the end.
For the borders, use the asterisk symbol '*'
.
If the user inputs Albert Einstein
, the output should be:
*******************
* Albert Einstein *
*******************
If the user inputs Nikola Tesla
, the output should be:
****************
* Nikola Tesla *
****************
https://hyperskill.org/projects/71?track=3
Project files: https://github.com/eucalypto/learn/tree/main/ASCII%20Text%20Signature
From the course description: About When learning a new programming language, we always have to figure out how to print text data. It is a simple and useful skill: you can print texts everywhere, even in the console.
There is only one problem: the text itself isn’t pretty enough for your taste. What if we try to add a little “make-up”? Or get very creative with fonts, draw awesome letters with other letters?
Let’s try this out.
Learning outcomes You will learn to use the famous triad: for, while, and when, and also take a glance at functions and files.