Guess the Sort: Interactive Number Classification Game

Guess the Sort: Interactive Number Classification Game
Loading the math board and drawing, please wait…
2017-08-09 00:14
This is an interactive math game demonstrating how to identify sorting rules for number sets through guessing and feedback. Core mathematical concepts include number classification (prime, composite, odd, even), interval partitioning, set operations, and conditional logic. Construction highlights: uses GeoGebra commands such as RandomElement and Random to generate random number lists, KeepIf, Remove, and Flatten to filter and organize data, Textfield and InputBox1 to create user input interfaces, If, Intersection, and RemoveUndefined to check whether user guesses match preset rules, and TableText to display results. Suitable for middle school math classes or self-study, this example trains students' observation and reasoning skills about number properties while experiencing programming-style mathematical modeling.

GeoGebra Commands & Parameters

  1. RandomElement({10, 100}) → roundsType
  2. Random(0, 10) → roundsNumber
  3. KeepIf((round(a / roundsType) * roundsType) ≟ (roundsNumber * roundsType), a, guesses) → roundsList
  4. KeepIf(floor(a / 12) ≟ a / 12, a, guesses) → twelveList
  5. KeepIf(floor(a / 11) ≟ a / 11, a, guesses) → elevenList
  6. KeepIf(floor(a / 10) ≟ a / 10, a, guesses) → tenList
  7. KeepIf(floor(a / 9) ≟ a / 9, a, guesses) → nineList
  8. KeepIf(floor(a / 8) ≟ a / 8, a, guesses) → eightList
  9. KeepIf(floor(a / 7) ≟ a / 7, a, guesses) → sevenList
  10. KeepIf(floor(a / 6) ≟ a / 6, a, guesses) → sixList
  11. KeepIf(floor(a / 5) ≟ a / 5, a, guesses) → fiveList
  12. KeepIf(floor(a / 4) ≟ a / 4, a, guesses) → fourList
  13. KeepIf(floor(a / 3) ≟ a / 3, a, guesses) → threeList
  14. Random(5, 100) → aboveBelowNumber
  15. KeepIf(a < aboveBelowNumber, a, guesses) → belowList
  16. KeepIf(a > aboveBelowNumber, a, guesses) → aboveList
  17. KeepIf(IsPrime[q], q, guesses) → primeList
  18. Remove(guesses, Join[{primeList, {1, 0}}]) → compositeList
  19. KeepIf(floor(x / 2 + 1 / 2) ≟ x / 2 + 1 / 2, guesses) → oddList
  20. KeepIf(floor(x / 2) ≟ x / 2, guesses) → evenList
  21. Flatten({"rounds", RandomElement[{"even", "odd"}], RandomElement[{"prime", "composite"}], First[Shuffle[{"3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}], 4], RandomElement[{"above", "below"}]}) → rules
  22. RandomElement(rules) → rule1
  23. RandomElement(Remove[rules, {rule1}]) → rule2
  24. Textfield(guessText) → InputBox1
  25. If(guess < 0, true, If[IsInteger[guess], false, true]) → warning
  26. If(rule2 ≟ "prime", primeList, If[rule2 ≟ "composite", compositeList, If[rule2 ≟ "even", evenList, If[rule2 ≟ "odd", oddList, If[rule2 ≟ "even", evenList, If[rule2 ≟ "3", threeList, If[rule2 ≟ "4", fourList, If[rule2 ≟ "5", fiveList, If[rule2 ≟ "6", sixList, If[rule2 ≟ "7", sevenList, If[rule2 ≟ "8", eightList, If[rule2 ≟ "9", nineList, If[rule2 ≟ "10", tenList, If[rule2 ≟ "11", elevenList, If[rule2 ≟ "12", twelveList, If[rule2 ≟ "above", aboveList, If[rule2 ≟ "below", belowList, If[rule2 ≟ "rounds", roundsList, {}]]]]]]]]]]]]]]]]]) → rule2HelperList
  27. If(rule1 ≟ "prime", primeList, If[rule1 ≟ "composite", compositeList, If[rule1 ≟ "even", evenList, If[rule1 ≟ "odd", oddList, If[rule1 ≟ "even", evenList, If[rule1 ≟ "3", threeList, If[rule1 ≟ "4", fourList, If[rule1 ≟ "5", fiveList, If[rule1 ≟ "6", sixList, If[rule1 ≟ "7", sevenList, If[rule1 ≟ "8", eightList, If[rule1 ≟ "9", nineList, If[rule1 ≟ "10", tenList, If[rule1 ≟ "11", elevenList, If[rule1 ≟ "12", twelveList, If[rule1 ≟ "above", aboveList, If[rule1 ≟ "below", belowList, If[rule1 ≟ "rounds", roundsList, {}]]]]]]]]]]]]]]]]]) → rule1HelperList
  28. Intersection(rule1HelperList, rule2HelperList) → intersectionList
  29. Remove(rule1HelperList, intersectionList) → rule1List
  30. Remove(rule2HelperList, intersectionList) → rule2List
  31. Remove(guesses, Join[{rule1List, rule2List, intersectionList}]) → excludedList
  32. RemoveUndefined(Sequence[RemoveUndefined[Sequence[Element[rule1List, i], i, 1 + (4 * j), 4 + (4 * j)]], j, 0, ceil(Length[rule1List / 4])]) → r1List
  33. TableText(r1List) → text8
  34. RemoveUndefined(Sequence[RemoveUndefined[Sequence[Element[rule2List, i], i, 1 + (4 * j), 4 + (4 * j)]], j, 0, ceil(Length[rule2List / 4])]) → r2List
  35. RemoveUndefined(Sequence[RemoveUndefined[Sequence[Element[excludedList, i], i, 1 + (4 * j), 4 + (4 * j)]], j, 0, ceil(Length[excludedList / 4])]) → EL
  36. RemoveUndefined(Sequence[RemoveUndefined[Sequence[Element[intersectionList, i], i, 1 + (4 * j), 4 + (4 * j)]], j, 0, ceil(Length[intersectionList / 4])]) → IL
  37. TableText(r2List) → text5
  38. TableText(IL) → text6
  39. TableText(EL) → text7

AI Drawing Prompt Reference

Create an interactive number classification game where the user needs to guess numbers based on given rules. First, randomly generate a number between 10 and 100, then create lists of numbers that meet specific criteria such as even, odd, prime, composite, etc. The user inputs a guess, and the system filters the lists according to the rules, showing numbers that match the criteria and providing feedback. Finally, display all the lists of numbers that match the criteria, including even, odd, prime, composite, etc.
The prompt above was compiled from the original drawing commands and is for reference only.