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.

Modifying variables

Modifying variables - Processing Tutorial

From the course: Processing: Interactive Data Visualization

Start my 1-month free trial

Modifying variables

In this movie, I want to talk about how you can work with variables specifically, modify their values over time, which of course is the flexibility that variables give you. What I want to demonstrate is how you can assign values several times to the same variable where the latest one trumps the previous one. And also, how you can change a variable from one type to another, and you can also create code to systematically change variables, as well as constrain some of their flexibility to keep them within a particular range. So what I'm going to do is I'm going to start by titling this sketch and then, I'm going to declare a few variables that we saw in the last video. So I have an integer variable called x, I'm giving it an initial value of 10. We have a floating-point variable, a float variable called y, I'm giving it an initial value of 50 and then, we also have a float variable z. I'm simply declaring it without initializing it. Next I'm going to create a drawing with two blocks of…

Contents