From: Neil Smith Date: Mon, 27 Mar 2017 16:49:30 +0000 (+0100) Subject: Updated notebook versions X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=9aab9a18ab1a0abfd9fd8b7a33bc0c833dea0560;p=cas-master-teacher-training.git Updated notebook versions --- diff --git a/hangman/01-hangman-setter.ipynb b/hangman/01-hangman-setter.ipynb index e3a7c15..c2c7905 100644 --- a/hangman/01-hangman-setter.ipynb +++ b/hangman/01-hangman-setter.ipynb @@ -1,742 +1,596 @@ { - "metadata": { - "name": "", - "signature": "sha256:374900202f4f7c3f157762c0d012b597cc502efce4de220013e3cc9cd8dfc896" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Hangman 1: set a puzzle\n", - "\n", - "A fairly traditional hangman game. The computer chooses a word, the (human) player has to guess it without making too many wrong guesses. You'll need to find a list of words to chose from and develop a simple UI for the game (e.g. text only: display the target word with underscores and letters, lives left, and maybe incorrect guesses). \n", - "\n", - "## Data structures\n", - "\n", - "* What do we need to track?\n", - "* What operations do we need to perform on it?\n", - "* How to store it?\n", - "\n", - "## Creating a game\n", - "* 'List' of words to choose from\n", - " * Pick one at random\n", - "\n", - "## Game state\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
Data         Operations
\n", - "\n", - "* Target word\n", - "* Discovered letters\n", - " * In order in the word\n", - "* Lives left\n", - "* Wrong letters?\n", - "\n", - "\n", - "\n", - "* Get a guess\n", - "* Update discovered letters\n", - "* Update lives\n", - "* Show discovered word\n", - "* Detect game end, report\n", - "* Detect game win or loss, report\n", - "\n", - "
" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import re\n", - "import random" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Get the words\n", - "Read the words the game setter can choose from. The list contains all sorts of hangman-illegal words, such as proper nouns and abbreviations. We'll remove them by taking the pragmatic approach that if a word contains a non-lowercase letter (capital letters, full stops, apostrophes, etc.), it's illegal. " - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# Just use a regex to filter the words. There are other ways to do this, as you know.\n", - "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", - " if re.match(r'^[a-z]*$', w.strip())]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "A few quick looks at the list of words, to make sure it's sensible." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "len(WORDS)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 5, - "text": [ - "62856" - ] - } - ], - "prompt_number": 5 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "WORDS[30000:30010]" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 6, - "text": [ - "['jotted',\n", - " 'jotting',\n", - " 'jottings',\n", - " 'joule',\n", - " 'joules',\n", - " 'jounce',\n", - " 'jounced',\n", - " 'jounces',\n", - " 'jouncing',\n", - " 'journal']" - ] - } - ], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Constants and game states" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## The target word" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "target = random.choice(WORDS)\n", - "target" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 7, - "text": [ - "'rocketing'" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "STARTING_LIVES = 10\n", - "lives = 0" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 8 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wrong_letters = []" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We'll represent the partially-discovered word as a list of characters. Each character is either the letter in the target (if it's been discovered) or an underscore if it's not.\n", - "\n", - "Use a `list` as it's a mutable data structure. That means we can change individual elements of a list, which we couldn't if we represented it as a `string`.\n", - "\n", - "We can also use `discovered` to check of a game win. If `discovered` contains an underscore, the player hasn't won the game." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "discovered = list('_' * len(target))\n", - "discovered" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 10, - "text": [ - "['_', '_', '_', '_', '_', '_', '_', '_', '_']" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can use `' '.join(discovered)` to display it nicely." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "' '.join(discovered)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 11, - "text": [ - "'_ _ _ _ _ _ _ _ _'" - ] - } - ], - "prompt_number": 11 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Read a letter\n", - "Get rid of fluff and make sure we only get one letter." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "letter = input('Enter letter: ').strip().lower()[0]\n", - "letter" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: r\n" - ] - }, - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 9, - "text": [ - "'r'" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Finding a letter in a word\n", - "One operation we want to to is to update `discovered` when we get a `letter`. The trick is that we want to update every occurrence of the `letter` in `discovered`. \n", - "\n", - "We'll do it in two phases. In the first phase, we'll find all the occurences of the `letter` in the `target` and return a list of those locations. In the second phase, we'll update all those positions in `discovered` with the `letter`. \n", - "\n", - "There's probaby a clever way of doing this in one pass, but it's complicated (or at least not obvious), so let's just do it the easy way." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# Note that find returns either the first occurrence of a substring, or -1 if it doesn't exist.\n", - "def find_all_explicit(string, letter):\n", - " locations = []\n", - " starting=0\n", - " location = string.find(letter)\n", - " while location > -1:\n", - " locations += [location]\n", - " starting = location + 1\n", - " location = string.find(letter, starting)\n", - " return locations" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 25 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# A simpler way using a list comprehension and the built-in enumerate()\n", - "def find_all(string, letter):\n", - " return [p for p, l in enumerate(string) if l == letter]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 12 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "find_all('happy', 'p')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 13, - "text": [ - "[2, 3]" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Updating the discovered word\n", - "Now we can update `discovered`. We'll look through the `locations` list and update that element of `discovered`." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "guessed_letter = 'e'\n", - "locations = find_all(target, guessed_letter)\n", - "for location in locations:\n", - " discovered[location] = guessed_letter\n", - "discovered" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 15, - "text": [ - "['_', '_', '_', '_', 'e', '_', '_', '_', '_']" - ] - } - ], - "prompt_number": 15 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Putting it all together\n", - "We've not got quite a few bits and pieces of how the game should work. Now it's time to start putting them together into the game.\n", - "\n", - "```\n", - "to play a game:\n", - " initialise lives, target, etc.\n", - " finished? = False\n", - " handle a turn\n", - " while not finished?:\n", - " if guessed all letters:\n", - " report success\n", - " finished? = True\n", - " elif run out of lives:\n", - " report failure\n", - " finished? = True\n", - " else:\n", - " handle a turn\n", - "```\n", - "\n", - "```\n", - "to handle a turn:\n", - " print the challenge\n", - " get the letter\n", - " if letter in target:\n", - " update discovered\n", - " else:\n", - " update lives, wrong_letters\n", - "```\n", - "\n", - "```\n", - "to update discovered:\n", - " find all the locations of letter in target\n", - " replace the appropriate underscores in discovered\n", - "```\n", - "\n", - "We pretty much know how to do all these bits, so let's just start at the bottom and off we go!\n", - "\n", - "###Syntax note\n", - "Note the use of Python's `global` statement, to tell Python that we're updating the global variables in each procedure. We'll fix that later." + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Hangman 1: set a puzzle\n", + "\n", + "A fairly traditional hangman game. The computer chooses a word, the (human) player has to guess it without making too many wrong guesses. You'll need to find a list of words to chose from and develop a simple UI for the game (e.g. text only: display the target word with underscores and letters, lives left, and maybe incorrect guesses). \n", + "\n", + "## Data structures\n", + "\n", + "* What do we need to track?\n", + "* What operations do we need to perform on it?\n", + "* How to store it?\n", + "\n", + "## Creating a game\n", + "* 'List' of words to choose from\n", + " * Pick one at random\n", + "\n", + "## Game state\n", + "\n", + "### Data\n", + "* Target word\n", + "* Discovered letters\n", + " * In order in the word\n", + "* Lives left\n", + "* Wrong letters?\n", + "\n", + "### Operations\n", + "* Get a guess\n", + "* Update discovered letters\n", + "* Update lives\n", + "* Show discovered word\n", + "* Detect game end, report\n", + "* Detect game win or loss, report\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import re\n", + "import random" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Get the words\n", + "Read the words the game setter can choose from. The list contains all sorts of hangman-illegal words, such as proper nouns and abbreviations. We'll remove them by taking the pragmatic approach that if a word contains a non-lowercase letter (capital letters, full stops, apostrophes, etc.), it's illegal. " + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Just use a regex to filter the words. There are other ways to do this, as you know.\n", + "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", + " if re.match(r'^[a-z]*$', w.strip())]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "A few quick looks at the list of words, to make sure it's sensible." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "62856" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "len(WORDS)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['jotted',\n", + " 'jotting',\n", + " 'jottings',\n", + " 'joule',\n", + " 'joules',\n", + " 'jounce',\n", + " 'jounced',\n", + " 'jounces',\n", + " 'jouncing',\n", + " 'journal']" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "WORDS[30000:30010]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Constants and game states" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## The target word" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'rocketing'" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "target = random.choice(WORDS)\n", + "target" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "STARTING_LIVES = 10\n", + "lives = 0" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "wrong_letters = []" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We'll represent the partially-discovered word as a list of characters. Each character is either the letter in the target (if it's been discovered) or an underscore if it's not.\n", + "\n", + "Use a `list` as it's a mutable data structure. That means we can change individual elements of a list, which we couldn't if we represented it as a `string`.\n", + "\n", + "We can also use `discovered` to check for a game win. If `discovered` contains an underscore, the player hasn't won the game." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['_', '_', '_', '_', '_', '_', '_', '_', '_']" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "discovered = list('_' * len(target))\n", + "discovered" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can use `' '.join(discovered)` to display it nicely." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "'_ _ _ _ _ _ _ _ _'" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "' '.join(discovered)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Read a letter\n", + "Get rid of fluff and make sure we only get one letter." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter letter: r\n" ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "def updated_discovered_word(discovered, guessed_letter):\n", - " locations = find_all(target, guessed_letter)\n", - " for location in locations:\n", - " discovered[location] = guessed_letter\n", - " return discovered" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 16 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def initialise():\n", - " global lives, target, discovered, wrong_letters\n", - " lives = STARTING_LIVES\n", - " target = random.choice(WORDS)\n", - " discovered = list('_' * len(target))\n", - " wrong_letters = []" - ], - "language": "python", + "data": { + "text/plain": [ + "'r'" + ] + }, + "execution_count": 9, "metadata": {}, - "outputs": [], - "prompt_number": 17 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def do_turn():\n", - " global discovered, lives, wrong_letters\n", - " print('Word:', ' '.join(discovered), ' : Lives =', lives, ', wrong guesses:', ' '.join(sorted(wrong_letters)))\n", - " guess = input('Enter letter: ').strip().lower()[0]\n", - " if guess in target:\n", - " updated_discovered_word(discovered, guess)\n", - " else:\n", - " lives -= 1\n", - " if guess not in wrong_letters:\n", - " wrong_letters += [guess]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 18 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def play_game():\n", - " global discovered, lives\n", - " initialise()\n", - " game_finished = False\n", - " do_turn()\n", - " while not game_finished:\n", - " if '_' not in discovered:\n", - " print('You won! The word was', target)\n", - " game_finished = True\n", - " elif lives <= 0:\n", - " print('You lost. The word was', target)\n", - " game_finished = True\n", - " else:\n", - " do_turn()" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 19 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Playing the game\n", - "That seemed straightforward. Let's see if it works!" + "output_type": "execute_result" + } + ], + "source": [ + "letter = input('Enter letter: ').strip().lower()[0]\n", + "letter" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Finding a letter in a word\n", + "One operation we want to to is to update `discovered` when we get a `letter`. The trick is that we want to update every occurrence of the `letter` in `discovered`. \n", + "\n", + "We'll do it in two phases. In the first phase, we'll find all the occurences of the `letter` in the `target` and return a list of those locations. In the second phase, we'll update all those positions in `discovered` with the `letter`. \n", + "\n", + "There's probaby a clever way of doing this in one pass, but it's complicated (or at least not obvious), so let's just do it the easy way." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Note that find returns either the first occurrence of a substring, or -1 if it doesn't exist.\n", + "def find_all_explicit(string, letter):\n", + " locations = []\n", + " starting=0\n", + " location = string.find(letter)\n", + " while location > -1:\n", + " locations += [location]\n", + " starting = location + 1\n", + " location = string.find(letter, starting)\n", + " return locations" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# A simpler way using a list comprehension and the built-in enumerate()\n", + "def find_all(string, letter):\n", + " return [p for p, l in enumerate(string) if l == letter]" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "[2, 3]" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "find_all('happy', 'p')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Updating the discovered word\n", + "Now we can update `discovered`. We'll look through the `locations` list and update that element of `discovered`." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['_', '_', '_', '_', 'e', '_', '_', '_', '_']" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "guessed_letter = 'e'\n", + "locations = find_all(target, guessed_letter)\n", + "for location in locations:\n", + " discovered[location] = guessed_letter\n", + "discovered" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Putting it all together\n", + "We've not got quite a few bits and pieces of how the game should work. Now it's time to start putting them together into the game.\n", + "\n", + "```\n", + "to play a game:\n", + " initialise lives, target, etc.\n", + " finished? = False\n", + " handle a turn\n", + " while not finished?:\n", + " if guessed all letters:\n", + " report success\n", + " finished? = True\n", + " elif run out of lives:\n", + " report failure\n", + " finished? = True\n", + " else:\n", + " handle a turn\n", + "```\n", + "\n", + "```\n", + "to handle a turn:\n", + " print the challenge\n", + " get the letter\n", + " if letter in target:\n", + " update discovered\n", + " else:\n", + " update lives, wrong_letters\n", + "```\n", + "\n", + "```\n", + "to update discovered:\n", + " find all the locations of letter in target\n", + " replace the appropriate underscores in discovered\n", + "```\n", + "\n", + "We pretty much know how to do all these bits, so let's just start at the bottom and off we go!\n", + "\n", + "###Syntax note\n", + "Note the use of Python's `global` statement, to tell Python that we're updating the global variables in each procedure. We'll fix that later." + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def updated_discovered_word(discovered, guessed_letter):\n", + " locations = find_all(target, guessed_letter)\n", + " for location in locations:\n", + " discovered[location] = guessed_letter\n", + " return discovered" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def initialise():\n", + " global lives, target, discovered, wrong_letters\n", + " lives = STARTING_LIVES\n", + " target = random.choice(WORDS)\n", + " discovered = list('_' * len(target))\n", + " wrong_letters = []" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def do_turn():\n", + " global discovered, lives, wrong_letters\n", + " print('Word:', ' '.join(discovered), ' : Lives =', lives, ', wrong guesses:', ' '.join(sorted(wrong_letters)))\n", + " guess = input('Enter letter: ').strip().lower()[0]\n", + " if guess in target:\n", + " updated_discovered_word(discovered, guess)\n", + " else:\n", + " lives -= 1\n", + " if guess not in wrong_letters:\n", + " wrong_letters += [guess]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def play_game():\n", + " global discovered, lives\n", + " initialise()\n", + " game_finished = False\n", + " do_turn()\n", + " while not game_finished:\n", + " if '_' not in discovered:\n", + " print('You won! The word was', target)\n", + " game_finished = True\n", + " elif lives <= 0:\n", + " print('You lost. The word was', target)\n", + " game_finished = True\n", + " else:\n", + " do_turn()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Playing the game\n", + "That seemed straightforward. Let's see if it works!" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Word: _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n", + "Enter letter: e\n", + "Word: _ _ _ _ _ _ e : Lives = 10 , wrong guesses: \n", + "Enter letter: a\n", + "Word: _ _ _ _ _ _ e : Lives = 9 , wrong guesses: a\n", + "Enter letter: i\n", + "Word: _ _ _ _ i _ e : Lives = 9 , wrong guesses: a\n", + "Enter letter: o\n", + "Word: _ o _ _ i _ e : Lives = 9 , wrong guesses: a\n", + "Enter letter: n\n", + "Word: _ o n _ i _ e : Lives = 9 , wrong guesses: a\n", + "Enter letter: v\n", + "Word: _ o n _ i _ e : Lives = 8 , wrong guesses: a v\n", + "Enter letter: t\n", + "Word: _ o n _ i _ e : Lives = 7 , wrong guesses: a t v\n", + "Enter letter: s\n", + "Word: _ o n _ i _ e : Lives = 6 , wrong guesses: a s t v\n", + "Enter letter: h\n", + "Word: _ o n _ i _ e : Lives = 5 , wrong guesses: a h s t v\n", + "Enter letter: f\n", + "Word: _ o n f i _ e : Lives = 5 , wrong guesses: a h s t v\n", + "Enter letter: b\n", + "Word: b o n f i _ e : Lives = 5 , wrong guesses: a h s t v\n", + "Enter letter: r\n", + "You won! The word was bonfire\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "play_game()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: e\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ e : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: a\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ e : Lives = 9 , wrong guesses: a\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: i\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ i _ e : Lives = 9 , wrong guesses: a\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: o\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o _ _ i _ e : Lives = 9 , wrong guesses: a\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: n\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n _ i _ e : Lives = 9 , wrong guesses: a\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: v\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n _ i _ e : Lives = 8 , wrong guesses: a v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: t\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n _ i _ e : Lives = 7 , wrong guesses: a t v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: s\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n _ i _ e : Lives = 6 , wrong guesses: a s t v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: h\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n _ i _ e : Lives = 5 , wrong guesses: a h s t v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: f\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ o n f i _ e : Lives = 5 , wrong guesses: a h s t v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: b\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: b o n f i _ e : Lives = 5 , wrong guesses: a h s t v\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: r\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "You won! The word was bonfire\n" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 17 } ], - "metadata": {} + "source": [ + "play_game()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" } - ] -} \ No newline at end of file + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/hangman/02-hangman-guesser.ipynb b/hangman/02-hangman-guesser.ipynb index 66f3b49..ce0cf89 100644 --- a/hangman/02-hangman-guesser.ipynb +++ b/hangman/02-hangman-guesser.ipynb @@ -1,329 +1,342 @@ { - "metadata": { - "name": "", - "signature": "sha256:eb35fa497310659186b8d082192529c5f3ce0083adaa1704282cce83da804db6" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Hangman 2: the guesser\n", - "Note that we're not trying to do anything clever here. We're just trying to make something that makes a series of legal moves in the game and that sometimes might win. We want to get something that fits the player-sized hole when we put the setter and guesser together. The clever players come later. \n", - "\n", - "We also need to think about how to have the guesser interact with a human setter, so that it can play against a human. It won't get much use, but we should have it for completeness.\n", - "\n", - "But before we can build something that fits the hole, we need to understand what shape the hole is. What is the interface between the guesser and the setter?\n", - "\n", - "Spoiler space\n", - "\n", - ".\n", - "\n", - ".\n", - "\n", - ".\n", - "\n", - ".\n", - "\n", - ".\n", - "\n", - ".\n", - "\n", - "." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The guesser only really needs to do one thing: make a guess. We'll say that the setter passes in the complete state of the game (disovered template, lives remaining, and wrong letters guessed) and the guesser simply returns the guess.\n", - "\n", - "Someone needs to keep track of the incorrect guesses so that the guesser doesn't keep making the same wrong guess. As the setter is already keeping track of the rest of the state, it's probably easier if the setter also keeps track of the wrong letters. That might allow us to keep the guesser state-free, which will keep it simpler. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Getting a game state\n", - "If we need the guesser to interact with a human, let's get it to read the game state from a human.\n", - "\n", - "Remember that we want to return two lists of characters, not two strings.\n", - "\n", - "We'll also not do any input validation. Life's too short (for this example)." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def read_game():\n", - " discovered = input('Enter the discovered word: ')\n", - " missed = input('Enter the wrong guesses: ')\n", - " return list(discovered), list(missed)" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 18 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "read_game()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the discovered word: __pp_\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter the wrong guesses: xv\n" - ] - }, - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 19, - "text": [ - "(['_', '_', 'p', 'p', '_'], ['x', 'v'])" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "That was easy." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Basic strategy\n", - "\n", - "Our first strategy is to simply guess the letters in order, with \"order\" defined as how often the letters appear in English running text. That means we need to read some English text and count the letters." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import string\n", - "import collections" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 20 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The `collections` standard library contains all sorts of fun stuff. The `Counter` object is very useful. Take a look at the documentation for what it does. We'll be using two features here: generate a `dict`-like thing of counts, and return the things in frequency order.\n", - "\n", - "First, let's read all the letters in *The Complete Works of Sherlock Holmes*." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "letter_counts = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", - "letter_counts" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 21, - "text": [ - "Counter({'e': 53111, 't': 38981, 'a': 35137, 'o': 33512, 'i': 30140, 'h': 29047, 'n': 28682, 's': 27194, 'r': 24508, 'd': 18563, 'l': 17145, 'u': 13116, 'm': 11787, 'w': 11266, 'c': 10499, 'y': 9431, 'f': 8975, 'g': 7887, 'p': 6835, 'b': 6362, 'v': 4452, 'k': 3543, 'x': 549, 'j': 452, 'q': 426, 'z': 149})" - ] - } - ], - "prompt_number": 21 - }, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Hangman 2: the guesser\n", + "Note that we're not trying to do anything clever here. We're just trying to make something that makes a series of legal moves in the game and that sometimes might win. We want to get something that fits the player-sized hole when we put the setter and guesser together. The clever players come later. \n", + "\n", + "We also need to think about how to have the guesser interact with a human setter, so that it can play against a human. It won't get much use, but we should have it for completeness.\n", + "\n", + "But before we can build something that fits the hole, we need to understand what shape the hole is. What is the interface between the guesser and the setter?\n", + "\n", + "Spoiler space\n", + "\n", + ".\n", + "\n", + ".\n", + "\n", + ".\n", + "\n", + ".\n", + "\n", + ".\n", + "\n", + ".\n", + "\n", + "." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The guesser only really needs to do one thing: make a guess. We'll say that the setter passes in the complete state of the game (disovered template, lives remaining, and wrong letters guessed) and the guesser simply returns the guess.\n", + "\n", + "Someone needs to keep track of the incorrect guesses so that the guesser doesn't keep making the same wrong guess. As the setter is already keeping track of the rest of the state, it's probably easier if the setter also keeps track of the wrong letters. That might allow us to keep the guesser state-free, which will keep it simpler. " + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Getting a game state\n", + "If we need the guesser to interact with a human, let's get it to read the game state from a human.\n", + "\n", + "Remember that we want to return two lists of characters, not two strings.\n", + "\n", + "We'll also not do any input validation. Life's too short (for this example)." + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def read_game():\n", + " discovered = input('Enter the discovered word: ')\n", + " missed = input('Enter the wrong guesses: ')\n", + " return list(discovered), list(missed)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Now, let's get them listed in order." + "name": "stdout", + "output_type": "stream", + "text": [ + "Enter the discovered word: __pp_\n", + "Enter the wrong guesses: xv\n" ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "letter_counts.most_common()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 22, - "text": [ - "[('e', 53111),\n", - " ('t', 38981),\n", - " ('a', 35137),\n", - " ('o', 33512),\n", - " ('i', 30140),\n", - " ('h', 29047),\n", - " ('n', 28682),\n", - " ('s', 27194),\n", - " ('r', 24508),\n", - " ('d', 18563),\n", - " ('l', 17145),\n", - " ('u', 13116),\n", - " ('m', 11787),\n", - " ('w', 11266),\n", - " ('c', 10499),\n", - " ('y', 9431),\n", - " ('f', 8975),\n", - " ('g', 7887),\n", - " ('p', 6835),\n", - " ('b', 6362),\n", - " ('v', 4452),\n", - " ('k', 3543),\n", - " ('x', 549),\n", - " ('j', 452),\n", - " ('q', 426),\n", - " ('z', 149)]" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "letters_in_order = [p[0] for p in letter_counts.most_common()]\n", - "letters_in_order" - ], - "language": "python", + "data": { + "text/plain": [ + "(['_', '_', 'p', 'p', '_'], ['x', 'v'])" + ] + }, + "execution_count": 19, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 23, - "text": [ - "['e',\n", - " 't',\n", - " 'a',\n", - " 'o',\n", - " 'i',\n", - " 'h',\n", - " 'n',\n", - " 's',\n", - " 'r',\n", - " 'd',\n", - " 'l',\n", - " 'u',\n", - " 'm',\n", - " 'w',\n", - " 'c',\n", - " 'y',\n", - " 'f',\n", - " 'g',\n", - " 'p',\n", - " 'b',\n", - " 'v',\n", - " 'k',\n", - " 'x',\n", - " 'j',\n", - " 'q',\n", - " 'z']" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Make a guess\n", - "How to make a guess? We want to guess the most common letter that hasn't already been guessed. \n", - "\n", - "That means we want to filter the available letters by removing the ones already guessed, and then take the first letter of the ones that are left. " - ] - }, + "output_type": "execute_result" + } + ], + "source": [ + "read_game()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That was easy." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Basic strategy\n", + "\n", + "Our first strategy is to simply guess the letters in order, with \"order\" defined as how often the letters appear in English running text. That means we need to read some English text and count the letters." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import string\n", + "import collections" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The `collections` standard library contains all sorts of fun stuff. The `Counter` object is very useful. Take a look at the documentation for what it does. We'll be using two features here: generate a `dict`-like thing of counts, and return the things in frequency order.\n", + "\n", + "First, let's read all the letters in *The Complete Works of Sherlock Holmes*." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "def make_guess(discovered, missed):\n", - " return [l for l in letters_in_order if l not in (discovered + missed)][0]" - ], - "language": "python", + "data": { + "text/plain": [ + "Counter({'e': 53111, 't': 38981, 'a': 35137, 'o': 33512, 'i': 30140, 'h': 29047, 'n': 28682, 's': 27194, 'r': 24508, 'd': 18563, 'l': 17145, 'u': 13116, 'm': 11787, 'w': 11266, 'c': 10499, 'y': 9431, 'f': 8975, 'g': 7887, 'p': 6835, 'b': 6362, 'v': 4452, 'k': 3543, 'x': 549, 'j': 452, 'q': 426, 'z': 149})" + ] + }, + "execution_count": 21, "metadata": {}, - "outputs": [], - "prompt_number": 27 - }, + "output_type": "execute_result" + } + ], + "source": [ + "letter_counts = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", + "letter_counts" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, let's get them listed in order." + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "make_guess(list('__pp_'), list('exv'))" - ], - "language": "python", + "data": { + "text/plain": [ + "[('e', 53111),\n", + " ('t', 38981),\n", + " ('a', 35137),\n", + " ('o', 33512),\n", + " ('i', 30140),\n", + " ('h', 29047),\n", + " ('n', 28682),\n", + " ('s', 27194),\n", + " ('r', 24508),\n", + " ('d', 18563),\n", + " ('l', 17145),\n", + " ('u', 13116),\n", + " ('m', 11787),\n", + " ('w', 11266),\n", + " ('c', 10499),\n", + " ('y', 9431),\n", + " ('f', 8975),\n", + " ('g', 7887),\n", + " ('p', 6835),\n", + " ('b', 6362),\n", + " ('v', 4452),\n", + " ('k', 3543),\n", + " ('x', 549),\n", + " ('j', 452),\n", + " ('q', 426),\n", + " ('z', 149)]" + ] + }, + "execution_count": 22, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 26, - "text": [ - "'t'" - ] - } - ], - "prompt_number": 26 - }, + "output_type": "execute_result" + } + ], + "source": [ + "letter_counts.most_common()" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", + "data": { + "text/plain": [ + "['e',\n", + " 't',\n", + " 'a',\n", + " 'o',\n", + " 'i',\n", + " 'h',\n", + " 'n',\n", + " 's',\n", + " 'r',\n", + " 'd',\n", + " 'l',\n", + " 'u',\n", + " 'm',\n", + " 'w',\n", + " 'c',\n", + " 'y',\n", + " 'f',\n", + " 'g',\n", + " 'p',\n", + " 'b',\n", + " 'v',\n", + " 'k',\n", + " 'x',\n", + " 'j',\n", + " 'q',\n", + " 'z']" + ] + }, + "execution_count": 23, "metadata": {}, - "source": [ - "...and that's it. We don't need to keep track of game end: the setting player can do that.\n", - "\n", - "It's easy to see how we could have different strategies, depending on the order of letters used in the `make_guess` procedure. But that's for next time." - ] - }, + "output_type": "execute_result" + } + ], + "source": [ + "letters_in_order = [p[0] for p in letter_counts.most_common()]\n", + "letters_in_order" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Make a guess\n", + "How to make a guess? We want to guess the most common letter that hasn't already been guessed. \n", + "\n", + "That means we want to filter the available letters by removing the ones already guessed, and then take the first letter of the ones that are left. " + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def make_guess(discovered, missed):\n", + " return [l for l in letters_in_order if l not in (discovered + missed)][0]" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", + "data": { + "text/plain": [ + "'t'" + ] + }, + "execution_count": 26, "metadata": {}, - "outputs": [] + "output_type": "execute_result" } ], - "metadata": {} + "source": [ + "make_guess(list('__pp_'), list('exv'))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "...and that's it. We don't need to keep track of game end: the setting player can do that.\n", + "\n", + "It's easy to see how we could have different strategies, depending on the order of letters used in the `make_guess` procedure. But that's for next time." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" } - ] -} \ No newline at end of file + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/hangman/03-hangman-both.ipynb b/hangman/03-hangman-both.ipynb index 543d832..54fbdb4 100644 --- a/hangman/03-hangman-both.ipynb +++ b/hangman/03-hangman-both.ipynb @@ -1,1343 +1,1028 @@ { - "metadata": { - "name": "", - "signature": "sha256:8dfb2bb1cf596c711c837f4c7c2d8706f9dcacc1a0ffc3dc21c1d0fedd3fc6bf" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "#Putting both halves together\n", - "We now have systems that can do both halves of the Hangman game. Now it's time to put them together so that we can get a machine to play itself. At the moment, let's concentrate on just the plumbing: let's get the two halves working together. In the next step, we'll think about different strategies and compare their effectiveness.\n", - "\n", - "The word of this section is \"encapsulation.\" \n", - "\n", - "First, a change in terminology. We'll call a `player` the thing that makes the guesses (the guesser player from before). We'll call a `game` the thing that handles receiving guesses, updating `discovered` words, updating lives and all of that. That's what was the setting player from before, but without the bit about picking a random word. We'll have the `game` accept the `target` as a parameter, so that we can test everything more easily (if we know what word the `player` is trying to guess, we can predict what it should do).\n", - "\n", - "Back to encapsulation.\n", - "\n", - "We want to bundle all the state information for a `game` into one 'thing' so that we don't need to worry about global variables. We will also want to bundle up everything to do with a `player` into one 'thing' so we can tell the game about it. For the `player`, the thing will include both any state it needs and the definition of that `player`'s guessing strategy. We're also going to have a bunch of related players, all doing much the same thing but with different strategies.\n", - "\n", - "In this case, objects seem like a natural fit.\n", - "\n", - "(Insert Neil's aikido instructor story here.)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Object-orientation in Python\n", - "There are a few things to remember about object orientation in Python.\n", - "\n", - "1. It's an ugly kludge that was bolted on long after the language was defined.\n", - "\n", - "2. `self` needs to be passed in to all object methods as the first parameter, though it doesn't appear when you call the method.\n", - "\n", - "3. Use `self.whatever` to refer to the instance variable `whatever`\n", - "\n", - "4. Use `self.however(arg1, arg2)` when one method calls another in the same object.\n", - "\n", - "Apart from that, it's pretty straightforward." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import re\n", - "import random\n", - "import string\n", - "import collections" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 43 - }, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Putting both halves together\n", + "We now have systems that can do both halves of the Hangman game. Now it's time to put them together so that we can get a machine to play itself. At the moment, let's concentrate on just the plumbing: let's get the two halves working together. In the next step, we'll think about different strategies and compare their effectiveness.\n", + "\n", + "The word of this section is \"encapsulation.\" \n", + "\n", + "First, a change in terminology. We'll call a `player` the thing that makes the guesses (the guesser player from before). We'll call a `game` the thing that handles receiving guesses, updating `discovered` words, updating lives and all of that. That's what was the setting player from before, but without the bit about picking a random word. We'll have the `game` accept the `target` as a parameter, so that we can test everything more easily (if we know what word the `player` is trying to guess, we can predict what it should do).\n", + "\n", + "Back to encapsulation.\n", + "\n", + "We want to bundle all the state information for a `game` into one 'thing' so that we don't need to worry about global variables. We will also want to bundle up everything to do with a `player` into one 'thing' so we can tell the game about it. For the `player`, the thing will include both any state it needs and the definition of that `player`'s guessing strategy. We're also going to have a bunch of related players, all doing much the same thing but with different strategies.\n", + "\n", + "In this case, objects seem like a natural fit.\n", + "\n", + "(Insert Neil's aikido instructor story here.)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Object-orientation in Python\n", + "There are a few things to remember about object orientation in Python.\n", + "\n", + "1. It's an ugly kludge that was bolted on long after the language was defined.\n", + "\n", + "2. `self` needs to be passed in to all object methods as the first parameter, though it doesn't appear when you call the method.\n", + "\n", + "3. Use `self.whatever` to refer to the instance variable `whatever`\n", + "\n", + "4. Use `self.however(arg1, arg2)` when one method calls another in the same object.\n", + "\n", + "Apart from that, it's pretty straightforward." + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import re\n", + "import random\n", + "import string\n", + "import collections" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", + " if re.match(r'^[a-z]*$', w.strip())]" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "STARTING_LIVES = 10" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This is pretty much the same code as for the `setter` part, just with plenty of `self` statements scatter around. A few things to note:\n", + "\n", + "* `initialise()` is now named `__init__()` (note the double underscores fore and aft).\n", + "* `player` and `lives` are parameters to the `game`, but with default values.\n", + "* I've added two new flags, `game_won` and `game_lost`.\n", + "* `do_turn` asks the player for a guess, if there is a player.\n", + "* The `guess()` method of the `player` is passed the `lives`, in case the guess should change depending on the progress of the game (the `player` can always ignore it).\n", + "* After a guess has been processed, `do_turn` has a few more statements to set the relevant flags to represent the state of the game.\n", + "* `report_on_game()` has been added for when the game is being played against a human." + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class Game:\n", + " def __init__(self, target, player=None, lives=STARTING_LIVES):\n", + " self.lives = lives\n", + " self.player = player\n", + " self.target = target\n", + " self.discovered = list('_' * len(target))\n", + " self.wrong_letters = []\n", + " self.game_finished = False\n", + " self.game_won = False\n", + " self.game_lost = False\n", + " \n", + " def find_all(self, letter):\n", + " return [p for p, l in enumerate(self.target) if l == letter]\n", + " \n", + " def update_discovered_word(self, guessed_letter):\n", + " locations = self.find_all(guessed_letter)\n", + " for location in locations:\n", + " self.discovered[location] = guessed_letter\n", + " return self.discovered\n", + " \n", + " def do_turn(self):\n", + " if self.player:\n", + " guess = self.player.guess(self.discovered, self.wrong_letters, self.lives)\n", + " else:\n", + " guess = self.ask_for_guess()\n", + " if guess in self.target:\n", + " self.update_discovered_word(guess)\n", + " else:\n", + " self.lives -= 1\n", + " if guess not in self.wrong_letters:\n", + " self.wrong_letters += [guess]\n", + " if self.lives == 0:\n", + " self.game_finished = True\n", + " self.game_lost = True\n", + " if '_' not in self.discovered:\n", + " self.game_finished = True\n", + " self.game_won = True\n", + " \n", + " def ask_for_guess(self):\n", + " print('Word:', ' '.join(self.discovered), \n", + " ' : Lives =', self.lives, \n", + " ', wrong guesses:', ' '.join(sorted(self.wrong_letters)))\n", + " guess = input('Enter letter: ').strip().lower()[0]\n", + " return guess\n", + " \n", + " def play_game(self):\n", + " self.do_turn()\n", + " while not self.game_finished:\n", + " self.do_turn()\n", + " if not self.player:\n", + " self.report_on_game()\n", + " return self.game_won\n", + " \n", + " def report_on_game(self):\n", + " if self.game_won:\n", + " print('You won! The word was', self.target)\n", + " else:\n", + " print('You lost. The word was', self.target)\n", + " return self.game_won" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Let's test it!" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "g = Game(random.choice(WORDS))" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", - " if re.match(r'^[a-z]*$', w.strip())]" - ], - "language": "python", + "data": { + "text/plain": [ + "'distension'" + ] + }, + "execution_count": 48, "metadata": {}, - "outputs": [], - "prompt_number": 44 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.target" + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "STARTING_LIVES = 10" - ], - "language": "python", + "data": { + "text/plain": [ + "['_', '_', '_', '_', '_', '_', '_', '_', '_', '_']" + ] + }, + "execution_count": 49, "metadata": {}, - "outputs": [], - "prompt_number": 45 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.discovered" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "This is pretty much the same code as for the `setter` part, just with plenty of `self` statements scatter around. A few things to note:\n", - "\n", - "* `initialise()` is now named `__init__()` (note the double underscores fore and aft).\n", - "* `player` and `lives` are parameters to the `game`, but with default values.\n", - "* I've added two new flags, `game_won` and `game_lost`.\n", - "* `do_turn` asks the player for a guess, if there is a player.\n", - "* The `guess()` method of the `player` is passed the `lives`, in case the guess should change depending on the progress of the game (the `player` can always ignore it).\n", - "* After a guess has been processed, `do_turn` has a few more statements to set the relevant flags to represent the state of the game.\n", - "* `report_on_game()` has been added for when the game is being played against a human." + "name": "stdout", + "output_type": "stream", + "text": [ + "Word: _ _ _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n", + "Enter letter: e\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class Game:\n", - " def __init__(self, target, player=None, lives=STARTING_LIVES):\n", - " self.lives = lives\n", - " self.player = player\n", - " self.target = target\n", - " self.discovered = list('_' * len(target))\n", - " self.wrong_letters = []\n", - " self.game_finished = False\n", - " self.game_won = False\n", - " self.game_lost = False\n", - " \n", - " def find_all(self, letter):\n", - " return [p for p, l in enumerate(self.target) if l == letter]\n", - " \n", - " def update_discovered_word(self, guessed_letter):\n", - " locations = self.find_all(guessed_letter)\n", - " for location in locations:\n", - " self.discovered[location] = guessed_letter\n", - " return self.discovered\n", - " \n", - " def do_turn(self):\n", - " if self.player:\n", - " guess = self.player.guess(self.discovered, self.wrong_letters, self.lives)\n", - " else:\n", - " guess = self.ask_for_guess()\n", - " if guess in self.target:\n", - " self.update_discovered_word(guess)\n", - " else:\n", - " self.lives -= 1\n", - " if guess not in self.wrong_letters:\n", - " self.wrong_letters += [guess]\n", - " if self.lives == 0:\n", - " self.game_finished = True\n", - " self.game_lost = True\n", - " if '_' not in self.discovered:\n", - " self.game_finished = True\n", - " self.game_won = True\n", - " \n", - " def ask_for_guess(self):\n", - " print('Word:', ' '.join(self.discovered), \n", - " ' : Lives =', self.lives, \n", - " ', wrong guesses:', ' '.join(sorted(self.wrong_letters)))\n", - " guess = input('Enter letter: ').strip().lower()[0]\n", - " return guess\n", - " \n", - " def play_game(self):\n", - " self.do_turn()\n", - " while not self.game_finished:\n", - " self.do_turn()\n", - " if not self.player:\n", - " self.report_on_game()\n", - " return self.game_won\n", - " \n", - " def report_on_game(self):\n", - " if self.game_won:\n", - " print('You won! The word was', self.target)\n", - " else:\n", - " print('You lost. The word was', self.target)\n", - " return self.game_won" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 46 - }, + } + ], + "source": [ + "g.do_turn()" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 51, "metadata": {}, - "source": [ - "Let's test it!" - ] - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.lives" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS))" - ], - "language": "python", + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 52, "metadata": {}, - "outputs": [], - "prompt_number": 47 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.wrong_letters" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.target" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 48, - "text": [ - "'distension'" - ] - } - ], - "prompt_number": 48 - }, + "name": "stdout", + "output_type": "stream", + "text": [ + "Word: _ _ _ _ e _ _ _ _ _ : Lives = 10 , wrong guesses: \n", + "Enter letter: q\n" + ] + } + ], + "source": [ + "g.do_turn()" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.discovered" - ], - "language": "python", + "data": { + "text/plain": [ + "9" + ] + }, + "execution_count": 54, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 49, - "text": [ - "['_', '_', '_', '_', '_', '_', '_', '_', '_', '_']" - ] - } - ], - "prompt_number": 49 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.lives" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.do_turn()" - ], - "language": "python", + "data": { + "text/plain": [ + "['_', '_', '_', '_', 'e', '_', '_', '_', '_', '_']" + ] + }, + "execution_count": 55, "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: e\n" - ] - } - ], - "prompt_number": 50 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.discovered" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.lives" - ], - "language": "python", + "data": { + "text/plain": [ + "['q']" + ] + }, + "execution_count": 56, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 51, - "text": [ - "10" - ] - } - ], - "prompt_number": 51 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.wrong_letters" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.wrong_letters" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 52, - "text": [ - "[]" - ] - } - ], - "prompt_number": 52 + "name": "stdout", + "output_type": "stream", + "text": [ + "Word: _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n", + "Enter letter: e\n", + "Word: e _ e _ _ _ _ e : Lives = 10 , wrong guesses: \n", + "Enter letter: x\n", + "Word: e _ e _ _ _ _ e : Lives = 9 , wrong guesses: x\n", + "Enter letter: s\n", + "Word: e _ e _ _ _ _ e : Lives = 8 , wrong guesses: s x\n", + "Enter letter: l\n", + "Word: e _ e _ _ _ _ e : Lives = 7 , wrong guesses: l s x\n", + "Enter letter: t\n", + "Word: e _ e _ _ _ _ e : Lives = 6 , wrong guesses: l s t x\n", + "Enter letter: m\n", + "Word: e _ e _ _ _ _ e : Lives = 5 , wrong guesses: l m s t x\n", + "Enter letter: h\n", + "Word: e _ e _ _ _ _ e : Lives = 4 , wrong guesses: h l m s t x\n", + "Enter letter: i\n", + "Word: e _ e _ _ _ _ e : Lives = 3 , wrong guesses: h i l m s t x\n", + "Enter letter: a\n", + "Word: e _ e _ _ _ _ e : Lives = 2 , wrong guesses: a h i l m s t x\n", + "Enter letter: o\n", + "Word: e _ e _ _ o _ e : Lives = 2 , wrong guesses: a h i l m s t x\n", + "Enter letter: n\n", + "Word: e _ e _ _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n", + "Enter letter: r\n", + "Word: e _ e r _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n", + "Enter letter: v\n", + "Word: e v e r _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n", + "Enter letter: y\n", + "You won! The word was everyone\n" + ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.do_turn()" - ], - "language": "python", + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 57, "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ e _ _ _ _ _ : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: q\n" - ] - } - ], - "prompt_number": 53 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g = Game(random.choice(WORDS))\n", + "g.play_game()" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.lives" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 54, - "text": [ - "9" - ] - } - ], - "prompt_number": 54 + "name": "stdout", + "output_type": "stream", + "text": [ + "Word: _ _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n", + "Enter letter: q\n", + "Word: _ _ _ _ _ _ _ _ _ : Lives = 9 , wrong guesses: q\n", + "Enter letter: z\n", + "Word: _ _ _ _ _ _ _ _ _ : Lives = 8 , wrong guesses: q z\n", + "Enter letter: x\n", + "Word: _ _ _ _ _ _ _ _ _ : Lives = 7 , wrong guesses: q x z\n", + "Enter letter: e\n", + "Word: _ _ _ _ _ _ _ _ _ : Lives = 6 , wrong guesses: e q x z\n", + "Enter letter: a\n", + "Word: _ _ a _ _ _ _ _ _ : Lives = 6 , wrong guesses: e q x z\n", + "Enter letter: v\n", + "Word: _ _ a _ _ _ _ _ _ : Lives = 5 , wrong guesses: e q v x z\n", + "Enter letter: b\n", + "Word: _ _ a _ _ _ _ _ _ : Lives = 4 , wrong guesses: b e q v x z\n", + "Enter letter: k\n", + "Word: _ _ a _ k _ k _ _ : Lives = 4 , wrong guesses: b e q v x z\n", + "Enter letter: l\n", + "Word: _ _ a _ k _ k _ _ : Lives = 3 , wrong guesses: b e l q v x z\n", + "Enter letter: j\n", + "Word: _ _ a _ k _ k _ _ : Lives = 2 , wrong guesses: b e j l q v x z\n", + "Enter letter: p\n", + "Word: _ _ a _ k _ k _ _ : Lives = 1 , wrong guesses: b e j l p q v x z\n", + "Enter letter: d\n", + "You lost. The word was sharkskin\n" + ] }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.discovered" - ], - "language": "python", + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 58, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 55, - "text": [ - "['_', '_', '_', '_', 'e', '_', '_', '_', '_', '_']" - ] - } - ], - "prompt_number": 55 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g = Game(random.choice(WORDS))\n", + "g.play_game()" + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.wrong_letters" - ], - "language": "python", + "data": { + "text/plain": [ + "'sharkskin'" + ] + }, + "execution_count": 59, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 56, - "text": [ - "['q']" - ] - } - ], - "prompt_number": 56 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.target" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Player objects\n", + "Let's work ourselves gently into this.\n", + "\n", + "In the first instance, the only thing a `player` needs is to respond to the `guess` method. Let's make objects with just this method. Let's even make it simpler than the player from the `guesser` stage, and have it just guess letters in alphabetical order." + ] + }, + { + "cell_type": "code", + "execution_count": 60, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAlphabetical:\n", + " def guess(self, discovered, missed, lives):\n", + " return [l for l in string.ascii_lowercase if l not in discovered + missed][0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That wasn't too hard, was it?\n", + "\n", + "Let's use it to play a game." + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerAlphabetical())" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS))\n", - "g.play_game()" - ], - "language": "python", + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 70, "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: e\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: x\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 9 , wrong guesses: x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: s\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 8 , wrong guesses: s x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: l\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 7 , wrong guesses: l s x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: t\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 6 , wrong guesses: l s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: m\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 5 , wrong guesses: l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: h\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 4 , wrong guesses: h l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: i\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 3 , wrong guesses: h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: a\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ _ _ e : Lives = 2 , wrong guesses: a h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: o\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ o _ e : Lives = 2 , wrong guesses: a h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: n\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e _ _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: r\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e _ e r _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: v\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: e v e r _ o n e : Lives = 2 , wrong guesses: a h i l m s t x\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: y\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "You won! The word was everyone\n" - ] - }, - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 57, - "text": [ - "True" - ] - } - ], - "prompt_number": 57 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.play_game()" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS))\n", - "g.play_game()" - ], - "language": "python", + "data": { + "text/plain": [ + "['c', 'e', '_', '_', 'i', 'f', 'i', 'c', 'a', '_', 'e', '_']" + ] + }, + "execution_count": 71, "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ : Lives = 10 , wrong guesses: \n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: q\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ : Lives = 9 , wrong guesses: q\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: z\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ : Lives = 8 , wrong guesses: q z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: x\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ : Lives = 7 , wrong guesses: q x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: e\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ _ _ _ _ _ _ _ : Lives = 6 , wrong guesses: e q x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: a\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ _ _ _ _ _ : Lives = 6 , wrong guesses: e q x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: v\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ _ _ _ _ _ : Lives = 5 , wrong guesses: e q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: b\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ _ _ _ _ _ : Lives = 4 , wrong guesses: b e q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: k\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ k _ k _ _ : Lives = 4 , wrong guesses: b e q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: l\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ k _ k _ _ : Lives = 3 , wrong guesses: b e l q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: j\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ k _ k _ _ : Lives = 2 , wrong guesses: b e j l q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: p\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Word: _ _ a _ k _ k _ _ : Lives = 1 , wrong guesses: b e j l p q v x z\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "stream": "stdout", - "text": [ - "Enter letter: d\n" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "You lost. The word was sharkskin\n" - ] - }, - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 58, - "text": [ - "False" - ] - } - ], - "prompt_number": 58 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.discovered" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.target" - ], - "language": "python", + "data": { + "text/plain": [ + "'certificates'" + ] + }, + "execution_count": 72, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 59, - "text": [ - "'sharkskin'" - ] - } - ], - "prompt_number": 59 - }, + "output_type": "execute_result" + } + ], + "source": [ + "g.target" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Bored with looking at all the state of the game with different cells. Let's have a `print()` statement that tells us what we need." + ] + }, + { + "cell_type": "code", + "execution_count": 74, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Player objects\n", - "Let's work ourselves gently into this.\n", - "\n", - "In the first instance, the only thing a `player` needs is to respond to the `guess` method. Let's make objects with just this method. Let's even make it simpler than the player from the `guesser` stage, and have it just guess letters in alphabetical order." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: turnoffs ; Discovered: ['_', '_', '_', '_', '_', 'f', 'f', '_'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAlphabetical:\n", - " def guess(self, discovered, missed, lives):\n", - " return [l for l in string.ascii_lowercase if l not in discovered + missed][0]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 60 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Another player\n", + "Let's reimplement our player that does letters in frequency order. Again, this is essentially code reused from earlier." + ] + }, + { + "cell_type": "code", + "execution_count": 76, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "LETTER_COUNTS = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", + "LETTERS_IN_ORDER = [p[0] for p in LETTER_COUNTS.most_common()]\n", + "\n", + "class PlayerFreqOrdered:\n", + " def guess(self, discovered, missed, lives):\n", + " return [l for l in LETTERS_IN_ORDER if l not in discovered + missed][0]" + ] + }, + { + "cell_type": "code", + "execution_count": 77, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "That wasn't too hard, was it?\n", - "\n", - "Let's use it to play a game." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: cartons ; Discovered: ['c', 'a', 'r', 't', 'o', 'n', 's'] ; Lives remaining: 2\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerAlphabetical())" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 69 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.play_game()" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 70, - "text": [ - "False" - ] - } - ], - "prompt_number": 70 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.discovered" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 71, - "text": [ - "['c', 'e', '_', '_', 'i', 'f', 'i', 'c', 'a', '_', 'e', '_']" - ] - } - ], - "prompt_number": 71 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g.target" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 72, - "text": [ - "'certificates'" - ] - } - ], - "prompt_number": 72 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "code", + "execution_count": 78, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Bored with looking at all the state of the game with different cells. Let's have a `print()` statement that tells us what we need." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: douching ; Discovered: ['d', 'o', 'u', 'c', 'h', 'i', 'n', '_'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: turnoffs ; Discovered: ['_', '_', '_', '_', '_', 'f', 'f', '_'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 74 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "code", + "execution_count": 79, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Another player\n", - "Let's reimplement our player that does letters in frequency order. Again, this is essentially code reused from earlier." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: minimisation ; Discovered: ['m', 'i', 'n', 'i', 'm', 'i', 's', 'a', 't', 'i', 'o', 'n'] ; Lives remaining: 4\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "LETTER_COUNTS = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", - "LETTERS_IN_ORDER = [p[0] for p in LETTER_COUNTS.most_common()]\n", - "\n", - "class PlayerFreqOrdered:\n", - " def guess(self, discovered, missed, lives):\n", - " return [l for l in LETTERS_IN_ORDER if l not in discovered + missed][0]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 76 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: cartons ; Discovered: ['c', 'a', 'r', 't', 'o', 'n', 's'] ; Lives remaining: 2\n" - ] - } - ], - "prompt_number": 77 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: douching ; Discovered: ['d', 'o', 'u', 'c', 'h', 'i', 'n', '_'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 78 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: minimisation ; Discovered: ['m', 'i', 'n', 'i', 'm', 'i', 's', 'a', 't', 'i', 'o', 'n'] ; Lives remaining: 4\n" - ] - } - ], - "prompt_number": 79 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Player subclasses and inheritance\n", + "Time to DRY the code a little. Both of these players (`PlayerAlphabetical` and `PlayerFreqOrdered`) are essentially the same. The only difference is the set of letters used in the middle of the `guess` method. \n", + "\n", + "Let's create a generic \"letters in a fixed order\" class that has that implementation of `guess` and is passed in a set of letters in order. The two players we already have are subclasses of that, where we have pre-packaged letter orders.\n", + "\n", + "Here's the generic player. Note that the ordered letters are passed in as a parameter to the `__init__()` method, and `guess()` uses that letter sequence." + ] + }, + { + "cell_type": "code", + "execution_count": 85, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerFixedOrder:\n", + " def __init__(self, ordered_letters):\n", + " self.ordered_letters = ordered_letters\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We can now specify the subclasses, using the fixed order. The initialisation of the subclasses now takes no additional parameter, but we pass the hardcoded order to the superclass's `__init__()`." + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAlphabetical(PlayerFixedOrder):\n", + " def __init__(self):\n", + " super().__init__(string.ascii_lowercase)\n", + "\n", + "class PlayerFreqOrdered(PlayerFixedOrder):\n", + " def __init__(self):\n", + " super().__init__(LETTERS_IN_ORDER)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Does it work?" + ] + }, + { + "cell_type": "code", + "execution_count": 87, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Player subclasses and inheritance\n", - "Time to DRY the code a little. Both of these players (`PlayerAlphabetical` and `PlayerFreqOrdered`) are essentially the same. The only difference is the set of letters used in the middle of the `guess` method. \n", - "\n", - "Let's create a generic \"letters in a fixed order\" class that has that implementation of `guess` and is passed in a set of letters in order. The two players we already have are subclasses of that, where we have pre-packaged letter orders.\n", - "\n", - "Here's the generic player. Note that the ordered letters are passed in as a parameter to the `__init__()` method, and `guess()` uses that letter sequence." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: yogi ; Discovered: ['_', 'o', '_', 'i'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerFixedOrder:\n", - " def __init__(self, ordered_letters):\n", - " self.ordered_letters = ordered_letters\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 85 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "code", + "execution_count": 88, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "We can now specify the subclasses, using the fixed order. The initialisation of the subclasses now takes no additional parameter, but we pass the hardcoded order to the superclass's `__init__()`." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: slimmest ; Discovered: ['s', 'l', 'i', 'm', 'm', 'e', 's', 't'] ; Lives remaining: 3\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAlphabetical(PlayerFixedOrder):\n", - " def __init__(self):\n", - " super().__init__(string.ascii_lowercase)\n", - "\n", - "class PlayerFreqOrdered(PlayerFixedOrder):\n", - " def __init__(self):\n", - " super().__init__(LETTERS_IN_ORDER)\n" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 86 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "code", + "execution_count": 89, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Does it work?" + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: diseases ; Discovered: ['d', 'i', '_', 'e', 'a', '_', 'e', '_'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: yogi ; Discovered: ['_', 'o', '_', 'i'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 87 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: slimmest ; Discovered: ['s', 'l', 'i', 'm', 'm', 'e', 's', 't'] ; Lives remaining: 3\n" - ] - } - ], - "prompt_number": 88 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: diseases ; Discovered: ['d', 'i', '_', 'e', 'a', '_', 'e', '_'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 89 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Can we use the generic version directly?" + ] + }, + { + "cell_type": "code", + "execution_count": 90, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Can we use the generic version directly?" + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: pardon ; Discovered: ['p', '_', 'r', '_', 'o', 'n'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: pardon ; Discovered: ['p', '_', 'r', '_', 'o', 'n'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 90 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", - "g.play_game()\n", - "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "Target: grouchier ; Discovered: ['_', 'r', 'o', 'u', '_', '_', '_', '_', 'r'] ; Lives remaining: 0\n" - ] - } - ], - "prompt_number": 91 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "code", + "execution_count": 91, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Mass gaming\n", - "Now we can get machines playing each other, we get get them playing *lots* of games and just tell us the summaries. \n", - "\n", - "Which of these three methods (alphabetical, frequency ordered, reverse alphabetical) is the best? Let's get each player to play 100 random games and see which gets the most wins." + "name": "stdout", + "output_type": "stream", + "text": [ + "Target: grouchier ; Discovered: ['_', 'r', 'o', 'u', '_', '_', '_', '_', 'r'] ; Lives remaining: 0\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "49\n" - ] - } - ], - "prompt_number": 92 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "309\n" - ] - } - ], - "prompt_number": 96 - }, + } + ], + "source": [ + "g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", + "g.play_game()\n", + "print('Target:', g.target, '; Discovered:', g.discovered, '; Lives remaining:', g.lives)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Mass gaming\n", + "Now we can get machines playing each other, we get get them playing *lots* of games and just tell us the summaries. \n", + "\n", + "Which of these three methods (alphabetical, frequency ordered, reverse alphabetical) is the best? Let's get each player to play 1000 random games and see which gets the most wins." + ] + }, + { + "cell_type": "code", + "execution_count": 92, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "6\n" - ] - } - ], - "prompt_number": 94 - }, + "name": "stdout", + "output_type": "stream", + "text": [ + "49\n" + ] + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 96, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Frequency ordered is much better than the others, but still only wins about 30% of the time. I'm sure we can do better.\n", - "\n", - "That's the next part..." + "name": "stdout", + "output_type": "stream", + "text": [ + "309\n" ] - }, + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 94, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "name": "stdout", + "output_type": "stream", + "text": [ + "6\n" + ] } ], - "metadata": {} + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Frequency ordered is much better than the others, but still only wins about 30% of the time. I'm sure we can do better.\n", + "\n", + "That's the next part..." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [] } - ] -} \ No newline at end of file + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/hangman/04-hangman-better.ipynb b/hangman/04-hangman-better.ipynb index f524dae..9db9295 100644 --- a/hangman/04-hangman-better.ipynb +++ b/hangman/04-hangman-better.ipynb @@ -1,1946 +1,1680 @@ { - "metadata": { - "name": "", - "signature": "sha256:f96f8d6bd00204692b51b22bb9f514c926594fc7c3ed2ee8cc31f44119a3e59c" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Better strategies\n", - "We've got the plumbing all working. Now to play and come up with some better playing strategies. \n", - "\n", - "First, some repetition from the previous section." + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategies\n", + "We've got the plumbing all working. Now to play and come up with some better playing strategies. \n", + "\n", + "First, some repetition from the previous section." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import re\n", + "import random\n", + "import string\n", + "import collections" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", + " if re.match(r'^[a-z]*$', w.strip())]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "LETTER_COUNTS = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", + "LETTERS_IN_ORDER = [p[0] for p in LETTER_COUNTS.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "STARTING_LIVES = 10" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class Game:\n", + " def __init__(self, target, player=None, lives=STARTING_LIVES):\n", + " self.lives = lives\n", + " self.player = player\n", + " self.target = target\n", + " self.discovered = list('_' * len(target))\n", + " self.wrong_letters = []\n", + " self.game_finished = False\n", + " self.game_won = False\n", + " self.game_lost = False\n", + " \n", + " def find_all(self, letter):\n", + " return [p for p, l in enumerate(self.target) if l == letter]\n", + " \n", + " def update_discovered_word(self, guessed_letter):\n", + " locations = self.find_all(guessed_letter)\n", + " for location in locations:\n", + " self.discovered[location] = guessed_letter\n", + " return self.discovered\n", + " \n", + " def do_turn(self):\n", + " if self.player:\n", + " guess = self.player.guess(self.discovered, self.wrong_letters, self.lives)\n", + " else:\n", + " guess = self.ask_for_guess()\n", + " if guess in self.target:\n", + " self.update_discovered_word(guess)\n", + " else:\n", + " self.lives -= 1\n", + " if guess not in self.wrong_letters:\n", + " self.wrong_letters += [guess]\n", + " if self.lives == 0:\n", + " self.game_finished = True\n", + " self.game_lost = True\n", + " if '_' not in self.discovered:\n", + " self.game_finished = True\n", + " self.game_won = True\n", + " \n", + " def ask_for_guess(self):\n", + " print('Word:', ' '.join(self.discovered), \n", + " ' : Lives =', self.lives, \n", + " ', wrong guesses:', ' '.join(sorted(self.wrong_letters)))\n", + " guess = input('Enter letter: ').strip().lower()[0]\n", + " return guess\n", + " \n", + " def play_game(self):\n", + " while not self.game_finished:\n", + " self.do_turn()\n", + " if not self.player:\n", + " self.report_on_game()\n", + " return self.game_won\n", + " \n", + " def report_on_game(self):\n", + " if self.game_won:\n", + " print('You won! The word was', self.target)\n", + " else:\n", + " print('You lost. The word was', self.target)\n", + " return self.game_won" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerFixedOrder:\n", + " def __init__(self, ordered_letters):\n", + " self.ordered_letters = ordered_letters\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAlphabetical(PlayerFixedOrder):\n", + " def __init__(self):\n", + " super().__init__(string.ascii_lowercase)\n", + "\n", + "class PlayerFreqOrdered(PlayerFixedOrder):\n", + " def __init__(self):\n", + " super().__init__(LETTERS_IN_ORDER)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Timing runs\n", + "Use the IPython `timeit` cellmagic to time runs." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "49\n", + "45\n", + "54\n", + "54\n", + "1 loops, best of 3: 207 ms per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "import re\n", - "import random\n", - "import string\n", - "import collections" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 1 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "WORDS = [w.strip() for w in open('/usr/share/dict/british-english').readlines() \n", - " if re.match(r'^[a-z]*$', w.strip())]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 2 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "LETTER_COUNTS = collections.Counter(l.lower() for l in open('../sherlock-holmes.txt').read() if l in string.ascii_letters)\n", - "LETTERS_IN_ORDER = [p[0] for p in LETTER_COUNTS.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "STARTING_LIVES = 10" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 4 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class Game:\n", - " def __init__(self, target, player=None, lives=STARTING_LIVES):\n", - " self.lives = lives\n", - " self.player = player\n", - " self.target = target\n", - " self.discovered = list('_' * len(target))\n", - " self.wrong_letters = []\n", - " self.game_finished = False\n", - " self.game_won = False\n", - " self.game_lost = False\n", - " \n", - " def find_all(self, letter):\n", - " return [p for p, l in enumerate(self.target) if l == letter]\n", - " \n", - " def update_discovered_word(self, guessed_letter):\n", - " locations = self.find_all(guessed_letter)\n", - " for location in locations:\n", - " self.discovered[location] = guessed_letter\n", - " return self.discovered\n", - " \n", - " def do_turn(self):\n", - " if self.player:\n", - " guess = self.player.guess(self.discovered, self.wrong_letters, self.lives)\n", - " else:\n", - " guess = self.ask_for_guess()\n", - " if guess in self.target:\n", - " self.update_discovered_word(guess)\n", - " else:\n", - " self.lives -= 1\n", - " if guess not in self.wrong_letters:\n", - " self.wrong_letters += [guess]\n", - " if self.lives == 0:\n", - " self.game_finished = True\n", - " self.game_lost = True\n", - " if '_' not in self.discovered:\n", - " self.game_finished = True\n", - " self.game_won = True\n", - " \n", - " def ask_for_guess(self):\n", - " print('Word:', ' '.join(self.discovered), \n", - " ' : Lives =', self.lives, \n", - " ', wrong guesses:', ' '.join(sorted(self.wrong_letters)))\n", - " guess = input('Enter letter: ').strip().lower()[0]\n", - " return guess\n", - " \n", - " def play_game(self):\n", - " while not self.game_finished:\n", - " self.do_turn()\n", - " if not self.player:\n", - " self.report_on_game()\n", - " return self.game_won\n", - " \n", - " def report_on_game(self):\n", - " if self.game_won:\n", - " print('You won! The word was', self.target)\n", - " else:\n", - " print('You lost. The word was', self.target)\n", - " return self.game_won" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 5 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerFixedOrder:\n", - " def __init__(self, ordered_letters):\n", - " self.ordered_letters = ordered_letters\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 6 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAlphabetical(PlayerFixedOrder):\n", - " def __init__(self):\n", - " super().__init__(string.ascii_lowercase)\n", - "\n", - "class PlayerFreqOrdered(PlayerFixedOrder):\n", - " def __init__(self):\n", - " super().__init__(LETTERS_IN_ORDER)\n" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 7 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Timing runs\n", - "Use the IPython `timeit` cellmagic to time runs." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "305\n", + "331\n", + "327\n", + "316\n", + "1 loops, best of 3: 212 ms per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "49\n", - "45" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "54" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "54" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 207 ms per loop\n" - ] - } - ], - "prompt_number": 8 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "305\n", - "331" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "327" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "316" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 212 ms per loop\n" - ] - } - ], - "prompt_number": 9 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "8\n", - "8" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "15" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "8" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 198 ms per loop\n" - ] - } - ], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Better strategy 1: letters in dictionary frequency order\n", - "When we're looking at letter frequencies, we've been looking at running English text. But the words being preseted to the player aren't drawn randomly from novels: they're taken from the dictionary. That means our frequencies are off because we're looking at the wrong distribution of words.\n", - "\n", - "For example, 'e' and 't' are common in running text because words like 'the' occur very frequently. But 'the' only occurs once in the dictionary. Let's sample letters from the dictionary and see if that makes a difference." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerFreqOrdered())\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "8\n", + "8\n", + "15\n", + "8\n", + "1 loops, best of 3: 198 ms per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "DICT_COUNTS = collections.Counter(''.join(WORDS))\n", - "DICT_LETTERS_IN_ORDER = [p[0] for p in DICT_COUNTS.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 11 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "DICT_COUNTS" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 12, - "text": [ - "Counter({'e': 60732, 's': 47997, 'i': 45470, 'a': 38268, 'r': 37522, 'n': 36868, 't': 36009, 'o': 31004, 'l': 26902, 'c': 21061, 'd': 20764, 'u': 17682, 'g': 16560, 'p': 15240, 'm': 13855, 'h': 11662, 'b': 9866, 'y': 7877, 'f': 7430, 'v': 5325, 'k': 4829, 'w': 4757, 'x': 1425, 'q': 1020, 'z': 979, 'j': 965})" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "print(DICT_LETTERS_IN_ORDER)\n", - "print(LETTERS_IN_ORDER)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "['e', 's', 'i', 'a', 'r', 'n', 't', 'o', 'l', 'c', 'd', 'u', 'g', 'p', 'm', 'h', 'b', 'y', 'f', 'v', 'k', 'w', 'x', 'q', 'z', 'j']\n", - "['e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z']\n" - ] - } - ], - "prompt_number": 13 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "The letter orders are certainly different. Let's see if it make the player more effective than the ~30% of `FreqOrder`." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerFixedOrder(list(reversed(string.ascii_lowercase))))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 1: letters in dictionary frequency order\n", + "When we're looking at letter frequencies, we've been looking at running English text. But the words being preseted to the player aren't drawn randomly from novels: they're taken from the dictionary. That means our frequencies are off because we're looking at the wrong distribution of words.\n", + "\n", + "For example, 'e' and 't' are common in running text because words like 'the' occur very frequently. But 'the' only occurs once in the dictionary. Let's sample letters from the dictionary and see if that makes a difference." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "DICT_COUNTS = collections.Counter(''.join(WORDS))\n", + "DICT_LETTERS_IN_ORDER = [p[0] for p in DICT_COUNTS.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Counter({'e': 60732, 's': 47997, 'i': 45470, 'a': 38268, 'r': 37522, 'n': 36868, 't': 36009, 'o': 31004, 'l': 26902, 'c': 21061, 'd': 20764, 'u': 17682, 'g': 16560, 'p': 15240, 'm': 13855, 'h': 11662, 'b': 9866, 'y': 7877, 'f': 7430, 'v': 5325, 'k': 4829, 'w': 4757, 'x': 1425, 'q': 1020, 'z': 979, 'j': 965})" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "DICT_COUNTS" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['e', 's', 'i', 'a', 'r', 'n', 't', 'o', 'l', 'c', 'd', 'u', 'g', 'p', 'm', 'h', 'b', 'y', 'f', 'v', 'k', 'w', 'x', 'q', 'z', 'j']\n", + "['e', 't', 'a', 'o', 'i', 'h', 'n', 's', 'r', 'd', 'l', 'u', 'm', 'w', 'c', 'y', 'f', 'g', 'p', 'b', 'v', 'k', 'x', 'j', 'q', 'z']\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerFixedOrder(DICT_LETTERS_IN_ORDER))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "463\n" - ] - } - ], - "prompt_number": 14 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "For convenience, we can wrap this new behaviour up in its own class." + } + ], + "source": [ + "print(DICT_LETTERS_IN_ORDER)\n", + "print(LETTERS_IN_ORDER)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The letter orders are certainly different. Let's see if it make the player more effective than the ~30% of `FreqOrder`." + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "463\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerDictOrder(PlayerFixedOrder):\n", - " def __init__(self):\n", - " super().__init__(DICT_LETTERS_IN_ORDER)" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 15 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerDictOrder())\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "474\n", - "460" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "490" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "467" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 220 ms per loop\n" - ] - } - ], - "prompt_number": 16 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "That was worth it!" + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerFixedOrder(DICT_LETTERS_IN_ORDER))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For convenience, we can wrap this new behaviour up in its own class." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerDictOrder(PlayerFixedOrder):\n", + " def __init__(self):\n", + " super().__init__(DICT_LETTERS_IN_ORDER)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "474\n", + "460\n", + "490\n", + "467\n", + "1 loops, best of 3: 220 ms per loop\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Better strategy 2: paying attention the target word\n", - "The strategies so far haven't paid any attention to the target word. Can we use information about the target to help refine our guesses?\n", - "\n", - "We've just seen that sampling letters from the dictionary works better than other approaches. But if we're presented with a seven letter word, we don't need to pay attention to the letter occurences in three- or ten-letter words. \n", - "\n", - "Let's build our first \"adaptive\" player, one that adapts its behaviour to what's happening in this game. \n", - "\n", - "The idea is that the player will hold internally a set of `candidate_words` that could match what it knows about the target. It will then count the letters in that set and pick the most frequent, but so-far-unguessed, letter.\n", - "\n", - "When the player is created, the it's give `all_words` it can chose from, but `candidate_words` is non-existent. As soon as it's given a word, it can filter `all_words` so that `candidate_words` are just those words with the same length as the `discovered` word. From the `candidate_words`, the player can create its own set of `ordered_letters`. Guesses are pulled from the `ordered_letters` the same as before." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerDictOrder())\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That was worth it!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 2: paying attention the target word\n", + "The strategies so far haven't paid any attention to the target word. Can we use information about the target to help refine our guesses?\n", + "\n", + "We've just seen that sampling letters from the dictionary works better than other approaches. But if we're presented with a seven letter word, we don't need to pay attention to the letter occurences in three- or ten-letter words. \n", + "\n", + "Let's build our first \"adaptive\" player, one that adapts its behaviour to what's happening in this game. \n", + "\n", + "The idea is that the player will hold internally a set of `candidate_words` that could match what it knows about the target. It will then count the letters in that set and pick the most frequent, but so-far-unguessed, letter.\n", + "\n", + "When the player is created, the it's give `all_words` it can chose from, but `candidate_words` is non-existent. As soon as it's given a word, it can filter `all_words` so that `candidate_words` are just those words with the same length as the `discovered` word. From the `candidate_words`, the player can create its own set of `ordered_letters`. Guesses are pulled from the `ordered_letters` the same as before." + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveLength:\n", + " def __init__(self, words):\n", + " self.all_words = words\n", + " self.candidate_words = None\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " if not self.candidate_words:\n", + " self.set_ordered_letters(len(discovered))\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def set_ordered_letters(self, word_len):\n", + " self.candidate_words = [w for w in self.all_words if len(w) == word_len]\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "452\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveLength:\n", - " def __init__(self, words):\n", - " self.all_words = words\n", - " self.candidate_words = None\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " if not self.candidate_words:\n", - " self.set_ordered_letters(len(discovered))\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def set_ordered_letters(self, word_len):\n", - " self.candidate_words = [w for w in self.all_words if len(w) == word_len]\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 17 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "452\n" - ] - } - ], - "prompt_number": 18 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "480\n", - "444" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "504" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "463" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 18.5 s per loop\n" - ] - } - ], - "prompt_number": 19 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "It's a bit better, but quite a lot slower. Can we improve the performance, to offset the cost of the slower game?" + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "480\n", + "444\n", + "504\n", + "463\n", + "1 loops, best of 3: 18.5 s per loop\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Better strategy 3: using discovered letters\n", - "Once we've made some successful guesses, we know more about the `target` and we can use that information to further filter the `candiate_words`. For instance, if we know the `target` is seven letters with an 'e' in the second and fourth positions, there are probably very few candiate words to choose from.\n", - "\n", - "The challenge here is to filter the `candidate_words` depending on the letter pattern. That's non-trivial, so we'll look at how to do that bit first.\n", - "\n", - "(This matching is the sort of thing that regular expressions are designed for, but I think there are enough new ideas in this material so far. See the end of this notebook for implementations of the adaptive players that use regexes.)" + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It's a bit better, but quite a lot slower. Can we improve the performance, to offset the cost of the slower game?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 3: using discovered letters\n", + "Once we've made some successful guesses, we know more about the `target` and we can use that information to further filter the `candiate_words`. For instance, if we know the `target` is seven letters with an 'e' in the second and fourth positions, there are probably very few candiate words to choose from.\n", + "\n", + "The challenge here is to filter the `candidate_words` depending on the letter pattern. That's non-trivial, so we'll look at how to do that bit first.\n", + "\n", + "(This matching is the sort of thing that regular expressions are designed for, but I think there are enough new ideas in this material so far. See the end of this notebook for implementations of the adaptive players that use regexes.)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Matching\n", + "The problem: given a pattern and a target word, determine if the word matches the pattern. The return value of `match` should be a Boolean.\n", + "\n", + "A target is a sequence of letters. \n", + "\n", + "A pattern is a sequence of either a letter or an underscore.\n", + "\n", + "A target matches a pattern if the corresponding elements of both match.\n", + "\n", + "* A target letter always matches an underscore.\n", + "\n", + "* A target letter matches a pattern letter if they are the same.\n", + "\n", + "If any element doesn't match, the whole match fails.\n", + "\n", + "If the target and pattern are different lengths, the match fails.\n", + "\n", + "The built-in `zip` will allow us to pair up the elements of the pattern and target." + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def match(pattern, target):\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_':\n", + " # true\n", + " pass\n", + " elif m != '_' and m == c:\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True " + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 21, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match('__pp_', 'happy')" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match('__pp_', 'hippo')" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match('__pp_', 'hello')" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match('__pp_', 'happier')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That all seems to be working. Let's put it in a `player` object." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveIncludedLetters:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered):\n", + " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]\n", + " \n", + " def match(self, pattern, target):\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_':\n", + " # true\n", + " pass\n", + " elif m != '_' and m == c:\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True " + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "981\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Matching\n", - "The problem: given a pattern and a target word, determine if the word matches the pattern. The return value of `match` should be a Boolean.\n", - "\n", - "A target is a sequence of letters. \n", - "\n", - "A pattern is a sequence of either a letter or an underscore.\n", - "\n", - "A target matches a pattern if the corresponding elements of both match.\n", - "\n", - "* A target letter always matches an underscore.\n", - "\n", - "* A target letter matches a pattern letter if they are the same.\n", - "\n", - "If any element doesn't match, the whole match fails.\n", - "\n", - "If the target and pattern are different lengths, the match fails.\n", - "\n", - "The built-in `zip` will allow us to pair up the elements of the pattern and target." + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "982\n", + "987\n", + "984\n", + "982\n", + "1 loops, best of 3: 51.7 s per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def match(pattern, target):\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_':\n", - " # true\n", - " pass\n", - " elif m != '_' and m == c:\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 20 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match('__pp_', 'happy')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 21, - "text": [ - "True" - ] - } - ], - "prompt_number": 21 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match('__pp_', 'hippo')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 22, - "text": [ - "True" - ] - } - ], - "prompt_number": 22 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match('__pp_', 'hello')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 23, - "text": [ - "False" - ] - } - ], - "prompt_number": 23 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match('__pp_', 'happier')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 24, - "text": [ - "False" - ] - } - ], - "prompt_number": 24 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "That all seems to be working. Let's put it in a `player` object." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Quite an improvement!\n", + "\n", + "But let's see if we can do better." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 4: using wrong guesses\n", + "If we make a guess that's wrong, we can also use that to eliminate `candidate_words`. If we know the `target` doesn't contain an 'e', we can eliminate all `candidate_words` that contain an 'e'. If we also know that the word contains an 'e' in the third positon, we can also eliminate all words that contain and 'e' in any other position.\n", + "\n", + "This requires an different verion of `match`, so that a word matches a pattern if an underscore in the pattern does not match any of the known-incorrect letters." + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def match_exclusion(pattern, target, excluded=None):\n", + " if not excluded:\n", + " excluded = ''\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_' and c not in excluded:\n", + " # true\n", + " pass\n", + " elif m != '_':\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True " + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match_exclusion('__pp_', 'happy', 'x')" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match_exclusion('__pp_', 'happy', 'a')" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match_exclusion('__pp_', 'happy', 'p')" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "data": { + "text/plain": [ + "False" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "match_exclusion('__pp_', 'happy', 'hp')" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveExcludedLetters:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered, missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", + " self.candidate_words = [w for w in self.candidate_words if self.match_exclusion(discovered, w, attempted_letters)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]\n", + " \n", + " def match_exclusion(self, pattern, target, excluded=None):\n", + " if not excluded:\n", + " excluded = ''\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_' and c not in excluded:\n", + " # true\n", + " pass\n", + " elif m != '_':\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True " + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "737\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveIncludedLetters:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered):\n", - " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]\n", - " \n", - " def match(self, pattern, target):\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_':\n", - " # true\n", - " pass\n", - " elif m != '_' and m == c:\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 25 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "981\n" - ] - } - ], - "prompt_number": 26 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "982\n", - "987" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "984" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "982" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 51.7 s per loop\n" - ] - } - ], - "prompt_number": 27 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Quite an improvement!\n", - "\n", - "But let's see if we can do better." + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "735\n", + "748\n", + "742\n", + "748\n", + "1 loops, best of 3: 1min 4s per loop\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Better strategy 4: using wrong guesses\n", - "If we make a guess that's wrong, we can also use that to eliminate `candidate_words`. If we know the `target` doesn't contain an 'e', we can eliminate all `candidate_words` that contain an 'e'. If we also know that the word contains and 'e' in the third positon, we can also eliminate all words that contain and 'e' in any other position.\n", - "\n", - "This requires an different verion of `match`, so that a word matches a pattern if an underscore in the pattern does not match any of the known-incorrect letters." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "That's better than the non-adaptive players, but not as good as the `IncludedLetters` player. But we could combine the two approaches. Will that work better?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 5: using both correct and wrong guesses\n", + "Not much to say. Let's just merge the two previous approaches." + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptivePattern:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered, missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", + " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w, attempted_letters)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]\n", + " \n", + " def match(self, pattern, target, excluded=None):\n", + " if not excluded:\n", + " excluded = ''\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_' and c not in excluded:\n", + " # true\n", + " pass\n", + " elif m != '_' and m == c:\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "993\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def match_exclusion(pattern, target, excluded=None):\n", - " if not excluded:\n", - " excluded = ''\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_' and c not in excluded:\n", - " # true\n", - " pass\n", - " elif m != '_':\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 28 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match_exclusion('__pp_', 'happy', 'x')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 29, - "text": [ - "True" - ] - } - ], - "prompt_number": 29 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match_exclusion('__pp_', 'happy', 'a')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 30, - "text": [ - "False" - ] - } - ], - "prompt_number": 30 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match_exclusion('__pp_', 'happy', 'p')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 31, - "text": [ - "True" - ] - } - ], - "prompt_number": 31 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "match_exclusion('__pp_', 'happy', 'hp')" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 32, - "text": [ - "False" - ] - } - ], - "prompt_number": 32 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveExcludedLetters:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered, missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", - " self.candidate_words = [w for w in self.candidate_words if self.match_exclusion(discovered, w, attempted_letters)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]\n", - " \n", - " def match_exclusion(self, pattern, target, excluded=None):\n", - " if not excluded:\n", - " excluded = ''\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_' and c not in excluded:\n", - " # true\n", - " pass\n", - " elif m != '_':\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 33 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "737\n" - ] - } - ], - "prompt_number": 34 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "735\n", - "748" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "742" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "748" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 1min 4s per loop\n" - ] - } - ], - "prompt_number": 35 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "That's better than the non-adaptive players, but not as good as the `IncludedLetters` player. But we could combine the two approaches. Will that work better?" + } + ], + "source": [ + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "990\n", + "995\n", + "992\n", + "994\n", + "1 loops, best of 3: 47.1 s per loop\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Better strategy 5: using both correct and wrong guesses\n", - "Not much to say. Let's just merge the two previous approaches." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## DRYing it up\n", + "You've probably noticed some duplicate code above. " + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptive:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered, missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " pass\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() \n", + " for l in ''.join(self.candidate_words) + string.ascii_lowercase \n", + " if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]\n", + "\n", + " def match(self, pattern, target, excluded=None):\n", + " if not excluded:\n", + " excluded = ''\n", + " if len(pattern) != len(target):\n", + " return False\n", + " for m, c in zip(pattern, target):\n", + " if m == '_' and c not in excluded:\n", + " # true\n", + " pass\n", + " elif m != '_' and m == c:\n", + " # true\n", + " pass\n", + " else:\n", + " return False\n", + " return True " + ] + }, + { + "cell_type": "code", + "execution_count": 40, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveLength(PlayerAdaptive):\n", + " def __init__(self, words):\n", + " super().__init__(words)\n", + " self.word_len = None\n", + " self.ordered_letters = None\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " if not self.word_len:\n", + " self.word_len = len(discovered)\n", + " self.candidate_words = [w for w in self.candidate_words if len(w) == self.word_len]\n", + " \n", + " def set_ordered_letters(self):\n", + " if not self.ordered_letters:\n", + " super().set_ordered_letters()" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveIncludedLetters(PlayerAdaptive):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w)]" + ] + }, + { + "cell_type": "code", + "execution_count": 42, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveExcludedLetters(PlayerAdaptive):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " if missed:\n", + " empty_target = '_' * len(discovered)\n", + " self.candidate_words = [w for w in self.candidate_words if self.match(empty_target, w, missed)] " + ] + }, + { + "cell_type": "code", + "execution_count": 43, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptivePattern(PlayerAdaptive):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " attempted_letters = [l for l in discovered if l != '_'] + missed\n", + " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w, attempted_letters)]" + ] + }, + { + "cell_type": "code", + "execution_count": 44, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "472\n", + "460\n", + "462\n", + "484\n", + "1 loops, best of 3: 17 s per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptivePattern:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered, missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", - " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w, attempted_letters)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]\n", - " \n", - " def match(self, pattern, target, excluded=None):\n", - " if not excluded:\n", - " excluded = ''\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_' and c not in excluded:\n", - " # true\n", - " pass\n", - " elif m != '_' and m == c:\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 36 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "993\n" - ] - } - ], - "prompt_number": 37 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "990\n", - "995" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "992" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "994" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 47.1 s per loop\n" - ] - } - ], - "prompt_number": 38 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##DRYing it up\n", - "You've probably noticed some duplicate code above. " + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 45, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "988\n", + "985\n", + "987\n", + "988\n", + "1 loops, best of 3: 49.3 s per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptive:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered, missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " pass\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() \n", - " for l in ''.join(self.candidate_words) + string.ascii_lowercase \n", - " if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]\n", - "\n", - " def match(self, pattern, target, excluded=None):\n", - " if not excluded:\n", - " excluded = ''\n", - " if len(pattern) != len(target):\n", - " return False\n", - " for m, c in zip(pattern, target):\n", - " if m == '_' and c not in excluded:\n", - " # true\n", - " pass\n", - " elif m != '_' and m == c:\n", - " # true\n", - " pass\n", - " else:\n", - " return False\n", - " return True " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 39 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveLength(PlayerAdaptive):\n", - " def __init__(self, words):\n", - " super().__init__(words)\n", - " self.word_len = None\n", - " self.ordered_letters = None\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " if not self.word_len:\n", - " self.word_len = len(discovered)\n", - " self.candidate_words = [w for w in self.candidate_words if len(w) == self.word_len]\n", - " \n", - " def set_ordered_letters(self):\n", - " if not self.ordered_letters:\n", - " super().set_ordered_letters()" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 40 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveIncludedLetters(PlayerAdaptive):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w)]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 41 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveExcludedLetters(PlayerAdaptive):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " if missed:\n", - " empty_target = '_' * len(discovered)\n", - " self.candidate_words = [w for w in self.candidate_words if self.match(empty_target, w, missed)] " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 42 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptivePattern(PlayerAdaptive):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " attempted_letters = [l for l in discovered if l != '_'] + missed\n", - " self.candidate_words = [w for w in self.candidate_words if self.match(discovered, w, attempted_letters)]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 43 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveLength(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "472\n", - "460" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "462" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "484" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 17 s per loop\n" - ] - } - ], - "prompt_number": 44 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "988\n", - "985" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "987" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "988" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 49.3 s per loop\n" - ] - } - ], - "prompt_number": 45 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "575\n", - "611" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "583" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "607" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 5min 10s per loop\n" - ] - } - ], - "prompt_number": 46 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "990\n", - "992" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "995" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "991" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 39.1 s per loop\n" - ] - } - ], - "prompt_number": 47 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", - " g.play_game()\n", - " if not g.game_won:\n", - " print(g.target, g.discovered, g.wrong_letters)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "puffy ['p', 'u', '_', '_', 'y'] ['s', 'e', 'a', 'o', 'i', 'm', 'l', 'n', 'r', 't']\n", - "jar" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " ['_', 'a', 'r'] ['t', 'p', 'g', 'w', 'd', 'm', 'b', 'y', 'f', 'o']\n", - "fate" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " ['_', 'a', '_', 'e'] ['l', 'r', 'm', 'p', 's', 'g', 'd', 'k', 'v', 'b']\n", - "robs" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - " ['_', 'o', 'b', 's'] ['e', 'a', 't', 'h', 'g', 'f', 'l', 'c', 'm', 'j']\n" - ] - } - ], - "prompt_number": 48 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "##Better strategy 6: divide and conquer\n", - "This is a general approach to solving big problems: divide the candidate set into two equal halves, so that a simple test can discard half the candidates. \n", - "\n", - "For Hangman, we want to guess the letter that will eliminate half the `candidate_words`. For each letter that's present in all of the candidate words, score the letter +1 for every word it appears in, and -1 for every word it doesn't appear in. The closer the total is to zero, the closer letter is to being in half the `candidate_words`. We then pick the unguesses letter with the score closest to zero.\n", - "\n", - "As the `PlayerAdaptivePattern` seems to work well, we'll use that to keep track of the `candidate_words`. This variant changes the order of the letters, so it's a rewrite of `set_ordered_letters()`." + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 46, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "575\n", + "611\n", + "583\n", + "607\n", + "1 loops, best of 3: 5min 10s per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveSplit(PlayerAdaptivePattern):\n", - " def set_ordered_letters(self):\n", - " def letter_diff(l):\n", - " total = 0\n", - " for w in self.candidate_words:\n", - " if l in w:\n", - " total += 1\n", - " else:\n", - " total -= 1\n", - " return total\n", - " # return abs(sum(1 if l in w else -1 for w in self.candidate_words))\n", - " possible_letters = set(''.join(self.candidate_words))\n", - " letter_diffs = [(l, letter_diff(l)) for l in possible_letters]\n", - " self.ordered_letters = [p[0] for p in sorted(letter_diffs, key=lambda p: p[1])]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 49 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "\n", - "wins = 0\n", - "for _ in range(1000):\n", - " g = Game(random.choice(WORDS), player=PlayerAdaptiveSplit(WORDS))\n", - " g.play_game()\n", - " if g.game_won:\n", - " wins += 1\n", - "print(wins)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "113\n", - "114" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "131" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "132" - ] - }, - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "\n", - "1 loops, best of 3: 2min 28s per loop\n" - ] - } - ], - "prompt_number": 50 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Oh.\n", - "\n", - "Why is this happening?" + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLetters(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 47, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "990\n", + "992\n", + "995\n", + "991\n", + "1 loops, best of 3: 39.1 s per loop\n" ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## See below for the regex-using versions" + } + ], + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "code", + "execution_count": 48, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "puffy ['p', 'u', '_', '_', 'y'] ['s', 'e', 'a', 'o', 'i', 'm', 'l', 'n', 'r', 't']\n", + "jar ['_', 'a', 'r'] ['t', 'p', 'g', 'w', 'd', 'm', 'b', 'y', 'f', 'o']\n", + "fate ['_', 'a', '_', 'e'] ['l', 'r', 'm', 'p', 's', 'g', 'd', 'k', 'v', 'b']\n", + "robs ['_', 'o', 'b', 's'] ['e', 'a', 't', 'h', 'g', 'f', 'l', 'c', 'm', 'j']\n" + ] + } + ], + "source": [ + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", + " g.play_game()\n", + " if not g.game_won:\n", + " print(g.target, g.discovered, g.wrong_letters)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Better strategy 6: divide and conquer\n", + "This is a general approach to solving big problems: divide the candidate set into two equal halves, so that a simple test can discard half the candidates. \n", + "\n", + "For Hangman, we want to guess the letter that will eliminate half the `candidate_words`. For each letter that's present in all of the candidate words, score the letter +1 for every word it appears in, and -1 for every word it doesn't appear in. The closer the total is to zero, the closer letter is to being in half the `candidate_words`. We then pick the unguesses letter with the score closest to zero.\n", + "\n", + "As the `PlayerAdaptivePattern` seems to work well, we'll use that to keep track of the `candidate_words`. This variant changes the order of the letters, so it's a rewrite of `set_ordered_letters()`." + ] + }, + { + "cell_type": "code", + "execution_count": 49, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveSplit(PlayerAdaptivePattern):\n", + " def set_ordered_letters(self):\n", + " def letter_diff(l):\n", + " total = 0\n", + " for w in self.candidate_words:\n", + " if l in w:\n", + " total += 1\n", + " else:\n", + " total -= 1\n", + " return total\n", + " # return abs(sum(1 if l in w else -1 for w in self.candidate_words))\n", + " possible_letters = set(''.join(self.candidate_words))\n", + " letter_diffs = [(l, letter_diff(l)) for l in possible_letters]\n", + " self.ordered_letters = [p[0] for p in sorted(letter_diffs, key=lambda p: p[1])]" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "113\n", + "114\n", + "131\n", + "132\n", + "1 loops, best of 3: 2min 28s per loop\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveIncludedLettersRegex:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered):\n", - " exp = re.compile('^' + ''.join(discovered).replace('_', '.') + '$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 51 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveExcludedLettersRegex:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, missed):\n", - " if missed:\n", - " exp = re.compile('^[^' + ''.join(missed) + ']*$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 52 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "re.match('^[^xaz]*$', 'happy')" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 53 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptivePatternRegex:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered, missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", - " if attempted_letters:\n", - " exclusion_pattern = '[^' + ''.join(attempted_letters) + ']'\n", - " else:\n", - " exclusion_pattern = '.'\n", - " exp = re.compile('^' + ''.join(discovered).replace('_', exclusion_pattern) + '$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]\n" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 54 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveRegex:\n", - " def __init__(self, words):\n", - " self.candidate_words = words\n", - " \n", - " def guess(self, discovered, missed, lives):\n", - " self.filter_candidate_words(discovered, missed)\n", - " self.set_ordered_letters()\n", - " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " pass\n", - " \n", - " def set_ordered_letters(self):\n", - " counts = collections.Counter(l.lower() \n", - " for l in ''.join(self.candidate_words) + string.ascii_lowercase \n", - " if l in string.ascii_letters)\n", - " self.ordered_letters = [p[0] for p in counts.most_common()]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 55 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveLengthRegex(PlayerAdaptiveRegex):\n", - " def __init__(self, words):\n", - " super().__init__(words)\n", - " self.word_len = None\n", - " self.ordered_letters = None\n", - " \n", - " def filter_candidate_words(self, discovered, missed):\n", - " if not self.word_len:\n", - " self.word_len = len(discovered)\n", - " self.candidate_words = [w for w in self.candidate_words if len(w) == self.word_len]\n", - " \n", - " def set_ordered_letters(self):\n", - " if not self.ordered_letters:\n", - " super().set_ordered_letters()" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 56 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveIncludedLettersRegex(PlayerAdaptiveRegex):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " exp = re.compile('^' + ''.join(discovered).replace('_', '.') + '$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 57 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptiveExcludedLettersRegex(PlayerAdaptiveRegex):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " if missed:\n", - " exp = re.compile('^[^' + ''.join(missed) + ']*$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)] " - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 58 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "class PlayerAdaptivePatternRegex(PlayerAdaptiveRegex):\n", - " def filter_candidate_words(self, discovered, missed):\n", - " attempted_letters = [l for l in discovered if l != '_'] + missed\n", - " if attempted_letters:\n", - " exclusion_pattern = '[^' + ''.join(attempted_letters) + ']'\n", - " else:\n", - " exclusion_pattern = '.'\n", - " exp = re.compile('^' + ''.join(discovered).replace('_', exclusion_pattern) + '$')\n", - " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 59 } ], - "metadata": {} + "source": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveSplit(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Oh.\n", + "\n", + "Why is this happening?" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## See below for the regex-using versions" + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveIncludedLettersRegex:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered):\n", + " exp = re.compile('^' + ''.join(discovered).replace('_', '.') + '$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveExcludedLettersRegex:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, missed):\n", + " if missed:\n", + " exp = re.compile('^[^' + ''.join(missed) + ']*$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "re.match('^[^xaz]*$', 'happy')" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptivePatternRegex:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered, missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " attempted_letters = list(set(l.lower() for l in discovered + missed if l in string.ascii_letters))\n", + " if attempted_letters:\n", + " exclusion_pattern = '[^' + ''.join(attempted_letters) + ']'\n", + " else:\n", + " exclusion_pattern = '.'\n", + " exp = re.compile('^' + ''.join(discovered).replace('_', exclusion_pattern) + '$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() for l in ''.join(self.candidate_words) if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]\n" + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveRegex:\n", + " def __init__(self, words):\n", + " self.candidate_words = words\n", + " \n", + " def guess(self, discovered, missed, lives):\n", + " self.filter_candidate_words(discovered, missed)\n", + " self.set_ordered_letters()\n", + " return [l for l in self.ordered_letters if l not in discovered + missed][0]\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " pass\n", + " \n", + " def set_ordered_letters(self):\n", + " counts = collections.Counter(l.lower() \n", + " for l in ''.join(self.candidate_words) + string.ascii_lowercase \n", + " if l in string.ascii_letters)\n", + " self.ordered_letters = [p[0] for p in counts.most_common()]" + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveLengthRegex(PlayerAdaptiveRegex):\n", + " def __init__(self, words):\n", + " super().__init__(words)\n", + " self.word_len = None\n", + " self.ordered_letters = None\n", + " \n", + " def filter_candidate_words(self, discovered, missed):\n", + " if not self.word_len:\n", + " self.word_len = len(discovered)\n", + " self.candidate_words = [w for w in self.candidate_words if len(w) == self.word_len]\n", + " \n", + " def set_ordered_letters(self):\n", + " if not self.ordered_letters:\n", + " super().set_ordered_letters()" + ] + }, + { + "cell_type": "code", + "execution_count": 57, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveIncludedLettersRegex(PlayerAdaptiveRegex):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " exp = re.compile('^' + ''.join(discovered).replace('_', '.') + '$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]" + ] + }, + { + "cell_type": "code", + "execution_count": 58, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptiveExcludedLettersRegex(PlayerAdaptiveRegex):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " if missed:\n", + " exp = re.compile('^[^' + ''.join(missed) + ']*$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)] " + ] + }, + { + "cell_type": "code", + "execution_count": 59, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "class PlayerAdaptivePatternRegex(PlayerAdaptiveRegex):\n", + " def filter_candidate_words(self, discovered, missed):\n", + " attempted_letters = [l for l in discovered if l != '_'] + missed\n", + " if attempted_letters:\n", + " exclusion_pattern = '[^' + ''.join(attempted_letters) + ']'\n", + " else:\n", + " exclusion_pattern = '.'\n", + " exp = re.compile('^' + ''.join(discovered).replace('_', exclusion_pattern) + '$')\n", + " self.candidate_words = [w for w in self.candidate_words if exp.match(w)]" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" } - ] -} \ No newline at end of file + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/hangman/05-hangman-logging.ipynb b/hangman/05-hangman-logging.ipynb index b14dd0f..0e5ace3 100644 --- a/hangman/05-hangman-logging.ipynb +++ b/hangman/05-hangman-logging.ipynb @@ -1,5128 +1,5170 @@ { - "metadata": { - "name": "", - "signature": "sha256:319787fef945fe728683c1bd9cbdb783efff5e79fec8332f433ebca77395f16d" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "code", - "collapsed": false, - "input": [ - "from hangman import *\n", - "import csv" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 5 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "with open('fixed_alphabetical.csv', 'w', newline='') as csvfile:\n", - " gamewriter = csv.writer(csvfile)\n", - " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", - " for _ in range(100):\n", - " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", - " g.play_game()\n", - " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", - " len([l for l in g.discovered if l != '_']),\n", - " g.lives, g.game_won])" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 63 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "players = [(PlayerAlphabetical, None, 'fixed_alphabetical.csv'), \n", - " (PlayerAlphabeticalReversed, None, 'fixed_alphabetical_reversed.csv'), \n", - " (PlayerFreqOrdered, None, 'fixed_order.csv'),\n", - " (PlayerDictFreqOrdered, None, 'fixed_dict_order.csv'),\n", - " (PlayerAdaptiveLength, WORDS, 'adaptive_length.csv'),\n", - " (PlayerAdaptiveIncludedLetters, WORDS, 'adaptive_included.csv'),\n", - " (PlayerAdaptiveExcludedLetters, WORDS, 'adaptive_excluded.csv'),\n", - " (PlayerAdaptivePattern, WORDS, 'adaptive_pattern.csv'),\n", - " (PlayerAdaptiveSplit, WORDS, 'adaptive_split.csv')]\n", - "\n", - "games_per_player = 1000\n", - "\n", - "for p, a, f in players:\n", - " with open(f, 'w', newline='') as csvfile:\n", - " gamewriter = csv.writer(csvfile)\n", - " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", - " for _ in range(games_per_player):\n", - " if a:\n", - " player = p(a)\n", - " else:\n", - " player=p()\n", - " g = Game(random.choice(WORDS), player=player)\n", - " g.play_game()\n", - " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", - " len([l for l in g.discovered if l != '_']),\n", - " g.lives, g.game_won])" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 64 - }, + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "from hangman import *\n", + "import csv" + ] + }, + { + "cell_type": "code", + "execution_count": 63, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "with open('fixed_alphabetical.csv', 'w', newline='') as csvfile:\n", + " gamewriter = csv.writer(csvfile)\n", + " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", + " for _ in range(100):\n", + " g = Game(random.choice(WORDS), player=PlayerAlphabetical())\n", + " g.play_game()\n", + " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", + " len([l for l in g.discovered if l != '_']),\n", + " g.lives, g.game_won])" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "players = [(PlayerAlphabetical, None, 'fixed_alphabetical.csv'), \n", + " (PlayerAlphabeticalReversed, None, 'fixed_alphabetical_reversed.csv'), \n", + " (PlayerFreqOrdered, None, 'fixed_order.csv'),\n", + " (PlayerDictFreqOrdered, None, 'fixed_dict_order.csv'),\n", + " (PlayerAdaptiveLength, WORDS, 'adaptive_length.csv'),\n", + " (PlayerAdaptiveIncludedLetters, WORDS, 'adaptive_included.csv'),\n", + " (PlayerAdaptiveExcludedLetters, WORDS, 'adaptive_excluded.csv'),\n", + " (PlayerAdaptivePattern, WORDS, 'adaptive_pattern.csv'),\n", + " (PlayerAdaptiveSplit, WORDS, 'adaptive_split.csv')]\n", + "\n", + "games_per_player = 1000\n", + "\n", + "for p, a, f in players:\n", + " with open(f, 'w', newline='') as csvfile:\n", + " gamewriter = csv.writer(csvfile)\n", + " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", + " for _ in range(games_per_player):\n", + " if a:\n", + " player = p(a)\n", + " else:\n", + " player=p()\n", + " g = Game(random.choice(WORDS), player=player)\n", + " g.play_game()\n", + " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", + " len([l for l in g.discovered if l != '_']),\n", + " g.lives, g.game_won])" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "players = [(PlayerAdaptiveSplit, WORDS, 'adaptive_split.csv')]\n", + "\n", + "games_per_player = 1000\n", + "\n", + "for p, a, f in players:\n", + " with open(f, 'w', newline='') as csvfile:\n", + " gamewriter = csv.writer(csvfile)\n", + " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", + " for _ in range(games_per_player):\n", + " if a:\n", + " player = p(a)\n", + " else:\n", + " player=p()\n", + " g = Game(random.choice(WORDS), player=player)\n", + " g.play_game()\n", + " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", + " len([l for l in g.discovered if l != '_']),\n", + " g.lives, g.game_won])" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import matplotlib as mpl\n", + "import matplotlib.pyplot as plt\n", + "%matplotlib inline" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "players = [(PlayerAdaptiveSplit, WORDS, 'adaptive_split.csv')]\n", - "\n", - "games_per_player = 1000\n", - "\n", - "for p, a, f in players:\n", - " with open(f, 'w', newline='') as csvfile:\n", - " gamewriter = csv.writer(csvfile)\n", - " gamewriter.writerow([\"target\", \"discovered\", \"wrong letters\", \"number of hits\", \"lives remaining\", \"game won\"])\n", - " for _ in range(games_per_player):\n", - " if a:\n", - " player = p(a)\n", - " else:\n", - " player=p()\n", - " g = Game(random.choice(WORDS), player=player)\n", - " g.play_game()\n", - " gamewriter.writerow([g.target, g.discovered, g.wrong_letters, \n", - " len([l for l in g.discovered if l != '_']),\n", - " g.lives, g.game_won])" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 2 True
1 deject ['d', 'e', '_', 'e', '_', 't'] ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 0 False
2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 0 False
3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 0 False
4 legion ['l', 'e', '_', 'i', 'o', 'n'] ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False
5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 0 False
6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 0 False
7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 2 True
8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] ['o', 'i', 'h', 'n', 'r'] 7 5 True
9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... ['a', 'h', 'l', 'u', 'w'] 11 5 True
10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 0 False
11 goop ['_', 'o', 'o', '_'] ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 0 False
12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] ['a', 'i', 'n', 'd', 'l', 'u'] 8 4 True
13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 0 False
14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 1 True
15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 0 False
16 violet ['_', 'i', 'o', 'l', 'e', 't'] ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False
17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 3 True
18 inane ['i', 'n', 'a', 'n', 'e'] ['t', 'o', 'h'] 5 7 True
19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 0 False
20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 0 False
21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 0 False
22 ks ['_', 's'] ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 0 False
23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 2 True
24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 0 False
25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 0 False
26 manias ['m', 'a', 'n', 'i', 'a', 's'] ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 2 True
27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 1 True
28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 0 False
29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 0 False
.....................
970 toxic ['t', 'o', '_', 'i', '_'] ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 0 False
971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 0 False
972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 0 False
973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... ['t', 's', 'r', 'd', 'u', 'w'] 11 4 True
974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... ['o', 'r', 'd', 'l'] 11 6 True
975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 0 False
976 lakes ['l', 'a', '_', 'e', 's'] ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 0 False
977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 0 False
978 taking ['t', 'a', '_', 'i', 'n', '_'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 0 False
979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 1 True
980 refile ['r', 'e', '_', 'i', 'l', 'e'] ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 0 False
981 unkind ['u', 'n', '_', 'i', 'n', 'd'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 0 False
982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 0 False
983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 0 False
984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... ['t', 'o', 'h', 's', 'l', 'u'] 11 4 True
985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 0 False
986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 0 False
987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 0 False
988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] ['t', 'o', 'i', 'h', 'r'] 7 5 True
989 white ['w', 'h', 'i', 't', 'e'] ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 1 True
990 arena ['a', 'r', 'e', 'n', 'a'] ['t', 'o', 'i', 'h', 's'] 5 5 True
991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] ['t', 'o', 'i', 'h', 'n', 'd'] 7 4 True
992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 0 False
993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... ['o', 'i', 'h', 'r', 'd'] 10 5 True
994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... ['h', 'd', 'l', 'u', 'm', 'w'] 10 4 True
995 safari ['s', 'a', '_', 'a', 'r', 'i'] ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 0 False
996 recap ['r', 'e', '_', 'a', '_'] ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 0 False
997 torts ['t', 'o', 'r', 't', 's'] ['e', 'a', 'i', 'h', 'n'] 5 5 True
998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 3 True
999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 0 False
\n", + "

1000 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... \n", + "1 deject ['d', 'e', '_', 'e', '_', 't'] \n", + "2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] \n", + "3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... \n", + "4 legion ['l', 'e', '_', 'i', 'o', 'n'] \n", + "5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... \n", + "6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] \n", + "7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] \n", + "8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] \n", + "9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... \n", + "10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] \n", + "11 goop ['_', 'o', 'o', '_'] \n", + "12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] \n", + "13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... \n", + "14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... \n", + "15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] \n", + "16 violet ['_', 'i', 'o', 'l', 'e', 't'] \n", + "17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... \n", + "18 inane ['i', 'n', 'a', 'n', 'e'] \n", + "19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] \n", + "20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... \n", + "21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] \n", + "22 ks ['_', 's'] \n", + "23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] \n", + "24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... \n", + "25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... \n", + "26 manias ['m', 'a', 'n', 'i', 'a', 's'] \n", + "27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... \n", + "28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... \n", + "29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] \n", + ".. ... ... \n", + "970 toxic ['t', 'o', '_', 'i', '_'] \n", + "971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... \n", + "972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] \n", + "973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... \n", + "974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... \n", + "975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] \n", + "976 lakes ['l', 'a', '_', 'e', 's'] \n", + "977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... \n", + "978 taking ['t', 'a', '_', 'i', 'n', '_'] \n", + "979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] \n", + "980 refile ['r', 'e', '_', 'i', 'l', 'e'] \n", + "981 unkind ['u', 'n', '_', 'i', 'n', 'd'] \n", + "982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] \n", + "983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] \n", + "984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... \n", + "985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] \n", + "986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] \n", + "987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... \n", + "988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] \n", + "989 white ['w', 'h', 'i', 't', 'e'] \n", + "990 arena ['a', 'r', 'e', 'n', 'a'] \n", + "991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] \n", + "992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] \n", + "993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... \n", + "994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... \n", + "995 safari ['s', 'a', '_', 'a', 'r', 'i'] \n", + "996 recap ['r', 'e', '_', 'a', '_'] \n", + "997 torts ['t', 'o', 'r', 't', 's'] \n", + "998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... \n", + "999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... \n", + "\n", + " wrong letters number of hits \\\n", + "0 ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 \n", + "1 ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 \n", + "2 ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 \n", + "3 ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 \n", + "4 ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", + "5 ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 \n", + "6 ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 \n", + "7 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 \n", + "8 ['o', 'i', 'h', 'n', 'r'] 7 \n", + "9 ['a', 'h', 'l', 'u', 'w'] 11 \n", + "10 ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 \n", + "11 ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 \n", + "12 ['a', 'i', 'n', 'd', 'l', 'u'] 8 \n", + "13 ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 \n", + "14 ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 \n", + "15 ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 \n", + "16 ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", + "17 ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 \n", + "18 ['t', 'o', 'h'] 5 \n", + "19 ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 \n", + "20 ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 \n", + "21 ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 \n", + "22 ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 \n", + "23 ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 \n", + "24 ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 \n", + "25 ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 \n", + "26 ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 \n", + "27 ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 \n", + "28 ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 \n", + "29 ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 \n", + ".. ... ... \n", + "970 ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 \n", + "971 ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 \n", + "972 ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 \n", + "973 ['t', 's', 'r', 'd', 'u', 'w'] 11 \n", + "974 ['o', 'r', 'd', 'l'] 11 \n", + "975 ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 \n", + "976 ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 \n", + "977 ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 \n", + "978 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 \n", + "979 ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 \n", + "980 ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 \n", + "981 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 \n", + "982 ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 \n", + "983 ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 \n", + "984 ['t', 'o', 'h', 's', 'l', 'u'] 11 \n", + "985 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 \n", + "986 ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 \n", + "987 ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 \n", + "988 ['t', 'o', 'i', 'h', 'r'] 7 \n", + "989 ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 \n", + "990 ['t', 'o', 'i', 'h', 's'] 5 \n", + "991 ['t', 'o', 'i', 'h', 'n', 'd'] 7 \n", + "992 ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 \n", + "993 ['o', 'i', 'h', 'r', 'd'] 10 \n", + "994 ['h', 'd', 'l', 'u', 'm', 'w'] 10 \n", + "995 ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 \n", + "996 ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 \n", + "997 ['e', 'a', 'i', 'h', 'n'] 5 \n", + "998 ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 \n", + "999 ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 \n", + "\n", + " lives remaining game won \n", + "0 2 True \n", + "1 0 False \n", + "2 0 False \n", + "3 0 False \n", + "4 0 False \n", + "5 0 False \n", + "6 0 False \n", + "7 2 True \n", + "8 5 True \n", + "9 5 True \n", + "10 0 False \n", + "11 0 False \n", + "12 4 True \n", + "13 0 False \n", + "14 1 True \n", + "15 0 False \n", + "16 0 False \n", + "17 3 True \n", + "18 7 True \n", + "19 0 False \n", + "20 0 False \n", + "21 0 False \n", + "22 0 False \n", + "23 2 True \n", + "24 0 False \n", + "25 0 False \n", + "26 2 True \n", + "27 1 True \n", + "28 0 False \n", + "29 0 False \n", + ".. ... ... \n", + "970 0 False \n", + "971 0 False \n", + "972 0 False \n", + "973 4 True \n", + "974 6 True \n", + "975 0 False \n", + "976 0 False \n", + "977 0 False \n", + "978 0 False \n", + "979 1 True \n", + "980 0 False \n", + "981 0 False \n", + "982 0 False \n", + "983 0 False \n", + "984 4 True \n", + "985 0 False \n", + "986 0 False \n", + "987 0 False \n", + "988 5 True \n", + "989 1 True \n", + "990 5 True \n", + "991 4 True \n", + "992 0 False \n", + "993 5 True \n", + "994 4 True \n", + "995 0 False \n", + "996 0 False \n", + "997 5 True \n", + "998 3 True \n", + "999 0 False \n", + "\n", + "[1000 rows x 6 columns]" + ] + }, + "execution_count": 8, "metadata": {}, - "outputs": [], - "prompt_number": 6 - }, + "output_type": "execute_result" + } + ], + "source": [ + "fixed_order = pd.read_csv('fixed_order.csv')\n", + "fixed_order" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "import pandas as pd\n", - "import matplotlib as mpl\n", - "import matplotlib.pyplot as plt\n", - "%matplotlib inline" - ], - "language": "python", + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 9, "metadata": {}, - "outputs": [], - "prompt_number": 7 - }, + "output_type": "execute_result" + } + ], + "source": [ + "len(fixed_order['discovered'][0].split(','))" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "fixed_order = pd.read_csv('fixed_order.csv')\n", - "fixed_order" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 2 True 10
1 deject ['d', 'e', '_', 'e', '_', 't'] ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 0 False 6
2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 0 False 9
3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 0 False 10
4 legion ['l', 'e', '_', 'i', 'o', 'n'] ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False 6
5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 0 False 11
6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 0 False 7
7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 2 True 8
8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] ['o', 'i', 'h', 'n', 'r'] 7 5 True 7
9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... ['a', 'h', 'l', 'u', 'w'] 11 5 True 11
10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 0 False 7
11 goop ['_', 'o', 'o', '_'] ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 0 False 4
12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] ['a', 'i', 'n', 'd', 'l', 'u'] 8 4 True 8
13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 0 False 10
14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 1 True 10
15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 0 False 8
16 violet ['_', 'i', 'o', 'l', 'e', 't'] ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False 6
17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 3 True 14
18 inane ['i', 'n', 'a', 'n', 'e'] ['t', 'o', 'h'] 5 7 True 5
19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 0 False 7
20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 0 False 11
21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 0 False 9
22 ks ['_', 's'] ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 0 False 2
23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 2 True 8
24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 0 False 10
25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 0 False 11
26 manias ['m', 'a', 'n', 'i', 'a', 's'] ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 2 True 6
27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 1 True 11
28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 0 False 12
29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 0 False 9
........................
970 toxic ['t', 'o', '_', 'i', '_'] ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 0 False 5
971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 0 False 11
972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 0 False 7
973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... ['t', 's', 'r', 'd', 'u', 'w'] 11 4 True 11
974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... ['o', 'r', 'd', 'l'] 11 6 True 11
975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 0 False 7
976 lakes ['l', 'a', '_', 'e', 's'] ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 0 False 5
977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 0 False 14
978 taking ['t', 'a', '_', 'i', 'n', '_'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 0 False 6
979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 1 True 8
980 refile ['r', 'e', '_', 'i', 'l', 'e'] ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 0 False 6
981 unkind ['u', 'n', '_', 'i', 'n', 'd'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 0 False 6
982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 0 False 9
983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 0 False 7
984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... ['t', 'o', 'h', 's', 'l', 'u'] 11 4 True 11
985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 0 False 7
986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 0 False 9
987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 0 False 10
988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] ['t', 'o', 'i', 'h', 'r'] 7 5 True 7
989 white ['w', 'h', 'i', 't', 'e'] ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 1 True 5
990 arena ['a', 'r', 'e', 'n', 'a'] ['t', 'o', 'i', 'h', 's'] 5 5 True 5
991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] ['t', 'o', 'i', 'h', 'n', 'd'] 7 4 True 7
992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 0 False 8
993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... ['o', 'i', 'h', 'r', 'd'] 10 5 True 10
994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... ['h', 'd', 'l', 'u', 'm', 'w'] 10 4 True 10
995 safari ['s', 'a', '_', 'a', 'r', 'i'] ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 0 False 6
996 recap ['r', 'e', '_', 'a', '_'] ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 0 False 5
997 torts ['t', 'o', 'r', 't', 's'] ['e', 'a', 'i', 'h', 'n'] 5 5 True 5
998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 3 True 10
999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 0 False 11
\n", + "

1000 rows × 7 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... \n", + "1 deject ['d', 'e', '_', 'e', '_', 't'] \n", + "2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] \n", + "3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... \n", + "4 legion ['l', 'e', '_', 'i', 'o', 'n'] \n", + "5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... \n", + "6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] \n", + "7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] \n", + "8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] \n", + "9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... \n", + "10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] \n", + "11 goop ['_', 'o', 'o', '_'] \n", + "12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] \n", + "13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... \n", + "14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... \n", + "15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] \n", + "16 violet ['_', 'i', 'o', 'l', 'e', 't'] \n", + "17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... \n", + "18 inane ['i', 'n', 'a', 'n', 'e'] \n", + "19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] \n", + "20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... \n", + "21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] \n", + "22 ks ['_', 's'] \n", + "23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] \n", + "24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... \n", + "25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... \n", + "26 manias ['m', 'a', 'n', 'i', 'a', 's'] \n", + "27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... \n", + "28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... \n", + "29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] \n", + ".. ... ... \n", + "970 toxic ['t', 'o', '_', 'i', '_'] \n", + "971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... \n", + "972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] \n", + "973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... \n", + "974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... \n", + "975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] \n", + "976 lakes ['l', 'a', '_', 'e', 's'] \n", + "977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... \n", + "978 taking ['t', 'a', '_', 'i', 'n', '_'] \n", + "979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] \n", + "980 refile ['r', 'e', '_', 'i', 'l', 'e'] \n", + "981 unkind ['u', 'n', '_', 'i', 'n', 'd'] \n", + "982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] \n", + "983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] \n", + "984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... \n", + "985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] \n", + "986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] \n", + "987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... \n", + "988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] \n", + "989 white ['w', 'h', 'i', 't', 'e'] \n", + "990 arena ['a', 'r', 'e', 'n', 'a'] \n", + "991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] \n", + "992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] \n", + "993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... \n", + "994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... \n", + "995 safari ['s', 'a', '_', 'a', 'r', 'i'] \n", + "996 recap ['r', 'e', '_', 'a', '_'] \n", + "997 torts ['t', 'o', 'r', 't', 's'] \n", + "998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... \n", + "999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... \n", + "\n", + " wrong letters number of hits \\\n", + "0 ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 \n", + "1 ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 \n", + "2 ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 \n", + "3 ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 \n", + "4 ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", + "5 ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 \n", + "6 ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 \n", + "7 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 \n", + "8 ['o', 'i', 'h', 'n', 'r'] 7 \n", + "9 ['a', 'h', 'l', 'u', 'w'] 11 \n", + "10 ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 \n", + "11 ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 \n", + "12 ['a', 'i', 'n', 'd', 'l', 'u'] 8 \n", + "13 ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 \n", + "14 ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 \n", + "15 ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 \n", + "16 ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", + "17 ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 \n", + "18 ['t', 'o', 'h'] 5 \n", + "19 ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 \n", + "20 ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 \n", + "21 ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 \n", + "22 ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 \n", + "23 ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 \n", + "24 ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 \n", + "25 ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 \n", + "26 ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 \n", + "27 ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 \n", + "28 ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 \n", + "29 ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 \n", + ".. ... ... \n", + "970 ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 \n", + "971 ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 \n", + "972 ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 \n", + "973 ['t', 's', 'r', 'd', 'u', 'w'] 11 \n", + "974 ['o', 'r', 'd', 'l'] 11 \n", + "975 ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 \n", + "976 ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 \n", + "977 ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 \n", + "978 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 \n", + "979 ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 \n", + "980 ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 \n", + "981 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 \n", + "982 ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 \n", + "983 ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 \n", + "984 ['t', 'o', 'h', 's', 'l', 'u'] 11 \n", + "985 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 \n", + "986 ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 \n", + "987 ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 \n", + "988 ['t', 'o', 'i', 'h', 'r'] 7 \n", + "989 ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 \n", + "990 ['t', 'o', 'i', 'h', 's'] 5 \n", + "991 ['t', 'o', 'i', 'h', 'n', 'd'] 7 \n", + "992 ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 \n", + "993 ['o', 'i', 'h', 'r', 'd'] 10 \n", + "994 ['h', 'd', 'l', 'u', 'm', 'w'] 10 \n", + "995 ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 \n", + "996 ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 \n", + "997 ['e', 'a', 'i', 'h', 'n'] 5 \n", + "998 ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 \n", + "999 ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 \n", + "\n", + " lives remaining game won word length \n", + "0 2 True 10 \n", + "1 0 False 6 \n", + "2 0 False 9 \n", + "3 0 False 10 \n", + "4 0 False 6 \n", + "5 0 False 11 \n", + "6 0 False 7 \n", + "7 2 True 8 \n", + "8 5 True 7 \n", + "9 5 True 11 \n", + "10 0 False 7 \n", + "11 0 False 4 \n", + "12 4 True 8 \n", + "13 0 False 10 \n", + "14 1 True 10 \n", + "15 0 False 8 \n", + "16 0 False 6 \n", + "17 3 True 14 \n", + "18 7 True 5 \n", + "19 0 False 7 \n", + "20 0 False 11 \n", + "21 0 False 9 \n", + "22 0 False 2 \n", + "23 2 True 8 \n", + "24 0 False 10 \n", + "25 0 False 11 \n", + "26 2 True 6 \n", + "27 1 True 11 \n", + "28 0 False 12 \n", + "29 0 False 9 \n", + ".. ... ... ... \n", + "970 0 False 5 \n", + "971 0 False 11 \n", + "972 0 False 7 \n", + "973 4 True 11 \n", + "974 6 True 11 \n", + "975 0 False 7 \n", + "976 0 False 5 \n", + "977 0 False 14 \n", + "978 0 False 6 \n", + "979 1 True 8 \n", + "980 0 False 6 \n", + "981 0 False 6 \n", + "982 0 False 9 \n", + "983 0 False 7 \n", + "984 4 True 11 \n", + "985 0 False 7 \n", + "986 0 False 9 \n", + "987 0 False 10 \n", + "988 5 True 7 \n", + "989 1 True 5 \n", + "990 5 True 5 \n", + "991 4 True 7 \n", + "992 0 False 8 \n", + "993 5 True 10 \n", + "994 4 True 10 \n", + "995 0 False 6 \n", + "996 0 False 5 \n", + "997 5 True 5 \n", + "998 3 True 10 \n", + "999 0 False 11 \n", + "\n", + "[1000 rows x 7 columns]" + ] + }, + "execution_count": 10, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 2 True
1 deject ['d', 'e', '_', 'e', '_', 't'] ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 0 False
2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 0 False
3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 0 False
4 legion ['l', 'e', '_', 'i', 'o', 'n'] ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False
5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 0 False
6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 0 False
7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 2 True
8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] ['o', 'i', 'h', 'n', 'r'] 7 5 True
9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... ['a', 'h', 'l', 'u', 'w'] 11 5 True
10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 0 False
11 goop ['_', 'o', 'o', '_'] ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 0 False
12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] ['a', 'i', 'n', 'd', 'l', 'u'] 8 4 True
13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 0 False
14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 1 True
15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 0 False
16 violet ['_', 'i', 'o', 'l', 'e', 't'] ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False
17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 3 True
18 inane ['i', 'n', 'a', 'n', 'e'] ['t', 'o', 'h'] 5 7 True
19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 0 False
20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 0 False
21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 0 False
22 ks ['_', 's'] ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 0 False
23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 2 True
24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 0 False
25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 0 False
26 manias ['m', 'a', 'n', 'i', 'a', 's'] ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 2 True
27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 1 True
28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 0 False
29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 0 False
.....................
970 toxic ['t', 'o', '_', 'i', '_'] ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 0 False
971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 0 False
972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 0 False
973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... ['t', 's', 'r', 'd', 'u', 'w'] 11 4 True
974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... ['o', 'r', 'd', 'l'] 11 6 True
975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 0 False
976 lakes ['l', 'a', '_', 'e', 's'] ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 0 False
977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 0 False
978 taking ['t', 'a', '_', 'i', 'n', '_'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 0 False
979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 1 True
980 refile ['r', 'e', '_', 'i', 'l', 'e'] ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 0 False
981 unkind ['u', 'n', '_', 'i', 'n', 'd'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 0 False
982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 0 False
983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 0 False
984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... ['t', 'o', 'h', 's', 'l', 'u'] 11 4 True
985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 0 False
986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 0 False
987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 0 False
988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] ['t', 'o', 'i', 'h', 'r'] 7 5 True
989 white ['w', 'h', 'i', 't', 'e'] ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 1 True
990 arena ['a', 'r', 'e', 'n', 'a'] ['t', 'o', 'i', 'h', 's'] 5 5 True
991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] ['t', 'o', 'i', 'h', 'n', 'd'] 7 4 True
992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 0 False
993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... ['o', 'i', 'h', 'r', 'd'] 10 5 True
994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... ['h', 'd', 'l', 'u', 'm', 'w'] 10 4 True
995 safari ['s', 'a', '_', 'a', 'r', 'i'] ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 0 False
996 recap ['r', 'e', '_', 'a', '_'] ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 0 False
997 torts ['t', 'o', 'r', 't', 's'] ['e', 'a', 'i', 'h', 'n'] 5 5 True
998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 3 True
999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 0 False
\n", - "

1000 rows \u00d7 6 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 8, - "text": [ - " target discovered \\\n", - "0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... \n", - "1 deject ['d', 'e', '_', 'e', '_', 't'] \n", - "2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] \n", - "3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... \n", - "4 legion ['l', 'e', '_', 'i', 'o', 'n'] \n", - "5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... \n", - "6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] \n", - "7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] \n", - "8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] \n", - "9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... \n", - "10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] \n", - "11 goop ['_', 'o', 'o', '_'] \n", - "12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] \n", - "13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... \n", - "14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... \n", - "15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] \n", - "16 violet ['_', 'i', 'o', 'l', 'e', 't'] \n", - "17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... \n", - "18 inane ['i', 'n', 'a', 'n', 'e'] \n", - "19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] \n", - "20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... \n", - "21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] \n", - "22 ks ['_', 's'] \n", - "23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] \n", - "24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... \n", - "25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... \n", - "26 manias ['m', 'a', 'n', 'i', 'a', 's'] \n", - "27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... \n", - "28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... \n", - "29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] \n", - ".. ... ... \n", - "970 toxic ['t', 'o', '_', 'i', '_'] \n", - "971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... \n", - "972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] \n", - "973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... \n", - "974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... \n", - "975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] \n", - "976 lakes ['l', 'a', '_', 'e', 's'] \n", - "977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... \n", - "978 taking ['t', 'a', '_', 'i', 'n', '_'] \n", - "979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] \n", - "980 refile ['r', 'e', '_', 'i', 'l', 'e'] \n", - "981 unkind ['u', 'n', '_', 'i', 'n', 'd'] \n", - "982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] \n", - "983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] \n", - "984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... \n", - "985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] \n", - "986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] \n", - "987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... \n", - "988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] \n", - "989 white ['w', 'h', 'i', 't', 'e'] \n", - "990 arena ['a', 'r', 'e', 'n', 'a'] \n", - "991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] \n", - "992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] \n", - "993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... \n", - "994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... \n", - "995 safari ['s', 'a', '_', 'a', 'r', 'i'] \n", - "996 recap ['r', 'e', '_', 'a', '_'] \n", - "997 torts ['t', 'o', 'r', 't', 's'] \n", - "998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... \n", - "999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... \n", - "\n", - " wrong letters number of hits \\\n", - "0 ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 \n", - "1 ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 \n", - "2 ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 \n", - "3 ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 \n", - "4 ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", - "5 ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 \n", - "6 ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 \n", - "7 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 \n", - "8 ['o', 'i', 'h', 'n', 'r'] 7 \n", - "9 ['a', 'h', 'l', 'u', 'w'] 11 \n", - "10 ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 \n", - "11 ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 \n", - "12 ['a', 'i', 'n', 'd', 'l', 'u'] 8 \n", - "13 ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 \n", - "14 ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 \n", - "15 ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 \n", - "16 ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", - "17 ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 \n", - "18 ['t', 'o', 'h'] 5 \n", - "19 ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 \n", - "20 ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 \n", - "21 ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 \n", - "22 ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 \n", - "23 ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 \n", - "24 ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 \n", - "25 ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 \n", - "26 ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 \n", - "27 ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 \n", - "28 ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 \n", - "29 ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 \n", - ".. ... ... \n", - "970 ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 \n", - "971 ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 \n", - "972 ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 \n", - "973 ['t', 's', 'r', 'd', 'u', 'w'] 11 \n", - "974 ['o', 'r', 'd', 'l'] 11 \n", - "975 ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 \n", - "976 ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 \n", - "977 ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 \n", - "978 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 \n", - "979 ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 \n", - "980 ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 \n", - "981 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 \n", - "982 ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 \n", - "983 ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 \n", - "984 ['t', 'o', 'h', 's', 'l', 'u'] 11 \n", - "985 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 \n", - "986 ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 \n", - "987 ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 \n", - "988 ['t', 'o', 'i', 'h', 'r'] 7 \n", - "989 ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 \n", - "990 ['t', 'o', 'i', 'h', 's'] 5 \n", - "991 ['t', 'o', 'i', 'h', 'n', 'd'] 7 \n", - "992 ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 \n", - "993 ['o', 'i', 'h', 'r', 'd'] 10 \n", - "994 ['h', 'd', 'l', 'u', 'm', 'w'] 10 \n", - "995 ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 \n", - "996 ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 \n", - "997 ['e', 'a', 'i', 'h', 'n'] 5 \n", - "998 ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 \n", - "999 ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 \n", - "\n", - " lives remaining game won \n", - "0 2 True \n", - "1 0 False \n", - "2 0 False \n", - "3 0 False \n", - "4 0 False \n", - "5 0 False \n", - "6 0 False \n", - "7 2 True \n", - "8 5 True \n", - "9 5 True \n", - "10 0 False \n", - "11 0 False \n", - "12 4 True \n", - "13 0 False \n", - "14 1 True \n", - "15 0 False \n", - "16 0 False \n", - "17 3 True \n", - "18 7 True \n", - "19 0 False \n", - "20 0 False \n", - "21 0 False \n", - "22 0 False \n", - "23 2 True \n", - "24 0 False \n", - "25 0 False \n", - "26 2 True \n", - "27 1 True \n", - "28 0 False \n", - "29 0 False \n", - ".. ... ... \n", - "970 0 False \n", - "971 0 False \n", - "972 0 False \n", - "973 4 True \n", - "974 6 True \n", - "975 0 False \n", - "976 0 False \n", - "977 0 False \n", - "978 0 False \n", - "979 1 True \n", - "980 0 False \n", - "981 0 False \n", - "982 0 False \n", - "983 0 False \n", - "984 4 True \n", - "985 0 False \n", - "986 0 False \n", - "987 0 False \n", - "988 5 True \n", - "989 1 True \n", - "990 5 True \n", - "991 4 True \n", - "992 0 False \n", - "993 5 True \n", - "994 4 True \n", - "995 0 False \n", - "996 0 False \n", - "997 5 True \n", - "998 3 True \n", - "999 0 False \n", - "\n", - "[1000 rows x 6 columns]" - ] - } - ], - "prompt_number": 8 - }, + "output_type": "execute_result" + } + ], + "source": [ + "fixed_order['word length'] = fixed_order.apply(lambda r: len(r['target']), axis=1)\n", + "fixed_order" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "len(fixed_order['discovered'][0].split(','))" - ], - "language": "python", + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 11, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 9, - "text": [ - "10" - ] - } - ], - "prompt_number": 9 + "output_type": "execute_result" }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "fixed_order['word length'] = fixed_order.apply(lambda r: len(r['target']), axis=1)\n", - "fixed_order" - ], - "language": "python", + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFU1JREFUeJzt3X2QVXd9x/E3CaEx5AEYOwRIMpdqMGXGig9Ep2pdKWFM\nxkD+qjhtZ7Gt/9BWO04VaKeD/xQpM534R6f/aJPFqaD4UIbYCU1Qrsbagg+5GrOhAetOsyasodGY\nEFMJbP/4/WAvO+zZc5dz93d+975fM3fOw3365G747uFzz72AJEmSJEmSJEmSJEmSJElSFl4HPNp2\neR74ELAIeBh4EngIWNB2n23AceAYsG42w0qSyrsCeAa4GdgFfCzu3wLsjOsrgRZwFdAATsT7SZJq\nZh3wSFw/BiyO6zfGbQhH6Vva7nMQeNuspJOkPtfpEfRGYG9cXwyMxfUxJgb8UmC07T6jwLKZBpQk\nldfJUJ8H3A184RLXjcfLVIqukyRVZG4Ht70T+C7wbNweI9QuJ4ElwE/j/p8QOvfzbor7Lli6dOn4\n008/PZO8ktTPfgS8tugGnRypv5+J6gXgADAY1weB/W37NxKO7JcDtwJH2x/o6aefZnx8vPaX7du3\nJ89gTnPmmtGc1V+A10w3qMseqc8H1gIfbNu3E9gH/DEwAvxe3D8c9w8DrwCbybR+GRkZSR2hFHNW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2Jo0UbF5wN3AF1IHuYTXAH9BOHBbSvjz/vtT3Xi2h/pP\nuLivuplwtK6Zuwr4EvDPwP7EWabzPPCvwFtSB7mE3wbWE/rqvcAa4DNJE03tmbh8FvgXQq1ZN6Px\n8u24/UXCcK+rO4HvEl7TunkL8C3gfwk11pcJ/7/WQk4fTGpQ/zdK5xAGz72pgxR4NeEsCIBXAd8A\nfjddnFLeRX3PfrkGuC6uzwf+HViXLk6hbwAr4vrHufhT5XXzOQrefEzsDYSz215F+DO/m/A3tNrI\n4YNJewnd1f8R3gP4QNo4U3oHodpoMXFK1nsK7zH7Xk/oVFuE0/A+mjZOKe+ivme/LCe8li3CH/S6\n/hmCMIy+DXyfcHRZ17Nf5gOnmPhlWUcfY+KUxt2Ev6FLkiRJkiRJkiRJkiRJkiRJkiRJUnn/D7pn\ntnpo7g5vAAAAAElFTkSuQmCC\n", + "text/plain": [ + "" + ] + }, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 2 True 10
1 deject ['d', 'e', '_', 'e', '_', 't'] ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 0 False 6
2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 0 False 9
3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 0 False 10
4 legion ['l', 'e', '_', 'i', 'o', 'n'] ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False 6
5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 0 False 11
6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 0 False 7
7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 2 True 8
8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] ['o', 'i', 'h', 'n', 'r'] 7 5 True 7
9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... ['a', 'h', 'l', 'u', 'w'] 11 5 True 11
10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 0 False 7
11 goop ['_', 'o', 'o', '_'] ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 0 False 4
12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] ['a', 'i', 'n', 'd', 'l', 'u'] 8 4 True 8
13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 0 False 10
14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 1 True 10
15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 0 False 8
16 violet ['_', 'i', 'o', 'l', 'e', 't'] ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 0 False 6
17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 3 True 14
18 inane ['i', 'n', 'a', 'n', 'e'] ['t', 'o', 'h'] 5 7 True 5
19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 0 False 7
20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 0 False 11
21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 0 False 9
22 ks ['_', 's'] ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 0 False 2
23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 2 True 8
24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 0 False 10
25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 0 False 11
26 manias ['m', 'a', 'n', 'i', 'a', 's'] ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 2 True 6
27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 1 True 11
28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 0 False 12
29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 0 False 9
........................
970 toxic ['t', 'o', '_', 'i', '_'] ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 0 False 5
971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 0 False 11
972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 0 False 7
973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... ['t', 's', 'r', 'd', 'u', 'w'] 11 4 True 11
974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... ['o', 'r', 'd', 'l'] 11 6 True 11
975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 0 False 7
976 lakes ['l', 'a', '_', 'e', 's'] ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 0 False 5
977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 0 False 14
978 taking ['t', 'a', '_', 'i', 'n', '_'] ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 0 False 6
979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 1 True 8
980 refile ['r', 'e', '_', 'i', 'l', 'e'] ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 0 False 6
981 unkind ['u', 'n', '_', 'i', 'n', 'd'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 0 False 6
982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 0 False 9
983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 0 False 7
984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... ['t', 'o', 'h', 's', 'l', 'u'] 11 4 True 11
985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 0 False 7
986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 0 False 9
987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 0 False 10
988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] ['t', 'o', 'i', 'h', 'r'] 7 5 True 7
989 white ['w', 'h', 'i', 't', 'e'] ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 1 True 5
990 arena ['a', 'r', 'e', 'n', 'a'] ['t', 'o', 'i', 'h', 's'] 5 5 True 5
991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] ['t', 'o', 'i', 'h', 'n', 'd'] 7 4 True 7
992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 0 False 8
993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... ['o', 'i', 'h', 'r', 'd'] 10 5 True 10
994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... ['h', 'd', 'l', 'u', 'm', 'w'] 10 4 True 10
995 safari ['s', 'a', '_', 'a', 'r', 'i'] ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 0 False 6
996 recap ['r', 'e', '_', 'a', '_'] ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 0 False 5
997 torts ['t', 'o', 'r', 't', 's'] ['e', 'a', 'i', 'h', 'n'] 5 5 True 5
998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 3 True 10
999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 0 False 11
\n", - "

1000 rows \u00d7 7 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 10, - "text": [ - " target discovered \\\n", - "0 mouldering ['m', 'o', 'u', 'l', 'd', 'e', 'r', 'i', 'n', ... \n", - "1 deject ['d', 'e', '_', 'e', '_', 't'] \n", - "2 lipsticks ['l', 'i', '_', 's', 't', 'i', '_', '_', 's'] \n", - "3 disparaged ['d', 'i', 's', '_', 'a', 'r', 'a', '_', 'e', ... \n", - "4 legion ['l', 'e', '_', 'i', 'o', 'n'] \n", - "5 fabricating ['_', 'a', '_', 'r', 'i', 'c', 'a', 't', 'i', ... \n", - "6 nicking ['n', 'i', '_', '_', 'i', 'n', '_'] \n", - "7 actinium ['a', 'c', 't', 'i', 'n', 'i', 'u', 'm'] \n", - "8 sedates ['s', 'e', 'd', 'a', 't', 'e', 's'] \n", - "9 modernistic ['m', 'o', 'd', 'e', 'r', 'n', 'i', 's', 't', ... \n", - "10 grouchy ['_', 'r', 'o', 'u', '_', 'h', '_'] \n", - "11 goop ['_', 'o', 'o', '_'] \n", - "12 theorems ['t', 'h', 'e', 'o', 'r', 'e', 'm', 's'] \n", - "13 panickiest ['_', 'a', 'n', 'i', 'c', '_', 'i', 'e', 's', ... \n", - "14 rightfully ['r', 'i', 'g', 'h', 't', 'f', 'u', 'l', 'l', ... \n", - "15 esquires ['e', 's', '_', 'u', 'i', 'r', 'e', 's'] \n", - "16 violet ['_', 'i', 'o', 'l', 'e', 't'] \n", - "17 dermatologists ['d', 'e', 'r', 'm', 'a', 't', 'o', 'l', 'o', ... \n", - "18 inane ['i', 'n', 'a', 'n', 'e'] \n", - "19 bonkers ['_', 'o', 'n', '_', 'e', 'r', 's'] \n", - "20 reassigning ['r', 'e', 'a', 's', 's', 'i', '_', 'n', 'i', ... \n", - "21 sweatshop ['s', 'w', 'e', 'a', 't', 's', 'h', 'o', '_'] \n", - "22 ks ['_', 's'] \n", - "23 outcomes ['o', 'u', 't', 'c', 'o', 'm', 'e', 's'] \n", - "24 parenthood ['_', 'a', 'r', 'e', 'n', 't', 'h', 'o', 'o', ... \n", - "25 frequencies ['f', 'r', 'e', '_', 'u', 'e', 'n', 'c', 'i', ... \n", - "26 manias ['m', 'a', 'n', 'i', 'a', 's'] \n", - "27 resupplying ['r', 'e', 's', 'u', 'p', 'p', 'l', 'y', 'i', ... \n", - "28 subcontinent ['s', 'u', '_', 'c', 'o', 'n', 't', 'i', 'n', ... \n", - "29 baptismal ['_', 'a', '_', 't', 'i', 's', 'm', 'a', 'l'] \n", - ".. ... ... \n", - "970 toxic ['t', 'o', '_', 'i', '_'] \n", - "971 brigantines ['_', 'r', 'i', '_', 'a', 'n', 't', 'i', 'n', ... \n", - "972 imagery ['i', 'm', 'a', '_', 'e', 'r', '_'] \n", - "973 melancholic ['m', 'e', 'l', 'a', 'n', 'c', 'h', 'o', 'l', ... \n", - "974 enthusiasms ['e', 'n', 't', 'h', 'u', 's', 'i', 'a', 's', ... \n", - "975 abraded ['a', '_', 'r', 'a', 'd', 'e', 'd'] \n", - "976 lakes ['l', 'a', '_', 'e', 's'] \n", - "977 telepathically ['t', 'e', 'l', 'e', '_', 'a', 't', 'h', 'i', ... \n", - "978 taking ['t', 'a', '_', 'i', 'n', '_'] \n", - "979 tomorrow ['t', 'o', 'm', 'o', 'r', 'r', 'o', 'w'] \n", - "980 refile ['r', 'e', '_', 'i', 'l', 'e'] \n", - "981 unkind ['u', 'n', '_', 'i', 'n', 'd'] \n", - "982 specimens ['s', '_', 'e', 'c', 'i', 'm', 'e', 'n', 's'] \n", - "983 regrets ['r', 'e', '_', 'r', 'e', 't', 's'] \n", - "984 remaindered ['r', 'e', 'm', 'a', 'i', 'n', 'd', 'e', 'r', ... \n", - "985 dignify ['d', 'i', '_', 'n', 'i', '_', '_'] \n", - "986 bandwagon ['_', 'a', 'n', 'd', 'w', 'a', '_', 'o', 'n'] \n", - "987 pacemakers ['_', 'a', 'c', 'e', 'm', 'a', '_', 'e', 'r', ... \n", - "988 dandles ['d', 'a', 'n', 'd', 'l', 'e', 's'] \n", - "989 white ['w', 'h', 'i', 't', 'e'] \n", - "990 arena ['a', 'r', 'e', 'n', 'a'] \n", - "991 surreal ['s', 'u', 'r', 'r', 'e', 'a', 'l'] \n", - "992 gutsiest ['_', 'u', 't', 's', 'i', 'e', 's', 't'] \n", - "993 annulments ['a', 'n', 'n', 'u', 'l', 'm', 'e', 'n', 't', ... \n", - "994 accretions ['a', 'c', 'c', 'r', 'e', 't', 'i', 'o', 'n', ... \n", - "995 safari ['s', 'a', '_', 'a', 'r', 'i'] \n", - "996 recap ['r', 'e', '_', 'a', '_'] \n", - "997 torts ['t', 'o', 'r', 't', 's'] \n", - "998 tyrannised ['t', 'y', 'r', 'a', 'n', 'n', 'i', 's', 'e', ... \n", - "999 indubitable ['i', 'n', 'd', 'u', '_', 'i', 't', 'a', '_', ... \n", - "\n", - " wrong letters number of hits \\\n", - "0 ['t', 'a', 'h', 's', 'w', 'c', 'y', 'f'] 10 \n", - "1 ['a', 'o', 'i', 'h', 'n', 's', 'r', 'l', 'u', ... 4 \n", - "2 ['e', 'a', 'o', 'h', 'n', 'r', 'd', 'u', 'm', ... 6 \n", - "3 ['t', 'o', 'h', 'n', 'l', 'u', 'm', 'w', 'c', ... 8 \n", - "4 ['t', 'a', 'h', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", - "5 ['e', 'o', 'h', 's', 'd', 'l', 'u', 'm', 'w', ... 8 \n", - "6 ['e', 't', 'a', 'o', 'h', 's', 'r', 'd', 'l', ... 4 \n", - "7 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'w'] 8 \n", - "8 ['o', 'i', 'h', 'n', 'r'] 7 \n", - "9 ['a', 'h', 'l', 'u', 'w'] 11 \n", - "10 ['e', 't', 'a', 'i', 'n', 's', 'd', 'l', 'm', ... 4 \n", - "11 ['e', 't', 'a', 'i', 'h', 'n', 's', 'r', 'd', ... 2 \n", - "12 ['a', 'i', 'n', 'd', 'l', 'u'] 8 \n", - "13 ['o', 'h', 'r', 'd', 'l', 'u', 'm', 'w', 'y', ... 8 \n", - "14 ['e', 'a', 'o', 'n', 's', 'd', 'm', 'w', 'c'] 10 \n", - "15 ['t', 'a', 'o', 'h', 'n', 'd', 'l', 'm', 'w', ... 7 \n", - "16 ['a', 'h', 'n', 's', 'r', 'd', 'u', 'm', 'w', ... 5 \n", - "17 ['h', 'n', 'u', 'w', 'c', 'y', 'f'] 14 \n", - "18 ['t', 'o', 'h'] 5 \n", - "19 ['t', 'a', 'i', 'h', 'd', 'l', 'u', 'm', 'w', ... 5 \n", - "20 ['t', 'o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', ... 9 \n", - "21 ['i', 'n', 'r', 'd', 'l', 'u', 'm', 'c', 'y', ... 8 \n", - "22 ['e', 't', 'a', 'o', 'i', 'h', 'n', 'r', 'd', ... 1 \n", - "23 ['a', 'i', 'h', 'n', 'r', 'd', 'l', 'w'] 8 \n", - "24 ['i', 's', 'l', 'u', 'm', 'w', 'c', 'y', 'f', ... 9 \n", - "25 ['t', 'a', 'o', 'h', 'd', 'l', 'm', 'w', 'y', ... 10 \n", - "26 ['e', 't', 'o', 'h', 'r', 'd', 'l', 'u'] 6 \n", - "27 ['t', 'a', 'o', 'h', 'd', 'm', 'w', 'c', 'f'] 11 \n", - "28 ['a', 'h', 'r', 'd', 'l', 'm', 'w', 'y', 'f', ... 11 \n", - "29 ['e', 'o', 'h', 'n', 'r', 'd', 'u', 'w', 'c', ... 7 \n", - ".. ... ... \n", - "970 ['e', 'a', 'h', 'n', 's', 'r', 'd', 'l', 'u', ... 3 \n", - "971 ['o', 'h', 'd', 'l', 'u', 'm', 'w', 'c', 'y', ... 9 \n", - "972 ['t', 'o', 'h', 'n', 's', 'd', 'l', 'u', 'w', ... 5 \n", - "973 ['t', 's', 'r', 'd', 'u', 'w'] 11 \n", - "974 ['o', 'r', 'd', 'l'] 11 \n", - "975 ['t', 'o', 'i', 'h', 'n', 's', 'l', 'u', 'm', ... 6 \n", - "976 ['t', 'o', 'i', 'h', 'n', 'r', 'd', 'u', 'm', ... 4 \n", - "977 ['o', 'n', 's', 'r', 'd', 'u', 'm', 'w', 'f', ... 13 \n", - "978 ['e', 'o', 'h', 's', 'r', 'd', 'l', 'u', 'm', ... 4 \n", - "979 ['e', 'a', 'i', 'h', 'n', 's', 'd', 'l', 'u'] 8 \n", - "980 ['t', 'a', 'o', 'h', 'n', 's', 'd', 'u', 'm', ... 5 \n", - "981 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'm', ... 5 \n", - "982 ['t', 'a', 'o', 'h', 'r', 'd', 'l', 'u', 'w', ... 8 \n", - "983 ['a', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'm', ... 6 \n", - "984 ['t', 'o', 'h', 's', 'l', 'u'] 11 \n", - "985 ['e', 't', 'a', 'o', 'h', 's', 'r', 'l', 'u', ... 4 \n", - "986 ['e', 't', 'i', 'h', 's', 'r', 'l', 'u', 'm', ... 7 \n", - "987 ['t', 'o', 'i', 'h', 'n', 'd', 'l', 'u', 'w', ... 8 \n", - "988 ['t', 'o', 'i', 'h', 'r'] 7 \n", - "989 ['a', 'o', 'n', 's', 'r', 'd', 'l', 'u', 'm'] 5 \n", - "990 ['t', 'o', 'i', 'h', 's'] 5 \n", - "991 ['t', 'o', 'i', 'h', 'n', 'd'] 7 \n", - "992 ['a', 'o', 'h', 'n', 'r', 'd', 'l', 'm', 'w', ... 7 \n", - "993 ['o', 'i', 'h', 'r', 'd'] 10 \n", - "994 ['h', 'd', 'l', 'u', 'm', 'w'] 10 \n", - "995 ['e', 't', 'o', 'h', 'n', 'd', 'l', 'u', 'm', ... 5 \n", - "996 ['t', 'o', 'i', 'h', 'n', 's', 'd', 'l', 'u', ... 3 \n", - "997 ['e', 'a', 'i', 'h', 'n'] 5 \n", - "998 ['o', 'h', 'l', 'u', 'm', 'w', 'c'] 10 \n", - "999 ['o', 'h', 's', 'r', 'm', 'w', 'c', 'y', 'f', ... 9 \n", - "\n", - " lives remaining game won word length \n", - "0 2 True 10 \n", - "1 0 False 6 \n", - "2 0 False 9 \n", - "3 0 False 10 \n", - "4 0 False 6 \n", - "5 0 False 11 \n", - "6 0 False 7 \n", - "7 2 True 8 \n", - "8 5 True 7 \n", - "9 5 True 11 \n", - "10 0 False 7 \n", - "11 0 False 4 \n", - "12 4 True 8 \n", - "13 0 False 10 \n", - "14 1 True 10 \n", - "15 0 False 8 \n", - "16 0 False 6 \n", - "17 3 True 14 \n", - "18 7 True 5 \n", - "19 0 False 7 \n", - "20 0 False 11 \n", - "21 0 False 9 \n", - "22 0 False 2 \n", - "23 2 True 8 \n", - "24 0 False 10 \n", - "25 0 False 11 \n", - "26 2 True 6 \n", - "27 1 True 11 \n", - "28 0 False 12 \n", - "29 0 False 9 \n", - ".. ... ... ... \n", - "970 0 False 5 \n", - "971 0 False 11 \n", - "972 0 False 7 \n", - "973 4 True 11 \n", - "974 6 True 11 \n", - "975 0 False 7 \n", - "976 0 False 5 \n", - "977 0 False 14 \n", - "978 0 False 6 \n", - "979 1 True 8 \n", - "980 0 False 6 \n", - "981 0 False 6 \n", - "982 0 False 9 \n", - "983 0 False 7 \n", - "984 4 True 11 \n", - "985 0 False 7 \n", - "986 0 False 9 \n", - "987 0 False 10 \n", - "988 5 True 7 \n", - "989 1 True 5 \n", - "990 5 True 5 \n", - "991 4 True 7 \n", - "992 0 False 8 \n", - "993 5 True 10 \n", - "994 4 True 10 \n", - "995 0 False 6 \n", - "996 0 False 5 \n", - "997 5 True 5 \n", - "998 3 True 10 \n", - "999 0 False 11 \n", - "\n", - "[1000 rows x 7 columns]" - ] - } - ], - "prompt_number": 10 - }, + "output_type": "display_data" + } + ], + "source": [ + "fixed_order['lives remaining'].hist()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "fixed_order['lives remaining'].hist()" - ], - "language": "python", + "data": { + "text/plain": [ + "lives remaining\n", + "0 667\n", + "1 86\n", + "2 60\n", + "3 59\n", + "4 50\n", + "5 35\n", + "6 22\n", + "7 15\n", + "8 6\n", + "dtype: int64" + ] + }, + "execution_count": 12, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 11, - "text": [ - "" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFU1JREFUeJzt3X2QVXd9x/E3CaEx5AEYOwRIMpdqMGXGig9Ep2pdKWFM\nxkD+qjhtZ7Gt/9BWO04VaKeD/xQpM534R6f/aJPFqaD4UIbYCU1Qrsbagg+5GrOhAetOsyasodGY\nEFMJbP/4/WAvO+zZc5dz93d+975fM3fOw3365G747uFzz72AJEmSJEmSJEmSJEmSJElSFl4HPNp2\neR74ELAIeBh4EngIWNB2n23AceAYsG42w0qSyrsCeAa4GdgFfCzu3wLsjOsrgRZwFdAATsT7SZJq\nZh3wSFw/BiyO6zfGbQhH6Vva7nMQeNuspJOkPtfpEfRGYG9cXwyMxfUxJgb8UmC07T6jwLKZBpQk\nldfJUJ8H3A184RLXjcfLVIqukyRVZG4Ht70T+C7wbNweI9QuJ4ElwE/j/p8QOvfzbor7Lli6dOn4\n008/PZO8ktTPfgS8tugGnRypv5+J6gXgADAY1weB/W37NxKO7JcDtwJH2x/o6aefZnx8vPaX7du3\nJ89gTnPmmtGc1V+A10w3qMseqc8H1gIfbNu3E9gH/DEwAvxe3D8c9w8DrwCbybR+GRkZSR2hFHNW\nK4ecOWQEc6ZQdqifBl49ad9zhEF/KTviRZI0izx/vMCmTZtSRyjFnNXKIWcOGcGcKcxJ9Lzj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abzPPCvwFtSB7mE3wbWE/rqvcAa4DNJE03tmbh8FvgXQq1ZN6Px\n8u24/UXCcK+rO4HvEl7TunkL8C3gfwk11pcJ/7/WQk4fTGpQ/zdK5xAGz72pgxR4NeEsCIBXAd8A\nfjddnFLeRX3PfrkGuC6uzwf+HViXLk6hbwAr4vrHufhT5XXzOQrefEzsDYSz215F+DO/m/A3tNrI\n4YNJewnd1f8R3gP4QNo4U3oHodpoMXFK1nsK7zH7Xk/oVFuE0/A+mjZOKe+ivme/LCe8li3CH/S6\n/hmCMIy+DXyfcHRZ17Nf5gOnmPhlWUcfY+KUxt2Ev6FLkiRJkiRJkiRJkiRJkiRJkiRJUnn/D7pn\ntnpo7g5vAAAAAElFTkSuQmCC\n", - "text": [ - "" - ] - } - ], - "prompt_number": 11 - }, + "output_type": "execute_result" + } + ], + "source": [ + "fixed_order.groupby('lives remaining').size()" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "fixed_order.groupby('lives remaining').size()" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] ['a', 'i'] 9 8 True
1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... [] 10 10 True
2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... ['s'] 10 9 True
3 normal ['n', 'o', 'r', 'm', 'a', 'l'] ['e', 's', 'i', 'f'] 6 6 True
4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] ['t'] 7 9 True
5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... ['e'] 11 9 True
6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] ['e', 't'] 8 8 True
7 erotic ['e', 'r', 'o', 't', 'i', 'c'] [] 6 10 True
8 double ['d', 'o', 'u', 'b', 'l', 'e'] ['a', 'm', 'r'] 6 7 True
9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] ['e', 's', 'n', 'l'] 6 6 True
10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... [] 11 10 True
11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... [] 13 10 True
12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... ['t'] 10 9 True
13 rails ['r', 'a', 'i', 'l', 's'] ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True
14 poised ['p', 'o', 'i', 's', 'e', 'd'] ['a', 'l', 't', 'k'] 6 6 True
15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... ['e'] 11 9 True
16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... [] 10 10 True
17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] ['m'] 8 9 True
18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] ['t', 'f', 'm'] 7 7 True
19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] ['e', 'i', 'a', 'n'] 7 6 True
20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] [] 8 10 True
21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... ['o'] 11 9 True
22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] ['t'] 8 9 True
23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] ['e', 'i', 't'] 9 7 True
24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] ['m'] 9 9 True
25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... [] 12 10 True
26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... ['i'] 12 9 True
27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... ['e'] 12 9 True
28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] ['t'] 7 9 True
29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] ['i'] 9 9 True
.....................
970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... [] 11 10 True
971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] [] 9 10 True
972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] ['r'] 8 9 True
973 picker ['p', 'i', 'c', 'k', 'e', 'r'] ['d', 's', 't', 'g'] 6 6 True
974 prom ['p', 'r', 'o', 'm'] ['e', 's', 'l'] 4 7 True
975 spoke ['s', 'p', 'o', 'k', 'e'] ['a', 'i', 't', 'r'] 5 6 True
976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... [] 10 10 True
977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] ['e', 'i'] 8 8 True
978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] ['e'] 8 9 True
979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... [] 12 10 True
980 audios ['a', 'u', 'd', 'i', 'o', 's'] ['e'] 6 9 True
981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] ['t', 'm'] 8 8 True
982 drake ['d', 'r', 'a', 'k', 'e'] ['s', 'c', 't', 'g', 'p'] 5 5 True
983 penes ['p', 'e', 'n', 'e', 's'] ['m'] 5 9 True
984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... ['s'] 10 9 True
985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... ['f'] 13 9 True
986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] ['p', 'i', 'm'] 8 7 True
987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... [] 10 10 True
988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] ['f'] 9 9 True
989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] [] 8 10 True
990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] ['e', 't', 'k', 'p'] 8 6 True
991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... ['e', 'i', 'o'] 11 7 True
992 bevies ['b', 'e', 'v', 'i', 'e', 's'] ['d', 'r', 'l'] 6 7 True
993 geeky ['g', 'e', 'e', 'k', 'y'] ['s', 'd', 't', 'f'] 5 6 True
994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... [] 14 10 True
995 dowses ['d', 'o', 'w', 's', 'e', 's'] ['r', 'u'] 6 8 True
996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... ['s', 'r', 'o'] 10 7 True
997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... [] 11 10 True
998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... [] 14 10 True
999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] ['e', 's', 'i', 'a', 'o'] 6 5 True
\n", + "

1000 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] \n", + "1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... \n", + "2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... \n", + "3 normal ['n', 'o', 'r', 'm', 'a', 'l'] \n", + "4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] \n", + "5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... \n", + "6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] \n", + "7 erotic ['e', 'r', 'o', 't', 'i', 'c'] \n", + "8 double ['d', 'o', 'u', 'b', 'l', 'e'] \n", + "9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] \n", + "10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... \n", + "11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... \n", + "12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... \n", + "13 rails ['r', 'a', 'i', 'l', 's'] \n", + "14 poised ['p', 'o', 'i', 's', 'e', 'd'] \n", + "15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... \n", + "16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... \n", + "17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] \n", + "18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] \n", + "19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] \n", + "20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] \n", + "21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... \n", + "22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] \n", + "23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] \n", + "24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] \n", + "25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... \n", + "26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... \n", + "27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... \n", + "28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] \n", + "29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] \n", + ".. ... ... \n", + "970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... \n", + "971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] \n", + "972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] \n", + "973 picker ['p', 'i', 'c', 'k', 'e', 'r'] \n", + "974 prom ['p', 'r', 'o', 'm'] \n", + "975 spoke ['s', 'p', 'o', 'k', 'e'] \n", + "976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... \n", + "977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] \n", + "978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] \n", + "979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... \n", + "980 audios ['a', 'u', 'd', 'i', 'o', 's'] \n", + "981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] \n", + "982 drake ['d', 'r', 'a', 'k', 'e'] \n", + "983 penes ['p', 'e', 'n', 'e', 's'] \n", + "984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... \n", + "985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... \n", + "986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] \n", + "987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... \n", + "988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] \n", + "989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] \n", + "990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] \n", + "991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... \n", + "992 bevies ['b', 'e', 'v', 'i', 'e', 's'] \n", + "993 geeky ['g', 'e', 'e', 'k', 'y'] \n", + "994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... \n", + "995 dowses ['d', 'o', 'w', 's', 'e', 's'] \n", + "996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... \n", + "997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... \n", + "998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... \n", + "999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] \n", + "\n", + " wrong letters number of hits lives remaining game won \n", + "0 ['a', 'i'] 9 8 True \n", + "1 [] 10 10 True \n", + "2 ['s'] 10 9 True \n", + "3 ['e', 's', 'i', 'f'] 6 6 True \n", + "4 ['t'] 7 9 True \n", + "5 ['e'] 11 9 True \n", + "6 ['e', 't'] 8 8 True \n", + "7 [] 6 10 True \n", + "8 ['a', 'm', 'r'] 6 7 True \n", + "9 ['e', 's', 'n', 'l'] 6 6 True \n", + "10 [] 11 10 True \n", + "11 [] 13 10 True \n", + "12 ['t'] 10 9 True \n", + "13 ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True \n", + "14 ['a', 'l', 't', 'k'] 6 6 True \n", + "15 ['e'] 11 9 True \n", + "16 [] 10 10 True \n", + "17 ['m'] 8 9 True \n", + "18 ['t', 'f', 'm'] 7 7 True \n", + "19 ['e', 'i', 'a', 'n'] 7 6 True \n", + "20 [] 8 10 True \n", + "21 ['o'] 11 9 True \n", + "22 ['t'] 8 9 True \n", + "23 ['e', 'i', 't'] 9 7 True \n", + "24 ['m'] 9 9 True \n", + "25 [] 12 10 True \n", + "26 ['i'] 12 9 True \n", + "27 ['e'] 12 9 True \n", + "28 ['t'] 7 9 True \n", + "29 ['i'] 9 9 True \n", + ".. ... ... ... ... \n", + "970 [] 11 10 True \n", + "971 [] 9 10 True \n", + "972 ['r'] 8 9 True \n", + "973 ['d', 's', 't', 'g'] 6 6 True \n", + "974 ['e', 's', 'l'] 4 7 True \n", + "975 ['a', 'i', 't', 'r'] 5 6 True \n", + "976 [] 10 10 True \n", + "977 ['e', 'i'] 8 8 True \n", + "978 ['e'] 8 9 True \n", + "979 [] 12 10 True \n", + "980 ['e'] 6 9 True \n", + "981 ['t', 'm'] 8 8 True \n", + "982 ['s', 'c', 't', 'g', 'p'] 5 5 True \n", + "983 ['m'] 5 9 True \n", + "984 ['s'] 10 9 True \n", + "985 ['f'] 13 9 True \n", + "986 ['p', 'i', 'm'] 8 7 True \n", + "987 [] 10 10 True \n", + "988 ['f'] 9 9 True \n", + "989 [] 8 10 True \n", + "990 ['e', 't', 'k', 'p'] 8 6 True \n", + "991 ['e', 'i', 'o'] 11 7 True \n", + "992 ['d', 'r', 'l'] 6 7 True \n", + "993 ['s', 'd', 't', 'f'] 5 6 True \n", + "994 [] 14 10 True \n", + "995 ['r', 'u'] 6 8 True \n", + "996 ['s', 'r', 'o'] 10 7 True \n", + "997 [] 11 10 True \n", + "998 [] 14 10 True \n", + "999 ['e', 's', 'i', 'a', 'o'] 6 5 True \n", + "\n", + "[1000 rows x 6 columns]" + ] + }, + "execution_count": 18, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 12, - "text": [ - "lives remaining\n", - "0 667\n", - "1 86\n", - "2 60\n", - "3 59\n", - "4 50\n", - "5 35\n", - "6 22\n", - "7 15\n", - "8 6\n", - "dtype: int64" - ] - } - ], - "prompt_number": 12 - }, + "output_type": "execute_result" + } + ], + "source": [ + "adaptive_pattern = pd.read_csv('adaptive_pattern.csv')\n", + "adaptive_pattern" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_pattern = pd.read_csv('adaptive_pattern.csv')\n", - "adaptive_pattern" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] ['a', 'i'] 9 8 True 9
1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... [] 10 10 True 10
2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... ['s'] 10 9 True 10
3 normal ['n', 'o', 'r', 'm', 'a', 'l'] ['e', 's', 'i', 'f'] 6 6 True 6
4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] ['t'] 7 9 True 7
5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... ['e'] 11 9 True 11
6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] ['e', 't'] 8 8 True 8
7 erotic ['e', 'r', 'o', 't', 'i', 'c'] [] 6 10 True 6
8 double ['d', 'o', 'u', 'b', 'l', 'e'] ['a', 'm', 'r'] 6 7 True 6
9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] ['e', 's', 'n', 'l'] 6 6 True 6
10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... [] 11 10 True 11
11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... [] 13 10 True 13
12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... ['t'] 10 9 True 10
13 rails ['r', 'a', 'i', 'l', 's'] ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True 5
14 poised ['p', 'o', 'i', 's', 'e', 'd'] ['a', 'l', 't', 'k'] 6 6 True 6
15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... ['e'] 11 9 True 11
16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... [] 10 10 True 10
17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] ['m'] 8 9 True 8
18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] ['t', 'f', 'm'] 7 7 True 7
19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] ['e', 'i', 'a', 'n'] 7 6 True 7
20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] [] 8 10 True 8
21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... ['o'] 11 9 True 11
22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] ['t'] 8 9 True 8
23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] ['e', 'i', 't'] 9 7 True 9
24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] ['m'] 9 9 True 9
25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... [] 12 10 True 12
26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... ['i'] 12 9 True 12
27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... ['e'] 12 9 True 12
28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] ['t'] 7 9 True 7
29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] ['i'] 9 9 True 9
........................
970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... [] 11 10 True 11
971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] [] 9 10 True 9
972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] ['r'] 8 9 True 8
973 picker ['p', 'i', 'c', 'k', 'e', 'r'] ['d', 's', 't', 'g'] 6 6 True 6
974 prom ['p', 'r', 'o', 'm'] ['e', 's', 'l'] 4 7 True 4
975 spoke ['s', 'p', 'o', 'k', 'e'] ['a', 'i', 't', 'r'] 5 6 True 5
976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... [] 10 10 True 10
977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] ['e', 'i'] 8 8 True 8
978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] ['e'] 8 9 True 8
979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... [] 12 10 True 12
980 audios ['a', 'u', 'd', 'i', 'o', 's'] ['e'] 6 9 True 6
981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] ['t', 'm'] 8 8 True 8
982 drake ['d', 'r', 'a', 'k', 'e'] ['s', 'c', 't', 'g', 'p'] 5 5 True 5
983 penes ['p', 'e', 'n', 'e', 's'] ['m'] 5 9 True 5
984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... ['s'] 10 9 True 10
985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... ['f'] 13 9 True 13
986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] ['p', 'i', 'm'] 8 7 True 8
987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... [] 10 10 True 10
988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] ['f'] 9 9 True 9
989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] [] 8 10 True 8
990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] ['e', 't', 'k', 'p'] 8 6 True 8
991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... ['e', 'i', 'o'] 11 7 True 11
992 bevies ['b', 'e', 'v', 'i', 'e', 's'] ['d', 'r', 'l'] 6 7 True 6
993 geeky ['g', 'e', 'e', 'k', 'y'] ['s', 'd', 't', 'f'] 5 6 True 5
994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... [] 14 10 True 14
995 dowses ['d', 'o', 'w', 's', 'e', 's'] ['r', 'u'] 6 8 True 6
996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... ['s', 'r', 'o'] 10 7 True 10
997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... [] 11 10 True 11
998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... [] 14 10 True 14
999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] ['e', 's', 'i', 'a', 'o'] 6 5 True 6
\n", + "

1000 rows × 7 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] \n", + "1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... \n", + "2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... \n", + "3 normal ['n', 'o', 'r', 'm', 'a', 'l'] \n", + "4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] \n", + "5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... \n", + "6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] \n", + "7 erotic ['e', 'r', 'o', 't', 'i', 'c'] \n", + "8 double ['d', 'o', 'u', 'b', 'l', 'e'] \n", + "9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] \n", + "10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... \n", + "11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... \n", + "12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... \n", + "13 rails ['r', 'a', 'i', 'l', 's'] \n", + "14 poised ['p', 'o', 'i', 's', 'e', 'd'] \n", + "15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... \n", + "16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... \n", + "17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] \n", + "18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] \n", + "19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] \n", + "20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] \n", + "21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... \n", + "22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] \n", + "23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] \n", + "24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] \n", + "25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... \n", + "26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... \n", + "27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... \n", + "28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] \n", + "29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] \n", + ".. ... ... \n", + "970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... \n", + "971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] \n", + "972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] \n", + "973 picker ['p', 'i', 'c', 'k', 'e', 'r'] \n", + "974 prom ['p', 'r', 'o', 'm'] \n", + "975 spoke ['s', 'p', 'o', 'k', 'e'] \n", + "976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... \n", + "977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] \n", + "978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] \n", + "979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... \n", + "980 audios ['a', 'u', 'd', 'i', 'o', 's'] \n", + "981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] \n", + "982 drake ['d', 'r', 'a', 'k', 'e'] \n", + "983 penes ['p', 'e', 'n', 'e', 's'] \n", + "984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... \n", + "985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... \n", + "986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] \n", + "987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... \n", + "988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] \n", + "989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] \n", + "990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] \n", + "991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... \n", + "992 bevies ['b', 'e', 'v', 'i', 'e', 's'] \n", + "993 geeky ['g', 'e', 'e', 'k', 'y'] \n", + "994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... \n", + "995 dowses ['d', 'o', 'w', 's', 'e', 's'] \n", + "996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... \n", + "997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... \n", + "998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... \n", + "999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] \n", + "\n", + " wrong letters number of hits lives remaining game won \\\n", + "0 ['a', 'i'] 9 8 True \n", + "1 [] 10 10 True \n", + "2 ['s'] 10 9 True \n", + "3 ['e', 's', 'i', 'f'] 6 6 True \n", + "4 ['t'] 7 9 True \n", + "5 ['e'] 11 9 True \n", + "6 ['e', 't'] 8 8 True \n", + "7 [] 6 10 True \n", + "8 ['a', 'm', 'r'] 6 7 True \n", + "9 ['e', 's', 'n', 'l'] 6 6 True \n", + "10 [] 11 10 True \n", + "11 [] 13 10 True \n", + "12 ['t'] 10 9 True \n", + "13 ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True \n", + "14 ['a', 'l', 't', 'k'] 6 6 True \n", + "15 ['e'] 11 9 True \n", + "16 [] 10 10 True \n", + "17 ['m'] 8 9 True \n", + "18 ['t', 'f', 'm'] 7 7 True \n", + "19 ['e', 'i', 'a', 'n'] 7 6 True \n", + "20 [] 8 10 True \n", + "21 ['o'] 11 9 True \n", + "22 ['t'] 8 9 True \n", + "23 ['e', 'i', 't'] 9 7 True \n", + "24 ['m'] 9 9 True \n", + "25 [] 12 10 True \n", + "26 ['i'] 12 9 True \n", + "27 ['e'] 12 9 True \n", + "28 ['t'] 7 9 True \n", + "29 ['i'] 9 9 True \n", + ".. ... ... ... ... \n", + "970 [] 11 10 True \n", + "971 [] 9 10 True \n", + "972 ['r'] 8 9 True \n", + "973 ['d', 's', 't', 'g'] 6 6 True \n", + "974 ['e', 's', 'l'] 4 7 True \n", + "975 ['a', 'i', 't', 'r'] 5 6 True \n", + "976 [] 10 10 True \n", + "977 ['e', 'i'] 8 8 True \n", + "978 ['e'] 8 9 True \n", + "979 [] 12 10 True \n", + "980 ['e'] 6 9 True \n", + "981 ['t', 'm'] 8 8 True \n", + "982 ['s', 'c', 't', 'g', 'p'] 5 5 True \n", + "983 ['m'] 5 9 True \n", + "984 ['s'] 10 9 True \n", + "985 ['f'] 13 9 True \n", + "986 ['p', 'i', 'm'] 8 7 True \n", + "987 [] 10 10 True \n", + "988 ['f'] 9 9 True \n", + "989 [] 8 10 True \n", + "990 ['e', 't', 'k', 'p'] 8 6 True \n", + "991 ['e', 'i', 'o'] 11 7 True \n", + "992 ['d', 'r', 'l'] 6 7 True \n", + "993 ['s', 'd', 't', 'f'] 5 6 True \n", + "994 [] 14 10 True \n", + "995 ['r', 'u'] 6 8 True \n", + "996 ['s', 'r', 'o'] 10 7 True \n", + "997 [] 11 10 True \n", + "998 [] 14 10 True \n", + "999 ['e', 's', 'i', 'a', 'o'] 6 5 True \n", + "\n", + " word length \n", + "0 9 \n", + "1 10 \n", + "2 10 \n", + "3 6 \n", + "4 7 \n", + "5 11 \n", + "6 8 \n", + "7 6 \n", + "8 6 \n", + "9 6 \n", + "10 11 \n", + "11 13 \n", + "12 10 \n", + "13 5 \n", + "14 6 \n", + "15 11 \n", + "16 10 \n", + "17 8 \n", + "18 7 \n", + "19 7 \n", + "20 8 \n", + "21 11 \n", + "22 8 \n", + "23 9 \n", + "24 9 \n", + "25 12 \n", + "26 12 \n", + "27 12 \n", + "28 7 \n", + "29 9 \n", + ".. ... \n", + "970 11 \n", + "971 9 \n", + "972 8 \n", + "973 6 \n", + "974 4 \n", + "975 5 \n", + "976 10 \n", + "977 8 \n", + "978 8 \n", + "979 12 \n", + "980 6 \n", + "981 8 \n", + "982 5 \n", + "983 5 \n", + "984 10 \n", + "985 13 \n", + "986 8 \n", + "987 10 \n", + "988 9 \n", + "989 8 \n", + "990 8 \n", + "991 11 \n", + "992 6 \n", + "993 5 \n", + "994 14 \n", + "995 6 \n", + "996 10 \n", + "997 11 \n", + "998 14 \n", + "999 6 \n", + "\n", + "[1000 rows x 7 columns]" + ] + }, + "execution_count": 14, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] ['a', 'i'] 9 8 True
1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... [] 10 10 True
2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... ['s'] 10 9 True
3 normal ['n', 'o', 'r', 'm', 'a', 'l'] ['e', 's', 'i', 'f'] 6 6 True
4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] ['t'] 7 9 True
5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... ['e'] 11 9 True
6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] ['e', 't'] 8 8 True
7 erotic ['e', 'r', 'o', 't', 'i', 'c'] [] 6 10 True
8 double ['d', 'o', 'u', 'b', 'l', 'e'] ['a', 'm', 'r'] 6 7 True
9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] ['e', 's', 'n', 'l'] 6 6 True
10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... [] 11 10 True
11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... [] 13 10 True
12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... ['t'] 10 9 True
13 rails ['r', 'a', 'i', 'l', 's'] ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True
14 poised ['p', 'o', 'i', 's', 'e', 'd'] ['a', 'l', 't', 'k'] 6 6 True
15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... ['e'] 11 9 True
16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... [] 10 10 True
17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] ['m'] 8 9 True
18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] ['t', 'f', 'm'] 7 7 True
19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] ['e', 'i', 'a', 'n'] 7 6 True
20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] [] 8 10 True
21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... ['o'] 11 9 True
22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] ['t'] 8 9 True
23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] ['e', 'i', 't'] 9 7 True
24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] ['m'] 9 9 True
25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... [] 12 10 True
26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... ['i'] 12 9 True
27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... ['e'] 12 9 True
28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] ['t'] 7 9 True
29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] ['i'] 9 9 True
.....................
970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... [] 11 10 True
971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] [] 9 10 True
972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] ['r'] 8 9 True
973 picker ['p', 'i', 'c', 'k', 'e', 'r'] ['d', 's', 't', 'g'] 6 6 True
974 prom ['p', 'r', 'o', 'm'] ['e', 's', 'l'] 4 7 True
975 spoke ['s', 'p', 'o', 'k', 'e'] ['a', 'i', 't', 'r'] 5 6 True
976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... [] 10 10 True
977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] ['e', 'i'] 8 8 True
978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] ['e'] 8 9 True
979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... [] 12 10 True
980 audios ['a', 'u', 'd', 'i', 'o', 's'] ['e'] 6 9 True
981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] ['t', 'm'] 8 8 True
982 drake ['d', 'r', 'a', 'k', 'e'] ['s', 'c', 't', 'g', 'p'] 5 5 True
983 penes ['p', 'e', 'n', 'e', 's'] ['m'] 5 9 True
984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... ['s'] 10 9 True
985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... ['f'] 13 9 True
986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] ['p', 'i', 'm'] 8 7 True
987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... [] 10 10 True
988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] ['f'] 9 9 True
989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] [] 8 10 True
990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] ['e', 't', 'k', 'p'] 8 6 True
991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... ['e', 'i', 'o'] 11 7 True
992 bevies ['b', 'e', 'v', 'i', 'e', 's'] ['d', 'r', 'l'] 6 7 True
993 geeky ['g', 'e', 'e', 'k', 'y'] ['s', 'd', 't', 'f'] 5 6 True
994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... [] 14 10 True
995 dowses ['d', 'o', 'w', 's', 'e', 's'] ['r', 'u'] 6 8 True
996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... ['s', 'r', 'o'] 10 7 True
997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... [] 11 10 True
998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... [] 14 10 True
999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] ['e', 's', 'i', 'a', 'o'] 6 5 True
\n", - "

1000 rows \u00d7 6 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 18, - "text": [ - " target discovered \\\n", - "0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] \n", - "1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... \n", - "2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... \n", - "3 normal ['n', 'o', 'r', 'm', 'a', 'l'] \n", - "4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] \n", - "5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... \n", - "6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] \n", - "7 erotic ['e', 'r', 'o', 't', 'i', 'c'] \n", - "8 double ['d', 'o', 'u', 'b', 'l', 'e'] \n", - "9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] \n", - "10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... \n", - "11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... \n", - "12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... \n", - "13 rails ['r', 'a', 'i', 'l', 's'] \n", - "14 poised ['p', 'o', 'i', 's', 'e', 'd'] \n", - "15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... \n", - "16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... \n", - "17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] \n", - "18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] \n", - "19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] \n", - "20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] \n", - "21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... \n", - "22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] \n", - "23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] \n", - "24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] \n", - "25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... \n", - "26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... \n", - "27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... \n", - "28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] \n", - "29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] \n", - ".. ... ... \n", - "970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... \n", - "971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] \n", - "972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] \n", - "973 picker ['p', 'i', 'c', 'k', 'e', 'r'] \n", - "974 prom ['p', 'r', 'o', 'm'] \n", - "975 spoke ['s', 'p', 'o', 'k', 'e'] \n", - "976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... \n", - "977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] \n", - "978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] \n", - "979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... \n", - "980 audios ['a', 'u', 'd', 'i', 'o', 's'] \n", - "981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] \n", - "982 drake ['d', 'r', 'a', 'k', 'e'] \n", - "983 penes ['p', 'e', 'n', 'e', 's'] \n", - "984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... \n", - "985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... \n", - "986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] \n", - "987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... \n", - "988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] \n", - "989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] \n", - "990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] \n", - "991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... \n", - "992 bevies ['b', 'e', 'v', 'i', 'e', 's'] \n", - "993 geeky ['g', 'e', 'e', 'k', 'y'] \n", - "994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... \n", - "995 dowses ['d', 'o', 'w', 's', 'e', 's'] \n", - "996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... \n", - "997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... \n", - "998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... \n", - "999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] \n", - "\n", - " wrong letters number of hits lives remaining game won \n", - "0 ['a', 'i'] 9 8 True \n", - "1 [] 10 10 True \n", - "2 ['s'] 10 9 True \n", - "3 ['e', 's', 'i', 'f'] 6 6 True \n", - "4 ['t'] 7 9 True \n", - "5 ['e'] 11 9 True \n", - "6 ['e', 't'] 8 8 True \n", - "7 [] 6 10 True \n", - "8 ['a', 'm', 'r'] 6 7 True \n", - "9 ['e', 's', 'n', 'l'] 6 6 True \n", - "10 [] 11 10 True \n", - "11 [] 13 10 True \n", - "12 ['t'] 10 9 True \n", - "13 ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True \n", - "14 ['a', 'l', 't', 'k'] 6 6 True \n", - "15 ['e'] 11 9 True \n", - "16 [] 10 10 True \n", - "17 ['m'] 8 9 True \n", - "18 ['t', 'f', 'm'] 7 7 True \n", - "19 ['e', 'i', 'a', 'n'] 7 6 True \n", - "20 [] 8 10 True \n", - "21 ['o'] 11 9 True \n", - "22 ['t'] 8 9 True \n", - "23 ['e', 'i', 't'] 9 7 True \n", - "24 ['m'] 9 9 True \n", - "25 [] 12 10 True \n", - "26 ['i'] 12 9 True \n", - "27 ['e'] 12 9 True \n", - "28 ['t'] 7 9 True \n", - "29 ['i'] 9 9 True \n", - ".. ... ... ... ... \n", - "970 [] 11 10 True \n", - "971 [] 9 10 True \n", - "972 ['r'] 8 9 True \n", - "973 ['d', 's', 't', 'g'] 6 6 True \n", - "974 ['e', 's', 'l'] 4 7 True \n", - "975 ['a', 'i', 't', 'r'] 5 6 True \n", - "976 [] 10 10 True \n", - "977 ['e', 'i'] 8 8 True \n", - "978 ['e'] 8 9 True \n", - "979 [] 12 10 True \n", - "980 ['e'] 6 9 True \n", - "981 ['t', 'm'] 8 8 True \n", - "982 ['s', 'c', 't', 'g', 'p'] 5 5 True \n", - "983 ['m'] 5 9 True \n", - "984 ['s'] 10 9 True \n", - "985 ['f'] 13 9 True \n", - "986 ['p', 'i', 'm'] 8 7 True \n", - "987 [] 10 10 True \n", - "988 ['f'] 9 9 True \n", - "989 [] 8 10 True \n", - "990 ['e', 't', 'k', 'p'] 8 6 True \n", - "991 ['e', 'i', 'o'] 11 7 True \n", - "992 ['d', 'r', 'l'] 6 7 True \n", - "993 ['s', 'd', 't', 'f'] 5 6 True \n", - "994 [] 14 10 True \n", - "995 ['r', 'u'] 6 8 True \n", - "996 ['s', 'r', 'o'] 10 7 True \n", - "997 [] 11 10 True \n", - "998 [] 14 10 True \n", - "999 ['e', 's', 'i', 'a', 'o'] 6 5 True \n", - "\n", - "[1000 rows x 6 columns]" - ] - } - ], - "prompt_number": 18 - }, + "output_type": "execute_result" + } + ], + "source": [ + "adaptive_pattern['word length'] = adaptive_pattern.apply(lambda r: len(r['target']), axis=1)\n", + "adaptive_pattern" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_pattern['word length'] = adaptive_pattern.apply(lambda r: len(r['target']), axis=1)\n", - "adaptive_pattern" - ], - "language": "python", + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 15, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] ['a', 'i'] 9 8 True 9
1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... [] 10 10 True 10
2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... ['s'] 10 9 True 10
3 normal ['n', 'o', 'r', 'm', 'a', 'l'] ['e', 's', 'i', 'f'] 6 6 True 6
4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] ['t'] 7 9 True 7
5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... ['e'] 11 9 True 11
6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] ['e', 't'] 8 8 True 8
7 erotic ['e', 'r', 'o', 't', 'i', 'c'] [] 6 10 True 6
8 double ['d', 'o', 'u', 'b', 'l', 'e'] ['a', 'm', 'r'] 6 7 True 6
9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] ['e', 's', 'n', 'l'] 6 6 True 6
10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... [] 11 10 True 11
11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... [] 13 10 True 13
12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... ['t'] 10 9 True 10
13 rails ['r', 'a', 'i', 'l', 's'] ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True 5
14 poised ['p', 'o', 'i', 's', 'e', 'd'] ['a', 'l', 't', 'k'] 6 6 True 6
15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... ['e'] 11 9 True 11
16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... [] 10 10 True 10
17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] ['m'] 8 9 True 8
18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] ['t', 'f', 'm'] 7 7 True 7
19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] ['e', 'i', 'a', 'n'] 7 6 True 7
20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] [] 8 10 True 8
21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... ['o'] 11 9 True 11
22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] ['t'] 8 9 True 8
23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] ['e', 'i', 't'] 9 7 True 9
24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] ['m'] 9 9 True 9
25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... [] 12 10 True 12
26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... ['i'] 12 9 True 12
27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... ['e'] 12 9 True 12
28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] ['t'] 7 9 True 7
29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] ['i'] 9 9 True 9
........................
970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... [] 11 10 True 11
971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] [] 9 10 True 9
972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] ['r'] 8 9 True 8
973 picker ['p', 'i', 'c', 'k', 'e', 'r'] ['d', 's', 't', 'g'] 6 6 True 6
974 prom ['p', 'r', 'o', 'm'] ['e', 's', 'l'] 4 7 True 4
975 spoke ['s', 'p', 'o', 'k', 'e'] ['a', 'i', 't', 'r'] 5 6 True 5
976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... [] 10 10 True 10
977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] ['e', 'i'] 8 8 True 8
978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] ['e'] 8 9 True 8
979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... [] 12 10 True 12
980 audios ['a', 'u', 'd', 'i', 'o', 's'] ['e'] 6 9 True 6
981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] ['t', 'm'] 8 8 True 8
982 drake ['d', 'r', 'a', 'k', 'e'] ['s', 'c', 't', 'g', 'p'] 5 5 True 5
983 penes ['p', 'e', 'n', 'e', 's'] ['m'] 5 9 True 5
984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... ['s'] 10 9 True 10
985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... ['f'] 13 9 True 13
986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] ['p', 'i', 'm'] 8 7 True 8
987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... [] 10 10 True 10
988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] ['f'] 9 9 True 9
989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] [] 8 10 True 8
990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] ['e', 't', 'k', 'p'] 8 6 True 8
991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... ['e', 'i', 'o'] 11 7 True 11
992 bevies ['b', 'e', 'v', 'i', 'e', 's'] ['d', 'r', 'l'] 6 7 True 6
993 geeky ['g', 'e', 'e', 'k', 'y'] ['s', 'd', 't', 'f'] 5 6 True 5
994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... [] 14 10 True 14
995 dowses ['d', 'o', 'w', 's', 'e', 's'] ['r', 'u'] 6 8 True 6
996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... ['s', 'r', 'o'] 10 7 True 10
997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... [] 11 10 True 11
998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... [] 14 10 True 14
999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] ['e', 's', 'i', 'a', 'o'] 6 5 True 6
\n", - "

1000 rows \u00d7 7 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 14, - "text": [ - " target discovered \\\n", - "0 toothsome ['t', 'o', 'o', 't', 'h', 's', 'o', 'm', 'e'] \n", - "1 analgesics ['a', 'n', 'a', 'l', 'g', 'e', 's', 'i', 'c', ... \n", - "2 intrenched ['i', 'n', 't', 'r', 'e', 'n', 'c', 'h', 'e', ... \n", - "3 normal ['n', 'o', 'r', 'm', 'a', 'l'] \n", - "4 debunks ['d', 'e', 'b', 'u', 'n', 'k', 's'] \n", - "5 satanically ['s', 'a', 't', 'a', 'n', 'i', 'c', 'a', 'l', ... \n", - "6 radicals ['r', 'a', 'd', 'i', 'c', 'a', 'l', 's'] \n", - "7 erotic ['e', 'r', 'o', 't', 'i', 'c'] \n", - "8 double ['d', 'o', 'u', 'b', 'l', 'e'] \n", - "9 caviar ['c', 'a', 'v', 'i', 'a', 'r'] \n", - "10 rigamaroles ['r', 'i', 'g', 'a', 'm', 'a', 'r', 'o', 'l', ... \n", - "11 disfranchises ['d', 'i', 's', 'f', 'r', 'a', 'n', 'c', 'h', ... \n", - "12 mushroomed ['m', 'u', 's', 'h', 'r', 'o', 'o', 'm', 'e', ... \n", - "13 rails ['r', 'a', 'i', 'l', 's'] \n", - "14 poised ['p', 'o', 'i', 's', 'e', 'd'] \n", - "15 circulating ['c', 'i', 'r', 'c', 'u', 'l', 'a', 't', 'i', ... \n", - "16 yesteryear ['y', 'e', 's', 't', 'e', 'r', 'y', 'e', 'a', ... \n", - "17 chastest ['c', 'h', 'a', 's', 't', 'e', 's', 't'] \n", - "18 lenders ['l', 'e', 'n', 'd', 'e', 'r', 's'] \n", - "19 upshots ['u', 'p', 's', 'h', 'o', 't', 's'] \n", - "20 stridden ['s', 't', 'r', 'i', 'd', 'd', 'e', 'n'] \n", - "21 trespassing ['t', 'r', 'e', 's', 'p', 'a', 's', 's', 'i', ... \n", - "22 muckrake ['m', 'u', 'c', 'k', 'r', 'a', 'k', 'e'] \n", - "23 bungalows ['b', 'u', 'n', 'g', 'a', 'l', 'o', 'w', 's'] \n", - "24 rewinding ['r', 'e', 'w', 'i', 'n', 'd', 'i', 'n', 'g'] \n", - "25 stepchildren ['s', 't', 'e', 'p', 'c', 'h', 'i', 'l', 'd', ... \n", - "26 courageously ['c', 'o', 'u', 'r', 'a', 'g', 'e', 'o', 'u', ... \n", - "27 gladiatorial ['g', 'l', 'a', 'd', 'i', 'a', 't', 'o', 'r', ... \n", - "28 unseals ['u', 'n', 's', 'e', 'a', 'l', 's'] \n", - "29 backaches ['b', 'a', 'c', 'k', 'a', 'c', 'h', 'e', 's'] \n", - ".. ... ... \n", - "970 priestliest ['p', 'r', 'i', 'e', 's', 't', 'l', 'i', 'e', ... \n", - "971 oversight ['o', 'v', 'e', 'r', 's', 'i', 'g', 'h', 't'] \n", - "972 nutshell ['n', 'u', 't', 's', 'h', 'e', 'l', 'l'] \n", - "973 picker ['p', 'i', 'c', 'k', 'e', 'r'] \n", - "974 prom ['p', 'r', 'o', 'm'] \n", - "975 spoke ['s', 'p', 'o', 'k', 'e'] \n", - "976 videodiscs ['v', 'i', 'd', 'e', 'o', 'd', 'i', 's', 'c', ... \n", - "977 braggart ['b', 'r', 'a', 'g', 'g', 'a', 'r', 't'] \n", - "978 shindigs ['s', 'h', 'i', 'n', 'd', 'i', 'g', 's'] \n", - "979 indorsements ['i', 'n', 'd', 'o', 'r', 's', 'e', 'm', 'e', ... \n", - "980 audios ['a', 'u', 'd', 'i', 'o', 's'] \n", - "981 disrobes ['d', 'i', 's', 'r', 'o', 'b', 'e', 's'] \n", - "982 drake ['d', 'r', 'a', 'k', 'e'] \n", - "983 penes ['p', 'e', 'n', 'e', 's'] \n", - "984 ecological ['e', 'c', 'o', 'l', 'o', 'g', 'i', 'c', 'a', ... \n", - "985 consideration ['c', 'o', 'n', 's', 'i', 'd', 'e', 'r', 'a', ... \n", - "986 strolled ['s', 't', 'r', 'o', 'l', 'l', 'e', 'd'] \n", - "987 peacemaker ['p', 'e', 'a', 'c', 'e', 'm', 'a', 'k', 'e', ... \n", - "988 chilliest ['c', 'h', 'i', 'l', 'l', 'i', 'e', 's', 't'] \n", - "989 neuritis ['n', 'e', 'u', 'r', 'i', 't', 'i', 's'] \n", - "990 quisling ['q', 'u', 'i', 's', 'l', 'i', 'n', 'g'] \n", - "991 transplants ['t', 'r', 'a', 'n', 's', 'p', 'l', 'a', 'n', ... \n", - "992 bevies ['b', 'e', 'v', 'i', 'e', 's'] \n", - "993 geeky ['g', 'e', 'e', 'k', 'y'] \n", - "994 demonstrations ['d', 'e', 'm', 'o', 'n', 's', 't', 'r', 'a', ... \n", - "995 dowses ['d', 'o', 'w', 's', 'e', 's'] \n", - "996 pummelling ['p', 'u', 'm', 'm', 'e', 'l', 'l', 'i', 'n', ... \n", - "997 earnestness ['e', 'a', 'r', 'n', 'e', 's', 't', 'n', 'e', ... \n", - "998 thermodynamics ['t', 'h', 'e', 'r', 'm', 'o', 'd', 'y', 'n', ... \n", - "999 flurry ['f', 'l', 'u', 'r', 'r', 'y'] \n", - "\n", - " wrong letters number of hits lives remaining game won \\\n", - "0 ['a', 'i'] 9 8 True \n", - "1 [] 10 10 True \n", - "2 ['s'] 10 9 True \n", - "3 ['e', 's', 'i', 'f'] 6 6 True \n", - "4 ['t'] 7 9 True \n", - "5 ['e'] 11 9 True \n", - "6 ['e', 't'] 8 8 True \n", - "7 [] 6 10 True \n", - "8 ['a', 'm', 'r'] 6 7 True \n", - "9 ['e', 's', 'n', 'l'] 6 6 True \n", - "10 [] 11 10 True \n", - "11 [] 13 10 True \n", - "12 ['t'] 10 9 True \n", - "13 ['e', 'o', 't', 'm', 'f', 'w'] 5 4 True \n", - "14 ['a', 'l', 't', 'k'] 6 6 True \n", - "15 ['e'] 11 9 True \n", - "16 [] 10 10 True \n", - "17 ['m'] 8 9 True \n", - "18 ['t', 'f', 'm'] 7 7 True \n", - "19 ['e', 'i', 'a', 'n'] 7 6 True \n", - "20 [] 8 10 True \n", - "21 ['o'] 11 9 True \n", - "22 ['t'] 8 9 True \n", - "23 ['e', 'i', 't'] 9 7 True \n", - "24 ['m'] 9 9 True \n", - "25 [] 12 10 True \n", - "26 ['i'] 12 9 True \n", - "27 ['e'] 12 9 True \n", - "28 ['t'] 7 9 True \n", - "29 ['i'] 9 9 True \n", - ".. ... ... ... ... \n", - "970 [] 11 10 True \n", - "971 [] 9 10 True \n", - "972 ['r'] 8 9 True \n", - "973 ['d', 's', 't', 'g'] 6 6 True \n", - "974 ['e', 's', 'l'] 4 7 True \n", - "975 ['a', 'i', 't', 'r'] 5 6 True \n", - "976 [] 10 10 True \n", - "977 ['e', 'i'] 8 8 True \n", - "978 ['e'] 8 9 True \n", - "979 [] 12 10 True \n", - "980 ['e'] 6 9 True \n", - "981 ['t', 'm'] 8 8 True \n", - "982 ['s', 'c', 't', 'g', 'p'] 5 5 True \n", - "983 ['m'] 5 9 True \n", - "984 ['s'] 10 9 True \n", - "985 ['f'] 13 9 True \n", - "986 ['p', 'i', 'm'] 8 7 True \n", - "987 [] 10 10 True \n", - "988 ['f'] 9 9 True \n", - "989 [] 8 10 True \n", - "990 ['e', 't', 'k', 'p'] 8 6 True \n", - "991 ['e', 'i', 'o'] 11 7 True \n", - "992 ['d', 'r', 'l'] 6 7 True \n", - "993 ['s', 'd', 't', 'f'] 5 6 True \n", - "994 [] 14 10 True \n", - "995 ['r', 'u'] 6 8 True \n", - "996 ['s', 'r', 'o'] 10 7 True \n", - "997 [] 11 10 True \n", - "998 [] 14 10 True \n", - "999 ['e', 's', 'i', 'a', 'o'] 6 5 True \n", - "\n", - " word length \n", - "0 9 \n", - "1 10 \n", - "2 10 \n", - "3 6 \n", - "4 7 \n", - "5 11 \n", - "6 8 \n", - "7 6 \n", - "8 6 \n", - "9 6 \n", - "10 11 \n", - "11 13 \n", - "12 10 \n", - "13 5 \n", - "14 6 \n", - "15 11 \n", - "16 10 \n", - "17 8 \n", - "18 7 \n", - "19 7 \n", - "20 8 \n", - "21 11 \n", - "22 8 \n", - "23 9 \n", - "24 9 \n", - "25 12 \n", - "26 12 \n", - "27 12 \n", - "28 7 \n", - "29 9 \n", - ".. ... \n", - "970 11 \n", - "971 9 \n", - "972 8 \n", - "973 6 \n", - "974 4 \n", - "975 5 \n", - "976 10 \n", - "977 8 \n", - "978 8 \n", - "979 12 \n", - "980 6 \n", - "981 8 \n", - "982 5 \n", - "983 5 \n", - "984 10 \n", - "985 13 \n", - "986 8 \n", - "987 10 \n", - "988 9 \n", - "989 8 \n", - "990 8 \n", - "991 11 \n", - "992 6 \n", - "993 5 \n", - "994 14 \n", - "995 6 \n", - "996 10 \n", - "997 11 \n", - "998 14 \n", - "999 6 \n", - "\n", - "[1000 rows x 7 columns]" - ] - } - ], - "prompt_number": 14 + "output_type": "execute_result" }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_pattern['lives remaining'].hist()" - ], - "language": "python", + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEjRJREFUeJzt3WuMnNV9x/Gv8UIJWGax0vqGk0GARS1VXVBx0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t_number": 15, - "text": [ - "" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEjRJREFUeJzt3WuMnNV9x/Gv8UIJWGax0vqGk0GARS1VXVBx0puYpA51\nIzC8qACpqbxA84YKsKIktiu1Tl+UGksVqKn8oqGBjYpdLKDUTouxTdleVHFJw6aUxcUmtZrF8UIA\nC3OpisP2xTnDGdaXmR1295x55vuRRjPnmWd2/v6z+59nf/PsAJIkSZIkSZIkSZIkSZIkST2tH3gI\neBEYBT4DLAD2Ai8Be+I+DRuBA8B+4KpZrVSSNCVDwM3xdh9wHrAF+Hrcth7YHG+vAEaAM4EacBA4\nY7YKlSS17zzghyfZvh9YGG8vimsIR+/rm/bbDXx2xqqTJJ1UO0fWFwKvAfcB3we+BZxLGO7jcZ9x\n0rBfAow1PX4MWDodxUqS2tfOgO8DLge2xut3gA2T9pmIl1M53X2SpBnQ18Y+Y/HybFw/RIhhjhCi\nmSPAYuDVeP8rwLKmx18Qt31oyZIlE4cPH+68aknqTS8DF7e7cztH8EeAHwHL43oV8AKwC1gbt60F\nHo23dwI3AmcR4p1LgGeav+Dhw4eZmJjwMjHBpk2bstdQysVe2At7cfoLcFG7wx3aO4IHuA14IA7t\nl4GbgLnADuAW4BBwfdx3NG4fBY4Dt2JEc0qHDh3KXUIx7EViLxJ70bl2B/wPgCtOsn3VKfa/M14k\nSZl4fnpmg4ODuUsohr1I7EViLzo3J9PzTsQ8SZLUpjlz5sAU5rZH8JkNDw/nLqEY9iKxF4m96JwD\nXpIqyohGkrqEEY0kCXDAZ2e+mNiLxF4k9qJzDnhJqigzeEnqEmbwkiTAAZ+d+WJiLxJ7kdiLzjng\nJamizOAlqUuYwUuSAAd8duaLib1I7EViLzrngJekijKDl6QuYQYvSQIc8NmZLyb2IrEXib3onANe\nkirKDF6SuoQZvCQJcM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hFNIe9mVeBYNhOH2LPAD\nwpFrL55FA+FskcZpkkOE33h7yXbC+w//R3jv8ibCm8/7KPQ0SUmSJEmSJEmSJEmSJEmSJEmSJEk6\nwf8D25ze66lP9woAAAAASUVORK5CYII=\n", - "text": [ - "" - ] - } - ], - "prompt_number": 15 - }, + "output_type": "display_data" + } + ], + "source": [ + "adaptive_pattern['lives remaining'].hist()" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_pattern.groupby('lives remaining').size()" - ], - "language": "python", + "data": { + "text/plain": [ + "lives remaining\n", + "0 11\n", + "1 5\n", + "2 5\n", + "3 22\n", + "4 40\n", + "5 42\n", + "6 79\n", + "7 109\n", + "8 161\n", + "9 290\n", + "10 236\n", + "dtype: int64" + ] + }, + "execution_count": 16, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 16, - "text": [ - "lives remaining\n", - "0 11\n", - "1 5\n", - "2 5\n", - "3 22\n", - "4 40\n", - "5 42\n", - "6 79\n", - "7 109\n", - "8 161\n", - "9 290\n", - "10 236\n", - "dtype: int64" - ] - } - ], - "prompt_number": 16 - }, + "output_type": "execute_result" + } + ], + "source": [ + "adaptive_pattern.groupby('lives remaining').size()" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_split = pd.read_csv('adaptive_split.csv')\n", - "adaptive_split" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 punned ['p', 'u', 'n', 'n', 'e', 'd'] ['s', 'r', 'l', 'a', 'i'] 6 5 True
1 anode ['a', 'n', 'o', 'd', 'e'] ['s', 'l', 'b'] 5 7 True
2 passes ['p', 'a', 's', 's', 'e', 's'] ['l', 'b'] 6 8 True
3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 1 True
4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] [] 8 10 True
5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] ['r', 'i', 's', 'd'] 8 6 True
6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... ['r'] 13 9 True
7 tussle ['t', 'u', 's', 's', 'l', 'e'] ['a'] 6 9 True
8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... ['o', 'a', 'b', 's', 'm'] 10 5 True
9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... ['u'] 10 9 True
10 error ['e', 'r', 'r', 'o', 'r'] ['s', 't', 'n', 'l', 'y'] 5 5 True
11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] ['r', 'i', 'l', 'b', 'c'] 7 5 True
12 dress ['d', 'r', 'e', 's', 's'] [] 5 10 True
13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] ['s', 'i', 'a', 'b', 'p'] 8 5 True
14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... ['s', 'g'] 13 8 True
15 reload ['r', 'e', 'l', 'o', 'a', 'd'] ['s', 'i'] 6 8 True
16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... ['p'] 10 9 True
17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... ['o', 'l'] 10 8 True
18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... ['l'] 11 9 True
19 party ['p', 'a', 'r', 't', 'y'] ['s', 'e', 'n', 'd'] 5 6 True
20 rill ['r', 'i', 'l', 'l'] ['e', 's', 'a', 'o', 'u', 'n'] 4 4 True
21 player ['p', 'l', 'a', 'y', 'e', 'r'] ['s', 'm'] 6 8 True
22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] ['i', 'd', 'l'] 9 7 True
23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] ['r', 'i'] 9 8 True
24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] ['a', 't', 'p'] 8 7 True
25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... [] 10 10 True
26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... ['o', 'l', 'g'] 10 7 True
27 scull ['s', 'c', 'u', 'l', 'l'] ['e', 'a', 'o', 'i', 'n'] 5 5 True
28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] ['s', 'a', 'd'] 6 7 True
29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... [] 12 10 True
.....................
970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... ['a', 'u', 'p'] 10 7 True
971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... [] 12 10 True
972 smalls ['s', 'm', 'a', 'l', 'l', 's'] ['e', 't', 'k', 'w'] 6 6 True
973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 3 True
974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... ['o', 'l', 'd', 's'] 11 6 True
975 mint ['_', '_', 'n', 't'] ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 0 False
976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... ['d'] 12 9 True
977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] ['r', 's'] 8 8 True
978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] ['s', 'n', 'c', 'm'] 7 6 True
979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] ['s', 'd', 'c', 'b'] 7 6 True
980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] ['s', 'g', 'a', 'l'] 6 6 True
981 public ['p', 'u', 'b', 'l', 'i', 'c'] ['s', 'r', 'd', 'n', 'a', 'e'] 6 4 True
982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... ['o', 'l'] 10 8 True
983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] ['r'] 7 9 True
984 yacht ['y', 'a', 'c', 'h', 't'] ['s', 'e'] 5 8 True
985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] ['o'] 7 9 True
986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] ['r', 'i', 'a'] 7 7 True
987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] ['t', 'a', 'r', 'n', 'i'] 9 5 True
988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] ['r', 'a', 't'] 8 7 True
989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] ['a', 'o', 't', 'd', 'l'] 7 5 True
990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... ['p', 'r'] 18 8 True
991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] ['s', 'r', 'i', 'n', 'y'] 6 5 True
992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] ['a', 's', 'f', 'd'] 9 6 True
993 weals ['w', 'e', 'a', 'l', 's'] ['r', 'd', 'p', 'm', 'h'] 5 5 True
994 dryer ['d', 'r', 'y', 'e', 'r'] ['s', 'i'] 5 8 True
995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... ['d'] 14 9 True
996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 0 False
997 graded ['g', 'r', 'a', 'd', 'e', 'd'] ['s', 'c', 'v', 'y', 't', 'z'] 6 4 True
998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] ['s', 'l', 'd'] 8 7 True
999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... ['o', 's'] 10 8 True
\n", + "

1000 rows × 6 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 punned ['p', 'u', 'n', 'n', 'e', 'd'] \n", + "1 anode ['a', 'n', 'o', 'd', 'e'] \n", + "2 passes ['p', 'a', 's', 's', 'e', 's'] \n", + "3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] \n", + "4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] \n", + "5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] \n", + "6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... \n", + "7 tussle ['t', 'u', 's', 's', 'l', 'e'] \n", + "8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... \n", + "9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... \n", + "10 error ['e', 'r', 'r', 'o', 'r'] \n", + "11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] \n", + "12 dress ['d', 'r', 'e', 's', 's'] \n", + "13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] \n", + "14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... \n", + "15 reload ['r', 'e', 'l', 'o', 'a', 'd'] \n", + "16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... \n", + "17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... \n", + "18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... \n", + "19 party ['p', 'a', 'r', 't', 'y'] \n", + "20 rill ['r', 'i', 'l', 'l'] \n", + "21 player ['p', 'l', 'a', 'y', 'e', 'r'] \n", + "22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] \n", + "23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] \n", + "24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] \n", + "25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... \n", + "26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... \n", + "27 scull ['s', 'c', 'u', 'l', 'l'] \n", + "28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] \n", + "29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... \n", + ".. ... ... \n", + "970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... \n", + "971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... \n", + "972 smalls ['s', 'm', 'a', 'l', 'l', 's'] \n", + "973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] \n", + "974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... \n", + "975 mint ['_', '_', 'n', 't'] \n", + "976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... \n", + "977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] \n", + "978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] \n", + "979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] \n", + "980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] \n", + "981 public ['p', 'u', 'b', 'l', 'i', 'c'] \n", + "982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... \n", + "983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] \n", + "984 yacht ['y', 'a', 'c', 'h', 't'] \n", + "985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] \n", + "986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] \n", + "987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] \n", + "988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] \n", + "989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] \n", + "990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... \n", + "991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] \n", + "992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] \n", + "993 weals ['w', 'e', 'a', 'l', 's'] \n", + "994 dryer ['d', 'r', 'y', 'e', 'r'] \n", + "995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... \n", + "996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] \n", + "997 graded ['g', 'r', 'a', 'd', 'e', 'd'] \n", + "998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] \n", + "999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... \n", + "\n", + " wrong letters number of hits \\\n", + "0 ['s', 'r', 'l', 'a', 'i'] 6 \n", + "1 ['s', 'l', 'b'] 5 \n", + "2 ['l', 'b'] 6 \n", + "3 ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 \n", + "4 [] 8 \n", + "5 ['r', 'i', 's', 'd'] 8 \n", + "6 ['r'] 13 \n", + "7 ['a'] 6 \n", + "8 ['o', 'a', 'b', 's', 'm'] 10 \n", + "9 ['u'] 10 \n", + "10 ['s', 't', 'n', 'l', 'y'] 5 \n", + "11 ['r', 'i', 'l', 'b', 'c'] 7 \n", + "12 [] 5 \n", + "13 ['s', 'i', 'a', 'b', 'p'] 8 \n", + "14 ['s', 'g'] 13 \n", + "15 ['s', 'i'] 6 \n", + "16 ['p'] 10 \n", + "17 ['o', 'l'] 10 \n", + "18 ['l'] 11 \n", + "19 ['s', 'e', 'n', 'd'] 5 \n", + "20 ['e', 's', 'a', 'o', 'u', 'n'] 4 \n", + "21 ['s', 'm'] 6 \n", + "22 ['i', 'd', 'l'] 9 \n", + "23 ['r', 'i'] 9 \n", + "24 ['a', 't', 'p'] 8 \n", + "25 [] 10 \n", + "26 ['o', 'l', 'g'] 10 \n", + "27 ['e', 'a', 'o', 'i', 'n'] 5 \n", + "28 ['s', 'a', 'd'] 6 \n", + "29 [] 12 \n", + ".. ... ... \n", + "970 ['a', 'u', 'p'] 10 \n", + "971 [] 12 \n", + "972 ['e', 't', 'k', 'w'] 6 \n", + "973 ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 \n", + "974 ['o', 'l', 'd', 's'] 11 \n", + "975 ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 \n", + "976 ['d'] 12 \n", + "977 ['r', 's'] 8 \n", + "978 ['s', 'n', 'c', 'm'] 7 \n", + "979 ['s', 'd', 'c', 'b'] 7 \n", + "980 ['s', 'g', 'a', 'l'] 6 \n", + "981 ['s', 'r', 'd', 'n', 'a', 'e'] 6 \n", + "982 ['o', 'l'] 10 \n", + "983 ['r'] 7 \n", + "984 ['s', 'e'] 5 \n", + "985 ['o'] 7 \n", + "986 ['r', 'i', 'a'] 7 \n", + "987 ['t', 'a', 'r', 'n', 'i'] 9 \n", + "988 ['r', 'a', 't'] 8 \n", + "989 ['a', 'o', 't', 'd', 'l'] 7 \n", + "990 ['p', 'r'] 18 \n", + "991 ['s', 'r', 'i', 'n', 'y'] 6 \n", + "992 ['a', 's', 'f', 'd'] 9 \n", + "993 ['r', 'd', 'p', 'm', 'h'] 5 \n", + "994 ['s', 'i'] 5 \n", + "995 ['d'] 14 \n", + "996 ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 \n", + "997 ['s', 'c', 'v', 'y', 't', 'z'] 6 \n", + "998 ['s', 'l', 'd'] 8 \n", + "999 ['o', 's'] 10 \n", + "\n", + " lives remaining game won \n", + "0 5 True \n", + "1 7 True \n", + "2 8 True \n", + "3 1 True \n", + "4 10 True \n", + "5 6 True \n", + "6 9 True \n", + "7 9 True \n", + "8 5 True \n", + "9 9 True \n", + "10 5 True \n", + "11 5 True \n", + "12 10 True \n", + "13 5 True \n", + "14 8 True \n", + "15 8 True \n", + "16 9 True \n", + "17 8 True \n", + "18 9 True \n", + "19 6 True \n", + "20 4 True \n", + "21 8 True \n", + "22 7 True \n", + "23 8 True \n", + "24 7 True \n", + "25 10 True \n", + "26 7 True \n", + "27 5 True \n", + "28 7 True \n", + "29 10 True \n", + ".. ... ... \n", + "970 7 True \n", + "971 10 True \n", + "972 6 True \n", + "973 3 True \n", + "974 6 True \n", + "975 0 False \n", + "976 9 True \n", + "977 8 True \n", + "978 6 True \n", + "979 6 True \n", + "980 6 True \n", + "981 4 True \n", + "982 8 True \n", + "983 9 True \n", + "984 8 True \n", + "985 9 True \n", + "986 7 True \n", + "987 5 True \n", + "988 7 True \n", + "989 5 True \n", + "990 8 True \n", + "991 5 True \n", + "992 6 True \n", + "993 5 True \n", + "994 8 True \n", + "995 9 True \n", + "996 0 False \n", + "997 4 True \n", + "998 7 True \n", + "999 8 True \n", + "\n", + "[1000 rows x 6 columns]" + ] + }, + "execution_count": 19, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame won
0 punned ['p', 'u', 'n', 'n', 'e', 'd'] ['s', 'r', 'l', 'a', 'i'] 6 5 True
1 anode ['a', 'n', 'o', 'd', 'e'] ['s', 'l', 'b'] 5 7 True
2 passes ['p', 'a', 's', 's', 'e', 's'] ['l', 'b'] 6 8 True
3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 1 True
4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] [] 8 10 True
5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] ['r', 'i', 's', 'd'] 8 6 True
6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... ['r'] 13 9 True
7 tussle ['t', 'u', 's', 's', 'l', 'e'] ['a'] 6 9 True
8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... ['o', 'a', 'b', 's', 'm'] 10 5 True
9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... ['u'] 10 9 True
10 error ['e', 'r', 'r', 'o', 'r'] ['s', 't', 'n', 'l', 'y'] 5 5 True
11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] ['r', 'i', 'l', 'b', 'c'] 7 5 True
12 dress ['d', 'r', 'e', 's', 's'] [] 5 10 True
13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] ['s', 'i', 'a', 'b', 'p'] 8 5 True
14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... ['s', 'g'] 13 8 True
15 reload ['r', 'e', 'l', 'o', 'a', 'd'] ['s', 'i'] 6 8 True
16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... ['p'] 10 9 True
17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... ['o', 'l'] 10 8 True
18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... ['l'] 11 9 True
19 party ['p', 'a', 'r', 't', 'y'] ['s', 'e', 'n', 'd'] 5 6 True
20 rill ['r', 'i', 'l', 'l'] ['e', 's', 'a', 'o', 'u', 'n'] 4 4 True
21 player ['p', 'l', 'a', 'y', 'e', 'r'] ['s', 'm'] 6 8 True
22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] ['i', 'd', 'l'] 9 7 True
23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] ['r', 'i'] 9 8 True
24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] ['a', 't', 'p'] 8 7 True
25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... [] 10 10 True
26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... ['o', 'l', 'g'] 10 7 True
27 scull ['s', 'c', 'u', 'l', 'l'] ['e', 'a', 'o', 'i', 'n'] 5 5 True
28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] ['s', 'a', 'd'] 6 7 True
29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... [] 12 10 True
.....................
970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... ['a', 'u', 'p'] 10 7 True
971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... [] 12 10 True
972 smalls ['s', 'm', 'a', 'l', 'l', 's'] ['e', 't', 'k', 'w'] 6 6 True
973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 3 True
974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... ['o', 'l', 'd', 's'] 11 6 True
975 mint ['_', '_', 'n', 't'] ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 0 False
976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... ['d'] 12 9 True
977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] ['r', 's'] 8 8 True
978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] ['s', 'n', 'c', 'm'] 7 6 True
979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] ['s', 'd', 'c', 'b'] 7 6 True
980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] ['s', 'g', 'a', 'l'] 6 6 True
981 public ['p', 'u', 'b', 'l', 'i', 'c'] ['s', 'r', 'd', 'n', 'a', 'e'] 6 4 True
982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... ['o', 'l'] 10 8 True
983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] ['r'] 7 9 True
984 yacht ['y', 'a', 'c', 'h', 't'] ['s', 'e'] 5 8 True
985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] ['o'] 7 9 True
986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] ['r', 'i', 'a'] 7 7 True
987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] ['t', 'a', 'r', 'n', 'i'] 9 5 True
988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] ['r', 'a', 't'] 8 7 True
989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] ['a', 'o', 't', 'd', 'l'] 7 5 True
990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... ['p', 'r'] 18 8 True
991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] ['s', 'r', 'i', 'n', 'y'] 6 5 True
992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] ['a', 's', 'f', 'd'] 9 6 True
993 weals ['w', 'e', 'a', 'l', 's'] ['r', 'd', 'p', 'm', 'h'] 5 5 True
994 dryer ['d', 'r', 'y', 'e', 'r'] ['s', 'i'] 5 8 True
995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... ['d'] 14 9 True
996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 0 False
997 graded ['g', 'r', 'a', 'd', 'e', 'd'] ['s', 'c', 'v', 'y', 't', 'z'] 6 4 True
998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] ['s', 'l', 'd'] 8 7 True
999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... ['o', 's'] 10 8 True
\n", - "

1000 rows \u00d7 6 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 19, - "text": [ - " target discovered \\\n", - "0 punned ['p', 'u', 'n', 'n', 'e', 'd'] \n", - "1 anode ['a', 'n', 'o', 'd', 'e'] \n", - "2 passes ['p', 'a', 's', 's', 'e', 's'] \n", - "3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] \n", - "4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] \n", - "5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] \n", - "6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... \n", - "7 tussle ['t', 'u', 's', 's', 'l', 'e'] \n", - "8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... \n", - "9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... \n", - "10 error ['e', 'r', 'r', 'o', 'r'] \n", - "11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] \n", - "12 dress ['d', 'r', 'e', 's', 's'] \n", - "13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] \n", - "14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... \n", - "15 reload ['r', 'e', 'l', 'o', 'a', 'd'] \n", - "16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... \n", - "17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... \n", - "18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... \n", - "19 party ['p', 'a', 'r', 't', 'y'] \n", - "20 rill ['r', 'i', 'l', 'l'] \n", - "21 player ['p', 'l', 'a', 'y', 'e', 'r'] \n", - "22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] \n", - "23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] \n", - "24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] \n", - "25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... \n", - "26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... \n", - "27 scull ['s', 'c', 'u', 'l', 'l'] \n", - "28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] \n", - "29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... \n", - ".. ... ... \n", - "970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... \n", - "971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... \n", - "972 smalls ['s', 'm', 'a', 'l', 'l', 's'] \n", - "973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] \n", - "974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... \n", - "975 mint ['_', '_', 'n', 't'] \n", - "976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... \n", - "977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] \n", - "978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] \n", - "979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] \n", - "980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] \n", - "981 public ['p', 'u', 'b', 'l', 'i', 'c'] \n", - "982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... \n", - "983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] \n", - "984 yacht ['y', 'a', 'c', 'h', 't'] \n", - "985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] \n", - "986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] \n", - "987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] \n", - "988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] \n", - "989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] \n", - "990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... \n", - "991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] \n", - "992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] \n", - "993 weals ['w', 'e', 'a', 'l', 's'] \n", - "994 dryer ['d', 'r', 'y', 'e', 'r'] \n", - "995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... \n", - "996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] \n", - "997 graded ['g', 'r', 'a', 'd', 'e', 'd'] \n", - "998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] \n", - "999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... \n", - "\n", - " wrong letters number of hits \\\n", - "0 ['s', 'r', 'l', 'a', 'i'] 6 \n", - "1 ['s', 'l', 'b'] 5 \n", - "2 ['l', 'b'] 6 \n", - "3 ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 \n", - "4 [] 8 \n", - "5 ['r', 'i', 's', 'd'] 8 \n", - "6 ['r'] 13 \n", - "7 ['a'] 6 \n", - "8 ['o', 'a', 'b', 's', 'm'] 10 \n", - "9 ['u'] 10 \n", - "10 ['s', 't', 'n', 'l', 'y'] 5 \n", - "11 ['r', 'i', 'l', 'b', 'c'] 7 \n", - "12 [] 5 \n", - "13 ['s', 'i', 'a', 'b', 'p'] 8 \n", - "14 ['s', 'g'] 13 \n", - "15 ['s', 'i'] 6 \n", - "16 ['p'] 10 \n", - "17 ['o', 'l'] 10 \n", - "18 ['l'] 11 \n", - "19 ['s', 'e', 'n', 'd'] 5 \n", - "20 ['e', 's', 'a', 'o', 'u', 'n'] 4 \n", - "21 ['s', 'm'] 6 \n", - "22 ['i', 'd', 'l'] 9 \n", - "23 ['r', 'i'] 9 \n", - "24 ['a', 't', 'p'] 8 \n", - "25 [] 10 \n", - "26 ['o', 'l', 'g'] 10 \n", - "27 ['e', 'a', 'o', 'i', 'n'] 5 \n", - "28 ['s', 'a', 'd'] 6 \n", - "29 [] 12 \n", - ".. ... ... \n", - "970 ['a', 'u', 'p'] 10 \n", - "971 [] 12 \n", - "972 ['e', 't', 'k', 'w'] 6 \n", - "973 ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 \n", - "974 ['o', 'l', 'd', 's'] 11 \n", - "975 ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 \n", - "976 ['d'] 12 \n", - "977 ['r', 's'] 8 \n", - "978 ['s', 'n', 'c', 'm'] 7 \n", - "979 ['s', 'd', 'c', 'b'] 7 \n", - "980 ['s', 'g', 'a', 'l'] 6 \n", - "981 ['s', 'r', 'd', 'n', 'a', 'e'] 6 \n", - "982 ['o', 'l'] 10 \n", - "983 ['r'] 7 \n", - "984 ['s', 'e'] 5 \n", - "985 ['o'] 7 \n", - "986 ['r', 'i', 'a'] 7 \n", - "987 ['t', 'a', 'r', 'n', 'i'] 9 \n", - "988 ['r', 'a', 't'] 8 \n", - "989 ['a', 'o', 't', 'd', 'l'] 7 \n", - "990 ['p', 'r'] 18 \n", - "991 ['s', 'r', 'i', 'n', 'y'] 6 \n", - "992 ['a', 's', 'f', 'd'] 9 \n", - "993 ['r', 'd', 'p', 'm', 'h'] 5 \n", - "994 ['s', 'i'] 5 \n", - "995 ['d'] 14 \n", - "996 ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 \n", - "997 ['s', 'c', 'v', 'y', 't', 'z'] 6 \n", - "998 ['s', 'l', 'd'] 8 \n", - "999 ['o', 's'] 10 \n", - "\n", - " lives remaining game won \n", - "0 5 True \n", - "1 7 True \n", - "2 8 True \n", - "3 1 True \n", - "4 10 True \n", - "5 6 True \n", - "6 9 True \n", - "7 9 True \n", - "8 5 True \n", - "9 9 True \n", - "10 5 True \n", - "11 5 True \n", - "12 10 True \n", - "13 5 True \n", - "14 8 True \n", - "15 8 True \n", - "16 9 True \n", - "17 8 True \n", - "18 9 True \n", - "19 6 True \n", - "20 4 True \n", - "21 8 True \n", - "22 7 True \n", - "23 8 True \n", - "24 7 True \n", - "25 10 True \n", - "26 7 True \n", - "27 5 True \n", - "28 7 True \n", - "29 10 True \n", - ".. ... ... \n", - "970 7 True \n", - "971 10 True \n", - "972 6 True \n", - "973 3 True \n", - "974 6 True \n", - "975 0 False \n", - "976 9 True \n", - "977 8 True \n", - "978 6 True \n", - "979 6 True \n", - "980 6 True \n", - "981 4 True \n", - "982 8 True \n", - "983 9 True \n", - "984 8 True \n", - "985 9 True \n", - "986 7 True \n", - "987 5 True \n", - "988 7 True \n", - "989 5 True \n", - "990 8 True \n", - "991 5 True \n", - "992 6 True \n", - "993 5 True \n", - "994 8 True \n", - "995 9 True \n", - "996 0 False \n", - "997 4 True \n", - "998 7 True \n", - "999 8 True \n", - "\n", - "[1000 rows x 6 columns]" - ] - } - ], - "prompt_number": 19 - }, + "output_type": "execute_result" + } + ], + "source": [ + "adaptive_split = pd.read_csv('adaptive_split.csv')\n", + "adaptive_split" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_split['word length'] = adaptive_split.apply(lambda r: len(r['target']), axis=1)\n", - "adaptive_split" - ], - "language": "python", + "data": { + "text/html": [ + "
\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 punned ['p', 'u', 'n', 'n', 'e', 'd'] ['s', 'r', 'l', 'a', 'i'] 6 5 True 6
1 anode ['a', 'n', 'o', 'd', 'e'] ['s', 'l', 'b'] 5 7 True 5
2 passes ['p', 'a', 's', 's', 'e', 's'] ['l', 'b'] 6 8 True 6
3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 1 True 6
4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] [] 8 10 True 8
5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] ['r', 'i', 's', 'd'] 8 6 True 8
6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... ['r'] 13 9 True 13
7 tussle ['t', 'u', 's', 's', 'l', 'e'] ['a'] 6 9 True 6
8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... ['o', 'a', 'b', 's', 'm'] 10 5 True 10
9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... ['u'] 10 9 True 10
10 error ['e', 'r', 'r', 'o', 'r'] ['s', 't', 'n', 'l', 'y'] 5 5 True 5
11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] ['r', 'i', 'l', 'b', 'c'] 7 5 True 7
12 dress ['d', 'r', 'e', 's', 's'] [] 5 10 True 5
13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] ['s', 'i', 'a', 'b', 'p'] 8 5 True 8
14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... ['s', 'g'] 13 8 True 13
15 reload ['r', 'e', 'l', 'o', 'a', 'd'] ['s', 'i'] 6 8 True 6
16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... ['p'] 10 9 True 10
17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... ['o', 'l'] 10 8 True 10
18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... ['l'] 11 9 True 11
19 party ['p', 'a', 'r', 't', 'y'] ['s', 'e', 'n', 'd'] 5 6 True 5
20 rill ['r', 'i', 'l', 'l'] ['e', 's', 'a', 'o', 'u', 'n'] 4 4 True 4
21 player ['p', 'l', 'a', 'y', 'e', 'r'] ['s', 'm'] 6 8 True 6
22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] ['i', 'd', 'l'] 9 7 True 9
23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] ['r', 'i'] 9 8 True 9
24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] ['a', 't', 'p'] 8 7 True 8
25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... [] 10 10 True 10
26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... ['o', 'l', 'g'] 10 7 True 10
27 scull ['s', 'c', 'u', 'l', 'l'] ['e', 'a', 'o', 'i', 'n'] 5 5 True 5
28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] ['s', 'a', 'd'] 6 7 True 6
29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... [] 12 10 True 12
........................
970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... ['a', 'u', 'p'] 10 7 True 10
971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... [] 12 10 True 12
972 smalls ['s', 'm', 'a', 'l', 'l', 's'] ['e', 't', 'k', 'w'] 6 6 True 6
973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 3 True 7
974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... ['o', 'l', 'd', 's'] 11 6 True 11
975 mint ['_', '_', 'n', 't'] ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 0 False 4
976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... ['d'] 12 9 True 12
977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] ['r', 's'] 8 8 True 8
978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] ['s', 'n', 'c', 'm'] 7 6 True 7
979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] ['s', 'd', 'c', 'b'] 7 6 True 7
980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] ['s', 'g', 'a', 'l'] 6 6 True 6
981 public ['p', 'u', 'b', 'l', 'i', 'c'] ['s', 'r', 'd', 'n', 'a', 'e'] 6 4 True 6
982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... ['o', 'l'] 10 8 True 10
983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] ['r'] 7 9 True 7
984 yacht ['y', 'a', 'c', 'h', 't'] ['s', 'e'] 5 8 True 5
985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] ['o'] 7 9 True 7
986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] ['r', 'i', 'a'] 7 7 True 7
987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] ['t', 'a', 'r', 'n', 'i'] 9 5 True 9
988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] ['r', 'a', 't'] 8 7 True 8
989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] ['a', 'o', 't', 'd', 'l'] 7 5 True 7
990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... ['p', 'r'] 18 8 True 18
991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] ['s', 'r', 'i', 'n', 'y'] 6 5 True 6
992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] ['a', 's', 'f', 'd'] 9 6 True 9
993 weals ['w', 'e', 'a', 'l', 's'] ['r', 'd', 'p', 'm', 'h'] 5 5 True 5
994 dryer ['d', 'r', 'y', 'e', 'r'] ['s', 'i'] 5 8 True 5
995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... ['d'] 14 9 True 14
996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 0 False 9
997 graded ['g', 'r', 'a', 'd', 'e', 'd'] ['s', 'c', 'v', 'y', 't', 'z'] 6 4 True 6
998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] ['s', 'l', 'd'] 8 7 True 8
999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... ['o', 's'] 10 8 True 10
\n", + "

1000 rows × 7 columns

\n", + "
" + ], + "text/plain": [ + " target discovered \\\n", + "0 punned ['p', 'u', 'n', 'n', 'e', 'd'] \n", + "1 anode ['a', 'n', 'o', 'd', 'e'] \n", + "2 passes ['p', 'a', 's', 's', 'e', 's'] \n", + "3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] \n", + "4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] \n", + "5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] \n", + "6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... \n", + "7 tussle ['t', 'u', 's', 's', 'l', 'e'] \n", + "8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... \n", + "9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... \n", + "10 error ['e', 'r', 'r', 'o', 'r'] \n", + "11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] \n", + "12 dress ['d', 'r', 'e', 's', 's'] \n", + "13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] \n", + "14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... \n", + "15 reload ['r', 'e', 'l', 'o', 'a', 'd'] \n", + "16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... \n", + "17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... \n", + "18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... \n", + "19 party ['p', 'a', 'r', 't', 'y'] \n", + "20 rill ['r', 'i', 'l', 'l'] \n", + "21 player ['p', 'l', 'a', 'y', 'e', 'r'] \n", + "22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] \n", + "23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] \n", + "24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] \n", + "25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... \n", + "26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... \n", + "27 scull ['s', 'c', 'u', 'l', 'l'] \n", + "28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] \n", + "29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... \n", + ".. ... ... \n", + "970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... \n", + "971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... \n", + "972 smalls ['s', 'm', 'a', 'l', 'l', 's'] \n", + "973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] \n", + "974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... \n", + "975 mint ['_', '_', 'n', 't'] \n", + "976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... \n", + "977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] \n", + "978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] \n", + "979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] \n", + "980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] \n", + "981 public ['p', 'u', 'b', 'l', 'i', 'c'] \n", + "982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... \n", + "983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] \n", + "984 yacht ['y', 'a', 'c', 'h', 't'] \n", + "985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] \n", + "986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] \n", + "987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] \n", + "988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] \n", + "989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] \n", + "990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... \n", + "991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] \n", + "992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] \n", + "993 weals ['w', 'e', 'a', 'l', 's'] \n", + "994 dryer ['d', 'r', 'y', 'e', 'r'] \n", + "995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... \n", + "996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] \n", + "997 graded ['g', 'r', 'a', 'd', 'e', 'd'] \n", + "998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] \n", + "999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... \n", + "\n", + " wrong letters number of hits \\\n", + "0 ['s', 'r', 'l', 'a', 'i'] 6 \n", + "1 ['s', 'l', 'b'] 5 \n", + "2 ['l', 'b'] 6 \n", + "3 ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 \n", + "4 [] 8 \n", + "5 ['r', 'i', 's', 'd'] 8 \n", + "6 ['r'] 13 \n", + "7 ['a'] 6 \n", + "8 ['o', 'a', 'b', 's', 'm'] 10 \n", + "9 ['u'] 10 \n", + "10 ['s', 't', 'n', 'l', 'y'] 5 \n", + "11 ['r', 'i', 'l', 'b', 'c'] 7 \n", + "12 [] 5 \n", + "13 ['s', 'i', 'a', 'b', 'p'] 8 \n", + "14 ['s', 'g'] 13 \n", + "15 ['s', 'i'] 6 \n", + "16 ['p'] 10 \n", + "17 ['o', 'l'] 10 \n", + "18 ['l'] 11 \n", + "19 ['s', 'e', 'n', 'd'] 5 \n", + "20 ['e', 's', 'a', 'o', 'u', 'n'] 4 \n", + "21 ['s', 'm'] 6 \n", + "22 ['i', 'd', 'l'] 9 \n", + "23 ['r', 'i'] 9 \n", + "24 ['a', 't', 'p'] 8 \n", + "25 [] 10 \n", + "26 ['o', 'l', 'g'] 10 \n", + "27 ['e', 'a', 'o', 'i', 'n'] 5 \n", + "28 ['s', 'a', 'd'] 6 \n", + "29 [] 12 \n", + ".. ... ... \n", + "970 ['a', 'u', 'p'] 10 \n", + "971 [] 12 \n", + "972 ['e', 't', 'k', 'w'] 6 \n", + "973 ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 \n", + "974 ['o', 'l', 'd', 's'] 11 \n", + "975 ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 \n", + "976 ['d'] 12 \n", + "977 ['r', 's'] 8 \n", + "978 ['s', 'n', 'c', 'm'] 7 \n", + "979 ['s', 'd', 'c', 'b'] 7 \n", + "980 ['s', 'g', 'a', 'l'] 6 \n", + "981 ['s', 'r', 'd', 'n', 'a', 'e'] 6 \n", + "982 ['o', 'l'] 10 \n", + "983 ['r'] 7 \n", + "984 ['s', 'e'] 5 \n", + "985 ['o'] 7 \n", + "986 ['r', 'i', 'a'] 7 \n", + "987 ['t', 'a', 'r', 'n', 'i'] 9 \n", + "988 ['r', 'a', 't'] 8 \n", + "989 ['a', 'o', 't', 'd', 'l'] 7 \n", + "990 ['p', 'r'] 18 \n", + "991 ['s', 'r', 'i', 'n', 'y'] 6 \n", + "992 ['a', 's', 'f', 'd'] 9 \n", + "993 ['r', 'd', 'p', 'm', 'h'] 5 \n", + "994 ['s', 'i'] 5 \n", + "995 ['d'] 14 \n", + "996 ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 \n", + "997 ['s', 'c', 'v', 'y', 't', 'z'] 6 \n", + "998 ['s', 'l', 'd'] 8 \n", + "999 ['o', 's'] 10 \n", + "\n", + " lives remaining game won word length \n", + "0 5 True 6 \n", + "1 7 True 5 \n", + "2 8 True 6 \n", + "3 1 True 6 \n", + "4 10 True 8 \n", + "5 6 True 8 \n", + "6 9 True 13 \n", + "7 9 True 6 \n", + "8 5 True 10 \n", + "9 9 True 10 \n", + "10 5 True 5 \n", + "11 5 True 7 \n", + "12 10 True 5 \n", + "13 5 True 8 \n", + "14 8 True 13 \n", + "15 8 True 6 \n", + "16 9 True 10 \n", + "17 8 True 10 \n", + "18 9 True 11 \n", + "19 6 True 5 \n", + "20 4 True 4 \n", + "21 8 True 6 \n", + "22 7 True 9 \n", + "23 8 True 9 \n", + "24 7 True 8 \n", + "25 10 True 10 \n", + "26 7 True 10 \n", + "27 5 True 5 \n", + "28 7 True 6 \n", + "29 10 True 12 \n", + ".. ... ... ... \n", + "970 7 True 10 \n", + "971 10 True 12 \n", + "972 6 True 6 \n", + "973 3 True 7 \n", + "974 6 True 11 \n", + "975 0 False 4 \n", + "976 9 True 12 \n", + "977 8 True 8 \n", + "978 6 True 7 \n", + "979 6 True 7 \n", + "980 6 True 6 \n", + "981 4 True 6 \n", + "982 8 True 10 \n", + "983 9 True 7 \n", + "984 8 True 5 \n", + "985 9 True 7 \n", + "986 7 True 7 \n", + "987 5 True 9 \n", + "988 7 True 8 \n", + "989 5 True 7 \n", + "990 8 True 18 \n", + "991 5 True 6 \n", + "992 6 True 9 \n", + "993 5 True 5 \n", + "994 8 True 5 \n", + "995 9 True 14 \n", + "996 0 False 9 \n", + "997 4 True 6 \n", + "998 7 True 8 \n", + "999 8 True 10 \n", + "\n", + "[1000 rows x 7 columns]" + ] + }, + "execution_count": 20, "metadata": {}, - "outputs": [ - { - "html": [ - "
\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
targetdiscoveredwrong lettersnumber of hitslives remaininggame wonword length
0 punned ['p', 'u', 'n', 'n', 'e', 'd'] ['s', 'r', 'l', 'a', 'i'] 6 5 True 6
1 anode ['a', 'n', 'o', 'd', 'e'] ['s', 'l', 'b'] 5 7 True 5
2 passes ['p', 'a', 's', 's', 'e', 's'] ['l', 'b'] 6 8 True 6
3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 1 True 6
4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] [] 8 10 True 8
5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] ['r', 'i', 's', 'd'] 8 6 True 8
6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... ['r'] 13 9 True 13
7 tussle ['t', 'u', 's', 's', 'l', 'e'] ['a'] 6 9 True 6
8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... ['o', 'a', 'b', 's', 'm'] 10 5 True 10
9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... ['u'] 10 9 True 10
10 error ['e', 'r', 'r', 'o', 'r'] ['s', 't', 'n', 'l', 'y'] 5 5 True 5
11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] ['r', 'i', 'l', 'b', 'c'] 7 5 True 7
12 dress ['d', 'r', 'e', 's', 's'] [] 5 10 True 5
13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] ['s', 'i', 'a', 'b', 'p'] 8 5 True 8
14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... ['s', 'g'] 13 8 True 13
15 reload ['r', 'e', 'l', 'o', 'a', 'd'] ['s', 'i'] 6 8 True 6
16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... ['p'] 10 9 True 10
17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... ['o', 'l'] 10 8 True 10
18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... ['l'] 11 9 True 11
19 party ['p', 'a', 'r', 't', 'y'] ['s', 'e', 'n', 'd'] 5 6 True 5
20 rill ['r', 'i', 'l', 'l'] ['e', 's', 'a', 'o', 'u', 'n'] 4 4 True 4
21 player ['p', 'l', 'a', 'y', 'e', 'r'] ['s', 'm'] 6 8 True 6
22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] ['i', 'd', 'l'] 9 7 True 9
23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] ['r', 'i'] 9 8 True 9
24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] ['a', 't', 'p'] 8 7 True 8
25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... [] 10 10 True 10
26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... ['o', 'l', 'g'] 10 7 True 10
27 scull ['s', 'c', 'u', 'l', 'l'] ['e', 'a', 'o', 'i', 'n'] 5 5 True 5
28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] ['s', 'a', 'd'] 6 7 True 6
29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... [] 12 10 True 12
........................
970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... ['a', 'u', 'p'] 10 7 True 10
971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... [] 12 10 True 12
972 smalls ['s', 'm', 'a', 'l', 'l', 's'] ['e', 't', 'k', 'w'] 6 6 True 6
973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 3 True 7
974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... ['o', 'l', 'd', 's'] 11 6 True 11
975 mint ['_', '_', 'n', 't'] ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 0 False 4
976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... ['d'] 12 9 True 12
977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] ['r', 's'] 8 8 True 8
978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] ['s', 'n', 'c', 'm'] 7 6 True 7
979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] ['s', 'd', 'c', 'b'] 7 6 True 7
980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] ['s', 'g', 'a', 'l'] 6 6 True 6
981 public ['p', 'u', 'b', 'l', 'i', 'c'] ['s', 'r', 'd', 'n', 'a', 'e'] 6 4 True 6
982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... ['o', 'l'] 10 8 True 10
983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] ['r'] 7 9 True 7
984 yacht ['y', 'a', 'c', 'h', 't'] ['s', 'e'] 5 8 True 5
985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] ['o'] 7 9 True 7
986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] ['r', 'i', 'a'] 7 7 True 7
987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] ['t', 'a', 'r', 'n', 'i'] 9 5 True 9
988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] ['r', 'a', 't'] 8 7 True 8
989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] ['a', 'o', 't', 'd', 'l'] 7 5 True 7
990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... ['p', 'r'] 18 8 True 18
991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] ['s', 'r', 'i', 'n', 'y'] 6 5 True 6
992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] ['a', 's', 'f', 'd'] 9 6 True 9
993 weals ['w', 'e', 'a', 'l', 's'] ['r', 'd', 'p', 'm', 'h'] 5 5 True 5
994 dryer ['d', 'r', 'y', 'e', 'r'] ['s', 'i'] 5 8 True 5
995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... ['d'] 14 9 True 14
996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 0 False 9
997 graded ['g', 'r', 'a', 'd', 'e', 'd'] ['s', 'c', 'v', 'y', 't', 'z'] 6 4 True 6
998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] ['s', 'l', 'd'] 8 7 True 8
999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... ['o', 's'] 10 8 True 10
\n", - "

1000 rows \u00d7 7 columns

\n", - "
" - ], - "metadata": {}, - "output_type": "pyout", - "prompt_number": 20, - "text": [ - " target discovered \\\n", - "0 punned ['p', 'u', 'n', 'n', 'e', 'd'] \n", - "1 anode ['a', 'n', 'o', 'd', 'e'] \n", - "2 passes ['p', 'a', 's', 's', 'e', 's'] \n", - "3 maxing ['m', 'a', 'x', 'i', 'n', 'g'] \n", - "4 quadrant ['q', 'u', 'a', 'd', 'r', 'a', 'n', 't'] \n", - "5 polygamy ['p', 'o', 'l', 'y', 'g', 'a', 'm', 'y'] \n", - "6 technologists ['t', 'e', 'c', 'h', 'n', 'o', 'l', 'o', 'g', ... \n", - "7 tussle ['t', 'u', 's', 's', 'l', 'e'] \n", - "8 explicitly ['e', 'x', 'p', 'l', 'i', 'c', 'i', 't', 'l', ... \n", - "9 moderators ['m', 'o', 'd', 'e', 'r', 'a', 't', 'o', 'r', ... \n", - "10 error ['e', 'r', 'r', 'o', 'r'] \n", - "11 stamped ['s', 't', 'a', 'm', 'p', 'e', 'd'] \n", - "12 dress ['d', 'r', 'e', 's', 's'] \n", - "13 truckled ['t', 'r', 'u', 'c', 'k', 'l', 'e', 'd'] \n", - "14 accommodation ['a', 'c', 'c', 'o', 'm', 'm', 'o', 'd', 'a', ... \n", - "15 reload ['r', 'e', 'l', 'o', 'a', 'd'] \n", - "16 confounded ['c', 'o', 'n', 'f', 'o', 'u', 'n', 'd', 'e', ... \n", - "17 racketeers ['r', 'a', 'c', 'k', 'e', 't', 'e', 'e', 'r', ... \n", - "18 ignoramuses ['i', 'g', 'n', 'o', 'r', 'a', 'm', 'u', 's', ... \n", - "19 party ['p', 'a', 'r', 't', 'y'] \n", - "20 rill ['r', 'i', 'l', 'l'] \n", - "21 player ['p', 'l', 'a', 'y', 'e', 'r'] \n", - "22 protester ['p', 'r', 'o', 't', 'e', 's', 't', 'e', 'r'] \n", - "23 asphalted ['a', 's', 'p', 'h', 'a', 'l', 't', 'e', 'd'] \n", - "24 uniforms ['u', 'n', 'i', 'f', 'o', 'r', 'm', 's'] \n", - "25 coniferous ['c', 'o', 'n', 'i', 'f', 'e', 'r', 'o', 'u', ... \n", - "26 dishearten ['d', 'i', 's', 'h', 'e', 'a', 'r', 't', 'e', ... \n", - "27 scull ['s', 'c', 'u', 'l', 'l'] \n", - "28 virgin ['v', 'i', 'r', 'g', 'i', 'n'] \n", - "29 licentiously ['l', 'i', 'c', 'e', 'n', 't', 'i', 'o', 'u', ... \n", - ".. ... ... \n", - "970 grindstone ['g', 'r', 'i', 'n', 'd', 's', 't', 'o', 'n', ... \n", - "971 bankruptcies ['b', 'a', 'n', 'k', 'r', 'u', 'p', 't', 'c', ... \n", - "972 smalls ['s', 'm', 'a', 'l', 'l', 's'] \n", - "973 limping ['l', 'i', 'm', 'p', 'i', 'n', 'g'] \n", - "974 interfacing ['i', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'i', ... \n", - "975 mint ['_', '_', 'n', 't'] \n", - "976 romanticises ['r', 'o', 'm', 'a', 'n', 't', 'i', 'c', 'i', ... \n", - "977 cleavage ['c', 'l', 'e', 'a', 'v', 'a', 'g', 'e'] \n", - "978 revival ['r', 'e', 'v', 'i', 'v', 'a', 'l'] \n", - "979 praying ['p', 'r', 'a', 'y', 'i', 'n', 'g'] \n", - "980 troupe ['t', 'r', 'o', 'u', 'p', 'e'] \n", - "981 public ['p', 'u', 'b', 'l', 'i', 'c'] \n", - "982 generating ['g', 'e', 'n', 'e', 'r', 'a', 't', 'i', 'n', ... \n", - "983 sallies ['s', 'a', 'l', 'l', 'i', 'e', 's'] \n", - "984 yacht ['y', 'a', 'c', 'h', 't'] \n", - "985 armpits ['a', 'r', 'm', 'p', 'i', 't', 's'] \n", - "986 oblongs ['o', 'b', 'l', 'o', 'n', 'g', 's'] \n", - "987 developed ['d', 'e', 'v', 'e', 'l', 'o', 'p', 'e', 'd'] \n", - "988 demolish ['d', 'e', 'm', 'o', 'l', 'i', 's', 'h'] \n", - "989 pincers ['p', 'i', 'n', 'c', 'e', 'r', 's'] \n", - "990 telecommunications ['t', 'e', 'l', 'e', 'c', 'o', 'm', 'm', 'u', ... \n", - "991 dabble ['d', 'a', 'b', 'b', 'l', 'e'] \n", - "992 morticing ['m', 'o', 'r', 't', 'i', 'c', 'i', 'n', 'g'] \n", - "993 weals ['w', 'e', 'a', 'l', 's'] \n", - "994 dryer ['d', 'r', 'y', 'e', 'r'] \n", - "995 inconclusively ['i', 'n', 'c', 'o', 'n', 'c', 'l', 'u', 's', ... \n", - "996 bubbliest ['_', '_', '_', '_', '_', '_', '_', '_', 't'] \n", - "997 graded ['g', 'r', 'a', 'd', 'e', 'd'] \n", - "998 carriage ['c', 'a', 'r', 'r', 'i', 'a', 'g', 'e'] \n", - "999 datelining ['d', 'a', 't', 'e', 'l', 'i', 'n', 'i', 'n', ... \n", - "\n", - " wrong letters number of hits \\\n", - "0 ['s', 'r', 'l', 'a', 'i'] 6 \n", - "1 ['s', 'l', 'b'] 5 \n", - "2 ['l', 'b'] 6 \n", - "3 ['s', 'r', 'd', 't', 'w', 'l', 'p', 'k', 'c'] 6 \n", - "4 [] 8 \n", - "5 ['r', 'i', 's', 'd'] 8 \n", - "6 ['r'] 13 \n", - "7 ['a'] 6 \n", - "8 ['o', 'a', 'b', 's', 'm'] 10 \n", - "9 ['u'] 10 \n", - "10 ['s', 't', 'n', 'l', 'y'] 5 \n", - "11 ['r', 'i', 'l', 'b', 'c'] 7 \n", - "12 [] 5 \n", - "13 ['s', 'i', 'a', 'b', 'p'] 8 \n", - "14 ['s', 'g'] 13 \n", - "15 ['s', 'i'] 6 \n", - "16 ['p'] 10 \n", - "17 ['o', 'l'] 10 \n", - "18 ['l'] 11 \n", - "19 ['s', 'e', 'n', 'd'] 5 \n", - "20 ['e', 's', 'a', 'o', 'u', 'n'] 4 \n", - "21 ['s', 'm'] 6 \n", - "22 ['i', 'd', 'l'] 9 \n", - "23 ['r', 'i'] 9 \n", - "24 ['a', 't', 'p'] 8 \n", - "25 [] 10 \n", - "26 ['o', 'l', 'g'] 10 \n", - "27 ['e', 'a', 'o', 'i', 'n'] 5 \n", - "28 ['s', 'a', 'd'] 6 \n", - "29 [] 12 \n", - ".. ... ... \n", - "970 ['a', 'u', 'p'] 10 \n", - "971 [] 12 \n", - "972 ['e', 't', 'k', 'w'] 6 \n", - "973 ['s', 'r', 'e', 'a', 'o', 'u', 'k'] 7 \n", - "974 ['o', 'l', 'd', 's'] 11 \n", - "975 ['e', 's', 'a', 'o', 'u', 'd', 'k', 'l', 'p', ... 2 \n", - "976 ['d'] 12 \n", - "977 ['r', 's'] 8 \n", - "978 ['s', 'n', 'c', 'm'] 7 \n", - "979 ['s', 'd', 'c', 'b'] 7 \n", - "980 ['s', 'g', 'a', 'l'] 6 \n", - "981 ['s', 'r', 'd', 'n', 'a', 'e'] 6 \n", - "982 ['o', 'l'] 10 \n", - "983 ['r'] 7 \n", - "984 ['s', 'e'] 5 \n", - "985 ['o'] 7 \n", - "986 ['r', 'i', 'a'] 7 \n", - "987 ['t', 'a', 'r', 'n', 'i'] 9 \n", - "988 ['r', 'a', 't'] 8 \n", - "989 ['a', 'o', 't', 'd', 'l'] 7 \n", - "990 ['p', 'r'] 18 \n", - "991 ['s', 'r', 'i', 'n', 'y'] 6 \n", - "992 ['a', 's', 'f', 'd'] 9 \n", - "993 ['r', 'd', 'p', 'm', 'h'] 5 \n", - "994 ['s', 'i'] 5 \n", - "995 ['d'] 14 \n", - "996 ['n', 'r', 'o', 'c', 'a', 'm', 'h', 'p', 'f', ... 1 \n", - "997 ['s', 'c', 'v', 'y', 't', 'z'] 6 \n", - "998 ['s', 'l', 'd'] 8 \n", - "999 ['o', 's'] 10 \n", - "\n", - " lives remaining game won word length \n", - "0 5 True 6 \n", - "1 7 True 5 \n", - "2 8 True 6 \n", - "3 1 True 6 \n", - "4 10 True 8 \n", - "5 6 True 8 \n", - "6 9 True 13 \n", - "7 9 True 6 \n", - "8 5 True 10 \n", - "9 9 True 10 \n", - "10 5 True 5 \n", - "11 5 True 7 \n", - "12 10 True 5 \n", - "13 5 True 8 \n", - "14 8 True 13 \n", - "15 8 True 6 \n", - "16 9 True 10 \n", - "17 8 True 10 \n", - "18 9 True 11 \n", - "19 6 True 5 \n", - "20 4 True 4 \n", - "21 8 True 6 \n", - "22 7 True 9 \n", - "23 8 True 9 \n", - "24 7 True 8 \n", - "25 10 True 10 \n", - "26 7 True 10 \n", - "27 5 True 5 \n", - "28 7 True 6 \n", - "29 10 True 12 \n", - ".. ... ... ... \n", - "970 7 True 10 \n", - "971 10 True 12 \n", - "972 6 True 6 \n", - "973 3 True 7 \n", - "974 6 True 11 \n", - "975 0 False 4 \n", - "976 9 True 12 \n", - "977 8 True 8 \n", - "978 6 True 7 \n", - "979 6 True 7 \n", - "980 6 True 6 \n", - "981 4 True 6 \n", - "982 8 True 10 \n", - "983 9 True 7 \n", - "984 8 True 5 \n", - "985 9 True 7 \n", - "986 7 True 7 \n", - "987 5 True 9 \n", - "988 7 True 8 \n", - "989 5 True 7 \n", - "990 8 True 18 \n", - "991 5 True 6 \n", - "992 6 True 9 \n", - "993 5 True 5 \n", - "994 8 True 5 \n", - "995 9 True 14 \n", - "996 0 False 9 \n", - "997 4 True 6 \n", - "998 7 True 8 \n", - "999 8 True 10 \n", - "\n", - "[1000 rows x 7 columns]" - ] - } - ], - "prompt_number": 20 - }, + "output_type": "execute_result" + } + ], + "source": [ + "adaptive_split['word length'] = adaptive_split.apply(lambda r: len(r['target']), axis=1)\n", + "adaptive_split" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_split['lives remaining'].hist()" - ], - "language": "python", + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 21, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 21, - "text": [ - "" - ] - }, - { - "metadata": {}, - "output_type": "display_data", - "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEQ1JREFUeJzt3G2MXOV5xvH/FpuornE2Vlq/4XQciJVYirK0idVCI29f\nhEjaQPqFJm0kNrRVJKpAG6nF5gOmX9oEiSaqqkRqA8EowcGClkAkUuOIVVNVCW0xL4kxL46txhhM\nSrFiI6vFsP3wnMlzWC+7M7Mz89x75v+TRjPnzOzOxSN879nrnB2QJEmSJEmSJEmSJEmSJEkaSRuB\nh4AfAN8Hrq323wQcBfZXtw/VvmYH8AxwELh0W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R/K39Q\nMlAwM3QwU4c54Dv5A6hRshy4B/gqqaIZVRcDlwOHgd3AbwB3FE1UztHq9u/V9t2kQT+K3g/8G/AS\ncAb4R9L/K6PsOKmaAVhHOjAKwz+AysZIQ+zzpYMEs43R7uAB/gXYXD2+CfhcuShFvY90hdnPkv69\n7AL+pGii4Wtx9knW9tWH2wl2khX8A6i2XyP1zY+Sqon9pEtIR902vIrmfaQj+MdIR62jehUNpCtG\n2pdJ7iL91jsqdpPOPfwf6dzlJ0knnvcR9DJJSZIkSZIkSZIkSZIkSZIkSZIkSZrT/wNDjrZHdtUP\nLwAAAABJRU5ErkJggg==\n", - "text": [ - "" - ] - } - ], - "prompt_number": 21 + "output_type": "execute_result" }, { - "cell_type": "code", - "collapsed": false, - "input": [ - "adaptive_split.groupby('lives remaining').size()" - ], - "language": "python", + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACAYAAAC57G0KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEQ1JREFUeJzt3G2MXOV5xvH/FpuornE2Vlq/4XQciJVYirK0idVCI29f\nhEjaQPqFJm0kNrRVJKpAG6nF5gOmX9oEiSaqqkRqA8EowcGClkAkUuOIVVNVCW0xL4kxL46txhhM\nSrFiI6vFsP3wnMlzWC+7M7Mz89x75v+TRjPnzOzOxSN879nrnB2QJEmSJEmSJEmSJEmSJEkaSRuB\nh4AfAN8Hrq323wQcBfZXtw/VvmYH8AxwELh0WEElSd1ZC0xUj1cCTwHvAXYCn5nj9VuAR4HlQAt4\nFviZgaeUJJ1loeH7AmlgA5wCngQ2VNtjc7z+CmA38CpwhDTgty46pSSpa90cXbeAi4DvVtufBh4D\nbgXGq33rSdVN21HyDwRJ0hB1OuBXAncD15GO5L8EbCLVN88Dt8zztTOLCShJ6s2yDl6zHLgH+Cpw\nb7XvxdrzXwburx4/Rzox23Z+te8N1q9fP3Ps2LGuw0rSiDsEXNjpixc6gh8jVTAHgC/U9q+r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knnvcR9DJJSZIkSZIkSZIkSZIkSZIkSZIkSZrT/wNDjrZHdtUP\nLwAAAABJRU5ErkJggg==\n", + "text/plain": [ + "" + ] + }, "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 22, - "text": [ - "lives remaining\n", - "0 19\n", - "1 9\n", - "2 22\n", - "3 56\n", - "4 68\n", - "5 105\n", - "6 165\n", - "7 172\n", - "8 183\n", - "9 124\n", - "10 77\n", - "dtype: int64" - ] - } - ], - "prompt_number": 22 - }, + "output_type": "display_data" + } + ], + "source": [ + "adaptive_split['lives remaining'].hist()" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", + "data": { + "text/plain": [ + "lives remaining\n", + "0 19\n", + "1 9\n", + "2 22\n", + "3 56\n", + "4 68\n", + "5 105\n", + "6 165\n", + "7 172\n", + "8 183\n", + "9 124\n", + "10 77\n", + "dtype: int64" + ] + }, + "execution_count": 22, "metadata": {}, - "outputs": [], - "prompt_number": 75 + "output_type": "execute_result" } ], - "metadata": {} + "source": [ + "adaptive_split.groupby('lives remaining').size()" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" } - ] -} \ No newline at end of file + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/hangman/word_filter_comparison.ipynb b/hangman/word_filter_comparison.ipynb index b96359e..d3e4318 100644 --- a/hangman/word_filter_comparison.ipynb +++ b/hangman/word_filter_comparison.ipynb @@ -1,365 +1,387 @@ { - "metadata": { - "name": "", - "signature": "sha256:b1430467f492182774cf211bf9da55e45dbf53644a26cb4e401bed473b1551ed" - }, - "nbformat": 3, - "nbformat_minor": 0, - "worksheets": [ + "cells": [ { - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Filtering words\n", - "The challenge is to read a list of words from a dictionary, and keep only those words which contain only lower-case letters. Any \"word\" that contains an upper-case letter, punctuation, spaces, or similar should be rejected on the basis that it's a proper noun, and abbreviation, or something else that means it can't be a valid target word for Hangman." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# Import the libraries we'll need\n", - "import re\n", - "import random\n", - "import string" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 3 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Get the list of all words." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "all_words = [w.strip() for w in open('/usr/share/dict/british-english').readlines()]\n", - "len(all_words)" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 4, - "text": [ - "99156" - ] - } - ], - "prompt_number": 4 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Checking a word\n", - "\n", - "## Explicit iteration over the word\n", - "This function walks over the word, character by character, and checks if it's in the list of valid characters (as given in `string.ascii_lowercase`). If it's not, the `valid` flag is set to `False`. The final value is returned." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def check_word_explicit(word):\n", - " valid = True\n", - " for letter in word:\n", - " if letter not in string.ascii_lowercase:\n", - " valid = False\n", - " return valid" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 5 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Short-circuiting explicit iteration\n", - "As above, but the function `return`s `False` as soon as it detects an invalid character. This should make it quicker to reject words." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def check_word_short_circuit(word):\n", - " for letter in word:\n", - " if letter not in string.ascii_lowercase:\n", - " return False\n", - " return True" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 6 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Using comprehensions\n", - "Use a comprehension function to convert the list of letters into a list of Booleans showing whether the character in that position is a valid letter. Use the built-in `all()` function to check that all the values in the list are `True`." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "# Examples of the idea\n", - "print('hello :', [letter in string.ascii_lowercase for letter in 'hello'])\n", - "print('heLLo :', [letter in string.ascii_lowercase for letter in 'heLLo'])" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "hello : [True, True, True, True, True]\n", - "heLLo : [True, True, False, False, True]\n" - ] - } - ], - "prompt_number": 7 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def check_word_comprehension(word):\n", - " return all(letter in string.ascii_lowercase for letter in word)" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 8 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Short-circuited comprehensions\n", - "An attempt to be clever. Can we stop the checking of letters as soon as we've found an invalid one?" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def check_word_comprehension_clever(word):\n", - " return not any(letter not in string.ascii_lowercase for letter in word)" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 9 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## A recursive definition\n", - "A word if all lowercase if the first character is lowercase and the rest of the word is all lowercase. The base case is an empty word. This should evaluate to `True` because an empty list does not contain any invalid characters.\n", - "\n", - "Note the Pythonic use of \"truthiness\" values. If you try to take the Boolean value of a string, it evaluates as `False` if it's empty and `True` otherwise. Using \n", - "\n", - "` if word != '':` \n", - "\n", - "in the first line is just as correct, but not as Pythonic." - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "def check_word_recursive(word):\n", - " if word:\n", - " if word[0] not in string.ascii_lowercase:\n", - " return False\n", - " else:\n", - " return check_word_recursive(word[1:])\n", - " else:\n", - " return True" - ], - "language": "python", - "metadata": {}, - "outputs": [], - "prompt_number": 10 - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Regular expressions\n", - "A regular expression is a way of defining a finite state machine (FSM) that accepts some sequences of characters. They're used a lot whenever you want to process something text-based. In this case, the regex consists of:\n", - "* `^` : match the start of the string\n", - "* `[a-z]` : match a single character in the range `a` to `z`\n", - "* `[a-z]+` : match a sequence of one one or more characters in the range `a` to `z`\n", - "* `$` : match the end of the string\n", - "This means you have a regular expression that matches strings containing just lower-case letters with nothing else between the matched letters and the start and end of the string. \n", - "\n", - "Python has the `re.compile` feature to build the specialised FSM that does the matching. This is faster if you want to use the same regular expression a lot. If you only want to use it a few times, it's often easier to just give the regex directly. See below for examples.\n", - "\n", - "Regular expresions are incredibly powerful, but take time to learn. See the [regular expression tutorial](http://www.regular-expressions.info/tutorial.html) for a guide." - ] - }, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Filtering words\n", + "The challenge is to read a list of words from a dictionary, and keep only those words which contain only lower-case letters. Any \"word\" that contains an upper-case letter, punctuation, spaces, or similar should be rejected on the basis that it's a proper noun, and abbreviation, or something else that means it can't be a valid target word for Hangman." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "# Import the libraries we'll need\n", + "import re\n", + "import random\n", + "import string" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Get the list of all words." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [ - "valid_word_re = re.compile(r'^[a-z]+$')" - ], - "language": "python", + "data": { + "text/plain": [ + "99156" + ] + }, + "execution_count": 4, "metadata": {}, - "outputs": [], - "prompt_number": 11 - }, + "output_type": "execute_result" + } + ], + "source": [ + "all_words = [w.strip() for w in open('/usr/share/dict/british-english').readlines()]\n", + "len(all_words)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Checking a word\n", + "\n", + "## Explicit iteration over the word\n", + "This function walks over the word, character by character, and checks if it's in the list of valid characters (as given in `string.ascii_lowercase`). If it's not, the `valid` flag is set to `False`. The final value is returned." + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def check_word_explicit(word):\n", + " valid = True\n", + " for letter in word:\n", + " if letter not in string.ascii_lowercase:\n", + " valid = False\n", + " return valid" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Short-circuiting explicit iteration\n", + "As above, but the function `return`s `False` as soon as it detects an invalid character. This should make it quicker to reject words." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def check_word_short_circuit(word):\n", + " for letter in word:\n", + " if letter not in string.ascii_lowercase:\n", + " return False\n", + " return True" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Using comprehensions\n", + "Use a comprehension function to convert the list of letters into a list of Booleans showing whether the character in that position is a valid letter. Use the built-in `all()` function to check that all the values in the list are `True`." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Evaluation\n", - "Which of these alternatives is the best?\n", - "\n", - "The important measure is whether the program is both readable and correct. You can be the judge of that (though I used a regex as a first recourse).\n", - "\n", - "We can also look at performance: which is the fastest?\n", - "\n", - "Use the IPython timing cell-magic to find out. We'll also use an `assert`ion to check that all the approaches give the same answer.\n", - "\n", - "You'll have to run the notebook to find the answer. Which do you think would be these fastest, or the slowest?" + "name": "stdout", + "output_type": "stream", + "text": [ + "hello : [True, True, True, True, True]\n", + "heLLo : [True, True, False, False, True]\n" ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "valid_word_count = len([w for w in all_words if valid_word_re.match(w)])\n", - "valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "metadata": {}, - "output_type": "pyout", - "prompt_number": 12, - "text": [ - "62856" - ] - } - ], - "prompt_number": 12 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if check_word_explicit(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if check_word_short_circuit(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if check_word_comprehension(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if check_word_comprehension_clever(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if check_word_recursive(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if re.match(r'^[a-z]+$', w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - "%%timeit\n", - "words = [w for w in all_words if valid_word_re.match(w)]\n", - "assert len(words) == valid_word_count" - ], - "language": "python", - "metadata": {}, - "outputs": [] - }, + } + ], + "source": [ + "# Examples of the idea\n", + "print('hello :', [letter in string.ascii_lowercase for letter in 'hello'])\n", + "print('heLLo :', [letter in string.ascii_lowercase for letter in 'heLLo'])" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def check_word_comprehension(word):\n", + " return all(letter in string.ascii_lowercase for letter in word)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Short-circuited comprehensions\n", + "An attempt to be clever. Can we stop the checking of letters as soon as we've found an invalid one?" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def check_word_comprehension_clever(word):\n", + " return not any(letter not in string.ascii_lowercase for letter in word)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## A recursive definition\n", + "A word if all lowercase if the first character is lowercase and the rest of the word is all lowercase. The base case is an empty word. This should evaluate to `True` because an empty list does not contain any invalid characters.\n", + "\n", + "Note the Pythonic use of \"truthiness\" values. If you try to take the Boolean value of a string, it evaluates as `False` if it's empty and `True` otherwise. Using \n", + "\n", + "` if word != '':` \n", + "\n", + "in the first line is just as correct, but not as Pythonic." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "def check_word_recursive(word):\n", + " if word:\n", + " if word[0] not in string.ascii_lowercase:\n", + " return False\n", + " else:\n", + " return check_word_recursive(word[1:])\n", + " else:\n", + " return True" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Regular expressions\n", + "A regular expression is a way of defining a finite state machine (FSM) that accepts some sequences of characters. They're used a lot whenever you want to process something text-based. In this case, the regex consists of:\n", + "* `^` : match the start of the string\n", + "* `[a-z]` : match a single character in the range `a` to `z`\n", + "* `[a-z]+` : match a sequence of one one or more characters in the range `a` to `z`\n", + "* `$` : match the end of the string\n", + "This means you have a regular expression that matches strings containing just lower-case letters with nothing else between the matched letters and the start and end of the string. \n", + "\n", + "Python has the `re.compile` feature to build the specialised FSM that does the matching. This is faster if you want to use the same regular expression a lot. If you only want to use it a few times, it's often easier to just give the regex directly. See below for examples.\n", + "\n", + "Regular expresions are incredibly powerful, but take time to learn. See the [regular expression tutorial](http://www.regular-expressions.info/tutorial.html) for a guide." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "valid_word_re = re.compile(r'^[a-z]+$')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Evaluation\n", + "Which of these alternatives is the best?\n", + "\n", + "The important measure is whether the program is both readable and correct. You can be the judge of that (though I used a regex as a first recourse).\n", + "\n", + "We can also look at performance: which is the fastest?\n", + "\n", + "Use the IPython timing cell-magic to find out. We'll also use an `assert`ion to check that all the approaches give the same answer.\n", + "\n", + "You'll have to run the notebook to find the answer. Which do you think would be these fastest, or the slowest?" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", + "data": { + "text/plain": [ + "62856" + ] + }, + "execution_count": 12, "metadata": {}, - "outputs": [] + "output_type": "execute_result" } ], - "metadata": {} + "source": [ + "valid_word_count = len([w for w in all_words if valid_word_re.match(w)])\n", + "valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if check_word_explicit(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if check_word_short_circuit(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if check_word_comprehension(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if check_word_comprehension_clever(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if check_word_recursive(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if re.match(r'^[a-z]+$', w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [ + "%%timeit\n", + "words = [w for w in all_words if valid_word_re.match(w)]\n", + "assert len(words) == valid_word_count" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "outputs": [], + "source": [] } - ] -} \ No newline at end of file + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.5.2+" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +}