-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b40bb89
commit cd4793b
Showing
8 changed files
with
160 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
from cell import Cell | ||
|
||
class Clue: | ||
# values that Clue.direction can take: | ||
ACROSS = True | ||
DOWN = False | ||
|
||
def __init__(self, number, across, question, answer, finished): | ||
def __init__(self, number, direction, question, answer): | ||
self.number = number | ||
self.across = across | ||
self.direction = direction | ||
self.question = question # string | ||
self.answer = answer # string | ||
self.finished = finished | ||
self.cells = [] # a list of Cell objects that the clue contains | ||
|
||
def finished(self): | ||
for cell in self.cells: | ||
if cell.content == None: | ||
return False | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
from clue import Clue | ||
|
||
class Room: | ||
def __init__(self, clues_across, clues_down, state, check): | ||
def __init__(self, clues, state, check): | ||
self.clues = {} | ||
self.clues["across"] = clues_across | ||
self.clues["down"] = clues_down | ||
self.clues["across"] = [x for x in clues if x.direction == Clue.ACROSS] | ||
self.clues["down"] = [x for x in clues if x.direction == Clue.DOWN] | ||
self.state = state | ||
self.check = check | ||
self.check_displayed = True |
Oops, something went wrong.