Skip to content

Create collision_between_rectangles.py #7831

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

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added parameter type hint
  • Loading branch information
0shuvo0 authored Oct 29, 2022
commit ad9f14b8c9d519b3f5eb07fb7418fed6f182e321
2 changes: 1 addition & 1 deletion maths/collision_between_rectangles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
rect2 = {"x": 20, "y": 30, "height": 40, "width": 30}


def check_collision(rect1, rect2) -> bool:
def check_collision(rect1 -> dict, rect2 -> dict) -> bool:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occured while parsing the file: maths/collision_between_rectangles.py

Traceback (most recent call last):
  File "/opt/render/project/src/.venv/lib/python3.10/site-packages/libcst/_parser/base_parser.py", line 151, in _add_token
    plan = stack[-1].dfa.transitions[transition]
KeyError: ReservedString(->)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 145, in parse
    reports = lint_file(
libcst._exceptions.ParserSyntaxError: Syntax Error @ 6:27.
Incomplete input. Encountered '->', but expected ')'.

def check_collision(rect1 -> dict, rect2 -> dict) -> bool:
                          ^

"""
Check if two rectangle are colliding/overlaping

Expand Down