It's just a simple cave generator.
The source: www.roguebasin.com
# - wall
. - empty space
"Generate" - compute another matches according the scheme given above.
"Reset" - Clears the board and fill it with random walls and empty spaces ("#" and ".") by percent chance of occurence of the Walls.