+ {
+ "cell_type": "code",
+ "execution_count": 38,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "absolved (True, 16, 2, <Direction.right: 2>)\n",
+ "adorable (True, 11, 4, <Direction.right: 2>)\n",
+ "aeon (True, 11, 4, <Direction.down: 4>)\n",
+ "alias (True, 15, 15, <Direction.left: 1>)\n",
+ "ancestor (False, 0, 0, <Direction.left: 1>)\n",
+ "baritone (False, 0, 0, <Direction.left: 1>)\n",
+ "bemusing (False, 0, 0, <Direction.left: 1>)\n",
+ "blonds (False, 0, 0, <Direction.left: 1>)\n",
+ "bran (True, 1, 9, <Direction.left: 1>)\n",
+ "calcite (True, 19, 9, <Direction.upright: 6>)\n",
+ "candor (True, 17, 12, <Direction.right: 2>)\n",
+ "conciseness (False, 0, 0, <Direction.left: 1>)\n",
+ "consequent (False, 0, 0, <Direction.left: 1>)\n",
+ "cuddle (False, 0, 0, <Direction.left: 1>)\n",
+ "damming (True, 17, 2, <Direction.right: 2>)\n",
+ "dashboards (False, 0, 0, <Direction.left: 1>)\n",
+ "despairing (False, 0, 0, <Direction.left: 1>)\n",
+ "dint (False, 0, 0, <Direction.left: 1>)\n",
+ "dullard (True, 8, 2, <Direction.down: 4>)\n",
+ "dynasty (True, 3, 4, <Direction.downright: 8>)\n",
+ "employer (False, 0, 0, <Direction.left: 1>)\n",
+ "exhorts (True, 0, 8, <Direction.left: 1>)\n",
+ "feted (True, 5, 10, <Direction.right: 2>)\n",
+ "fill (True, 9, 14, <Direction.upleft: 5>)\n",
+ "flattens (True, 10, 10, <Direction.upleft: 5>)\n",
+ "foghorn (True, 10, 11, <Direction.downright: 8>)\n",
+ "fortification (True, 19, 16, <Direction.left: 1>)\n",
+ "freakish (False, 0, 0, <Direction.left: 1>)\n",
+ "frolics (True, 16, 16, <Direction.up: 3>)\n",
+ "gall (False, 0, 0, <Direction.left: 1>)\n",
+ "gees (True, 17, 0, <Direction.upright: 6>)\n",
+ "genies (True, 5, 7, <Direction.upleft: 5>)\n",
+ "gets (True, 6, 4, <Direction.upleft: 5>)\n",
+ "hastening (True, 14, 13, <Direction.left: 1>)\n",
+ "hits (True, 2, 0, <Direction.down: 4>)\n",
+ "hopelessness (False, 0, 0, <Direction.left: 1>)\n",
+ "hurlers (True, 18, 0, <Direction.right: 2>)\n",
+ "impales (False, 0, 0, <Direction.left: 1>)\n",
+ "infix (False, 0, 0, <Direction.left: 1>)\n",
+ "inflow (False, 0, 0, <Direction.left: 1>)\n",
+ "innumerable (False, 0, 0, <Direction.left: 1>)\n",
+ "intentional (False, 0, 0, <Direction.left: 1>)\n",
+ "jerkin (False, 0, 0, <Direction.left: 1>)\n",
+ "justification (False, 0, 0, <Direction.left: 1>)\n",
+ "kitty (True, 8, 15, <Direction.upleft: 5>)\n",
+ "knuckles (True, 17, 19, <Direction.up: 3>)\n",
+ "leaving (False, 0, 0, <Direction.left: 1>)\n",
+ "like (True, 3, 11, <Direction.left: 1>)\n",
+ "limitation (True, 8, 3, <Direction.right: 2>)\n",
+ "locoweeds (False, 0, 0, <Direction.left: 1>)\n",
+ "loot (True, 3, 19, <Direction.up: 3>)\n",
+ "lucking (True, 7, 10, <Direction.upleft: 5>)\n",
+ "lumps (True, 0, 17, <Direction.down: 4>)\n",
+ "mercerising (True, 15, 17, <Direction.up: 3>)\n",
+ "monickers (False, 0, 0, <Direction.left: 1>)\n",
+ "motionless (True, 13, 1, <Direction.up: 3>)\n",
+ "naturally (True, 9, 16, <Direction.up: 3>)\n",
+ "nighest (True, 15, 4, <Direction.right: 2>)\n",
+ "notion (True, 17, 18, <Direction.up: 3>)\n",
+ "ogled (True, 1, 18, <Direction.down: 4>)\n",
+ "originality (False, 0, 0, <Direction.left: 1>)\n",
+ "outings (False, 0, 0, <Direction.left: 1>)\n",
+ "pendulous (False, 0, 0, <Direction.left: 1>)\n",
+ "piled (True, 1, 10, <Direction.right: 2>)\n",
+ "pins (True, 7, 4, <Direction.upleft: 5>)\n",
+ "pithier (False, 0, 0, <Direction.left: 1>)\n",
+ "prep (True, 10, 4, <Direction.right: 2>)\n",
+ "randomness (False, 0, 0, <Direction.left: 1>)\n",
+ "rectors (False, 0, 0, <Direction.left: 1>)\n",
+ "redrew (False, 0, 0, <Direction.left: 1>)\n",
+ "reformulated (False, 0, 0, <Direction.left: 1>)\n",
+ "remoteness (False, 0, 0, <Direction.left: 1>)\n",
+ "retaking (True, 6, 0, <Direction.down: 4>)\n",
+ "rethink (False, 0, 0, <Direction.left: 1>)\n",
+ "rope (True, 9, 4, <Direction.right: 2>)\n",
+ "rubier (True, 0, 4, <Direction.downright: 8>)\n",
+ "sailors (True, 7, 15, <Direction.up: 3>)\n",
+ "scowls (False, 0, 0, <Direction.left: 1>)\n",
+ "scum (True, 16, 11, <Direction.right: 2>)\n",
+ "sepals (True, 6, 10, <Direction.upright: 6>)\n",
+ "sequencers (False, 0, 0, <Direction.left: 1>)\n",
+ "serf (False, 0, 0, <Direction.left: 1>)\n",
+ "shoaled (True, 11, 18, <Direction.up: 3>)\n",
+ "shook (False, 0, 0, <Direction.left: 1>)\n",
+ "sonic (True, 18, 18, <Direction.left: 1>)\n",
+ "spottiest (False, 0, 0, <Direction.left: 1>)\n",
+ "stag (True, 7, 8, <Direction.left: 1>)\n",
+ "stood (False, 0, 0, <Direction.left: 1>)\n",
+ "stratum (True, 2, 13, <Direction.left: 1>)\n",
+ "strong (True, 4, 19, <Direction.down: 4>)\n",
+ "studying (True, 0, 16, <Direction.left: 1>)\n",
+ "surtaxing (False, 0, 0, <Direction.left: 1>)\n",
+ "tailing (True, 13, 6, <Direction.right: 2>)\n",
+ "tears (True, 13, 3, <Direction.up: 3>)\n",
+ "teazles (True, 4, 10, <Direction.downright: 8>)\n",
+ "vans (True, 18, 8, <Direction.upright: 6>)\n",
+ "wardrobes (False, 0, 0, <Direction.left: 1>)\n",
+ "wooded (True, 12, 5, <Direction.right: 2>)\n",
+ "worsts (True, 1, 0, <Direction.downright: 8>)\n",
+ "zings (True, 10, 14, <Direction.upleft: 5>)\n"
+ ]
+ }
+ ],
+ "source": [
+ "width, height, grid, words = read_wordsearch('wordsearch04.txt')\n",
+ "for w in words:\n",
+ " print(w, present(grid, w))"
+ ]
+ },