mapobjcopy[ ][ythe map object has characters that represent the position of the playergoalsand stars these are necessary for the map object (they're stored in other data structures after the map file is readso they are converted to blank spaces flood fill to determine inside/outside floor tiles floodfill(mapobjcopystartxstarty'' 'the floodfill(function will change all of the tiles inside the walls from characters to 'ocharacters it does this using programming concept called recursionwhich is explained in --recursive functions|section later in this convert the adjoined walls into corner tiles for in range(len(mapobjcopy)) for in range(len(mapobjcopy[ ])) if mapobjcopy[ ][ ='#' if (iswall(mapobjcopyxy- and iswall(mapobjcopyx+ )or (iswall(mapobjcopyx+ yand iswall(mapobjcopyxy+ )or (iswall(mapobjcopyxy+ and iswall(mapobjcopyx- )or (iswall(mapobjcopyx- yand iswall(mapobjcopyxy- )) mapobjcopy[ ][ ' elif mapobjcopy[ ][ =and random randint( outside_decoration_pct mapobjcopy[ ][yrandom choice(list(outsidedecomapping keys()) return mapobjcopy the largemulti-line if statement on line checks if the wall tile at the current xy coordinates are corner wall tile by checking if there are wall tiles adjacent to it that form corner shape if sothe '#string in the map object that represents normal wall is changed to 'xstring which represents corner wall tile def isblocked(mapobjgamestateobjxy) """returns true if the (xyposition on the map is blocked by wall or starotherwise return false ""