Skip to content

Commit

Permalink
Revert "Resolved size setting problem"
Browse files Browse the repository at this point in the history
This reverts commit d046cc8.

it aint work
  • Loading branch information
viktorashi committed Sep 19, 2023
1 parent d046cc8 commit 1cf62d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 3 additions & 1 deletion TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ 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)

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
some other shit idk

more idk
10 changes: 4 additions & 6 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

def get_text_squares(self, squares) -> [[str]]:
#initialize 2d array of empty strings
phrases = {}
for square in squares:
phrases[square["row"]]= {}
phrases: [[str]] = [["" for _ in range(self.size)] for _ in range(self.size)]
for square in squares:
phrases[square["row"]][square["col"]] = square["label"]
return phrases
Expand Down Expand Up @@ -166,6 +164,7 @@ def check_4_corners(size, squares: [[bool]]) -> bool:
"""
4 corners
"""

return (
squares[0][0]
and squares[0][size - 1]
Expand Down Expand Up @@ -400,9 +399,8 @@ def read_from_config() -> dict:


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

0 comments on commit 1cf62d7

Please sign in to comment.