Skip to content

karodgers/ascii-art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text to ASCII Art

Go-Logo_Blue-removebg-preview(2)

Overview

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.

Content

  • main.go

  • printart.go

  • readbyline.go

  • readtxtfile.go

  • validate.go

  • handlers_test.go

  • shadow.txt

  • standard.txt

  • thinktoy.txt

Features

  • 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.

Limitations and Error Handling

  • Our program does not handle cases where special characters (0-32) are part of the input string, instead it returns an error message.
  • Also non-ascii characters (>128) are not included in the scope of this program they also generate error message when found in the input.

Banner Formats

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

How to Install

Ascii-art 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://github.com/skanenje/ascii-art
cd ascii-art

Usage

Once you are in the directory,

To run the program, use the following command, on the terminal command line:

the ascii art representation is by default printed in the standard font.

go run . "<your_string>"

For example:

go run . "Hello\\nthere"

To print ascii art from different font file, we have utilised flags to use them

go run . "<your string>" -th

for thinkertoy font. and,

go run . "<your string>" -sh

for shadow font.

Example Outputs

Here are some example outputs generated by the program:

The default format

 _    _          _   _          
| |  | |        | | | |         
| |__| |   ___  | | | |   ___   
|  __  |  / _ \ | | | |  / _ \  
| |  | | |  __/ | | | | | (_) | 
|_|  |_|  \___| |_| |_|  \___/  
                                 
                                       

in thinkertoy font

o        o o     
|        | |     
O--o o-o | | o-o 
|  | |-' | | | | 
o  o o-o o o o-o 
                 

in shadow font

_|                _| _|          
_|_|_|     _|_|   _| _|   _|_|   
_|    _| _|_|_|_| _| _| _|    _| 
_|    _| _|       _| _| _|    _| 
_|    _|   _|_|_| _| _|   _|_|   
                                

Allowed Packages

Only standard Go packages are used in this project.

HOW TO CONTRIBUTE ? 👷

1. Fork this repository.

2. Clone the forked repository.

git clone https://github.com/skanenje/ascii-art

3. Navigate to the project directory.

cd ascii-art

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) project

Issues and Contributions

If you encounter any issues or have suggestions for improvements, feel free to submit an issue or propose a change.

Enjoy ASCII Art in Go!

Feel free to explore the codebase, run the program with different inputs, and contribute to enhancing the project. Happy coding experience!

Contributors

Aaron/
skanenje
Emmanuel/
krodgers
Abraham/
svictor

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages