This is a simple command-line tool written in Go that generates ASCII art based on standard text. It reads characters from a standard text file and converts them into ASCII art representation.
- Clone Repository: Clone this repository to your local machine.
- Build Program: Ensure you have Go installed on your machine. Navigate to the directory containing the
main.go
file and run the following command to build the program:go build main.go
- Run Program: Execute the program by providing the input text as a command-line argument. For example:
This will generate ASCII art representing the word "Hello".
go run . "Hello"
- Line Breaks: You can provide a newline character (
\n
) to create a line break in the ASCII art. For example:This will generate ASCII art for "Hello" followed by a newline, and then ASCII art for "World".go run . "Hello\nWorld"
- Input Text: The program takes one argument, which is the input text for which ASCII art is to be generated. This text can contain alphanumeric characters, special characters, and newline characters (
\n
).
- main.go: Contains the main program logic, including argument parsing and reading from the standard text file.
- ascii_art.go: Contains the function for generating ASCII art based on the input text.
The ASCII art characters are stored in a standard text file named standard.txt
. Each character's representation occupies 8 lines in the file.
- Only one argument is allowed to be input by the user
- If too many or too few arguments are provided, the program will display an error message and exit.
- If there is an error reading the
standard.txt
file, the program will display an error message and exit.
- This program does not have any external dependencies.