No longer rendering spaces as secret characters

This commit is contained in:
raul 2024-02-13 07:37:54 +00:00
parent 30d42a3219
commit 887e0556bf
2 changed files with 7 additions and 3 deletions

View File

@ -36,9 +36,12 @@ func main() {
filePath = os.Args[1] filePath = os.Args[1]
randWord = getWord(filePath) randWord = getWord(filePath)
for range randWord { for _, v := range randWord {
// TODO: Detect spaces in string and don't set them to "_" if string(v) == " " {
hiddenChars = append(hiddenChars, "_") hiddenChars = append(hiddenChars, " ")
} else {
hiddenChars = append(hiddenChars, "_")
}
} }
for _, v := range randWord { for _, v := range randWord {
revealedChars = append(revealedChars, string(v)) revealedChars = append(revealedChars, string(v))

View File

@ -1,5 +1,6 @@
fantastic fantastic
achieve achieve
this is a spaced sentence
security security
tool tool
cathedral cathedral