From f633721d5e2b0f57ca6f7de398592ec95477ccad Mon Sep 17 00:00:00 2001 From: adam10836 <67599608+adam10836@users.noreply.github.com> Date: Wed, 30 Sep 2026 21:17:43 -0500 Subject: [PATCH] Add BioBuzz to ranked --- highscores/lib.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/highscores/lib.py b/highscores/lib.py index ac5c5b1..a6afaec 100644 --- a/highscores/lib.py +++ b/highscores/lib.py @@ -295,6 +295,11 @@ def submit_decode(score_obj: Score) -> Union[str, None, tuple[None, str]]: def submit_rebuilt(score_obj: Score) -> Union[str, None, tuple[None, str]]: return submit_score(score_obj, rebuilt_clean_code_check) +def submit_biobuzz(score_obj: Score) -> Union[str, None, tuple[None, str]]: + return submit_score(score_obj, biobuzz_clean_code_check) + + + def decode_time_data(in_string: str) -> str: out_bytes = "" @@ -543,6 +548,9 @@ def decode_clean_code_check(score_obj: Score) -> Union[str, None, tuple[None, st def rebuilt_clean_code_check(score_obj: Score) -> Union[str, None, tuple[None, str]]: return clean_code_check(score_obj, check_rebuilt_game_settings, check_subtraction_score) +def biozbuzz_clean_code_check(score_obj: Score) -> Union[str, None, tuple[None, str]]: + return clean_code_check(score_obj, check_biozbuzz_game_settings, check_subtraction_score) + def extract_clean_code_info(score_obj: Score) -> tuple[str, list[str], str, str, str, str, str, str]: """ Extracts the relevant information from the clean code. @@ -846,6 +854,15 @@ def check_rebuilt_game_settings(game_options: list, restart_option: str, game_in return None # No error +def check_biobuzz_game_settings(game_options: list, restart_option: str, game_index: str) -> Union[str, None]: + """ Checks if the BIOBUZZ game settings are valid. + :return: None if the settings are valid, or a response with an error message if they are not. + """ + if (game_index != '23'): + return 'Wrong game! This form is for BIOBUZZ.' + + return None # No error + def check_robot_type(score_obj: Score, robot_model: str) -> Union[str, None]: """ Checks if the robot model is valid. @@ -1040,6 +1057,7 @@ def get_game_length(game_index: str): "pb": submit_push_back, "dc": submit_decode, "rb": submit_rebuilt, + "bb": submit_biobuzz, } game_to_submit_func = { @@ -1062,4 +1080,5 @@ def get_game_length(game_index: str): "Push Back": submit_push_back, "DECODE": submit_decode, "REBUILT": submit_rebuilt, + "BIOBUZZ": submit_biobuzz, }