Snail Race - Integer Addition & Subtraction

Snail Race - Integer Addition & Subtraction
Loading the math board and drawing, please wait…
2025-09-22 19:38
This example demonstrates a dynamic snail race simulation using integer addition and subtraction to model the race progress. Core math concepts include integer arithmetic, sequence generation, and conditional logic. Construction highlights involve GeoGebra commands and objects like Textfield, Segment, Polygon, OrthogonalLine, Sequence, If, Defined, Shuffle, Flatten, Split, CountIf to create the ra

GeoGebra Commands & Parameters

  1. Textfield(input) → InputBox
  2. Segment((0, 0.7), (40, 0.7)) → f
  3. Segment((0, -9.3), (40, -9.3)) → g
  4. Polygon(E, F, G, H) → v1, e, f_1, g_1, h
  5. OrthogonalLine(A_1, xAxis) → i
  6. Sequence(Translate[Element[salat1, i], Vector[SalatPos1 + ((i - 1) * (dxFolge, 0))]], i, 1, 3) → showSalat1
  7. Sequence(Translate[Element[salat2, i], Vector[SalatPos2 + ((i - 1) * (dxFolge, 0))]], i, 1, 3) → showSalat2
  8. Sequence(Translate[Element[salat3, i], Vector[SalatPos3 + ((i - 1) * (dxFolge, 0))]], i, 1, 3) → showSalat3
  9. If(turboschnecke, 1 / 6, regenbogenschnecke, (1 / 6 * 0.8), (1 / 6 * 0.6)) → speed2
  10. Defined(input) → fixed
  11. Shuffle(Sequence[Random[2, 6], i, 1, 50]) → randomZahl3Nenner, {3, 6, 5, 3, 5, 4, 2, 2, 4, 4, 2, 2, 3, 6, 5, 6, 6, 4, 4, 5, 2, 4, 3, 3, 5, 6, 5, 2, 6, 3, 5, 6, 2, 4, 4, 5, 4, 5, 2, 3, 4, 6, 2, 6, 5, 3, 2, 3, 5, 5}
  12. Flatten(Sequence[Shuffle[1…4], k, 1, 50]) → VRAuswahl1
  13. Flatten(Sequence[Shuffle[1…4], k, 1, 50]) → VRAuswahl2
  14. Flatten(Sequence[Shuffle[1…4], k, 1, 50]) → VRAuswahl3
  15. Shuffle(Sequence[Random[1, 10], i, 1, 50]) → randomZahl11, {2, 8, 9, 10, 3, 5, 3, 4, 3, 3, 2, 8, 5, 9, 7, 1, 1, 1, 6, 8, 2, 7, 2, 4, 9, 7, 9, 4, 8, 1, 9, 3, 10, 3, 9, 6, 2, 10, 2, 5, 8, 8, 10, 10, 2, 2, 2, 1, 4, 2}
  16. Shuffle(Sequence[Random[1, 10], i, 1, 50]) → randomZahl12, {3, 2, 3, 10, 3, 1, 8, 7, 1, 5, 6, 9, 6, 3, 2, 5, 6, 4, 5, 10, 6, 8, 10, 6, 5, 5, 5, 10, 9, 3, 10, 6, 5, 9, 4, 1, 3, 3, 9, 8, 1, 7, 1, 5, 10, 9, 6, 3, 4, 1}
  17. Shuffle(Sequence[Random[1, 10], i, 1, 50]) → randomZahl13, {7, 7, 10, 1, 9, 3, 9, 9, 9, 4, 1, 6, 5, 4, 1, 5, 7, 10, 7, 2, 6, 2, 7, 9, 8, 7, 9, 5, 3, 10, 6, 10, 2, 1, 5, 7, 4, 4, 2, 9, 7, 8, 1, 6, 10, 5, 10, 4, 2, 9}
  18. Sequence(RandomElement[1…2], i, 1, 50) → random5050, {1, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, 1}
  19. Shuffle(Sequence[RandomElement[(0…49) \ {0, -10, 10, -20, 20, -30, 30, -40, 40}] / 10, i, 1, 55]) → randomZahl212, {2.2, 1.9, 1.7, 2.9, 1.2, 1.2, 3.9, 2.2, 0.6, 0.9, 2.7, 1.9, 4.8, 4.2, 1.4, 1.1, 3.4, 2.9, 4.4, 3.4, 0.3, 1.9, 1.3, 4.1, 3.1, 0.1, 4.4, 2.6, 1.9, 0.7, 4.7, 1.7, 4.8, 4.6, 2.7, 3.2, 4.8, 0.1, 2.1, 4.1, 3.9, 1.5, 0.9, 2.9, 1.9, 1.7, 1.1, 4.8, 3.8, 2.8, 1.4, 4.5, 2.8, 0.2, 2.3}
  20. Shuffle(Sequence[RandomElement[(1…10) \ {10}] / 10, i, 1, 55]) → randomZahl211, {0.5, 0.7, 0.7, 0.4, 0.7, 0.7, 0.5, 0.2, 0.6, 0.9, 0.2, 0.7, 0.8, 0.5, 0.7, 0.6, 0.9, 0.1, 0.3, 0.1, 0.8, 0.1, 0.4, 0.4, 0.4, 0.8, 0.5, 0.4, 0.4, 0.4, 0.5, 0.5, 0.3, 0.7, 0.6, 0.2, 0.1, 0.6, 0.5, 0.9, 0.1, 0.9, 0.8, 0.1, 0.6, 0.1, 0.1, 0.1, 0.8, 0.3, 0.4, 0.9, 0.6, 0.3, 0.2}
  21. If(random5050(beispiel) ≟ 1, randomZahl211, randomZahl212) → randomZahl21
  22. Shuffle(Sequence[RandomElement[(1…10) \ {10}] / 10, i, 1, 55]) → randomZahl22, {0.3, 0.2, 0.7, 0.8, 0.5, 0.9, 0.1, 0.5, 0.1, 0.4, 0.2, 0.8, 0.1, 0.1, 0.4, 0.8, 0.2, 0.2, 0.3, 0.1, 0.2, 0.3, 0.5, 0.2, 0.3, 0.8, 0.6, 0.7, 0.4, 0.8, 0.9, 0.7, 0.9, 0.2, 0.8, 0.3, 0.6, 0.2, 0.1, 0.1, 0.2, 0.1, 0.9, 0.7, 0.1, 0.6, 0.4, 0.2, 0.7, 0.9, 0.8, 0.9, 0.9, 0.6, 0.7}
  23. Shuffle(Sequence[Random[1, 2], i, 1, 100]) → randomPosition2, {2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1}
  24. If(random5050(beispiel) ≟ 1, solution21, solution22) → solution2
  25. Sequence(If[randomZahl3Nenner(i) ≟ 2, Random[1, 2], randomZahl3Nenner(i) ≟ 3, Random[1, 3], randomZahl3Nenner(i) ≟ 4, Random[1, 4], randomZahl3Nenner(i) ≟ 5, Random[1, 5], randomZahl3Nenner(i) ≟ 6, Random[1, 6]], i, 1, 50) → randomZahl3Zähler1
  26. Sequence(If[randomZahl3Nenner(i) ≟ 2, Random[1, 2], randomZahl3Nenner(i) ≟ 3, Random[1, 3], randomZahl3Nenner(i) ≟ 4, Random[1, 4], randomZahl3Nenner(i) ≟ 5, Random[1, 5], randomZahl3Nenner(i) ≟ 6, Random[1, 6]], i, 1, 50) → randomZahl3Zähler2
  27. Flatten(Sequence[Shuffle[1…3], k, 1, 50]) → randomQuestionType
  28. If(questionType ≟ 1, solution1, questionType ≟ 2, solution2, solution3) → solution
  29. Split(Text[InputBox], {""}) → inputKeys
  30. CountIf(x ≟ " ", inputKeys) → NumOfLeer
  31. If(questionType ≟ 3, NumOfLeer ≤ 2, NumOfLeer ≟ 0) → correctKeys
  32. CountIf(x ≟ "+", inputKeys) → NumOfPlus
  33. CountIf(x ≟ "-", inputKeys) → NumOfMinus
  34. CountIf(x ≟ "/", inputKeys) → NumOfDurch
  35. CountIf(x ≟ "*", inputKeys) → NumOfMal