From ed3546759246e690051717c7a880321dda4291fc Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 10 Nov 2025 16:22:06 +0000 Subject: [PATCH] Add borrowing checkbox for subtraction problems This commit adds a new checkbox to the print config view that allows users to generate only subtraction problems that require borrowing. Changes: - Added "Only problems that require borrowing?" checkbox to the UI - Implemented requiresBorrowing() helper function to detect when a subtraction problem requires borrowing - Updated equation generation logic to filter problems based on the borrowing constraint - The filter only applies to subtraction category worksheets The borrowing detection works by comparing each digit position from right to left and checking if any minuend digit is less than the corresponding subtrahend digit. --- src/index.html | 8 ++++++++ src/js/hw-gen.js | 46 ++++++++++++++++++++++++++++++++++++++-------- src/js/util.js | 14 ++++++++++++++ 3 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/index.html b/src/index.html index 4cd7f41..7ed234c 100644 --- a/src/index.html +++ b/src/index.html @@ -214,6 +214,14 @@

How many worksheets?

+
+ +