// default is you don't change the ca space. default mouse=mouse; default direc=direc; // mouse will find an empty cell next to it to move into if (mouse=='M') { rot if (direc=='d' || direc=='^' && no:direc=='.') // mouse has already decided where to move mouse='.'; // so it moves else rot if ((no:mouse=='.' || no:mouse=='F') && no:direc=='.') // check empty neighbors direc='^'; // find one, so set the direction else // exhausted all chance, should back track now direc='d'; // so set to dead direction and wait for rescue. } if (mouse=='F') { // if I am food and mouse found me then I change to 'V' rot if (so:mouse=='M' && so:direc=='^') mouse = 'V'; } // empty space will check if a mouse is willing to come over if (mouse=='.') { rot if (direc=='.' && so:direc=='^' && so:mouse=='M') // a mouse points a me mouse = so:mouse; // so I copy it over. else rot if (direc=='^' && no:direc=='d' && no:mouse=='M') // a mouse needs rescue mouse = no:mouse; // so I also copy it over. }