First project from math series - polynomial expressions. This is a very very basic project that solves a polynomial equation of degree less than or equal to 2 -quadaratic, linear and monomial functions. In its standard form, it displays basic information about the solving process like reduced form of equation, polynomial degree and the solutions, however with --verbose
and --improved
flags more logs are available.
git clone https://github.com/psprawka/Computor_V1 psprawka_computor_v1
cd psprawka_computor_v1
python3 computor_v1.py [-h] [-v | --verbose] [--improved] [-f file | --file file] <equation[s]>
The program supports several options and arguments:
-h
: display extended usage of computor_v2
-v | --verbose : display verbose logs of equation solving process
--improved
: 'reduced' part of solving process will be display in more elegant style,
i.e. x² insted of X^2, 9 instead of 9 * X^0 etc
-f || --file file : take with test cases instead of arguments from command line. Once
the program encounters this flag, it ignores all of the following parameters.
Valid file is constructed from the equations = one per line. It can contain
the comments with '#', meaning everything after '#' sign will be ignored
<equation[s]> : the equations to solve. There should be at least one equation, otherwise
computor_v1 will sit and wait for the equation in command line. Equation
should be composed in the following way:
'a₀ * X^0 + a₁ * X^1 + ... + an * X^n = a₀ * X^0 + a₁ * X^1 + ... + an * X^n',
meaning:
-> it has one equal sign,
-> all terms are in the form of a * xⁿ,
-> the powers are well ordered and all present.