mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
* Improve combine_like_terms * Lint fix * add some latex to readme * give compound_interest latex formatting * fix compound interest readme * update combine_like_terms readme * combine_like_terms add delimiters * Convert some alebra output to latex * Add missing right] to latex * Fix makeReadme script * Correct det 2x2 latex * use bmatrix for det 2x2 * update readme and bump version * Make latex matrix one line * made latex for most of algebra * more latex migrations * convert basic_math to latex * re-generate readme * fix double exponent * latex for most of calculus * Improved stationary points gen * made cs latex * Transform geometry to latex * texify misc outputs * texify statistics * regenerate readme * Add tex markers to linear_equations * add list_to_tex for mult_int_22 * upgrade readme * update list_to_tex * add end to list_to_tex * tweak list_to_tex, update readme * Update README.md * Update README.md * lint fixes * lint fix * Remove tests * texify system_of_equations * update system_of_equations tex * regen readme * texify complex_quadratic * update complex_quadratic * regen readme * sqrt to complex_quadratic * complex_quadratic texify * Update README.md * Update README.md * make latexbuilder * regen readme * fix bmatrix * bmatrix conversions * update readme * use times symbol * improve tex of prod_sci_notations * Add missing delim to prod of sci notations * Add missing curly brack to prod-sci-not * lint fixes * texify differentiation * texify stationary points * changed differentation to trig_differentiation * texify stationary points * update readme * Remove left right from stat_points * texify angle_btw_vectors * update readme * add spaces to mod operator * Swap \\% with \\percent * update readme * Replace //percent with non-math % * fix leftover \\percent * latexify vector_cross * change tex multiply to times * update readme * lint fixes * lint fix
16 lines
348 B
Python
16 lines
348 B
Python
from ...generator import Generator
|
|
import random
|
|
|
|
|
|
def gen_func(max_dec=99):
|
|
a = random.randint(1, max_dec)
|
|
b = bin(a).replace("0b", "")
|
|
|
|
problem = f'Binary of ${a} = $'
|
|
solution = f'${b}$'
|
|
return problem, solution
|
|
|
|
|
|
decimal_to_binary = Generator("Decimal to Binary", 14, gen_func,
|
|
["max_dec=99"])
|