(The main idea of the flame effect program is to average the color values of the eight points above, below, left, right, upper left, lower left, upper right and lower right of the current point, and then attenuate each frame to move the current pixel up. You need to prepare a palette, which is actually a color array to save the flame colors from yellow to black to represent the different colors when the flame rises.)