-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
added type hints for backtracking/minimax.py #2313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@cclauss do we need add some test cases? |
Yes, please. And please don't forget the difficult case like depth is -1 or scores is [], etc. |
Hey @abdujabbor, TravisCI finished with status TravisBuddy Request Identifier: 109d16a0-e7c7-11ea-b1e9-0f855a8df5b8 |
Travis tests have failedHey @abdujabbor, TravisBuddy Request Identifier: 91feece0-e7c8-11ea-b1e9-0f855a8df5b8 |
@cclauss look I think it's better than the previous version |
* Update CONTRIBUTING.md fixed dead link to the license * Update README.md Added License * Update README.md * Update README.md * Update README.md * Update CONTRIBUTING.md Co-authored-by: Christian Clauss <[email protected]>
* added idf-smooth * added idf-smooth * added idf-smooth
* Create capitalize.py This function will capitalize the first character of a sentence or a word * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update strings/capitalize.py Co-authored-by: Christian Clauss <[email protected]> * Update capitalize.py * Update strings/capitalize.py Co-authored-by: Christian Clauss <[email protected]> * Update capitalize.py * Update capitalize.py * Update capitalize.py * Update strings/capitalize.py Co-authored-by: Christian Clauss <[email protected]> * Update capitalize.py * Update strings/capitalize.py Co-authored-by: Christian Clauss <[email protected]> * Update capitalize.py * Update capitalize.py Co-authored-by: Christian Clauss <[email protected]>
* Create hexadecimal_to_decimal * Update conversions/hexadecimal_to_decimal Co-authored-by: Tapajyoti Bose <[email protected]> * Update conversions/hexadecimal_to_decimal Co-authored-by: Tapajyoti Bose <[email protected]> * Update conversions/hexadecimal_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update hexadecimal_to_decimal * Update hexadecimal_to_decimal * Update hexadecimal_to_decimal * Update hexadecimal_to_decimal * Update hexadecimal_to_decimal * Update conversions/hexadecimal_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update hexadecimal_to_decimal Added negative hexadecimal conversion to decimal number * Update hexadecimal_to_decimal * Update conversions/hexadecimal_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update conversions/hexadecimal_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update hexadecimal_to_decimal * Update hexadecimal_to_decimal Co-authored-by: Tapajyoti Bose <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* Update scoring_functions.py We can find accuracy by manually if we are not going to use sklearn library. * Update scoring_functions.py * Update machine_learning/scoring_functions.py Co-authored-by: Christian Clauss <[email protected]>
* optimized recursive_bubble_sort * Fixed doctest error due whitespace * reduce loop times for optimization * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Create octal_to_decimal octal to decimal converter * Update octal_to_decimal * Update conversions/octal_to_decimal Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* Create binary_to_decimal binary to decimal converter * Update conversions/binary_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update binary_to_decimal * Update conversions/binary_to_decimal Co-authored-by: Christian Clauss <[email protected]> * Update binary_to_decimal Co-authored-by: Christian Clauss <[email protected]>
* Fix Non Recursive Depth First Search * Unindent docstring * Reindent docstring by 1 space Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
* lxmlCovidDataFetch * lxmlCovidDataFetch1 * Update worldometers_covid_with_lxml.py * Rename worldometers_covid_with_lxml.py to covid_stats_via_xpath.py Co-authored-by: Christian Clauss <[email protected]>
* file-transfer: writing tests and ensuring that all is going well * def send_file(filename: str = "mytext.txt", testing: bool = False) -> None: * send_file(filename="mytext.txt", testing=True) * Update send_file.py * requirements.txt: lxml Co-authored-by: Christian Clauss <[email protected]>
* jump_search: doctest, docstring, type hint, inputs * jumpsearch.py: case number not found * trailing whitespace jump search
* fix assignment of a variable to itself * Fix unnecessary 'else' clause in loop * formatting and redundant reasignment fix * mark unreachable code with a TODO comment * fix variable defined multiple times * fix static method without static decorator * revert unintended autoformatting Co-authored-by: Christian Clauss <[email protected]> * revert autoformatting issue * applied black autoformatting Co-authored-by: Christian Clauss <[email protected]>
* * Renamed files * Fiexed doctest * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* * Added type hints * Added test * Formated code * updating DIRECTORY.md * Update stack.py * Test error conditions for pop, peek, and Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
* recaptchaVerification * recaptchaVerification * recaptchaVerification1 * recaptchaVerification2 * recaptchaVerification3 * recaptchaVerification4 * recaptchaVerificatio5 * recaptchaVerificatio5 * recaptchaVerificatio6 * drawOnVideoStreamOpenCV * matrixInverseMCAmethod * fixingImports * recaptchaVerificationfixes * recaptchaVerificationfixes * recaptchaVerificationfixes * recaptchaVerificationfixes * recaptchaVerificationfixes1 * recaptchaVerificationfixes1 * authenticate = login = render = redirect = print Co-authored-by: Christian Clauss <[email protected]>
* bin_to_octal Converts binary values to the octal equivalent. * Update bin_to_octal * Update conversions/bin_to_octal Co-authored-by: Christian Clauss <[email protected]> * Update conversions/bin_to_octal Co-authored-by: Du Yuanchao <[email protected]> * Update conversions/bin_to_octal Co-authored-by: Du Yuanchao <[email protected]> * Update conversions/bin_to_octal Co-authored-by: Du Yuanchao <[email protected]> * Rename bin_to_octal to bin_to_octal.py Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Du Yuanchao <[email protected]>
* Update and rename bin_to_octal.py to binary_to_octal.py * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
…m a palindrome. (#2450) * Added check_if_string_can_be_rearranged_as_palindrome function. * Added counter implementation and benchmark function. * flake changes * Update and rename check_if_string_can_be_converted_to_palindrome.py to can_string_be_rearranged_as_palindrome.py * Update can_string_be_rearranged_as_palindrome.py * # Co-authored-by: svedire <[email protected]> Co-authored-by: Christian Clauss <[email protected]>
|
||
scores = [90, 23, 6, 33, 21, 65, 123, 34423] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These five lines show the user something when they run the program. Removing them means that the program shows the user nothing when run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cclauss thank you for your feedback, I have added these lines as method main, look at it if is it right way or not?
* Add solution and test files for project euler 54 * Update sol1.py * updating DIRECTORY.md * Fix: use proper path to open files * Commit suggestions: - Use list comprehension instead of map - Sort imports using isort * Changes made as suggested (simplified a lot): - List and set comprehension instead of itemgetter - Using enumerate as it's easy to read - Divided into list of card values and set of card suit as set will remove all the duplicate values. So, no need for double indexing. - Add test for testing multiple calls to five_high_straight function * Add suggestions and simplified: - Split generate_random_hands function into two: - First will generate a random hand - Second, which will be called, will return a generator object Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* optimization for problem09 in project_euler * added benchmark code * fixup! Format Python code with psf/black push * Update project_euler/problem_09/sol1.py Co-authored-by: Christian Clauss <[email protected]> * updating DIRECTORY.md * Update project_euler/problem_09/sol1.py * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Christian Clauss <[email protected]>
* Testing Travis CI configuration for project Euler * Fix: Installing mypy and pytest-cov for testing * Remove unnecessary checks for project_euler job * Removing branches section * Update .travis.yml * Update .travis.yml * Update .travis.yml * Update .travis.yml Co-authored-by: Christian Clauss <[email protected]>
* from __future__ import annotations * fixup! from __future__ import annotations * fixup! from __future__ import annotations * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
backtracking/minimax.py
Outdated
@@ -1,4 +1,5 @@ | |||
from typing import List |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase with master to pick up the #2464 changes.
* Add Python type hints and doctests to other/two_sum.py #2465 * Update other/two_sum.py Co-authored-by: Christian Clauss <[email protected]> * Update other/two_sum.py Co-authored-by: Christian Clauss <[email protected]> * Update two_sum.py Co-authored-by: Christian Clauss <[email protected]>
* Added binary_and_operator.py & binary_xor_operator.py * Updated binary_and_operator.py * Updated binary_xor_operator.py * Updated binary_xor_operator.py
* updated reversed words * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* fixed remove duplicate * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* Add solution() for problem 54 of Project Euler * Add type hints for solution() function
Hey @abdujabbor, TravisCI finished with status TravisBuddy Request Identifier: aa11d8b0-fe70-11ea-803e-573615702161 |
@cclauss I can't understand why but after rebase there are a lot of other commits in my pull request, is it ok? or better to close this PR and send another with only my changes? |
Please create a new PR with just one file changed. |
Added type hints and little modification for readability on backtracking/minimax.py
Checklist:
Fixes: #{$ISSUE_NO}
.