1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 06:37:46 +00:00

Fix typos (#982)

This commit is contained in:
Ian Manske 2024-11-21 20:51:05 -08:00 committed by GitHub
parent fc1d1989b6
commit dee0e7efcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 838 additions and 833 deletions

View file

@ -1,7 +1,7 @@
# A Terminal Wordle game.
# A Terminal Wordle game.
# The code is based on https://gist.github.com/huytd/6a1a6a7b34a0d0abcac00b47e3d01513 ,but slightly personalized.
# a simple termninal Wordle game!
# a simple terminal Wordle game!
export def main [
--unlimited(-u) # Play the game in unlimited mode.
--max_count(-M) : int = 6 # Give yourself more chances than default
@ -23,7 +23,7 @@ export def main [
if (((($words | where column1 =~ $guess) | length) >= 1) and ($guess | str length) == 5) {
mut out = ""
mut checked = $word
for i in ($guess | split chars) -n {
for i in ($guess | split chars | enumerate) {
if ($i.item == ($word | str substring ($i.index)..($i.index + 1)) ) {
$out += $"(ansi green_reverse)($i.item)(ansi reset)"
$avail = ($avail | str replace $i.item $"(ansi green_reverse)($i.item)(ansi white_reverse)")
@ -46,10 +46,10 @@ export def main [
} else {
echo "please enter a valid [5 letter] word!"
$guess_count -= 1
}
}
} else {
echo $"(ansi yellow )You loose, the word was: (ansi red)($word)(ansi reset)"
$end = true
}
}
}
}