diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d9b6ee..556fd76 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,26 +8,16 @@ This project was created with contributions at it's core. We need your help to e As of right now, all of our generators are being coded in python. Your generator will be an object of the Generator class and will have a function created seperately. Your object instantiation should follow this format: ``` -#g = Generator("", <id>, <generalized problem>, <generalized solution>, <function name>) +#<title> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) ``` and look something like this: ``` -g2 = Generator("Addition", 2, "a+b=", "c", addition) +addition = Generator("Addition", 2, "a+b=", "c", additionFunc) ``` Your function should look something like the following: ``` -def addition(maxSum, maxAddend): - """ - DESCRIPTION: - Generates addition problems with positive addends less than maxAddend and sum less than maxSum - SKILLID: - 2 - PROBLEM: - "a+b=" - SOLUTION: - "c" - """ +def additionFunc(maxSum, maxAddend): a = random.randint(0, maxAddend) b = random.randint(0, min((maxSum-a), maxAddend)) #The highest value of b will be no higher than the maxsum minus the first number and no higher than the maxAddend as well c = a+b diff --git a/README.md b/README.md index 7b87d47..a413aa2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# mathGenerator +# mathgenerator A math problem generator, created for the purpose of giving self-studying students and teaching organizations the means to easily get access to random math problems to suit their needs. To try out generators, go to http://todarith.ml/generate diff --git a/mathGenerator/__init__.py b/mathgenerator/__init__.py similarity index 100% rename from mathGenerator/__init__.py rename to mathgenerator/__init__.py diff --git a/mathGenerator/generator.py b/mathgenerator/mathgen.py similarity index 77% rename from mathGenerator/generator.py rename to mathgenerator/mathgen.py index 2be0ec8..0c6d444 100644 --- a/mathGenerator/generator.py +++ b/mathgenerator/mathgen.py @@ -19,7 +19,7 @@ class Generator: # || Functions -def addition(maxSum = 99, maxAddend = 50): +def additionFunc(maxSum = 99, maxAddend = 50): a = random.randint(0, maxAddend) b = random.randint(0, min((maxSum-a), maxAddend)) #The highest value of b will be no higher than the maxsum minus the first number and no higher than the maxAddend as well c = a+b @@ -38,11 +38,6 @@ def subtraction(maxMinuend = 99, maxDiff = 99): # || Class Instances #Format is: -#g<id> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) -g2 = Generator("Addition", 2, "a+b=", "c", addition) -g3 = Generator("Subtraction", 3, "a-b=", "c", subtraction) - -# || Testing Zone -print(g2) -print(g2()) -print(g3()) +#<title> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) +addition = Generator("Addition", 2, "a+b=", "c", additionFunc) +subtraction = Generator("Subtraction", 3, "a-b=", "c", subtractionFunc) diff --git a/setup.py b/setup.py index b1f5269..0c36b2a 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ from setuptools import setup, find_packages setup( - name='mathGenerator', - version='1.0.0', + name='mathgenerator', + version='1.0.1', description='An open source solution for generating math problems', - url='https://github.com/todarith/mathGenerator', + url='https://github.com/todarith/mathgenerator', author='Luke Weiler', author_email='lukew25073@gmail.com', license='MIT', @@ -14,7 +14,7 @@ setup( ], entry_points={ 'console_scripts': [ - 'mathGenerator=mathGenerator.mainGen:main' + 'mathgenerator=mathgenerator.generator:main' ], }, )