diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 322f429..ed5a3ab 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: @@ -165,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