(The MonteCarlo algorithm is a very strange algorithm, but its thinking is not very messy. This document teaches you how to use this strange algorithm step by step from simple to messy, and uses C # to implement the algorithm in between. The text is attached with specific source code and instructions. I think this document is worth looking at. This document includes the following annexes:
Parsing the MonteCarlo Algorithm.pdf)