I first started off by creating four files: gui.py, translator.py, definitions.py, and solver.py.
- gui.py is the script that will run the graphics user interface for the user, so that the user can type down their math problem and have it submitted to the program.
- translator.py is the script will perform translations in order to make an expression or an input be in a more friendly form for another function or script to use.
- definitions.py is where I'm going to define all the mathematical objects, and operations, such as: variables, constants, and expressions.
- solver.py is where the logic of solving various problems be stored in.
These four files won't be the only files in this program. I plan to add a script that is dedicated in creating the explanations for the step-by-step solutions, storing each step as it is created, and help project that onto the GUI.
As for the actual progress in this project, I have defined classes for variables, constants, and expressions, so that I can define specific operations that can be done to each of these objects in various cases. I did define a few functions in the expression class that will gather like terms, and simplify the expression by step. As of currently, it requires some debugging, since I recently implemented the "constant" class, since initially I was handling constants as strings in my expression, but then I realized that defining operations for them would be all over the place.
This constant class will handle all operations with numbers itself, and it's being used as a parameter for the coefficient and degree for the variable class itself. (It's named "var".) The var class can only handle simple terms, which can only have one letter being raised to a power, but it can't handle having multiple variables, all being raised to different powers. I do plan to fix that, by perhaps creating a new class similar to the variable class that will store all of its letters, and every power associated with each one of them.
I did define a function in translator.py called "translate_input", which will translate the user's input into a form that uses the classes in definitions.py, such as var and constant, and to be able to be used by other classes, such as the expression class as previously mentioned.
I currently have made quite a bit of progress, and I hope I can continue to push forward, and reach a big milestone.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.