This project is an ASCII art program implemented in Go. It takes a string as input and outputs a graphic representation of the string using ASCII characters. The output resembles the input string but with ASCII characters.
- support flags that represent banner files
- Handles input with numbers, letters, spaces and newlines.
- Supports various graphical templates using ASCII characters.
- Written in Go with adherence to good practices.
- Includes test files for unit testing.
- The program does not handle cases where special characters (ASCII values 0-32) are part of the input string. Instead, it returns an error message. -Additionally, non-ASCII characters (values greater than 128) are not within the scope of your program, and they also generate an error message when encountered in the inpu
- implemented different error handling messages based on the missing elements in the input: the case of [STRING] [BANNER] depending on the missing element
If the [BANNER] is missing, the program displays the following usage message:
Usage: go run . [OPTION] [STRING] [BANNER]
Example: go run . --output=banner.txt something standard
Exit Status Zero:
The program uses exit status zero when the program terminates. This allows us to print custom error messages in the terminal. By doing so, we can easily trace the origin of any errors during debugging.
User-Friendly Experience:
The approach ensures a user-friendly environment by providing clear instructions on how to proceed.
The concise and informative error messages guide users toward correct usage.
The ASCII banner files included in the project have specific graphical representations formatted in ASCII. Each character has a height of 8 lines, and characters are separated by a newline (\n) character.
The following banner formats are included:
shadow
standard
thinkertoy
matrix
Additional banner files are applicable so long as they meet the conditions of the available banners i.e each character occupies 8 lines and has a total of 855 lines. The user can add their own banner file with a txt extension (if it meets the above requirements) and specify the banner name appriately i.e go run . [string] [banner name]
Ascii-art-fs requires go v 1.22.2 to run
Once go is installed clone into this repository to do this
- Open terminal and run
git clone https://learn.zone01kisumu.ke/git/krodgers/fs
cd ascii-art-fs
Once you are in the directory,
To run the program, use the following command, on the terminal command line:
go run . "<your_string>" "banner"
For example:
go run . "Hello" standard
To print ascii art in standard font
go run . "<your string>" thinkertoy
for thinkertoy font. and,
go run . "<your string>" shadow
for shadow font.
Here are some example outputs generated by the program:
The standard font
$ cat -e banner.txt
_ _ _ _
| | | | | | | |
| |__| | ___ | | | | ___
| __ | / _ \ | | | | / _ \
| | | | | __/ | | | | | (_) |
|_| |_| \___| |_| |_| \___/
in thinkertoy font
o o o
| | |
O--o o-o | | o-o
| | |-' | | | |
o o o-o o o o-o
in shadow font
_| _| _|
_|_|_| _|_| _| _| _|_|
_| _| _|_|_|_| _| _| _| _|
_| _| _| _| _| _| _|
_| _| _|_|_| _| _| _|_|
Only standard Go packages are used in this project.
1. Fork this repository.
2. Clone the forked repository.
git clone https://github.com/skanenje/ascii-art-output
3. Navigate to the project directory.
cd ascii-art-output
4. MAKE A NEW FOLDER WITH YOUR PROJECT NAME INSIDE
5. Also Add a README file in your project folder which consists of Description/screenshots about your project !
6. Create a new branch.
git checkout -b <your_branch_name>
7. Add & Commit your changes.
git add .
git commit -m "<your_commit_message>"
7. Push your local branch to the remote repository.
git push -u origin <your_branch_name>
8. Create a Pull Request!
Congratulations! Sit and relax till we review your PR, you've made your contribution to (https://github.com/skanenje/ascii-art-output) project
If you encounter any issues or have suggestions for improvements, feel free to submit an issue or propose a change.
Feel free to explore the codebase, run the program with different inputs, and contribute to enhancing the project. Happy coding experience!
skanenje |
krodgers |