No longer rendering spaces as secret characters
This commit is contained in:
parent
30d42a3219
commit
887e0556bf
|
@ -36,10 +36,13 @@ 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, " ")
|
||||||
|
} else {
|
||||||
hiddenChars = append(hiddenChars, "_")
|
hiddenChars = append(hiddenChars, "_")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for _, v := range randWord {
|
for _, v := range randWord {
|
||||||
revealedChars = append(revealedChars, string(v))
|
revealedChars = append(revealedChars, string(v))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
fantastic
|
fantastic
|
||||||
achieve
|
achieve
|
||||||
|
this is a spaced sentence
|
||||||
security
|
security
|
||||||
tool
|
tool
|
||||||
cathedral
|
cathedral
|
||||||
|
|
Loading…
Reference in New Issue