Questions

Intro :

If our code is interactive or generative there may be times where questions are programmed in the form of if statements.

It's easy to forget to ask questions from the perspective of a computer rather than a human. For example, a computer cannot interpret any other scenerio than the specific question programmed.

This example will run without a compiler error. However, it will result in a Functional Error that has different interactive outcomes.

---------------------------------------------------------------------------->

Open ended questions :

Move your mouse diagonally downward to the right across the canvas to see the different outcomes.

Consider why the left-hand graphic only changes colour once whereas the right-hand graphic continues to flip between orange and black colours.

---------------------------------------------------------------------------->

Try it :

Try edit the code to turn the one-time interaction into a continuous interation.

Consider what line of code might be creating the behavioural difference. What extra information may the computer require in order to fully understand the question being asked of it?

Once you start typing code you can press the 'undo' button to go back a step. Or press the 'revert' button if you want to refresh to the orginal code.

---------------------------------------------------------------------------->
---------------------------------------------------------------------------->

J3n Sykes

GitHub | Back to examples