A small CLI tool to generate written arithmetic exercises (addition, subtraction, multiplication) tailored by belt color difficulty.
This is based on tests that have been done at "Le Petit Athénée de Jodoigne" which is part of "Athénée Royale de Jodoigne" school.
Belt Colors
- ⚪️: L'addition (395 + 228)
- 🟡: La soustraction avec retenue (544 - 306)
- 🟠: La multiplication par un nombre à un chiffre (72 x 9)
- 🩷: La multiplication par un nombre à un chiffre (455 x 4)
- 🟢: L'addition (6199 + 4566)
- 🔵: La soustraction avec retenue (5206 - 2355)
- 🟣: La multiplication par un nombre à deux chiffres (45 x 23)
- 🟤: La multiplication par un nombre à deux chiffres (541 x 54)
- ⚫️: L'addition de nombres décimaux (297,7 + 37,05)
- 🔴: La soustraction de nombres décimaux (982,7 - 64,47)
- Generate vertical (written) integer and float calculations.
- Color-based difficulty levels (e.g.
white,yellow,orange, ...red,black). - Control number of exercises with
--quantityand limit withMAX_QUANTITY. - Optionally show results with
-r/--show-result.
- Python 3.8+
Clone the repository and run the script from the project folder:
git clone <repo-url>
cd path/to/arj-written-calculations-trainer-cli
python3 src/main.py [options]Basic usage (default color, default quantity):
python3 src/main.pySpecify a belt color (choices are listed in the COLORS constant):
python3 src/main.py --color redGenerate a fixed number of calculations (up to the maximum):
python3 src/main.py --quantity 5Show results inline (useful for worksheets or verification):
python3 src/main.py --color red --quantity 5 --show-result
# or using the short flag
python3 src/main.py -rUse --color random to pick a random color per generated calculation.
Defaults and limits are defined in src/config.py:
COLORS— list of available belt colorsQUANTITY— default number of calculations generatedMAX_QUANTITY— hard cap for--quantityDISPLAY_RESULT— whether results are shown by default
- The tool prints each exercise in a vertical, written format (aligned columns). For float exercises results are formatted to two decimals.
- Consider adding:
- unit tests for the number generation functions,
- a
--seedoption for reproducible outputs, - an installable
pyproject.tomland a small test suite.
python3 src/main.py --color red --quantity 3 --show-result
Belt Color: Red - Generating 3 calculations
74.01
- 56.62
-------
17.39
486.22
- 12.03
--------
474.19
824.24
- 664.00
--------
160.24