Spaces:
Build error
Build error
Fix complex case test and update state updater
Browse filesFiles changed (2)
170 unmodified lines171172173174175176177170 unmodified lines# Char at all positions = nostate[offset:offset + 3 * WORDLE_N] = [1, 0, 0] * WORDLE_Nelse: # goal_word.count(c) <= processed_letters.count(c) and goal in word# Only information at this point is that char at position i = nostate[offset + 3 * i:offset + 3 * i + 3] = [1, 0, 0]processed_letters.append(c)return state, reward170 unmodified lines171172173174175176177178179180181170 unmodified lines# Char at all positions = nostate[offset:offset + 3 * WORDLE_N] = [1, 0, 0] * WORDLE_Nelse: # goal_word.count(c) <= processed_letters.count(c) and goal in word# At i and in every position which is not set = nostate[offset + 3 * i:offset + 3 * i + 3] = [1, 0, 0]for char_idx in range(0, WORDLE_N * 3, 3):char_offset = offset + char_idxif tuple(state[char_offset: char_offset + 3]) == (0, 0, 0):state[char_offset: char_offset + 3] = [1, 0, 0]processed_letters.append(c)return state, reward
160 unmodified lines161162163164165166167120 unmodified lines288289290291292293160 unmodified lines1, 0, 0,0, 0, 1,0, 1, 0)print(new_state, letter_state)letter_test('A', new_state, letter_state)# Expect P to be right in position 1 2 no in 3 and maybe in 4120 unmodified linesletter_state = (1, 0, 0,0, 0, 1,1, 0, 0,0, 0, 0,0, 0, 0)letter_test('P', new_state, letter_state)160 unmodified lines161162163164165166120 unmodified lines287288289290291292160 unmodified lines1, 0, 0,0, 0, 1,0, 1, 0)letter_test('A', new_state, letter_state)# Expect P to be right in position 1 2 no in 3 and maybe in 4120 unmodified linesletter_state = (1, 0, 0,0, 0, 1,1, 0, 0,1, 0, 0,1, 0, 0)letter_test('P', new_state, letter_state)
wordle_env/state.py+5-1
wordle_env/test_wordle.py+2-3