DEV Community

loading...

Discussion on: Advent of Code 2020: Python Solution Day 18

Collapse
codemonkey51 profile image
Codemonkey51

I spent like 20 minutes working on it using ply and misread the instructions, accidentally flipping precedence, instead of removing it. So I accidentally solved part 2 doing part 1.

Collapse
qviper profile image
Viper Author

Can you share it? I tried to solve this using recursion but it was too large to parse everything.

Collapse
codemonkey51 profile image
Codemonkey51

I think I may have deleted it, once I found an easier way, the same idea that you used. But I could try to recover it. (I'm not good at ply at all, so it had to run 2 scripts to actually work.). One other solution I tried: I made a "math engine" a while ago, it used PEMDAS, but I never finished the parenthesis parsing in it.

Thread Thread
qviper profile image
Viper Author

Awesome. 'Math engine' is it publicly available?

Thread Thread
codemonkey51 profile image
Codemonkey51 • Edited

I think I can pull it up on my github, but it is old code, and it doesn't have the best formatting, and variable naming. But I can see if I link it one sec.

Thread Thread
codemonkey51 profile image
Codemonkey51 • Edited

@qviper I can find it, it's just not on github. I think I could put it up right now though.

Thread Thread
qviper profile image
Viper Author

Cool. I hope you can share it on GitHub.

Thread Thread
codemonkey51 profile image
Codemonkey51

I can't easily put it on github right now, but I do have it on replit. Beware, lots of bugs/errors ahead

Thread Thread
qviper profile image