From 5f2a5ab2366f655d77d9e8e0321e4f2edd34f325 Mon Sep 17 00:00:00 2001 From: lukew3 Date: Mon, 19 Oct 2020 19:22:51 -0400 Subject: [PATCH 1/4] import generator in each module --- mathgenerator/funcs/BinaryToDecimalFunc.py | 1 + mathgenerator/funcs/DecimalToBinaryFunc.py | 1 + mathgenerator/funcs/DiceSumProbFunc.py | 1 + mathgenerator/funcs/MidPointOfTwoPointFunc.py | 1 + mathgenerator/funcs/absoluteDifferenceFunc.py | 1 + mathgenerator/funcs/angleBtwVectorsFunc.py | 1 + mathgenerator/funcs/areaOfTriangleFunc.py | 1 + mathgenerator/funcs/arithmeticProgressionSumFunc.py | 1 + mathgenerator/funcs/arithmeticProgressionTermFunc.py | 1 + mathgenerator/funcs/basicAlgebraFunc.py | 1 + mathgenerator/funcs/basicTrigonometryFunc.py | 1 + mathgenerator/funcs/binary2sComplement.py | 1 + mathgenerator/funcs/binaryComplement1sFunc.py | 1 + mathgenerator/funcs/binaryToHexFunc.py | 1 + mathgenerator/funcs/combinationsFunc.py | 1 + mathgenerator/funcs/commonFactorsFunc.py | 1 + mathgenerator/funcs/compareFractionsFunc.py | 1 + mathgenerator/funcs/compoundInterestFunc.py | 1 + mathgenerator/funcs/confidenceIntervalFunc.py | 1 + mathgenerator/funcs/cubeRootFunc.py | 1 + mathgenerator/funcs/dataSummaryFunc.py | 1 + mathgenerator/funcs/deciToHexaFunc.py | 1 + mathgenerator/funcs/determinantToMatrix22.py | 1 + mathgenerator/funcs/distanceTwoPointsFunc.py | 1 + mathgenerator/funcs/divideFractionsFunc.py | 1 + mathgenerator/funcs/divisionFunc.py | 1 + mathgenerator/funcs/divisionToIntFunc.py | 1 + mathgenerator/funcs/euclidianNormFunc.py | 1 + mathgenerator/funcs/exponentiationFunc.py | 1 + mathgenerator/funcs/factorialFunc.py | 1 + mathgenerator/funcs/factoringFunc.py | 1 + mathgenerator/funcs/fibonacciSeriesFunc.py | 1 + mathgenerator/funcs/fourthAngleOfQuadriFunc.py | 1 + mathgenerator/funcs/gcdFunc.py | 1 + mathgenerator/funcs/geomProgrFunc.py | 1 + mathgenerator/funcs/geometricMeanFunc.py | 1 + mathgenerator/funcs/harmonicMeanFunc.py | 1 + mathgenerator/funcs/hcfFunc.py | 1 + mathgenerator/funcs/intersectionOfTwoLinesFunc.py | 1 + mathgenerator/funcs/isTriangleValidFunc.py | 1 + mathgenerator/funcs/lcmFunc.py | 1 + mathgenerator/funcs/linearEquationsFunc.py | 1 + mathgenerator/funcs/logFunc.py | 1 + mathgenerator/funcs/matrixInversion.py | 1 + mathgenerator/funcs/matrixMultiplicationFunc.py | 1 + mathgenerator/funcs/meanMedianFunc.py | 1 + mathgenerator/funcs/moduloFunc.py | 1 + mathgenerator/funcs/multiplicationFunc.py | 1 + mathgenerator/funcs/multiplyComplexNumbersFunc.py | 1 + mathgenerator/funcs/multiplyFractionsFunc.py | 1 + mathgenerator/funcs/multiplyIntToMatrix22.py | 1 + mathgenerator/funcs/nthFibonacciNumberFunc.py | 1 + mathgenerator/funcs/percentageFunc.py | 1 + mathgenerator/funcs/permutationFunc.py | 1 + mathgenerator/funcs/powerRuleDifferentiationFunc.py | 1 + mathgenerator/funcs/powerRuleIntegrationFunc.py | 1 + mathgenerator/funcs/primeFactorsFunc.py | 1 + mathgenerator/funcs/profitLossPercentFunc.py | 1 + mathgenerator/funcs/pythagoreanTheoremFunc.py | 1 + mathgenerator/funcs/quadraticEquation.py | 1 + mathgenerator/funcs/regularPolygonAngleFunc.py | 1 + mathgenerator/funcs/sectorAreaFunc.py | 1 + mathgenerator/funcs/simpleInterestFunc.py | 1 + mathgenerator/funcs/squareFunc.py | 1 + mathgenerator/funcs/squareRootFunc.py | 1 + mathgenerator/funcs/subtractionFunc.py | 1 + mathgenerator/funcs/sumOfAnglesOfPolygonFunc.py | 1 + mathgenerator/funcs/surdsComparisonFunc.py | 1 + mathgenerator/funcs/surfaceAreaCone.py | 1 + mathgenerator/funcs/surfaceAreaCube.py | 1 + mathgenerator/funcs/surfaceAreaCuboid.py | 1 + mathgenerator/funcs/surfaceAreaCylinder.py | 1 + mathgenerator/funcs/surfaceAreaSphere.py | 1 + mathgenerator/funcs/systemOfEquationsFunc.py | 1 + mathgenerator/funcs/thirdAngleOfTriangleFunc.py | 1 + mathgenerator/funcs/vectorCrossFunc.py | 1 + mathgenerator/funcs/vectorDotFunc.py | 1 + mathgenerator/funcs/volumeCone.py | 1 + mathgenerator/funcs/volumeCube.py | 1 + mathgenerator/funcs/volumeCuboid.py | 1 + mathgenerator/funcs/volumeCylinder.py | 1 + mathgenerator/funcs/volumeSphereFunc.py | 1 + 82 files changed, 82 insertions(+) diff --git a/mathgenerator/funcs/BinaryToDecimalFunc.py b/mathgenerator/funcs/BinaryToDecimalFunc.py index 9d2b25d..f975ded 100644 --- a/mathgenerator/funcs/BinaryToDecimalFunc.py +++ b/mathgenerator/funcs/BinaryToDecimalFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def BinaryToDecimalFunc(max_dig=10): diff --git a/mathgenerator/funcs/DecimalToBinaryFunc.py b/mathgenerator/funcs/DecimalToBinaryFunc.py index 872e105..2baaeeb 100644 --- a/mathgenerator/funcs/DecimalToBinaryFunc.py +++ b/mathgenerator/funcs/DecimalToBinaryFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def DecimalToBinaryFunc(max_dec=99): diff --git a/mathgenerator/funcs/DiceSumProbFunc.py b/mathgenerator/funcs/DiceSumProbFunc.py index 8f05a4f..0bb00c9 100644 --- a/mathgenerator/funcs/DiceSumProbFunc.py +++ b/mathgenerator/funcs/DiceSumProbFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def DiceSumProbFunc(maxDice=3): diff --git a/mathgenerator/funcs/MidPointOfTwoPointFunc.py b/mathgenerator/funcs/MidPointOfTwoPointFunc.py index f8cd8a1..98d91b0 100644 --- a/mathgenerator/funcs/MidPointOfTwoPointFunc.py +++ b/mathgenerator/funcs/MidPointOfTwoPointFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def MidPointOfTwoPointFunc(maxValue=20): diff --git a/mathgenerator/funcs/absoluteDifferenceFunc.py b/mathgenerator/funcs/absoluteDifferenceFunc.py index 138c8de..065e6a6 100644 --- a/mathgenerator/funcs/absoluteDifferenceFunc.py +++ b/mathgenerator/funcs/absoluteDifferenceFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def absoluteDifferenceFunc(maxA=100, maxB=100): diff --git a/mathgenerator/funcs/angleBtwVectorsFunc.py b/mathgenerator/funcs/angleBtwVectorsFunc.py index 927ca38..6e45eeb 100644 --- a/mathgenerator/funcs/angleBtwVectorsFunc.py +++ b/mathgenerator/funcs/angleBtwVectorsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def angleBtwVectorsFunc(maxEltAmt=20): diff --git a/mathgenerator/funcs/areaOfTriangleFunc.py b/mathgenerator/funcs/areaOfTriangleFunc.py index a795a99..6d4ee66 100644 --- a/mathgenerator/funcs/areaOfTriangleFunc.py +++ b/mathgenerator/funcs/areaOfTriangleFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def areaOfTriangleFunc(maxA=20, maxB=20, maxC=20): diff --git a/mathgenerator/funcs/arithmeticProgressionSumFunc.py b/mathgenerator/funcs/arithmeticProgressionSumFunc.py index 517d713..b441d16 100644 --- a/mathgenerator/funcs/arithmeticProgressionSumFunc.py +++ b/mathgenerator/funcs/arithmeticProgressionSumFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100): diff --git a/mathgenerator/funcs/arithmeticProgressionTermFunc.py b/mathgenerator/funcs/arithmeticProgressionTermFunc.py index 63cca09..ff67f60 100644 --- a/mathgenerator/funcs/arithmeticProgressionTermFunc.py +++ b/mathgenerator/funcs/arithmeticProgressionTermFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100): diff --git a/mathgenerator/funcs/basicAlgebraFunc.py b/mathgenerator/funcs/basicAlgebraFunc.py index d11000d..0060883 100644 --- a/mathgenerator/funcs/basicAlgebraFunc.py +++ b/mathgenerator/funcs/basicAlgebraFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def basicAlgebraFunc(maxVariable=10): diff --git a/mathgenerator/funcs/basicTrigonometryFunc.py b/mathgenerator/funcs/basicTrigonometryFunc.py index 520b8a3..2a6f5ce 100644 --- a/mathgenerator/funcs/basicTrigonometryFunc.py +++ b/mathgenerator/funcs/basicTrigonometryFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator # Handles degrees in quadrant one diff --git a/mathgenerator/funcs/binary2sComplement.py b/mathgenerator/funcs/binary2sComplement.py index 01af731..6fe00f8 100644 --- a/mathgenerator/funcs/binary2sComplement.py +++ b/mathgenerator/funcs/binary2sComplement.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def binary2sComplementFunc(maxDigits=10): diff --git a/mathgenerator/funcs/binaryComplement1sFunc.py b/mathgenerator/funcs/binaryComplement1sFunc.py index 009feea..dcc9796 100644 --- a/mathgenerator/funcs/binaryComplement1sFunc.py +++ b/mathgenerator/funcs/binaryComplement1sFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def binaryComplement1sFunc(maxDigits=10): diff --git a/mathgenerator/funcs/binaryToHexFunc.py b/mathgenerator/funcs/binaryToHexFunc.py index f06fcfc..0523f8d 100644 --- a/mathgenerator/funcs/binaryToHexFunc.py +++ b/mathgenerator/funcs/binaryToHexFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def binaryToHexFunc(max_dig=10): diff --git a/mathgenerator/funcs/combinationsFunc.py b/mathgenerator/funcs/combinationsFunc.py index f213222..e0c7078 100644 --- a/mathgenerator/funcs/combinationsFunc.py +++ b/mathgenerator/funcs/combinationsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def combinationsFunc(maxlength=20): diff --git a/mathgenerator/funcs/commonFactorsFunc.py b/mathgenerator/funcs/commonFactorsFunc.py index 82a0e3b..eab088f 100644 --- a/mathgenerator/funcs/commonFactorsFunc.py +++ b/mathgenerator/funcs/commonFactorsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def commonFactorsFunc(maxVal=100): diff --git a/mathgenerator/funcs/compareFractionsFunc.py b/mathgenerator/funcs/compareFractionsFunc.py index 1c4072a..c681d49 100644 --- a/mathgenerator/funcs/compareFractionsFunc.py +++ b/mathgenerator/funcs/compareFractionsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def compareFractionsFunc(maxVal=10): diff --git a/mathgenerator/funcs/compoundInterestFunc.py b/mathgenerator/funcs/compoundInterestFunc.py index 7914828..964bfb1 100644 --- a/mathgenerator/funcs/compoundInterestFunc.py +++ b/mathgenerator/funcs/compoundInterestFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def compoundInterestFunc(maxPrinciple=10000, diff --git a/mathgenerator/funcs/confidenceIntervalFunc.py b/mathgenerator/funcs/confidenceIntervalFunc.py index b631caf..8f7abc5 100644 --- a/mathgenerator/funcs/confidenceIntervalFunc.py +++ b/mathgenerator/funcs/confidenceIntervalFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def confidenceIntervalFunc(): diff --git a/mathgenerator/funcs/cubeRootFunc.py b/mathgenerator/funcs/cubeRootFunc.py index 97b978d..a2e7ebf 100644 --- a/mathgenerator/funcs/cubeRootFunc.py +++ b/mathgenerator/funcs/cubeRootFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def cubeRootFunc(minNo=1, maxNo=1000): diff --git a/mathgenerator/funcs/dataSummaryFunc.py b/mathgenerator/funcs/dataSummaryFunc.py index 1059b1f..275d372 100644 --- a/mathgenerator/funcs/dataSummaryFunc.py +++ b/mathgenerator/funcs/dataSummaryFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def dataSummaryFunc(number_values=15, minval=5, maxval=50): diff --git a/mathgenerator/funcs/deciToHexaFunc.py b/mathgenerator/funcs/deciToHexaFunc.py index 5958dfa..3b76371 100644 --- a/mathgenerator/funcs/deciToHexaFunc.py +++ b/mathgenerator/funcs/deciToHexaFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def deciToHexaFunc(max_dec=1000): diff --git a/mathgenerator/funcs/determinantToMatrix22.py b/mathgenerator/funcs/determinantToMatrix22.py index 33b4004..2d9c40e 100644 --- a/mathgenerator/funcs/determinantToMatrix22.py +++ b/mathgenerator/funcs/determinantToMatrix22.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def determinantToMatrix22(maxMatrixVal=100): diff --git a/mathgenerator/funcs/distanceTwoPointsFunc.py b/mathgenerator/funcs/distanceTwoPointsFunc.py index 9fa85c8..6e447e3 100644 --- a/mathgenerator/funcs/distanceTwoPointsFunc.py +++ b/mathgenerator/funcs/distanceTwoPointsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def distanceTwoPointsFunc(maxValXY=20, minValXY=-20): diff --git a/mathgenerator/funcs/divideFractionsFunc.py b/mathgenerator/funcs/divideFractionsFunc.py index 970b28f..19432f7 100644 --- a/mathgenerator/funcs/divideFractionsFunc.py +++ b/mathgenerator/funcs/divideFractionsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def divideFractionsFunc(maxVal=10): diff --git a/mathgenerator/funcs/divisionFunc.py b/mathgenerator/funcs/divisionFunc.py index 930e34b..da1fa47 100644 --- a/mathgenerator/funcs/divisionFunc.py +++ b/mathgenerator/funcs/divisionFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def divisionFunc(maxRes=99, maxDivid=99): diff --git a/mathgenerator/funcs/divisionToIntFunc.py b/mathgenerator/funcs/divisionToIntFunc.py index fcc62f5..959d322 100644 --- a/mathgenerator/funcs/divisionToIntFunc.py +++ b/mathgenerator/funcs/divisionToIntFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def divisionToIntFunc(maxA=25, maxB=25): diff --git a/mathgenerator/funcs/euclidianNormFunc.py b/mathgenerator/funcs/euclidianNormFunc.py index 28c85c5..7e14f26 100644 --- a/mathgenerator/funcs/euclidianNormFunc.py +++ b/mathgenerator/funcs/euclidianNormFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def euclidianNormFunc(maxEltAmt=20): diff --git a/mathgenerator/funcs/exponentiationFunc.py b/mathgenerator/funcs/exponentiationFunc.py index a74f378..6201b4f 100644 --- a/mathgenerator/funcs/exponentiationFunc.py +++ b/mathgenerator/funcs/exponentiationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def exponentiationFunc(maxBase=20, maxExpo=10): diff --git a/mathgenerator/funcs/factorialFunc.py b/mathgenerator/funcs/factorialFunc.py index 71dc3a2..e242159 100644 --- a/mathgenerator/funcs/factorialFunc.py +++ b/mathgenerator/funcs/factorialFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def factorialFunc(maxInput=6): diff --git a/mathgenerator/funcs/factoringFunc.py b/mathgenerator/funcs/factoringFunc.py index 1cb43c0..3858ef0 100644 --- a/mathgenerator/funcs/factoringFunc.py +++ b/mathgenerator/funcs/factoringFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def factoringFunc(range_x1=10, range_x2=10): diff --git a/mathgenerator/funcs/fibonacciSeriesFunc.py b/mathgenerator/funcs/fibonacciSeriesFunc.py index 60391cb..e668f46 100644 --- a/mathgenerator/funcs/fibonacciSeriesFunc.py +++ b/mathgenerator/funcs/fibonacciSeriesFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def fibonacciSeriesFunc(minNo=1): diff --git a/mathgenerator/funcs/fourthAngleOfQuadriFunc.py b/mathgenerator/funcs/fourthAngleOfQuadriFunc.py index 59a05c4..5307746 100644 --- a/mathgenerator/funcs/fourthAngleOfQuadriFunc.py +++ b/mathgenerator/funcs/fourthAngleOfQuadriFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def fourthAngleOfQuadriFunc(maxAngle=180): diff --git a/mathgenerator/funcs/gcdFunc.py b/mathgenerator/funcs/gcdFunc.py index 505c7fb..c087db6 100644 --- a/mathgenerator/funcs/gcdFunc.py +++ b/mathgenerator/funcs/gcdFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def gcdFunc(maxVal=20): diff --git a/mathgenerator/funcs/geomProgrFunc.py b/mathgenerator/funcs/geomProgrFunc.py index 7c80a7e..f638c8a 100644 --- a/mathgenerator/funcs/geomProgrFunc.py +++ b/mathgenerator/funcs/geomProgrFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def geomProgrFunc(number_values=6, diff --git a/mathgenerator/funcs/geometricMeanFunc.py b/mathgenerator/funcs/geometricMeanFunc.py index 0980979..11085fa 100644 --- a/mathgenerator/funcs/geometricMeanFunc.py +++ b/mathgenerator/funcs/geometricMeanFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def geometricMeanFunc(maxValue=100, maxNum=4): diff --git a/mathgenerator/funcs/harmonicMeanFunc.py b/mathgenerator/funcs/harmonicMeanFunc.py index 8aefb41..22e6a86 100644 --- a/mathgenerator/funcs/harmonicMeanFunc.py +++ b/mathgenerator/funcs/harmonicMeanFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def harmonicMeanFunc(maxValue=100, maxNum=4): diff --git a/mathgenerator/funcs/hcfFunc.py b/mathgenerator/funcs/hcfFunc.py index 047fb0c..8faa555 100644 --- a/mathgenerator/funcs/hcfFunc.py +++ b/mathgenerator/funcs/hcfFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def hcfFunc(maxVal=20): diff --git a/mathgenerator/funcs/intersectionOfTwoLinesFunc.py b/mathgenerator/funcs/intersectionOfTwoLinesFunc.py index eda508e..829f8e3 100644 --- a/mathgenerator/funcs/intersectionOfTwoLinesFunc.py +++ b/mathgenerator/funcs/intersectionOfTwoLinesFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def intersectionOfTwoLinesFunc(minM=-10, diff --git a/mathgenerator/funcs/isTriangleValidFunc.py b/mathgenerator/funcs/isTriangleValidFunc.py index 13c7240..d662e4e 100644 --- a/mathgenerator/funcs/isTriangleValidFunc.py +++ b/mathgenerator/funcs/isTriangleValidFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def isTriangleValidFunc(maxSideLength=50): diff --git a/mathgenerator/funcs/lcmFunc.py b/mathgenerator/funcs/lcmFunc.py index 32e1868..bf3b93f 100644 --- a/mathgenerator/funcs/lcmFunc.py +++ b/mathgenerator/funcs/lcmFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def lcmFunc(maxVal=20): diff --git a/mathgenerator/funcs/linearEquationsFunc.py b/mathgenerator/funcs/linearEquationsFunc.py index e2eeb26..b7fed0e 100644 --- a/mathgenerator/funcs/linearEquationsFunc.py +++ b/mathgenerator/funcs/linearEquationsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def linearEquationsFunc(n=2, varRange=20, coeffRange=20): diff --git a/mathgenerator/funcs/logFunc.py b/mathgenerator/funcs/logFunc.py index 6fc651b..96c611a 100644 --- a/mathgenerator/funcs/logFunc.py +++ b/mathgenerator/funcs/logFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def logFunc(maxBase=3, maxVal=8): diff --git a/mathgenerator/funcs/matrixInversion.py b/mathgenerator/funcs/matrixInversion.py index 72c01ca..366207f 100644 --- a/mathgenerator/funcs/matrixInversion.py +++ b/mathgenerator/funcs/matrixInversion.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator import sympy diff --git a/mathgenerator/funcs/matrixMultiplicationFunc.py b/mathgenerator/funcs/matrixMultiplicationFunc.py index 3b1f20b..7190265 100644 --- a/mathgenerator/funcs/matrixMultiplicationFunc.py +++ b/mathgenerator/funcs/matrixMultiplicationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def matrixMultiplicationFunc(maxVal=100, max_dim=10): diff --git a/mathgenerator/funcs/meanMedianFunc.py b/mathgenerator/funcs/meanMedianFunc.py index 4b17846..5eb954a 100644 --- a/mathgenerator/funcs/meanMedianFunc.py +++ b/mathgenerator/funcs/meanMedianFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def meanMedianFunc(maxlen=10): diff --git a/mathgenerator/funcs/moduloFunc.py b/mathgenerator/funcs/moduloFunc.py index 2a447c4..9cf3a3b 100644 --- a/mathgenerator/funcs/moduloFunc.py +++ b/mathgenerator/funcs/moduloFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def moduloFunc(maxRes=99, maxModulo=99): diff --git a/mathgenerator/funcs/multiplicationFunc.py b/mathgenerator/funcs/multiplicationFunc.py index 8ad25f6..017b5cd 100644 --- a/mathgenerator/funcs/multiplicationFunc.py +++ b/mathgenerator/funcs/multiplicationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def multiplicationFunc(maxRes=99, maxMulti=99): diff --git a/mathgenerator/funcs/multiplyComplexNumbersFunc.py b/mathgenerator/funcs/multiplyComplexNumbersFunc.py index f1842c2..63f0280 100644 --- a/mathgenerator/funcs/multiplyComplexNumbersFunc.py +++ b/mathgenerator/funcs/multiplyComplexNumbersFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def multiplyComplexNumbersFunc(minRealImaginaryNum=-20, diff --git a/mathgenerator/funcs/multiplyFractionsFunc.py b/mathgenerator/funcs/multiplyFractionsFunc.py index 1ec38bb..a71c5c9 100644 --- a/mathgenerator/funcs/multiplyFractionsFunc.py +++ b/mathgenerator/funcs/multiplyFractionsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def multiplyFractionsFunc(maxVal=10): diff --git a/mathgenerator/funcs/multiplyIntToMatrix22.py b/mathgenerator/funcs/multiplyIntToMatrix22.py index 7808afe..e96d595 100644 --- a/mathgenerator/funcs/multiplyIntToMatrix22.py +++ b/mathgenerator/funcs/multiplyIntToMatrix22.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def multiplyIntToMatrix22(maxMatrixVal=10, maxRes=100): diff --git a/mathgenerator/funcs/nthFibonacciNumberFunc.py b/mathgenerator/funcs/nthFibonacciNumberFunc.py index b7475ee..bcbc784 100644 --- a/mathgenerator/funcs/nthFibonacciNumberFunc.py +++ b/mathgenerator/funcs/nthFibonacciNumberFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def nthFibonacciNumberFunc(maxN=100): diff --git a/mathgenerator/funcs/percentageFunc.py b/mathgenerator/funcs/percentageFunc.py index f064f2a..eeba61f 100644 --- a/mathgenerator/funcs/percentageFunc.py +++ b/mathgenerator/funcs/percentageFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def percentageFunc(maxValue=99, maxpercentage=99): diff --git a/mathgenerator/funcs/permutationFunc.py b/mathgenerator/funcs/permutationFunc.py index c62841f..6ef5670 100644 --- a/mathgenerator/funcs/permutationFunc.py +++ b/mathgenerator/funcs/permutationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def permutationFunc(maxlength=20): diff --git a/mathgenerator/funcs/powerRuleDifferentiationFunc.py b/mathgenerator/funcs/powerRuleDifferentiationFunc.py index a14bd90..774a80d 100644 --- a/mathgenerator/funcs/powerRuleDifferentiationFunc.py +++ b/mathgenerator/funcs/powerRuleDifferentiationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def powerRuleDifferentiationFunc(maxCoef=10, maxExp=10, maxTerms=5): diff --git a/mathgenerator/funcs/powerRuleIntegrationFunc.py b/mathgenerator/funcs/powerRuleIntegrationFunc.py index fb1f62d..25a3861 100644 --- a/mathgenerator/funcs/powerRuleIntegrationFunc.py +++ b/mathgenerator/funcs/powerRuleIntegrationFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def powerRuleIntegrationFunc(maxCoef=10, maxExp=10, maxTerms=5): diff --git a/mathgenerator/funcs/primeFactorsFunc.py b/mathgenerator/funcs/primeFactorsFunc.py index 852821c..71fa1d0 100644 --- a/mathgenerator/funcs/primeFactorsFunc.py +++ b/mathgenerator/funcs/primeFactorsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def primeFactorsFunc(minVal=1, maxVal=200): diff --git a/mathgenerator/funcs/profitLossPercentFunc.py b/mathgenerator/funcs/profitLossPercentFunc.py index da99f94..7a6fd9e 100644 --- a/mathgenerator/funcs/profitLossPercentFunc.py +++ b/mathgenerator/funcs/profitLossPercentFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def profitLossPercentFunc(maxCP=1000, maxSP=1000): diff --git a/mathgenerator/funcs/pythagoreanTheoremFunc.py b/mathgenerator/funcs/pythagoreanTheoremFunc.py index 17bcd82..2e9c2e3 100644 --- a/mathgenerator/funcs/pythagoreanTheoremFunc.py +++ b/mathgenerator/funcs/pythagoreanTheoremFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def pythagoreanTheoremFunc(maxLength=20): diff --git a/mathgenerator/funcs/quadraticEquation.py b/mathgenerator/funcs/quadraticEquation.py index 7f784fc..c862ae0 100644 --- a/mathgenerator/funcs/quadraticEquation.py +++ b/mathgenerator/funcs/quadraticEquation.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def quadraticEquation(maxVal=100): diff --git a/mathgenerator/funcs/regularPolygonAngleFunc.py b/mathgenerator/funcs/regularPolygonAngleFunc.py index 5275bef..d8d308a 100644 --- a/mathgenerator/funcs/regularPolygonAngleFunc.py +++ b/mathgenerator/funcs/regularPolygonAngleFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def regularPolygonAngleFunc(minVal=3, maxVal=20): diff --git a/mathgenerator/funcs/sectorAreaFunc.py b/mathgenerator/funcs/sectorAreaFunc.py index c2ab0bf..4785557 100644 --- a/mathgenerator/funcs/sectorAreaFunc.py +++ b/mathgenerator/funcs/sectorAreaFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def sectorAreaFunc(maxRadius=49, maxAngle=359): diff --git a/mathgenerator/funcs/simpleInterestFunc.py b/mathgenerator/funcs/simpleInterestFunc.py index 30ca938..aa5aae2 100644 --- a/mathgenerator/funcs/simpleInterestFunc.py +++ b/mathgenerator/funcs/simpleInterestFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def simpleInterestFunc(maxPrinciple=10000, maxRate=10, maxTime=10): diff --git a/mathgenerator/funcs/squareFunc.py b/mathgenerator/funcs/squareFunc.py index 1d159dc..78c55e0 100644 --- a/mathgenerator/funcs/squareFunc.py +++ b/mathgenerator/funcs/squareFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def squareFunc(maxSquareNum=20): diff --git a/mathgenerator/funcs/squareRootFunc.py b/mathgenerator/funcs/squareRootFunc.py index e5d2418..2c09168 100644 --- a/mathgenerator/funcs/squareRootFunc.py +++ b/mathgenerator/funcs/squareRootFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def squareRootFunc(minNo=1, maxNo=12): diff --git a/mathgenerator/funcs/subtractionFunc.py b/mathgenerator/funcs/subtractionFunc.py index a50537e..ecac4e5 100644 --- a/mathgenerator/funcs/subtractionFunc.py +++ b/mathgenerator/funcs/subtractionFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def subtractionFunc(maxMinuend=99, maxDiff=99): diff --git a/mathgenerator/funcs/sumOfAnglesOfPolygonFunc.py b/mathgenerator/funcs/sumOfAnglesOfPolygonFunc.py index 8338698..9e7ff89 100644 --- a/mathgenerator/funcs/sumOfAnglesOfPolygonFunc.py +++ b/mathgenerator/funcs/sumOfAnglesOfPolygonFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def sumOfAnglesOfPolygonFunc(maxSides=12): diff --git a/mathgenerator/funcs/surdsComparisonFunc.py b/mathgenerator/funcs/surdsComparisonFunc.py index e005d3f..4ee3e30 100644 --- a/mathgenerator/funcs/surdsComparisonFunc.py +++ b/mathgenerator/funcs/surdsComparisonFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surdsComparisonFunc(maxValue=100, maxRoot=10): diff --git a/mathgenerator/funcs/surfaceAreaCone.py b/mathgenerator/funcs/surfaceAreaCone.py index 53799aa..d8cb21c 100644 --- a/mathgenerator/funcs/surfaceAreaCone.py +++ b/mathgenerator/funcs/surfaceAreaCone.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surfaceAreaCone(maxRadius=20, maxHeight=50, unit='m'): diff --git a/mathgenerator/funcs/surfaceAreaCube.py b/mathgenerator/funcs/surfaceAreaCube.py index 9f9d07f..2452a05 100644 --- a/mathgenerator/funcs/surfaceAreaCube.py +++ b/mathgenerator/funcs/surfaceAreaCube.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surfaceAreaCube(maxSide=20, unit='m'): diff --git a/mathgenerator/funcs/surfaceAreaCuboid.py b/mathgenerator/funcs/surfaceAreaCuboid.py index 95fee71..f1b8205 100644 --- a/mathgenerator/funcs/surfaceAreaCuboid.py +++ b/mathgenerator/funcs/surfaceAreaCuboid.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surfaceAreaCuboid(maxSide=20, unit='m'): diff --git a/mathgenerator/funcs/surfaceAreaCylinder.py b/mathgenerator/funcs/surfaceAreaCylinder.py index eacc0be..8a218dc 100644 --- a/mathgenerator/funcs/surfaceAreaCylinder.py +++ b/mathgenerator/funcs/surfaceAreaCylinder.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surfaceAreaCylinder(maxRadius=20, maxHeight=50, unit='m'): diff --git a/mathgenerator/funcs/surfaceAreaSphere.py b/mathgenerator/funcs/surfaceAreaSphere.py index 6b9110d..664e9f8 100644 --- a/mathgenerator/funcs/surfaceAreaSphere.py +++ b/mathgenerator/funcs/surfaceAreaSphere.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def surfaceAreaSphere(maxSide=20, unit='m'): diff --git a/mathgenerator/funcs/systemOfEquationsFunc.py b/mathgenerator/funcs/systemOfEquationsFunc.py index ef63c73..84bf2c7 100644 --- a/mathgenerator/funcs/systemOfEquationsFunc.py +++ b/mathgenerator/funcs/systemOfEquationsFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def systemOfEquationsFunc(range_x=10, range_y=10, coeff_mult_range=10): diff --git a/mathgenerator/funcs/thirdAngleOfTriangleFunc.py b/mathgenerator/funcs/thirdAngleOfTriangleFunc.py index 5268ceb..9a8cbc6 100644 --- a/mathgenerator/funcs/thirdAngleOfTriangleFunc.py +++ b/mathgenerator/funcs/thirdAngleOfTriangleFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def thirdAngleOfTriangleFunc(maxAngle=89): diff --git a/mathgenerator/funcs/vectorCrossFunc.py b/mathgenerator/funcs/vectorCrossFunc.py index 7506283..78cb99b 100644 --- a/mathgenerator/funcs/vectorCrossFunc.py +++ b/mathgenerator/funcs/vectorCrossFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def vectorCrossFunc(minVal=-20, maxVal=20): diff --git a/mathgenerator/funcs/vectorDotFunc.py b/mathgenerator/funcs/vectorDotFunc.py index 011beb3..871011a 100644 --- a/mathgenerator/funcs/vectorDotFunc.py +++ b/mathgenerator/funcs/vectorDotFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def vectorDotFunc(minVal=-20, maxVal=20): diff --git a/mathgenerator/funcs/volumeCone.py b/mathgenerator/funcs/volumeCone.py index c237bca..f965024 100644 --- a/mathgenerator/funcs/volumeCone.py +++ b/mathgenerator/funcs/volumeCone.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def volumeCone(maxRadius=20, maxHeight=50, unit='m'): diff --git a/mathgenerator/funcs/volumeCube.py b/mathgenerator/funcs/volumeCube.py index 6a52da4..1efb25f 100644 --- a/mathgenerator/funcs/volumeCube.py +++ b/mathgenerator/funcs/volumeCube.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def volumeCube(maxSide=20, unit='m'): diff --git a/mathgenerator/funcs/volumeCuboid.py b/mathgenerator/funcs/volumeCuboid.py index b0a2490..ea55e42 100644 --- a/mathgenerator/funcs/volumeCuboid.py +++ b/mathgenerator/funcs/volumeCuboid.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def volumeCuboid(maxSide=20, unit='m'): diff --git a/mathgenerator/funcs/volumeCylinder.py b/mathgenerator/funcs/volumeCylinder.py index 38dfd64..39ab091 100644 --- a/mathgenerator/funcs/volumeCylinder.py +++ b/mathgenerator/funcs/volumeCylinder.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def volumeCylinder(maxRadius=20, maxHeight=50, unit='m'): diff --git a/mathgenerator/funcs/volumeSphereFunc.py b/mathgenerator/funcs/volumeSphereFunc.py index 1f94c7f..0a33b82 100644 --- a/mathgenerator/funcs/volumeSphereFunc.py +++ b/mathgenerator/funcs/volumeSphereFunc.py @@ -1,4 +1,5 @@ from .__init__ import * +from ..__init__ import Generator def volumeSphereFunc(maxRadius=100): From 84cb84a21cd915eb36ef57af323516628c38dbde Mon Sep 17 00:00:00 2001 From: lukew3 Date: Mon, 19 Oct 2020 20:33:18 -0400 Subject: [PATCH 2/4] Out of order but localized --- mathgenerator/funcs/BinaryToDecimalFunc.py | 4 + mathgenerator/funcs/DecimalToBinaryFunc.py | 4 + mathgenerator/funcs/DiceSumProbFunc.py | 6 + mathgenerator/funcs/MidPointOfTwoPointFunc.py | 5 + mathgenerator/funcs/absoluteDifferenceFunc.py | 6 + mathgenerator/funcs/angleBtwVectorsFunc.py | 6 + mathgenerator/funcs/areaOfTriangleFunc.py | 5 + .../funcs/arithmeticProgressionSumFunc.py | 5 + .../funcs/arithmeticProgressionTermFunc.py | 5 + mathgenerator/funcs/basicAlgebraFunc.py | 4 + mathgenerator/funcs/basicTrigonometryFunc.py | 4 + mathgenerator/funcs/binary2sComplement.py | 5 + mathgenerator/funcs/binaryComplement1sFunc.py | 4 + mathgenerator/funcs/binaryToHexFunc.py | 4 + mathgenerator/funcs/combinationsFunc.py | 6 + mathgenerator/funcs/commonFactorsFunc.py | 5 + mathgenerator/funcs/compareFractionsFunc.py | 6 + mathgenerator/funcs/compoundInterestFunc.py | 6 + mathgenerator/funcs/confidenceIntervalFunc.py | 5 + mathgenerator/funcs/cubeRootFunc.py | 4 + mathgenerator/funcs/dataSummaryFunc.py | 4 + mathgenerator/funcs/deciToHexaFunc.py | 4 + mathgenerator/funcs/determinantToMatrix22.py | 5 + mathgenerator/funcs/distanceTwoPointsFunc.py | 5 + mathgenerator/funcs/divideFractionsFunc.py | 4 + mathgenerator/funcs/divisionFunc.py | 3 + mathgenerator/funcs/divisionToIntFunc.py | 3 + mathgenerator/funcs/euclidianNormFunc.py | 5 + mathgenerator/funcs/exponentiationFunc.py | 4 + mathgenerator/funcs/factorialFunc.py | 3 + mathgenerator/funcs/factoringFunc.py | 4 + mathgenerator/funcs/fibonacciSeriesFunc.py | 5 + .../funcs/fourthAngleOfQuadriFunc.py | 6 + mathgenerator/funcs/gcdFunc.py | 4 + mathgenerator/funcs/geomProgrFunc.py | 6 + mathgenerator/funcs/geometricMeanFunc.py | 5 + mathgenerator/funcs/harmonicMeanFunc.py | 6 + mathgenerator/funcs/hcfFunc.py | 4 + .../funcs/intersectionOfTwoLinesFunc.py | 6 + mathgenerator/funcs/isTriangleValidFunc.py | 5 + mathgenerator/funcs/lcmFunc.py | 4 + mathgenerator/funcs/linearEquationsFunc.py | 4 + mathgenerator/funcs/logFunc.py | 3 + mathgenerator/funcs/matrixInversion.py | 4 + .../funcs/matrixMultiplicationFunc.py | 5 + mathgenerator/funcs/meanMedianFunc.py | 5 + mathgenerator/funcs/moduloFunc.py | 3 + mathgenerator/funcs/multiplicationFunc.py | 4 + .../funcs/multiplyComplexNumbersFunc.py | 5 + mathgenerator/funcs/multiplyFractionsFunc.py | 5 + mathgenerator/funcs/multiplyIntToMatrix22.py | 6 + mathgenerator/funcs/nthFibonacciNumberFunc.py | 5 + mathgenerator/funcs/percentageFunc.py | 4 + mathgenerator/funcs/permutationFunc.py | 6 + .../funcs/powerRuleDifferentiationFunc.py | 5 + .../funcs/powerRuleIntegrationFunc.py | 4 + mathgenerator/funcs/primeFactorsFunc.py | 4 + mathgenerator/funcs/profitLossPercentFunc.py | 6 + mathgenerator/funcs/pythagoreanTheoremFunc.py | 6 + mathgenerator/funcs/quadraticEquation.py | 6 + .../funcs/regularPolygonAngleFunc.py | 6 + mathgenerator/funcs/sectorAreaFunc.py | 5 + mathgenerator/funcs/simpleInterestFunc.py | 6 + mathgenerator/funcs/squareFunc.py | 3 + mathgenerator/funcs/squareRootFunc.py | 3 + mathgenerator/funcs/subtractionFunc.py | 3 + .../funcs/sumOfAnglesOfPolygonFunc.py | 5 + mathgenerator/funcs/surdsComparisonFunc.py | 5 + mathgenerator/funcs/surfaceAreaCone.py | 6 + mathgenerator/funcs/surfaceAreaCube.py | 5 + mathgenerator/funcs/surfaceAreaCuboid.py | 6 + mathgenerator/funcs/surfaceAreaCylinder.py | 6 + mathgenerator/funcs/surfaceAreaSphere.py | 6 + mathgenerator/funcs/systemOfEquationsFunc.py | 5 + .../funcs/thirdAngleOfTriangleFunc.py | 5 + mathgenerator/funcs/vectorCrossFunc.py | 4 + mathgenerator/funcs/vectorDotFunc.py | 4 + mathgenerator/funcs/volumeCone.py | 6 + mathgenerator/funcs/volumeCube.py | 5 + mathgenerator/funcs/volumeCuboid.py | 6 + mathgenerator/funcs/volumeCylinder.py | 6 + mathgenerator/funcs/volumeSphereFunc.py | 5 + mathgenerator/mathgen.py | 241 ------------------ 83 files changed, 395 insertions(+), 241 deletions(-) diff --git a/mathgenerator/funcs/BinaryToDecimalFunc.py b/mathgenerator/funcs/BinaryToDecimalFunc.py index f975ded..01fb780 100644 --- a/mathgenerator/funcs/BinaryToDecimalFunc.py +++ b/mathgenerator/funcs/BinaryToDecimalFunc.py @@ -11,3 +11,7 @@ def BinaryToDecimalFunc(max_dig=10): solution = int(problem, 2) return problem, solution + + +binaryToDecimal = Generator("Binary to Decimal", 15, "Decimal of a=", "b", + BinaryToDecimalFunc) diff --git a/mathgenerator/funcs/DecimalToBinaryFunc.py b/mathgenerator/funcs/DecimalToBinaryFunc.py index 2baaeeb..a2aa043 100644 --- a/mathgenerator/funcs/DecimalToBinaryFunc.py +++ b/mathgenerator/funcs/DecimalToBinaryFunc.py @@ -10,3 +10,7 @@ def DecimalToBinaryFunc(max_dec=99): solution = str(b) return problem, solution + + +decimalToBinary = Generator("Decimal to Binary", 14, "Binary of a=", "b", + DecimalToBinaryFunc) diff --git a/mathgenerator/funcs/DiceSumProbFunc.py b/mathgenerator/funcs/DiceSumProbFunc.py index 0bb00c9..720490e 100644 --- a/mathgenerator/funcs/DiceSumProbFunc.py +++ b/mathgenerator/funcs/DiceSumProbFunc.py @@ -25,3 +25,9 @@ def DiceSumProbFunc(maxDice=3): a, b) solution = "{}/{}".format(count, 6**a) return problem, solution + + +diceSumProbability = Generator( + "Probability of a certain sum appearing on faces of dice", 52, + "If n dices are rolled then probabilty of getting sum of x is =", "z", + DiceSumProbFunc) diff --git a/mathgenerator/funcs/MidPointOfTwoPointFunc.py b/mathgenerator/funcs/MidPointOfTwoPointFunc.py index 98d91b0..1a126b2 100644 --- a/mathgenerator/funcs/MidPointOfTwoPointFunc.py +++ b/mathgenerator/funcs/MidPointOfTwoPointFunc.py @@ -11,3 +11,8 @@ def MidPointOfTwoPointFunc(maxValue=20): problem = f"({x1},{y1}),({x2},{y2})=" solution = f"({(x1+x2)/2},{(y1+y2)/2})" return problem, solution + + +midPointOfTwoPoint = Generator("Midpoint of the two point", 20, + "((X1,Y1),(X2,Y2))=", "((X1+X2)/2,(Y1+Y2)/2)", + MidPointOfTwoPointFunc) diff --git a/mathgenerator/funcs/absoluteDifferenceFunc.py b/mathgenerator/funcs/absoluteDifferenceFunc.py index 065e6a6..755e049 100644 --- a/mathgenerator/funcs/absoluteDifferenceFunc.py +++ b/mathgenerator/funcs/absoluteDifferenceFunc.py @@ -11,3 +11,9 @@ def absoluteDifferenceFunc(maxA=100, maxB=100): str(a) + " and " + str(b) + " = " solution = absDiff return problem, solution + + +absoluteDifference = Generator( + "Absolute difference between two numbers", 71, + "Absolute difference betweeen two numbers a and b =", "|a-b|", + absoluteDifferenceFunc) diff --git a/mathgenerator/funcs/angleBtwVectorsFunc.py b/mathgenerator/funcs/angleBtwVectorsFunc.py index 6e45eeb..65ec973 100644 --- a/mathgenerator/funcs/angleBtwVectorsFunc.py +++ b/mathgenerator/funcs/angleBtwVectorsFunc.py @@ -20,3 +20,9 @@ def angleBtwVectorsFunc(maxEltAmt=20): solution = 'NaN' # would return the answer in radians return problem, solution + + +angleBtwVectors = 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) diff --git a/mathgenerator/funcs/areaOfTriangleFunc.py b/mathgenerator/funcs/areaOfTriangleFunc.py index 6d4ee66..c49167c 100644 --- a/mathgenerator/funcs/areaOfTriangleFunc.py +++ b/mathgenerator/funcs/areaOfTriangleFunc.py @@ -14,3 +14,8 @@ def areaOfTriangleFunc(maxA=20, maxB=20, maxC=20): str(a) + " " + str(b) + " " + str(c) + " = " solution = area return problem, solution + + +areaOfTriangle = Generator("Area of Triangle", 18, + "Area of Triangle with side lengths a, b, c = ", + "area", areaOfTriangleFunc) diff --git a/mathgenerator/funcs/arithmeticProgressionSumFunc.py b/mathgenerator/funcs/arithmeticProgressionSumFunc.py index b441d16..294cb7f 100644 --- a/mathgenerator/funcs/arithmeticProgressionSumFunc.py +++ b/mathgenerator/funcs/arithmeticProgressionSumFunc.py @@ -12,3 +12,8 @@ def arithmeticProgressionSumFunc(maxd=100, maxa=100, maxn=100): problem = 'Find the sum of first ' + str(n) + ' terms of the AP series: ' + apString solution = n * ((2 * a1) + ((n - 1) * d)) / 2 return problem, solution + + +arithmeticProgressionSum = Generator("AP Sum Calculation", 83, + "Find the sum of first n terms of the AP series: a1, a2, a3 ...", + "Sum", arithmeticProgressionSumFunc) diff --git a/mathgenerator/funcs/arithmeticProgressionTermFunc.py b/mathgenerator/funcs/arithmeticProgressionTermFunc.py index ff67f60..e549c18 100644 --- a/mathgenerator/funcs/arithmeticProgressionTermFunc.py +++ b/mathgenerator/funcs/arithmeticProgressionTermFunc.py @@ -12,3 +12,8 @@ def arithmeticProgressionTermFunc(maxd=100, maxa=100, maxn=100): problem = 'Find the term number ' + str(n) + ' of the AP series: ' + apString solution = a1 + ((n - 1) * d) return problem, solution + + +arithmeticProgressionTerm = Generator("AP Term Calculation", 82, + "Find the term number n of the AP series: a1, a2, a3 ...", + "a-n", arithmeticProgressionTermFunc) diff --git a/mathgenerator/funcs/basicAlgebraFunc.py b/mathgenerator/funcs/basicAlgebraFunc.py index 0060883..504ac41 100644 --- a/mathgenerator/funcs/basicAlgebraFunc.py +++ b/mathgenerator/funcs/basicAlgebraFunc.py @@ -24,3 +24,7 @@ def basicAlgebraFunc(maxVariable=10): problem = f"{a}x + {b} = {c}" solution = x return problem, solution + + +basicAlgebra = Generator("Basic Algebra", 11, "ax + b = c", "d", + basicAlgebraFunc) diff --git a/mathgenerator/funcs/basicTrigonometryFunc.py b/mathgenerator/funcs/basicTrigonometryFunc.py index 2a6f5ce..da6d97c 100644 --- a/mathgenerator/funcs/basicTrigonometryFunc.py +++ b/mathgenerator/funcs/basicTrigonometryFunc.py @@ -24,3 +24,7 @@ def basicTrigonometryFunc(angles=[0, 30, 45, 60, 90], solution = result_fraction_map[round(eval(expression), 2)] if round( eval(expression), 2) <= 99999 else "∞" # for handling the ∞ condition return problem, solution + + +basicTrigonometry = Generator("Trigonometric Values", 57, "What is sin(X)?", + "ans", basicTrigonometryFunc) diff --git a/mathgenerator/funcs/binary2sComplement.py b/mathgenerator/funcs/binary2sComplement.py index 6fe00f8..891990d 100644 --- a/mathgenerator/funcs/binary2sComplement.py +++ b/mathgenerator/funcs/binary2sComplement.py @@ -27,3 +27,8 @@ def binary2sComplementFunc(maxDigits=10): problem = "2's complement of " + question + " =" solution = ''.join(answer).lstrip('0') return problem, solution + + +binary2sComplement = Generator("Binary 2's Complement", 73, + "2's complement of 11010110 =", "101010", + binary2sComplementFunc) diff --git a/mathgenerator/funcs/binaryComplement1sFunc.py b/mathgenerator/funcs/binaryComplement1sFunc.py index dcc9796..f748af5 100644 --- a/mathgenerator/funcs/binaryComplement1sFunc.py +++ b/mathgenerator/funcs/binaryComplement1sFunc.py @@ -14,3 +14,7 @@ def binaryComplement1sFunc(maxDigits=10): problem = question + "=" solution = answer return problem, solution + + +binaryComplement1s = Generator("Binary Complement 1s", 4, "1010=", "0101", + binaryComplement1sFunc) diff --git a/mathgenerator/funcs/binaryToHexFunc.py b/mathgenerator/funcs/binaryToHexFunc.py index 0523f8d..12dbe7f 100644 --- a/mathgenerator/funcs/binaryToHexFunc.py +++ b/mathgenerator/funcs/binaryToHexFunc.py @@ -10,3 +10,7 @@ def binaryToHexFunc(max_dig=10): solution = hex(int(problem, 2)) return problem, solution + + +binaryToHex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", "b", + binaryToHexFunc) diff --git a/mathgenerator/funcs/combinationsFunc.py b/mathgenerator/funcs/combinationsFunc.py index e0c7078..ca42532 100644 --- a/mathgenerator/funcs/combinationsFunc.py +++ b/mathgenerator/funcs/combinationsFunc.py @@ -18,3 +18,9 @@ def combinationsFunc(maxlength=20): a, b) return problem, solution + + +combinations = Generator( + "Combinations of Objects", 30, + "Combinations available for picking 4 objects at a time from 6 distinct objects =", + " 15", combinationsFunc) diff --git a/mathgenerator/funcs/commonFactorsFunc.py b/mathgenerator/funcs/commonFactorsFunc.py index eab088f..929c48e 100644 --- a/mathgenerator/funcs/commonFactorsFunc.py +++ b/mathgenerator/funcs/commonFactorsFunc.py @@ -23,3 +23,8 @@ def commonFactorsFunc(maxVal=100): problem = f"Common Factors of {a} and {b} = " solution = arr return problem, solution + + +commonFactors = Generator("Common Factors", 40, + "Common Factors of {a} and {b} = ", "[c, d, ...]", + commonFactorsFunc) diff --git a/mathgenerator/funcs/compareFractionsFunc.py b/mathgenerator/funcs/compareFractionsFunc.py index c681d49..19ba5c9 100644 --- a/mathgenerator/funcs/compareFractionsFunc.py +++ b/mathgenerator/funcs/compareFractionsFunc.py @@ -25,3 +25,9 @@ def compareFractionsFunc(maxVal=10): problem = f"Which symbol represents the comparison between {a}/{b} and {c}/{d}?" return problem, solution + + +compareFractions = Generator( + "Compare Fractions", 44, + "Which symbol represents the comparison between a/b and c/d?", ">//=", + surdsComparisonFunc) diff --git a/mathgenerator/funcs/surfaceAreaCone.py b/mathgenerator/funcs/surfaceAreaCone.py index d8cb21c..8497460 100644 --- a/mathgenerator/funcs/surfaceAreaCone.py +++ b/mathgenerator/funcs/surfaceAreaCone.py @@ -12,3 +12,9 @@ def surfaceAreaCone(maxRadius=20, maxHeight=50, unit='m'): solution = f"{ans} {unit}^2" return problem, solution + + +surfaceAreaConeGen = Generator( + "Surface Area of cone", 38, + "Surface area of cone with height = a units and radius = b units is", + "c units^2", surfaceAreaCone) diff --git a/mathgenerator/funcs/surfaceAreaCube.py b/mathgenerator/funcs/surfaceAreaCube.py index 2452a05..42b07f4 100644 --- a/mathgenerator/funcs/surfaceAreaCube.py +++ b/mathgenerator/funcs/surfaceAreaCube.py @@ -8,3 +8,8 @@ def surfaceAreaCube(maxSide=20, unit='m'): ans = 6 * a * a solution = f"{ans} {unit}^2" return problem, solution + + +surfaceAreaCubeGen = Generator("Surface Area of Cube", 32, + "Surface area of cube with side a units is", + "b units^2", surfaceAreaCube) diff --git a/mathgenerator/funcs/surfaceAreaCuboid.py b/mathgenerator/funcs/surfaceAreaCuboid.py index f1b8205..0889441 100644 --- a/mathgenerator/funcs/surfaceAreaCuboid.py +++ b/mathgenerator/funcs/surfaceAreaCuboid.py @@ -11,3 +11,9 @@ def surfaceAreaCuboid(maxSide=20, unit='m'): ans = 2 * (a * b + b * c + c * a) solution = f"{ans} {unit}^2" return problem, solution + + +surfaceAreaCuboidGen = Generator( + "Surface Area of Cuboid", 33, + "Surface area of cuboid with sides = a units, b units, c units is", + "d units^2", surfaceAreaCuboid) diff --git a/mathgenerator/funcs/surfaceAreaCylinder.py b/mathgenerator/funcs/surfaceAreaCylinder.py index 8a218dc..3a7a1e8 100644 --- a/mathgenerator/funcs/surfaceAreaCylinder.py +++ b/mathgenerator/funcs/surfaceAreaCylinder.py @@ -10,3 +10,9 @@ def surfaceAreaCylinder(maxRadius=20, maxHeight=50, unit='m'): ans = int(2 * math.pi * a * b + 2 * math.pi * b * b) solution = f"{ans} {unit}^2" return problem, solution + + +surfaceAreaCylinderGen = Generator( + "Surface Area of Cylinder", 34, + "Surface area of cylinder with height = a units and radius = b units is", + "c units^2", surfaceAreaCylinder) diff --git a/mathgenerator/funcs/surfaceAreaSphere.py b/mathgenerator/funcs/surfaceAreaSphere.py index 664e9f8..86a9456 100644 --- a/mathgenerator/funcs/surfaceAreaSphere.py +++ b/mathgenerator/funcs/surfaceAreaSphere.py @@ -9,3 +9,9 @@ def surfaceAreaSphere(maxSide=20, unit='m'): ans = 4 * math.pi * r * r solution = f"{ans} {unit}^2" return problem, solution + + +surfaceAreaSphereGen = Generator( + "Surface Area of Sphere", 60, + "Surface area of sphere with radius = a units is", "d units^2", + surfaceAreaSphere) diff --git a/mathgenerator/funcs/systemOfEquationsFunc.py b/mathgenerator/funcs/systemOfEquationsFunc.py index 84bf2c7..ef00b0e 100644 --- a/mathgenerator/funcs/systemOfEquationsFunc.py +++ b/mathgenerator/funcs/systemOfEquationsFunc.py @@ -46,3 +46,8 @@ def systemOfEquationsFunc(range_x=10, range_y=10, coeff_mult_range=10): solution = f"x = {x}, y = {y}" return problem, solution # Add random (non-zero) multiple of equations to each other + + +systemOfEquations = Generator("Solve a System of Equations in R^2", 23, + "2x + 5y = 13, -3x - 3y = -6", "x = -1, y = 3", + systemOfEquationsFunc) diff --git a/mathgenerator/funcs/thirdAngleOfTriangleFunc.py b/mathgenerator/funcs/thirdAngleOfTriangleFunc.py index 9a8cbc6..f5f7afb 100644 --- a/mathgenerator/funcs/thirdAngleOfTriangleFunc.py +++ b/mathgenerator/funcs/thirdAngleOfTriangleFunc.py @@ -10,3 +10,8 @@ def thirdAngleOfTriangleFunc(maxAngle=89): problem = f"Third angle of triangle with angles {angle1} and {angle2} = " solution = angle3 return problem, solution + + +thirdAngleOfTriangle = Generator("Third Angle of Triangle", 22, + "Third Angle of the triangle = ", "angle3", + thirdAngleOfTriangleFunc) diff --git a/mathgenerator/funcs/vectorCrossFunc.py b/mathgenerator/funcs/vectorCrossFunc.py index 78cb99b..318beec 100644 --- a/mathgenerator/funcs/vectorCrossFunc.py +++ b/mathgenerator/funcs/vectorCrossFunc.py @@ -13,3 +13,7 @@ def vectorCrossFunc(minVal=-20, maxVal=20): problem = str(a) + " X " + str(b) + " = " solution = str(c) return problem, solution + + +vectorCross = Generator("Cross Product of 2 Vectors", 43, "a X b = ", "c", + vectorCrossFunc) diff --git a/mathgenerator/funcs/vectorDotFunc.py b/mathgenerator/funcs/vectorDotFunc.py index 871011a..0ca2609 100644 --- a/mathgenerator/funcs/vectorDotFunc.py +++ b/mathgenerator/funcs/vectorDotFunc.py @@ -10,3 +10,7 @@ def vectorDotFunc(minVal=-20, maxVal=20): problem = str(a) + " . " + str(b) + " = " solution = str(c) return problem, solution + + +vectorDot = Generator("Dot Product of 2 Vectors", 72, "a . b = ", "c", + vectorDotFunc) diff --git a/mathgenerator/funcs/volumeCone.py b/mathgenerator/funcs/volumeCone.py index f965024..85dbd55 100644 --- a/mathgenerator/funcs/volumeCone.py +++ b/mathgenerator/funcs/volumeCone.py @@ -10,3 +10,9 @@ def volumeCone(maxRadius=20, maxHeight=50, unit='m'): ans = int(math.pi * b * b * a * (1 / 3)) solution = f"{ans} {unit}^3" return problem, solution + + +volumeConeGen = Generator( + "Volume of cone", 39, + "Volume of cone with height = a units and radius = b units is", + "c units^3", volumeCone) diff --git a/mathgenerator/funcs/volumeCube.py b/mathgenerator/funcs/volumeCube.py index 1efb25f..ff1ac76 100644 --- a/mathgenerator/funcs/volumeCube.py +++ b/mathgenerator/funcs/volumeCube.py @@ -9,3 +9,8 @@ def volumeCube(maxSide=20, unit='m'): ans = a * a * a solution = f"{ans} {unit}^3" return problem, solution + + +volumeCubeGen = Generator("Volum of Cube", 35, + "Volume of cube with side a units is", "b units^3", + volumeCube) diff --git a/mathgenerator/funcs/volumeCuboid.py b/mathgenerator/funcs/volumeCuboid.py index ea55e42..d25d753 100644 --- a/mathgenerator/funcs/volumeCuboid.py +++ b/mathgenerator/funcs/volumeCuboid.py @@ -11,3 +11,9 @@ def volumeCuboid(maxSide=20, unit='m'): ans = a * b * c solution = f"{ans} {unit}^3" return problem, solution + + +volumeCuboidGen = Generator( + "Volume of Cuboid", 36, + "Volume of cuboid with sides = a units, b units, c units is", "d units^3", + volumeCuboid) diff --git a/mathgenerator/funcs/volumeCylinder.py b/mathgenerator/funcs/volumeCylinder.py index 39ab091..e021aab 100644 --- a/mathgenerator/funcs/volumeCylinder.py +++ b/mathgenerator/funcs/volumeCylinder.py @@ -10,3 +10,9 @@ def volumeCylinder(maxRadius=20, maxHeight=50, unit='m'): ans = int(math.pi * b * b * a) solution = f"{ans} {unit}^3" return problem, solution + + +volumeCylinderGen = Generator( + "Volume of cylinder", 37, + "Volume of cylinder with height = a units and radius = b units is", + "c units^3", volumeCylinder) diff --git a/mathgenerator/funcs/volumeSphereFunc.py b/mathgenerator/funcs/volumeSphereFunc.py index 0a33b82..038607e 100644 --- a/mathgenerator/funcs/volumeSphereFunc.py +++ b/mathgenerator/funcs/volumeSphereFunc.py @@ -9,3 +9,8 @@ def volumeSphereFunc(maxRadius=100): ans = (4 * math.pi / 3) * r * r * r solution = f"{ans} m^3" return problem, solution + + +volumeSphere = Generator("Volume of Sphere", 61, + "Volume of sphere with radius r m = ", + "(4*pi/3)*r*r*r", volumeSphereFunc) diff --git a/mathgenerator/mathgen.py b/mathgenerator/mathgen.py index 61074cd..959093b 100644 --- a/mathgenerator/mathgen.py +++ b/mathgenerator/mathgen.py @@ -33,246 +33,5 @@ def genById(id): return (generator()) -# -# def getGenList(): -# return(genList) - # Format is: # = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) -# Funcs_start - DO NOT REMOVE! -# addition = Generator("Addition", 0, "a+b=", "c", additionFunc) -subtraction = Generator("Subtraction", 1, "a-b=", "c", subtractionFunc) -multiplication = Generator("Multiplication", 2, "a*b=", "c", - multiplicationFunc) -division = Generator("Division", 3, "a/b=", "c", divisionFunc) -binaryComplement1s = Generator("Binary Complement 1s", 4, "1010=", "0101", - binaryComplement1sFunc) -moduloDivision = Generator("Modulo Division", 5, "a%b=", "c", moduloFunc) -squareRoot = Generator("Square Root", 6, "sqrt(a)=", "b", squareRootFunc) -powerRuleDifferentiation = Generator("Power Rule Differentiation", 7, "nx^m=", - "(n*m)x^(m-1)", - powerRuleDifferentiationFunc) -square = Generator("Square", 8, "a^2", "b", squareFunc) -lcm = Generator("LCM (Least Common Multiple)", 9, "LCM of a and b = ", "c", - lcmFunc) -gcd = Generator("GCD (Greatest Common Denominator)", 10, "GCD of a and b = ", - "c", gcdFunc) -basicAlgebra = Generator("Basic Algebra", 11, "ax + b = c", "d", - basicAlgebraFunc) -log = Generator("Logarithm", 12, "log2(8)", "3", logFunc) -intDivision = Generator("Easy Division", 13, "a/b=", "c", divisionToIntFunc) -decimalToBinary = Generator("Decimal to Binary", 14, "Binary of a=", "b", - DecimalToBinaryFunc) -binaryToDecimal = Generator("Binary to Decimal", 15, "Decimal of a=", "b", - BinaryToDecimalFunc) -fractionDivision = Generator("Fraction Division", 16, "(a/b)/(c/d)=", "x/y", - divideFractionsFunc) -intMatrix22Multiplication = Generator("Integer Multiplication with 2x2 Matrix", - 17, "k * [[a,b],[c,d]]=", - "[[k*a,k*b],[k*c,k*d]]", - multiplyIntToMatrix22) -areaOfTriangle = Generator("Area of Triangle", 18, - "Area of Triangle with side lengths a, b, c = ", - "area", areaOfTriangleFunc) -doesTriangleExist = Generator("Triangle exists check", 19, - "Does triangle with sides a, b and c exist?", - "Yes/No", isTriangleValidFunc) -midPointOfTwoPoint = Generator("Midpoint of the two point", 20, - "((X1,Y1),(X2,Y2))=", "((X1+X2)/2,(Y1+Y2)/2)", - MidPointOfTwoPointFunc) -factoring = Generator("Factoring Quadratic", 21, "x^2+(x1+x2)+x1*x2", - "(x-x1)(x-x2)", factoringFunc) -thirdAngleOfTriangle = Generator("Third Angle of Triangle", 22, - "Third Angle of the triangle = ", "angle3", - thirdAngleOfTriangleFunc) -systemOfEquations = Generator("Solve a System of Equations in R^2", 23, - "2x + 5y = 13, -3x - 3y = -6", "x = -1, y = 3", - systemOfEquationsFunc) -distance2Point = Generator("Distance between 2 points", 24, - "Find the distance between (x1,y1) and (x2,y2)", - "sqrt(distanceSquared)", distanceTwoPointsFunc) -pythagoreanTheorem = Generator( - "Pythagorean Theorem", 25, - "The hypotenuse of a right triangle given the other two lengths a and b = ", - "hypotenuse", pythagoreanTheoremFunc) -# This has multiple variables whereas #23 has only x and y -linearEquations = Generator("Linear Equations", 26, "2x+5y=20 & 3x+6y=12", - "x=-20 & y=12", linearEquationsFunc) -primeFactors = Generator("Prime Factorisation", 27, "Prime Factors of a =", - "[b, c, d, ...]", primeFactorsFunc) -fractionMultiplication = Generator("Fraction Multiplication", 28, - "(a/b)*(c/d)=", "x/y", - multiplyFractionsFunc) -angleRegularPolygon = Generator( - "Angle of a Regular Polygon", 29, - "Find the angle of a regular polygon with 6 sides", "120", - regularPolygonAngleFunc) -combinations = Generator( - "Combinations of Objects", 30, - "Combinations available for picking 4 objects at a time from 6 distinct objects =", - " 15", combinationsFunc) -factorial = Generator("Factorial", 31, "a! = ", "b", factorialFunc) -surfaceAreaCubeGen = Generator("Surface Area of Cube", 32, - "Surface area of cube with side a units is", - "b units^2", surfaceAreaCube) -surfaceAreaCuboidGen = Generator( - "Surface Area of Cuboid", 33, - "Surface area of cuboid with sides = a units, b units, c units is", - "d units^2", surfaceAreaCuboid) -surfaceAreaCylinderGen = Generator( - "Surface Area of Cylinder", 34, - "Surface area of cylinder with height = a units and radius = b units is", - "c units^2", surfaceAreaCylinder) -volumeCubeGen = Generator("Volum of Cube", 35, - "Volume of cube with side a units is", "b units^3", - volumeCube) -volumeCuboidGen = Generator( - "Volume of Cuboid", 36, - "Volume of cuboid with sides = a units, b units, c units is", "d units^3", - volumeCuboid) -volumeCylinderGen = Generator( - "Volume of cylinder", 37, - "Volume of cylinder with height = a units and radius = b units is", - "c units^3", volumeCylinder) -surfaceAreaConeGen = Generator( - "Surface Area of cone", 38, - "Surface area of cone with height = a units and radius = b units is", - "c units^2", surfaceAreaCone) -volumeConeGen = Generator( - "Volume of cone", 39, - "Volume of cone with height = a units and radius = b units is", - "c units^3", volumeCone) -commonFactors = Generator("Common Factors", 40, - "Common Factors of {a} and {b} = ", "[c, d, ...]", - commonFactorsFunc) -intersectionOfTwoLines = 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) -permutations = Generator( - "Permutations", 42, - "Total permutations of 4 objects at a time from 10 objects is", "5040", - permutationFunc) -vectorCross = Generator("Cross Product of 2 Vectors", 43, "a X b = ", "c", - vectorCrossFunc) -compareFractions = Generator( - "Compare Fractions", 44, - "Which symbol represents the comparison between a/b and c/d?", ">/</=", - compareFractionsFunc) -simpleInterest = 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) -matrixMultiplication = Generator("Multiplication of two matrices", 46, - "Multiply two matrices A and B", "C", - matrixMultiplicationFunc) -CubeRoot = Generator("Cube Root", 47, "Cuberoot of a upto 2 decimal places is", - "b", cubeRootFunc) -powerRuleIntegration = Generator("Power Rule Integration", 48, "nx^m=", - "(n/m)x^(m+1)", powerRuleIntegrationFunc) -fourthAngleOfQuadrilateral = Generator( - "Fourth Angle of Quadrilateral", 49, - "Fourth angle of Quadrilateral with angles a,b,c =", "angle4", - fourthAngleOfQuadriFunc) -quadraticEquationSolve = Generator( - "Quadratic Equation", 50, - "Find the zeros {x1,x2} of the quadratic equation ax^2+bx+c=0", "x1,x2", - quadraticEquation) -hcf = Generator("HCF (Highest Common Factor)", 51, "HCF of a and b = ", "c", - hcfFunc) -diceSumProbability = Generator( - "Probability of a certain sum appearing on faces of dice", 52, - "If n dices are rolled then probabilty of getting sum of x is =", "z", - DiceSumProbFunc) -exponentiation = Generator("Exponentiation", 53, "a^b = ", "c", - exponentiationFunc) -confidenceInterval = Generator("Confidence interval For sample S", 54, - "With X% confidence", "is (A,B)", - confidenceIntervalFunc) -surdsComparison = Generator("Comparing surds", 55, - "Fill in the blanks a^(1/b) _ c^(1/d)", "</>/=", - surdsComparisonFunc) -fibonacciSeries = Generator( - "Fibonacci Series", 56, "fibonacci series of first a numbers", - "prints the fibonacci series starting from 0 to a", fibonacciSeriesFunc) -basicTrigonometry = Generator("Trigonometric Values", 57, "What is sin(X)?", - "ans", basicTrigonometryFunc) -sumOfAnglesOfPolygon = Generator("Sum of Angles of Polygon", 58, - "Sum of angles of polygon with n sides = ", - "sum", sumOfAnglesOfPolygonFunc) -dataSummary = Generator("Mean,Standard Deviation,Variance", 59, "a,b,c", - "Mean:a+b+c/3,Std,Var", dataSummaryFunc) -surfaceAreaSphereGen = Generator( - "Surface Area of Sphere", 60, - "Surface area of sphere with radius = a units is", "d units^2", - surfaceAreaSphere) -volumeSphere = Generator("Volume of Sphere", 61, - "Volume of sphere with radius r m = ", - "(4*pi/3)*r*r*r", volumeSphereFunc) -nthFibonacciNumberGen = Generator("nth Fibonacci number", 62, - "What is the nth Fibonacci number", "Fn", - nthFibonacciNumberFunc) -profitLossPercent = Generator( - "Profit or Loss Percent", 63, - "Profit/ Loss percent when CP = cp and SP = sp is: ", "percent", - profitLossPercentFunc) -binaryToHex = Generator("Binary to Hexidecimal", 64, "Hexidecimal of a=", "b", - binaryToHexFunc) -complexNumMultiply = Generator("Multiplication of 2 complex numbers", 65, - "(x + j) (y + j) = ", "xy + xj + yj -1", - multiplyComplexNumbersFunc) -geometricprogression = Generator( - "Geometric Progression", 66, - "Initial value,Common Ratio,nth Term,Sum till nth term =", - "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc) -geometricMean = Generator("Geometric Mean of N Numbers", 67, - "Geometric mean of n numbers A1 , A2 , ... , An = ", - "(A1*A2*...An)^(1/n) = ans", geometricMeanFunc) -harmonicMean = Generator("Harmonic Mean of N Numbers", 68, - "Harmonic mean of n numbers A1 , A2 , ... , An = ", - " n/((1/A1) + (1/A2) + ... + (1/An)) = ans", - harmonicMeanFunc) -eucldianNorm = 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) -angleBtwVectors = 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) -absoluteDifference = Generator( - "Absolute difference between two numbers", 71, - "Absolute difference betweeen two numbers a and b =", "|a-b|", - absoluteDifferenceFunc) -vectorDot = Generator("Dot Product of 2 Vectors", 72, "a . b = ", "c", - vectorDotFunc) -binary2sComplement = Generator("Binary 2's Complement", 73, - "2's complement of 11010110 =", "101010", - binary2sComplementFunc) -invertmatrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", - "A^(-1)", matrixInversion) -sectorArea = Generator("Area of a Sector", 75, - "Area of a sector with radius, r and angle, a ", "Area", - sectorAreaFunc) -meanMedian = Generator("Mean and Median", 76, - "Mean and median of given set of numbers", - "Mean, Median", meanMedianFunc) -intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, - "Det([[a,b],[c,d]]) =", " a * d - b * c", - determinantToMatrix22) -compoundInterest = Generator( - "Compound Interest", 78, - "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", - "A dollars", compoundInterestFunc) -decimalToHexadeci = Generator("Decimal to Hexadecimal", 79, "Binary of a=", - "b", deciToHexaFunc) -percentage = Generator("Percentage of a number", 80, "What is a% of b?", - "percentage", percentageFunc) -celsiustofahrenheit = Generator("Celsius To Fahrenheit", 81, "(C +(9/5))+32=", "F", celsiustofahrenheitFunc) - -arithmeticProgressionTerm = Generator("AP Term Calculation", 82, - "Find the term number n of the AP series: a1, a2, a3 ...", - "a-n", arithmeticProgressionTermFunc) - -arithmeticProgressionSum = Generator("AP Sum Calculation", 83, - "Find the sum of first n terms of the AP series: a1, a2, a3 ...", - "Sum", arithmeticProgressionSumFunc) From ce79a2a94b67f06ddec87937135e9708b4a8dd53 Mon Sep 17 00:00:00 2001 From: lukew3 <lukew25073@gmail.com> Date: Mon, 19 Oct 2020 20:42:49 -0400 Subject: [PATCH 3/4] Fixed all ordering except for addition --- mathgenerator/funcs/__init__.py | 8 ++++---- test.py | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mathgenerator/funcs/__init__.py b/mathgenerator/funcs/__init__.py index bf9803e..8937e2c 100644 --- a/mathgenerator/funcs/__init__.py +++ b/mathgenerator/funcs/__init__.py @@ -11,8 +11,8 @@ from .moduloFunc import * from .squareRootFunc import * from .powerRuleDifferentiationFunc import * from .squareFunc import * -from .gcdFunc import * from .lcmFunc import * +from .gcdFunc import * from .basicAlgebraFunc import * from .logFunc import * from .divisionToIntFunc import * @@ -35,10 +35,10 @@ from .regularPolygonAngleFunc import * from .combinationsFunc import * from .factorialFunc import * from .surfaceAreaCube import * -from .volumeCube import * from .surfaceAreaCuboid import * -from .volumeCuboid import * from .surfaceAreaCylinder import * +from .volumeCube import * +from .volumeCuboid import * from .volumeCylinder import * from .surfaceAreaCone import * from .volumeCone import * @@ -84,5 +84,5 @@ from .compoundInterestFunc import * from .deciToHexaFunc import * from .percentageFunc import * from .celsiustofahrenheit import * -from .arithmeticProgressionSumFunc import * from .arithmeticProgressionTermFunc import * +from .arithmeticProgressionSumFunc import * diff --git a/test.py b/test.py index 1302ce5..7f2d993 100644 --- a/test.py +++ b/test.py @@ -4,3 +4,9 @@ from mathgenerator import mathgen print(mathgen.addition()) print(mathgen.genById(79)) +print(mathgen.getGenList()) +list = mathgen.getGenList() + +# prints the order of generators in the list +for item in list: + print(item[2]) From 20918c5a78ce8d4b4e12f3d51d83169e12be2024 Mon Sep 17 00:00:00 2001 From: lukew3 <lukew25073@gmail.com> Date: Mon, 19 Oct 2020 21:07:50 -0400 Subject: [PATCH 4/4] Rough fix of genList issue --- mathgenerator/__init__.py | 3 ++- test.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mathgenerator/__init__.py b/mathgenerator/__init__.py index 0a261d0..956697a 100644 --- a/mathgenerator/__init__.py +++ b/mathgenerator/__init__.py @@ -20,4 +20,5 @@ class Generator: def getGenList(): - return genList + correctedList = genList[-1:] + genList[:-1] + return correctedList diff --git a/test.py b/test.py index 7f2d993..9df861d 100644 --- a/test.py +++ b/test.py @@ -4,9 +4,10 @@ from mathgenerator import mathgen print(mathgen.addition()) print(mathgen.genById(79)) -print(mathgen.getGenList()) -list = mathgen.getGenList() -# prints the order of generators in the list +# prints each generator in genList +""" +list = mathgen.getGenList() for item in list: print(item[2]) +"""