Workflow: Chapter 8/Exercise 1
In this exercise, we implement a CASE Switch block within a loop.
We first generate numbers from 1 to 10 with the Table Creator node. We then process the numbers, however, we want process the numbers differently: Multiply even numbers by 3 (top branch) and odd numbers by 10 (bottom branch).
To identify whether a number is even or odd we implement a modulo operation using the Expression node. We then process the data row by row using a Table Row to Variable Loop Start node. To process the even and odd numbers accordingly, we implement a CASE Switch block inside the loop, activating either the top port if the number is even, or the bottom port if the number is odd. The Loop End node collects the results of each iteration.