Added kwargs to generator module and readme

This commit is contained in:
lukew3
2021-02-16 11:02:45 -05:00
parent ba6ffc4e6e
commit 9efffce9f5
116 changed files with 359 additions and 251 deletions

View File

@@ -10,12 +10,13 @@ genList = []
class Generator:
def __init__(self, title, id, generalProb, generalSol, func):
def __init__(self, title, id, generalProb, generalSol, func, kwargs):
self.title = title
self.id = id
self.generalProb = generalProb
self.generalSol = generalSol
self.func = func
self.kwargs = kwargs
(filename, line_number, function_name,
text) = traceback.extract_stack()[-2]
@@ -24,7 +25,7 @@ class Generator:
subjectname = filename[:filename.rfind('/')].strip()
subjectname = subjectname[subjectname.rfind('/'):].strip()
subjectname = subjectname[1:]
genList.append([id, title, self, funcname, subjectname])
genList.append([id, title, self, funcname, subjectname, kwargs])
def __str__(self):
return str(

View File

@@ -30,4 +30,4 @@ def basicAlgebraFunc(maxVariable=10, style='raw'):
basic_algebra = Generator("Basic Algebra", 11, "ax + b = c", "d",
basicAlgebraFunc)
basicAlgebraFunc, ["maxVariable=10"])

View File

@@ -42,4 +42,4 @@ def combineTerms(string):
combine_like_terms = Generator("Combine Like terms", 105, "nx^m+lx^k+bx^m",
"(n+b)x^m+lx^k", likeTermCombineFunc)
"(n+b)x^m+lx^k", likeTermCombineFunc, ["maxCoef=10", "maxExp=20", "maxTerms=10"])

View File

@@ -72,4 +72,5 @@ complex_quadratic = Generator(
"complex Quadratic Equation", 100,
"Find the roots of given Quadratic Equation ",
"simplified solution : (x1, x2), generalized solution : ((-b + sqrt(d))/2a, (-b - sqrt(d))/2a) or ((-b + sqrt(d)i)/2a, (-b - sqrt(d)i)/2a)",
complexQuadraticFunc)
complexQuadraticFunc,
["prob_type=0", "max_range=10"])

View File

@@ -16,4 +16,6 @@ def compoundInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10):
compound_interest = Generator(
"Compound Interest", 78,
"Compound interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ",
"d dollars", compoundInterestFunc)
"d dollars",
compoundInterestFunc,
["maxPrinciple=10000", "maxRate=10", "maxTime=10"])

View File

@@ -17,4 +17,5 @@ def distanceTwoPointsFunc(maxValXY=20, minValXY=-20):
distance_two_points = Generator(
"Distance between 2 points", 24,
"Find the distance between (x1,y1) and (x2,y2)", "sqrt(distanceSquared)",
distanceTwoPointsFunc)
distanceTwoPointsFunc,
["maxValXY=20", "minValXY=-20"])

View File

@@ -45,4 +45,5 @@ def expandingFunc(range_x1=10, range_x2=10, range_a=10, range_b=10):
expanding = Generator("Expanding Factored Binomial", 111, "(a*x-x1)(b*x-x2)",
"a*b*x^2+(b*x1+a*x2)*x+x1*x2", expandingFunc)
"a*b*x^2+(b*x1+a*x2)*x+x1*x2", expandingFunc,
["range_x1=10", "range_x2=10", "range_a=10", "range_b=10"])

View File

@@ -30,4 +30,5 @@ def factoringFunc(range_x1=10, range_x2=10):
factoring = Generator("Factoring Quadratic", 21, "x^2+(x1+x2)+x1*x2",
"(x-x1)(x-x2)", factoringFunc)
"(x-x1)(x-x2)", factoringFunc,
["range_x1=10", "range_x2=10"])

View File

@@ -15,4 +15,5 @@ def determinantToMatrix22(maxMatrixVal=100):
int_matrix_22_determinant = Generator("Determinant to 2x2 Matrix", 77,
"Det([[a,b],[c,d]]) =", " a * d - b * c",
determinantToMatrix22)
determinantToMatrix22,
["maxMatrixVal=100"])

View File

@@ -71,4 +71,5 @@ def intersectionOfTwoLinesFunc(minM=-10,
intersection_of_two_lines = Generator(
"Intersection of Two Lines", 41,
"Find the point of intersection of the two lines: y = m1*x + b1 and y = m2*x + b2",
"(x, y)", intersectionOfTwoLinesFunc)
"(x, y)", intersectionOfTwoLinesFunc,
["minM=-10","maxM=10","minB=-10","maxB=10","minDenominator=1","maxDenominator=6"])

View File

@@ -80,4 +80,5 @@ def matrixInversion(SquareMatrixDimension=3,
invert_matrix = Generator("Inverse of a Matrix", 74,
"Inverse of a matrix A is", "A^(-1)",
matrixInversion)
matrixInversion,
["SquareMatrixDimension=3","MaxMatrixElement=99","OnlyIntegerElementsInInvertedMatrix=False"])

View File

@@ -31,4 +31,5 @@ def linearEquationsFunc(n=2, varRange=20, coeffRange=20):
linear_equations = Generator("Linear Equations", 26, "2x+5y=20 & 3x+6y=12",
"x=-20 & y=12", linearEquationsFunc)
"x=-20 & y=12", linearEquationsFunc,
["n=2", "varRange=20", "coeffRange=20"])

View File

@@ -17,4 +17,5 @@ def logFunc(maxBase=3, maxVal=8, style='raw'):
return problem, solution
log = Generator("Logarithm", 12, "log2(8)", "3", logFunc)
log = Generator("Logarithm", 12, "log2(8)", "3", logFunc,
["maxBase=3", "maxVal=8"])

View File

@@ -55,4 +55,5 @@ def matrixMultiplicationFuncHelper(inp):
matrix_multiplication = Generator("Multiplication of two matrices", 46,
"Multiply two matrices A and B", "C",
matrixMultiplicationFunc)
matrixMultiplicationFunc,
["maxVal=100", "max_dim=10"])

View File

@@ -15,4 +15,5 @@ def MidPointOfTwoPointFunc(maxValue=20):
midPoint_of_two_points = Generator("Midpoint of the two point", 20,
"((X1,Y1),(X2,Y2))=",
"((X1+X2)/2,(Y1+Y2)/2)",
MidPointOfTwoPointFunc)
MidPointOfTwoPointFunc,
["maxValue=20"])

View File

@@ -14,4 +14,5 @@ def multiplyComplexNumbersFunc(minRealImaginaryNum=-20,
multiply_complex_numbers = Generator("Multiplication of 2 complex numbers", 65,
"(x + j) (y + j) = ", "xy + xj + yj -1",
multiplyComplexNumbersFunc)
multiplyComplexNumbersFunc,
["minRealImaginaryNum=-20","maxRealImaginaryNum=20"])

View File

@@ -26,4 +26,5 @@ def multiplyIntToMatrix22(maxMatrixVal=10, maxRes=100, style='raw'):
multiply_int_to_22_matrix = Generator("Integer Multiplication with 2x2 Matrix",
17, "k * [[a,b],[c,d]]=",
"[[k*a,k*b],[k*c,k*d]]",
multiplyIntToMatrix22)
multiplyIntToMatrix22,
["maxMatrixVal=10", "maxRes=100"])

View File

@@ -20,4 +20,5 @@ def quadraticEquation(maxVal=100):
quadratic_equation = Generator(
"Quadratic Equation", 50,
"Find the zeros {x1,x2} of the quadratic equation ax^2+bx+c=0", "x1,x2",
quadraticEquation)
quadraticEquation,
["maxVal=100"])

View File

@@ -18,4 +18,5 @@ def simpleInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10):
simple_interest = Generator(
"Simple Interest", 45,
"Simple interest for a principle amount of a dollars, b% rate of interest and for a time period of c years is = ",
"d dollars", simpleInterestFunc)
"d dollars", simpleInterestFunc,
["maxPrinciple=10000", "maxRate=10", "maxTime=10"])

View File

@@ -49,4 +49,5 @@ def systemOfEquationsFunc(range_x=10, range_y=10, coeff_mult_range=10):
system_of_equations = Generator("Solve a System of Equations in R^2", 23,
"2x + 5y = 13, -3x - 3y = -6", "x = -1, y = 3",
systemOfEquationsFunc)
systemOfEquationsFunc,
["range_x=10", "range_y=10", "coeff_mult_range=10"])

View File

@@ -15,4 +15,5 @@ def vectorCrossFunc(minVal=-20, maxVal=20):
vector_cross = Generator("Cross Product of 2 Vectors", 43, "a X b = ", "c",
vectorCrossFunc)
vectorCrossFunc,
["minVal=-20", "maxVal=20"])

View File

@@ -12,4 +12,5 @@ def vectorDotFunc(minVal=-20, maxVal=20):
vector_dot = Generator("Dot Product of 2 Vectors", 72, "a . b = ", "c",
vectorDotFunc)
vectorDotFunc,
["minVal=-20", "maxVal=20"])

View File

@@ -18,4 +18,5 @@ def absoluteDifferenceFunc(maxA=100, maxB=100, style='raw'):
absolute_difference = Generator(
"Absolute difference between two numbers", 71,
"Absolute difference betweeen two numbers a and b =", "|a-b|",
absoluteDifferenceFunc)
absoluteDifferenceFunc,
["maxA=100", "maxB=100"])

View File

@@ -19,4 +19,5 @@ def addition_func(maxSum=99, maxAddend=50, style='raw'):
return problem, solution
addition = Generator("Addition", 0, "a+b=", "c", addition_func)
addition = Generator("Addition", 0, "a+b=", "c", addition_func,
["maxSum=99", "maxAddend=50"])

View File

@@ -32,4 +32,5 @@ def compareFractionsFunc(maxVal=10, style='raw'):
compare_fractions = Generator(
"Compare Fractions", 44,
"Which symbol represents the comparison between a/b and c/d?", ">/</=",
compareFractionsFunc)
compareFractionsFunc,
["maxVal=10"])

View File

@@ -16,4 +16,5 @@ def complexDivisionFunc(maxRes=99, maxDivid=99, style='raw'):
return problem, solution
complex_division = Generator("Complex Division", 13, "a/b=", "c", complexDivisionFunc)
complex_division = Generator("Complex Division", 13, "a/b=", "c", complexDivisionFunc,
["maxRes=99", "maxDivid=99"])

View File

@@ -16,4 +16,5 @@ def cubeRootFunc(minNo=1, maxNo=1000, style='raw'):
cube_root = Generator("Cube Root", 47,
"Cuberoot of a upto 2 decimal places is", "b",
cubeRootFunc)
cubeRootFunc,
["minNo=1", "maxNo=1000"])

View File

@@ -42,4 +42,5 @@ def divideFractionsFunc(maxVal=10, style='raw'):
divide_fractions = Generator("Fraction Division", 16, "(a/b)/(c/d)=", "x/y",
divideFractionsFunc)
divideFractionsFunc,
["maxVal=10"])

View File

@@ -18,4 +18,4 @@ def divisionToIntFunc(maxA=25, maxB=25, style='raw'):
return problem, solution
division = Generator("Division", 3, "a/b=", "c", divisionToIntFunc)
division = Generator("Division", 3, "a/b=", "c", divisionToIntFunc, ["maxA=25", "maxB=25"])

View File

@@ -15,4 +15,5 @@ def exponentiationFunc(maxBase=20, maxExpo=10, style='raw'):
exponentiation = Generator("Exponentiation", 53, "a^b = ", "c",
exponentiationFunc)
exponentiationFunc,
["maxBase=20", "maxExpo=10"])

View File

@@ -15,4 +15,4 @@ def factorialFunc(maxInput=6):
return problem, solution
factorial = Generator("Factorial", 31, "a! = ", "b", factorialFunc)
factorial = Generator("Factorial", 31, "a! = ", "b", factorialFunc, ["maxInput=6"])

View File

@@ -41,4 +41,5 @@ def multiplyFractionsFunc(maxVal=10, style='raw'):
fraction_multiplication = Generator("Fraction Multiplication", 28,
"(a/b)*(c/d)=", "x/y",
multiplyFractionsFunc)
multiplyFractionsFunc,
["maxVal=10"])

View File

@@ -1,8 +1,8 @@
from .__init__ import *
def isprime(max_a=100):
a = random.randint(2, max_a)
def isprime(max_num=100):
a = random.randint(2, max_num)
problem = f"Is {a} prime?"
if a == 2:
solution = "Yes"
@@ -19,4 +19,5 @@ def isprime(max_a=100):
is_prime = Generator('isprime', 90, 'a any positive integer', 'True/False',
isprime)
isprime,
["max_num=100"])

View File

@@ -16,4 +16,5 @@ def multiplicationFunc(maxMulti=12, style='raw'):
multiplication = Generator("Multiplication", 2, "a*b=", "c",
multiplicationFunc)
multiplicationFunc,
["maxMulti=12"])

View File

@@ -12,4 +12,5 @@ def percentageFunc(maxValue=99, maxpercentage=99):
percentage = Generator("Percentage of a number", 80, "What is a% of b?",
"percentage", percentageFunc)
"percentage", percentageFunc,
["maxValue=99", "maxpercentage=99"])

View File

@@ -17,4 +17,5 @@ def powerOfPowersFunc(maxBase=50, maxPower=10, style='raw'):
power_of_powers = Generator("Power of Powers", 97, "6^4^2",
"6^8", powerOfPowersFunc)
"6^8", powerOfPowersFunc,
["maxBase=50", "maxPower=10"])

View File

@@ -14,4 +14,4 @@ def squareFunc(maxSquareNum=20, style='raw'):
return problem, solution
square = Generator("Square", 8, "a^2", "b", squareFunc)
square = Generator("Square", 8, "a^2", "b", squareFunc, ["maxSquareNum=20"])

View File

@@ -14,4 +14,4 @@ def squareRootFunc(minNo=1, maxNo=12, style='raw'):
return problem, solution
square_root = Generator("Square Root", 6, "sqrt(a)=", "b", squareRootFunc)
square_root = Generator("Square Root", 6, "sqrt(a)=", "b", squareRootFunc, ["minNo=1", "maxNo=12"])

View File

@@ -11,4 +11,4 @@ def subtractionFunc(maxMinuend=99, maxDiff=99):
return problem, solution
subtraction = Generator("Subtraction", 1, "a-b=", "c", subtractionFunc)
subtraction = Generator("Subtraction", 1, "a-b=", "c", subtractionFunc, ["maxMinuend=99", "maxDiff=99"])

View File

@@ -25,4 +25,5 @@ def definiteIntegralFunc(max_coeff=100):
definite_integral = Generator(
"Definite Integral of Quadratic Equation", 89,
"The definite integral within limits 0 to 1 of quadratic equation ax^2+bx+c is = ",
"S", definiteIntegralFunc)
"S", definiteIntegralFunc,
["max_coeff=100"])

View File

@@ -1,7 +1,7 @@
from .__init__ import *
def genDifferentiationProblem(diff_lvl):
def genDifferentiationProblem(diff_lvl=2):
problem = ''
types = {
@@ -51,4 +51,5 @@ def differentiationFunc(diff_lvl=2):
differentiation = Generator("Differentiation", 88,
"differentiate w.r.t x : d(f(x))/dx", "g(x)",
differentiationFunc)
differentiationFunc,
["diff_lvl=2"])

View File

@@ -20,4 +20,5 @@ def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5):
power_rule_differentiation = Generator("Power Rule Differentiation", 7,
"nx^m=", "(n*m)x^(m-1)",
powerRuleDifferentiationFunc)
powerRuleDifferentiationFunc,
["maxCoef=10", "maxExp=10", "maxTerms=5"])

View File

@@ -22,4 +22,5 @@ def powerRuleIntegrationFunc(maxCoef=10, maxExp=10, maxTerms=5):
power_rule_integration = Generator("Power Rule Integration", 48, "nx^m=",
"(n/m)x^(m+1)", powerRuleIntegrationFunc)
"(n/m)x^(m+1)", powerRuleIntegrationFunc,
["maxCoef=10", "maxExp=10", "maxTerms=5"])

View File

@@ -21,4 +21,5 @@ def stationaryPointsFunc(maxExp=3, maxCoef=10):
stationary_points = Generator("Stationary Points", 110, "f(x)=x^3-3x",
"(-1,2),(1,-2)", stationaryPointsFunc)
"(-1,2),(1,-2)", stationaryPointsFunc,
["maxExp=3", "maxCoef=10"])

View File

@@ -22,4 +22,5 @@ def BCDtoDecimalFunc(maxNumber=10000):
bcd_to_decimal = Generator("Binary Coded Decimal to Integer", 91,
"Integer of Binary Coded Decimal b is ", "n",
BCDtoDecimalFunc)
BCDtoDecimalFunc,
["maxNumber=10000"])

View File

@@ -30,4 +30,5 @@ def binary2sComplementFunc(maxDigits=10):
binary_2s_complement = Generator("Binary 2's Complement", 73,
"2's complement of 11010110 =", "101010",
binary2sComplementFunc)
binary2sComplementFunc,
["maxDigits=10"])

View File

@@ -16,4 +16,5 @@ def binaryComplement1sFunc(maxDigits=10):
binary_complement_1s = Generator("Binary Complement 1s", 4, "1010=", "0101",
binaryComplement1sFunc)
binaryComplement1sFunc,
["maxDigits=10"])

View File

@@ -13,4 +13,5 @@ def binaryToDecimalFunc(max_dig=10):
binary_to_decimal = Generator("Binary to Decimal", 15, "Decimal of a=", "b",
binaryToDecimalFunc)
binaryToDecimalFunc,
["max_dig=10"])

View File

@@ -12,4 +12,5 @@ def binaryToHexFunc(max_dig=10):
binary_to_hex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=",
"b", binaryToHexFunc)
"b", binaryToHexFunc,
["max_dig=10"])

View File

@@ -18,4 +18,5 @@ def DecimalToBCDFunc(maxNumber=10000):
decimal_to_bcd = Generator("Decimal to Binary Coded Decimal", 103,
"Binary Coded Decimal of Decimal n is ", "b",
DecimalToBCDFunc)
DecimalToBCDFunc,
["maxNumber=10000"])

View File

@@ -12,4 +12,5 @@ def DecimalToBinaryFunc(max_dec=99):
decimal_to_binary = Generator("Decimal to Binary", 14, "Binary of a=", "b",
DecimalToBinaryFunc)
DecimalToBinaryFunc,
["max_dec=99"])

View File

@@ -11,4 +11,5 @@ def deciToHexaFunc(max_dec=1000):
decimal_to_hexadeci = Generator("Decimal to Hexadecimal", 79, "Binary of a=",
"b", deciToHexaFunc)
"b", deciToHexaFunc,
["max_dec=1000"])

View File

@@ -10,4 +10,5 @@ def decimalToOctalFunc(maxDecimal=4096):
decimal_to_octal = Generator("Converts decimal to octal", 84,
"What's the octal representation of 98?", "0o142",
decimalToOctalFunc)
decimalToOctalFunc,
["maxDecimal=4096"])

View File

@@ -23,4 +23,5 @@ def fibonacciSeriesFunc(minNo=1):
fibonacci_series = Generator(
"Fibonacci Series", 56, "fibonacci series of first a numbers",
"prints the fibonacci series starting from 0 to a", fibonacciSeriesFunc)
"prints the fibonacci series starting from 0 to a", fibonacciSeriesFunc,
["minNo=1"])

View File

@@ -11,4 +11,5 @@ def moduloFunc(maxRes=99, maxModulo=99):
return problem, solution
modulo_division = Generator("Modulo Division", 5, "a%b=", "c", moduloFunc)
modulo_division = Generator("Modulo Division", 5, "a%b=", "c", moduloFunc,
["maxRes=99", "maxModulo=99"])

View File

@@ -14,4 +14,5 @@ def nthFibonacciNumberFunc(maxN=100):
nth_fibonacci_number = Generator("nth Fibonacci number", 62,
"What is the nth Fibonacci number", "Fn",
nthFibonacciNumberFunc)
nthFibonacciNumberFunc,
["maxN=100"])

View File

@@ -28,4 +28,5 @@ def angleBtwVectorsFunc(maxEltAmt=20):
angle_btw_vectors = Generator(
"Angle between 2 vectors", 70,
"Angle Between 2 vectors V1=[v11, v12, ..., v1n] and V2=[v21, v22, ....., v2n]",
"V1.V2 / (euclidNorm(V1)*euclidNorm(V2))", angleBtwVectorsFunc)
"V1.V2 / (euclidNorm(V1)*euclidNorm(V2))", angleBtwVectorsFunc,
["maxEltAmt=20"])

View File

@@ -13,4 +13,5 @@ def regularPolygonAngleFunc(minVal=3, maxVal=20):
angle_regular_polygon = Generator(
"Angle of a Regular Polygon", 29,
"Find the angle of a regular polygon with 6 sides", "120",
regularPolygonAngleFunc)
regularPolygonAngleFunc,
["minVal=3", "maxVal=20"])

View File

@@ -14,4 +14,5 @@ def arclengthFunc(maxRadius=49, maxAngle=359):
arc_length = Generator("Arc length of Angle", 108,
" Given the radius, r and angle, ang. Calculate the arc length of the given angle", "(ang/360) * 2 * pi * r", arclengthFunc)
" Given the radius, r and angle, ang. Calculate the arc length of the given angle", "(ang/360) * 2 * pi * r", arclengthFunc,
["maxRadius=49", "maxAngle=359"])

View File

@@ -10,4 +10,5 @@ def areaCircle(maxRadius=100):
return problem, solution
area_of_circle = Generator("Area of Circle", 112, "pi*r*r=", "area", areaCircle)
area_of_circle = Generator("Area of Circle", 112, "pi*r*r=", "area", areaCircle,
["maxRadius=100"])

View File

@@ -17,4 +17,5 @@ def areaOfTriangleFunc(maxA=20, maxB=20, maxC=20):
area_of_triangle = Generator("Area of Triangle", 18,
"Area of Triangle with side lengths a, b, c = ",
"area", areaOfTriangleFunc)
"area", areaOfTriangleFunc,
["maxA=20", "maxB=20", "maxC=20"])

View File

@@ -28,4 +28,5 @@ def basicTrigonometryFunc(angles=[0, 30, 45, 60, 90],
basic_trigonometry = Generator("Trigonometric Values", 57, "What is sin(X)?",
"ans", basicTrigonometryFunc)
"ans", basicTrigonometryFunc,
["angles=[0, 30, 45, 60, 90]","functions=['sin', 'cos', 'tan']"])

View File

@@ -10,4 +10,5 @@ def circumferenceCircle(maxRadius=100):
return problem, solution
circumference = Generator("Circumference", 104, "2*pi*r=", "circumference", circumferenceCircle)
circumference = Generator("Circumference", 104, "2*pi*r=", "circumference", circumferenceCircle,
["maxRadius=100"])

View File

@@ -14,4 +14,5 @@ def curvedSurfaceAreaCylinderFunc(maxRadius=49, maxHeight=99):
curved_surface_area_cylinder = Generator(
"Curved surface area of a cylinder", 95,
"What is CSA of a cylinder of radius, r and height, h?", "csa of cylinder",
curvedSurfaceAreaCylinderFunc)
curvedSurfaceAreaCylinderFunc,
["maxRadius=49", "maxHeight=99"])

View File

@@ -14,4 +14,5 @@ def degreeToRadFunc(max_deg=360):
degree_to_rad = Generator("Degrees to Radians", 86, "Angle a in radians is = ",
"b", degreeToRadFunc)
"b", degreeToRadFunc,
["max_deg=360"])

View File

@@ -17,4 +17,5 @@ def fourthAngleOfQuadriFunc(maxAngle=180):
fourth_angle_of_quadrilateral = Generator(
"Fourth Angle of Quadrilateral", 49,
"Fourth angle of Quadrilateral with angles a,b,c =", "angle4",
fourthAngleOfQuadriFunc)
fourthAngleOfQuadriFunc,
["maxAngle=180"])

View File

@@ -17,4 +17,5 @@ def perimeterOfPolygons(maxSides=12, maxLength=120):
perimeter_of_polygons = Generator(
"Perimeter of Polygons", 96,
"The perimeter of a x sided polygon with lengths of y cm is: ", "z",
perimeterOfPolygons)
perimeterOfPolygons,
["maxSides=12", "maxLength=120"])

View File

@@ -14,4 +14,5 @@ def pythagoreanTheoremFunc(maxLength=20):
pythagorean_theorem = Generator(
"Pythagorean Theorem", 25,
"The hypotenuse of a right triangle given the other two lengths a and b = ",
"hypotenuse", pythagoreanTheoremFunc)
"hypotenuse", pythagoreanTheoremFunc,
["maxLength=20"])

View File

@@ -15,4 +15,5 @@ def radianToDegFunc(max_rad=3):
radian_to_deg = Generator("Radians to Degrees", 87, "Angle a in degrees is = ",
"b", radianToDegFunc)
"b", radianToDegFunc,
["max_rad=3"])

View File

@@ -13,4 +13,5 @@ def sectorAreaFunc(maxRadius=49, maxAngle=359):
sector_area = Generator("Area of a Sector", 75,
"Area of a sector with radius, r and angle, a ",
"Area", sectorAreaFunc)
"Area", sectorAreaFunc,
["maxRadius=49", "maxAngle=359"])

View File

@@ -12,4 +12,5 @@ def sumOfAnglesOfPolygonFunc(maxSides=12):
sum_of_polygon_angles = Generator("Sum of Angles of Polygon", 58,
"Sum of angles of polygon with n sides = ",
"sum", sumOfAnglesOfPolygonFunc)
"sum", sumOfAnglesOfPolygonFunc,
["maxSides=12"])

View File

@@ -16,4 +16,5 @@ def surfaceAreaCone(maxRadius=20, maxHeight=50, unit='m'):
surface_area_cone = Generator(
"Surface Area of cone", 38,
"Surface area of cone with height = a units and radius = b units is",
"c units^2", surfaceAreaCone)
"c units^2", surfaceAreaCone,
["maxRadius=20", "maxHeight=50", "unit='m'"])

View File

@@ -11,4 +11,5 @@ def surfaceAreaCube(maxSide=20, unit='m'):
surface_area_cube = Generator("Surface Area of Cube", 32,
"Surface area of cube with side a units is",
"b units^2", surfaceAreaCube)
"b units^2", surfaceAreaCube,
["maxSide=20", "unit='m'"])

View File

@@ -15,4 +15,5 @@ def surfaceAreaCuboid(maxSide=20, unit='m'):
surface_area_cuboid = Generator(
"Surface Area of Cuboid", 33,
"Surface area of cuboid with sides = a units, b units, c units is",
"d units^2", surfaceAreaCuboid)
"d units^2", surfaceAreaCuboid,
["maxSide=20", "unit='m'"])

View File

@@ -14,4 +14,5 @@ def surfaceAreaCylinder(maxRadius=20, maxHeight=50, unit='m'):
surface_area_cylinder = Generator(
"Surface Area of Cylinder", 34,
"Surface area of cylinder with height = a units and radius = b units is",
"c units^2", surfaceAreaCylinder)
"c units^2", surfaceAreaCylinder,
["maxRadius=20", "maxHeight=50", "unit='m'"])

View File

@@ -13,4 +13,5 @@ def surfaceAreaSphere(maxSide=20, unit='m'):
surface_area_sphere = Generator(
"Surface Area of Sphere", 60,
"Surface area of sphere with radius = a units is", "d units^2",
surfaceAreaSphere)
surfaceAreaSphere,
["maxSide=20", "unit='m'"])

View File

@@ -13,4 +13,5 @@ def thirdAngleOfTriangleFunc(maxAngle=89):
third_angle_of_triangle = Generator("Third Angle of Triangle", 22,
"Third Angle of the triangle = ", "angle3",
thirdAngleOfTriangleFunc)
thirdAngleOfTriangleFunc,
["maxAngle=89"])

View File

@@ -22,4 +22,5 @@ def isTriangleValidFunc(maxSideLength=50):
valid_triangle = Generator("Triangle exists check", 19,
"Does triangle with sides a, b and c exist?",
"Yes/No", isTriangleValidFunc)
"Yes/No", isTriangleValidFunc,
["maxSideLength=50"])

View File

@@ -14,4 +14,5 @@ def volumeCone(maxRadius=20, maxHeight=50, unit='m'):
volume_cone = Generator(
"Volume of cone", 39,
"Volume of cone with height = a units and radius = b units is",
"c units^3", volumeCone)
"c units^3", volumeCone,
["maxRadius=20", "maxHeight=50", "unit='m'"])

View File

@@ -12,4 +12,5 @@ def volumeCube(maxSide=20, unit='m'):
volume_cube = Generator("Volum of Cube", 35,
"Volume of cube with side a units is", "b units^3",
volumeCube)
volumeCube,
["maxSide=20", "unit='m'"])

View File

@@ -15,4 +15,5 @@ def volumeCuboid(maxSide=20, unit='m'):
volume_cuboid = Generator(
"Volume of Cuboid", 36,
"Volume of cuboid with sides = a units, b units, c units is", "d units^3",
volumeCuboid)
volumeCuboid,
["maxSide=20", "unit='m'"])

View File

@@ -14,4 +14,5 @@ def volumeCylinder(maxRadius=20, maxHeight=50, unit='m'):
volume_cylinder = Generator(
"Volume of cylinder", 37,
"Volume of cylinder with height = a units and radius = b units is",
"c units^3", volumeCylinder)
"c units^3", volumeCylinder,
["maxRadius=20", "maxHeight=50", "unit='m'"])

View File

@@ -12,4 +12,5 @@ def volumeSphereFunc(maxRadius=100):
volume_sphere = Generator("Volume of Sphere", 61,
"Volume of sphere with radius r m = ",
"(4*pi/3)*r*r*r", volumeSphereFunc)
"(4*pi/3)*r*r*r", volumeSphereFunc,
["maxRadius=100"])

View File

@@ -17,4 +17,5 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100):
arithmetic_progression_sum = Generator(
"AP Sum Calculation", 83,
"Find the sum of first n terms of the AP series: a1, a2, a3 ...", "Sum",
arithmeticProgressionSumFunc)
arithmeticProgressionSumFunc,
["maxd=100", "maxa=100", "maxn=100"])

View File

@@ -17,4 +17,5 @@ def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100):
arithmetic_progression_term = Generator(
"AP Term Calculation", 82,
"Find the term number n of the AP series: a1, a2, a3 ...", "a-n",
arithmeticProgressionTermFunc)
arithmeticProgressionTermFunc,
["maxd=100", "maxa=100", "maxn=100"])

View File

@@ -55,4 +55,5 @@ def baseConversionFunc(maxNum=60000, maxBase=16):
base_conversion = Generator("Base Conversion", 94,
"Convert 152346 from base 8 to base 10.", "54502",
baseConversionFunc)
baseConversionFunc,
["maxNum=60000", "maxBase=16"])

View File

@@ -39,4 +39,4 @@ def binomialDistFunc():
binomial_distribution = Generator("Binomial distribution", 109,
"P(X<x)=", "c", binomialDistFunc)
"P(X<x)=", "c", binomialDistFunc, [""])

View File

@@ -12,4 +12,5 @@ def celsiustofahrenheitFunc(maxTemp=100):
celsius_to_fahrenheit = Generator("Celsius To Fahrenheit", 81,
"(C +(9/5))+32=", "F",
celsiustofahrenheitFunc)
celsiustofahrenheitFunc,
["maxTemp=100"])

View File

@@ -26,4 +26,5 @@ def commonFactorsFunc(maxVal=100):
common_factors = Generator("Common Factors", 40,
"Common Factors of {a} and {b} = ", "[c, d, ...]",
commonFactorsFunc)
commonFactorsFunc,
["maxVal=100"])

View File

@@ -17,4 +17,5 @@ def complexToPolarFunc(minRealImaginaryNum=-20, maxRealImaginaryNum=20):
complex_to_polar = Generator("Complex To Polar Form", 92, "rexp(itheta) = ",
"plr", complexToPolarFunc)
"plr", complexToPolarFunc,
["minRealImaginaryNum=-20, maxRealImaginaryNum=20"])

View File

@@ -37,4 +37,5 @@ def decimalToRomanNumeralsFunc(maxDecimal=4000):
decimal_to_roman_numerals = Generator("Converts decimal to Roman Numerals", 85,
"Convert 20 into Roman Numerals", "XX",
decimalToRomanNumeralsFunc)
decimalToRomanNumeralsFunc,
["maxDecimal=4000"])

View File

@@ -15,4 +15,5 @@ def euclidianNormFunc(maxEltAmt=20):
eucldian_norm = Generator(
"Euclidian norm or L2 norm of a vector", 69,
"Euclidian Norm of a vector V:[v1, v2, ......., vn]",
"sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc)
"sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc,
["maxEltAmt=20"])

View File

@@ -13,4 +13,5 @@ def gcdFunc(maxVal=20):
gcd = Generator("GCD (Greatest Common Denominator)", 10, "GCD of a and b = ",
"c", gcdFunc)
"c", gcdFunc,
["maxVal=20"])

View File

@@ -30,4 +30,5 @@ def geometricMeanFunc(maxValue=100, maxNum=4):
geometric_mean = Generator(
"Geometric Mean of N Numbers", 67,
"Geometric mean of n numbers A1 , A2 , ... , An = ",
"(A1*A2*...An)^(1/n) = ans", geometricMeanFunc)
"(A1*A2*...An)^(1/n) = ans", geometricMeanFunc,
["maxValue=100", "maxNum=4"])

View File

@@ -26,4 +26,5 @@ def geomProgrFunc(number_values=6,
geometric_progression = Generator(
"Geometric Progression", 66,
"Initial value,Common Ratio,nth Term,Sum till nth term =",
"a,r,ar^n-1,sum(ar^n-1", geomProgrFunc)
"a,r,ar^n-1,sum(ar^n-1", geomProgrFunc,
["number_values=6", "min_value=2", "max_value=12", "n_term=7", "sum_term=5"])

View File

@@ -31,4 +31,5 @@ def harmonicMeanFunc(maxValue=100, maxNum=4):
harmonic_mean = Generator("Harmonic Mean of N Numbers", 68,
"Harmonic mean of n numbers A1 , A2 , ... , An = ",
" n/((1/A1) + (1/A2) + ... + (1/An)) = ans",
harmonicMeanFunc)
harmonicMeanFunc,
["maxValue=100", "maxNum=4"])

View File

@@ -13,4 +13,5 @@ def hcfFunc(maxVal=20):
hcf = Generator("HCF (Highest Common Factor)", 51, "HCF of a and b = ", "c",
hcfFunc)
hcfFunc,
["maxVal=20"])

View File

@@ -21,5 +21,5 @@ def IsLeapYear(minNumber=1900, maxNumber=2099):
is_leap_year = Generator("Leap Year or Not", 101,
"Year y ", "is/not a leap year",
IsLeapYear)
# for readme ## | 102 | Leap Year or Not | Year 1964 | is a leap year | is_leap_year |
IsLeapYear,
["minNumber=1900", "maxNumber=2099"])

View File

@@ -18,4 +18,5 @@ def lcmFunc(maxVal=20):
lcm = Generator("LCM (Least Common Multiple)", 9, "LCM of a and b = ", "c",
lcmFunc)
lcmFunc,
["maxVal=20"])

View File

@@ -11,4 +11,5 @@ def minutesToHoursFunc(maxMinutes=999):
minutes_to_hours = Generator("Minute to Hour conversion", 102,
"Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc)
"Convert minutes to Hours & Minutes", "hours:minutes", minutesToHoursFunc,
["maxMinutes=999"])

Some files were not shown because too many files have changed in this diff Show More