Environment: Let assume the environment is a grid of colored tiles(WHITE,BLUE,GREEN,BLACK,YELLOW).Robot is standing on a tile.Every tile has a(X,Y) Position We use a function getTileColor(x,y) to know color of current tile(x,y position). ALGORITHM: TRESUREHUNT(x,y) 1. color=getColor(x,y) 2. IF color=YELLOW 3. Return \"tiles\"+x+y+\" Is a tresure\" 4. ELSE IF color=WHITE 5. TRESUREHUNT(x,y-1) // move to front tile by decrementing y by 1 6 ELSE IF color=BLUE 7. TRESUREHUNT(x-1,y) // move to left bydecrementing x by 1 8. ELSE IF color=GREEN 9. TRESUREHUNT(x+1,y) // move to right tile by incrementing x by 1 10. ELSE IF color=BLACK 11. TRESUREHUNT(x,y+2) // move to front tile by incrementint y by 2 12. ELSE 13. Return \"Unsucessfull\" 12.END iF C++ CODE //for simplicity i represent entite grid in a 2;D array .Each cell is viewed as a tile.It contains arbitary color values,0-BLACK //1-BLUE,2;GREEN,14;YELLOW,15-WHITE //accordingly the x,y value is changed. if current cell(tile)=15(WHITE) robot moves to front tile. // so x=x-1 and y=y #include #include void tresurehunt(int x,int y); int grid[][7]={ {1, 1, 1, 14,2, 0, 15}, {0, 1, 1, 1, 0, 0, 2}, {2, 2 ,1, 0, 15,14,1}, {15,15,14,0, 1, 2, 1}, {15,0, 0, 1, 2, 2, 14}, {14,14,14,15,0, 2, 2}, {15,15,15,1, 1, 2, 1}}; int main() { tresurehunt(4,4); return 0; } void tresurehunt(int x,int y) { //int color=getpixel(x,y); int color=grid[x][y]; if(color==YELLOW) { cout<<\"Tresure is in:\"< Solution Environment: Let assume the environment is a grid of colored tiles(WHITE,BLUE,GREEN,BLACK,YELLOW).Robot is standing on a tile.Every tile has a(X,Y) Position We use a function getTileColor(x,y) to know color of current tile(x,y position). ALGORITHM: TRESUREHUNT(x,y) 1. color=getColor(x,y) 2. IF color=YELLOW 3. Return \"tiles\"+x+y+\" Is a tresure\" 4. ELSE IF color=WHITE 5. TRESUREHUNT(x,y-1) // move to front tile by decrementing y by 1 6 ELSE IF color=BLUE 7. TRESUREHUNT(x-1,y) // move to left bydecrementing x by 1 8. ELSE IF color=GREEN 9. TRESUREHUNT(x+1,y) // move to right tile by incrementing x by 1 10. ELSE IF color=BLACK 11. TRESUREHUNT(x,y+2) // move to front tile by incrementint y by 2 12. ELSE 13. Return \"Unsucessfull\" 12.END iF C++ CODE //for simplicity i represent entite grid in a 2;D array .Each cell is viewed as a tile.It contains arbitary color values,0-BLACK //1-BLUE,2;GREEN,14;YELLOW,15-WHITE //accordingly the x,y value is changed. if current cell(tile)=15(WHITE) robot moves to front tile. // so x=x-1 and y=y #include #include void tresurehunt(int x,int y); int grid[][7]={ {1, 1, 1, 14,2, 0, 15}, {0, 1, 1, 1, 0, 0, 2}, {2, 2 ,1, 0, 15,14,1}, {15,15,14,0, 1, 2, 1}, {15,0, 0, 1, 2, 2, 14}, {14,14,14,15,0, 2, 2}, {15,15,15,1, 1, 2, 1}}; int main() { tresurehunt(4,4); return 0; } void tresurehunt(int x,int y) { //int color=getpixel(x,y); int color=grid[x][y]; if(color==YELLOW) { cout<<\"Tresure is in:\"<.