From 71263a2a4ccac8eb5f6a74a17c3318bfe30cd587 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Sun, 8 Mar 2026 19:52:11 -0400 Subject: [PATCH] Create generate_random_ticket --- lottery_predictor/draw.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lottery_predictor/draw.py diff --git a/lottery_predictor/draw.py b/lottery_predictor/draw.py new file mode 100644 index 0000000..c87c35a --- /dev/null +++ b/lottery_predictor/draw.py @@ -0,0 +1,16 @@ +import random + + +def generate_random_ticket(max_main: int, max_game: int, num_main: int = 5) -> tuple[list[int], int]: + """ + Generate a random lottery ticket. + + :param max_main: The maximum number in the range to choose from for main game balls + :param max_game: The maximum number in the range to choose from for the game ball + :param num_main: The number of numbers that can be chosen in the main field + + :return: A tuple of (main_balls, game_ball) + """ + main_balls = random.sample(range(1, max_main), num_main) + game_ball = random.randint(1, max_game) + return sorted(main_balls), game_ball