The shortest ascii-art program I could create.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
lines := strings.Split(strings.ReplaceAll(os.Args[1], "\\n", "\n"), "\n")
|
|
|
|
for ; lines[len(lines)-1] == ""; lines = lines[:len(lines)-1] {
|
|
|
|
defer os.Stdout.WriteString("\n")
|
|
|
|
}
|
|
|
|
bytes, _ := os.ReadFile("standard.txt")
|
|
|
|
alphabet := strings.Split(strings.ReplaceAll(string(bytes), "\r\n", "\n"), "\n")
|
|
|
|
for _, line := range lines {
|
|
|
|
for i := 1; i < 9; i++ {
|
|
|
|
for _, char := range line {
|
|
|
|
os.Stdout.WriteString(alphabet[(char-32)*9+rune(i)])
|
|
|
|
}
|
|
|
|
os.Stdout.WriteString("\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|