- # else:
- # self.ordered_letters = list(self.candidate_words[0])
-
-
-# In[72]:
-
-g = Game(random.choice(WORDS), player=PlayerAdaptiveSplit(WORDS))
-g.play_game()
-
-
-# In[73]:
-
-g.target
-
-
-# In[74]:
-
-g.discovered
-
-
-# In[75]:
-
-g.wrong_letters
-
-
-# In[78]:
-
-get_ipython().run_cell_magic('timeit', '', '\nwins = 0\nfor _ in range(1000):\n g = Game(random.choice(WORDS), player=PlayerAdaptiveSplit(WORDS))\n g.play_game()\n if g.game_won:\n wins += 1\nprint(wins)')
-
-
-# In[54]:
-
-p=PlayerAdaptiveSplit(WORDS)
-
-
-# In[55]:
-
-dsc = ['_'] * len('recognition')
-dsc
-
-
-# In[56]:
-
-p.guess(dsc, [], 10)
-
-
-# In[57]:
-
-len(p.candidate_words)
-
-
-# In[58]:
-
-p.guess(['_', '_', '_', 'o', '_', '_', '_', '_', '_', 'o', '_'], [], 10)
-
-
-# In[59]:
-
-p.candidate_words
-
-
-# In[60]:
-
-p.guess(['_', '_', 'c', 'o', '_', '_', '_', '_', '_', 'o', '_'], [], 10)
-
-
-# In[61]:
-
-p.candidate_words
-
-
-# In[62]:
-
-p.guess(['_', '_', 'c', 'o', '_', '_', '_', '_', '_', 'o', '_'], ['a'], 9)
-
-
-# In[63]:
-
-p.candidate_words
-
-
-# In[64]:
-
-p.guess(['_', '_', 'c', 'o', '_', '_', '_', '_', '_', 'o', '_'], ['a', 'd'], 8)
-
-
-# In[65]:
-
-p.candidate_words
-
-
-# In[67]:
-
-g = Game('recognition', player=PlayerAdaptiveSplit(WORDS))
-g.play_game()
-
-
-# In[68]:
-
-g.discovered
-
-
-# In[69]:
-
-g.lives
-
-
-# In[79]:
-
-get_ipython().run_cell_magic('timeit', '', '\nwins = 0\nfor _ in range(10000):\n g = Game(random.choice(WORDS), player=PlayerAdaptiveSplit(WORDS))\n g.play_game()\n if g.game_won:\n wins += 1\nprint(wins)')
-
-
-# In[81]:
-
-get_ipython().run_cell_magic('timeit', '', '\nwins = 0\nfor _ in range(10000):\n g = Game(random.choice(WORDS), player=PlayerAdaptivePatternNoRegex(WORDS))\n g.play_game()\n if g.game_won:\n wins += 1\nprint(wins)')
-
-
-# In[90]:
-
-for w in random.sample(WORDS, 5000):
- gp = Game(w, player=PlayerAdaptivePatternNoRegex(WORDS))
- gp.play_game()
- gs = Game(w, player=PlayerAdaptiveSplit(WORDS))
- gs.play_game()
- if not gp.game_won and not gs.game_won:
- print('Both:::::', gp.target, 'Pattern:', '[' + ' '.join(gp.discovered) + ']', ''.join(gp.wrong_letters),
- ':: Split:', '[' + ' '.join(gs.discovered) + ']', ''.join(gs.wrong_letters))
- if not gp.game_won and gs.game_won:
- print('Pattern::', gp.target, '[' + ' '.join(gp.discovered) + ']', ''.join(gp.wrong_letters))
- if gp.game_won and not gs.game_won:
- print('Split::::', gs.target, '[' + ' '.join(gs.discovered) + ']', ''.join(gs.wrong_letters))
-
-
-# In[91]:
-
-gs = Game('businesses', player=PlayerAdaptiveSplit(WORDS))
-
-
-# In[170]:
-
-g = Game('feminism', player=PlayerAdaptiveSplit(WORDS))
-while not g.game_finished:
- guess = g.player.guess(g.discovered, g.wrong_letters, g.lives)
- print(g.target, '(' + str(g.lives) + ')',
- '[' + ' '.join(g.discovered) + ']', ''.join(g.wrong_letters),
- ';', len(g.player.candidate_words), 'candidate words')
- print('Guess = ', guess)
- g.do_turn()
-
-
-# In[172]:
-
-g = Game('feminism', player=PlayerAdaptivePatternNoRegex(WORDS))
-while not g.game_finished:
- guess = g.player.guess(g.discovered, g.wrong_letters, g.lives)
- print(g.target, '(' + str(g.lives) + ')',
- '[' + ' '.join(g.discovered) + ']', ''.join(g.wrong_letters),
- ';', len(g.player.candidate_words), 'candidate words')
- print('Guess = ', guess)
- g.do_turn()
-
-
-# In[171]:
-
-g.player.candidate_words
-
-
-# In[ ]:
-
-