-
Notifications
You must be signed in to change notification settings - Fork 2
Dave's Branch #3
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
base: main
Are you sure you want to change the base?
Changes from 13 commits
57c8d05
3697ff9
8bf41d3
426d9d7
7ed053b
c22d826
74ea0db
3690887
05fc53c
85c3c93
05320b4
4df03ff
667ea7b
f811b83
af63a19
34a8ec7
efddf53
0068470
d71ac00
1700325
d71bf54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| class FailedToGenerateWordSearchError(Exception): | ||
| ... | ||
|
|
||
|
|
||
| class FailedToPlaceAllWordsError(Exception): | ||
| ... | ||
|
|
||
|
|
||
| class NoLegalPlacementsError(Exception): | ||
| ... | ||
|
|
||
|
|
||
| class GridOverflowError(Exception): | ||
| ... |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "name": "Dave", | ||
| "version": "0.0.2", | ||
| "description": "", | ||
| "main": "main.py", | ||
| "scripts": { | ||
| "start": "nodemon main.py", | ||
| "test": "pytest" | ||
| }, | ||
| "keywords": [], | ||
| "author": "", | ||
| "license": "ISC", | ||
| "devDependencies": { | ||
| "nodemon": "^3.0.1" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,8 @@ class Placement: | |
| position: Point | ||
| direction: Direction | ||
|
Comment on lines
+8
to
+9
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like the "prefer composition over inheritance"!
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you clarify?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a design pattern thing here is a good explanation but it's a very common phrase. |
||
|
|
||
| # This allows us to unpack a placement with the syntax: | ||
| # position, direction = placement | ||
| def __iter__(self): | ||
| yield self.position | ||
| yield self.direction | ||
|
DaveDangereux marked this conversation as resolved.
|
||
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.
A mix of
is notand!=here again.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.
Ah yeah, this was because I had intended to use
is/is notwith everything, but received a SyntaxWarning about using it with a literal.Turns out this is because
is/is notand==/!=are not interchangeable and the former checks type as well, as far as I can tell.Seems like the answer is to make everything
==/!=.That's enough backticks for now.