From 9edccf1fb4ad3898b082d3ca7206226e7b5c85cf Mon Sep 17 00:00:00 2001 From: GitBluub Date: Fri, 24 Mar 2023 20:49:44 +0900 Subject: [PATCH] every note missed at the end diminish score and test --- scorometer/main.py | 3 +++ scorometer/tests/end_miss/input | 19 +++++++++++++++++++ scorometer/tests/end_miss/output | 9 +++++++++ 3 files changed, 31 insertions(+) create mode 100644 scorometer/tests/end_miss/input create mode 100644 scorometer/tests/end_miss/output diff --git a/scorometer/main.py b/scorometer/main.py index a4e698c..d6ed176 100755 --- a/scorometer/main.py +++ b/scorometer/main.py @@ -178,6 +178,9 @@ class Scorometer(): self.handleMessage(line.rstrip()) else: pass + for i in self.partition.notes: + if i.done == False: + self.score -= 50 return self.score, {} def handleStartMessage(start_message): diff --git a/scorometer/tests/end_miss/input b/scorometer/tests/end_miss/input new file mode 100644 index 0000000..c687828 --- /dev/null +++ b/scorometer/tests/end_miss/input @@ -0,0 +1,19 @@ +{"type":"start", "id": 1, "mode": "normal", "user_id": 1} +{"type": "note_on", "id": 1, "time": 3500, "note": 68} +{"type": "note_off", "id": 1, "time": 3740, "note": 68} +{"type": "note_on", "id": 2, "time": 3750, "note": 67} +{"type": "note_off", "id": 2, "time": 3980, "note": 67} +{"type": "note_on", "id": 3, "time": 4000, "note": 62} +{"type": "note_off", "id": 3, "time": 4240, "note": 62} +{"type": "note_on", "id": 4, "time": 4000, "note": 64} +{"type": "note_off", "id": 4, "time": 4240, "note": 64} +{"type": "note_on", "id": 5, "time": 4000, "note": 60} +{"type": "note_off", "id": 5, "time": 4240, "note": 60} +{"type": "note_on", "id": 6, "time": 4500, "note": 63} +{"type": "note_off", "id": 6, "time": 4740, "note": 63} +{"type": "note_on", "id": 7, "time": 4750, "note": 63} +{"type": "note_off", "id": 7, "time": 4980, "note": 63} +{"type": "note_on", "id": 8, "time": 5000, "note": 63} +{"type": "note_off", "id": 8, "time": 5990, "note": 63} +{} + diff --git a/scorometer/tests/end_miss/output b/scorometer/tests/end_miss/output new file mode 100644 index 0000000..55142a4 --- /dev/null +++ b/scorometer/tests/end_miss/output @@ -0,0 +1,9 @@ +{"id": 1, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 2, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 3, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 4, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 5, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 6, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 7, "timingScore": "perfect", "timingInformation": "perfect"} +{"id": 8, "timingScore": "perfect", "timingInformation": "perfect"} +{"overallScore": 700, "score": {}}