From 06057a4246a6e44c613bebbf6dc5e23dbe1a9764 Mon Sep 17 00:00:00 2001 From: 20148528 <20148528@tafe.wa.edu.au> Date: Wed, 20 May 2026 11:15:34 +0800 Subject: [PATCH 1/2] docs: Added student profile for Nonoka-T --- .idea/.gitignore | 5 +++ .idea/inspectionProfiles/Project_Default.xml | 15 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 7 ++++ .idea/modules.xml | 8 +++++ .idea/student-fest.iml | 12 +++++++ .idea/vcs.xml | 6 ++++ profiles/Nonoka-T.md | 34 +++++++++++++++++++ 8 files changed, 93 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/student-fest.iml create mode 100644 .idea/vcs.xml create mode 100644 profiles/Nonoka-T.md diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..b58b603 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..8421265 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,15 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..590a59e --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c8cf647 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/student-fest.iml b/.idea/student-fest.iml new file mode 100644 index 0000000..f55cd92 --- /dev/null +++ b/.idea/student-fest.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/profiles/Nonoka-T.md b/profiles/Nonoka-T.md new file mode 100644 index 0000000..cf648e9 --- /dev/null +++ b/profiles/Nonoka-T.md @@ -0,0 +1,34 @@ +# [Nonoka Takahashi] - Interactive Profile 🚀 + +## 👋 Quick Intro +- **Name**: Nonoka Takahashi +- **Location**: Australia +- **Role**: Student +- **GitHub**: [@Nonoka-T] (https://github.com/Nonoka-T) + +## 🌟 About Me + +Write a brief description about yourself: +- What you're passionate about +- What you're currently learning - Python, C#, HTML, CSS, Javascript, SQL +- Your favorite programming languages - C#, HTML, CSS +- Fun facts about you - I'm an international student from Japan, learning programming in Australia. +- Your development journey - Finished certificate 3 in Web Development and currently doing certificate 4 including Open Source, Web development, Mobile application development. + +## 🎯 Current Focus + +- **Learning**: What you're currently studying - Open source (Python), Mobile Application Development with API (C#), HTML/CSS/Javascript using API +- **Building**: Projects you're working on - Contributing with open source +- **Exploring**: Technologies you want to try +- **Goals**: What you want to achieve this year - Finish certificate 4 and develop more skills in diploma. + + +## 📫 Connect With Me + +- 🌐 **Portfolio**: (https://github.com/Nonoka-T) + + +## 🎉 Fun Section + +Add something unique about yourself: +- Hobbies outside coding - Traveling, Journaling From 38d1ef306d09552bf56f78bbedb98aa2ad694ee1 Mon Sep 17 00:00:00 2001 From: 20148528 <20148528@tafe.wa.edu.au> Date: Sun, 14 Jun 2026 18:17:25 +0800 Subject: [PATCH 2/2] test: add pytest test for Number Guessing Game --- .../tests/test_number_guessing_game.py | 79 +++++++++++++++++++ easy_score | 0 2 files changed, 79 insertions(+) create mode 100644 challenges/intermediate/number-guessing-game/tests/test_number_guessing_game.py create mode 100644 easy_score diff --git a/challenges/intermediate/number-guessing-game/tests/test_number_guessing_game.py b/challenges/intermediate/number-guessing-game/tests/test_number_guessing_game.py new file mode 100644 index 0000000..4d149bc --- /dev/null +++ b/challenges/intermediate/number-guessing-game/tests/test_number_guessing_game.py @@ -0,0 +1,79 @@ +import sys +import os + +sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../solutions")) + +from sehmaluva_number_guessing_game import NumberGuessingGame + + +def get_game(): + """Helper to create fresh game instance for testing.""" + return NumberGuessingGame() + + +def test_calculate_score_easy_first_attempt(): + """Test score calculation for easy difficulty on first attempt. + On the first attempt, the base score (1000) is not reduced + and the easy multiplier is 1 so the score should be 1000. + + """ + game = get_game() + easy_difficulty = game.difficulties[1] + score = game.calculate_score(attempts=1, difficulty=easy_difficulty) + assert score == 1000 + + +def test_calculate_score_decreases_with_attempts(): + """Test that score decreases as attempts increase.""" + game = get_game() + difficulty = game.difficulties[1] #Easy + score_1 = game.calculate_score(attempts=1, difficulty=difficulty) + score_2 = game.calculate_score(attempts=2, difficulty=difficulty) + assert score_2 < score_1 + + +def test_calculate_score_hard_multiplier(): + """Test that hard difficulty applies higher multiplier.""" + game = get_game() + easy = game.difficulties[1] + hard = game.difficulties[3] + #Compare scores for the same number of attempts + # Hard should give more points because of the higher multiplier + easy_score = game.calculate_score(attempts=1, difficulty=easy) + hard_score = game.calculate_score(attempts=1, difficulty=hard) + assert hard_score > easy_score + + +def test_provide_feedback_too_low(): + """Test feedback when guess is lower than secret number.""" + game = get_game() + difficulty = game.difficulties[1] # Easy + feedback = game.provide_feedback(guess=10, secret=50, difficulty=difficulty) + assert "Too low" in feedback + + +def test_provide_feedback_too_high(): + """Test feedback when guess is higher than secret number.""" + game = get_game() + difficulty = game.difficulties[1] #Easy + feedback = game.provide_feedback(guess=80, secret=50, difficulty=difficulty) + assert "Too high" in feedback + + +def test_provide_feedback_correct(): + """Test feedback when guess matches the secret number.""" + game = get_game() + difficulty = game.difficulties[1] #Easy + feedback = game.provide_feedback(guess=50, secret=50, difficulty=difficulty) + assert "CORRECT" in feedback + + +def test_generate_secret_number_within_range(): + """Test that the generated secret number is within the difficulty range.""" + game = get_game() + difficulty = game.difficulties[2] #Medium + secret = game.generate_secret_number(difficulty) + min_val = difficulty["range"][0] + max_val = difficulty["range"][1] + assert secret >= min_val + assert secret <= max_val \ No newline at end of file diff --git a/easy_score b/easy_score new file mode 100644 index 0000000..e69de29