This came from the fact I wanted to learn Java, so I asked a teacher for a challenge I could do on my own.
You have a bunch of ball arranged in a grid as show in the solutions_sketch.jpg.
Each ball have can have a certain property accorded to a probability p. We are not interested about this probability, just that a ball have it or not.
Then our goal is to know if there is percolation. Meaning that there exists on or more path from the top of the grid to the bottom of the grid.
A path is qualified 2 properties :
- All the balls of the path must have the property
- All the balls of the path must be direct neighbors
As with most projects, there is still more to do, still ways to improve it.
For this one, it would be to add an ascii display of the grid, extend it to the 3rd dimension, add the possibility of doing multiple simulations and maybe even some statistic.