From bd773150ab7eb5d2a02393f5b3a97641348f983b Mon Sep 17 00:00:00 2001 From: Dendy Date: Mon, 31 Jan 2022 11:27:38 +0100 Subject: [PATCH 1/2] Add script shebang --- wordle.py | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 wordle.py diff --git a/wordle.py b/wordle.py old mode 100644 new mode 100755 index 417306c..eb70330 --- a/wordle.py +++ b/wordle.py @@ -1,3 +1,5 @@ +#!/bin/env python + import random def getw(): From 9bc1f91b0b766ad49e6df4ef74515b0637007e94 Mon Sep 17 00:00:00 2001 From: Dendy Date: Mon, 31 Jan 2022 11:32:58 +0100 Subject: [PATCH 2/2] Fix uppercasing of repeated characters --- wordle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wordle.py b/wordle.py index eb70330..8aa5468 100755 --- a/wordle.py +++ b/wordle.py @@ -32,7 +32,7 @@ def word(palabra): break while i != 5: if guess[i] == palabra[i]: - guess = guess.replace(guess[i], guess[i].upper()) + guess = guess[:i] + guess[i].upper() + guess[i+1:] i += 1 print(guess) hp -= 1