agents.ipynb 123 ko
Newer Older
{
 "cells": [
tolusalako's avatar
tolusalako a validé
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# AGENT #\n",
    "\n",
    "An agent, as defined in 2.1 is anything that can perceive its <b>environment</b> through sensors, and act upon that environment through actuators based on its <b>agent program</b>. This can be a dog, robot, or even you. As long as you can perceive the environment and act on it, you are an agent. This notebook will explain how to implement a simple agent, create an environment, and create a program that helps the agent act on the environment based on its percepts.\n",
    "\n",
    "Before moving on, review the <b>Agent</b> and <b>Environment</b> classes in [<b>agents.py</b>](https://github.com/aimacode/aima-python/blob/master/agents.py).\n",
tolusalako's avatar
tolusalako a validé
    "\n",
    "Let's begin by importing all the functions from the agents.py module and creating our first agent - a blind dog."
   ]
  },
  {
   "cell_type": "code",
tolusalako's avatar
tolusalako a validé
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "from agents import *\n",
    "\n",
    "class BlindDog(Agent):\n",
    "    def eat(self, thing):\n",
    "        print(\"Dog: Ate food at {}.\".format(self.location))\n",
    "            \n",
    "    def drink(self, thing):\n",
    "        print(\"Dog: Drank water at {}.\".format( self.location))\n",
    "\n",
    "dog = BlindDog()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "What we have just done is create a dog who can only feel what's in his location (since he's blind), and can eat or drink. Let's see if he's alive..."
   ]
  },
  {
   "cell_type": "code",
tolusalako's avatar
tolusalako a validé
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True\n"
     ]
    }
   ],
   "source": [
    "print(dog.alive)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
Toluwanimi Salako's avatar
Toluwanimi Salako a validé
    "![Cool dog](https://gifgun.files.wordpress.com/2015/07/wpid-wp-1435860392895.gif)\n",
tolusalako's avatar
tolusalako a validé
    "This is our dog. How cool is he? Well, he's hungry and needs to go search for food. For him to do this, we need to give him a program. But before that, let's create a park for our dog to play in."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ENVIRONMENT #\n",
    "\n",
    "A park is an example of an environment because our dog can perceive and act upon it. The <b>Environment</b> class in agents.py is an abstract class, so we will have to create our own subclass from it before we can use it. The abstract class must contain the following methods:\n",
    "\n",
    "<li><b>percept(self, agent)</b> - returns what the agent perceives</li>\n",
    "<li><b>execute_action(self, agent, action)</b> - changes the state of the environment based on what the agent does.</li>"
   ]
  },
  {
   "cell_type": "code",
tolusalako's avatar
tolusalako a validé
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "class Food(Thing):\n",
    "    pass\n",
    "\n",
    "class Water(Thing):\n",
    "    pass\n",
    "\n",
    "class Park(Environment):\n",
    "    def percept(self, agent):\n",
    "        '''prints & return a list of things that are in our agent's location'''\n",
tolusalako's avatar
tolusalako a validé
    "        things = self.list_things_at(agent.location)\n",
    "        return things\n",
    "    \n",
    "    def execute_action(self, agent, action):\n",
    "        '''changes the state of the environment based on what the agent does.'''\n",
    "        if action == \"move down\":\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
tolusalako's avatar
tolusalako a validé
    "            agent.movedown()\n",
    "        elif action == \"eat\":\n",
    "            items = self.list_things_at(agent.location, tclass=Food)\n",
    "            if len(items) != 0:\n",
    "                if agent.eat(items[0]): #Have the dog eat the first item\n",
    "                    print('{} ate {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
tolusalako's avatar
tolusalako a validé
    "                    self.delete_thing(items[0]) #Delete it from the Park after.\n",
    "        elif action == \"drink\":\n",
    "            items = self.list_things_at(agent.location, tclass=Water)\n",
    "            if len(items) != 0:\n",
    "                if agent.drink(items[0]): #Have the dog drink the first item\n",
    "                    print('{} drank {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
tolusalako's avatar
tolusalako a validé
    "                    self.delete_thing(items[0]) #Delete it from the Park after.\n",
tolusalako's avatar
tolusalako a validé
    "    def is_done(self):\n",
    "        '''By default, we're done when we can't find a live agent, \n",
    "        but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
tolusalako's avatar
tolusalako a validé
    "        no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
    "        dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
    "        return dead_agents or no_edibles\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# PROGRAM - BlindDog #\n",
tolusalako's avatar
tolusalako a validé
    "Now that we have a <b>Park</b> Class, we need to implement a <b>program</b> module for our dog. A program controls how the dog acts upon it's environment. Our program will be very simple, and is shown in the table below.\n",
    "<table>\n",
    "    <tr>\n",
    "        <td><b>Percept:</b> </td>\n",
    "        <td>Feel Food </td>\n",
    "        <td>Feel Water</td>\n",
    "        <td>Feel Nothing</td>\n",
    "   </tr>\n",
    "   <tr>\n",
    "       <td><b>Action:</b> </td>\n",
    "       <td>eat</td>\n",
    "       <td>drink</td>\n",
    "       <td>move down</td>\n",
tolusalako's avatar
tolusalako a validé
    "   </tr>\n",
    "        \n",
    "</table>\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
tolusalako's avatar
tolusalako a validé
    "class BlindDog(Agent):\n",
    "    location = 1\n",
    "    \n",
    "    def movedown(self):\n",
    "        self.location += 1\n",
    "        \n",
    "    def eat(self, thing):\n",
    "        '''returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Food):\n",
    "            #print(\"Dog: Ate food at {}.\".format(self.location))\n",
tolusalako's avatar
tolusalako a validé
    "            return True\n",
    "        return False\n",
    "    \n",
    "    def drink(self, thing):\n",
    "        ''' returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Water):\n",
    "            #print(\"Dog: Drank water at {}.\".format(self.location))\n",
tolusalako's avatar
tolusalako a validé
    "            return True\n",
    "        return False\n",
    "        \n",
    "def program(percepts):\n",
    "    '''Returns an action based on it's percepts'''\n",
    "    for p in percepts:\n",
    "        if isinstance(p, Food):\n",
    "            return 'eat'\n",
    "        elif isinstance(p, Water):\n",
    "            return 'drink'\n",
    "    return 'move down'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Lets now run our simulation by creating a park with some food, water, and our dog."
tolusalako's avatar
tolusalako a validé
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
tolusalako's avatar
tolusalako a validé
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BlindDog decided to move down at location: 1\n",
      "BlindDog decided to move down at location: 2\n",
      "BlindDog decided to move down at location: 3\n",
      "BlindDog decided to move down at location: 4\n",
      "BlindDog ate Food at location: 5\n"
     ]
    }
   ],
tolusalako's avatar
tolusalako a validé
   "source": [
    "park = Park()\n",
    "dog = BlindDog(program)\n",
    "dogfood = Food()\n",
    "water = Water()\n",
    "park.add_thing(dog, 1)\n",
tolusalako's avatar
tolusalako a validé
    "park.add_thing(dogfood, 5)\n",
    "park.add_thing(water, 7)\n",
    "\n",
    "park.run(5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Notice that the dog moved from location 1 to 4, over 4 steps, and ate food at location 5 in the 5th step.\n",
    "\n",
    "Lets continue this simulation for 5 more steps."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BlindDog decided to move down at location: 5\n",
      "BlindDog decided to move down at location: 6\n",
      "BlindDog drank Water at location: 7\n"
     ]
    }
   ],
   "source": [
    "park.run(5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Perfect! Note how the simulation stopped after the dog drank the water - exhausting all the food and water ends our simulation, as we had defined before. Lets add some more water and see if our dog can reach it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BlindDog decided to move down at location: 7\n",
      "BlindDog decided to move down at location: 8\n",
      "BlindDog decided to move down at location: 9\n",
      "BlindDog decided to move down at location: 10\n",
      "BlindDog decided to move down at location: 11\n",
      "BlindDog decided to move down at location: 12\n",
      "BlindDog decided to move down at location: 13\n",
      "BlindDog decided to move down at location: 14\n",
      "BlindDog drank Water at location: 15\n"
     ]
    }
   ],
   "source": [
    "park.add_thing(water, 15)\n",
tolusalako's avatar
tolusalako a validé
    "park.run(10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This is how to implement an agent, its program, and environment. However, this was a very simple case. Lets try a 2-Dimentional environment now with multiple agents.\n",
    "\n",
    "\n",
    "# 2D Environment #\n",
    "To make our Park 2D, we will need to make it a subclass of <b>XYEnvironment</b> instead of Environment. Please note that our park is indexed in the 4th quadrant of the X-Y plane.\n",
    "We will also eventually add a person to pet the dog."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
    "class Park2D(XYEnvironment):\n",
    "    def percept(self, agent):\n",
    "        '''prints & return a list of things that are in our agent's location'''\n",
    "        things = self.list_things_at(agent.location)\n",
    "        return things\n",
    "    \n",
    "    def execute_action(self, agent, action):\n",
    "        '''changes the state of the environment based on what the agent does.'''\n",
    "        if action == \"move down\":\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
    "            agent.movedown()\n",
    "        elif action == \"eat\":\n",
    "            items = self.list_things_at(agent.location, tclass=Food)\n",
    "            if len(items) != 0:\n",
    "                if agent.eat(items[0]): #Have the dog eat the first item\n",
    "                    print('{} ate {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0]) #Delete it from the Park after.\n",
    "        elif action == \"drink\":\n",
    "            items = self.list_things_at(agent.location, tclass=Water)\n",
    "            if len(items) != 0:\n",
    "                if agent.drink(items[0]): #Have the dog drink the first item\n",
    "                    print('{} drank {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0]) #Delete it from the Park after.\n",
    "                    \n",
    "    def is_done(self):\n",
    "        '''By default, we're done when we can't find a live agent, \n",
    "        but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
    "        no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
    "        dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
    "        return dead_agents or no_edibles\n",
    "\n",
    "class BlindDog(Agent):\n",
    "    location = [0,1]# change location to a 2d value\n",
    "    direction = Direction(\"down\")# variable to store the direction our dog is facing\n",
    "    \n",
    "    def movedown(self):\n",
    "        self.location[1] += 1\n",
    "        \n",
    "    def eat(self, thing):\n",
    "        '''returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Food):\n",
    "            return True\n",
    "        return False\n",
    "    \n",
    "    def drink(self, thing):\n",
    "        ''' returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Water):\n",
    "            return True\n",
    "        return False\n",
    "        \n",
    "def program(percepts):\n",
    "    '''Returns an action based on it's percepts'''\n",
    "    for p in percepts:\n",
    "        if isinstance(p, Food):\n",
    "            return 'eat'\n",
    "        elif isinstance(p, Water):\n",
    "            return 'drink'\n",
    "    return 'move down'"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now lets test this new park with our same dog, food and water"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "BlindDog decided to move down at location: [0, 1]\n",
      "BlindDog decided to move down at location: [0, 2]\n",
      "BlindDog decided to move down at location: [0, 3]\n",
      "BlindDog decided to move down at location: [0, 4]\n",
      "BlindDog ate Food at location: [0, 5]\n",
      "BlindDog decided to move down at location: [0, 5]\n",
      "BlindDog decided to move down at location: [0, 6]\n",
      "BlindDog drank Water at location: [0, 7]\n",
      "BlindDog decided to move down at location: [0, 7]\n",
      "BlindDog decided to move down at location: [0, 8]\n",
      "BlindDog decided to move down at location: [0, 9]\n",
      "BlindDog decided to move down at location: [0, 10]\n",
      "BlindDog decided to move down at location: [0, 11]\n",
      "BlindDog decided to move down at location: [0, 12]\n",
      "BlindDog decided to move down at location: [0, 13]\n",
      "BlindDog decided to move down at location: [0, 14]\n",
      "BlindDog drank Water at location: [0, 15]\n"
     ]
    }
   ],
   "source": [
    "park = Park2D(5,20) # park width is set to 5, and height to 20\n",
    "dog = BlindDog(program)\n",
    "dogfood = Food()\n",
    "water = Water()\n",
    "park.add_thing(dog, [0,1])\n",
    "park.add_thing(dogfood, [0,5])\n",
    "park.add_thing(water, [0,7])\n",
    "morewater = Water()\n",
    "park.add_thing(morewater, [0,15])\n",
    "park.run(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This works, but our blind dog doesn't make any use of the 2 dimensional space available to him. Let's make our dog more energetic so that he turns and moves forward, instead of always moving down. We'll also need to make appropriate changes to our environment to be able to handle this extra motion.\n",
    "\n",
    "# PROGRAM - EnergeticBlindDog #\n",
    "\n",
    "Lets make our dog turn or move forwards at random - except when he's at the edge of our park - in which case we make him change his direction explicitly by turning to avoid trying to leave the park. Our dog is blind, however, so he wouldn't know which way to turn - he'd just have to try arbitrarily.\n",
    "\n",
    "<table>\n",
    "    <tr>\n",
    "        <td><b>Percept:</b> </td>\n",
    "        <td>Feel Food </td>\n",
    "        <td>Feel Water</td>\n",
    "        <td>Feel Nothing</td>\n",
    "   </tr>\n",
    "   <tr>\n",
    "       <td><b>Action:</b> </td>\n",
    "       <td>eat</td>\n",
    "       <td>drink</td>\n",
    "       <td>\n",
    "       <table>\n",
    "           <tr>\n",
    "               <td><b>Remember being at Edge : </b></td>\n",
    "               <td>At Edge</td>\n",
    "               <td>Not at Edge</td>\n",
    "           </tr>\n",
    "           <tr>\n",
    "               <td><b>Action : </b></td>\n",
    "               <td>Turn Left / Turn Right <br> ( 50% - 50% chance )</td>\n",
    "               <td>Turn Left / Turn Right / Move Forward <br> ( 25% - 25% - 50% chance )</td>\n",
    "           </tr>\n",
    "       </table>\n",
    "       </td>\n",
    "   </tr>\n",
    "        \n",
    "</table>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from random import choice\n",
    "\n",
    "turn = False# global variable to remember to turn if our dog hits the boundary\n",
    "class EnergeticBlindDog(Agent):\n",
    "    location = [0,1]\n",
    "    direction = Direction(\"down\")\n",
    "    \n",
    "    def moveforward(self, success=True):\n",
    "        '''moveforward possible only if success (ie valid destination location)'''\n",
    "        global turn\n",
    "        if not success:\n",
    "            turn = True # if edge has been reached, remember to turn\n",
    "            return\n",
    "        if self.direction.direction == Direction.R:\n",
    "            self.location[0] += 1\n",
    "        elif self.direction.direction == Direction.L:\n",
    "            self.location[0] -= 1\n",
    "        elif self.direction.direction == Direction.D:\n",
    "            self.location[1] += 1\n",
    "        elif self.direction.direction == Direction.U:\n",
    "            self.location[1] -= 1\n",
    "    \n",
    "    def turn(self, d):\n",
    "        self.direction = self.direction + d\n",
    "        \n",
    "    def eat(self, thing):\n",
    "        '''returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Food):\n",
    "            #print(\"Dog: Ate food at {}.\".format(self.location))\n",
    "            return True\n",
    "        return False\n",
    "    \n",
    "    def drink(self, thing):\n",
    "        ''' returns True upon success or False otherwise'''\n",
    "        if isinstance(thing, Water):\n",
    "            #print(\"Dog: Drank water at {}.\".format(self.location))\n",
    "            return True\n",
    "        return False\n",
    "        \n",
    "def program(percepts):\n",
    "    '''Returns an action based on it's percepts'''\n",
    "    global turn\n",
    "    for p in percepts: # first eat or drink - you're a dog!\n",
    "        if isinstance(p, Food):\n",
    "            return 'eat'\n",
    "        elif isinstance(p, Water):\n",
    "            return 'drink'\n",
    "    if turn: # then recall if you were at an edge and had to turn\n",
    "        turn = False\n",
    "        choice = random.choice((1,2));\n",
    "    else:\n",
    "        choice = random.choice((1,2,3,4)) # 1-right, 2-left, others-forward\n",
    "    if choice == 1:\n",
    "        return 'turnright'\n",
    "    elif choice == 2:\n",
    "        return 'turnleft'\n",
    "    else:\n",
    "        return 'moveforward'\n",
    "    "
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We also need to modify our park accordingly, in order to be able to handle all the new actions our dog wishes to execute. Additionally, we'll need to prevent our dog from moving to locations beyond our park boundary - it just isn't safe for blind dogs to be outside the park by themselves."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class Park2D(XYEnvironment):\n",
    "    def percept(self, agent):\n",
    "        '''prints & return a list of things that are in our agent's location'''\n",
    "        things = self.list_things_at(agent.location)\n",
    "        return things\n",
    "    \n",
    "    def execute_action(self, agent, action):\n",
    "        '''changes the state of the environment based on what the agent does.'''\n",
    "        if action == 'turnright':\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
    "            agent.turn(Direction.R)\n",
    "            #print('now facing {}'.format(agent.direction.direction))\n",
    "        elif action == 'turnleft':\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
    "            agent.turn(Direction.L)\n",
    "            #print('now facing {}'.format(agent.direction.direction))\n",
    "        elif action == 'moveforward':\n",
    "            loc = copy.deepcopy(agent.location) # find out the target location\n",
    "            if agent.direction.direction == Direction.R:\n",
    "                loc[0] += 1\n",
    "            elif agent.direction.direction == Direction.L:\n",
    "                loc[0] -= 1\n",
    "            elif agent.direction.direction == Direction.D:\n",
    "                loc[1] += 1\n",
    "            elif agent.direction.direction == Direction.U:\n",
    "                loc[1] -= 1\n",
    "            #print('{} at {} facing {}'.format(agent, loc, agent.direction.direction))\n",
    "            if self.is_inbounds(loc):# move only if the target is a valid location\n",
    "                print('{} decided to move {}wards at location: {}'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
    "                agent.moveforward()\n",
    "            else:\n",
    "                print('{} decided to move {}wards at location: {}, but couldnt'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
    "                agent.moveforward(False)\n",
    "        elif action == \"eat\":\n",
    "            items = self.list_things_at(agent.location, tclass=Food)\n",
    "            if len(items) != 0:\n",
    "                if agent.eat(items[0]):\n",
    "                    print('{} ate {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0])\n",
    "        elif action == \"drink\":\n",
    "            items = self.list_things_at(agent.location, tclass=Water)\n",
    "            if len(items) != 0:\n",
    "                if agent.drink(items[0]):\n",
    "                    print('{} drank {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0])\n",
    "                    \n",
    "    def is_done(self):\n",
    "        '''By default, we're done when we can't find a live agent, \n",
    "        but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
    "        no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
    "        dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
    "        return dead_agents or no_edibles\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dog started at [0,0], facing down. Lets see if he found any food or water!\n",
      "EnergeticBlindDog decided to move downwards at location: [0, 0]\n",
      "EnergeticBlindDog decided to move downwards at location: [0, 1]\n",
      "EnergeticBlindDog drank Water at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnright at location: [0, 2]\n",
      "EnergeticBlindDog decided to move leftwards at location: [0, 2], but couldnt\n",
      "EnergeticBlindDog decided to turnright at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnright at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to move leftwards at location: [0, 2], but couldnt\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnright at location: [0, 2]\n",
      "EnergeticBlindDog decided to move leftwards at location: [0, 2], but couldnt\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to move downwards at location: [0, 2], but couldnt\n",
      "EnergeticBlindDog decided to turnright at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n",
      "EnergeticBlindDog decided to move rightwards at location: [0, 2]\n",
      "EnergeticBlindDog ate Food at location: [1, 2]\n"
     ]
    }
   ],
   "source": [
    "park = Park2D(3,3)\n",
    "dog = EnergeticBlindDog(program)\n",
    "dogfood = Food()\n",
    "water = Water()\n",
    "park.add_thing(dog, [0,0])\n",
    "park.add_thing(dogfood, [1,2])\n",
    "park.add_thing(water, [2,1])\n",
    "morewater = Water()\n",
    "park.add_thing(morewater, [0,2])\n",
    "print('dog started at [0,0], facing down. Lets see if he found any food or water!')\n",
    "park.run(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This is good, but it still lacks graphics. What if we wanted to visualize our park as it changed? To do that, all we have to do is make our park a subclass of <b>GraphicEnvironment</b> instead of <b>XYEnvironment</b>. Lets see how this looks."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "class GraphicPark(GraphicEnvironment):\n",
    "    def percept(self, agent):\n",
    "        '''prints & return a list of things that are in our agent's location'''\n",
    "        things = self.list_things_at(agent.location)\n",
    "        return things\n",
    "    \n",
    "    def execute_action(self, agent, action):\n",
    "        '''changes the state of the environment based on what the agent does.'''\n",
    "        if action == 'turnright':\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
    "            agent.turn(Direction.R)\n",
    "            #print('now facing {}'.format(agent.direction.direction))\n",
    "        elif action == 'turnleft':\n",
    "            print('{} decided to {} at location: {}'.format(str(agent)[1:-1], action, agent.location))\n",
    "            agent.turn(Direction.L)\n",
    "            #print('now facing {}'.format(agent.direction.direction))\n",
    "        elif action == 'moveforward':\n",
    "            loc = copy.deepcopy(agent.location) # find out the target location\n",
    "            if agent.direction.direction == Direction.R:\n",
    "                loc[0] += 1\n",
    "            elif agent.direction.direction == Direction.L:\n",
    "                loc[0] -= 1\n",
    "            elif agent.direction.direction == Direction.D:\n",
    "                loc[1] += 1\n",
    "            elif agent.direction.direction == Direction.U:\n",
    "                loc[1] -= 1\n",
    "            #print('{} at {} facing {}'.format(agent, loc, agent.direction.direction))\n",
    "            if self.is_inbounds(loc):# move only if the target is a valid location\n",
    "                print('{} decided to move {}wards at location: {}'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
    "                agent.moveforward()\n",
    "            else:\n",
    "                print('{} decided to move {}wards at location: {}, but couldnt'.format(str(agent)[1:-1], agent.direction.direction, agent.location))\n",
    "                agent.moveforward(False)\n",
    "        elif action == \"eat\":\n",
    "            items = self.list_things_at(agent.location, tclass=Food)\n",
    "            if len(items) != 0:\n",
    "                if agent.eat(items[0]):\n",
    "                    print('{} ate {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0])\n",
    "        elif action == \"drink\":\n",
    "            items = self.list_things_at(agent.location, tclass=Water)\n",
    "            if len(items) != 0:\n",
    "                if agent.drink(items[0]):\n",
    "                    print('{} drank {} at location: {}'\n",
    "                          .format(str(agent)[1:-1], str(items[0])[1:-1], agent.location))\n",
    "                    self.delete_thing(items[0])\n",
    "                    \n",
    "    def is_done(self):\n",
    "        '''By default, we're done when we can't find a live agent, \n",
    "        but to prevent killing our cute dog, we will stop before itself - when there is no more food or water'''\n",
    "        no_edibles = not any(isinstance(thing, Food) or isinstance(thing, Water) for thing in self.things)\n",
    "        dead_agents = not any(agent.is_alive() for agent in self.agents)\n",
    "        return dead_agents or no_edibles\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "That is the only change we make. The rest of our code stays the same. There is a slight difference in usage though. Every time we create a GraphicPark, we need to define the colors of all the things we plan to put into the park. The colors are defined in typical [<b>RGB digital 8-bit format</b>](https://en.wikipedia.org/wiki/RGB_color_model#Numeric_representations), common across the web."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "dog started at [0,0], facing down. Lets see if he found any food or water!\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksaf1405d9-7c77-4d02-8174-8388e561d556 td {border: 1px solid white;}</style><table id=\"blocksaf1405d9-7c77-4d02-8174-8388e561d556\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move downwards at location: [0, 0]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks99100e92-9bff-4520-abef-0033260b28fa td {border: 1px solid white;}</style><table id=\"blocks99100e92-9bff-4520-abef-0033260b28fa\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog drank Water at location: [0, 1]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks0140eb62-c20c-4144-abca-5ec02e4b8bd6 td {border: 1px solid white;}</style><table id=\"blocks0140eb62-c20c-4144-abca-5ec02e4b8bd6\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [0, 1]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksf39f35ea-383e-4a46-b41e-7bc10d0ba96c td {border: 1px solid white;}</style><table id=\"blocksf39f35ea-383e-4a46-b41e-7bc10d0ba96c\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnright at location: [0, 1]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksb27ca4da-8807-40f2-849d-745e30fc4bfc td {border: 1px solid white;}</style><table id=\"blocksb27ca4da-8807-40f2-849d-745e30fc4bfc\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move downwards at location: [0, 1]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blockscab41cde-4b8f-465b-9149-5cce0dc22e0a td {border: 1px solid white;}</style><table id=\"blockscab41cde-4b8f-465b-9149-5cce0dc22e0a\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [0, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks6efe042f-73fa-4122-9083-93a2ab785c1c td {border: 1px solid white;}</style><table id=\"blocks6efe042f-73fa-4122-9083-93a2ab785c1c\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move rightwards at location: [0, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksa894dcae-9df0-4f71-8d0b-71d79e03a486 td {border: 1px solid white;}</style><table id=\"blocksa894dcae-9df0-4f71-8d0b-71d79e03a486\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog ate Food at location: [1, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksff9baccc-be51-49de-84f4-f5b2228ee189 td {border: 1px solid white;}</style><table id=\"blocksff9baccc-be51-49de-84f4-f5b2228ee189\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [1, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks47dc3290-05f2-4ba9-879d-2e9fa3e0a57a td {border: 1px solid white;}</style><table id=\"blocks47dc3290-05f2-4ba9-879d-2e9fa3e0a57a\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [1, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks197df250-f220-426b-9386-17ae9b3f57e8 td {border: 1px solid white;}</style><table id=\"blocks197df250-f220-426b-9386-17ae9b3f57e8\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [1, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks54adc6f5-aad0-4e90-9961-3c95292d2865 td {border: 1px solid white;}</style><table id=\"blocks54adc6f5-aad0-4e90-9961-3c95292d2865\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move downwards at location: [1, 2]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks34f360c8-d188-4adb-af9d-ef57332b66cc td {border: 1px solid white;}</style><table id=\"blocks34f360c8-d188-4adb-af9d-ef57332b66cc\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnright at location: [1, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blockse4035b7f-b2f5-4421-8e9c-50e21b12adb6 td {border: 1px solid white;}</style><table id=\"blockse4035b7f-b2f5-4421-8e9c-50e21b12adb6\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move leftwards at location: [1, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksd97c6f72-f7ef-455f-b647-b354b8689fef td {border: 1px solid white;}</style><table id=\"blocksd97c6f72-f7ef-455f-b647-b354b8689fef\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move leftwards at location: [0, 3], but couldnt\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksa826f3b3-f0f8-4213-9a44-1690992507aa td {border: 1px solid white;}</style><table id=\"blocksa826f3b3-f0f8-4213-9a44-1690992507aa\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnleft at location: [0, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks2f9c919a-95f8-4bab-a7b2-643f44d2164a td {border: 1px solid white;}</style><table id=\"blocks2f9c919a-95f8-4bab-a7b2-643f44d2164a\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnright at location: [0, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks59718eb4-d5d0-4a05-b2da-6395de547e1d td {border: 1px solid white;}</style><table id=\"blocks59718eb4-d5d0-4a05-b2da-6395de547e1d\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move leftwards at location: [0, 3], but couldnt\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocksaa79961b-64f1-405b-b1bd-61af4e54ff3b td {border: 1px solid white;}</style><table id=\"blocksaa79961b-64f1-405b-b1bd-61af4e54ff3b\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to turnright at location: [0, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks6702c813-c35a-4c8c-a1da-105841db229b td {border: 1px solid white;}</style><table id=\"blocks6702c813-c35a-4c8c-a1da-105841db229b\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "EnergeticBlindDog decided to move upwards at location: [0, 3]\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blockse8c87bd0-109f-41ac-b0f1-06dbf3e6c037 td {border: 1px solid white;}</style><table id=\"blockse8c87bd0-109f-41ac-b0f1-06dbf3e6c037\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [0, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [1, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (200, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 0, 0);\"></td><td title=\"Index: [2, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [2, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 2]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [3, 4]&#10;Color: (230, 115, 40)\" style=\"width: 20px; height: 20px;background-color: rgb(230, 115, 40);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 1]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 2]&#10;Color: (0, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 200, 200);\"></td><td title=\"Index: [4, 3]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td><td title=\"Index: [4, 4]&#10;Color: (200, 200, 200)\" style=\"width: 20px; height: 20px;background-color: rgb(200, 200, 200);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "park = GraphicPark(5,5, color={'EnergeticBlindDog': (200,0,0), 'Water': (0, 200, 200), 'Food': (230, 115, 40)})\n",
    "dog = EnergeticBlindDog(program)\n",
    "dogfood = Food()\n",
    "water = Water()\n",
    "park.add_thing(dog, [0,0])\n",
    "park.add_thing(dogfood, [1,2])\n",
    "park.add_thing(water, [0,1])\n",
    "morewater = Water()\n",
    "morefood = Food()\n",
    "park.add_thing(morewater, [2,4])\n",
    "park.add_thing(morefood, [4,3])\n",
    "print('dog started at [0,0], facing down. Lets see if he found any food or water!')\n",
    "park.run(20)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "## Wumpus Environment"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from ipythonblocks import BlockGrid\n",
    "from agents import *\n",
    "\n",
    "color = {\"Breeze\": (225, 225, 225),\n",
    "        \"Pit\": (0,0,0),\n",
    "        \"Gold\": (253, 208, 23),\n",
    "        \"Glitter\": (253, 208, 23),\n",
    "        \"Wumpus\": (43, 27, 23),\n",
    "        \"Stench\": (128, 128, 128),\n",
    "        \"Explorer\": (0, 0, 255),\n",
    "        \"Wall\": (44, 53, 57)\n",
    "        }\n",
    "\n",
    "def program(percepts):\n",
    "    '''Returns an action based on it's percepts'''\n",
    "    print(percepts)\n",
    "    return input()\n",
    "\n",
    "w = WumpusEnvironment(program, 7, 7)         \n",
    "grid = BlockGrid(w.width, w.height, fill=(123, 234, 123))\n",
    "\n",
    "def draw_grid(world):\n",
    "    global grid\n",
    "    grid[:] = (123, 234, 123)\n",
    "    for x in range(0, len(world)):\n",
    "        for y in range(0, len(world[x])):\n",
    "            if len(world[x][y]):\n",
    "                grid[y, x] = color[world[x][y][-1].__class__.__name__]\n",
    "\n",
    "def step():\n",
    "    global grid, w\n",
    "    draw_grid(w.get_world())\n",
    "    grid.show()\n",
    "    w.step()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style type=\"text/css\">table.blockgrid {border: none;} .blockgrid tr {border: none;} .blockgrid td {padding: 0px;} #blocks938b81d6-751c-44be-b694-4071520e6655 td {border: 1px solid white;}</style><table id=\"blocks938b81d6-751c-44be-b694-4071520e6655\" class=\"blockgrid\"><tbody><tr><td title=\"Index: [0, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 1]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 2]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 3]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 4]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 5]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [0, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [1, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [1, 1]&#10;Color: (0, 0, 255)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 0, 255);\"></td><td title=\"Index: [1, 2]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [1, 3]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [1, 4]&#10;Color: (128, 128, 128)\" style=\"width: 20px; height: 20px;background-color: rgb(128, 128, 128);\"></td><td title=\"Index: [1, 5]&#10;Color: (43, 27, 23)\" style=\"width: 20px; height: 20px;background-color: rgb(43, 27, 23);\"></td><td title=\"Index: [1, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [2, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [2, 1]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [2, 2]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [2, 3]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [2, 4]&#10;Color: (253, 208, 23)\" style=\"width: 20px; height: 20px;background-color: rgb(253, 208, 23);\"></td><td title=\"Index: [2, 5]&#10;Color: (128, 128, 128)\" style=\"width: 20px; height: 20px;background-color: rgb(128, 128, 128);\"></td><td title=\"Index: [2, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [3, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [3, 1]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [3, 2]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [3, 3]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [3, 4]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [3, 5]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [3, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [4, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [4, 1]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [4, 2]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [4, 3]&#10;Color: (0, 0, 0)\" style=\"width: 20px; height: 20px;background-color: rgb(0, 0, 0);\"></td><td title=\"Index: [4, 4]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [4, 5]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [4, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [5, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [5, 1]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [5, 2]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [5, 3]&#10;Color: (225, 225, 225)\" style=\"width: 20px; height: 20px;background-color: rgb(225, 225, 225);\"></td><td title=\"Index: [5, 4]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [5, 5]&#10;Color: (123, 234, 123)\" style=\"width: 20px; height: 20px;background-color: rgb(123, 234, 123);\"></td><td title=\"Index: [5, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr><tr><td title=\"Index: [6, 0]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 1]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 2]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 3]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 4]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 5]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td><td title=\"Index: [6, 6]&#10;Color: (44, 53, 57)\" style=\"width: 20px; height: 20px;background-color: rgb(44, 53, 57);\"></td></tr></tbody></table>"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[<Bump>], [<Breeze>], [<Bump>], [<Breeze>], [<Breeze>, None]]\n",
      "Forward\n"
     ]
    }
   ],
   "source": [
    "step()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.4.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}