1.0.1 formatting fixes

This commit is contained in:
lukew3
2020-10-13 14:06:11 -04:00
parent e54c0c0619
commit 82ea6a429a
5 changed files with 12 additions and 27 deletions

View File

@@ -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. 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: Your object instantiation should follow this format:
``` ```
#g<id> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) #<title> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>)
``` ```
and look something like this: 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: Your function should look something like the following:
``` ```
def addition(maxSum, maxAddend): def additionFunc(maxSum, maxAddend):
"""
DESCRIPTION:
Generates addition problems with positive addends less than maxAddend and sum less than maxSum
SKILLID:
2
PROBLEM:
"a+b="
SOLUTION:
"c"
"""
a = random.randint(0, 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 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 c = a+b

View File

@@ -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. 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 To try out generators, go to http://todarith.ml/generate

View File

@@ -19,7 +19,7 @@ class Generator:
# || Functions # || Functions
def addition(maxSum = 99, maxAddend = 50): def additionFunc(maxSum = 99, maxAddend = 50):
a = random.randint(0, 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 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 c = a+b
@@ -38,11 +38,6 @@ def subtraction(maxMinuend = 99, maxDiff = 99):
# || Class Instances # || Class Instances
#Format is: #Format is:
#g<id> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>) #<title> = Generator("<Title>", <id>, <generalized problem>, <generalized solution>, <function name>)
g2 = Generator("Addition", 2, "a+b=", "c", addition) addition = Generator("Addition", 2, "a+b=", "c", additionFunc)
g3 = Generator("Subtraction", 3, "a-b=", "c", subtraction) subtraction = Generator("Subtraction", 3, "a-b=", "c", subtractionFunc)
# || Testing Zone
print(g2)
print(g2())
print(g3())

View File

@@ -1,10 +1,10 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup( setup(
name='mathGenerator', name='mathgenerator',
version='1.0.0', version='1.0.1',
description='An open source solution for generating math problems', 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='Luke Weiler',
author_email='lukew25073@gmail.com', author_email='lukew25073@gmail.com',
license='MIT', license='MIT',
@@ -14,7 +14,7 @@ setup(
], ],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'mathGenerator=mathGenerator.mainGen:main' 'mathgenerator=mathgenerator.generator:main'
], ],
}, },
) )