This is a simulation of how a rolling average acts to smooth out the output of a sensor. The role of sensor in this program is played by a random number generator.
Thank you to Mr. Dec and from ChatGPT for helping me with the concept and the code to calculate the rolling average.