~pvigo/+junk/processing-3.1.2

« back to all changes in this revision

Viewing changes to debian/processing/usr/share/processing-3.1.2/modes/java/examples/Basics/Control/Iteration/Iteration.pde

  • Committer: Pablo Vigo
  • Date: 2016-08-16 10:54:55 UTC
  • Revision ID: pvigo@xtec.cat-20160816105455-4y3x00r4w5anrpr4
2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Iteration. 
 
3
 * 
 
4
 * Iteration with a "for" structure to construct repetitive forms. 
 
5
 */
 
6
 
 
7
int y;
 
8
int num = 14;
 
9
 
 
10
size(640, 360);
 
11
background(102);
 
12
noStroke();
 
13
 
 
14
// White bars 
 
15
fill(255);
 
16
y = 60;
 
17
for(int i = 0; i < num/3; i++) {
 
18
  rect(50, y, 475, 10);
 
19
  y+=20;
 
20
}
 
21
 
 
22
// Gray bars
 
23
fill(51);
 
24
y = 40;
 
25
for(int i = 0; i < num; i++) {
 
26
  rect(405, y, 30, 10);
 
27
  y += 20;
 
28
}
 
29
y = 50;
 
30
for(int i = 0; i < num; i++) {
 
31
  rect(425, y, 30, 10);
 
32
  y += 20;
 
33
}
 
34
  
 
35
// Thin lines
 
36
y = 45;
 
37
fill(0);
 
38
for(int i = 0; i < num-1; i++) {
 
39
  rect(120, y, 40, 1);
 
40
  y+= 20;
 
41
}
 
 
b'\\ No newline at end of file'