From df3b7d2f017643afe7ce313a18d531aa287ac725 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Mon, 29 Apr 2024 08:00:47 +1200 Subject: [PATCH 01/10] Iteration problem --- Iteration problem | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Iteration problem diff --git a/Iteration problem b/Iteration problem new file mode 100644 index 0000000..6946ea8 --- /dev/null +++ b/Iteration problem @@ -0,0 +1,7 @@ +for num in range(1,100): + print(num*num) + answer = input("Is this square?") + if answer == "yes"or"Yes": + print("Correct") + else: + print("Wrong") From 53f55640eeffdf6bcef30d9ba0d8dfcaf93a67e4 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Tue, 30 Apr 2024 07:56:55 +1200 Subject: [PATCH 02/10] Create Boolean and Operations --- Boolean and Operations | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Boolean and Operations diff --git a/Boolean and Operations b/Boolean and Operations new file mode 100644 index 0000000..bd596f2 --- /dev/null +++ b/Boolean and Operations @@ -0,0 +1,7 @@ +Money = input("How much money you got?") +if Money == 5: + print('Poor!') +elif Money == 15: + print('Average.') +elif Money == 30: + print('What??') From d370dad7b89aa2d67d767505aae64297dda64abd Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Wed, 1 May 2024 16:15:26 +1200 Subject: [PATCH 03/10] Create Output and Variables --- Output and Variables | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Output and Variables diff --git a/Output and Variables b/Output and Variables new file mode 100644 index 0000000..959a0b4 --- /dev/null +++ b/Output and Variables @@ -0,0 +1,2 @@ +x = 6 +print(x-5) From 8c841d8f32f3f65524cd61ec491dad8d90828e30 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Wed, 8 May 2024 16:19:40 +1200 Subject: [PATCH 04/10] Create A regular problem --- A regular problem | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 A regular problem diff --git a/A regular problem b/A regular problem new file mode 100644 index 0000000..f41b4a4 --- /dev/null +++ b/A regular problem @@ -0,0 +1,8 @@ +animal = 'elephant' +answer = 'nil' +while not answer == 'elephant': + answer = input('Pick a random animal to sneak into your moms trolley. (all lowercase)') + if answer == 'elephant': + print('Fail :(') + else: + print('Success :D') From 5526faffb6970b10b18acb7365b451e857adc935 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Thu, 16 May 2024 08:02:13 +1200 Subject: [PATCH 05/10] Time problem --- Time problem | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Time problem diff --git a/Time problem b/Time problem new file mode 100644 index 0000000..205e7b6 --- /dev/null +++ b/Time problem @@ -0,0 +1,6 @@ +def main(): + time = int(input("Enter the current time (Range: 0-24): ")) + print(["good night.", "good morning.", "good afternoon.", "good evening."][time//6]) + +if __name__ == "__main__": + main() From c7a71a6b3ac58adc85743d8055820fe05703b464 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Mon, 20 May 2024 09:43:14 +1200 Subject: [PATCH 06/10] Time problem --- Time problem | 1 - 1 file changed, 1 deletion(-) diff --git a/Time problem b/Time problem index 205e7b6..e6676b7 100644 --- a/Time problem +++ b/Time problem @@ -1,6 +1,5 @@ def main(): time = int(input("Enter the current time (Range: 0-24): ")) print(["good night.", "good morning.", "good afternoon.", "good evening."][time//6]) - if __name__ == "__main__": main() From 2e65c6094526a69a25407055623328941012e502 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Thu, 25 Jul 2024 08:18:36 +1200 Subject: [PATCH 07/10] Create Number Problem --- Number Problem | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Number Problem diff --git a/Number Problem b/Number Problem new file mode 100644 index 0000000..1a241c0 --- /dev/null +++ b/Number Problem @@ -0,0 +1,16 @@ +# Number Problem + +def seen_before(numbers): + seen = set() + results = [] + for num in numbers: + if num in seen: + results.append("YES") + else: + results.append("NO") + seen.add(num) + return results + +# Example usage +numbers = [1, 3, 8, 35, 4, 2, 3] +print("#".join(seen_before(numbers))) From 76ec35850e0739614fce2edd20a252079e6546d3 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:38:28 +1200 Subject: [PATCH 08/10] Create Adventure BP yes, it is a code. --- Adventure BP | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Adventure BP diff --git a/Adventure BP b/Adventure BP new file mode 100644 index 0000000..d35419e --- /dev/null +++ b/Adventure BP @@ -0,0 +1,73 @@ +import random + +def choose_scenario(): + return random.randint(1, 2) + +def forest_treasure_hunt(): + fruits = {"banana", "apple", "strawberry", "blueberry", "orange"} + guessed = set() + while len(guessed) < 5: + guess = input("Guess a fruit: ").lower() + if guess in fruits: + guessed.add(guess) + print("You passed the monkey!") + +def cross_river(): + height = int(input("Enter height in cm: ")) + if height <= 160: + print("You drown.") + return False + if height <= 180: + print("You cross safely.") + return True + print("The tiger spots you.") + return False + +def unlock_door(): + password = [random.randint(0, 9) for _ in range(4)] + for _ in range(10): + guess = [int(digit) for digit in input("4-digit guess: ")] + if guess == password: + print("Door unlocked!") + return True + correct = sum(a == b for a, b in zip(guess, password)) + print(f"Correct digits: {correct}") + print("Failed to unlock.") + return False + +def python_quiz(): + questions = [ + ("2 + 3 =", ["4", "5", "6", "7"], "5"), + ("Python data type?", ["String", "Integer", "List", "All of the above"], "All of the above"), + ("Start a comment?", ["//", "#", "/*", "--"], "#"), + ("Define function?", ["define", "function", "def", "func"], "def"), + ("Block of code?", ["Indentation", "Braces", "Parentheses", "Quotes"], "Indentation"), + ("Invalid variable?", ["var_name", "1var_name", "_varName", "varName1"], "1var_name") + ] + + correct = sum( + input(f"{q[0]} {', '.join(q[1])}: ") == q[2] + for q in questions + ) + print(f"Score: {correct}/6") + +def main(): + scenario = choose_scenario() + if scenario == 1: + forest_treasure_hunt() + if not cross_river(): return + unlock_door() + else: + python_quiz() + + if input("Try the other game? (yes/no): ").strip().lower() == "yes": + if scenario == 1: + python_quiz() + else: + forest_treasure_hunt() + if cross_river(): + unlock_door() + print("Goodbye!") + +if __name__ == "__main__": + main() From 1795239c6204e0167dd294102d9a8b0b55d49299 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:43:24 +1200 Subject: [PATCH 09/10] Create NYT World BP --- NYT World BP | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 NYT World BP diff --git a/NYT World BP b/NYT World BP new file mode 100644 index 0000000..75b71cb --- /dev/null +++ b/NYT World BP @@ -0,0 +1,35 @@ +import random + +def get_feedback(guess, word): + feedback = "" + for i, letter in enumerate(guess): + if letter == word[i]: + feedback += "🟩" + elif letter in word: + feedback += "🟨" + else: + feedback += "⬛️" + return feedback + +def play_game(): + word = "light" + print("Welcome to Wordle! You have 6 chances to guess a 5-letter word.") + + for attempt in range(6): + guess = input(f"Attempt {attempt + 1}/6: ").lower() + + if len(guess) != 5 or not guess.isalpha(): + print("Invalid guess. Please enter a 5-letter word with letters only.") + continue + + feedback = get_feedback(guess, word) + print(feedback) + + if guess == word: + print(f"Congratulations! You guessed '{word}' correctly.") + return + + print(f"Unfortunate! The word was '{word}'.") + +if __name__ == "__main__": + play_game() From 673af3ab8662f79fda0c4f571a086188d8a8ef53 Mon Sep 17 00:00:00 2001 From: Jerry24298 <161253840+Jerry24298@users.noreply.github.com> Date: Thu, 12 Sep 2024 09:43:52 +1200 Subject: [PATCH 10/10] Rename NYT World BP to NYT Wordle BP --- NYT World BP => NYT Wordle BP | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename NYT World BP => NYT Wordle BP (100%) diff --git a/NYT World BP b/NYT Wordle BP similarity index 100% rename from NYT World BP rename to NYT Wordle BP