Uh oh!
There was an error while loading. Please reload this page.
Updated problem_06 in Project Euler - #2439
Conversation
spamegg1
commented
Sep 16, 2020
In In sum_cubes= (n* (n+1) //2) **2sum_squares=n* (n+1) * (2*n+1) //6returnsum_cubes-sum_squares |
realDuYuanChao
commented
Sep 16, 2020
I agree. And you ? @cclauss |
* fix type hint * fix doctest
We should test the solutions against each other. Please create one more file called fromsol1importsolutionassol1fromsol2importsolutionassol2fromsol3importsolutionassol3fromsol4importsolutionassol4deftest_solutions()
""" >>> test_solutions() """assertsol1() ==sol2() ==sol3() ==sol4()
if__name__=="__main__":
test_solutions() |
TravisBuddy
commented
Sep 17, 2020
Travis tests have failedHey @shellhub, TravisBuddy Request Identifier: c53c0e60-f8c3-11ea-addf-b708e47cc149 |
| if __name__ == '__main__': | ||
| test_solutions() No newline at end of file |
There was a problem hiding this comment.
Python files end with one and only one \n.
realDuYuanChao
commented
Sep 17, 2020
@cclauss build passed. Thanks :) |
cclauss
commented
Sep 17, 2020
Is there a website that provides all the answers to the Euler puzzles so we could test the solutions against those answers? |
realDuYuanChao
commented
Sep 17, 2020
I have no results after google.😄 |
https://www.nayuki.io/page/project-euler-solutions |
importrequestsurl="https://raw.githubusercontent.com/nayuki/Project-Euler-solutions/master/Answers.txt"lines= [line.replace(":", "").split()[1:] forlineinrequests.get(url).text.splitlines() ifline.startswith("Problem")]
answers= {int(key): valueforkey, valueinlines} |
@dhruvmanila@nayuki@shellhub@spamegg1 The Euler tests really slow down our automated testing so I was thinking about creating a second Travis CI job that would run in parallel just to test the Euler code while the main Travis CI job continues testing all other algorithms.
Is anyone interested to work on this with me? |
dhruvmanila
commented
Sep 23, 2020
Yes, I will help. I will take a look at how to implement parallel jobs in Travis CI.
One question: Does every Euler solution contains the implementation which prints the actual answer? If it's a maybe then we will have to check for that as well. |
cclauss
commented
Sep 23, 2020
According to CONTRIBUTING.md, algorithmic functions should not |
cclauss
commented
Sep 23, 2020
We should raise issues on the files that do not contain pure algorithmic functions that do not print. These will be good issues for Hacktoberfest! |
Alright, I did it with using Also, Edit:
Edit: $ fd -t f -e py .| wc -l # find files with extension py and count the lines 668
$ fd -t d .| wc -l # find directories and count the lines 123I'll open a PR for this. |
* * rename variable
* fix type hint
* fix doctest
* added test function
* fixed import error
* fixup! Format Python code with psf/black push
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.