As a deeper example of interfacing with the MshHostRawUserInterface class, the next few articles will deal with implementing the classic “Fire Effect” seen in many of the demos that I so fondly remember. As part of the journey, we’ll also explore some of the ways in which you can improve the performance of time-sensitive portions of your script.

[This GIF is animated. Some Ad blocking software restricts animation]
What is the fire effect? It’s a relatively simple algorithm to simulate fire – usually in a graphical buffer. We’re going to do it in the console text buffer. In the algorithm, you seed the bottom row randomly with hot pixels. Then, you progress the fire upwards. As you progress the fire upwards, you cool it off a little bit – and simulate heat dissipation by averaging the heat from nearby buffer cells.
