Visualiser

Code:

Code (visualised):

Output: