June 1 is the international Children's Day celebrated in many countries, so I decided to spend the last weekend developing a Mathematica version of the Triangle Peg Game to impress some young friends. I've only very recently discovered the game, and this is my very first game developed with Mathematica (notebook attached). Thanks very much to the author of the other post Raiden Arcade game. I learned all the basics by studying the code of many other games mentioned there.
The rules of Peg Game are quite simple:
The standard version has 15 pegs, but I wonder how the game will look like by increasing the size. The version I developed allows a user to choose the size of the board and the open space at the beginning:
Then the user can simply click around to make the pegs disappear ( the adorable Wolfie here stands for peg ):
I am really impressed by how easy it is to draw graphics and create interactions with Wolfram Language. In fact, the first thing I did is to create the grids -- and this saved a lot of papers as there's no need to draw the board to figure out the relationships of the pegs.
Welcome any suggestions to improve the code or the behavior.
For people who are more interested in solutions, here are some good links I found: