From bcffaa0f470af341385e495a182826878166c675 Mon Sep 17 00:00:00 2001 From: bottleInALightning Date: Thu, 15 Oct 2020 11:03:23 +0200 Subject: [PATCH 1/2] Added Easy Division --- mathgenerator/mathgen.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 322f429..9884a29 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -148,6 +148,14 @@ def logFunc(maxBase=3, maxVal=8): solution = str(a) return problem, solution +def divisionToIntFunc(maxA=25, maxB=25): + a = random.randint(1,maxA) + b = random.randint(1,maxB) + divisor = a*b + dividend=random.choice([a,b]) + problem = f"{divisor}/{dividend} = " + solution=int(divisor/dividend) + return problem,solution # || Class Instances #Format is: From f789eee26c5cf90c615df0470564ae18aad3963a Mon Sep 17 00:00:00 2001 From: bottleInALightning Date: Thu, 15 Oct 2020 11:07:14 +0200 Subject: [PATCH 2/2] Added Easy Division --- mathgenerator/mathgen.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 9884a29..ed5a3ab 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -173,3 +173,4 @@ lcm = Generator("Lcm_generator", 11, "LCM of a and b = ", "c", lcmFunc) gcd = Generator("Gcd_generator", 12, "GCD of a and b = ", "c", gcdFunc) basicAlgebra = Generator("Basic_Algebra", 13, "ax + b = c", "d", basicAlgebraFunc) log = Generator("Logarithm", 13, "log2(8)", "3", logFunc) +intdivision = Generator("Easy Divisio",14,"a/b=","c",divisionToIntFunc) \ No newline at end of file