Teaching Module 06-control-flow is densily packaged with content. To open the material to more novice programmers, I suggest to split it.
06-conditionals: which only contains if clauses and perhaps the subtyping exercise
07-loops: which only contains the content on loops
With this separation, one could also introduce loops in a more simple minded fashion. For example, if your goal is to optimize the parameters of the trebuchet, maybe storing the params and the distances first in a Vector/Tuple/Dict might make sense. This way, for loops could be introduced in a more shallow fashion a la
I want to make 12 experiments, so let's create a vector with zeros(12) first for the achieved distances
let's loop over the vector and create 12 pairs of shots of the trebuchet
let's check the results by printing the vector
but that is all very clumsy, let's do forward differentiation and conduct an optimisation
Teaching Module 06-control-flow is densily packaged with content. To open the material to more novice programmers, I suggest to split it.
With this separation, one could also introduce loops in a more simple minded fashion. For example, if your goal is to optimize the parameters of the trebuchet, maybe storing the params and the distances first in a Vector/Tuple/Dict might make sense. This way, for loops could be introduced in a more shallow fashion a la
zeros(12)
first for the achieved distances