Yoann commited on
Commit
623ba43
1 Parent(s): 4765388

Updating difficuly

Browse files
Files changed (1) hide show
  1. sentence.py +3 -1
sentence.py CHANGED
@@ -92,6 +92,7 @@ def updateState(var_dict, preds):
92
  ### Check if the current part has been guessed
93
  part = var_dict["parts"][var_dict["step"]]
94
 
 
95
  idx_of_nothing = -1
96
  if ("nothing" in preds[0]): idx_of_nothing = 0
97
  elif ("nothing" in preds[1]): idx_of_nothing = 1
@@ -101,8 +102,9 @@ def updateState(var_dict, preds):
101
  if (part["classes"][-1] == preds[0]): idx_of_guess = 0
102
  elif (part["classes"][-1] == preds[1]): idx_of_guess = 1
103
  elif (part["classes"][-1] == preds[2]): idx_of_guess = 2
 
104
 
105
- if not var_dict["win"] and idx_of_guess > idx_of_nothing:
106
  var_dict["step"] += 1
107
  var_dict["found_words"].append(part["word"])
108
  var_dict["win"] = var_dict["step"] == len(var_dict["parts"])
 
92
  ### Check if the current part has been guessed
93
  part = var_dict["parts"][var_dict["step"]]
94
 
95
+ '''
96
  idx_of_nothing = -1
97
  if ("nothing" in preds[0]): idx_of_nothing = 0
98
  elif ("nothing" in preds[1]): idx_of_nothing = 1
 
102
  if (part["classes"][-1] == preds[0]): idx_of_guess = 0
103
  elif (part["classes"][-1] == preds[1]): idx_of_guess = 1
104
  elif (part["classes"][-1] == preds[2]): idx_of_guess = 2
105
+ '''
106
 
107
+ if not var_dict["win"] and part["classes"][-1] in preds:
108
  var_dict["step"] += 1
109
  var_dict["found_words"].append(part["word"])
110
  var_dict["win"] = var_dict["step"] == len(var_dict["parts"])