04.04.2013 Views

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

Processing: Creative Coding and Computational Art

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

void setBeanType(String beanType){<br />

this.beanType = beanType;<br />

}<br />

String[] getToppings(){<br />

return this.toppings;<br />

}<br />

void setToppings(String[] toppings){<br />

this.toppings = toppings;<br />

}<br />

int getSalsa(int salsaTemperature){<br />

return this.salsaTemperature;<br />

}<br />

void setSalsa(int salsaTemperature){<br />

this.salsaTemperature = salsaTemperature;<br />

}<br />

OBJECT-ORIENTED PROGRAMMING<br />

void printRecipe(){<br />

println("Burrito Recipe:");<br />

println("---------------");<br />

if (this.tortillaFlavor!=null){<br />

println("Steam or lightly pan heat a " + this.tortillaFlavor + ➥<br />

" tortilla.");<br />

if (this.beanType!=null){<br />

println("Sauté fresh onions, garlic, cilantro, slowly ➥<br />

mixing in " + this.beanType + " beans <strong>and</strong> white wine.");<br />

}<br />

if (this.meatType!=null){<br />

println("Grill " + this.meatType + " along with fresh green ➥<br />

pepper, jalapeno pepper, chile pepper, ➥<br />

onions <strong>and</strong> garlic.");<br />

}<br />

if (this.toppings!=null){<br />

for (int i =0; i< toppings.length; i++){<br />

println("Add " + toppings[i]+".");<br />

}<br />

}<br />

if (this.salsaTemperature>0){<br />

println("Finish off with a generous spritz of "+ ➥<br />

this.salsaTemperature+" alarm salsa.");<br />

}<br />

}<br />

else {<br />

println("Uh, you'll need to give me some ingredients\n" + ➥<br />

"if you actually want me to produce a recipe.");<br />

}<br />

307<br />

8

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!