pygame display update(draw displaysurf to the screen fpsclock tick( def decoratemap(mapobjstartxy) """makes copy of the given map object and modifies it here is what is done to it walls that are corners are turned into corner pieces the outside/inside floor tile distinction is made tree/rock decorations are randomly added to the outside tiles returns the decorated map object "" startxstarty startxy syntactic sugar copy the map object so we don' modify the original passed mapobjcopy copy deepcopy(mapobj remove the non-wall characters from the map data for in range(len(mapobjcopy)) for in range(len(mapobjcopy[ ])) if mapobjcopy[ ][yin ('$'''@''+''*') mapobjcopy[ ][ flood fill to determine inside/outside floor tiles floodfill(mapobjcopystartxstarty'' ' 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