From: Neil Smith Date: Thu, 22 Jan 2015 21:30:02 +0000 (+0000) Subject: Changing machine X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=5001e9431b2a52630f91d78f381c29aca25dd310;p=cas-master-teacher-training.git Changing machine --- diff --git a/hangman/01-hangman-setter.ipynb b/hangman/01-hangman-setter.ipynb new file mode 100644 index 0000000..e3a7c15 --- /dev/null +++ b/hangman/01-hangman-setter.ipynb @@ -0,0 +1,742 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:374900202f4f7c3f157762c0d012b597cc502efce4de220013e3cc9cd8dfc896" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "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": "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", + "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!" + ] + }, + { + "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": {} + } + ] +} \ No newline at end of file diff --git a/hangman/02-hangman-guesser.ipynb b/hangman/02-hangman-guesser.ipynb new file mode 100644 index 0000000..8f482b1 --- /dev/null +++ b/hangman/02-hangman-guesser.ipynb @@ -0,0 +1,556 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:393162de43635426518dd3dca8100dca49558a55f990aede7c52f3a98de60612" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "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": [ + "## 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": 1 + }, + { + "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": 3, + "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": 3 + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, let's get them listed in order." + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letter_counts.most_common()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 6, + "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": 6 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letters_in_order = [p[0] for p in letter_counts.most_common()]\n", + "letters_in_order" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 4, + "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": 4 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def make_guess():\n", + " guessed_letters = read_game()\n", + " unguessed_letters_in_order = ordered_subtract(letters_in_order, guessed_letters)\n", + " print('My guess is:', unguessed_letters_in_order[0])" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 29 + }, + { + "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 [l for l in lower(discovered + missed) if l in string.ascii_letters]" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 30 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def ordered_subtract(ordered_list, to_remove):\n", + " for r in to_remove:\n", + " if r in ordered_list:\n", + " ordered_list.remove(r)\n", + " return ordered_list" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 19 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letters_in_order" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 20, + "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": 20 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ordered_subtract(letters_in_order, 'etaoin')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 21, + "text": [ + "['h',\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": 21 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letters_in_order" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 22, + "text": [ + "['h',\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": 22 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "def ordered_subtract(ordered_list, to_remove):\n", + " for r in to_remove:\n", + " if r in ordered_list:\n", + " ri = ordered_list.index(r)\n", + " ordered_list = ordered_list[:ri] + ordered_list[ri+1:]\n", + " return ordered_list" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 26 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letters_in_order = [p[0] for p in letter_counts.most_common()]\n", + "letters_in_order" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 24, + "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": 24 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "ordered_subtract(letters_in_order, 'etaoin')" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 27, + "text": [ + "['h',\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": 27 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "letters_in_order" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 28, + "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": 28 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "make_guess()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter the discovered word: _a__y\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter the wrong guesses: eit\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "My guess is: o\n" + ] + } + ], + "prompt_number": 31 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [] + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/hangman/03-hangman-both.ipynb b/hangman/03-hangman-both.ipynb new file mode 100644 index 0000000..d9e565b --- /dev/null +++ b/hangman/03-hangman-both.ipynb @@ -0,0 +1,1186 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5e9f030b42097ebbcce2654cdb1d9370fde38b61bdbfa85a0cc700e76d5a8a71" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import re\n", + "import random\n", + "import string\n", + "import collections" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 71 + }, + { + "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": 72 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "STARTING_LIVES = 10" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 73 + }, + { + "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": 74 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g = Game(random.choice(WORDS))" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 75 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.target" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 76, + "text": [ + "'strife'" + ] + } + ], + "prompt_number": 76 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.discovered" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 77, + "text": [ + "['_', '_', '_', '_', '_', '_']" + ] + } + ], + "prompt_number": 77 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.do_turn()" + ], + "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" + ] + } + ], + "prompt_number": 78 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.lives" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 79, + "text": [ + "10" + ] + } + ], + "prompt_number": 79 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.wrong_letters" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 80, + "text": [ + "[]" + ] + } + ], + "prompt_number": 80 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.do_turn()" + ], + "language": "python", + "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: d\n" + ] + } + ], + "prompt_number": 81 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.lives" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 82, + "text": [ + "9" + ] + } + ], + "prompt_number": 82 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.discovered" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 83, + "text": [ + "['_', '_', '_', '_', '_', 'e']" + ] + } + ], + "prompt_number": 83 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.wrong_letters" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 84, + "text": [ + "['d']" + ] + } + ], + "prompt_number": 84 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g = Game(random.choice(WORDS))\n", + "g.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: d\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ _ _ d : 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 d : Lives = 10 , wrong guesses: \n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: f\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 9 , wrong guesses: f\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: e\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 9 , wrong guesses: f\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: s\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 8 , wrong guesses: f s\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: t\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 7 , wrong guesses: f s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: n\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 6 , wrong guesses: f n s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: m\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 5 , wrong guesses: f m n s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: h\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 4 , wrong guesses: f h m n s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: o\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ _ _ e d : Lives = 3 , wrong guesses: f h m n o s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: i\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ e _ i _ e d : Lives = 3 , wrong guesses: f h m n o s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: r\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: r e _ i r e d : Lives = 3 , wrong guesses: f h m n o s t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: w\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You won! The word was rewired\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 85, + "text": [ + "True" + ] + } + ], + "prompt_number": 85 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g = Game(random.choice(WORDS))\n", + "g.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: _ _ _ _ _ : Lives = 9 , wrong guesses: e\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: s\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 9 , wrong guesses: e\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: t\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 8 , wrong guesses: e t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: o\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 7 , wrong guesses: e o t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: i\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 6 , wrong guesses: e i o t\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: u\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 5 , wrong guesses: e i o t u\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: a\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ _ _ _ s : Lives = 4 , wrong guesses: a e i o t u\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: y\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ y _ _ s : Lives = 4 , wrong guesses: a e i o t u\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: w\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: _ y _ _ s : Lives = 3 , wrong guesses: a e i o t u w\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: h\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: h y _ _ s : Lives = 3 , wrong guesses: a e i o t u w\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: m\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Word: h y m _ s : Lives = 3 , wrong guesses: a e i o t u w\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "stream": "stdout", + "text": [ + "Enter letter: n\n" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "You won! The word was hymns\n" + ] + }, + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 86, + "text": [ + "True" + ] + } + ], + "prompt_number": 86 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.target" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 108, + "text": [ + "'six'" + ] + } + ], + "prompt_number": 108 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAlphabetical:\n", + " def guess(self, discovered, missed, lives):\n", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in string.ascii_lowercase if l not in guessed_letters][0]" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 109 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g = Game(random.choice(WORDS), player=PlayerAlphabetical())" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 110 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.play_game()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 111, + "text": [ + "False" + ] + } + ], + "prompt_number": 111 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.discovered" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 112, + "text": [ + "['l', 'e', 'g', 'a', 'l', 'l', '_']" + ] + } + ], + "prompt_number": 112 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "g.target" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 113, + "text": [ + "'legally'" + ] + } + ], + "prompt_number": 113 + }, + { + "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: cavalry ; Discovered: ['c', 'a', '_', 'a', 'l', '_', '_'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 114 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in LETTERS_IN_ORDER if l not in guessed_letters][0]" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 115 + }, + { + "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: deathblow ; Discovered: ['d', 'e', 'a', 't', 'h', '_', 'l', 'o', 'w'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 116 + }, + { + "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: littered ; Discovered: ['l', 'i', 't', 't', 'e', 'r', 'e', 'd'] ; Lives remaining: 5\n" + ] + } + ], + "prompt_number": 117 + }, + { + "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: licenced ; Discovered: ['l', 'i', 'c', 'e', 'n', 'c', 'e', 'd'] ; Lives remaining: 1\n" + ] + } + ], + "prompt_number": 118 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][0]" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 119 + }, + { + "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": 120 + }, + { + "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: unworthier ; Discovered: ['u', 'n', 'w', 'o', 'r', 't', 'h', 'i', 'e', 'r'] ; Lives remaining: 5\n" + ] + } + ], + "prompt_number": 121 + }, + { + "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: kneel ; Discovered: ['_', 'n', 'e', 'e', 'l'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 122 + }, + { + "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: provisoes ; Discovered: ['_', '_', '_', '_', 'i', '_', '_', 'e', '_'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 123 + }, + { + "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: invincible ; Discovered: ['_', '_', 'v', '_', '_', '_', '_', '_', '_', '_'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 124 + }, + { + "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: clogging ; Discovered: ['_', '_', '_', '_', '_', '_', '_', '_'] ; Lives remaining: 0\n" + ] + } + ], + "prompt_number": 125 + }, + { + "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": [ + "44\n" + ] + } + ], + "prompt_number": 126 + }, + { + "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": [ + "320\n" + ] + } + ], + "prompt_number": 127 + }, + { + "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": [ + "7\n" + ] + } + ], + "prompt_number": 128 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 128 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/hangman/05-hangman-better.ipynb b/hangman/05-hangman-better.ipynb new file mode 100644 index 0000000..20a12e0 --- /dev/null +++ b/hangman/05-hangman-better.ipynb @@ -0,0 +1,2335 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:32b3b300745f022158bfde0b3fc0a50b11d36551211371d50140e9f9d2a7b8e1" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": "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": [ + "50\n", + "59" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "33" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "53" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "49" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "42" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "43" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "54" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "49" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "54" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "45" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "46" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "44" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "45" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "48" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "51" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "46" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "54" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "49" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "44" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "42" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "44" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "48" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "39" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "46" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "43" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "50" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "47" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "52" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "46" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "55" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "47" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "39" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "55" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "40" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "46" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "53" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "43" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "40" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "53" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "41" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10 loops, best of 3: 64.2 ms per loop\n" + ] + } + ], + "prompt_number": 54 + }, + { + "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": [ + "334\n", + "342" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "318" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "313" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "353" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "304" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "332" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "313" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "335" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "339" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "328" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "334" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "322" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "347" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "334" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "340" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "319" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "365" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "315" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "307" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "314" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "317" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "310" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "324" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "313" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "318" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "314" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "324" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "297" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "335" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "335" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "343" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "342" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "318" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "306" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "353" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "332" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "330" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "334" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "307" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "306" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10 loops, best of 3: 96.2 ms per loop\n" + ] + } + ], + "prompt_number": 56 + }, + { + "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": [ + "7\n", + "5" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "8" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "5" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "5" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "5" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "9" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "3" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "8" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "13" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "8" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "9" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "9" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "12" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "14" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "9" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "8" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "8" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "9" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "4" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "3" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "7" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "11" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "6" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "4" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "10 loops, best of 3: 74.6 ms per loop\n" + ] + } + ], + "prompt_number": 57 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "DICT_COUNTS = collections.Counter(l.lower() for l in open('/usr/share/dict/british-english').read() if l in string.ascii_letters)\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({'s': 91332, 'e': 88692, 'i': 66900, 'a': 64468, 'r': 57460, 'n': 57128, 't': 52949, 'o': 49121, 'l': 40995, 'c': 31854, 'd': 28505, 'u': 26372, 'g': 22693, 'm': 22549, 'p': 22249, 'h': 19337, 'b': 15540, 'y': 12652, 'f': 10679, 'k': 8386, 'v': 8000, 'w': 7505, 'x': 2125, 'z': 2058, 'j': 1950, 'q': 1536})" + ] + } + ], + "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": [ + "['s', 'e', 'i', 'a', 'r', 'n', 't', 'o', 'l', 'c', 'd', 'u', 'g', 'm', 'p', 'h', 'b', 'y', 'f', 'k', 'v', 'w', 'x', 'z', 'j', 'q']\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": "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": [ + "440\n" + ] + } + ], + "prompt_number": 14 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 33 + }, + { + "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": [ + "474\n" + ] + } + ], + "prompt_number": 34 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 35 + }, + { + "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": [ + "982\n" + ] + } + ], + "prompt_number": 36 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "re.match('^[^xaz]*$', 'happy')" + ], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 37 + }, + { + "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(missed)\n", + " self.set_ordered_letters()\n", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 38 + }, + { + "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": [ + "502\n" + ] + } + ], + "prompt_number": 39 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 40 + }, + { + "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": 41 + }, + { + "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": [ + "994\n", + "993" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "987" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "993" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 30.6 s per loop\n" + ] + } + ], + "prompt_number": 42 + }, + { + "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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 43 + }, + { + "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": 44 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveIncludedLetters(PlayerAdaptive):\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": 45 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveExcludedLetters(PlayerAdaptive):\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": 46 + }, + { + "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", + " 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": 47 + }, + { + "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": [ + "479\n", + "455" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "460" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "498" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 15.9 s per loop\n" + ] + } + ], + "prompt_number": 48 + }, + { + "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": [ + "981\n", + "983" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "980" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "980" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 36.9 s per loop\n" + ] + } + ], + "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=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": [ + "521\n", + "484" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "491" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "518" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 7min 18s per loop\n" + ] + } + ], + "prompt_number": 50 + }, + { + "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": [ + "987\n", + "988" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "996" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "995" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 31.1 s per loop\n" + ] + } + ], + "prompt_number": 51 + }, + { + "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": [ + "naked ['_', 'a', '_', 'e', 'd'] ['s', 'r', 'w', 'c', 't', 'g', 'l', 'f', 'p', 'm']\n", + "wound" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'o', 'u', 'n', 'd'] ['s', 'e', 'a', 'y', 'p', 'm', 'f', 'h', 'b', 'r']\n", + "hut" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'u', 't'] ['a', 'o', 'e', 'i', 'b', 'g', 'n', 'p', 'm', 'c']\n", + "fucker" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'u', '_', '_', 'e', 'r'] ['d', 's', 'i', 'a', 'o', 't', 'b', 'n', 'm', 'l']\n", + "fox" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'o', '_'] ['a', 't', 'b', 'd', 'w', 'p', 'n', 's', 'g', 'y']\n", + "wills" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'i', 'l', 'l', 's'] ['e', 'o', 'a', 'g', 'p', 'm', 'k', 'f', 'h', 'd']\n", + "bunny" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'u', 'n', 'n', 'y'] ['s', 'e', 'a', 'o', 'i', 'm', 'l', 'g', 'f', 't']\n", + "curving" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['c', 'u', '_', '_', 'i', 'n', 'g'] ['e', 'a', 'o', 'l', 's', 'f', 'p', 'b', 't', 'm']\n", + "hoe" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'o', '_'] ['a', 't', 'b', 'd', 'w', 'p', 'n', 's', 'g', 'y']\n", + "butt" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'u', '_', '_'] ['e', 's', 'o', 'a', 'i', 'l', 'f', 'r', 'n', 'm']\n", + "mucked" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['_', 'u', '_', '_', 'e', 'd'] ['a', 'o', 'i', 'l', 's', 't', 'f', 'p', 'g', 'b']\n", + "flaw" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + " ['f', 'l', 'a', '_'] ['e', 's', 'o', 'r', 'y', 'g', 'k', 'x', 'p', 'n']\n" + ] + } + ], + "prompt_number": 52 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "iterations = 10000\n", + "wins = 0\n", + "for _ in range(iterations):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePattern(WORDS))\n", + " g.play_game()\n", + " if g.game_won:\n", + " wins += 1\n", + "print(wins / iterations)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "0.9936\n" + ] + } + ], + "prompt_number": 53 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveNoRegex:\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", + " guessed_letters = [l.lower() for l in discovered + missed if l in string.ascii_letters]\n", + " return [l for l in self.ordered_letters if l not in guessed_letters][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": 59 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveLengthNoRegex(PlayerAdaptiveNoRegex):\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": 60 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveIncludedLettersNoRegex(PlayerAdaptiveNoRegex):\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": 61 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptiveExcludedLettersNoRegex(PlayerAdaptiveNoRegex):\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": 66 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "class PlayerAdaptivePatternNoRegex(PlayerAdaptiveNoRegex):\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": 67 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveLengthNoRegex(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": [ + "471\n", + "492" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "502" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "469" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 16 s per loop\n" + ] + } + ], + "prompt_number": 69 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveIncludedLettersNoRegex(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": [ + "978\n", + "979" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "983" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "979" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 48 s per loop\n" + ] + } + ], + "prompt_number": 70 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptiveExcludedLettersNoRegex(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": [ + "582\n", + "595" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "587" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "611" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 4min 59s per loop\n" + ] + } + ], + "prompt_number": 71 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "%%timeit\n", + "\n", + "wins = 0\n", + "for _ in range(1000):\n", + " g = Game(random.choice(WORDS), player=PlayerAdaptivePatternNoRegex(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": [ + "991\n", + "992" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "993" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "994" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "\n", + "1 loops, best of 3: 37.9 s per loop\n" + ] + } + ], + "prompt_number": 72 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 72 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file diff --git a/hangman/06-hangman-logging.ipynb b/hangman/06-hangman-logging.ipynb new file mode 100644 index 0000000..b14dd0f --- /dev/null +++ b/hangman/06-hangman-logging.ipynb @@ -0,0 +1,5128 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:319787fef945fe728683c1bd9cbdb783efff5e79fec8332f433ebca77395f16d" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "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", + "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", + "metadata": {}, + "outputs": [], + "prompt_number": 6 + }, + { + "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", + "metadata": {}, + "outputs": [], + "prompt_number": 7 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "fixed_order = pd.read_csv('fixed_order.csv')\n", + "fixed_order" + ], + "language": "python", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "len(fixed_order['discovered'][0].split(','))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 9, + "text": [ + "10" + ] + } + ], + "prompt_number": 9 + }, + { + "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", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "fixed_order['lives remaining'].hist()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 11, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6A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JkiRJUnn/D7pn\ntnpo7g5vAAAAAElFTkSuQmCC\n", + "text": [ + "" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "fixed_order.groupby('lives remaining').size()" + ], + "language": "python", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_pattern = pd.read_csv('adaptive_pattern.csv')\n", + "adaptive_pattern" + ], + "language": "python", + "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 + }, + { + "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", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_pattern['lives remaining'].hist()" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "pyout", + "prompt_number": 15, + "text": [ + "" + ] + }, + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEACA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EmSJEmSJEmSJEk6\nwf8D25ze66lP9woAAAAASUVORK5CYII=\n", + "text": [ + "" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_pattern.groupby('lives remaining').size()" + ], + "language": "python", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_split = pd.read_csv('adaptive_split.csv')\n", + "adaptive_split" + ], + "language": "python", + "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 + }, + { + "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", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_split['lives remaining'].hist()" + ], + "language": "python", + "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/VvmYH8AxwELh0WEElSd1ZC0xUj1cCTwHvAXYCn5nj9VuAR4HlQAt4\nFviZgaeUJJ1loeH7AmlgA5wCngQ2VNtjc7z+CmA38CpwhDTgty46pSSpa90cXbeAi4DvVtufBh4D\nbgXGq33rSdVN21HyDwRJ0hB1OuBXAncD15GO5L8EbCLVN88Dt8zztTOLCShJ6s2yDl6zHLgH+Cpw\nb7XvxdrzXwburx4/Rzox23Z+te8N1q9fP3Ps2LGuw0rSiDsEXNjpixc6gh8jVTAHgC/U9q+rPf5d\n4Inq8X3Ax4BzSUf47wIenv1Njx07xszMjLeZGXbu3Fk8Q5Sba+FauBbz34ALOh3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g==\n", + "text": [ + "" + ] + } + ], + "prompt_number": 21 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "adaptive_split.groupby('lives remaining').size()" + ], + "language": "python", + "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 + }, + { + "cell_type": "code", + "collapsed": false, + "input": [], + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 75 + } + ], + "metadata": {} + } + ] +} \ No newline at end of file