Skip to content

Commit 4dd95fd

Browse files
committed
adding breadcrumbs to tutorials
1 parent 38b269e commit 4dd95fd

File tree

18 files changed

+84
-37
lines changed

18 files changed

+84
-37
lines changed

content/tutorials/text/2darray/index.mdx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
slug: '/tutorials/2darray'
3-
title: 'Two-Dimensional Arrays'
4-
author: 'Daniel Shiffman'
5-
intro: 'Store and acess data in a matrix using a two-dimensional array.'
6-
level: 'Intermediate'
2+
slug: "/tutorials/2darray"
3+
title: "Two-Dimensional Arrays"
4+
author: "Daniel Shiffman"
5+
intro: "Store and acess data in a matrix using a two-dimensional array."
6+
level: "Intermediate"
77
coverImage: 2darray.jpg
88
---
99

1010
<Note>
1111

12-
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

16-
An [array](http://www.processing.org/reference/Array.html) keeps track of multiple pieces of information in linear order, a one-dimensional list. However, the data associated with certain systems (a digital image, a board game, etc.) lives in two dimensions. To visualize this data, we need a multi-dimensional data structure, that is, a multi-dimensional array. A two-dimensional array is really nothing more than an array of arrays (a three-dimensional array is an array of arrays of arrays). Think of your dinner. You could have a one-dimensional list of everything you eat:
16+
An [array](http://www.processing.org/reference/Array.html) keeps track of multiple pieces of information in linear order, a one-dimensional list. However, the data associated with certain systems (a digital image, a board game, etc.) lives in two dimensions. To visualize this data, we need a multi-dimensional data structure, that is, a multi-dimensional array. A two-dimensional array is really nothing more than an array of arrays (a three-dimensional array is an array of arrays of arrays). Think of your dinner. You could have a one-dimensional list of everything you eat:
1717

1818
`(lettuce, tomatoes, steak, mashed potatoes, cake, ice cream)`
1919

@@ -22,6 +22,7 @@ Or you could have a two-dimensional list of three courses, each containing two t
2222
`(lettuce, tomatoes) and (steak, mashed potatoes) and (cake, ice cream)`
2323

2424
In the case of an array, our old-fashioned one-dimensional array looks like this:
25+
2526
```
2627
int[] myArray = {0,1,2,3};
2728
```
@@ -56,7 +57,7 @@ int[][] myArray = { {236, 189, 189, 0},
5657
{236, 189, 189, 80} };
5758
```
5859

59-
To walk through every element of a one-dimensional array, we use a for loop, that is:
60+
To walk through every element of a one-dimensional array, we use a for loop, that is:
6061

6162
```
6263
int[] myArray = new int[10];
@@ -72,7 +73,7 @@ int cols = 10;
7273
int rows = 10;
7374
int[][] myArray = new int[cols][rows];
7475
75-
// Two nested loops allow us to visit every spot in a 2D array.
76+
// Two nested loops allow us to visit every spot in a 2D array.
7677
// For every column I, visit every row J.
7778
for (int i = 0; i < cols; i++) {
7879
for (int j = 0; j < rows; j++) {
@@ -113,7 +114,7 @@ for (int i = 0; i < cols; i++) {
113114
}
114115
```
115116

116-
A two-dimensional array can also be used to store objects, which is especially convenient for programming sketches that involve some sort of "grid" or "board." The following example displays a grid of Cell objects stored in a two-dimensional array. Each cell is a rectangle whose brightness oscillates from 0-255 with a sine function.
117+
A two-dimensional array can also be used to store objects, which is especially convenient for programming sketches that involve some sort of "grid" or "board." The following example displays a grid of Cell objects stored in a two-dimensional array. Each cell is a rectangle whose brightness oscillates from 0-255 with a sine function.
117118

118119
<FixedImage side width={200} >
119120

@@ -142,8 +143,8 @@ void setup() {
142143
143144
void draw() {
144145
background(0);
145-
// The counter variables i and j are also the column and row numbers and
146-
// are used as arguments to the constructor for each object in the grid.
146+
// The counter variables i and j are also the column and row numbers and
147+
// are used as arguments to the constructor for each object in the grid.
147148
for (int i = 0; i < cols; i++) {
148149
for (int j = 0; j < rows; j++) {
149150
// Oscillate and display each object
@@ -155,7 +156,7 @@ void draw() {
155156
156157
// A Cell object
157158
class Cell {
158-
// A cell object knows about its location in the grid
159+
// A cell object knows about its location in the grid
159160
// as well as its size with the variables x,y,w,h
160161
float x,y; // x,y location
161162
float w,h; // width and height
@@ -168,21 +169,18 @@ class Cell {
168169
w = tempW;
169170
h = tempH;
170171
angle = tempAngle;
171-
}
172-
172+
}
173+
173174
// Oscillation means increase angle
174175
void oscillate() {
175-
angle += 0.02;
176+
angle += 0.02;
176177
}
177178
178179
void display() {
179180
stroke(255);
180181
// Color calculated using sine wave
181182
fill(127+127*sin(angle));
182-
rect(x,y,w,h);
183+
rect(x,y,w,h);
183184
}
184185
}
185186
```
186-
187-
188-

content/tutorials/text/color/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: color.jpg
99

1010
<Note>
1111

12-
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/data/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: data.jpg
99

1010
<Note>
1111

12-
This tutorial is from the book [Learning Processing, 2nd Edition](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2015 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is from the book [Learning Processing, 2nd Edition](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2015 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/electronics/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: electronics.jpg
99

1010
<Note>
1111

12-
This tutorial is &ldquo;Extension 5&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is &ldquo;Extension 5&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/network/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: network.jpg
99

1010
<Note>
1111

12-
This tutorial is &ldquo;Extension 2&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is &ldquo;Extension 2&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/objects/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: objects.jpg
99

1010
<Note>
1111

12-
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/pixels/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: pixels.jpg
99

1010
<Note>
1111

12-
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is from the book [Learning Processing](https://processing.org/books/#shiffman) by Daniel Shiffman, published by Morgan Kaufmann, © 2008 Elsevier Inc. All rights reserved. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/print/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: print.jpg
99

1010
<Note>
1111

12-
This tutorial is &ldquo;Extension 4&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is &ldquo;Extension 4&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

content/tutorials/text/pshape/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: pshape.jpg
99

1010
<Note>
1111

12-
If you see any errors in this tutorial or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen). This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).
12+
If you see any errors in this tutorial or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen). This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-nc-sa/4.0/).
1313

1414
</Note>
1515

content/tutorials/text/sound/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ coverImage: sound.png
99

1010
<Note>
1111

12-
This tutorial is &ldquo;Extension 3&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-docs/issues?q=is%3Aopen).
12+
This tutorial is &ldquo;Extension 3&rdquo; from [Processing: A Programming Handbook for Visual Designers and Artists, Second Edition](../../handbook), published by MIT Press. &copy; 2014 MIT Press. If you see any errors or have comments, [please let us know](https://github.com/processing/processing-website/issues?q=is%3Aopen).
1313

1414
</Note>
1515

0 commit comments

Comments
 (0)