Peg Solitaire French (European) Style, 37 Holes

Peg Solitaire French (European) Style, 37 Holes
Loading the math board and drawing, please wait…
2021-01-06 14:34
This GeoGebra applet demonstrates the board construction and game logic of the French European-style 37-hole Peg Solitaire, also known as Marteau or Kongming Chess. The applet precisely constructs the classic octagonal board layout featuring 37 circular holes arranged in a symmetric pattern, using GeoGebra commands such as Circle, Polygon, and Sequence to compute exact hole coordinates through analytic geometry. The board is rendered programmatically rather than drawn by hand, showcasing how mathematical algorithms can generate complex geometric grids with perfect regularity. Beyond static board drawing, the applet implements the core game mechanics of Peg Solitaire. Players interact with the board by clicking on pieces to select them and clicking on target holes to move, enabling the standard legal moves where a piece jumps over an adjacent peg into an empty hole, removing the jumped piece. The applet uses conditional logic and list operations to validate each move against the official rules, checking conditions such as whether the source contains a peg, whether the intermediate position is occupied, and whether the destination is empty. Move history is tracked throughout gameplay, allowing players to review the sequence of actions taken. The mathematical concepts illustrated include coordinate geometry for positioning the 37 holes on the octagonal grid, discrete mathematics in modeling the state transitions of peg removal, and algorithmic thinking through the rule-validation logic embedded in the model. The sequential generation of board elements using List and Sequence commands also demonstrates how parametric design principles apply to recreational mathematics. This interactive model serves as both an engaging puzzle platform and an educational tool. Students can explore spatial reasoning as they plan moves across the octagonal board, practice logical deduction as they work toward the classic goal of leaving a single peg remaining, and observe firsthand how analytic geometry and algorithmic construction underpin the design of board games. The applet thereby bridges abstract mathematical theory with hands-on problem solving, making it valuable for learners studying discrete structures, coordinate systems, and computational thinking.

GeoGebra Commands & Parameters

  1. Circle((-1, 3), r) → c1
  2. Circle((0, 3), r) → c2
  3. Circle((1, 3), r) → c3
  4. Circle((-1, 2), r) → c4
  5. Circle((0, 2), r) → c5
  6. Circle((1, 2), r) → c6
  7. Circle((-3, 1), r) → c7
  8. Circle((-2, 1), r) → c8
  9. Circle((-1, 1), r) → c9
  10. Circle((0, 1), r) → c10
  11. Circle((1, 1), r) → c11
  12. Circle((2, 1), r) → c12
  13. Circle((3, 1), r) → c13
  14. Circle((-3, 0), r) → c14
  15. Circle((-2, 0), r) → c15
  16. Circle((-1, 0), r) → c16
  17. Circle((0, 0), r) → c17
  18. Circle((1, 0), r) → c18
  19. Circle((2, 0), r) → c19
  20. Circle((-3, -1), r) → c21
  21. Circle((3, 0), r) → c20
  22. Circle((-2, -1), r) → c22
  23. Circle((-1, -1), r) → c23
  24. Circle((0, -1), r) → c24
  25. Circle((1, -1), r) → c25
  26. Circle((2, -1), r) → c26
  27. Circle((3, -1), r) → c27
  28. Circle((-1, -2), r) → c28
  29. Circle((0, -2), r) → c29
  30. Circle((1, -2), r) → c30
  31. Circle((-1, -3), r) → c31
  32. Circle((0, -3), r) → c32
  33. Circle((1, -3), r) → c33
  34. Intersection(focusongo, spaces) → spacesgo1
  35. Polygon({(-1.5, -3.5), (1.5, -3.5), (3.5, -1.5), (3.5, 1.5), (1.5, 3.5), (-1.5, 3.5), (-3.5, 1.5), (-3.5, -1.5)}) → polyBoard
  36. RemoveUndefined(Sequence[If[(focuson(1) + spacesgo1(k)) / 2 ∈ checkers, spacesgo1(k)], k, 1, Length[spacesgo1]]) → spacesgo
  37. Polygon({(-1.5, -3.5), (1.5, -3.5), (3.5, -1.5), (3.5, 1.5), (1.5, 3.5), (-1.5, 3.5), (-3.5, 1.5), (-3.5, -1.5)}) → polyBoardEdge
  38. Polygon({Corner[1], Corner[2], Corner[3], Corner[4]}) → polyBackground
  39. Length(checkers) → numR
  40. Length(Gamelog) → nGL
  41. Sequence(Circle[checkers(k), 0.375], k, 1, Length[checkers]) → checkersC
  42. Sequence(Circle[spacesgo(k), 0.375], k, 1, Length[spacesgo]) → spacesgoC
  43. Sequence(Circle[spaces(k), 0.375], k, 1, Length[spaces]) → spacesC
  44. Polygon({Corner[1], Corner[2], Corner[3], Corner[4]}) → polyMask
  45. Unique(Flatten[Sequence[{If[checkers(k) + (1, 0) ∈ checkers, checkers(k) + (2, 0)], If[checkers(k) + (-1, 0) ∈ checkers, checkers(k) + (-2, 0)], If[checkers(k) + (0, -1) ∈ checkers, checkers(k) + (0, -2)], If[checkers(k) + (0, 1) ∈ checkers, checkers(k) + (0, 2)]}, k, 1, Length[checkers]]]) → allcheckersgo
  46. Intersection(allcheckersgo, spaces) → allgo
  47. Circle((2, -2), r) → c37
  48. Circle((-2, -2), r) → c36
  49. Circle((2, 2), r) → c35
  50. Polygon({(-1.3, -5), (1.3, -5), (1.3, -0.7), (-1.3, -0.7)}) → polyPattern
  51. Circle((-2, 2), r) → c34
  52. Sequence(Translate[picMarble, Vector[A, checkers(k) + (-0.375, -0.375)]], k, 1, Length[checkers]) → checkersM

AI Drawing Prompt Reference

Draw a 37-hole European-style chessboard, including an octagonal board frame, 37 circular holes, pieces, and empty spaces. The board frame is an octagon with a side length of 5 units. The 37 holes are circular with a radius of 0.375 units, arranged in an octagonal pattern on the board, forming a symmetrical design. The pieces are circular with a radius of 0.375 units, located in some of the holes on the board. The empty spaces are the holes on the board without pieces. Draw the entire board, including the board frame, holes, pieces, and empty spaces.
The prompt above was compiled from the original drawing commands and is for reference only.