Do not export ASCII chars

This commit is contained in:
Alexandre Iooss 2020-10-14 19:02:03 +02:00
parent 177ed189ff
commit e56b21b819
No known key found for this signature in database
GPG Key ID: 6C79278F3FCDCC02
1 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ var (
currentMessage map[string]*string
clientCount map[string]int
ASCIICHARS = []byte{' ', '.', ',', ':', ';', '+', '*', '?', '%', '$', '#', '@'}
asciiChars = []byte{' ', '.', ',', ':', ';', '+', '*', '?', '%', '$', '#', '@'}
)
// Options holds telnet package configuration
@ -161,8 +161,8 @@ func StartASCIIArtStream(streamID string, reader io.ReadCloser) {
// Convert image to ASCII
for j := 0; j < Cfg.Height; j++ {
for i := 0; i < Cfg.Width; i++ {
textBuff.WriteByte(ASCIICHARS[pixelBuff[Cfg.Width*j+i]/22])
textBuff.WriteByte(ASCIICHARS[pixelBuff[Cfg.Width*j+i]/22])
textBuff.WriteByte(asciiChars[pixelBuff[Cfg.Width*j+i]/22])
textBuff.WriteByte(asciiChars[pixelBuff[Cfg.Width*j+i]/22])
}
textBuff.WriteByte('\n')
}