From the course: Processing: Interactive Data Visualization
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Creating arrays - Processing Tutorial
From the course: Processing: Interactive Data Visualization
Creating arrays
Up to this point, we've been working with what are called primitive variables like ints, floats and Booleans that only hold a single value at a time. You can make an array with any datatype. You can make it with primitives, you can make an array of int variables of Booleans of colors. You can even make arrays with more complex things like images or objects or strings that we haven't dealt with very much yet. However, every piece of data in the array must be of the same type. If you need data of different types, an object, which we'll talk about later, would probably be a better idea. In this particular one, I want to show you how to create arrays and then work with some other values. I'm going to start by putting a little comment here at the top, put the name of the sketch and then, I'm going to show you how to create an array. The first thing you need to do, I will call this one, Manually create an array. What I'm going to do here is, first like a variable, you have to declare the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.