Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d9feae6

Browse files
author
Greg Eakin
committed
Typos
1 parent 9ab98ed commit d9feae6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎ch07/knightsTests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def test_3x4(self):
9393
width = 4
9494
height = 3
9595
# 1,0 2,0 3,0
96-
# 0,2 1,2 2,0
96+
# 0,2 1,2 2,2
9797
# 2 N N N .
9898
# 1 . . . .
9999
# 0 . N N N
@@ -111,8 +111,8 @@ def test_10x10(self):
111111
self.find_knight_positions(width, height, 22)
112112

113113
def test_12x12(self):
114-
width = 13
115-
height = 13
114+
width = 12
115+
height = 12
116116
self.find_knight_positions(width, height, 28)
117117

118118
def test_13x13(self):

‎ch17/regexTests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ def __init__(self, numWantedMatched, totalWanted, numUnwantedMatched,
357357
def __gt__(self, other):
358358
combined = (self._totalWanted - self.NumWantedMatched) \
359359
+ self.NumUnwantedMatched
360-
otherCombined = (self._totalWanted - other.NumWantedMatched) \
360+
otherCombined = (other._totalWanted - other.NumWantedMatched) \
361361
+ other.NumUnwantedMatched
362362
if combined != otherCombined:
363363
return combined < otherCombined
@@ -370,7 +370,7 @@ def __gt__(self, other):
370370
return self.Length < other.Length
371371

372372
def __str__(self):
373-
return "matches {} wanted {} unwanted, len {}".format(
373+
return "matches: {} wanted, {} unwanted, len {}".format(
374374
"all" if self._totalWanted == self.NumWantedMatched else self.NumWantedMatched,
375375
self.NumUnwantedMatched,
376376
self.Length)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /