Skip to content

Instantly share code, notes, and snippets.

@egcodes
Last active February 15, 2018 17:32
Show Gist options
  • Save egcodes/6f2a15e40e86ee7aa9ddc5943afe43fa to your computer and use it in GitHub Desktop.
Save egcodes/6f2a15e40e86ee7aa9ddc5943afe43fa to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
"strconv"
"strings"
)
func main() {
printBanner()
}
func printBanner() {
chCodes := []int{
0, 0, 0, 0, 0, 0,
12, 18, 33, 63, 33, 33,
62, 32, 62, 33, 33, 62,
30, 33, 32, 32, 33, 30,
62, 33, 33, 33, 33, 62,
63, 32, 62, 32, 32, 63,
63, 32, 62, 32, 32, 32,
30, 33, 32, 39, 33, 30,
33, 33, 63, 33, 33, 33,
4, 4, 4, 4, 4, 4,
1, 1, 1, 1, 33, 30,
33, 34, 60, 36, 34, 33,
32, 32, 32, 32, 32, 63,
33, 51, 45, 33, 33, 33,
33, 49, 41, 37, 35, 33,
30, 33, 33, 33, 33, 30,
62, 33, 33, 62, 32, 32,
30, 33, 33, 37, 34, 29,
62, 33, 33, 62, 34, 33,
30, 32, 30, 1, 33, 30,
31, 4, 4, 4, 4, 4,
33, 33, 33, 33, 33, 30,
33, 33, 33, 33, 18, 12,
33, 33, 33, 45, 51, 33,
33, 18, 12, 12, 18, 33,
17, 10, 4, 4, 4, 4,
63, 2, 4, 8, 16, 63}
if len(os.Args) < 2 {
fmt.Println("Enter a text")
return
}
if _, err := strconv.Atoi(os.Args[1]); err == nil {
fmt.Println("Only text")
return
}
entry := strings.ToUpper(os.Args[1])
for j := 0; j < 6; j++ {
for i := 0; len(entry) > i; i++ {
chTemp := chCodes[int(rune(entry[i])-rune('A'))*6+6+j]
for count := 6; count > 0; count-- {
chTemp = chTemp << 1
if (64 & chTemp) > 0 {
fmt.Printf("#")
} else {
fmt.Printf(" ")
}
}
fmt.Printf("\t")
}
fmt.Printf("\n")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment