diff --git a/brain-jogging.py b/brain-jogging.py index 576e5e1..4204bfc 100644 --- a/brain-jogging.py +++ b/brain-jogging.py @@ -51,6 +51,28 @@ def generate_math_problem(): return format_and_return(a, b, operation, a // b) def create_brain_jogging_pdf(filename): + """ + Creates a brain jogging PDF with math problems and saves it to the specified filename. + + The PDF contains 20 rows with 4 math problems per row, chosen randomly from addition, subtraction, multiplication, and division. + The PDF has two pages: the first page contains only the math problems, and the second page includes the problems along with their results. + + Args: + filename (str): The output PDF filename. + + Dependencies: + - reportlab.lib.pagesizes.A4 + - reportlab.platypus.SimpleDocTemplate + - reportlab.platypus.Paragraph + - reportlab.platypus.Spacer + - reportlab.platypus.Table + - reportlab.platypus.PageBreak + - reportlab.lib.colors + - reportlab.platypus.TableStyle + - reportlab.lib.styles.getSampleStyleSheet + - reportlab.pdfbase.pdfmetrics + - reportlab.pdfbase.ttfonts.TTFont + """ problems = [[generate_math_problem() for _ in range(4)] for _ in range(20)] data = [[problem[0] for problem in row] for row in problems] data_with_results = [[f"{problem[0]} {problem[1]}" for problem in row] for row in problems]