6 ms·
Python-based Project Euler command line tool
- Pewqazz 12y agoOh wow, didn't think this would get posted to Hacker News. I only submitted a link to /r/learnprogramming and /r/Python since, being my first ever Python project, it seems pretty rudimentary compared to some of the amazing things I see here. I'm glad to see people are liking it (and perhaps more importantly that I didn't make any massive coding mistakes)!
- chunkstuntman 12y agoHaving a --cheat option seems like a poor decision. Having easy access to every solution (especially as it exists in a plain text file) harms the experience of struggling through a problem until the correct answer is reached.
- Pewqazz 12y agoI considered this, and figured since the solutions are stored by the program anyways, it would make more sense to include the functionality rather than to omit it. Naming the option `--cheat` was an conscious decision to discourage a reliance on it. Then again, if someone really does want to view the solutions rather than work through the problems themselves, I suppose it's their loss anyways.
- chunkstuntman 12y agoWell, the general upside to googling for an answer is that often when someone is providing you with the numeric solution they are also describing their algorithm and implementation. Having it in plain text right on the local hard drive might be more tempting with fewer benefits. Potential Solution: store the solutions file in an obfuscated format that is easy to decrypt
- giancarlostoro 12y agoStoring them in a sqlite database could be enough "encryption" for the beginner type to not find the solutions right away.
- Pewqazz 12y agoGood point; I'll keep this solution in mind.
- e12e 12y ago> the general upside to googling for an answer is that often when someone is providing you with the numeric solution they are also describing their algorithm and implementation Can't this be seen as a downside as well? I'd much rather have an option of first just seeing if I'm eg off by a magnitude, or an iteration -- rather than having my fun ruined by someone showing me the whole solution...
- mcamac 12y agoPossibly md5 them or something?
- giancarlostoro 12y agoThat's great! Now I can try Project Euler in Python, I've just started learning Python, I'm loving it so far after putting it off for 10 years... Thanks, keep up the good work! - Giancarlos
- GuiA 12y agoIncluding solutions is just a terrible idea. Not only is it discouraged by the maintainer of the site himself [0], it is also just inconsiderate to the community. The worst thing that could happen to Project Euler is people creating profiles and populating them with answers they didn't come up with, so they can pad their resume or other. Having PE be flooded with profiles that have hundreds of "solved" problems would ruin it for those of us who enjoy the challenge and take pride in their solved count. When you are publishing large corpuses of answers to Github, your personal site, etc., you make it that much more likely for Project Euler to be ruined in the future. I get the incentive behind including solutions in your tool, and there are definitely worse things in the world- but it's just not cool and disrespectful to the PE community. [0]: http://projecteuler.net/about http://projecteuler.net/about - see penultimate entry
- Pewqazz 12y agoThe solutions that are stored in the package are only plain answers - not actual algorithmic solutions to each of the problems. I understand the concern, but in my opinion, if someone had a collection of solutions that were derived specifically from the answers derived from EulerPy, it would likely consist of just `print n`s (which shouldn't be impressive to anyone by any means). I apologize if my project has degraded the integrity of the Project Euler community.
- ipsin 12y agoI don't think that's any better. Please consider removing them and leaving it to people to discover the answers themselves.
- pepon 12y agoNo need to apologize. IMHO your project is great for the Project Euler community.
- ghshephard 12y agoPlease don't apologize - I absolutely love what you've done here - I'm frequently in situations where I don't have good internet connectivity, but would love to spend time keeping my scripting skills sharp with PE - and now I can. I'd previously scraped the questions off of PE, but could never check my answers until I was back online - but now I can! Your project is going to have a meaningful, and measurably beneficial impact on my life, and I'd like to say thank you very much for the hard work you've put into this wonderful tool!
- CraigJPerry 12y agoI used Cython and PyOpenCL on some of the problems, but similar idea: https://github.com/CraigJPerry/project_euler https://github.com/CraigJPerry/project_euler Not sure about the cheat option though, kinda goes against the ethos of the site?
- racktash 12y agoI like the idea of downloading the question, and having it placed in the source code file. I myself extract the problem into a comment (although, I use C) before trying to work out the solution, so this could save me valuable seconds. :)
- ghshephard 12y agoImportant to note that these are just the first 202 questions, and they don't include any graphical resources. Some of the PE questions, will probably benefit from the actual images, particularly ones like: https://projecteuler.net/problem=252 https://projecteuler.net/problem=252
- Pewqazz 12y agoHmm, I'll have to keep this in mind when I get to adding problems like this. Time to convert GeoGebra images to ASCII art /s!
- qmaxquique 12y agoHey Guys, Do you want to try it immediately? I've created a terminal.com snapshot. Feel free to test it and comment! https://terminal.com/tiny/aEVfrRHg8K https://terminal.com/tiny/aEVfrRHg8K