mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
Added latex for 11, 12, and 17. First 3 of algebra section
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def basicAlgebraFunc(maxVariable=10):
|
||||
def basicAlgebraFunc(maxVariable=10, style='raw'):
|
||||
a = random.randint(1, maxVariable)
|
||||
b = random.randint(1, maxVariable)
|
||||
c = random.randint(b, maxVariable)
|
||||
@@ -20,8 +20,12 @@ def basicAlgebraFunc(maxVariable=10):
|
||||
elif a == 1 or a == i:
|
||||
x = f"{c - b}"
|
||||
|
||||
problem = f"{a}x + {b} = {c}"
|
||||
solution = x
|
||||
if style == 'latex':
|
||||
problem = f"\\({a}x + {b} = {c}\\)"
|
||||
solution = "\\(" + x + "\\)"
|
||||
else:
|
||||
problem = f"{a}x + {b} = {c}"
|
||||
solution = x
|
||||
return problem, solution
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user