diff --git a/.gitignore b/.gitignore index 83f41ff..b771117 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ #project specific -test.* +test/ bruh.py bingoconfig.json pyvenv.cfg diff --git a/TODO.txt b/TODO.txt index 9fa9b06..44f12f2 100644 --- a/TODO.txt +++ b/TODO.txt @@ -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 \ No newline at end of file diff --git a/bingo-card-databases/5by5.zip b/bingo-card-databases/5by5.zip new file mode 100644 index 0000000..d1d7b26 Binary files /dev/null and b/bingo-card-databases/5by5.zip differ diff --git a/bingo-card-databases/64c998520e68afc5-generated.txt.zip b/bingo-card-databases/64c998520e68afc5-generated.txt.zip deleted file mode 100644 index 0ecdee0..0000000 Binary files a/bingo-card-databases/64c998520e68afc5-generated.txt.zip and /dev/null differ diff --git a/bingo-card-databases/6by6.zip b/bingo-card-databases/6by6.zip new file mode 100644 index 0000000..f0a0178 Binary files /dev/null and b/bingo-card-databases/6by6.zip differ diff --git a/utils.py b/utils.py index d3a377f..e4ef2ef 100644 --- a/utils.py +++ b/utils.py @@ -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 @@ -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 @@ -164,7 +164,6 @@ def check_4_corners(size, squares: [[bool]]) -> bool: """ 4 corners """ - return ( squares[0][0] and squares[0][size - 1] @@ -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: