Skip to content

improve canvas.route test to do not overlap.#53

Open
saeedou wants to merge 7 commits intopylover:masterfrom
saeedou:feature/canvas_route
Open

improve canvas.route test to do not overlap.#53
saeedou wants to merge 7 commits intopylover:masterfrom
saeedou:feature/canvas_route

Conversation

@saeedou
Copy link
Contributor

@saeedou saeedou commented Sep 18, 2021

No description provided.

Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

Initial and trailing portions of your route must be horizontal.

@saeedou saeedou force-pushed the feature/canvas_route branch from 8c9db5a to e2e3f8d Compare September 18, 2021 10:50
c = Canvas()
c.route(2, 3, 7, 8)
c.route(2, 4, 7, 8)
c.route(2, 3, 7, 8, direction='h')
Copy link
Owner

Choose a reason for hiding this comment

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

direction='horizontal'

. | .
. | .
. | .
. +-> .
Copy link
Owner

Choose a reason for hiding this comment

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

👍

Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

Do not use abbreviations.

Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

Everything should be made as simple as possible, but no simpler.

Albert Einstein

adia/canvas.py Outdated
self.draw_vline(col1, row1, (row2 - row1))
self.set_char(col1, row2, '+')
self.draw_hline(col1 + 1, row2, col2 - col1 - 1)
def route(self, col1, row1, col2, row2, direction=None):
Copy link
Owner

Choose a reason for hiding this comment

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

direction) instead of direction=None).

def test_canvas_route_horizontal():
c = Canvas()
c.route(2, 3, 7, 8, direction='h')
c.route(2, 3, 7, 8, direction='horizontal')
Copy link
Owner

Choose a reason for hiding this comment

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

, 'horizontal' instead of , direction='horizontal'

@saeedou saeedou force-pushed the feature/canvas_route branch from d485c2c to de1556a Compare September 19, 2021 15:58
Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

canvas.py:148

@saeedou saeedou force-pushed the feature/canvas_route branch from de1556a to fcdee0d Compare September 19, 2021 16:22
Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

Please provide more tests for overlap.

Copy link
Owner

@pylover pylover left a comment

Choose a reason for hiding this comment

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

Please provide more tests for overlap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants