Implementation of the chaos game to generate flame fractals