Solve problems from the Tchisla app in Python. Code is in the tchisla.py
script below. Parameters for the problem being solved can be modified in the if __name__ == "__main__"
block at the bottom of tchisla.py
.
TODO:
- Avoid creating strings for expressions until the values have been validated
- This could involve passing the operator and child expressions to
Solver._validate
instead of the resulting expression, calculting the value using theOperator.operation
attribute orOperator.__call__
method inSolver._validate
, and then only creating the resulting expression (including creating its string using theOperator.get_string
attribute) if the value is valid
- This could involve passing the operator and child expressions to
- Change
target
,n
andn_count_target
to command line arguments - Add more comments
- Save dictionaries to file so that the