26 ms·
One of the big reasons Project Euler is so brilliant is that every problem is formulated so that you can do it in any language. (I've introduced myself to about
by Smaug123 6y ago
One of the big reasons Project Euler is so brilliant is that every problem is formulated so that you can do it in any language. (I've introduced myself to about six languages this way, none of which you support yet.) What drove the decision to have an allowlist of languages? If you're concerned about people publishing the one true number that is the answer to problem 11, you could always generate random test cases and ask the user to supply the answers to those test cases.
- pontus 6y agoThe downside with Project Euler, though is that you need to run your code elsewhere. That's why something like leetcode is so nice (I think, at least): you can run the code right there in the browser. If you take this approach, you're forced to whitelist languages.
- Smaug123 6y agoPorque no los dos? Allowlist the languages you understand, also allow manual entry for the languages you don't? Seems like the obvious solution.
- PolarizedPoutin 6y agoRight yeah it's a good question. I think the reason we did it is so that we could visualize user output/solutions. You can learn new things by looking at your solutions to various test cases! One example would be if you submit a solution (or just the code stub) to the Exponential growth problem, then your solution gets plotted and compared with the analytic solution and the correct solution: https://projectlovelace.net/problems/exponential-growth/ https://projectlovelace.net/problems/exponential-growth/ Also, unlike Project Euler where every solution is a number, a lot of scientific problems have solutions that are multi-dimensional arrays or multiple objects. So in this case, copy pasting your output becomes quite messy. It's not trivial to add support new languages since the engine app that runs user-submitted code needs to be able to run arbitrary code in your chosen language and needs a way to communicate with Python (either directly or through JSON passing). So far we've just been adding support for languages we know and use. But indeed there are hundreds of languages out there that would be nice to support in some way. It might be neat to add a new submission mode where you're given a couple of test cases that you run manually then submit your solution manually.
- HKH2 6y agoFor multiple items, you could sum them like in Advent of Code.
- PolarizedPoutin 6y agoOh that's a neat idea. I should check out Advent of Code. Summing would probably work for a lot of problems but some problems mix strings with numbers in the output