Percolation simulator in C++