Constraints

A restriction placed on the parameters upon which a subroutine or program works or in a loop to define the scope of the problem.


The example above uses a constraint for inputted values in a program that creates the line from a given slope and y-intercept. Having students create and alter code of this nature corresponds with Mathematics Grade 9 C2.1, 2.2, 2.3, C3, C4.


Try it now!

To practice with constraints, access our Scratch Playground here ⤵️