Learn creative coding writing simple programs

19. Tweak the bar-code, create your first function

This time we continue with the bar-code example from last episode. We create our first custom function. Functions can make the code easier to read. They are also useful to avoid repeating code: when the same group of lines is used multiple times in a program, it's a good idea to convert that group of lines into a function.
We also play a little bit with the numbers to see how they affect the image.


Code editor

You can make changes to the code below. Then
Questions and comments are welcome! :) But please try to stay close to the topic of this episode. Use the Processing forums for help with your Processing projects (or hire me for help ;-)