art.go 400 B

12345678910111213141516171819202122232425
  1. package main
  2. import (
  3. _ "embed"
  4. "log"
  5. "red-green/door"
  6. "strings"
  7. )
  8. //go:embed growl.ans
  9. var growl string
  10. func ANSIGrowl() []string {
  11. data := strings.Split(growl, "\n")
  12. if !door.Unicode && !door.CP437 {
  13. log.Panicf("Call after door.Init() so Unicode/CP437 has been set.")
  14. }
  15. if door.Unicode {
  16. for idx := range data {
  17. data[idx] = door.CP437_to_Unicode(data[idx])
  18. }
  19. }
  20. return data
  21. }