Ideas for Exercise Based on the 'Crane-Turtle Problem'

I posted about the traditional Japanese arithmetic problem ‘Crane-Turtle-Problem’ on the Discord ‘exercism-idea’ recently. I’m grateful for the insightful responses I received.

I’m still at the Easy track for Java and the Learning Exercise track for Python, and I don’t have the skills to create an exercise yet. However, inspired by the excellent hints I received, I’ve been thinking about what kind of exercises I could create. Feedback would be appreciated.

  1. Practice with conditional statements and loops:
    Implement an algorithm to determine the numbers of cranes and turtles using conditional statements and loops.

  2. Mathematical thinking and logic:
    Analyze the problem using mathematical principles and logical reasoning to identify mathematical relationships.

  3. Recursion:
    For example, consider solving the problem recursively by decrementing a given number while treating it as the total count.

  4. Object-oriented programming:
    Create classes to represent cranes and turtles, define methods for each class, and solve the problem by creating a class that calculates the number of heads and legs for cranes and turtles.

I understand that Goals of the Exercise and Concepts Involved are necessary for exercises. Also, since I’ve only touched on a small part of all the tracks, I need to consider potential overlaps with other exercises. I apologize for taking up your time, but I would appreciate any advice on revisions or directions for my ideas.

Some possible variations, using

  • A viper has a head and no legs
  • A crane has one head and two legs
  • A turtle has one head and four legs
  • A beetle has one head and six legs

Variation One
Given only the number of heads and legs, list all the possible solutions.

Variation Two
Given any two kinds of animals, and the number of heads and legs, return the required number of animals of each kind.

I can imagine a Pharo port of Variation Two using metaobjects.

What about a variation feature centipede and millipede :eyes: ?