Slide Puzzle Example

Slide Puzzle Example
Loading the math board and drawing, please wait…
2018-01-07 19:40
This example demonstrates a slide puzzle game where blocks are dragged to restore a complete image. Core math concepts include logical operations, coordinate transformations, random number generation, and geometric shape drawing. Construction highlights the use of GeoGebra commands like Point, PolyLine, Sequence, Polygon, If, RemoveUndefined, CountIf, Random, IndexOf, Translate, and objects such as points, A, frame, B, D, E, F, G, H, I, J, K, L, M, N, Z, O, button1, C, C_1, Z_1, B_1, A_1, D_1, E_1, F_1, G_1, K_1, J_1, I_1, H_1, L_1, M_1, N_1, O_1, image1, image2, image3, image4, image5. Suitable for high school math classes to illustrate probability & statistics, geometric transformations, and algorithmic applications, or for programming education.

GeoGebra Commands & Parameters

  1. Point(points) → A
  2. PolyLine((0, 0), (8, 0), (8, 8), (0, 8), (0, 0)) → frame
  3. Point(points) → B
  4. Point(points) → D
  5. Point(points) → E
  6. Point(points) → F
  7. Point(points) → G
  8. Point(points) → H
  9. Point(points) → I
  10. Point(points) → J
  11. Point(points) → K
  12. Point(points) → L
  13. Point(points) → M
  14. Point(points) → N
  15. Point(points) → O
  16. Sequence(Segment[(i, 0), (i, 8)], i, 2, 6, 2) → list1
  17. Sequence(Segment[(0, i), (8, i)], i, 2, 6, 2) → list2
  18. Polygon((x(Z) - 1, y(Z) - 1), (x(Z) + 1, y(Z) - 1), (x(Z) + 1, y(Z) + 1), (x(Z) - 1, y(Z) + 1)) → polygon1, a, b, c, d
  19. If(t ≟ 10, false, true) → scramble
  20. Sequence(If[Distance[Z, Element[points2, i]] ≟ 2, Element[points2, i]], i, 1, 15) → closepoints
  21. RemoveUndefined(closepoints) → closepointsclean
  22. CountIf(true, howmany, closepointsclean) → howmany
  23. Random(1, howmany) → i
  24. Polygon((18, 8), (20, 8), (20, 6), (18, 6)) → polygon2, e, f, g, h
  25. IndexOf((3, 7), points) → j
  26. Translate(frame, (12, 0)) → frame'