2 Commits
2 changed files with 24 additions and 9 deletions
+8 -8
View File
@@ -1,23 +1,23 @@
#/43;45;45;15
${C3}.%1-------------------------:
%3.%1-------------------------:
.%2+=%1========================.
:%2++%1===%2++===%1===============- :%2++%1-
:%2*++%1====%2+++++==%1===========- .==:
-%2*+++%1=====%2+***++=%1=========:
=%2*++++=%1=======------------:
=%2*+++++=%1====- ${C3}...%1
=%2*+++++=%1====- %3...%1
.%2+*+++++%1=-===: .%2=+++=%1:
:%2++++%1=====-==: -***%2**%1+
:%2++=%1=======-=. .=+**+${C3}.%1
.%2+%1==========-. ${C3}.%1
:%2+++++++%1====- ${C3}.%1--==-${C3}.%1
:%2++%1==========. ${C3}:%2+++++++%1${C3}:
:%2++=%1=======-=. .=+**+%3.%1
.%2+%1==========-. %3.%1
:%2+++++++%1====- %3.%1--==-%3.%1
:%2++%1==========. %3:%2+++++++%1%3:
%1.-===========. =*****+*+
%1.-===========: .+*****+:
%1-=======%2++++%1:::::::::::::::::::::::::-: ${C3}.%1---:
%1-=======%2++++%1:::::::::::::::::::::::::-: %3.%1---:
:======%2++++%1====%2+++******************=.
%1:=====%2+++%1==========%2++++++++++++++*-
%1.====%2++%1==============%2++++++++++*-
%1.===%2+%1==================%2+++++++:
%1.-=======================%2+++:
${C3}..........................
%3..........................
+16 -1
View File
@@ -6,6 +6,7 @@ import (
"strconv"
"strings"
"time"
"unicode"
)
// Build-time variables
@@ -48,6 +49,20 @@ func run() {
}
asciiArtNoColor := asciiArt
// Rewrite last color code to the start of the next line
lastColor := "0"
for i := 1; i < len(asciiArt); i++ {
rune := rune(asciiArt[i])
if unicode.IsDigit(rune) && asciiArt[i-1] == '%' {
lastColor = string(rune)
}
if rune == '\n' {
asciiArt = asciiArt[:i+1] + "%" + lastColor + asciiArt[i+1:]
}
}
// Setup color map and replace colors in ascii art
colorMap := setupColorMap(asciiArtHeader)
for key, value := range colorMap {
@@ -107,7 +122,7 @@ func run() {
}
}
// Split ascii art into each lien
// Split ascii art into each line
asciiArtSplit := strings.Split(asciiArt, "\n")
asciiArtNoColorSplit := strings.Split(asciiArtNoColor, "\n")