Jun-07-2020, 08:00 AM
If I have a function with some values that I defined in the function, how would i go about getting those values out to be check against.
I know I can return values, just not sure with this setup.
Any guidance much appreciated.
I figured it out. I made a list with the values and returned them. I must be getting tired.
I know I can return values, just not sure with this setup.
Any guidance much appreciated.
Some other stuff above check = ['x','x','x'] for value in self.possible(): if check in value: do stuff def possible(self): # Rows self.row1 = [self.grid[0], self.grid[1], self.grid[2]] self.row2 = [self.grid[3], self.grid[4], self.grid[5]] self.row3 = [self.grid[6], self.grid[7], self.grid[8]] # Columns self.col1 = [self.grid[0], self.grid[3], self.grid[6]] self.col2 = [self.grid[1], self.grid[4], self.grid[7]] self.col3 = [self.grid[2], self.grid[5], self.grid[8]] # Diagonals self.diag1 = [self.grid[0], self.grid[4], self.grid[8]] self.diag2 = [self.grid[2], self.grid[4], self.grid[6]]
I figured it out. I made a list with the values and returned them. I must be getting tired.