lukew3 / mathgenerator

A math problem generator, created for the purpose of giving self-studying students and teaching organizations the means to easily get access to high-quality, generated math problems to suit their needs.
https://lukew3.github.io/mathgenerator
MIT License
681 stars 176 forks source link

algebra/expanding string integer out of range error #403

Open lukew3 opened 1 year ago

lukew3 commented 1 year ago

Bug Description

When generating a problem for algebra/expanding, this error may come up:

Traceback (most recent call last):
  File "adoptGenerator.py", line 40, in <module>
    main()  # makes readme
  File "/home/luke/src/mathgenerator/scripts/makeReadme.py", line 134, in main
    write_subject_table(subject, wList)
  File "/home/luke/src/mathgenerator/scripts/makeReadme.py", line 110, in write_subject_table
    write_list.append(gen_to_row_string(item))
  File "/home/luke/src/mathgenerator/scripts/makeReadme.py", line 58, in gen_to_row_string
    prob, solu = myGen()
  File "/home/luke/src/mathgenerator/mathgenerator/generator.py", line 26, in __call__
    return self.func(*args, **kwargs)
  File "/home/luke/src/mathgenerator/mathgenerator/funcs/algebra/expanding.py", line 37, in gen_func
    elif p3[0] == "+":
IndexError: string index out of range
ialoko commented 10 months ago

Hello, I just fixed this issue. Would love if I could get this approved for Hacktoberfest 2023