Skip to content

Commit

Permalink
fixed buncha shit and added to db good night
Browse files Browse the repository at this point in the history
added buncha shit and the db
  • Loading branch information
viktorashi committed Sep 19, 2023
1 parent 1cf62d7 commit 056f664
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#project specific

test.*
test/
bruh.py
bingoconfig.json
pyvenv.cfg
Expand Down
4 changes: 1 addition & 3 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,4 @@ when making it a front-end : make a calculation to see how much time it would ta

Not Checking when found output (try to make each thread conect via the websocket)

some other shit idk

more idk
-Aparently when he changes from 5x5 to 6x6 the link stays the same... so that's confusing, and when you go back to a previously generated card it just keeps everything that was before checked and the size gets increased like hmmm idfk how we would be able to save that, brian stuoopid
Binary file added bingo-card-databases/5by5.zip
Binary file not shown.
Binary file not shown.
Binary file added bingo-card-databases/6by6.zip
Binary file not shown.
14 changes: 7 additions & 7 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def get_text_squares(self, squares) -> [[str]]:
#initialize 2d array of empty strings
phrases: [[str]] = [["" for _ in range(self.size)] for _ in range(self.size)]
phrases: [[str]] = [["" for _ in range(6)] for _ in range(6)]
for square in squares:
phrases[square["row"]][square["col"]] = square["label"]
return phrases
Expand Down Expand Up @@ -67,7 +67,7 @@ def get_squares_completion(self, card: dict) -> [[bool]]:
for i in range(self.size):
for j in range(self.size):
for input_phrase in self.input_phrases:
if input_phrase.lower().strip() in card["squares"][i][j].lower():
if input_phrase in card["squares"][i][j].lower():
squares_completion[i][j] = 1
break

Expand Down Expand Up @@ -164,7 +164,6 @@ def check_4_corners(size, squares: [[bool]]) -> bool:
"""
4 corners
"""

return (
squares[0][0]
and squares[0][size - 1]
Expand Down Expand Up @@ -399,11 +398,12 @@ def read_from_config() -> dict:


def read_from_input(self) -> [str]:
with open(self.input_path) as f:
input_phrases = f.read().splitlines()
if input_phrases == []:
with open(self.input_path) as f_in:
lines = (line.rstrip() for line in f_in) # All lines including the blank ones
lines = list(line for line in lines if line) # Non-blank lines
if lines == []:
raise ValueError(f"input file {self.input_path} is empty")
return input_phrases
return lines


def write_to_output(self, cards: [dict]) -> None:
Expand Down

0 comments on commit 056f664

Please sign in to comment.