This document contains code for implementing flood filling and boundary filling algorithms. It defines functions for 4-connected and 8-connected boundary filling (bfill4 and bfill8) and flood filling (ffill4 and ffill8). These functions recursively change the color of pixels connected to a starting pixel. The main function draws a polygon, performs 8-connected boundary and flood filling, and ends the graphics mode.