Inspired by the story Anno's Magic Seeds by Mitsumasa Anno.
A quick first draft, by George Gadanidis & Chris Yiu.
In the story Anno's Magic Seeds, Jack has 2 magic seeds. Each seed will sustain him for 1 year. Each seed planted also produces 2 new seeds in one year.
In Year 1, Jack eats 1 seed and plants the other, to get 2 new seeds. In Year 2, Jack eats 1 seed and plants the other, to get 2 new seeds. He continues like this for a number of years.
Click on Example #1, and then on Run Code, to model this pattern.
What would happen if Jack finds something else to eat, and does not eat any of the seeds?
Would he have 10 seeds more at the end of the 10 years?
How could you edit the code to model this pattern?
SAVE & SHARE
Click on Save Code and name your project. The URL that appears under the Project Name can be shared.
In the story, eventually Jack decides to plant both seeds, and eat something else that year. The 2 seeds grow into 4 seeds. Next year, he eats 1 seed, and plants 3, to get 6 seeds. He then eats 1 seed and plants 5. How will his number of seeds grow if he continues in this way?
Click on Example #2, and then on Run Code, to model this pattern.
Jack has a partner named Alice. Suppose they start with 2 seeds. How should Jack and Alice plan what they eat and plant?
Edit the code to model their plan.
Enter the code below. Click on Run Program. Study the code and the output. How does this code and output compare with that of Example #2?
On laptop: If code window does not appear at right of canvas, use Control or Command key and minus (-) to reduce screen resolution. On tablet or phone: Scroll to access code window below canvas.