Skip to content

This project is about a progra written in go that takes words as input and prints its word art to the console.

License

Notifications You must be signed in to change notification settings

Baraq23/ascii-art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ASCII Art Program in Go!

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 with ASCII characters.

Content

  • functions/
    • test_files/
      • standard.txt
      • start_test.go
    • formatspecialcharacters.go
    • printart.go
    • readbanner.go
    • start.go
    • validatebannerfile.go
    • validate.go
  • go.mod
  • main.go
  • readme.md
  • shadow.txt
  • standard.txt
  • thinkertoy.txt

Features

  • This project is written in go lang.
  • Handles input with ascii values between ascii values 32 to 126, include special characters suchas newline and tab.
  • Uses graphical templates such as standard banner file, shadow banner file and also thinkertoy banner file..
  • Includes test files for testing.

Usage

To run the program,follow these steps:

  • clone the program into your computer
https://barraotieno/gitea.com/ascii-art
  • Open the cloned folder with your prefered text editor among VScode and Vim.

  • In the terminal from your text editor type the following:

go run . "type string here" | cat -e
  • Hit Enter. The corresponding word art will be printed in the console.

Output

The following shows input and results when the program is run:

:~ go run . "Hello" | cat -e

 _    _          _   _          $
| |  | |        | | | |         $
| |__| |   ___  | | | |   ___   $
|  __  |  / _ \ | | | |  / _ \  $
| |  | | |  __/ | | | | | (_) | $
|_|  |_|  \___| |_| |_|  \___/  $
                                $
                                $
:~ go run . "Cold\n" | cat -e
  _____           _       _  $
 / ____|         | |     | | $
| |        ___   | |   __| | $
| |       / _ \  | |  / _` | $
| |____  | (_) | | | | (_| | $
 \_____|  \___/  |_|  \__,_| $
                             $
                             $
$

:~ go run . "Welcome" | cat -e
__          __         _                                    $
\ \        / /        | |                                   $
 \ \  /\  / /    ___  | |   ___    ___    _ __ ___     ___  $
  \ \/  \/ /    / _ \ | |  / __|  / _ \  | '_ ` _ \   / _ \ $
   \  /\  /    |  __/ | | | (__  | (_) | | | | | | | |  __/ $
    \/  \/      \___| |_|  \___|  \___/  |_| |_| |_|  \___| $
                                                            $
                                                            $

Packages

Only standard Go packages are used in this project.

How to use the program

  • Strings to be printed must be put in quotation marks.
:~ go run main.go "Hello\n"
  • The following banner formats are included:
    • shadow -sh
    • standard -st
    • thinkertoy-th
  • To use any type the banners above: specify its corresponding flag as follows: -sh, -st and -th respectively.

Examples

:~ go run main.go "Welcome" -th

o       o     o                    
|       |     |                    
o   o   o o-o |  o-o o-o o-O-o o-o 
 \ / \ /  |-' | |    | | | | | |-' 
  o   o   o-o o  o-o o-o o o o o-o 
                                   
:~ go run main.go "Golang" -sh 
                                                
  _|_|_|          _|                            
_|         _|_|   _|   _|_|_| _|_|_|     _|_|_| 
_|  _|_| _|    _| _| _|    _| _|    _| _|    _| 
_|    _| _|    _| _| _|    _| _|    _| _|    _| 
  _|_|_|   _|_|   _|   _|_|_| _|    _|   _|_|_| 
                                             _| 
                                         _|_|                           
  • Standard banner template will be automatically selected if user has not entered any flag.

Error handling

  • The program notifies if the template bannerfile is corrupted or empty. In this case the user should download a new banner template from the following links;

Collaborators

Aaron/
Barrack Otieno

Goals

  • Understanding the Go file system (fs) API.
  • Manipulating data in Go.

HOW TO CONTRIBUTE ? 👷

1. Clone this repository.

2. Clone the forked repository.

git clone https://github.com/011369/starter

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>"

Push your local branch to the remote repository.

git push -u origin <your_branch_name>

8. Create a Pull Request!

Review: At this stage, we will review PR and merge your code into our codebase after approval by our team.

Issues and Contributions

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.

About

This project is about a progra written in go that takes words as input and prints its word art to the console.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages