Progetto

Generale

Profilo

File » pattern_pde.pde

questo va caricato nello sketch principale - Carla Chicchiero, 16-05-2016 18:18

 
1

    
2
void init1(){
3
  // Initialization of cells     
4
  for (int x=7; x<25; x++) {
5
    cells[x][12] = 1; 
6
    cells[x][13] = 1; 
7
  }
8
  cells[9][11] = 1; 
9
  cells[9][14] = 1; 
10
  cells[14][11] = 1; 
11
  cells[15][11] = 1; 
12
  cells[14][10] = 1; 
13
  cells[13][10] = 1; 
14
  cells[13][9] = 1; 
15
  cells[13][8] = 1; 
16
  cells[13][7] = 1; 
17
  cells[12][9] = 1; 
18
  cells[12][8] = 1; 
19
  cells[12][7] = 1; 
20
  cells[14][6] = 1; 
21
  cells[14][14] = 1; 
22
  cells[15][14] = 1; 
23
  cells[13][15] = 1; 
24
  cells[14][15] = 1; 
25
  cells[12][16] = 1; 
26
  cells[13][16] = 1; 
27
  cells[12][17] = 1; 
28
  cells[13][17] = 1; 
29
  cells[12][18] = 1; 
30
  cells[13][18] = 1; 
31
  cells[14][19] = 1; 
32
  cells[17][11] = 1; 
33
  cells[17][10] = 1; 
34
  cells[17][9] = 1; 
35
  cells[17][8] = 1; 
36
  cells[17][7] = 1; 
37
  cells[17][14] = 1; 
38
  cells[17][15] = 1; 
39
  cells[17][16] = 1; 
40
  cells[17][17] = 1; 
41
  cells[17][18] = 1;   
42
  cells[16][10] = 1;  
43
  cells[16][9] = 1;  
44
  cells[16][8] = 1;  
45
  cells[16][15] = 1;  
46
  cells[16][16] = 1;  
47
  cells[16][17] = 1;  
48
  cells[18][8] = 1;  
49
  cells[18][17] = 1; 
50
  cells[20][11] = 1; 
51
  cells[21][11] = 1; 
52
  cells[22][11] = 1; 
53
  cells[23][11] = 1; 
54
  cells[20][14] = 1; 
55
  cells[21][14] = 1; 
56
  cells[22][14] = 1; 
57
  cells[23][14] = 1; 
58
}
59

    
60
void init2(){
61
  // Initialization of cells     
62
  for (int x=4; x<21; x++) {
63
    cells[15][x] = 1; 
64
    cells[16][x] = 1; 
65
    cells[18][x] = 1; 
66
    cells[19][x] = 1; 
67
  }
68
  for (int x=3; x<14; x++) {
69
    cells[x][17] = 1; 
70
  }
71
  for (int x=21; x<32; x++) {
72
    cells[x][17] = 1; 
73
  }
74
  cells[13][18] = 1; 
75
  cells[14][18] = 1; 
76
  cells[20][18] = 1; 
77
  cells[21][18] = 1; 
78
  cells[16][21] = 1; 
79
  cells[17][21] = 1; 
80
  cells[18][21] = 1; 
81
  cells[5][16] = 1; 
82
  cells[5][15] = 1; 
83
  cells[5][14] = 1; 
84
  cells[5][13] = 1; 
85
  cells[4][14] = 1; 
86
  cells[29][16] = 1; 
87
  cells[29][15] = 1; 
88
  cells[29][14] = 1; 
89
  cells[29][13] = 1; 
90
  cells[30][14] = 1;   
91
  for (int x=11; x<17; x++) {
92
    cells[6][x] = 1; 
93
    cells[28][x] = 1; 
94
  }
95
  cells[7][13] = 1;
96
  cells[7][12] = 1; 
97
  cells[7][11] = 1; 
98
  cells[27][13] = 1;
99
  cells[27][12] = 1; 
100
  cells[27][11] = 1; 
101
  cells[8][13] = 1; 
102
  cells[8][12] = 1; 
103
  cells[26][13] = 1; 
104
  cells[26][12] = 1; 
105
  cells[8][13] = 1; 
106
  
107
  cells[9][13] = 1; 
108
  cells[10][14] = 1; 
109
  cells[11][15] = 1; 
110
  cells[12][16] = 1; 
111
  cells[22][16] = 1; 
112
  cells[23][15] = 1; 
113
  cells[24][14] = 1; 
114
  cells[25][13] = 1; 
115
  
116
  cells[14][14] = 1; 
117
  cells[13][13] = 1; 
118
  cells[12][12] = 1; 
119
  cells[12][11] = 1; 
120
  
121
  for (int x=6; x<12; x++) {
122
    cells[11][x] = 1; 
123
    cells[23][x] = 1; 
124
  }
125
  for (int x=6; x<11; x++) {
126
    cells[10][x] = 1; 
127
    cells[24][x] = 1; 
128
  }
129
  for (int x=7; x<10; x++) {
130
    cells[12][x] = 1; 
131
    cells[22][x] = 1; 
132
  }
133
  cells[9][9] = 1; 
134
  cells[25][9] = 1; 
135
  cells[14][8] = 1; 
136
  cells[13][8] = 1; 
137
  cells[21][8] = 1; 
138
  cells[20][8] = 1; 
139
  cells[20][14] = 1;   
140
  cells[21][13] = 1; 
141
  cells[22][12] = 1; 
142
  cells[22][11] = 1; 
143
  
144
}
145

    
146
void init3(int t, int s){
147
  // Initialization of cells   
148
  cells[1+t][7+s] = 1;   
149
  cells[2+t][2+s] = 1; 
150
  cells[2+t][6+s] = 1; 
151
  cells[2+t][7+s] = 1; 
152
  cells[2+t][8+s] = 1; 
153
  cells[2+t][12+s] = 1;  
154
  
155
  cells[1+14+t][7+s] = 1;   
156
  cells[2+12+t][2+s] = 1; 
157
  cells[2+12+t][6+s] = 1; 
158
  cells[2+12+t][7+s] = 1; 
159
  cells[2+12+t][8+s] = 1; 
160
  cells[2+12+t][12+s] = 1;   
161
  
162
  cells[3+t][3+s] = 1;  
163
  cells[13+t][3+s] = 1;  
164
  for (int x=5; x<=9; x++) {
165
    cells[3+t][x+s] = 1; 
166
    cells[13+t][x+s] = 1; 
167
  }  
168
  cells[3+t][11+s] = 1;  
169
  cells[13+t][11+s] = 1;  
170
  for (int x=4; x<=10; x++) {
171
    cells[4+t][x+s] = 1; 
172
    cells[12+t][x+s] = 1; 
173
  }  
174
  for (int x=5; x<=9; x++) {
175
    cells[5+t][x+s] = 1; 
176
    cells[11+t][x+s] = 1; 
177
  }  
178
  cells[6+t][5+s] = 1;  
179
  cells[6+t][9+s] = 1; 
180
  cells[10+t][5+s] = 1;   
181
  cells[10+t][9+s] = 1;  
182
  
183
  for (int x=2; x<=5; x++) {
184
    cells[7+t][x+s] = 1; 
185
    cells[9+t][x+s] = 1; 
186
  }  
187
  for (int x=9; x<=12; x++) {
188
    cells[7+t][x+s] = 1; 
189
    cells[9+t][x+s] = 1; 
190
  }  
191
  for (int x=1; x<=4; x++) {
192
    cells[8+t][x+s] = 1; 
193
  }  
194
  for (int x=10; x<=14; x++) {
195
    cells[8+t][x+s] = 1; 
196
  }  
197
}
198

    
199
void init4(){
200
  // Initialization of cells   
201
  cells[3][13] = 1;     
202
  cells[3][15] = 1;     
203
  cells[2][12] = 1;    
204
  cells[2][16] = 1;   
205
  cells[3][11] = 1;   
206
  cells[3][17] = 1;   
207
  cells[5][13] = 1;  
208
  cells[5][15] = 1;  
209
  cells[5][10] = 1;  
210
  cells[5][9] = 1;   
211
  cells[5][18] = 1;  
212
  cells[5][19] = 1;   
213
  cells[6][9] = 1;     
214
  cells[6][11] = 1;  
215
  cells[6][19] = 1;  
216
  cells[6][17] = 1;   
217
  cells[7][9] = 1;   
218
  cells[7][12] = 1;   
219
  cells[7][16] = 1;   
220
  cells[7][19] = 1;   
221
  cells[8][13] = 1;   
222
  cells[8][15] = 1;  
223
  cells[9][9] = 1;    
224
  cells[9][10] = 1;    
225
  cells[9][18] = 1;    
226
  cells[9][19] = 1; 
227
  cells[10][9] = 1;   
228
  cells[10][11] = 1; 
229
  cells[10][17] = 1;   
230
  cells[10][19] = 1;     
231
  cells[11][9] = 1;      
232
  cells[11][12] = 1;    
233
  cells[11][16] = 1;     
234
  cells[11][19] = 1;     
235
  cells[12][13] = 1;     
236
  cells[12][15] = 1;           
237
  for (int x=13; x<=16; x++) {
238
    for (int y=12; y<=16; y++) {
239
      cells[x][y] = 1; 
240
    }
241
  }              
242
  cells[17][13] = 1; 
243
  cells[17][15] = 1;   
244
  cells[21][13] = 1;   
245
  cells[22][12] = 1;   
246
  for (int x=3; x<=20; x++) {
247
    cells[x][14] = 1; 
248
  }  
249
}
(2-2/3)