diff --git a/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde b/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde deleted file mode 100644 index 82539334c..000000000 --- a/java/examples/Books/Getting Started/Chapter02/Ex_02_01/Ex_02_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Example 02-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -ellipse(50, 50, 80, 80); diff --git a/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde b/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde deleted file mode 100644 index 0455e4836..000000000 --- a/java/examples/Books/Getting Started/Chapter02/Ex_02_02/Ex_02_02.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 02-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - if (mousePressed) { - fill(0); - } else { - fill(255); - } - ellipse(mouseX, mouseY, 80, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde deleted file mode 100644 index 2220a08fb..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_01/Ex_03_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Example 03-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(800, 600); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde deleted file mode 100644 index abd536f2c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_02/Ex_03_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -point(240, 60); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde deleted file mode 100644 index ba7ab8280..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_03/Ex_03_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -line(20, 50, 420, 110); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde deleted file mode 100644 index eb117b98c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_04/Ex_03_04.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 03-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -quad(158, 55, 199, 14, 392, 66, 351, 107); -triangle(347, 54, 392, 9, 392, 66); -triangle(158, 55, 290, 91, 290, 112); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde deleted file mode 100644 index 9e297af1e..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_05/Ex_03_05.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Example 03-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -rect(180, 60, 220, 40); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde deleted file mode 100644 index d4016401c..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_06/Ex_03_06.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 03-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -ellipse(278, -100, 400, 400); -ellipse(120, 100, 110, 110); -ellipse(412, 60, 18, 18); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde deleted file mode 100644 index a0dc019a7..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_07/Ex_03_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -arc(90, 60, 80, 80, 0, HALF_PI); -arc(190, 60, 80, 80, 0, PI+HALF_PI); -arc(290, 60, 80, 80, PI, TWO_PI+HALF_PI); -arc(390, 60, 80, 80, QUARTER_PI, PI+QUARTER_PI); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde deleted file mode 100644 index 75b5f4f73..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_08/Ex_03_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -arc(90, 60, 80, 80, 0, radians(90)); -arc(190, 60, 80, 80, 0, radians(270)); -arc(290, 60, 80, 80, radians(180), radians(450)); -arc(390, 60, 80, 80, radians(45), radians(225)); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde deleted file mode 100644 index 525f1da67..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_09/Ex_03_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -ellipse(140, 0, 190, 190); -// The rectangle draws on top of the ellipse -// because it comes after in the code -rect(160, 30, 260, 20); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde deleted file mode 100644 index b765d8fb9..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_10/Ex_03_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -rect(160, 30, 260, 20); -// The ellipse draws on top of the rectangle -// because it comes after in the code -ellipse(140, 0, 190, 190); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde deleted file mode 100644 index d40ff08cb..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_11/Ex_03_11.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 03-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); // Turns on smoothing -ellipse(140, 60, 90, 90); -noSmooth(); // Turns off smoothing -ellipse(240, 60, 90, 90); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde deleted file mode 100644 index fdd8e9a4f..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_12/Ex_03_12.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 03-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -ellipse(75, 60, 90, 90); -strokeWeight(8); // Stroke weight to 8 pixels -ellipse(175, 60, 90, 90); -ellipse(279, 60, 90, 90); -strokeWeight(20); // Stroke weight to 20 pixels -ellipse(389, 60, 90, 90); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde deleted file mode 100644 index e47332559..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_13/Ex_03_13.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 03-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(12); -strokeJoin(ROUND); // Round the stroke corners -rect(40, 25, 70, 70); -strokeJoin(BEVEL); // Bevel the stroke corners -rect(140, 25, 70, 70); -strokeCap(SQUARE); // Square the line endings -line(270, 25, 340, 95); -strokeCap(ROUND); // Round the line endings -line(350, 25, 420, 95); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde deleted file mode 100644 index 31f7d5f93..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_14/Ex_03_14.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 03-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -background(0); // Black -fill(204); // Light gray -ellipse(132, 82, 200, 200); // Light gray circle -fill(153); // Medium gray -ellipse(228, -16, 200, 200); // Medium gray circle -fill(102); // Dark gray -ellipse(268, 118, 200, 200); // Dark gray circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde deleted file mode 100644 index 83b5d3c44..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_15/Ex_03_15.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 03-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -fill(153); // Medium gray -ellipse(132, 82, 200, 200); // Gray circle -noFill(); // Turn off fill -ellipse(228, -16, 200, 200); // Outline circle -noStroke(); // Turn off stroke -ellipse(268, 118, 200, 200); // Doesn’t draw! diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde deleted file mode 100644 index 833ce14a1..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_16/Ex_03_16.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -noStroke(); -smooth(); -background(0, 26, 51); // Dark blue color -fill(255, 0, 0); // Red color -ellipse(132, 82, 200, 200); // Red circle -fill(0, 255, 0); // Green color -ellipse(228, -16, 200, 200); // Green circle -fill(0, 0, 255); // Blue color -ellipse(268, 118, 200, 200); // Blue circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde deleted file mode 100644 index d7bbbd22d..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_17/Ex_03_17.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -noStroke(); -smooth(); -background(204, 226, 225); // Light blue color -fill(255, 0, 0, 160); // Red color -ellipse(132, 82, 200, 200); // Red circle -fill(0, 255, 0, 160); // Green color -ellipse(228, -16, 200, 200); // Green circle -fill(0, 0, 255, 160); // Blue color -ellipse(268, 118, 200, 200); // Blue circle diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde deleted file mode 100644 index c19099ee0..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_18/Ex_03_18.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -beginShape(); -vertex(180, 82); -vertex(207, 36); -vertex(214, 63); -vertex(407, 11); -vertex(412, 30); -vertex(219, 82); -vertex(226, 109); -endShape(); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde deleted file mode 100644 index 0e1e8d785..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_19/Ex_03_19.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 03-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -beginShape(); -vertex(180, 82); -vertex(207, 36); -vertex(214, 63); -vertex(407, 11); -vertex(412, 30); -vertex(219, 82); -vertex(226, 109); -endShape(CLOSE); diff --git a/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde b/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde deleted file mode 100644 index 76b283bfa..000000000 --- a/java/examples/Books/Getting Started/Chapter03/Ex_03_20/Ex_03_20.pde +++ /dev/null @@ -1,38 +0,0 @@ -// Example 03-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); - -// Left creature -beginShape(); -vertex(50, 120); -vertex(100, 90); -vertex(110, 60); -vertex(80, 20); -vertex(210, 60); -vertex(160, 80); -vertex(200, 90); -vertex(140, 100); -vertex(130, 120); -endShape(); -fill(0); -ellipse(155, 60, 8, 8); - -// Right creature -fill(255); -beginShape(); -vertex(370, 120); -vertex(360, 90); -vertex(290, 80); -vertex(340, 70); -vertex(280, 50); -vertex(420, 10); -vertex(390, 50); -vertex(410, 90); -vertex(460, 120); -endShape(); -fill(0); -ellipse(345, 50, 10, 10); - - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde deleted file mode 100644 index 22ab9a5e3..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_01/Ex_04_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -int y = 60; -int d = 80; -ellipse(75, y, d, d); // Left -ellipse(175, y, d, d); // Middle -ellipse(275, y, d, d); // Right diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde deleted file mode 100644 index 01d3cb29a..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_02/Ex_04_02.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -int y = 100; -int d = 130; -ellipse(75, y, d, d); // Left -ellipse(175, y, d, d); // Middle -ellipse(275, y, d, d); // Right diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde deleted file mode 100644 index b7cdec584..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_03/Ex_04_03.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 04-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -line(0, 0, width, height); // Line from (0,0) to (480, 120) -line(width, 0, 0, height); // Line from (480, 0) to (0, 120) -ellipse(width/2, height/2, 60, 60); diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde deleted file mode 100644 index 294092ded..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_04/Ex_04_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 04-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -int x = 25; -int h = 20; -int y = 25; -rect(x, y, 300, h); // Top -x = x + 100; -rect(x, y + h, 300, h); // Middle -x = x - 250; -rect(x, y + h*2, 300, h); // Bottom diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde deleted file mode 100644 index beddf453e..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_05/Ex_04_05.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 04-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(8); -line(20, 40, 80, 80); -line(80, 40, 140, 80); -line(140, 40, 200, 80); -line(200, 40, 260, 80); -line(260, 40, 320, 80); -line(320, 40, 380, 80); -line(380, 40, 440, 80); diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde deleted file mode 100644 index b7f5fa3f4..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_06/Ex_04_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(8); -for (int i = 20; i < 400; i += 60) { - line(i, 40, i + 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde deleted file mode 100644 index 6c641d898..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_07/Ex_04_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 8) { - line(i, 40, i + 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde deleted file mode 100644 index 68092ced5..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_08/Ex_04_08.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Example 04-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 20) { - line(i, 0, i + i/2, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde deleted file mode 100644 index 67493fd0d..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_09/Ex_04_09.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 04-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -smooth(); -strokeWeight(2); -for (int i = 20; i < 400; i += 20) { - line(i, 0, i + i/2, 80); - line(i + i/2, 80, i*1.2, 120); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde deleted file mode 100644 index 2b6f7cb4f..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_10/Ex_04_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 04-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -noStroke(); -for (int y = 0; y <= height; y += 40) { - for (int x = 0; x <= width; x += 40) { - fill(255, 140); - ellipse(x, y, 40, 40); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde deleted file mode 100644 index 18bf46050..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_11/Ex_04_11.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 04-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -noStroke(); -for (int y = 0; y < height+45; y += 40) { - fill(255, 140); - ellipse(0, y, 40, 40); -} -for (int x = 0; x < width+45; x += 40) { - fill(255, 140); - ellipse(x, 0, 40, 40); -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde deleted file mode 100644 index 565af4f4b..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_12/Ex_04_12.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 04-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -fill(255); -stroke(102); -for (int y = 20; y <= height-20; y += 10) { - for (int x = 20; x <= width-20; x += 10) { - ellipse(x, y, 4, 4); - // Draw a line to the center of the display - line(x, y, 240, 60); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde b/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde deleted file mode 100644 index a57dd0f97..000000000 --- a/java/examples/Books/Getting Started/Chapter04/Ex_04_13/Ex_04_13.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 04-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(480, 120); -background(0); -smooth(); -for (int y = 32; y <= height; y += 8) { - for (int x = 12; x <= width; x += 15) { - ellipse(x + y, y, 16 - y/10.0, 16 - y/10.0); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde deleted file mode 100644 index f1359dd0e..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_01/Ex_05_01.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Example 05-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - // Displays the frame count to the Console - println("I’m drawing"); - println(frameCount); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde deleted file mode 100644 index 4dd7dafbb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_02/Ex_05_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 05-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("I’m starting"); -} - -void draw() { - println("I’m running"); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde deleted file mode 100644 index 6151ad601..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_03/Ex_05_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 280; -int y = -100; -int diameter = 380; - -void setup() { - size(480, 120); - smooth(); - fill(102); -} - -void draw() { - background(204); - ellipse(x, y, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde deleted file mode 100644 index f5752a2e0..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_04/Ex_05_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - fill(0, 102); - smooth(); - noStroke(); -} - -void draw() { - ellipse(mouseX, mouseY, 9, 9); -} - - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde deleted file mode 100644 index fcd3daa4a..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_05/Ex_05_05.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - fill(0, 102); - smooth(); - noStroke(); -} - -void draw() { - background(204); - ellipse(mouseX, mouseY, 9, 9); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde deleted file mode 100644 index 3346117bd..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_06/Ex_05_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 05-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - strokeWeight(4); - smooth(); - stroke(0, 102); -} - -void draw() { - line(mouseX, mouseY, pmouseX, pmouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde deleted file mode 100644 index 5f0415957..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_07/Ex_05_07.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 05-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); - stroke(0, 102); -} - -void draw() { - float weight = dist(mouseX, mouseY, pmouseX, pmouseY); - strokeWeight(weight); - line(mouseX, mouseY, pmouseX, pmouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde deleted file mode 100644 index d32f682bb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_08/Ex_05_08.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -float easing = 0.01; - -void setup() { - size(220, 120); - smooth(); -} - -void draw() { - float targetX = mouseX; - x += (targetX - x) * easing; - ellipse(x, 40, 12, 12); - println(targetX + " : " + x); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde deleted file mode 100644 index 0bca76b71..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_09/Ex_05_09.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 05-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -float y; -float px; -float py; -float easing = 0.05; - -void setup() { - size(480, 120); - smooth(); - stroke(0, 102); -} - -void draw() { - float targetX = mouseX; - x += (targetX - x) * easing; - float targetY = mouseY; - y += (targetY - y) * easing; - float weight = dist(x, y, px, py); - strokeWeight(weight); - line(x, y, px, py); - py = y; - px = x; -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde deleted file mode 100644 index be0cf8ced..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_10/Ex_05_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - strokeWeight(12); - smooth(); -} - -void draw() { - background(204); - stroke(255); - line(120, 60, mouseX, mouseY); // White line - stroke(0); - float mx = mouseX/2 + 60; - line(120, 60, mx, mouseY); // Black line -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde deleted file mode 100644 index 0fb127237..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_11/Ex_05_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 05-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - strokeWeight(12); - smooth(); -} - -void draw() { - background(204); - stroke(255); - line(120, 60, mouseX, mouseY); // White line - stroke(0); - float mx = map(mouseX, 0, width, 60, 180); - line(120, 60, mx, mouseY); // Black line -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde deleted file mode 100644 index b69e2f422..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_12/Ex_05_12.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 05-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed == true) { - stroke(0); - } - line(0, 70, width, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde deleted file mode 100644 index a5f4cd85d..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_13/Ex_05_13.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 05-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed) { - stroke(0); - } else { - stroke(255); - } - line(0, 70, width, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde deleted file mode 100644 index a75d0a93f..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_14/Ex_05_14.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Example 05-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - smooth(); - strokeWeight(30); -} - -void draw() { - background(204); - stroke(102); - line(40, 0, 70, height); - if (mousePressed) { - if (mouseButton == LEFT) { - stroke(255); - } else { - stroke(0); - } - line(0, 70, width, 50); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde deleted file mode 100644 index 78a1bdae0..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_15/Ex_05_15.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Example 05-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x; -int offset = 10; - -void setup() { - size(240, 120); - smooth(); - x = width/2; -} - -void draw() { - background(204); - if (mouseX > x) { - x += 0.5; - offset = -10; - } - if (mouseX < x) { - x -= 0.5; - offset = 10; - } - line(x, 0, x, height); - line(mouseX, mouseY, mouseX + offset, mouseY - 10); - line(mouseX, mouseY, mouseX + offset, mouseY + 10); - line(mouseX, mouseY, mouseX + offset*3, mouseY); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde deleted file mode 100644 index 7092b86ab..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_16/Ex_05_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 05-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 120; -int y = 60; -int radius = 12; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(204); - float d = dist(mouseX, mouseY, x, y); - if (d < radius) { - radius++; - fill(0); - } else { - fill(255); - } - ellipse(x, y, radius, radius); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde deleted file mode 100644 index cf3ebe452..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_17/Ex_05_17.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 05-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 80; -int y = 30; -int w = 80; -int h = 60; - -void setup() { - size(240, 120); -} - -void draw() { - background(204); - if ((mouseX > x) && (mouseX < x+w) && - (mouseY > y) && (mouseY < y+h)) { - fill(0); - } - else { - fill(255); - } - rect(x, y, w, h); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde deleted file mode 100644 index 1031bb201..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_18/Ex_05_18.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 05-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(204); - line(20, 20, 220, 100); - if (keyPressed) { - line(220, 20, 20, 100); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde deleted file mode 100644 index 96bb0217d..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_19/Ex_05_19.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 05-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - textSize(64); - textAlign(CENTER); -} - -void draw() { - background(0); - text(key, 60, 80); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde deleted file mode 100644 index df7a032eb..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_20/Ex_05_20.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 05-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - background(204); - if (keyPressed) { - if ((key == 'h') || (key == 'H')) { - line(30, 60, 90, 60); - } - if ((key == 'n') || (key == 'N')) { - line(30, 20, 90, 100); - } - } - line(30, 20, 30, 100); - line(90, 20, 90, 100); -} - diff --git a/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde b/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde deleted file mode 100644 index b3e3afabe..000000000 --- a/java/examples/Books/Getting Started/Chapter05/Ex_05_21/Ex_05_21.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 05-21 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 215; - -void setup() { - size(480, 120); -} - -void draw() { - if (keyPressed && (key == CODED)) { // If it's a coded key - if (keyCode == LEFT) { // If it's the left arrow - x--; - } - else if (keyCode == RIGHT) { // If it's the right arrow - x++; - } - } - rect(x, 45, 50, 50); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde deleted file mode 100644 index 534292bd6..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_01/Ex_06_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 06-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("lunar.jpg"); -} - -void draw() { - image(img, 0, 0); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde deleted file mode 100644 index 38ede3e47..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_02/Ex_06_02.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img1; -PImage img2; - -void setup() { - size(480, 120); - img1 = loadImage("lunar.jpg"); - img2 = loadImage("capsule.jpg"); -} - -void draw() { - image(img1, -120, 0); - image(img1, 130, 0, 240, 120); - image(img2, 300, 0, 240, 120); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde deleted file mode 100644 index 11d0ce517..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_03/Ex_06_03.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 06-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("lunar.jpg"); -} - -void draw() { - background(0); - image(img, 0, 0, mouseX * 2, mouseY * 2); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde deleted file mode 100644 index a59ea353a..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/Ex_06_04.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 06-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("clouds.gif"); -} - -void draw() { - background(255); - image(img, 0, 0); - image(img, 0, mouseY * -1); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif b/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif deleted file mode 100644 index ad52b85a1..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_04/data/clouds.gif and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde deleted file mode 100644 index 0b157b55d..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_05/Ex_06_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 06-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PImage img; - -void setup() { - size(480, 120); - img = loadImage("clouds.png"); -} - -void draw() { - background(204); - image(img, 0, 0); - image(img, 0, mouseY * -1); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde deleted file mode 100644 index 1831a30bd..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/Ex_06_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 06-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; - -void setup() { - size(480, 120); - smooth(); - font = loadFont("AndaleMono-36.vlw"); - textFont(font); -} - -void draw() { - background(102); - textSize(36); - text("That’s one small step for man...", 25, 60); - textSize(18); - text("That’s one small step for man...", 27, 90); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw deleted file mode 100644 index 34e243f0b..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_06/data/AndaleMono-36.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde deleted file mode 100644 index b96eff645..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/Ex_06_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; - -void setup() { - size(480, 120); - font = loadFont("AndaleMono-24.vlw"); - textFont(font); -} - -void draw() { - background(102); - text("That’s one small step for man...", 26, 30, 240, 100); -} - - - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_07/data/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde deleted file mode 100644 index 25edeafb1..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/Ex_06_08.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 06-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PFont font; -String quote = "That’s one small step for man..."; - -void setup() { - size(480, 120); - font = loadFont("AndaleMono-24.vlw"); - textFont(font); -} - -void draw() { - background(102); - text(quote, 26, 30, 240, 100); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw b/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/Chapter06/Ex_06_08/data/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde deleted file mode 100644 index 74c4be6a6..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/Ex_06_09.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 06-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PShape network; - -void setup() { - size(480, 120); - smooth(); - network = loadShape("network.svg"); -} - -void draw() { - background(0); - shape(network, 30, 10); - shape(network, 180, 10, 280, 280); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg b/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_09/data/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde b/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde deleted file mode 100644 index 417acc3c8..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/Ex_06_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 06-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -PShape network; - -void setup() { - size(240, 120); - smooth(); - shapeMode(CENTER); - network = loadShape("network.svg"); -} - -void draw() { - background(0); - float diameter = map(mouseX, 0, width, 10, 800); - shape(network, 120, 60, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg b/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/Chapter06/Ex_06_10/data/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde deleted file mode 100644 index 3db017b73..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_01/Ex_07_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Example 07-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - println(frameRate); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde deleted file mode 100644 index 615aaf154..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_02/Ex_07_02.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Example 07-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - frameRate(30); // Thirty frames each second - //frameRate(12); // Twelve frames each second - //frameRate(2); // Two frames each second - //frameRate(0.5); // One frame every two seconds -} - -void draw() { - println(frameRate); -} - - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde deleted file mode 100644 index aafb141cc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_03/Ex_07_03.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 07-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = -radius; -float speed = 0.5; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed; // Increase the value of x - arc(x, 60, radius, radius, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde deleted file mode 100644 index b3c37bad9..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_04/Ex_07_04.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 07-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = -radius; -float speed = 0.5; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed; // Increase the value of x - if (x > width+radius) { // If the shape is off screen - x = -radius; // move to the left edge - } - arc(x, 60, radius, radius, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde deleted file mode 100644 index 99ac8e396..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_05/Ex_07_05.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 07-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int radius = 40; -float x = 110; -float speed = 0.5; -int direction = 1; - -void setup() { - size(240, 120); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - x += speed * direction; - if ((x > width-radius) || (x < radius)) { - direction = -direction; // Flip direction - } - if (direction == 1) { - arc(x, 60, radius, radius, 0.52, 5.76); // Face right - } else { - arc(x, 60, radius, radius, 3.67, 8.9); // Face left - } -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde deleted file mode 100644 index c318a2fe2..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_06/Ex_07_06.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 07-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int startX = 20; // Initial x-coordinate -int stopX = 160; // Final x-coordinate -int startY = 30; // Initial y-coordinate -int stopY = 80; // Final y-coordinate -float x = startX; // Current x-coordinate -float y = startY; // Current y-coordinate -float step = 0.005; // Size of each step (0.0 to 1.0) -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(0); - if (pct < 1.0) { - x = startX + ((stopX-startX) * pct); - y = startY + ((stopY-startY) * pct); - pct += step; - } - ellipse(x, y, 20, 20); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde deleted file mode 100644 index 045de5dbc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_07/Ex_07_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 07-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - float r = random(0, mouseX); - println(r); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde deleted file mode 100644 index f2d1b0ee1..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_08/Ex_07_08.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Example 07-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(204); - for (int x = 20; x < width; x += 20) { - float mx = mouseX / 10; - float offsetA = random(-mx, mx); - float offsetB = random(-mx, mx); - line(x + offsetA, 20, x - offsetB, 100); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde deleted file mode 100644 index 55f18fbab..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_09/Ex_07_09.pde +++ /dev/null @@ -1,21 +0,0 @@ -// Example 07-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float speed = 2.5; -int diameter = 20; -float x; -float y; - -void setup() { - size(240, 120); - smooth(); - x = width/2; - y = height/2; -} - -void draw() { - x += random(-speed, speed); - y += random(-speed, speed); - ellipse(x, y, diameter, diameter); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde deleted file mode 100644 index cec7c2012..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_10/Ex_07_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Example 07-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void draw() { - int timer = millis(); - println(timer); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde deleted file mode 100644 index 95ac8b2ab..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_11/Ex_07_11.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Example 07-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int time1 = 2000; -int time2 = 4000; -float x = 0; - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - int currentTime = millis(); - background(204); - if (currentTime > time2) { - x -= 0.5; - } else if (currentTime > time1) { - x += 2; - } - ellipse(x, 60, 90, 90); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde deleted file mode 100644 index 21c2f7701..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_12/Ex_07_12.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Example 07-12 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void draw() { - float sinval = sin(angle); - println(sinval); - float gray = map(sinval, -1, 1, 0, 255); - background(gray); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde deleted file mode 100644 index b6beee4f4..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_13/Ex_07_13.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 07-13 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 40; -float speed = 0.05; - -void setup() { - size(240, 120); - smooth(); -} - -void draw() { - background(0); - float y1 = offset + sin(angle) * scalar; - float y2 = offset + sin(angle + 0.4) * scalar; - float y3 = offset + sin(angle + 0.8) * scalar; - ellipse( 80, y1, 40, 40); - ellipse(120, y2, 40, 40); - ellipse(160, y3, 40, 40); - angle += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde deleted file mode 100644 index 55bf6952d..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_14/Ex_07_14.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 07-14 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 30; -float speed = 0.05; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - float x = offset + cos(angle) * scalar; - float y = offset + sin(angle) * scalar; - ellipse( x, y, 40, 40); - angle += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde deleted file mode 100644 index 85a550f76..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_15/Ex_07_15.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Example 07-15 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float offset = 60; -float scalar = 2; -float speed = 0.05; - -void setup() { - size(120, 120); - fill(0); - smooth(); -} - -void draw() { - float x = offset + cos(angle) * scalar; - float y = offset + sin(angle) * scalar; - ellipse( x, y, 2, 2); - angle += speed; - scalar += speed; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde deleted file mode 100644 index 981566038..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_16/Ex_07_16.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 07-16 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - translate(mouseX, mouseY); - rect(0, 0, 30, 30); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde deleted file mode 100644 index c25f2919c..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_17/Ex_07_17.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 07-17 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - translate(mouseX, mouseY); - rect(0, 0, 30, 30); - translate(35, 10); - rect(0, 0, 15, 15); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde deleted file mode 100644 index 62530d982..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_18/Ex_07_18.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 07-18 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(120, 120); -} - -void draw() { - pushMatrix(); - translate(mouseX, mouseY); - rect(0, 0, 30, 30); - popMatrix(); - translate(35, 10); - rect(0, 0, 15, 15); -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde deleted file mode 100644 index 3b8f61554..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_19/Ex_07_19.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-19 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - rotate(angle); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde deleted file mode 100644 index 599b07389..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_20/Ex_07_20.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-20 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - rotate(angle); - translate(mouseX, mouseY); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde deleted file mode 100644 index 323ed422d..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_21/Ex_07_21.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 07-21 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - scale(sin(angle) + 2); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde deleted file mode 100644 index 4eaf3f2b3..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_22/Ex_07_22.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 07-22 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - translate(mouseX, mouseY); - float scalar = sin(angle) + 2; - scale(scalar); - strokeWeight(1.0 / scalar); - rect(-15, -15, 30, 30); - angle += 0.1; -} - diff --git a/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde b/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde deleted file mode 100644 index 0c42b9fbc..000000000 --- a/java/examples/Books/Getting Started/Chapter07/Ex_07_23/Ex_07_23.pde +++ /dev/null @@ -1,33 +0,0 @@ -// Example 07-23 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float angle = 0.0; -float angleDirection = 1; -float speed = 0.005; - -void setup() { - size(120, 120); - smooth(); -} - -void draw() { - background(204); - translate(20, 25); // Move to start position - rotate(angle); - strokeWeight(12); - line(0, 0, 40, 0); - translate(40, 0); // Move to next joint - rotate(angle * 2.0); - strokeWeight(6); - line(0, 0, 30, 0); - translate(30, 0); // Move the next joint - rotate(angle * 2.5); - strokeWeight(3); - line(0, 0, 20, 0); - - angle += speed * angleDirection; - if ((angle > QUARTER_PI) || (angle < 0)) { - angleDirection *= -1; - } -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde deleted file mode 100644 index 4ca134af5..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_01/Ex_08_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Example 08-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("Ready to roll!"); - rollDice(20); - rollDice(20); - rollDice(6); - println("Finished."); -} - -void rollDice(int numSides) { - int d = 1 + int(random(numSides)); - println("Rolling... " + d); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde deleted file mode 100644 index a4516b752..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_02/Ex_08_02.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 08-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - println("Ready to roll!"); - int d1 = 1 + int(random(20)); - println("Rolling... " + d1); - int d2 = 1 + int(random(20)); - println("Rolling... " + d2); - int d3 = 1 + int(random(6)); - println("Rolling... " + d3); - println("Finished."); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde deleted file mode 100644 index 9f17ec89f..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_03/Ex_08_03.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 08-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - translate(110, 110); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde deleted file mode 100644 index 2a9eba4a0..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_04/Ex_08_04.pde +++ /dev/null @@ -1,42 +0,0 @@ -// Example 08-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - - // Left owl - translate(110, 110); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - - // Right owl - translate(70, 0); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde deleted file mode 100644 index b477a30d5..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_05/Ex_08_05.pde +++ /dev/null @@ -1,32 +0,0 @@ -// Example 08-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - owl(110, 110); - owl(180, 110); -} - -void owl(int x, int y) { - pushMatrix(); - translate(x, y); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde deleted file mode 100644 index df886744c..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_06/Ex_08_06.pde +++ /dev/null @@ -1,33 +0,0 @@ -// Example 08-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - for (int x = 35; x < width + 70; x += 70) { - owl(x, 110); - } -} - -void owl(int x, int y) { - pushMatrix(); - translate(x, y); - stroke(0); - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(0); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde deleted file mode 100644 index 51f496c9b..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_07/Ex_08_07.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Example 08-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - size(480, 120); - smooth(); -} - -void draw() { - background(204); - randomSeed(0); - for (int i = 35; i < width + 40; i += 40) { - int gray = int(random(0, 102)); - float scalar = random(0.25, 1.0); - owl(i, 110, gray, scalar); - } -} - -void owl(int x, int y, int g, float s) { - pushMatrix(); - translate(x, y); - scale(s); // Set the size - stroke(g); // Set the gray value - strokeWeight(70); - line(0, -35, 0, -65); // Body - noStroke(); - fill(255-g); - ellipse(-17.5, -65, 35, 35); // Left eye dome - ellipse(17.5, -65, 35, 35); // Right eye dome - arc(0, -65, 70, 70, 0, PI); // Chin - fill(g); - ellipse(-14, -65, 8, 8); // Left eye - ellipse(14, -65, 8, 8); // Right eye - quad(0, -58, 4, -51, 0, -44, -4, -51); // Beak - popMatrix(); -} - diff --git a/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde b/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde deleted file mode 100644 index 04450188b..000000000 --- a/java/examples/Books/Getting Started/Chapter08/Ex_08_08/Ex_08_08.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Example 08-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -void setup() { - float yourWeight = 132; - float marsWeight = calculateMars(yourWeight); - println(marsWeight); -} - -float calculateMars(float w) { - float newWeight = w * 0.38; - return newWeight; -} - diff --git a/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde b/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde deleted file mode 100644 index 3ba66c8a6..000000000 --- a/java/examples/Books/Getting Started/Chapter09/Ex_09_01/Ex_09_01.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Example 09-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug bug; // Declare object - -void setup() { - size(480, 120); - smooth(); - // Create object and pass in parameters - bug = new JitterBug(width/2, height/2, 20); -} - -void draw() { - bug.move(); - bug.display(); -} - -class JitterBug { - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - diff --git a/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde b/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde deleted file mode 100644 index 3b229def1..000000000 --- a/java/examples/Books/Getting Started/Chapter09/Ex_09_02/Ex_09_02.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Example 09-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug jit; -JitterBug bug; - -void setup() { - size(480, 120); - smooth(); - jit = new JitterBug(width * 0.33, height/2, 50); - bug = new JitterBug(width * 0.66, height/2, 10); -} - -void draw() { - jit.move(); - jit.display(); - bug.move(); - bug.display(); -} - -class JitterBug { - - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde deleted file mode 100644 index e2936c92e..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_01/Ex_10_01.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 10-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x1 = -20; -float x2 = 20; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x1 += 0.5; - x2 += 0.5; - arc(x1, 30, 40, 40, 0.52, 5.76); - arc(x2, 90, 40, 40, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde deleted file mode 100644 index ae04cde1c..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_02/Ex_10_02.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 10-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x1 = -10; -float x2 = 10; -float x3 = 35; -float x4 = 18; -float x5 = 30; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x1 += 0.5; - x2 += 0.5; - x3 += 0.5; - x4 += 0.5; - x5 += 0.5; - arc(x1, 20, 20, 20, 0.52, 5.76); - arc(x2, 40, 20, 20, 0.52, 5.76); - arc(x3, 60, 20, 20, 0.52, 5.76); - arc(x4, 80, 20, 20, 0.52, 5.76); - arc(x5, 100, 20, 20, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde deleted file mode 100644 index 7902c2895..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_03/Ex_10_03.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 10-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] x = new float[3000]; - -void setup() { - size(240, 120); - smooth(); - noStroke(); - fill(255, 200); - for (int i = 0; i < x.length; i++) { - x[i] = random(-1000, 200); - } -} - -void draw() { - background(0); - for (int i = 0; i < x.length; i++) { - x[i] += 0.5; - float y = i * 0.4; - arc(x[i], y, 12, 12, 0.52, 5.76); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde deleted file mode 100644 index 3b6830679..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_04/Ex_10_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Example 10-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x; // Declare the array - -void setup() { - size(200, 200); - x = new int[2]; // Create the array - x[0] = 12; // Assign the first value - x[1] = 2; // Assign the second value -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde deleted file mode 100644 index 53408bc04..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_05/Ex_10_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Example 10-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x = new int[2]; // Declare and create the array - -void setup() { - size(200, 200); - x[0] = 12; // Assign the first value - x[1] = 2; // Assign the second value -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde deleted file mode 100644 index a3b551a7a..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_06/Ex_10_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Example 10-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int[] x = { 12, 2 }; // Declare, create, and assign - -void setup() { - size(200, 200); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde deleted file mode 100644 index 581c46a2c..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_07/Ex_10_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Example 10-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] x = {-20, 20}; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x[0] += 0.5; // Increase the first element - x[1] += 0.5; // Increase the second element - arc(x[0], 30, 40, 40, 0.52, 5.76); - arc(x[1], 90, 40, 40, 0.52, 5.76); -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde deleted file mode 100644 index a1738f00e..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_08/Ex_10_08.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Example 10-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float[] gray; - -void setup() { - size(240, 120); - gray = new float[width]; - for (int i = 0; i < gray.length; i++) { - gray[i] = random(0, 255); - } -} - -void draw() { - for (int i = 0; i < gray.length; i++) { - stroke(gray[i]); - line(i, 0, i, height); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde deleted file mode 100644 index 74246b2b2..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_09/Ex_10_09.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Example 10-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int num = 60; -int[] x = new int[num]; -int[] y = new int[num]; - -void setup() { - size(240, 120); - smooth(); - noStroke(); -} - -void draw() { - background(0); - // Copy array values from back to front - for (int i = x.length-1; i > 0; i--) { - x[i] = x[i-1]; - y[i] = y[i-1]; - } - x[0] = mouseX; // Set the first element - y[0] = mouseY; // Set the first element - for (int i = 0; i < x.length; i++) { - fill(i * 4); - ellipse(x[i], y[i], 40, 40); - } -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde deleted file mode 100644 index 6e1734e20..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_10/Ex_10_10.pde +++ /dev/null @@ -1,47 +0,0 @@ -// Example 10-10 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -JitterBug[] bugs = new JitterBug[33]; - -void setup() { - size(240, 120); - smooth(); - for (int i = 0; i < bugs.length; i++) { - float x = random(width); - float y = random(height); - int r = i + 2; - bugs[i] = new JitterBug(x, y, r); - } -} - -void draw() { - for (int i = 0; i < bugs.length; i++) { - bugs[i].move(); - bugs[i].display(); - } -} - -class JitterBug { - - float x; - float y; - int diameter; - float speed = 2.5; - - JitterBug(float tempX, float tempY, int tempDiameter) { - x = tempX; - y = tempY; - diameter = tempDiameter; - } - - void move() { - x += random(-speed, speed); - y += random(-speed, speed); - } - - void display() { - ellipse(x, y, diameter, diameter); - } - -} - diff --git a/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde b/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde deleted file mode 100644 index 8bac9402a..000000000 --- a/java/examples/Books/Getting Started/Chapter10/Ex_10_11/Ex_10_11.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Example 10-11 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int numFrames = 12; // The number of frames -PImage[] images = new PImage[numFrames]; // Make the array -int currentFrame = 1; - -void setup() { - size(240, 120); - for (int i = 1; i < images.length; i++) { - String imageName = "frame-" + nf(i, 4) + ".png"; - images[i] = loadImage(imageName); // Load each image - } - frameRate(24); -} - -void draw() { - image(images[currentFrame], 0, 0); - currentFrame++; // Next frame - if (currentFrame >= images.length) { - currentFrame = 1; // Return to first frame - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde deleted file mode 100644 index 189a80672..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_01/Ex_11_01.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 11-01 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(440, 220, OPENGL); - noStroke(); - fill(255, 190); -} - -void draw() { - background(0); - translate(width/2, height/2, 0); - rotateX(mouseX / 200.0); - rotateY(mouseY / 100.0); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.2) { - for (int j = -height/2; j < height/2; j += dim*1.2) { - beginShape(); - vertex(i, j, 0); - vertex(i+dim, j, 0); - vertex(i+dim, j+dim, -dim); - vertex(i, j+dim, -dim); - endShape(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde deleted file mode 100644 index a0585cb85..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_02/Ex_11_02.pde +++ /dev/null @@ -1,36 +0,0 @@ -// Example 11-02 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(420, 220, OPENGL); - noStroke(); - fill(255); -} - -void draw() { - lights(); - //ambientLight(102, 102, 102); - //directionalLight(255, 255, 255, // Color - // -1, 0, 0); // Direction XYZ - //pointLight(255, 255, 255, // Color - // mouseX, 110, 50); // Position - //spotLight(255, 255, 255, // Color - // mouseX, 0, 200, // Position - // 0, 0, -1, // Direction XYZ - // PI, 2); // Concentration - rotateY(PI/24); - background(0); - translate(width/2, height/2, -20); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.4) { - for (int j = -height/2; j < height/2; j += dim*1.4) { - pushMatrix(); - translate(i, j, -j); - box(dim, dim, dim); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde deleted file mode 100644 index 7c0c0871d..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_03/Ex_11_03.pde +++ /dev/null @@ -1,29 +0,0 @@ -// Example 11-03 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.opengl.*; - -void setup() { - size(420, 220, OPENGL); - noStroke(); -} - -void draw() { - lights(); - background(0); - float camZ = (height/2.0) / tan(PI*60.0 / 360.0); - camera(mouseX, mouseY, camZ, // Camera location - width/2.0, height/2.0, 0, // Camera target - 0, 1, 0); // Camera orientation - translate(width/2, height/2, -20); - int dim = 18; - for (int i = -height/2; i < height/2; i += dim*1.4) { - for (int j = -height/2; j < height/2; j += dim*1.4) { - pushMatrix(); - translate(i, j, -j); - box(dim, dim, dim); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde deleted file mode 100644 index fa63b0dd5..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_04/Ex_11_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Example 11-04 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 0; - -void setup() { - size(720, 480); - smooth(); - noFill(); - strokeCap(SQUARE); - frameRate(30); -} - -void draw() { - background(204); - translate(x, 0); - for (int y = 40; y < 280; y += 20) { - line(-260, y, 0, y + 200); - line(0, y + 200, 260, y); - } - if (frameCount < 60) { - saveFrame("frames/SaveExample-####.tif"); - } else { - exit(); - } - x += 2.5; -} diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde deleted file mode 100644 index 104c28c73..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_05/Ex_11_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Example 11-05 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.pdf.*; - -void setup() { - size(600, 800, PDF, "Ex-11-5.pdf"); - noFill(); - strokeCap(SQUARE); -} - -void draw() { - background(255); - for (int y = 100; y < height - 300; y+=20) { - float r = random(0, 102); - strokeWeight(r / 10); - beginShape(); - vertex(100, y); - vertex(width/2, y + 200); - vertex(width-100, y); - endShape(); - } - exit(); -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde deleted file mode 100644 index 70db3c766..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_06/Ex_11_06.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Example 11-06 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -// Note: This is code for an Arduino board, not Processing - -int sensorPin = 0; // Select input pin -int val = 0; - -void setup() { - Serial.begin(9600); // Open serial port -} - -void loop() { - val = analogRead(sensorPin) / 4; // Read value from sensor - Serial.print(val, BYTE); // Print variable to serial port - delay(100); // Wait 100 milliseconds -} diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde deleted file mode 100644 index 8965855a7..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_07/Ex_11_07.pde +++ /dev/null @@ -1,30 +0,0 @@ -// Example 11-07 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port - -void setup() { - size(440, 220); - // IMPORTANT NOTE: - // The first serial port retrieved by Serial.list() - // should be your Arduino. If not, uncomment the next - // line by deleting the // before it. Run the sketch - // again to see a list of serial ports. Then, change - // the 0 in between [ and ] to the number of the port - // that your Arduino is connected to. - //println(Serial.list()); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); -} - -void draw() { - if (port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - val = map(val, 0, 255, 0, height); // Convert the value - } - rect(40, val-10, 360, 20); -} - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde deleted file mode 100644 index 444e8c692..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_08/Ex_11_08.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Example 11-08 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port -int x; -float easing = 0.05; -float easedVal; - -void setup() { - size(440, 440); - frameRate(30); - smooth(); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); - background(0); -} - -void draw() { - if ( port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - val = map(val, 0, 255, 0, height); // Convert the values - } - - float targetVal = val; - easedVal += (targetVal - easedVal) * easing; - - stroke(0); - line(x, 0, x, height); // Black line - stroke(255); - line(x+1, 0, x+1, height); // White line - line(x, 220, x, val); // Raw value - line(x, 440, x, easedVal + 220); // Averaged value - - x++; - if (x > width) { - x = 0; - } -} - - - diff --git a/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde b/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde deleted file mode 100644 index ed28e4622..000000000 --- a/java/examples/Books/Getting Started/Chapter11/Ex_11_09/Ex_11_09.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Example 11-09 from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -import processing.serial.*; - -Serial port; // Create object from Serial class -float val; // Data received from the serial port -float angle; -float radius; - -void setup() { - size(440, 440); - frameRate(30); - strokeWeight(2); - smooth(); - String arduinoPort = Serial.list()[0]; - port = new Serial(this, arduinoPort, 9600); - background(0); -} - -void draw() { - if ( port.available() > 0) { // If data is available, - val = port.read(); // read it and store it in val - // Convert the values to set the radius - radius = map(val, 0, 255, 0, height * 0.45); - } - - int middleX = width/2; - int middleY = height/2; - float x = middleX + cos(angle) * height/2; - float y = middleY + sin(angle) * height/2; - stroke(0); - line(middleX, middleY, x, y); - - x = middleX + cos(angle) * radius; - y = middleY + sin(angle) * radius; - stroke(255); - line(middleX, middleY, x, y); - - angle += 0.01; -} diff --git a/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde b/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde deleted file mode 100644 index 60b197205..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot1_Draw/Robot1_Draw.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Robot 1: Draw from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -size(720, 480); -smooth(); -strokeWeight(2); -background(204); -ellipseMode(RADIUS); - -// Neck -stroke(102); // Set stroke to gray -line(266, 257, 266, 162); // Left -line(276, 257, 276, 162); // Middle -line(286, 257, 286, 162); // Right - -// Antennae -line(276, 155, 246, 112); // Small -line(276, 155, 306, 56); // Tall -line(276, 155, 342, 170); // Medium - -// Body -noStroke(); // Disable stroke -fill(102); // Set fill to gray -ellipse(264, 377, 33, 33); // Antigravity orb -fill(0); // Set fill to black -rect(219, 257, 90, 120); // Main body -fill(102); // Set fill to gray -rect(219, 274, 90, 6); // Gray stripe - -// Head -fill(0); // Set fill to black -ellipse(276, 155, 45, 45); // Head -fill(255); // Set fill to white -ellipse(288, 150, 14, 14); // Large eye -fill(0); // Set fill to black -ellipse(288, 150, 3, 3); // Pupil -fill(153); // Set fill to light gray -ellipse(263, 148, 5, 5); // Small eye 1 -ellipse(296, 130, 4, 4); // Small eye 2 -ellipse(305, 162, 3, 3); // Small eye 3 - diff --git a/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde b/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde deleted file mode 100644 index a20816e2c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot2_Variables/Robot2_Variables.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Robot 2: Variables from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -int x = 60; // X-coordinate -int y = 420; // Y-coordinate -int bodyHeight = 110; // Body Height -int neckHeight = 140; // Neck Height -int radius = 45; -int ny = y - bodyHeight - neckHeight - radius; // Neck Y - -size(170, 480); -smooth(); -strokeWeight(2); -background(204); -ellipseMode(RADIUS); - -// Neck -stroke(102); -line(x+2, y-bodyHeight, x+2, ny); -line(x+12, y-bodyHeight, x+12, ny); -line(x+22, y-bodyHeight, x+22, ny); - -// Antennae -line(x+12, ny, x-18, ny-43); -line(x+12, ny, x+42, ny-99); -line(x+12, ny, x+78, ny+15); - -// Body -noStroke(); -fill(102); -ellipse(x, y-33, 33, 33); -fill(0); -rect(x-45, y-bodyHeight, 90, bodyHeight-33); -fill(102); -rect(x-45, y-bodyHeight+17, 90, 6); - -// Head -fill(0); -ellipse(x+12, ny, radius, radius); -fill(255); -ellipse(x+24, ny-6, 14, 14); -fill(0); -ellipse(x+24, ny-6, 3, 3); -fill(153); -ellipse(x, ny-8, 5, 5); -ellipse(x+30, ny-26, 4, 4); -ellipse(x+41, ny+6, 3, 3); - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde b/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde deleted file mode 100644 index dea4634d9..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot3_Response/Robot3_Response.pde +++ /dev/null @@ -1,59 +0,0 @@ -// Robot 3: Response from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 60; // X-coordinate -float y = 440; // Y-coordinate -int radius = 45; // Head Radius -int bodyHeight = 160; // Body Height -int neckHeight = 70; // Neck Height - -float easing = 0.02; - -void setup() { - size(360, 480); - smooth(); - strokeWeight(2); - ellipseMode(RADIUS); -} - -void draw() { - - int targetX = mouseX; - x += (targetX - x) * easing; - - if (mousePressed) { - neckHeight = 16; - bodyHeight = 90; - } else { - neckHeight = 70; - bodyHeight = 160; - } - - float ny = y - bodyHeight - neckHeight - radius; - - background(204); - - // Neck - stroke(102); - line(x+12, y-bodyHeight, x+12, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); -} diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde b/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde deleted file mode 100644 index 1945fa3d4..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/Robot4_Media.pde +++ /dev/null @@ -1,43 +0,0 @@ -// Robot 4: Media from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - - -PShape bot1; -PShape bot2; -PShape bot3; -PImage landscape; - -float easing = 0.05; -float offset = 0; - -void setup() { - size(720, 480); - bot1 = loadShape("robot1.svg"); - bot2 = loadShape("robot2.svg"); - bot3 = loadShape("robot3.svg"); - landscape = loadImage("alpine.png"); - smooth(); -} - -void draw() { - // Set the background to the "landscape" image, this image - // must be the same width and height as the program - background(landscape); - - // Set the left/right offset and apply easing to make - // the transition smooth - float targetOffset = map(mouseY, 0, height, -40, 40); - offset += (targetOffset - offset) * easing; - - // Draw the left robot - shape(bot1, 85 + offset, 65); - - // Draw the right robot smaller and give it a smaller offset - float smallerOffset = offset * 0.7; - shape(bot2, 510 + smallerOffset, 140, 78, 248); - - // Draw the smallest robot, give it a smaller offset - smallerOffset *= -0.5; - shape(bot3, 410 + smallerOffset, 225, 39, 124); -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg deleted file mode 100644 index bda32e6a1..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot2.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg b/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg deleted file mode 100644 index 436456609..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot4_Media/data/robot3.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde b/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde deleted file mode 100644 index 70c0a2eff..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot5_Motion/Robot5_Motion.pde +++ /dev/null @@ -1,57 +0,0 @@ -// Robot 5: Motion from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -float x = 180; // X-coordinate -float y = 400; // Y-coordinate -float bodyHeight = 153; // Body Height -float neckHeight = 56; // Neck Height -float radius = 45; // Head Radius -float angle = 0.0; // Angle for motion - -void setup() { - size(360, 480); - smooth(); - ellipseMode(RADIUS); -} - -void draw() { - // Change position by a small random amount - x += random(-4, 4); - y += random(-1, 1); - - // Change height of neck - neckHeight = 80 + sin(angle) * 30; - angle += 0.05; - - // Adjust the height of the head - float ny = y - bodyHeight - neckHeight - radius; - - // Neck - stroke(102); - line(x+2, y-bodyHeight, x+2, ny); - line(x+12, y-bodyHeight, x+12, ny); - line(x+22, y-bodyHeight, x+22, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - fill(102); - rect(x-45, y-bodyHeight+17, 90, 6); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde b/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde deleted file mode 100644 index 9d1878b54..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot6_Functions/Robot6_Functions.pde +++ /dev/null @@ -1,63 +0,0 @@ -// Robot 6: Functions from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - - -void setup() { - size(720, 480); - smooth(); - strokeWeight(2); - ellipseMode(RADIUS); -} - -void draw() { - background(204); - drawRobot(120, 420, 110, 140); - drawRobot(270, 460, 260, 95); - drawRobot(420, 310, 80, 10); - drawRobot(570, 390, 180, 40); -} - -void drawRobot(int x, int y, int bodyHeight, int neckHeight) { - - int radius = 45; - int ny = y - bodyHeight - neckHeight - radius; // neckHeight Y - - // Neck - stroke(102); - line(x+2, y-bodyHeight, x+2, ny); - line(x+12, y-bodyHeight, x+12, ny); - line(x+22, y-bodyHeight, x+22, ny); - - // Antennae - line(x+12, ny, x-18, ny-43); - line(x+12, ny, x+42, ny-99); - line(x+12, ny, x+78, ny+15); - - // Body - noStroke(); - fill(102); - ellipse(x, y-33, 33, 33); - fill(0); - rect(x-45, y-bodyHeight, 90, bodyHeight-33); - fill(102); - rect(x-45, y-bodyHeight+17, 90, 6); - - // Head - fill(0); - ellipse(x+12, ny, radius, radius); - fill(255); - ellipse(x+24, ny-6, 14, 14); - fill(0); - ellipse(x+24, ny-6, 3, 3); - fill(153); - ellipse(x, ny-8, 5, 5); - ellipse(x+30, ny-26, 4, 4); - ellipse(x+41, ny+6, 3, 3); -} - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde b/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde deleted file mode 100644 index 5f0da699f..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/Robot7_Objects.pde +++ /dev/null @@ -1,53 +0,0 @@ -// Robot 7: Objects from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -Robot bot1; -Robot bot2; - -void setup() { - size(720, 480); - bot1 = new Robot("robot1.svg", 90, 80); - bot2 = new Robot("robot2.svg", 440, 30); - smooth(); -} - -void draw() { - background(204); - - // Update and display first robot - bot1.update(); - bot1.display(); - - // Update and display second robot - bot2.update(); - bot2.display(); -} - -class Robot { - float xpos; - float ypos; - float angle; - PShape botShape; - float yoffset = 0.0; - - // Set initial values in constructor - Robot(String svgName, float tempX, float tempY) { - botShape = loadShape(svgName); - xpos = tempX; - ypos = tempY; - angle = random(0, TWO_PI); - } - - // Update the fields - void update() { - angle += 0.05; - yoffset = sin(angle) * 20; - } - - // Draw the robot to the screen - void display() { - shape(botShape, xpos, ypos + yoffset); - } - -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg b/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg deleted file mode 100644 index bda32e6a1..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot7_Objects/data/robot2.svg +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde b/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde deleted file mode 100644 index 396a5d6c5..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/Robot8_Arrays.pde +++ /dev/null @@ -1,58 +0,0 @@ -// Robot 8: Arrays from "Getting Started with Processing" -// by Reas & Fry. O'Reilly / Make 2010 - -Robot[] bots; // Declare array of Robot objects - -void setup() { - size(720, 480); - PShape robotShape = loadShape("robot1.svg"); - // Create the array of Robot objects - bots = new Robot[20]; - // Create each object - for (int i = 0; i < bots.length; i++) { - // Create a random x-coordinate - float x = random(-40, width-40); - // Assign the y-coordinate based on the order - float y = map(i, 0, bots.length, -100, height-200); - bots[i] = new Robot(robotShape, x, y); - } - smooth(); -} - -void draw() { - background(204); - // Update and display each bot in the array - for (int i = 0; i < bots.length; i++) { - bots[i].update(); - bots[i].display(); - } -} - -class Robot { - float xpos; - float ypos; - float angle; - PShape botShape; - float yoffset = 0.0; - - // Set initial values in constructor - Robot(PShape shape, float tempX, float tempY) { - botShape = shape; - xpos = tempX; - ypos = tempY; - angle = random(0, TWO_PI); - } - - // Update the fields - void update() { - angle += 0.05; - yoffset = sin(angle) * 20; - } - - // Draw the robot to the screen - void display() { - shape(botShape, xpos, ypos + yoffset); - } - -} - diff --git a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg b/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/Robots/Robot8_Arrays/data/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/AndaleMono-24.vlw b/java/examples/Books/Getting Started/media/AndaleMono-24.vlw deleted file mode 100644 index a71ac78ac..000000000 Binary files a/java/examples/Books/Getting Started/media/AndaleMono-24.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/AndaleMono-36.vlw b/java/examples/Books/Getting Started/media/AndaleMono-36.vlw deleted file mode 100644 index 34e243f0b..000000000 Binary files a/java/examples/Books/Getting Started/media/AndaleMono-36.vlw and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/clouds.gif b/java/examples/Books/Getting Started/media/clouds.gif deleted file mode 100644 index ad52b85a1..000000000 Binary files a/java/examples/Books/Getting Started/media/clouds.gif and /dev/null differ diff --git a/java/examples/Books/Getting Started/media/network.svg b/java/examples/Books/Getting Started/media/network.svg deleted file mode 100644 index 5ecd8d159..000000000 --- a/java/examples/Books/Getting Started/media/network.svg +++ /dev/null @@ -1,4056 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/robot1.svg b/java/examples/Books/Getting Started/media/robot1.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/media/robot1.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Getting Started/media/robot2.svg b/java/examples/Books/Getting Started/media/robot2.svg deleted file mode 100644 index e44805f1c..000000000 --- a/java/examples/Books/Getting Started/media/robot2.svg +++ /dev/null @@ -1,1033 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde deleted file mode 100644 index 0dcfe7a67..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Connection.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Connection { - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - // Variables to track the animation - boolean sending = false; - PVector sender; - - // Need to store the output for when its time to pass along - float output = 0; - - Connection(Neuron from, Neuron to, float w) { - weight = w; - a = from; - b = to; - } - - - // The Connection is active - void feedforward(float val) { - output = val*weight; // Compute output - sender = a.location.get(); // Start animation at Neuron A - sending = true; // Turn on sending - } - - // Update traveling sender - void update() { - if (sending) { - // Use a simple interpolation - sender.x = lerp(sender.x, b.location.x, 0.1); - sender.y = lerp(sender.y, b.location.y, 0.1); - float d = PVector.dist(sender, b.location); - // If we've reached the end - if (d < 1) { - // Pass along the output! - b.feedforward(output); - sending = false; - } - } - } - - // Draw line and traveling circle - void display() { - stroke(0); - strokeWeight(1+weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - - if (sending) { - fill(0); - strokeWeight(1); - ellipse(sender.x, sender.y, 16, 16); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde deleted file mode 100644 index 87958e675..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Exercise_10_5_LayeredNetworkAnimation.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -Network network; - -void setup() { - size(640,360); - // Create the Network object - network = new Network(width/2, height/2); - - int layers = 3; - int inputs = 2; - - Neuron output = new Neuron(250, 0); - for (int i = 0; i < layers; i++) { - for (int j = 0; j < inputs; j++) { - float x = map(i, 0, layers, -250, 300); - float y = map(j, 0, inputs-1, -75, 75); - Neuron n = new Neuron(x, y); - if (i > 0) { - for (int k = 0; k < inputs; k++) { - Neuron prev = network.neurons.get(network.neurons.size()-inputs+k-j); - network.connect(prev, n, random(1)); - } - } - if (i == layers-1) { - network.connect(n, output, random(1)); - } - network.addNeuron(n); - } - } - network.addNeuron(output); -} - -void draw() { - background(255); - // Update and display the Network - network.update(); - network.display(); - - // Every 30 frames feed in an input - if (frameCount % 30 == 0) { - network.feedforward(random(1),random(1)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde deleted file mode 100644 index 68a9f597f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Network.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - - // The Network now keeps a duplicate list of all Connection objects. - // This makes it easier to draw everything in this class - ArrayList connections; - PVector location; - - Network(float x, float y) { - location = new PVector(x, y); - neurons = new ArrayList(); - connections = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b, float weight) { - Connection c = new Connection(a, b, weight); - a.addConnection(c); - // Also add the Connection here - connections.add(c); - } - - // Sending an input to the first Neuron - // We should do something better to track multiple inputs - void feedforward(float input1, float input2) { - Neuron n1 = neurons.get(0); - n1.feedforward(input1); - - Neuron n2 = neurons.get(1); - n2.feedforward(input2); - - } - - // Update the animation - void update() { - for (Connection c : connections) { - c.update(); - } - } - - // Draw everything - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - - for (Connection c : connections) { - c.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde deleted file mode 100644 index 819fe6750..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/Exercise_10_5_LayeredNetworkAnimation/Neuron.pde +++ /dev/null @@ -1,64 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Neuron { - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - // We now track the inputs and sum them - float sum = 0; - - // The Neuron's size can be animated - float r = 32; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Receive an input - void feedforward(float input) { - // Accumulate it - sum += input; - // Activate it? - if (sum > 1) { - fire(); - sum = 0; // Reset the sum to 0 if it fires - } - } - - // The Neuron fires - void fire() { - r = 64; // It suddenly is bigger - - // We send the output through all connections - for (Connection c : connections) { - c.feedforward(sum); - } - } - - // Draw it as a circle - void display() { - stroke(0); - strokeWeight(1); - // Brightness is mapped to sum - float b = map(sum,0,1,255,0); - fill(b); - ellipse(location.x, location.y, r, r); - - // Size shrinks down back to original dimensions - r = lerp(r,32,0.1); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde deleted file mode 100644 index 4d3c6d365..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Connection.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Connection { - float weight; - Neuron a; - Neuron b; - - Connection(Neuron from, Neuron to,float w) { - weight = w; - a = from; - b = to; - } - - void display() { - stroke(0); - strokeWeight(weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde deleted file mode 100644 index e9a8f2de2..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/LayeredNetworkViz.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Network network; - -void setup() { - size(640, 360); - network = new Network(4,3,1); -} - -void draw() { - background(255); - network.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde deleted file mode 100644 index ec87c6e37..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Network.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Network { - ArrayList neurons; - PVector location; - Network(int layers, int inputs, int outputs) { - location = new PVector(width/2, height/2); - - neurons = new ArrayList(); - - Neuron output = new Neuron(250, 0); - for (int i = 0; i < layers; i++) { - for (int j = 0; j < inputs; j++) { - float x = map(i, 0, layers, -200, 200); - float y = map(j, 0, inputs-1, -100, 100); - println(j + " " + y); - Neuron n = new Neuron(x, y); - - if (i > 0) { - for (int k = 0; k < inputs; k++) { - Neuron prev = neurons.get(neurons.size()-inputs+k-j); - prev.connect(n); - } - } - - if (i == layers-1) { - n.connect(output); - } - neurons.add(n); - } - } - neurons.add(output); - } - - - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde deleted file mode 100644 index e500dcb2b..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/LayeredNetworkViz/Neuron.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Neuron { - PVector location; - - ArrayList connections; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - void connect(Neuron n) { - Connection c = new Connection(this, n, random(1)); - connections.add(c); - } - - void display() { - stroke(0); - strokeWeight(1); - fill(0); - ellipse(location.x, location.y, 16, 16); - - for (Connection c : connections) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde deleted file mode 100644 index 93148cea1..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/NOC_10_01_SimplePerceptron.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Code based on text "Artificial Intelligence", George Luger - -// A list of points we will use to "train" the perceptron -Trainer[] training = new Trainer[2000]; -// A Perceptron object -Perceptron ptron; - -// We will train the perceptron with one "Point" object at a time -int count = 0; - -// Coordinate space -float xmin = -400; -float ymin = -100; -float xmax = 400; -float ymax = 100; - -// The function to describe a line -float f(float x) { - return 0.4*x+1; -} - -void setup() { - size(640, 360); - - // The perceptron has 3 inputs -- x, y, and bias - // Second value is "Learning Constant" - ptron = new Perceptron(3, 0.00001); // Learning Constant is low just b/c it's fun to watch, this is not necessarily optimal - - // Create a random set of training points and calculate the "known" answer - for (int i = 0; i < training.length; i++) { - float x = random(xmin, xmax); - float y = random(ymin, ymax); - int answer = 1; - if (y < f(x)) answer = -1; - training[i] = new Trainer(x, y, answer); - } - smooth(); -} - - -void draw() { - background(255); - translate(width/2,height/2); - - // Draw the line - strokeWeight(4); - stroke(127); - float x1 = xmin; - float y1 = f(x1); - float x2 = xmax; - float y2 = f(x2); - line(x1,y1,x2,y2); - - // Draw the line based on the current weights - // Formula is weights[0]*x + weights[1]*y + weights[2] = 0 - stroke(0); - strokeWeight(1); - float[] weights = ptron.getWeights(); - x1 = xmin; - y1 = (-weights[2] - weights[0]*x1)/weights[1]; - x2 = xmax; - y2 = (-weights[2] - weights[0]*x2)/weights[1]; - line(x1,y1,x2,y2); - - - - // Train the Perceptron with one "training" point at a time - ptron.train(training[count].inputs, training[count].answer); - count = (count + 1) % training.length; - - // Draw all the points based on what the Perceptron would "guess" - // Does not use the "known" correct answer - for (int i = 0; i < count; i++) { - stroke(0); - strokeWeight(1); - fill(0); - int guess = ptron.feedforward(training[i].inputs); - if (guess > 0) noFill(); - - ellipse(training[i].inputs[0], training[i].inputs[1], 8, 8); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde deleted file mode 100644 index 0eec0da5b..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Perceptron.pde +++ /dev/null @@ -1,60 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Perceptron Class - -class Perceptron { - float[] weights; // Array of weights for inputs - float c; // learning constant - - // Perceptron is created with n weights and learning constant - Perceptron(int n, float c_) { - weights = new float[n]; - // Start with random weights - for (int i = 0; i < weights.length; i++) { - weights[i] = random(-1,1); - } - c = c_; - } - - // Function to train the Perceptron - // Weights are adjusted based on "desired" answer - void train(float[] inputs, int desired) { - // Guess the result - int guess = feedforward(inputs); - // Compute the factor for changing the weight based on the error - // Error = desired output - guessed output - // Note this can only be 0, -2, or 2 - // Multiply by learning constant - float error = desired - guess; - // Adjust weights based on weightChange * input - for (int i = 0; i < weights.length; i++) { - weights[i] += c * error * inputs[i]; - } - } - - // Guess -1 or 1 based on input values - int feedforward(float[] inputs) { - // Sum all values - float sum = 0; - for (int i = 0; i < weights.length; i++) { - sum += inputs[i]*weights[i]; - } - // Result is sign of the sum, -1 or 1 - return activate(sum); - } - - int activate(float sum) { - if (sum > 0) return 1; - else return -1; - } - - // Return weights - float[] getWeights() { - return weights; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde deleted file mode 100644 index 69db5371c..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_01_SimplePerceptron/Trainer.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// A class to describe a training point -// Has an x and y, a "bias" (1) and known output -// Could also add a variable for "guess" but not required here - -class Trainer { - - float[] inputs; - int answer; - - Trainer(float x, float y, int a) { - inputs = new float[3]; - inputs[0] = x; - inputs[1] = y; - inputs[2] = 1; - answer = a; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde deleted file mode 100644 index de91587f1..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/NOC_10_02_SeekingNeural.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Vehicle controlled by a Perceptron - -Vehicle v; - -PVector desired; - -ArrayList targets; - -void setup() { - size(640, 360); - // The Vehicle's desired location - desired = new PVector(width/2,height/2); - - - // Create a list of targets - makeTargets(); - - // Create the Vehicle (it has to know about the number of targets - // in order to configure its brain) - v = new Vehicle(targets.size(), random(width), random(height)); -} - -// Make a random ArrayList of targets to steer towards -void makeTargets() { - targets = new ArrayList(); - for (int i = 0; i < 8; i++) { - targets.add(new PVector(random(width), random(height))); - } -} - -void draw() { - background(255); - - // Draw a circle to show the Vehicle's goal - stroke(0); - strokeWeight(2); - fill(0, 100); - ellipse(desired.x, desired.y, 36, 36); - - // Draw the targets - for (PVector target : targets) { - noFill(); - stroke(0); - strokeWeight(2); - ellipse(target.x, target.y, 16, 16); - line(target.x,target.y-16,target.x,target.y+16); - line(target.x-16,target.y,target.x+16,target.y); - } - - // Update the Vehicle - v.steer(targets); - v.update(); - v.display(); -} - -void mousePressed() { - makeTargets(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde deleted file mode 100644 index f52c726b3..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Perceptron.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Perceptron Example -// See: http://en.wikipedia.org/wiki/Perceptron - -// Perceptron Class - -class Perceptron { - float[] weights; // Array of weights for inputs - float c; // learning constant - - // Perceptron is created with n weights and learning constant - Perceptron(int n, float c_) { - weights = new float[n]; - c = c_; - // Start with random weights - for (int i = 0; i < weights.length; i++) { - weights[i] = random(0, 1); - } - } - - // Function to train the Perceptron - // Weights are adjusted based on vehicle's error - void train(PVector[] forces, PVector error) { - for (int i = 0; i < weights.length; i++) { - weights[i] += c*error.x*forces[i].x; - weights[i] += c*error.y*forces[i].y; - weights[i] = constrain(weights[i], 0, 1); - } - } - - // Give me a steering result - PVector feedforward(PVector[] forces) { - // Sum all values - PVector sum = new PVector(); - for (int i = 0; i < weights.length; i++) { - forces[i].mult(weights[i]); - sum.add(forces[i]); - } - return sum; - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde deleted file mode 100644 index efd9bf287..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_02_SeekingNeural/Vehicle.pde +++ /dev/null @@ -1,102 +0,0 @@ -// Seek -// Daniel Shiffman - -// The "Vehicle" class - -class Vehicle { - - // Vehicle now has a brain! - Perceptron brain; - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(int n, float x, float y) { - brain = new Perceptron(n,0.001); - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 3.0; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - - location.x = constrain(location.x,0,width); - location.y = constrain(location.y,0,height); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Here is where the brain processes everything - void steer(ArrayList targets) { - // Make an array of forces - PVector[] forces = new PVector[targets.size()]; - - // Steer towards all targets - for (int i = 0; i < forces.length; i++) { - forces[i] = seek(targets.get(i)); - } - - // That array of forces is the input to the brain - PVector result = brain.feedforward(forces); - - // Use the result to steer the vehicle - applyForce(result); - - // Train the brain according to the error - PVector error = PVector.sub(desired, location); - brain.train(forces,error); - - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - void display() { - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(175); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde deleted file mode 100644 index 5e183e58f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Connection.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Connection { - - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - Connection(Neuron from, Neuron to,float w) { - weight = w; - a = from; - b = to; - } - - // Drawn as a line - void display() { - stroke(0); - strokeWeight(weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde deleted file mode 100644 index c368b9966..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/NOC_10_03_NetworkViz.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -Network network; - -void setup() { - size(640, 360); - // Create the Network object - network = new Network(width/2,height/2); - - // Create a bunch of Neurons - Neuron a = new Neuron(-200,0); - Neuron b = new Neuron(0,75); - Neuron c = new Neuron(0,-75); - Neuron d = new Neuron(200,0); - - // Connect them - network.connect(a,b); - network.connect(a,c); - network.connect(b,d); - network.connect(c,d); - - // Add them to the Network - network.addNeuron(a); - network.addNeuron(b); - network.addNeuron(c); - network.addNeuron(d); -} - -void draw() { - background(255); - // Draw the Network - network.display(); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde deleted file mode 100644 index 44b94a80f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Network.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - PVector location; - - Network(float x, float y) { - location = new PVector(x,y); - neurons = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b) { - Connection c = new Connection(a, b, random(1)); - a.addConnection(c); - } - - // We can draw the network - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde deleted file mode 100644 index d14ed2a5e..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_03_NetworkViz/Neuron.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A static drawing of a Neural Network - -class Neuron { - - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Draw Neuron as a circle - void display() { - stroke(0); - strokeWeight(1); - fill(0); - ellipse(location.x, location.y, 16, 16); - - // Draw all its connections - for (Connection c : connections) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde deleted file mode 100644 index 0dcfe7a67..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Connection.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Connection { - // Connection is from Neuron A to B - Neuron a; - Neuron b; - - // Connection has a weight - float weight; - - // Variables to track the animation - boolean sending = false; - PVector sender; - - // Need to store the output for when its time to pass along - float output = 0; - - Connection(Neuron from, Neuron to, float w) { - weight = w; - a = from; - b = to; - } - - - // The Connection is active - void feedforward(float val) { - output = val*weight; // Compute output - sender = a.location.get(); // Start animation at Neuron A - sending = true; // Turn on sending - } - - // Update traveling sender - void update() { - if (sending) { - // Use a simple interpolation - sender.x = lerp(sender.x, b.location.x, 0.1); - sender.y = lerp(sender.y, b.location.y, 0.1); - float d = PVector.dist(sender, b.location); - // If we've reached the end - if (d < 1) { - // Pass along the output! - b.feedforward(output); - sending = false; - } - } - } - - // Draw line and traveling circle - void display() { - stroke(0); - strokeWeight(1+weight*4); - line(a.location.x, a.location.y, b.location.x, b.location.y); - - if (sending) { - fill(0); - strokeWeight(1); - ellipse(sender.x, sender.y, 16, 16); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde deleted file mode 100644 index 4c2d2ed6c..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/NOC_10_04_NetworkAnimation.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -Network network; - -void setup() { - size(640, 360); - // Create the Network object - network = new Network(width/2, height/2); - - // Create a bunch of Neurons - Neuron a = new Neuron(-275, 0); - Neuron b = new Neuron(-150, 0); - Neuron c = new Neuron(0, 75); - Neuron d = new Neuron(0, -75); - Neuron e = new Neuron(150, 0); - Neuron f = new Neuron(275, 0); - - // Connect them - network.connect(a, b,1); - network.connect(b, c,random(1)); - network.connect(b, d,random(1)); - network.connect(c, e,random(1)); - network.connect(d, e,random(1)); - network.connect(e, f,1); - - // Add them to the Network - network.addNeuron(a); - network.addNeuron(b); - network.addNeuron(c); - network.addNeuron(d); - network.addNeuron(e); - network.addNeuron(f); -} - -void draw() { - background(255); - // Update and display the Network - network.update(); - network.display(); - - // Every 30 frames feed in an input - if (frameCount % 30 == 0) { - network.feedforward(random(1)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde deleted file mode 100644 index 5506414c9..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Network.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Network { - - // The Network has a list of neurons - ArrayList neurons; - - // The Network now keeps a duplicate list of all Connection objects. - // This makes it easier to draw everything in this class - ArrayList connections; - PVector location; - - Network(float x, float y) { - location = new PVector(x, y); - neurons = new ArrayList(); - connections = new ArrayList(); - } - - // We can add a Neuron - void addNeuron(Neuron n) { - neurons.add(n); - } - - // We can connection two Neurons - void connect(Neuron a, Neuron b, float weight) { - Connection c = new Connection(a, b, weight); - a.addConnection(c); - // Also add the Connection here - connections.add(c); - } - - // Sending an input to the first Neuron - // We should do something better to track multiple inputs - void feedforward(float input) { - Neuron start = neurons.get(0); - start.feedforward(input); - } - - // Update the animation - void update() { - for (Connection c : connections) { - c.update(); - } - } - - // Draw everything - void display() { - pushMatrix(); - translate(location.x, location.y); - for (Neuron n : neurons) { - n.display(); - } - - for (Connection c : connections) { - c.display(); - } - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde b/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde deleted file mode 100644 index 89bc6c822..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/NOC_10_04_NetworkAnimation/Neuron.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An animated drawing of a Neural Network - -class Neuron { - // Neuron has a location - PVector location; - - // Neuron has a list of connections - ArrayList connections; - - // We now track the inputs and sum them - float sum = 0; - - // The Neuron's size can be animated - float r = 32; - - Neuron(float x, float y) { - location = new PVector(x, y); - connections = new ArrayList(); - } - - // Add a Connection - void addConnection(Connection c) { - connections.add(c); - } - - // Receive an input - void feedforward(float input) { - // Accumulate it - sum += input; - // Activate it? - if (sum > 1) { - fire(); - sum = 0; // Reset the sum to 0 if it fires - } - } - - // The Neuron fires - void fire() { - r = 64; // It suddenly is bigger - - // We send the output through all connections - for (Connection c : connections) { - c.feedforward(sum); - } - } - - // Draw it as a circle - void display() { - stroke(0); - strokeWeight(1); - // Brightness is mapped to sum - float b = map(sum,0,1,255,0); - fill(b); - ellipse(location.x, location.y, r, r); - - // Size shrinks down back to original dimensions - r = lerp(r,32,0.1); - } -} - diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde b/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde deleted file mode 100755 index 07bc45c54..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/Landscape.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// "Landscape" example - -class Landscape { - - int scl; // size of each cell - int w,h; // width and height of thingie - int rows, cols; // number of rows and columns - float zoff = 0.0; // perlin noise argument - float[][] z; // using an array to store all the height values - - Landscape(int scl_, int w_, int h_) { - scl = scl_; - w = w_; - h = h_; - cols = w/scl; - rows = h/scl; - z = new float[cols][rows]; - } - - - // Calculate height values (based off a neural netork) - void calculate(Network nn) { - float x = 0; - float dx = (float) 1.0 / cols; - for (int i = 0; i < cols; i++) - { - float y = 0; - float dy = (float) 1.0 / rows; - for (int j = 0; j < rows; j++) - { - float[] input = new float[2]; - input[0] = x; - input[1] = y; - float result = nn.feedForward(input); - z[i][j] = z[i][j]*0.95 + 0.05*(float)(result*280.0f-140.0); - y += dy; - } - x += dx; - } - - } - - // Render landscape as grid of quads - void render() { - // Every cell is an individual quad - // (could use quad_strip here, but produces funny results, investigate this) - for (int x = 0; x < z.length-1; x++) - { - for (int y = 0; y < z[x].length-1; y++) - { - // one quad at a time - // each quad's color is determined by the height value at each vertex - // (clean this part up) - noStroke(); - pushMatrix(); - beginShape(QUADS); - translate(x*scl-w/2,y*scl-h/2,0); - fill(z[x][y]+127,220); - vertex(0,0,z[x][y]); - fill(z[x+1][y]+127,220); - vertex(scl,0,z[x+1][y]); - fill(z[x+1][y+1]+127,220); - vertex(scl,scl,z[x+1][y+1]); - fill(z[x][y+1]+127,220); - vertex(0,scl,z[x][y+1]); - endShape(); - popMatrix(); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java deleted file mode 100644 index d8415d2a6..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Connection.java +++ /dev/null @@ -1,47 +0,0 @@ -// Daniel Shiffman -// The Nature of Code, Fall 2006 -// Neural Network - -// Class to describe a connection between two neurons - -package nn; - -public class Connection { - - private Neuron from; // Connection goes from. . . - private Neuron to; // To. . . - private float weight; // Weight of the connection. . . - - // Constructor builds a connection with a random weight - public Connection(Neuron a_, Neuron b_) { - from = a_; - to = b_; - weight = (float) Math.random()*2-1; - } - - // In case I want to set the weights manually, using this for testing - public Connection(Neuron a_, Neuron b_, float w) { - from = a_; - to = b_; - weight = w; - } - - public Neuron getFrom() { - return from; - } - - public Neuron getTo() { - return to; - } - - public float getWeight() { - return weight; - } - - // Changing the weight of the connection - public void adjustWeight(float deltaWeight) { - weight += deltaWeight; - } - - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java deleted file mode 100644 index 3c8d7945d..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/HiddenNeuron.java +++ /dev/null @@ -1,20 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -// Hidden Neuron Class -// So far not necessary to differentiate these - -package nn; - -public class HiddenNeuron extends Neuron { - - public HiddenNeuron() { - super(); - } - - public HiddenNeuron(int i) { - super(i); - } - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java deleted file mode 100644 index a2191632f..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/InputNeuron.java +++ /dev/null @@ -1,23 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -// Input Neuron Class -// Has additional functionality to receive beginning input - -package nn; - -public class InputNeuron extends Neuron { - public InputNeuron() { - super(); - } - - public InputNeuron(int i) { - super(i); - } - - public void input(float d) { - output = d; - } - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java deleted file mode 100644 index c0854712d..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Network.java +++ /dev/null @@ -1,143 +0,0 @@ -// Daniel Shiffman -// The Nature of Code, Fall 2006 -// Neural Network - -// Class to describe the entire network -// Arrays for input neurons, hidden neurons, and output neuron - -// Need to update this so that it would work with an array out outputs -// Rather silly that I didn't do this initially - -// Also need to build in a "Layer" class so that there can easily -// be more than one hidden layer - -package nn; - -import java.util.ArrayList; - -public class Network { - - // Layers - InputNeuron[] input; - HiddenNeuron[] hidden; - OutputNeuron output; - - public static final float LEARNING_CONSTANT = 0.5f; - - // Only One output now to start!!! (i can do better, really. . .) - // Constructor makes the entire network based on number of inputs & number of neurons in hidden layer - // Only One hidden layer!!! (fix this dood) - - public Network(int inputs, int hiddentotal) { - - input = new InputNeuron[inputs+1]; // Got to add a bias input - hidden = new HiddenNeuron[hiddentotal+1]; - - // Make input neurons - for (int i = 0; i < input.length-1; i++) { - input[i] = new InputNeuron(); - } - - // Make hidden neurons - for (int i = 0; i < hidden.length-1; i++) { - hidden[i] = new HiddenNeuron(); - } - - // Make bias neurons - input[input.length-1] = new InputNeuron(1); - hidden[hidden.length-1] = new HiddenNeuron(1); - - // Make output neuron - output = new OutputNeuron(); - - // Connect input layer to hidden layer - for (int i = 0; i < input.length; i++) { - for (int j = 0; j < hidden.length-1; j++) { - // Create the connection object and put it in both neurons - Connection c = new Connection(input[i],hidden[j]); - input[i].addConnection(c); - hidden[j].addConnection(c); - } - } - - // Connect the hidden layer to the output neuron - for (int i = 0; i < hidden.length; i++) { - Connection c = new Connection(hidden[i],output); - hidden[i].addConnection(c); - output.addConnection(c); - } - - } - - - public float feedForward(float[] inputVals) { - - // Feed the input with an array of inputs - for (int i = 0; i < inputVals.length; i++) { - input[i].input(inputVals[i]); - } - - // Have the hidden layer calculate its output - for (int i = 0; i < hidden.length-1; i++) { - hidden[i].calcOutput(); - } - - // Calculate the output of the output neuron - output.calcOutput(); - - // Return output - return output.getOutput(); - } - - public float train(float[] inputs, float answer) { - float result = feedForward(inputs); - - - // This is where the error correction all starts - // Derivative of sigmoid output function * diff between known and guess - float deltaOutput = result*(1-result) * (answer-result); - - - // BACKPROPOGATION - // This is easier b/c we just have one output - // Apply Delta to connections between hidden and output - ArrayList connections = output.getConnections(); - for (int i = 0; i < connections.size(); i++) { - Connection c = (Connection) connections.get(i); - Neuron neuron = c.getFrom(); - float output = neuron.getOutput(); - float deltaWeight = output*deltaOutput; - c.adjustWeight(LEARNING_CONSTANT*deltaWeight); - } - - // ADJUST HIDDEN WEIGHTS - for (int i = 0; i < hidden.length; i++) { - connections = hidden[i].getConnections(); - float sum = 0; - // Sum output delta * hidden layer connections (just one output) - for (int j = 0; j < connections.size(); j++) { - Connection c = (Connection) connections.get(j); - // Is this a connection from hidden layer to next layer (output)? - if (c.getFrom() == hidden[i]) { - sum += c.getWeight()*deltaOutput; - } - } - // Then adjust the weights coming in based: - // Above sum * derivative of sigmoid output function for hidden neurons - for (int j = 0; j < connections.size(); j++) { - Connection c = (Connection) connections.get(j); - // Is this a connection from previous layer (input) to hidden layer? - if (c.getTo() == hidden[i]) { - float output = hidden[i].getOutput(); - float deltaHidden = output * (1 - output); // Derivative of sigmoid(x) - deltaHidden *= sum; // Would sum for all outputs if more than one output - Neuron neuron = c.getFrom(); - float deltaWeight = neuron.getOutput()*deltaHidden; - c.adjustWeight(LEARNING_CONSTANT*deltaWeight); - } - } - } - - return result; - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java deleted file mode 100644 index 234780016..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/Neuron.java +++ /dev/null @@ -1,81 +0,0 @@ -//Daniel Shiffman -//The Nature of Code, Fall 2006 -//Neural Network - -//Generic Neuron Class -//Can be a bias neuron (true or false) - -package nn; - -import java.util.ArrayList; - -public class Neuron { - - protected float output; - protected ArrayList connections; - protected boolean bias = false; - - // A regular Neuron - public Neuron() { - output = 0; - // Using an arraylist to store list of connections to other neurons - connections = new ArrayList(); - bias = false; - } - - // Constructor for a bias neuron - public Neuron(int i) { - output = i; - connections = new ArrayList(); - bias = true; - } - - // Function to calculate output of this neuron - // Output is sum of all inputs*weight of connections - public void calcOutput() { - if (bias) { - // do nothing - } else { - float sum = 0; - float bias = 0; - //System.out.println("Looking through " + connections.size() + " connections"); - for (int i = 0; i < connections.size(); i++) { - Connection c = (Connection) connections.get(i); - Neuron from = c.getFrom(); - Neuron to = c.getTo(); - // Is this connection moving forward to us - // Ignore connections that we send our output to - if (to == this) { - // This isn't really necessary - // But I am treating the bias individually in case I need to at some point - if (from.bias) { - bias = from.getOutput()*c.getWeight(); - } else { - sum += from.getOutput()*c.getWeight(); - } - } - } - // Output is result of sigmoid function - output = f(bias+sum); - } - } - - void addConnection(Connection c) { - connections.add(c); - } - - float getOutput() { - return output; - } - - // Sigmoid function - public static float f(float x) { - return 1.0f / (1.0f + (float) Math.exp(-x)); - } - - public ArrayList getConnections() { - return connections; - } - - -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java b/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java deleted file mode 100644 index abe8daee4..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/code/src/OutputNeuron.java +++ /dev/null @@ -1,7 +0,0 @@ -package nn; - -public class OutputNeuron extends Neuron { - public OutputNeuron() { - super(); - } -} diff --git a/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde b/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde deleted file mode 100644 index dd73eef29..000000000 --- a/java/examples/Books/Nature of Code/chp10_nn/xor/xor.pde +++ /dev/null @@ -1,112 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// XOR Multi-Layered Neural Network Example -// Neural network code is all in the "code" folder - -import nn.*; - -ArrayList inputs; // List of training input values -Network nn; // Neural Network Object -int count; // Total training interations -Landscape land; // Solution space -float theta = 0.0; // Angle of rotation -PFont f; // Font - - -void setup() { - - size(400,400,P3D); - - // Create a landscape object - land = new Landscape(20,300,300); - - f = createFont("Courier",12,true); - - nn = new Network(2,4); - - // Create a list of 4 training inputs - inputs = new ArrayList(); - float[] input = new float[2]; - input[0] = 1; - input[1] = 0; - inputs.add((float []) input.clone()); - input[0] = 0; - input[1] = 1; - inputs.add((float []) input.clone()); - input[0] = 1; - input[1] = 1; - inputs.add((float []) input.clone()); - input[0] = 0; - input[1] = 0; - inputs.add((float []) input.clone()); -} - -void draw() { - - int trainingIterationsPerFrame = 5; - - for (int i = 0; i < trainingIterationsPerFrame; i++) { - // Pick a random training input - int pick = int(random(inputs.size())); - // Grab that input - float[] inp = (float[]) inputs.get(pick); - // Compute XOR - float known = 1; - if ((inp[0] == 1.0 && inp[1] == 1.0) || (inp[0] == 0 && inp[1] == 0)) known = 0; - // Train that sucker! - float result = nn.train(inp,known); - count++; - } - - // Ok, visualize the solution space - background(175); - pushMatrix(); - translate(width/2,height/2+20,-160); - rotateX(PI/3); - rotateZ(theta); - - // Put a little BOX on screen - pushMatrix(); - stroke(50); - noFill(); - translate(-10,-10,0); - box(280); - - // Draw the landscape - popMatrix(); - land.calculate(nn); - land.render(); - theta += 0.0025; - popMatrix(); - - // Display overal neural net stats - networkStatus(); - -} - - -void networkStatus() { - float mse = 0.0; - - textFont(f); - fill(0); - text("Your friendly neighborhood neural network solving XOR.",10,20); - text("Total iterations: " + count,10,40); - - for (int i = 0; i < inputs.size(); i++) { - float[] inp = (float[]) inputs.get(i); - float known = 1; - if ((inp[0] == 1.0 && inp[1] == 1.0) || (inp[0] == 0 && inp[1] == 0)) known = 0; - float result = nn.feedForward(inp); - //System.out.println("For: " + inp[0] + " " + inp[1] + ": " + result); - mse += (result - known)*(result - known); - } - - float rmse = sqrt(mse/4.0); - text("Root mean squared error: " + nf(rmse,1,5), 10,60); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde deleted file mode 100644 index 44b00fefe..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // The Mover tracks location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - // The Mover's maximum speed - float topspeed; - - Mover() { - // Start in the center - location = new PVector(width/2,height/2); - velocity = new PVector(0,0); - topspeed = 5; - } - - void update() { - - // Compute a vector that points from location to mouse - PVector mouse = new PVector(mouseX,mouseY); - PVector acceleration = PVector.sub(mouse,location); - // Set magnitude of acceleration - //acceleration.setMag(0.2); - acceleration.normalize(); - acceleration.mult(0.2); - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Limit the velocity by topspeed - velocity.limit(topspeed); - // Location changes by velocity - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde deleted file mode 100644 index baf4b6522..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_10_motion101_acceleration/NOC_1_10_motion101_acceleration.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Mover object -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - // Update the location - mover.update(); - // Display the Mover - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde deleted file mode 100644 index b0713e6ed..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/Mover.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // The Mover tracks location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - // The Mover's maximum speed - float topspeed; - - Mover() { - // Start in the center - location = new PVector(random(width),random(height)); - velocity = new PVector(0,0); - topspeed = 5; - } - - void update() { - - // Compute a vector that points from location to mouse - PVector mouse = new PVector(mouseX,mouseY); - PVector acceleration = PVector.sub(mouse,location); - // Set magnitude of acceleration - //acceleration.setMag(0.2); - acceleration.normalize(); - acceleration.mult(0.2); - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Limit the velocity by topspeed - velocity.limit(topspeed); - // Location changes by velocity - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127,200); - ellipse(location.x,location.y,48,48); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde deleted file mode 100644 index 40e9b48d6..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_11_motion101_acceleration_array/NOC_1_11_motion101_acceleration_array.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of the basics of motion with vector. -// A "Mover" object stores location, velocity, and acceleration as vectors -// The motion is controlled by affecting the acceleration (in this case towards the mouse) - -Mover[] movers = new Mover[20]; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(); - } -} - -void draw() { - - background(255); - - for (int i = 0; i < movers.length; i++) { - movers[i].update(); - movers[i].display(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde deleted file mode 100644 index 09b4224a8..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_1_bouncingball_novectors/NOC_1_1_bouncingball_novectors.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-1: Bouncing Ball, no vectors -float x = 100; -float y = 100; -float xspeed = 2.5; -float yspeed = 2; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - - - // Add the current speed to the location. - x = x + xspeed; - y = y + yspeed; - - if ((x > width) || (x < 0)) { - xspeed = xspeed * -1; - } - if ((y > height) || (y < 0)) { - yspeed = yspeed * -1; - } - - - // Display circle at x location - stroke(0); - strokeWeight(2); - fill(127); - ellipse(x, y, 48, 48); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde deleted file mode 100644 index 232de4c48..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_2_bouncingball_vectors/NOC_1_2_bouncingball_vectors.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-2: Bouncing Ball, with PVector! -PVector location; -PVector velocity; - -void setup() { - size(200,200); - background(255); - location = new PVector(100,100); - velocity = new PVector(2.5,5); -} - -void draw() { - noStroke(); - fill(255,10); - rect(0,0,width,height); - - // Add the current speed to the location. - location.add(velocity); - - if ((location.x > width) || (location.x < 0)) { - velocity.x = velocity.x * -1; - } - if ((location.y > height) || (location.y < 0)) { - velocity.y = velocity.y * -1; - } - - // Display circle at x location - stroke(0); - fill(175); - ellipse(location.x,location.y,16,16); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde deleted file mode 100644 index a9659a409..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_3_vector_subtraction/NOC_1_3_vector_subtraction.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-3: Vector subtraction - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - translate(width/2,height/2); - strokeWeight(2); - stroke(0); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde deleted file mode 100644 index 3f7f76b3f..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_4_vector_multiplication/NOC_1_4_vector_multiplication.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-4: Vector multiplication - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - // Multiplying a vector! The vector is now half its original size (multiplied by 0.5). - mouse.mult(0.5); - - translate(width/2,height/2); - strokeWeight(2); - stroke(0); - line(0,0,mouse.x,mouse.y); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde deleted file mode 100644 index 53d0b99a1..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_5_vector_magnitude/NOC_1_5_vector_magnitude.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example 1-5: Vector magnitude - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX,mouseY); - PVector center = new PVector(width/2,height/2); - mouse.sub(center); - - float m = mouse.mag(); - fill(0); - noStroke(); - rect(0,0,m,10); - - translate(width/2,height/2); - stroke(0); - strokeWeight(2); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde deleted file mode 100644 index 659d8a512..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_6_vector_normalize/NOC_1_6_vector_normalize.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of normalizing a vector. -// Normalizing a vector sets its length to 1. - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - // A vector that points to the mouse location - PVector mouse = new PVector(mouseX,mouseY); - // A vector that points to the center of the window - PVector center = new PVector(width/2,height/2); - // Subtract center from mouse which results in a vector that points from center to mouse - mouse.sub(center); - - // Normalize the vector - mouse.normalize(); - - // Multiply its length by 50 - mouse.mult(150); - - translate(width/2,height/2); - // Draw the resulting vector - stroke(0); - strokeWeight(2); - line(0,0,mouse.x,mouse.y); - -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde deleted file mode 100644 index 8d7abe902..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/Mover.pde +++ /dev/null @@ -1,43 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - - Mover() { - location = new PVector(random(width), random(height)); - velocity = new PVector(random(-2, 2), random(-2, 2)); - } - - void update() { - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde deleted file mode 100644 index 9f968a254..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_7_motion101/NOC_1_7_motion101.pde +++ /dev/null @@ -1,19 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde deleted file mode 100644 index fdf9f5093..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - acceleration = new PVector(-0.001, 0.01); - topspeed = 10; - } - - void update() { - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde deleted file mode 100644 index 3d1668104..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_8_motion101_acceleration/NOC_1_8_motion101_acceleration.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde deleted file mode 100644 index d5644bff2..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/Mover.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - topspeed = 6; - } - - void update() { - - acceleration = PVector.random2D(); - acceleration.mult(random(2)); - - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde b/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde deleted file mode 100644 index 30e22723f..000000000 --- a/java/examples/Books/Nature of Code/chp1_vectors/NOC_1_9_motion101_acceleration/NOC_1_9_motion101_acceleration.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - mover.update(); - mover.checkEdges(); - mover.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde deleted file mode 100644 index bff0c1f5c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Attractor.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector drag; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 10; - drag = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(0); - ellipse(location.x,location.y,mass*6,mass*6); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - drag.x = location.x-mx; - drag.y = location.y-my; - } - } - - void rollover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + drag.x; - location.y = mouseY + drag.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde deleted file mode 100644 index 03eefdbc6..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Exercise_2_10_attractrepel.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -Attractor a; - -float g = 1; - -void setup() { - size(800,200); - a = new Attractor(); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(4,12),random(width),random(height)); - } -} - -void draw() { - background(255); - - a.display(); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].repel(movers[i]); - movers[i].applyForce(force); - } - } - - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - movers[i].update(); - movers[i].display(); - } - - - -} - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde deleted file mode 100644 index 0725db4c9..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Exercise_2_10_attractrepel/Mover.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - PVector repel(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance,1.0,10000.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(-1*strength); // Get force vector --> magnitude * direction - return force; - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } - else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - location.y = height; - velocity.y *= -1; - } - else if (location.y < 0) { - location.y = 0; - velocity.y *= -1; - } - - } - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde b/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde deleted file mode 100644 index ac2636abd..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Extra_instantforce.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; - -float t = 0.0; - -void setup() { - size(640, 360); - m = new Mover(); -} - -void draw() { - background(255); - - // Perlin noise wind - float wx = map(noise(t),0,1,-1,1); - PVector wind = new PVector(wx, 0); - t += 0.01; - line(width/2,height/2,width/2+wind.x*100,height/2+wind.y*100); - m.applyForce(wind); - - // Gravity - PVector gravity = new PVector(0, 0.1); - //m.applyForce(gravity); - - // Shake force - //m.shake(); - - // Boundary force - if (m.location.x > width - 50) { - PVector boundary = new PVector(-1,0); - m.applyForce(boundary); - } else if (m.location.x < 50) { - PVector boundary = new PVector(1,0); - m.applyForce(boundary); - } - - - - - m.update(); - m.display(); - //m.checkEdges(); -} - -// Instant Force -void mousePressed() { - PVector cannon = PVector.random2D(); - cannon.mult(5); - m.applyForce(cannon); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde deleted file mode 100644 index 681cfed16..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/Extra_instantforce/Mover.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(width/2,height/2); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void shake() { - PVector force = PVector.random2D(); - force.mult(0.7); - applyForce(force); - - - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - - // Simple friction - velocity.mult(0.95); - - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde deleted file mode 100644 index a242a2ef2..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Attractor.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - float g; - - Attractor() { - location = new PVector(0,0); - mass = 20; - g = 0.4; - } - - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - stroke(255); - noFill(); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*2); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde deleted file mode 100644 index 5a5b3dcdf..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/Mover.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y, float z) { - mass = m; - location = new PVector(x,y,z); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(location.x,location.y,location.z); - sphere(mass*8); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde deleted file mode 100644 index 5faf4dca0..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_attraction_3D/NOC_02forces_many_attraction_3D.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -import processing.opengl.*; - -Mover[] movers = new Mover[10]; - -Attractor a; - -float angle = 0; - -void setup() { - size(800,200,OPENGL); - background(255); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(-width/2,width/2),random(-height/2,height/2),random(-100,100)); - } - a = new Attractor(); -} - -void draw() { - background(0); - sphereDetail(8); - lights(); - translate(width/2,height/2); - rotateY(angle); - - - a.display(); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } - - angle += 0.003; - -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde deleted file mode 100644 index ed666c5f0..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/Mover.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175, 200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - void boundaries() { - - float d = 50; - - PVector force = new PVector(0, 0); - - if (location.x < d) { - force.x = 1; - } - else if (location.x > width -d) { - force.x = -1; - } - - if (location.y < d) { - force.y = 1; - } - else if (location.y > height-d) { - force.y = -1; - } - - force.normalize(); - force.mult(0.1); - - applyForce(force); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde deleted file mode 100644 index caf6d8b63..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_02forces_many_mutual_boundaries/NOC_02forces_many_mutual_boundaries.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -float g = 0.4; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1,2),random(width),random(height)); - } -} - -void draw() { - background(255); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].attract(movers[i]); - movers[i].applyForce(force); - } - } - - movers[i].boundaries(); - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde deleted file mode 100644 index 839b1afdc..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(30,30); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,48,48); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde deleted file mode 100644 index 92713efaa..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_1_forces/NOC_2_1_forces.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; - -void setup() { - size(640,360); - m = new Mover(); -} - -void draw() { - background(255); - - PVector wind = new PVector(0.01,0); - PVector gravity = new PVector(0,0.1); - m.applyForce(wind); - m.applyForce(gravity); - - - m.update(); - m.display(); - m.checkEdges(); - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde deleted file mode 100644 index 6b008918c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde deleted file mode 100644 index db74a7634..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_2_forces_many/NOC_2_2_forces_many.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,4),0,0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01,0); - PVector gravity = new PVector(0,0.1); - - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde deleted file mode 100644 index 6b008918c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - velocity.x *= -1; - location.x = 0; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde deleted file mode 100644 index c3ecd8488..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_3_forces_many_realgravity/NOC_2_3_forces_many_realgravity.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -void setup() { - size(800, 200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), 0, 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde deleted file mode 100644 index 263724c51..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde deleted file mode 100644 index 02c417066..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_friction/NOC_2_4_forces_friction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[5]; - -void setup() { - size(383, 200); - randomSeed(1); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), random(width), 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - float c = 0.05; - PVector friction = movers[i].velocity.get(); - friction.mult(-1); - friction.normalize(); - friction.mult(c); - - movers[i].applyForce(friction); - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde deleted file mode 100644 index 263724c51..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/Mover.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x , float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(0,0); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,127); - ellipse(location.x,location.y,mass*16,mass*16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = width; - velocity.x *= -1; - } else if (location.x < 0) { - location.x = 0; - velocity.x *= -1; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde deleted file mode 100644 index 029236deb..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_4_forces_nofriction/NOC_2_4_forces_nofriction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[5]; - -void setup() { - size(383, 200); - randomSeed(1); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(1, 4), random(width), 0); - } -} - -void draw() { - background(255); - - for (int i = 0; i < movers.length; i++) { - - PVector wind = new PVector(0.01, 0); - PVector gravity = new PVector(0, 0.1*movers[i].mass); - - float c = 0.05; - PVector friction = movers[i].velocity.get(); - friction.mult(-1); - friction.normalize(); - friction.mult(c); - - //movers[i].applyForce(friction); - movers[i].applyForce(wind); - movers[i].applyForce(gravity); - - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } -} - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde deleted file mode 100644 index b0ea9b736..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Liquid.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - // Liquid class - class Liquid { - - - // Liquid is a rectangle - float x,y,w,h; - // Coefficient of drag - float c; - - Liquid(float x_, float y_, float w_, float h_, float c_) { - x = x_; - y = y_; - w = w_; - h = h_; - c = c_; - } - - // Is the Mover in the Liquid? - boolean contains(Mover m) { - PVector l = m.location; - if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) { - return true; - } - else { - return false; - } - } - - // Calculate drag force - PVector drag(Mover m) { - // Magnitude is coefficient * speed squared - float speed = m.velocity.mag(); - float dragMagnitude = c * speed * speed; - - // Direction is inverse of velocity - PVector dragForce = m.velocity.get(); - dragForce.mult(-1); - - // Scale according to magnitude - // dragForce.setMag(dragMagnitude); - dragForce.normalize(); - dragForce.mult(dragMagnitude); - return dragForce; - } - - void display() { - noStroke(); - fill(50); - rect(x,y,w,h); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde deleted file mode 100644 index 791e90954..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/Mover.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - - // Mass is tied to size - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - // Newton's 2nd law: F = M * A - // or A = F / M - void applyForce(PVector force) { - // Divide by mass - PVector f = PVector.div(force, mass); - // Accumulate all forces in acceleration - acceleration.add(f); - } - - void update() { - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Location changes by velocity - location.add(velocity); - // We must clear acceleration each frame - acceleration.mult(0); - } - - // Draw Mover - void display() { - stroke(0); - strokeWeight(2); - fill(127, 200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - // Bounce off bottom of window - void checkEdges() { - if (location.y > height) { - velocity.y *= -0.9; // A little dampening when hitting the bottom - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde deleted file mode 100644 index ff9573d6d..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance/NOC_2_5_fluidresistance.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Forces (Gravity and Fluid Resistence) with Vectors - -// Demonstration of multiple force acting on bodies (Mover class) -// Bodies experience gravity continuously -// Bodies experience fluid resistance when in "water" - -// Five moving bodies -Mover[] movers = new Mover[11]; - -// Liquid -Liquid liquid; - -void setup() { - size(800, 200); - reset(); - // Create liquid object - liquid = new Liquid(0, height/2, width, height/2, 0.1); -} - -void draw() { - background(255); - - // Draw water - liquid.display(); - - for (int i = 0; i < movers.length; i++) { - - // Is the Mover in the liquid? - if (liquid.contains(movers[i])) { - // Calculate drag force - PVector dragForce = liquid.drag(movers[i]); - // Apply drag force to Mover - movers[i].applyForce(dragForce); - } - - // Gravity is scaled by mass here! - PVector gravity = new PVector(0, 0.1*movers[i].mass); - // Apply gravity - movers[i].applyForce(gravity); - - // Update and display - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - - fill(0); - text("click mouse to reset",10,30); - -} - -void mousePressed() { - reset(); -} - -// Restart all the Mover objects randomly -void reset() { - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.5, 3), 40+i*70, 0); - } -} - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde deleted file mode 100644 index bce05cc7c..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Liquid.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - // Liquid class - class Liquid { - - - // Liquid is a rectangle - float x,y,w,h; - // Coefficient of drag - float c; - - Liquid(float x_, float y_, float w_, float h_, float c_) { - x = x_; - y = y_; - w = w_; - h = h_; - c = c_; - } - - // Is the Mover in the Liquid? - boolean contains(Mover m) { - PVector l = m.location; - if (l.x > x && l.x < x + w && l.y > y && l.y < y + h) { - return true; - } - else { - return false; - } - } - - // Calculate drag force - PVector drag(Mover m) { - // Magnitude is coefficient * speed squared - float speed = m.velocity.mag(); - float dragMagnitude = c * speed * speed; - - // Direction is inverse of velocity - PVector dragForce = m.velocity.get(); - dragForce.mult(-1); - - // Scale according to magnitude - // dragForce.setMag(dragMagnitude); - dragForce.normalize(); - dragForce.mult(dragMagnitude); - return dragForce; - } - - void display() { - noStroke(); - fill(50); - rect(x,y,w,h); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde deleted file mode 100644 index d45e3b664..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/Mover.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - // location, velocity, and acceleration - PVector location; - PVector velocity; - PVector acceleration; - - // Mass is tied to size - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - // Newton's 2nd law: F = M * A - // or A = F / M - void applyForce(PVector force) { - // Divide by mass - PVector f = PVector.div(force, mass); - // Accumulate all forces in acceleration - acceleration.add(f); - } - - void update() { - - // Velocity changes according to acceleration - velocity.add(acceleration); - // Location changes by velocity - location.add(velocity); - // We must clear acceleration each frame - acceleration.mult(0); - } - - // Draw Mover - void display() { - stroke(0); - strokeWeight(2*2.25); - fill(127,200); - ellipse(location.x, location.y, mass*16, mass*16); - } - - // Bounce off bottom of window - void checkEdges() { - if (location.y > height) { - velocity.y *= -0.9; // A little dampening when hitting the bottom - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde deleted file mode 100644 index 99d47915b..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_5_fluidresistance_sequence/NOC_2_5_fluidresistance_sequence.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Forces (Gravity and Fluid Resistence) with Vectors - -// Demonstration of multiple force acting on bodies (Mover class) -// Bodies experience gravity continuously -// Bodies experience fluid resistance when in "water" - -// Five moving bodies -Mover[] movers = new Mover[5]; - -// Liquid -Liquid liquid; - -void setup() { - size(450, 450); - randomSeed(1); - reset(); - // Create liquid object - liquid = new Liquid(0, height/2, width, height/2, 0.1); -} - -void draw() { - background(255); - - // Draw water - liquid.display(); - - for (int i = 0; i < movers.length; i++) { - - // Is the Mover in the liquid? - if (liquid.contains(movers[i])) { - // Calculate drag force - PVector dragForce = liquid.drag(movers[i]); - // Apply drag force to Mover - movers[i].applyForce(dragForce); - } - - // Gravity is scaled by mass here! - PVector gravity = new PVector(0, 0.1*movers[i].mass); - // Apply gravity - movers[i].applyForce(gravity); - - // Update and display - movers[i].update(); - movers[i].display(); - movers[i].checkEdges(); - } - - fill(255); - //text("click mouse to reset",10,30); - - if (frameCount % 20 == 0) saveFrame("ch2_05_####.png"); -} - -void mousePressed() { - reset(); -} - -// Restart all the Mover objects randomly -void reset() { - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.5*2.25,3*2.25), 20*2.25+i*40*2.25, 0); - } -} - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde deleted file mode 100644 index 7c35ead44..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/Mover.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(400,50); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x,location.y,16,16); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde deleted file mode 100644 index d2ab1284a..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_6_attraction/NOC_2_6_attraction.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; -Attractor a; - -void setup() { - size(640,360); - m = new Mover(); - a = new Attractor(); -} - -void draw() { - background(255); - - PVector force = a.attract(m); - m.applyForce(force); - m.update(); - - a.drag(); - a.hover(mouseX,mouseY); - - a.display(); - m.display(); -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde deleted file mode 100644 index 245dd0c3e..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/Mover.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(1, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0,100); - ellipse(location.x, location.y, mass*25, mass*25); - } -} - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde deleted file mode 100644 index e7f5b1c5b..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_7_attraction_many/NOC_2_7_attraction_many.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[10]; - -Attractor a; - -void setup() { - size(800, 200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1, 2), random(width), random(height)); - } - a = new Attractor(); - } - -void draw() { - background(255); - - a.display(); - a.drag(); - a.hover(mouseX, mouseY); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } -} - -void mousePressed() { - a.clicked(mouseX, mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde deleted file mode 100644 index 63b9dbc67..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/Mover.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x, y); - velocity = new PVector(0, 0); - acceleration = new PVector(0, 0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force, mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(0, 100); - ellipse(location.x, location.y, mass*24, mass*24); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction - - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - -} - - - diff --git a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde b/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde deleted file mode 100644 index 3a6ef45a8..000000000 --- a/java/examples/Books/Nature of Code/chp2_forces/NOC_2_8_mutual_attraction/NOC_2_8_mutual_attraction.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -float g = 0.4; - -void setup() { - size(800,200); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(width),random(height)); - } -} - -void draw() { - background(255); - - - for (int i = 0; i < movers.length; i++) { - for (int j = 0; j < movers.length; j++) { - if (i != j) { - PVector force = movers[j].attract(movers[i]); - movers[i].applyForce(force); - } - } - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde deleted file mode 100644 index 2636374b8..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AdditiveWave/AdditiveWave.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -// Maybe better for this answer to be OOP??? - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(640,360); - colorMode(RGB, 255, 255, 255, 100); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - noStroke(); - fill(255,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde deleted file mode 100644 index 8f58c9712..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/AttractionArrayWithOscillation.pde +++ /dev/null @@ -1,46 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction Array with Oscillating objects around each Crawler - -// Click and drag attractive body to move throughout space - -Crawler[] crawlers = new Crawler[6]; -Attractor a; - -void setup() { - size(640,360); - // Some random bodies - for (int i = 0; i < crawlers.length; i++) { - crawlers[i] = new Crawler(); - } - // Create an attractive body - a = new Attractor(new PVector(width/2,height/2),20,0.4); -} - -void draw() { - background(255); - a.rollover(mouseX,mouseY); - a.go(); - - for (int i = 0; i < crawlers.length; i++) { - // Calculate a force exerted by "attractor" on "Crawler" - PVector f = a.attract(crawlers[i]); - // Apply that force to the Crawler - crawlers[i].applyForce(f); - // Update and render - crawlers[i].update(); - crawlers[i].display(); - } - - -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde deleted file mode 100644 index 4e97f0cab..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Attractor.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector loc; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector drag; // holds the offset for when object is clicked on - - Attractor(PVector l_,float m_, float g_) { - loc = l_.get(); - mass = m_; - G = g_; - drag = new PVector(0.0,0.0); - } - - void go() { - render(); - drag(); - } - - PVector attract(Crawler c) { - PVector dir = PVector.sub(loc,c.loc); // Calculate direction of force - float d = dir.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - dir.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float force = (G * mass * c.mass) / (d * d); // Calculate gravitional force magnitude - dir.mult(force); // Get force vector --> magnitude * direction - return dir; - } - - // Method to display - void render() { - ellipseMode(CENTER); - stroke(0,100); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,50); - ellipse(loc.x,loc.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,loc.x,loc.y); - if (d < mass) { - dragging = true; - drag.x = loc.x-mx; - drag.y = loc.y-my; - } - } - - void rollover(int mx, int my) { - float d = dist(mx,my,loc.x,loc.y); - if (d < mass) { - rollover = true; - } else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - loc.x = mouseX + drag.x; - loc.y = mouseY + drag.y; - } - } - -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde deleted file mode 100644 index 7c03641ee..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Crawler.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class to describe a thing in our world, has vectors for location, velocity, and acceleration -// Also includes scalar values for mass, maximum velocity, and elasticity - -class Crawler { - PVector loc; - PVector vel; - PVector acc; - float mass; - - Oscillator osc; - - Crawler() { - acc = new PVector(); - vel = new PVector(random(-1,1),random(-1,1)); - loc = new PVector(random(width),random(height)); - mass = random(8,16); - osc = new Oscillator(mass*2); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - // Multiplying by 0 sets the all the components to 0 - acc.mult(0); - - osc.update(vel.mag()/10); - } - - // Method to display - void display() { - float angle = vel.heading2D(); - pushMatrix(); - translate(loc.x,loc.y); - rotate(angle); - ellipseMode(CENTER); - stroke(0); - fill(175,100); - ellipse(0,0,mass*2,mass*2); - - osc.display(loc); - popMatrix(); - - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde b/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde deleted file mode 100644 index 2f4d4506d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/AttractionArrayWithOscillation/Oscillator.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction Array with Oscillating objects around each thing - -class Oscillator { - - // Because we are going to oscillate along the x and y axis we can use PVector for two angles, amplitudes, etc.! - float theta; - float amplitude; - - Oscillator(float r) { - - // Initialize randomly - theta = 0; - amplitude = r; - - } - - // Update theta and offset - void update(float thetaVel) { - theta += thetaVel; - } - - // Display based on a location - void display(PVector loc) { - float x = map(cos(theta),-1,1,0,amplitude); - - stroke(0); - fill(50); - line(0,0,x,0); - ellipse(x,0,8,8); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde deleted file mode 100644 index 590ea83ab..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_01_exercise_baton/Exercise_3_01_exercise_baton.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; - -void setup() { - size(750, 150); - smooth(); -} - -void draw() { - background(255); - - fill(127); - stroke(0); - rectMode(CENTER); - translate(width/2, height/2); - rotate(angle); - line(-50, 0, 50, 0); - stroke(0); - strokeWeight(2); - fill(127); - ellipse(50, 0, 16, 16); - ellipse(-50, 0, 16, 16); - angle += 0.05; -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde deleted file mode 100644 index 80a9ca8ba..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/CannonBall.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class CannonBall { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r = 8; - - float topspeed = 10; - - CannonBall(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - } - - void applyForce(PVector force) { - acceleration.add(force); - } - - - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y); - ellipse(0,0,r*2,r*2); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde deleted file mode 100644 index 72313eaa9..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_03_cannon/Exercise_3_03_cannon.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - -// All of this stuff should go into a Cannon class -float angle = -PI/4; -PVector location = new PVector(50, 300); -boolean shot = false; - -CannonBall ball; - -void setup() { - size(640, 360); - ball = new CannonBall(location.x, location.y); -} - -void draw() { - background(255); - - pushMatrix(); - translate(location.x, location.y); - rotate(angle); - rect(0, -5, 50, 10); - popMatrix(); - - if (shot) { - PVector gravity = new PVector(0, 0.2); - ball.applyForce(gravity); - ball.update(); - } - ball.display(); - - if (ball.location.y > height) { - ball = new CannonBall(location.x, location.y); - shot = false; - } -} - -void keyPressed() { - if (key == CODED && keyCode == RIGHT) { - angle += 0.1; - } - else if (key == CODED && keyCode == LEFT) { - angle -= 0.1; - } - else if (key == ' ') { - shot = true; - PVector force = PVector.fromAngle(angle); - force.mult(10); - ball.applyForce(force); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde deleted file mode 100644 index 90b7fea95..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_04_spiral/Exercise_3_04_spiral.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Polar coordinate, radius now starts at 0 to spiral outwards -float r = 0; -float theta = 0; - -void setup() { - size(750,200); - background(255); - smooth(); -} - -void draw() { - // Polar to Cartesian conversion - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw an ellipse at x,y - noStroke(); - fill(0); - // Adjust for center of window - ellipse(x+width/2, y+height/2, 16, 16); - - // Increment the angle - theta += 0.01; - // Increment the radius - r += 0.05; -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde deleted file mode 100644 index d0340916f..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Exercise_3_05_asteroids.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids exercise - -// Mover object -Spaceship ship; - -void setup() { - size(640, 360); - ship = new Spaceship(); -} - -void draw() { - background(255); - - // Update location - ship.update(); - // Wrape edges - ship.wrapEdges(); - // Draw ship - ship.display(); - - - fill(0); - //text("left right arrows to turn, z to thrust",10,height-5); - - // Turn or thrust the ship depending on what key is pressed - if (keyPressed) { - if (key == CODED && keyCode == LEFT) { - ship.turn(-0.03); - } else if (key == CODED && keyCode == RIGHT) { - ship.turn(0.03); - } else if (key == 'z' || key == 'Z') { - ship.thrust(); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde deleted file mode 100644 index 3a8682da7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_05_asteroids/Spaceship.pde +++ /dev/null @@ -1,99 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids - -class Spaceship { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Arbitrary damping to slow down ship - float damping = 0.995; - float topspeed = 6; - - // Variable for heading! - float heading = 0; - - // Size - float r = 16; - - // Are we thrusting (to color boosters) - boolean thrusting = false; - - Spaceship() { - location = new PVector(width/2,height/2); - velocity = new PVector(); - acceleration = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - //f.div(mass); // ignoring mass right now - acceleration.add(f); - } - - // Turn changes angle - void turn(float a) { - heading += a; - } - - // Apply a thrust force - void thrust() { - // Offset the angle since we drew the ship vertically - float angle = heading - PI/2; - // Polar to cartesian for force vector! - PVector force = new PVector(cos(angle),sin(angle)); - force.mult(0.1); - applyForce(force); - // To draw booster - thrusting = true; - } - - void wrapEdges() { - float buffer = r*2; - if (location.x > width + buffer) location.x = -buffer; - else if (location.x < -buffer) location.x = width+buffer; - if (location.y > height + buffer) location.y = -buffer; - else if (location.y < -buffer) location.y = height+buffer; - } - - - // Draw the ship - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y+r); - rotate(heading); - fill(175); - if (thrusting) fill(255,0,0); - // Booster rockets - rect(-r/2,r,r/3,r/2); - rect(r/2,r,r/3,r/2); - fill(175); - // A triangle - beginShape(); - vertex(-r,r); - vertex(0,-r); - vertex(r,r); - endShape(CLOSE); - rectMode(CENTER); - popMatrix(); - - thrusting = false; - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde deleted file mode 100644 index f8b759970..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Exercise_3_10_OOPWave.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Sine Wave - -// Two wave objects -Wave wave0; -Wave wave1; - -void setup() { - size(750,200); - // Initialize a wave with starting point, width, amplitude, and period - wave0 = new Wave(new PVector(50,75),100,20,500); - wave1 = new Wave(new PVector(300,100),300,40,220); - -} - -void draw() { - background(255); - - // Update and display waves - wave0.calculate(); - wave0.display(); - - wave1.calculate(); - wave1.display(); - - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde deleted file mode 100644 index df88f7cd0..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_10_OOPWave/Wave.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Wave { - - int xspacing = 8; // How far apart should each horizontal location be spaced - int w; // Width of entire wave - - PVector origin; // Where does the wave's first point start - float theta = 0.0; // Start angle at 0 - float amplitude; // Height of wave - float period; // How many pixels before the wave repeats - float dx; // Value for incrementing X, to be calculated as a function of period and xspacing - float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - - Wave(PVector o, int w_, float a, float p) { - origin = o.get(); - w = w_; - period = p; - amplitude = a; - dx = (TWO_PI / period) * xspacing; - yvalues = new float[w/xspacing]; - } - - - void calculate() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // For every x value, calculate a y value with sine function - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = sin(x)*amplitude; - x+=dx; - } - } - - void display() { - // A simple way to draw the wave with an ellipse at each location - for (int x = 0; x < yvalues.length; x++) { - stroke(0); - fill(0,50); - ellipseMode(CENTER); - ellipse(origin.x+x*xspacing,origin.y+yvalues[x],48,48); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde deleted file mode 100644 index ccf0975a3..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_11_AdditiveWave/Exercise_3_11_AdditiveWave.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(750,200); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(255); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - stroke(0); - fill(127,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],48,48); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde deleted file mode 100644 index 9f0d74795..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Exercise_3_16_springs.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob b1; -Bob b2; -Bob b3; - -Spring s1; -Spring s2; -Spring s3; - -void setup() { - size(640, 360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - b1 = new Bob(width/2, 100); - b2 = new Bob(width/2, 200); - b3 = new Bob(width/2, 300); - - s1 = new Spring(b1,b2,100); - s2 = new Spring(b2,b3,100); - s3 = new Spring(b1,b3,100); -} - -void draw() { - background(255); - - s1.update(); - s2.update(); - s3.update(); - - s1.display(); - s2.display(); - s3.display(); - - b1.update(); - b1.display(); - b2.update(); - b2.display(); - b3.update(); - b3.display(); - - b1.drag(mouseX, mouseY); -} - - - -void mousePressed() { - b1.clicked(mouseX, mouseY); -} - -void mouseReleased() { - b1.stopDragging(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde deleted file mode 100644 index 368aa20d2..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 12; - - // Arbitrary damping to simulate friction / drag - float damping = 0.95; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde deleted file mode 100644 index 0f4060e13..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs/Spring.pde +++ /dev/null @@ -1,52 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - Bob a; - Bob b; - - // Constructor - Spring(Bob a_, Bob b_, int l) { - a = a_; - b = b_; - len = l; - } - - // Calculate spring force - void update() { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(a.location, b.location); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - a.applyForce(force); - force.mult(-1); - b.applyForce(force); - } - - - void display() { - strokeWeight(2); - stroke(0); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde deleted file mode 100644 index 01a0bcad4..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Exercise_3_16_springs_array.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob[] bobs = new Bob[5]; - -Spring[] springs = new Spring[4]; - -void setup() { - size(640, 360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - for (int i = 0; i < bobs.length; i++) { - bobs[i] = new Bob(width/2, i*40); - } - for (int i = 0; i < springs.length; i++) { - springs[i] = new Spring(bobs[i], bobs[i+1],40); - } -} - -void draw() { - background(255); - - for (Spring s : springs) { - s.update(); - s.display(); - } - - for (Bob b : bobs) { - b.update(); - b.display(); - b.drag(mouseX, mouseY); - } -} - - - -void mousePressed() { - for (Bob b : bobs) { - b.clicked(mouseX, mouseY); - } -} - -void mouseReleased() { - for (Bob b : bobs) { - b.stopDragging(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde deleted file mode 100644 index 7f5e0fcc5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 8; - - // Arbitrary damping to simulate friction / drag - float damping = 0.95; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175,120); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde deleted file mode 100644 index 0f4060e13..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/Exercise_3_16_springs_array/Spring.pde +++ /dev/null @@ -1,52 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - Bob a; - Bob b; - - // Constructor - Spring(Bob a_, Bob b_, int l) { - a = a_; - b = b_; - len = l; - } - - // Calculate spring force - void update() { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(a.location, b.location); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - a.applyForce(force); - force.mult(-1); - b.applyForce(force); - } - - - void display() { - strokeWeight(2); - stroke(0); - line(a.location.x, a.location.y, b.location.x, b.location.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde deleted file mode 100644 index 556605cb7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Attractor.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - float G; // Gravitational Constant - PVector location; // Location - boolean dragging = false; // Is the object being dragged? - boolean rollover = false; // Is the mouse over the ellipse? - PVector dragOffset; // holds the offset for when object is clicked on - - Attractor() { - location = new PVector(width/2,height/2); - mass = 20; - G = 1; - dragOffset = new PVector(0.0,0.0); - } - - PVector attract(Mover m) { - PVector force = PVector.sub(location,m.location); // Calculate direction of force - float d = force.mag(); // Distance between objects - d = constrain(d,5.0,25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (G * mass * m.mass) / (d * d); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - ellipseMode(CENTER); - strokeWeight(4); - stroke(0); - if (dragging) fill (50); - else if (rollover) fill(100); - else fill(175,200); - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void hover(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - rollover = true; - } - else { - rollover = false; - } - } - - void stopDragging() { - dragging = false; - } - - - - void drag() { - if (dragging) { - location.x = mouseX + dragOffset.x; - location.y = mouseY + dragOffset.y; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde deleted file mode 100644 index 25f1b1ca5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/ExtraOscillatingBody.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover m; -Attractor a; - -void setup() { - size(640,360); - m = new Mover(); - a = new Attractor(); -} - -void draw() { - background(255); - - PVector force = a.attract(m); - m.applyForce(force); - m.update(); - - a.drag(); - a.hover(mouseX,mouseY); - - a.display(); - m.display(); - -} - -void mousePressed() { - a.clicked(mouseX,mouseY); -} - -void mouseReleased() { - a.stopDragging(); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde deleted file mode 100644 index 00850bc1c..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingBody/Mover.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - Mover() { - location = new PVector(400,50); - velocity = new PVector(1,0); - acceleration = new PVector(0,0); - mass = 1; - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(127); - pushMatrix(); - translate(location.x,location.y); - float heading = velocity.heading(); - rotate(heading); - ellipse(0,0,16,16); - rectMode(CENTER); - // "20" should be a variable that is oscillating - // with sine function - rect(20,0,10,10); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - velocity.y *= -1; - location.y = height; - } - - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde b/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde deleted file mode 100644 index 68b1b2074..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/ExtraOscillatingUpAndDown/ExtraOscillatingUpAndDown.pde +++ /dev/null @@ -1,15 +0,0 @@ -float angle = 0; -void setup() { - size(400,400); -} - -void draw() { - background(255); - float y = 100*sin(angle); - angle += 0.02; - - fill(127); - translate(width/2,height/2); - line(0,0,0,y); - ellipse(0,y,16,16); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde b/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde deleted file mode 100644 index 4a53d917f..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/MultipleOscillations/MultipleOscillations.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle1 = 0; -float aVelocity1 = 0.01; -float amplitude1 = 300; - -float angle2 = 0; -float aVelocity2 = 0.3; -float amplitude2 = 10; - - -void setup() { - size(640,360); -} - -void draw() { - background(255); - - float x = 0; - x += amplitude1 * cos(angle1); - x += amplitude2 * sin(angle2); - - angle1 += aVelocity1; - angle2 += aVelocity2; - - ellipseMode(CENTER); - stroke(0); - fill(175); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde deleted file mode 100644 index 4645efce7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_03spring_exercise_sine/NOC_03spring_exercise_sine.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0.05; - -void setup() { - size(640,360); - smooth(); -} - -void draw() { - background(255); - - float x = width/2; - float y = map(sin(angle),-1,1,50,250); - angle += aVelocity; - - ellipseMode(CENTER); - stroke(0); - fill(175); - line(x,0,x,y); - ellipse(x,y,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde deleted file mode 100644 index e36c11dd8..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_01_angular_motion/NOC_3_01_angular_motion.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0; -float aAcceleration = 0.0001; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - - - fill(127); - stroke(0); - - translate(width/2, height/2); - rectMode(CENTER); - rotate(angle); - stroke(0); - strokeWeight(2); - fill(127); - line(-60, 0, 60, 0); - ellipse(60, 0, 16, 16); - ellipse(-60, 0, 16, 16); - - angle += aVelocity; - aVelocity += aAcceleration; -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde deleted file mode 100644 index c7c457db7..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Attractor.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Attraction - -// A class for a draggable attractive body in our world - -class Attractor { - float mass; // Mass, tied to size - PVector location; // Location - float g; - - Attractor() { - location = new PVector(width/2, height/2); - mass = 20; - g = 0.4; - } - - - PVector attract(Mover m) { - PVector force = PVector.sub(location, m.location); // Calculate direction of force - float distance = force.mag(); // Distance between objects - distance = constrain(distance, 5.0, 25.0); // Limiting the distance to eliminate "extreme" results for very close or very far objects - force.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - float strength = (g * mass * m.mass) / (distance * distance); // Calculate gravitional force magnitude - force.mult(strength); // Get force vector --> magnitude * direction - return force; - } - - // Method to display - void display() { - stroke(0); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 48, 48); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde deleted file mode 100644 index be9646c09..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/Mover.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float mass; - - float angle = 0; - float aVelocity = 0; - float aAcceleration = 0; - - Mover(float m, float x, float y) { - mass = m; - location = new PVector(x,y); - velocity = new PVector(random(-1,1),random(-1,1)); - acceleration = new PVector(0,0); - } - - void applyForce(PVector force) { - PVector f = PVector.div(force,mass); - acceleration.add(f); - } - - void update() { - - velocity.add(acceleration); - location.add(velocity); - - aAcceleration = acceleration.x / 10.0; - aVelocity += aAcceleration; - aVelocity = constrain(aVelocity,-0.1,0.1); - angle += aVelocity; - - acceleration.mult(0); - } - - void display() { - stroke(0); - fill(175,200); - rectMode(CENTER); - pushMatrix(); - translate(location.x,location.y); - rotate(angle); - rect(0,0,mass*16,mass*16); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde deleted file mode 100644 index 4d4302aff..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_02_forces_angular_motion/NOC_3_02_forces_angular_motion.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover[] movers = new Mover[20]; - -Attractor a; - -void setup() { - size(800,200); - background(255); - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(0.1,2),random(width),random(height)); - } - a = new Attractor(); -} - -void draw() { - background(255); - - a.display(); - - for (int i = 0; i < movers.length; i++) { - PVector force = a.attract(movers[i]); - movers[i].applyForce(force); - - movers[i].update(); - movers[i].display(); - } - -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde deleted file mode 100644 index 399d93a4d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/Mover.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Mover { - - PVector location; - PVector velocity; - PVector acceleration; - float topspeed; - - float xoff, yoff; - - float r = 16; - - Mover() { - location = new PVector(width/2, height/2); - velocity = new PVector(0, 0); - topspeed = 4; - xoff = 1000; - yoff = 0; - } - - void update() { - - PVector mouse = new PVector(mouseX, mouseY); - PVector dir = PVector.sub(mouse, location); - dir.normalize(); - dir.mult(0.5); - acceleration = dir; - - velocity.add(acceleration); - velocity.limit(topspeed); - location.add(velocity); - } - - void display() { - float theta = velocity.heading2D(); - - stroke(0); - strokeWeight(2); - fill(127); - pushMatrix(); - rectMode(CENTER); - translate(location.x, location.y); - rotate(theta); - rect(0, 0, 30, 10); - popMatrix(); - } - - void checkEdges() { - - if (location.x > width) { - location.x = 0; - } - else if (location.x < 0) { - location.x = width; - } - - if (location.y > height) { - location.y = 0; - } - else if (location.y < 0) { - location.y = height; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde deleted file mode 100644 index df09af915..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_03_pointing_velocity/NOC_3_03_pointing_velocity.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Mover mover; - -void setup() { - size(800,200); - mover = new Mover(); -} - -void draw() { - background(255); - - mover.update(); - mover.checkEdges(); - mover.display(); -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde deleted file mode 100644 index 8be1f3bd1..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian/NOC_3_04_PolarToCartesian.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// PolarToCartesian -// Convert a polar coordinate (r,theta) to cartesian (x,y): -// x = r * cos(theta) -// y = r * sin(theta) - -float r; -float theta; - - -void setup() { - size(800, 200); - // Initialize all values - r = height * 0.45; - theta = 0; -} - -void draw() { - - background(255); - - // Translate the origin point to the center of the screen - translate(width/2, height/2); - - // Convert polar to cartesian - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw the ellipse at the cartesian coordinate - ellipseMode(CENTER); - fill(127); - stroke(0); - strokeWeight(2); - line(0,0,x,y); - ellipse(x, y, 48, 48); - - // Increase the angle over time - theta += 0.02; - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde deleted file mode 100644 index 928afe73a..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_04_PolarToCartesian_trail/NOC_3_04_PolarToCartesian_trail.pde +++ /dev/null @@ -1,52 +0,0 @@ -/** - * PolarToCartesian - * by Daniel Shiffman. - * - * Convert a polar coordinate (r,theta) to cartesian (x,y): - * x = r * cos(theta) - * y = r * sin(theta) - */ - -float r; -float theta; - - -void setup() { - size(800, 200); - background(255); - // Initialize all values - r = height * 0.45; - theta = 0; -} - -void draw() { - - //background(255); - noStroke(); - fill(255,5); - rect(0,0,width,height); - - // Translate the origin point to the center of the screen - translate(width/2, height/2); - - // Convert polar to cartesian - float x = r * cos(theta); - float y = r * sin(theta); - - // Draw the ellipse at the cartesian coordinate - ellipseMode(CENTER); - fill(127); - stroke(0); - strokeWeight(2); - line(0,0,x,y); - ellipse(x, y, 48, 48); - - // Increase the angle over time - theta += 0.02; - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde deleted file mode 100644 index e2830e6ca..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_05_simple_harmonic_motion/NOC_3_05_simple_harmonic_motion.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(800,200); -} - -void draw() { - background(255); - - float period = 120; - float amplitude = 300; - // Calculating horizontal location according to formula for simple harmonic motion - float x = amplitude * cos(TWO_PI * frameCount / period); - stroke(0); - strokeWeight(2); - fill(127); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,48,48); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde deleted file mode 100644 index 4ab3782c0..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_06_simple_harmonic_motion/NOC_3_06_simple_harmonic_motion.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float aVelocity = 0.03; - -void setup() { - size(640,360); - - smooth(); -} - -void draw() { - background(255); - - float amplitude = 300; - float x = amplitude * cos(angle); - angle += aVelocity; - - ellipseMode(CENTER); - stroke(0); - fill(175); - translate(width/2,height/2); - line(0,0,x,0); - ellipse(x,0,20,20); -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde deleted file mode 100644 index 20af612ed..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/NOC_3_07_oscillating_objects.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An array of objects -Oscillator[] oscillators = new Oscillator[10]; - -void setup() { - size(800,200); - smooth(); - // Initialize all objects - for (int i = 0; i < oscillators.length; i++) { - oscillators[i] = new Oscillator(); - } - background(255); -} - -void draw() { - background(255); - // Run all objects - for (int i = 0; i < oscillators.length; i++) { - oscillators[i].oscillate(); - oscillators[i].display(); - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde deleted file mode 100644 index da9a7d6ca..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_07_oscillating_objects/Oscillator.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Oscillator { - - PVector angle; - PVector velocity; - PVector amplitude; - - Oscillator() { - angle = new PVector(); - velocity = new PVector(random(-0.05, 0.05), random(-0.05, 0.05)); - amplitude = new PVector(random(20,width/2), random(20,height/2)); - } - - void oscillate() { - angle.add(velocity); - } - - void display() { - - float x = sin(angle.x)*amplitude.x; - float y = sin(angle.y)*amplitude.y; - - pushMatrix(); - translate(width/2, height/2); - stroke(0); - strokeWeight(2); - fill(127,127); - line(0, 0, x, y); - ellipse(x, y, 32, 32); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde deleted file mode 100644 index 1149e065d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_08_static_wave_lines/NOC_3_08_static_wave_lines.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float angle = 0; -float angleVel = 0.1; - -size(800,200); -background(255); -stroke(0); -strokeWeight(2); -noFill(); - -beginShape(); -for (int x = 0; x <= width; x += 5) { - float y = map(sin(angle),-1,1,0,height); - vertex(x,y); - angle +=angleVel; -} -endShape(); - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde deleted file mode 100644 index fd7f4bc7b..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_exercise_additive_wave/NOC_3_09_exercise_additive_wave.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Wave -// Create a more complex wave by adding two waves together. - -// Maybe better for this answer to be OOP??? - -int xspacing = 8; // How far apart should each horizontal location be spaced -int w; // Width of entire wave -int maxwaves = 5; // total # of waves to add together - -float theta = 0.0; -float[] amplitude = new float[maxwaves]; // Height of wave -float[] dx = new float[maxwaves]; // Value for incrementing X, to be calculated as a function of period and xspacing -float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - -void setup() { - size(640,360); - colorMode(RGB, 255, 255, 255, 100); - w = width + 16; - - for (int i = 0; i < maxwaves; i++) { - amplitude[i] = random(10,30); - float period = random(100,300); // How many pixels before the wave repeats - dx[i] = (TWO_PI / period) * xspacing; - } - - yvalues = new float[w/xspacing]; -} - -void draw() { - background(0); - calcWave(); - renderWave(); -} - -void calcWave() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // Set all height values to zero - for (int i = 0; i < yvalues.length; i++) { - yvalues[i] = 0; - } - - // Accumulate wave height values - for (int j = 0; j < maxwaves; j++) { - float x = theta; - for (int i = 0; i < yvalues.length; i++) { - // Every other wave is cosine instead of sine - if (j % 2 == 0) yvalues[i] += sin(x)*amplitude[j]; - else yvalues[i] += cos(x)*amplitude[j]; - x+=dx[j]; - } - } -} - -void renderWave() { - // A simple way to draw the wave with an ellipse at each location - noStroke(); - fill(255,50); - ellipseMode(CENTER); - for (int x = 0; x < yvalues.length; x++) { - ellipse(x*xspacing,height/2+yvalues[x],16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde deleted file mode 100644 index 5eb61b28b..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave/NOC_3_09_wave.pde +++ /dev/null @@ -1,28 +0,0 @@ - -float startAngle = 0; -float angleVel = 0.23; - -void setup() { - size(800,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde deleted file mode 100644 index 95c824eb5..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_a/NOC_3_09_wave_a.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float startAngle = 0; -float angleVel = 0.05; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde deleted file mode 100644 index 9749647db..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_b/NOC_3_09_wave_b.pde +++ /dev/null @@ -1,28 +0,0 @@ - -float startAngle = 0; -float angleVel = 0.2; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde deleted file mode 100644 index 88a1e396d..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_09_wave_c/NOC_3_09_wave_c.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float startAngle = 0; -float angleVel = 0.4; - -void setup() { - size(250,200); - smooth(); -} - -void draw() { - background(255); - - startAngle += 0.015; - float angle = startAngle; - - for (int x = 0; x <= width; x += 24) { - float y = map(sin(angle),-1,1,0,height); - stroke(0); - fill(0,50); - strokeWeight(2); - ellipse(x,y,48,48); - angle += angleVel; - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde deleted file mode 100644 index 80fe915bb..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/NOC_3_10_PendulumExample.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A simple pendulum simulation -// Given a pendulum with an angle theta (0 being the pendulum at rest) and a radius r -// we can use sine to calculate the angular component of the gravitational force. - -// Gravity Force = Mass * Gravitational Constant; -// Pendulum Force = Gravity Force * sine(theta) -// Angular Acceleration = Pendulum Force / Mass = gravitational acceleration * sine(theta); - -// Note this is an ideal world scenario with no tension in the -// pendulum arm, a more realistic formula might be: -// Angular Acceleration = (g / R) * sine(theta) - -// For a more substantial explanation, visit: -// http://www.myphysicslab.com/pendulum1.html - -Pendulum p; - -void setup() { - size(800,200); - // Make a new Pendulum with an origin location and armlength - p = new Pendulum(new PVector(width/2,0),175); - -} - -void draw() { - - background(255); - p.go(); -} - -void mousePressed() { - p.clicked(mouseX,mouseY); -} - -void mouseReleased() { - p.stopDragging(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde deleted file mode 100644 index 02d400155..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExample/Pendulum.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A Simple Pendulum Class -// Includes functionality for user can click and drag the pendulum - -class Pendulum { - - PVector location; // Location of pendulum ball - PVector origin; // Location of arm origin - float r; // Length of arm - float angle; // Pendulum arm angle - float aVelocity; // Angle velocity - float aAcceleration; // Angle acceleration - - float ballr; // Ball radius - float damping; // Arbitary damping amount - - boolean dragging = false; - - // This constructor could be improved to allow a greater variety of pendulums - Pendulum(PVector origin_, float r_) { - // Fill all variables - origin = origin_.get(); - location = new PVector(); - r = r_; - angle = PI/4; - - aVelocity = 0.0; - aAcceleration = 0.0; - damping = 0.995; // Arbitrary damping - ballr = 48.0; // Arbitrary ball radius - } - - void go() { - update(); - drag(); //for user interaction - display(); - } - - // Function to update location - void update() { - // As long as we aren't dragging the pendulum, let it swing! - if (!dragging) { - float gravity = 0.4; // Arbitrary constant - aAcceleration = (-1 * gravity / r) * sin(angle); // Calculate acceleration (see: http://www.myphysicslab.com/pendulum1.html) - aVelocity += aAcceleration; // Increment velocity - aVelocity *= damping; // Arbitrary damping - angle += aVelocity; // Increment angle - } - } - - void display() { - location.set(r*sin(angle), r*cos(angle), 0); // Polar to cartesian conversion - location.add(origin); // Make sure the location is relative to the pendulum's origin - - stroke(0); - strokeWeight(2); - // Draw the arm - line(origin.x, origin.y, location.x, location.y); - ellipseMode(CENTER); - fill(175); - if (dragging) fill(0); - // Draw the ball - ellipse(location.x, location.y, ballr, ballr); - } - - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the pendulum ball - void clicked(int mx, int my) { - float d = dist(mx, my, location.x, location.y); - if (d < ballr) { - dragging = true; - } - } - - // This tells us we are not longer clicking on the ball - void stopDragging() { - aVelocity = 0; // No velocity once you let go - dragging = false; - } - - void drag() { - // If we are draging the ball, we calculate the angle between the - // pendulum origin and mouse location - // we assign that angle to the pendulum - if (dragging) { - PVector diff = PVector.sub(origin, new PVector(mouseX, mouseY)); // Difference between 2 points - angle = atan2(-1*diff.y, diff.x) - radians(90); // Angle relative to vertical axis - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde deleted file mode 100644 index 07c09ed46..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/NOC_3_10_PendulumExampleSimplified.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A simple pendulum simulation -// Given a pendulum with an angle theta (0 being the pendulum at rest) and a radius r -// we can use sine to calculate the angular component of the gravitational force. - -// Gravity Force = Mass * Gravitational Constant; -// Pendulum Force = Gravity Force * sine(theta) -// Angular Acceleration = Pendulum Force / Mass = Gravitational Constant * sine(theta); - -// Note this is an ideal world scenario with no tension in the -// pendulum arm, a more realistic formula might be: -// Angular Acceleration = (G / R) * sine(theta) - -// For a more substantial explanation, visit: -// http://www.myphysicslab.com/pendulum1.html - -Pendulum p; - -void setup() { - size(800,200); - // Make a new Pendulum with an origin location and armlength - p = new Pendulum(new PVector(width/2,0),175); - -} - -void draw() { - background(255); - p.go(); -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde deleted file mode 100644 index 1b63fd3cc..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_10_PendulumExampleSimplified/Pendulum.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pendulum - -// A Simple Pendulum Class -// Includes functionality for user can click and drag the pendulum - -class Pendulum { - - PVector location; // Location of pendulum ball - PVector origin; // Location of arm origin - float r; // Length of arm - float angle; // Pendulum arm angle - float aVelocity; // Angle velocity - float aAcceleration; // Angle acceleration - float damping; // Arbitary damping amount - - // This constructor could be improved to allow a greater variety of pendulums - Pendulum(PVector origin_, float r_) { - // Fill all variables - origin = origin_.get(); - location = new PVector(); - r = r_; - angle = PI/4; - - aVelocity = 0.0; - aAcceleration = 0.0; - damping = 0.995; // Arbitrary damping - } - - void go() { - update(); - display(); - } - - // Function to update location - void update() { - float gravity = 0.4; // Arbitrary constant - aAcceleration = (-1 * gravity / r) * sin(angle); // Calculate acceleration (see: http://www.myphysicslab.com/pendulum1.html) - aVelocity += aAcceleration; // Increment velocity - aVelocity *= damping; // Arbitrary damping - angle += aVelocity; // Increment angle - } - - void display() { - location.set(r*sin(angle), r*cos(angle), 0); // Polar to cartesian conversion - location.add(origin); // Make sure the location is relative to the pendulum's origin - - stroke(0); - strokeWeight(2); - // Draw the arm - line(origin.x, origin.y, location.x, location.y); - ellipseMode(CENTER); - fill(175); - // Draw the ball - ellipse(location.x, location.y, 48, 48); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde deleted file mode 100644 index 4545f5cd1..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Mover.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bob class, just like our regular Mover (location, velocity, acceleration, mass) - -class Bob { - PVector location; - PVector velocity; - PVector acceleration; - float mass = 24; - - // Arbitrary damping to simulate friction / drag - float damping = 0.98; - - // For mouse interaction - PVector dragOffset; - boolean dragging = false; - - // Constructor - Bob(float x, float y) { - location = new PVector(x,y); - velocity = new PVector(); - acceleration = new PVector(); - dragOffset = new PVector(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - location.add(velocity); - acceleration.mult(0); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - - // Draw the bob - void display() { - stroke(0); - strokeWeight(2); - fill(175); - if (dragging) { - fill(50); - } - ellipse(location.x,location.y,mass*2,mass*2); - } - - // The methods below are for mouse interaction - - // This checks to see if we clicked on the mover - void clicked(int mx, int my) { - float d = dist(mx,my,location.x,location.y); - if (d < mass) { - dragging = true; - dragOffset.x = location.x-mx; - dragOffset.y = location.y-my; - } - } - - void stopDragging() { - dragging = false; - } - - void drag(int mx, int my) { - if (dragging) { - location.x = mx + dragOffset.x; - location.y = my + dragOffset.y; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde deleted file mode 100644 index ff09a0a9a..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/NOC_3_11_spring.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Mover object -Bob bob; - -// Spring object -Spring spring; - -void setup() { - size(640,360); - // Create objects at starting location - // Note third argument in Spring constructor is "rest length" - spring = new Spring(width/2,10,100); - bob = new Bob(width/2,100); - -} - -void draw() { - background(255); - // Apply a gravity force to the bob - PVector gravity = new PVector(0,2); - bob.applyForce(gravity); - - // Connect the bob to the spring (this calculates the force) - spring.connect(bob); - // Constrain spring distance between min and max - spring.constrainLength(bob,30,200); - - // Update bob - bob.update(); - // If it's being dragged - bob.drag(mouseX,mouseY); - - // Draw everything - spring.displayLine(bob); // Draw a line between spring and bob - bob.display(); - spring.display(); - - fill(0); - text("click on bob to drag",10,height-5); -} - - -// For mouse interaction with bob - -void mousePressed() { - bob.clicked(mouseX,mouseY); -} - -void mouseReleased() { - bob.stopDragging(); -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde b/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde deleted file mode 100644 index 565fbb307..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/NOC_3_11_spring/Spring.pde +++ /dev/null @@ -1,75 +0,0 @@ -// Nature of Code 2011 -// Daniel Shiffman -// Chapter 3: Oscillation - -// Class to describe an anchor point that can connect to "Bob" objects via a spring -// Thank you: http://www.myphysicslab.com/spring2d.html - -class Spring { - - // Location - PVector anchor; - - // Rest length and spring constant - float len; - float k = 0.2; - - // Constructor - Spring(float x, float y, int l) { - anchor = new PVector(x, y); - len = l; - } - - // Calculate spring force - void connect(Bob b) { - // Vector pointing from anchor to bob location - PVector force = PVector.sub(b.location, anchor); - // What is distance - float d = force.mag(); - // Stretch is difference between current distance and rest length - float stretch = d - len; - - // Calculate force according to Hooke's Law - // F = k * stretch - force.normalize(); - force.mult(-1 * k * stretch); - b.applyForce(force); - } - - // Constrain the distance between bob and anchor between min and max - void constrainLength(Bob b, float minlen, float maxlen) { - PVector dir = PVector.sub(b.location, anchor); - float d = dir.mag(); - // Is it too short? - if (d < minlen) { - dir.normalize(); - dir.mult(minlen); - // Reset location and stop from moving (not realistic physics) - b.location = PVector.add(anchor, dir); - b.velocity.mult(0); - // Is it too long? - } - else if (d > maxlen) { - dir.normalize(); - dir.mult(maxlen); - // Reset location and stop from moving (not realistic physics) - b.location = PVector.add(anchor, dir); - b.velocity.mult(0); - } - } - - void display() { - stroke(0); - fill(175); - strokeWeight(2); - rectMode(CENTER); - rect(anchor.x, anchor.y, 10, 10); - } - - void displayLine(Bob b) { - strokeWeight(2); - stroke(0); - line(b.location.x, b.location.y, anchor.x, anchor.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde deleted file mode 100644 index 423afa435..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/OOPWaveParticles.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Sine Wave - -// Two wave objects -Wave wave0; -Wave wave1; - -void setup() { - size(640,360); - // Initialize a wave with starting point, width, amplitude, and period - wave0 = new Wave(new PVector(200,75),100,20,500); - wave1 = new Wave(new PVector(150,250),300,40,220); - -} - -void draw() { - background(255); - - // Update and display waves - wave0.calculate(); - wave0.display(); - - wave1.calculate(); - wave1.display(); - - -} - - diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde deleted file mode 100644 index d04daea97..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Particle.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - - Particle() { - location = new PVector(); - } - - void setLocation(float x, float y) { - location.x = x; - location.y = y; - } - - void display() { - fill(random(255)); - ellipse(location.x,location.y,16,16); - } - - -} diff --git a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde b/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde deleted file mode 100644 index 9763ba892..000000000 --- a/java/examples/Books/Nature of Code/chp3_oscillation/OOPWaveParticles/Wave.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Wave { - - int xspacing = 8; // How far apart should each horizontal location be spaced - int w; // Width of entire wave - - PVector origin; // Where does the wave's first point start - float theta = 0.0; // Start angle at 0 - float amplitude; // Height of wave - float period; // How many pixels before the wave repeats - float dx; // Value for incrementing X, to be calculated as a function of period and xspacing - //float[] yvalues; // Using an array to store height values for the wave (not entirely necessary) - Particle[] particles; - - Wave(PVector o, int w_, float a, float p) { - origin = o.get(); - w = w_; - period = p; - amplitude = a; - dx = (TWO_PI / period) * xspacing; - particles = new Particle[w/xspacing]; - for (int i = 0; i < particles.length; i++) { - particles[i] = new Particle(); - } - } - - - void calculate() { - // Increment theta (try different values for 'angular velocity' here - theta += 0.02; - - // For every x value, calculate a y value with sine function - float x = theta; - for (int i = 0; i < particles.length; i++) { - particles[i].setLocation(origin.x+i*xspacing,origin.y+sin(x)*amplitude); - x+=dx; - } - } - - void manipulate() { - // Loop through the array of particles and check stuff regarding the mouse - - } - - void display() { - - // A simple way to draw the wave with an ellipse at each location - for (int i = 0; i < particles.length; i++) { - particles[i].display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde deleted file mode 100644 index a81a4ed84..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/CircleVsBlob.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(200,200); - PImage img = loadImage("texture.png"); - background(0); - image(img,0,0,width,height); - save("blob.tif"); - - background(0); - fill(255); - noStroke(); - ellipse(100,100,width,height); - save("circle.tif"); -} - -void draw() { - - -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif deleted file mode 100644 index 62b3058e4..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/blob.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif deleted file mode 100644 index 101ae8775..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/circle.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif deleted file mode 100644 index 17e84e806..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.gif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/CircleVsBlob/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde deleted file mode 100644 index 3e26041b4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Exercise_4_03_MovingParticleSystem.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - - // Option #1 (move the Particle System origin) - ps.origin.set(mouseX,mouseY,0); - - ps.addParticle(); - ps.run(); - - // Option #2 (move the Particle System origin) - // ps.addParticle(mouseX,mouseY); - - - -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde deleted file mode 100644 index 264df8539..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_03_MovingParticleSystem/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void addParticle(float x, float y) { - particles.add(new Particle(new PVector(x, y))); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde deleted file mode 100644 index d0340916f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Exercise_4_04_asteroids.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids exercise - -// Mover object -Spaceship ship; - -void setup() { - size(640, 360); - ship = new Spaceship(); -} - -void draw() { - background(255); - - // Update location - ship.update(); - // Wrape edges - ship.wrapEdges(); - // Draw ship - ship.display(); - - - fill(0); - //text("left right arrows to turn, z to thrust",10,height-5); - - // Turn or thrust the ship depending on what key is pressed - if (keyPressed) { - if (key == CODED && keyCode == LEFT) { - ship.turn(-0.03); - } else if (key == CODED && keyCode == RIGHT) { - ship.turn(0.03); - } else if (key == 'z' || key == 'Z') { - ship.thrust(); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde deleted file mode 100644 index e6736696e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Particle.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l,PVector dir) { - acceleration = dir.get(); - velocity = PVector.random2D(); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - noStroke(); - fill(127,0,0,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde deleted file mode 100644 index 0b83fa96a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/ParticleSystem.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem() { - particles = new ArrayList(); - } - - void addParticle(float x, float y, PVector force) { - particles.add(new Particle(new PVector(x, y),force)); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde deleted file mode 100644 index bdc11f6c1..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_04_asteroids/Spaceship.pde +++ /dev/null @@ -1,110 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Chapter 3: Asteroids - -class Spaceship { - // All of our regular motion stuff - PVector location; - PVector velocity; - PVector acceleration; - - ParticleSystem ps; - - // Arbitrary damping to slow down ship - float damping = 0.995; - float topspeed = 6; - - // Variable for heading! - float heading = 0; - - // Size - float r = 16; - - // Are we thrusting (to color boosters) - boolean thrusting = false; - - Spaceship() { - location = new PVector(width/2,height/2); - velocity = new PVector(); - acceleration = new PVector(); - - ps = new ParticleSystem(); - } - - // Standard Euler integration - void update() { - velocity.add(acceleration); - velocity.mult(damping); - velocity.limit(topspeed); - location.add(velocity); - acceleration.mult(0); - - ps.run(); - } - - // Newton's law: F = M * A - void applyForce(PVector force) { - PVector f = force.get(); - //f.div(mass); // ignoring mass right now - acceleration.add(f); - } - - // Turn changes angle - void turn(float a) { - heading += a; - } - - // Apply a thrust force - void thrust() { - // Offset the angle since we drew the ship vertically - float angle = heading - PI/2; - // Polar to cartesian for force vector! - PVector force = PVector.fromAngle(angle); - force.mult(0.1); - applyForce(force); - - force.mult(-2); - ps.addParticle(location.x,location.y+r,force); - - - // To draw booster - thrusting = true; - } - - void wrapEdges() { - float buffer = r*2; - if (location.x > width + buffer) location.x = -buffer; - else if (location.x < -buffer) location.x = width+buffer; - if (location.y > height + buffer) location.y = -buffer; - else if (location.y < -buffer) location.y = height+buffer; - } - - - // Draw the ship - void display() { - stroke(0); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y+r); - rotate(heading); - fill(175); - if (thrusting) fill(255,0,0); - // Booster rockets - rect(-r/2,r,r/3,r/2); - rect(r/2,r,r/3,r/2); - fill(175); - // A triangle - beginShape(); - vertex(-r,r); - vertex(0,-r); - vertex(r,r); - endShape(CLOSE); - rectMode(CENTER); - popMatrix(); - - thrusting = false; - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde deleted file mode 100644 index f7026ae40..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Exercise_4_06_Shatter.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(100,100,5); -} - -void draw() { - background(255); - - ps.display(); - ps.update(); -} - -void mousePressed() { - ps.shatter(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde deleted file mode 100644 index d160a42c8..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/Particle.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r; - - Particle(float x, float y, float r_) { - acceleration = new PVector(0,0.01); - velocity = PVector.random2D(); - velocity.mult(0.5); - location = new PVector(x,y); - lifespan = 255.0; - r = r_; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0); - fill(0); - rectMode(CENTER); - rect(location.x,location.y,r,r); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde deleted file mode 100644 index 611b1218b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_06_Shatter/ParticleSystem.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - int rows = 20; - int cols = 20; - - boolean intact = true; - - ParticleSystem(float x, float y, float r) { - particles = new ArrayList(); - - for (int i = 0; i < rows*cols; i++) { - addParticle(x + (i%cols)*r, y + (i/rows)*r, r); - } - } - - void addParticle(float x, float y, float r) { - particles.add(new Particle(x, y, r)); - } - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void shatter() { - intact = false; - } - - void update() { - if (!intact) { - for (Particle p : particles) { - p.update(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde deleted file mode 100644 index d27427366..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Exercise_4_10_particleintersection.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(mouseX,mouseY); - ps.update(); - ps.intersection(); - ps.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde deleted file mode 100644 index 90c4dec0c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/Particle.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r = 6; - boolean highlight; - - Particle(float x, float y) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-2, 0)); - location = new PVector(x, y); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void intersects(ArrayList particles) { - highlight = false; - for (Particle other : particles) { - if (other != this) { - float d = PVector.dist(other.location, location); - if (d < r + other.r) { - highlight = true; - } - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - if (highlight) { - fill(127,0,0); - } - ellipse(location.x, location.y, r*2, r*2); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde deleted file mode 100644 index 3b3367656..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particleintersection/ParticleSystem.pde +++ /dev/null @@ -1,43 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem(PVector location) { - particles = new ArrayList(); - } - - void addParticle(float x, float y) { - particles.add(new Particle(x, y)); - } - - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void intersection() { - for (Particle p : particles) { - p.intersects(particles); - } - } - - - void update() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.update(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde deleted file mode 100644 index 408ce3edd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Exercise_4_10_particlerepel.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(random(width),random(height)); - - //PVector gravity = new PVector(0,0.1); - //ps.applyForce(gravity); - ps.update(); - ps.intersection(); - ps.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde deleted file mode 100644 index dcd577cec..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/Particle.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float r = 6; - - - Particle(float x, float y) { - acceleration = new PVector(); - velocity = PVector.random2D(); - location = new PVector(x, y); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void intersects(ArrayList particles) { - for (Particle other : particles) { - if (other != this) { - PVector dir = PVector.sub(location, other.location); - if (dir.mag() < r*2) { - dir.setMag(0.5); - applyForce(dir); - } - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 0.5; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, r*2, r*2); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde deleted file mode 100644 index 4168dc229..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_10_particlerepel/ParticleSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - - ParticleSystem(PVector location) { - particles = new ArrayList(); - } - - void addParticle(float x, float y) { - particles.add(new Particle(x, y)); - } - - - void display() { - for (Particle p : particles) { - p.display(); - } - } - - void applyForce(PVector f) { - for (Particle p : particles) { - p.applyForce(f); - } - } - - void intersection() { - for (Particle p : particles) { - p.intersects(particles); - } - } - - - void update() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.update(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde deleted file mode 100644 index dbc8ac3c5..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Exercise_4_12_ArrayofImages.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Array of Images for particle textures - -ParticleSystem ps; - -PImage[] imgs; - -void setup() { - size(640, 360, P2D); - - imgs = new PImage[5]; - imgs[0] = loadImage("corona.png"); - imgs[1] = loadImage("emitter.png"); - imgs[2] = loadImage("particle.png"); - imgs[3] = loadImage("texture.png"); - imgs[4] = loadImage("reflection.png"); - - ps = new ParticleSystem(imgs, new PVector(width/2, 50)); -} - -void draw() { - - // Additive blending! - blendMode(ADD); - - background(0); - - PVector up = new PVector(0,-0.2); - ps.applyForce(up); - - ps.run(); - for (int i = 0; i < 5; i++) { - ps.addParticle(mouseX,mouseY); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde deleted file mode 100644 index adb3431f3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/Particle.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - - PImage img; - - // Another constructor (the one we are using here) - Particle(float x, float y, PImage img_) { - // Boring example with constant acceleration - acc = new PVector(0, 0); - vel = PVector.random2D(); - loc = new PVector(x, y); - lifespan = 255; - img = img_; - } - - void run() { - update(); - render(); - } - - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - acc.mult(0); - lifespan -= 2.0; - } - - // Method to display - void render() { - imageMode(CENTER); - tint(lifespan); - image(img, loc.x, loc.y, 32, 32); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde deleted file mode 100644 index 98208b71e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/ParticleSystem.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - - PImage[] textures; - - ParticleSystem(PImage[] imgs, PVector v) { - textures = imgs; - particles = new ArrayList(); // Initialize the arraylist - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle(float x, float y) { - int r = int(random(textures.length)); - particles.add(new Particle(x,y,textures[r])); - } - - - void applyForce(PVector f) { - for (Particle p : particles) { - p.applyForce(f); - } - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd deleted file mode 100644 index d532f15aa..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/Exercise_4_12_ArrayofImages/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde deleted file mode 100644 index 1ab939148..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/NOC_4_01_SingleParticle.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Particle p; - -void setup() { - size(800,200); - p = new Particle(new PVector(width/2,20)); - background(255); - smooth(); -} - -void draw() { - background(255); - - p.run(); - if (p.isDead()) { - p = new Particle(new PVector(width/2,20)); - //println("Particle dead!"); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde deleted file mode 100644 index ca927c34a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle/Particle.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -// A simple Particle class - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-1, 0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde deleted file mode 100644 index e372ea14e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/NOC_4_01_SingleParticle_trail.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Particle p; - -void setup() { - size(800, 200); - p = new Particle(new PVector(width/2, 20)); - background(255); - smooth(); -} - -void draw() { - if (mousePressed) { - noStroke(); - fill(255, 5); - rect(0, 0, width, height); - - p.run(); - if (p.isDead()) { - println("Particle dead!"); - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde deleted file mode 100644 index 5e78f8545..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_01_SingleParticle_trail/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), -1); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde deleted file mode 100644 index c0820f600..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/NOC_4_02_ArrayListParticles.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ArrayList particles; - -void setup() { - size(640,360); - particles = new ArrayList(); -} - -void draw() { - background(255); - - particles.add(new Particle(new PVector(width/2,50))); - - // Looping through backwards to delete - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde deleted file mode 100644 index a4c372ac4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_02_ArrayListParticles/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0, 0.05); - velocity = new PVector(random(-1, 1), random(-2, 0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0, lifespan); - strokeWeight(2); - fill(127, lifespan); - ellipse(location.x, location.y, 12, 12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/NOC_4_03_ParticleSystemClass.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde deleted file mode 100644 index ffddfc873..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_03_ParticleSystemClass/ParticleSystem.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Using Generics now! comment and annotate, etc. - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde deleted file mode 100644 index 2fe6ee428..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/NOC_4_04_SystemofSystems.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Simple Particle System - -// Particles are generated each cycle through draw(), -// fall with gravity and fade out over time -// A ParticleSystem object manages a variable size (ArrayList) -// list of particles. - -ArrayList systems; - -void setup() { - size(640,360); - systems = new ArrayList(); -} - -void draw() { - background(255); - for (ParticleSystem ps: systems) { - ps.run(); - ps.addParticle(); - } - - fill(0); - text("click mouse to add particle systems",10,height-30); -} - -void mousePressed() { - systems.add(new ParticleSystem(1,new PVector(mouseX,mouseY))); -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde deleted file mode 100644 index 12d1ef02a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/Particle.pde +++ /dev/null @@ -1,50 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde deleted file mode 100644 index 06f1ff3a9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_04_SystemofSystems/ParticleSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde deleted file mode 100644 index e86ce8d5b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Confetti.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Confetti extends Particle { - - // We could add variables for only Confetti here if we so - - Confetti(PVector l) { - super(l); - } - - // Inherits update() from parent - - // Override the display method - void display() { - rectMode(CENTER); - fill(127,lifespan); - stroke(0,lifespan); - strokeWeight(2); - pushMatrix(); - translate(location.x,location.y); - float theta = map(location.x,0,width,0,TWO_PI*2); - rotate(theta); - rect(0,0,12,12); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/NOC_4_05_ParticleSystemInheritancePolymorphism.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde deleted file mode 100644 index b38b30cf7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/Particle.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde deleted file mode 100644 index 28fde7c2e..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_05_ParticleSystemInheritancePolymorphism/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - float r = random(1); - if (r < 0.5) { - particles.add(new Particle(origin)); - } - else { - particles.add(new Confetti(origin)); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde deleted file mode 100644 index eef4c0555..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/NOC_4_06_ParticleSystemForces.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - - // Apply gravity force to all Particles - PVector gravity = new PVector(0,0.1); - ps.applyForce(gravity); - - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde deleted file mode 100644 index 971ea0c5c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/Particle.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float mass = 1; // Let's do something better here! - - Particle(PVector l) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde deleted file mode 100644 index c840ffd5b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_06_ParticleSystemForces/ParticleSystem.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A function to apply a force to all Particles - void applyForce(PVector f) { - for (Particle p: particles) { - p.applyForce(f); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde deleted file mode 100644 index c7de70143..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/NOC_4_07_ParticleSystemForcesRepeller.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; -Repeller repeller; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); - repeller = new Repeller(width/2-20,height/2); -} - -void draw() { - background(255); - ps.addParticle(); - - // Apply gravity force to all Particles - PVector gravity = new PVector(0,0.1); - ps.applyForce(gravity); - - ps.applyRepeller(repeller); - - repeller.display(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde deleted file mode 100644 index 971ea0c5c..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Particle.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - float mass = 1; // Let's do something better here! - - Particle(PVector l) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - display(); - } - - void applyForce(PVector force) { - PVector f = force.get(); - f.div(mass); - acceleration.add(f); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - lifespan -= 2.0; - } - - // Method to display - void display() { - stroke(0,lifespan); - strokeWeight(2); - fill(127,lifespan); - ellipse(location.x,location.y,12,12); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde deleted file mode 100644 index d4ad80fa7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/ParticleSystem.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - // A function to apply a force to all Particles - void applyForce(PVector f) { - for (Particle p: particles) { - p.applyForce(f); - } - } - - void applyRepeller(Repeller r) { - for (Particle p: particles) { - PVector force = r.repel(p); - p.applyForce(force); - } - } - - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde deleted file mode 100644 index 351780121..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_07_ParticleSystemForcesRepeller/Repeller.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Particles + Forces - -// A very basic Repeller class -class Repeller { - - // Gravitational Constant - float G = 100; - // Location - PVector location; - float r = 10; - - Repeller(float x, float y) { - location = new PVector(x,y); - } - - void display() { - stroke(0); - strokeWeight(2); - fill(175); - ellipse(location.x,location.y,48,48); - } - - // Calculate a force to push particle away from repeller - PVector repel(Particle p) { - PVector dir = PVector.sub(location,p.location); // Calculate direction of force - float d = dir.mag(); // Distance between objects - dir.normalize(); // Normalize vector (distance doesn't matter here, we just want this vector for direction) - d = constrain(d,5,100); // Keep distance within a reasonable range - float force = -1 * G / (d * d); // Repelling force is inversely proportional to distance - dir.mult(force); // Get force vector --> magnitude * direction - return dir; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde deleted file mode 100644 index fb11356e4..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/NOC_4_08_ParticleSystemSmoke.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A basic smoke effect using a particle system -// Each particle is rendered as an alpha masked image - -/* @pjs preload="processingjs/chapter04/_4_08_ParticleSystemSmoke/data/texture.png"; */ - -ParticleSystem ps; - -void setup() { - size(640,360); - PImage img = loadImage("texture.png"); - ps = new ParticleSystem(0,new PVector(width/2,height-75),img); -} - -void draw() { - background(0); - - // Calculate a "wind" force based on mouse horizontal position - float dx = map(mouseX,0,width,-0.2,0.2); - PVector wind = new PVector(dx,0); - ps.applyForce(wind); - ps.run(); - for (int i = 0; i < 2; i++) { - ps.addParticle(); - } - - // Draw an arrow representing the wind force - drawVector(wind, new PVector(width/2,50,0),500); - -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(255); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde deleted file mode 100644 index b3dce76be..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/Particle.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - PImage img; - - Particle(PVector l,PImage img_) { - acc = new PVector(0,0); - float vx = randomGaussian()*0.3; - float vy = randomGaussian()*0.3 - 1.0; - vel = new PVector(vx,vy); - loc = l.get(); - lifespan = 100.0; - img = img_; - } - - void run() { - update(); - render(); - } - - // Method to apply a force vector to the Particle object - // Note we are ignoring "mass" here - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.5; - acc.mult(0); // clear Acceleration - } - - // Method to display - void render() { - imageMode(CENTER); - tint(255,lifespan); - image(img,loc.x,loc.y); - // Drawing a circle instead - // fill(255,lifespan); - // noStroke(); - // ellipse(loc.x,loc.y,img.width,img.height); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde deleted file mode 100644 index 93fee68fa..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/ParticleSystem.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - PImage img; - - ParticleSystem(int num, PVector v, PImage img_) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - img = img_; - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - // Method to add a force vector to all particles currently in the system - void applyForce(PVector dir) { - // Enhanced loop!!! - for (Particle p: particles) { - p.applyForce(dir); - } - } - - void addParticle() { - particles.add(new Particle(origin, img)); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde deleted file mode 100644 index 52e945c60..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/NOC_4_08_ParticleSystemSmoke_b.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smoke Particle System - -// A basic smoke effect using a particle system -// Each particle is rendered as an alpha masked image - -/* @pjs preload="processingjs/chapter04/_4_08_ParticleSystemSmoke/data/texture.png"; */ - -import java.util.Random; - -ParticleSystem ps; -Random generator; - -void setup() { - size(640,360); - generator = new Random(); - PImage img = loadImage("texture.png"); - ps = new ParticleSystem(0,new PVector(width/2,height-75),img); - smooth(); -} - -void draw() { - background(0); - - // Calculate a "wind" force based on mouse horizontal position - float dx = map(mouseX,0,width,-0.2,0.2); - PVector wind = new PVector(dx,0); - ps.applyForce(wind); - ps.run(); - for (int i = 0; i < 2; i++) { - ps.addParticle(); - } - - // Draw an arrow representing the wind force - drawVector(wind, new PVector(width/2,50,0),500); - -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(255); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde deleted file mode 100644 index c5516d104..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/Particle.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Simple Particle System - -// A simple Particle class, renders the particle as an image - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - PImage img; - - Particle(PVector l,PImage img_) { - acc = new PVector(0,0); - float vx = (float) generator.nextGaussian()*0.3; - float vy = (float) generator.nextGaussian()*0.3 - 1.0; - vel = new PVector(vx,vy); - loc = l.get(); - lifespan = 100.0; - img = img_; - } - - void run() { - update(); - render(); - } - - // Method to apply a force vector to the Particle object - // Note we are ignoring "mass" here - void applyForce(PVector f) { - acc.add(f); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.5; - acc.mult(0); // clear Acceleration - } - - // Method to display - void render() { - //imageMode(CENTER); - //tint(255,lifespan); - //image(img,loc.x,loc.y); - // Drawing a circle instead - fill(255,lifespan); - noStroke(); - ellipse(loc.x,loc.y,img.width,img.height); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde deleted file mode 100644 index 43296a098..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/ParticleSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Smoke Particle Syste - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - PImage img; - - ParticleSystem(int num, PVector v, PImage img_) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - img = img_; - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin, img)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - // Method to add a force vector to all particles currently in the system - void applyForce(PVector dir) { - // Enhanced loop!!! - for (Particle p: particles) { - p.applyForce(dir); - } - - } - - void addParticle() { - particles.add(new Particle(origin,img)); - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } else { - return false; - } - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd deleted file mode 100644 index 8208feb02..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_08_ParticleSystemSmoke_b/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde deleted file mode 100644 index d0341315f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/NOC_4_09_AdditiveBlending.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Additive Blending - -// This example demonstrates a "glow" like effect using -// additive blending with a Particle system. By playing -// with colors, textures, etc. you can achieve a variety -// of looks. - -ParticleSystem ps; - -PImage img; - -void setup() { - size(640, 360, P2D); - - // Create an alpha masked image to be applied as the particle's texture - img = loadImage("texture.png"); - - ps = new ParticleSystem(0, new PVector(width/2, 50)); -} - -void draw() { - - // Additive blending! - blendMode(ADD); - - background(0); - - ps.run(); - for (int i = 0; i < 10; i++) { - ps.addParticle(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde deleted file mode 100644 index d9853841b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/Particle.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Particle System - -class Particle { - PVector loc; - PVector vel; - PVector acc; - float lifespan; - - // Another constructor (the one we are using here) - Particle(PVector l) { - // Boring example with constant acceleration - acc = new PVector(0,0.05,0); - vel = new PVector(random(-1,1),random(-1,0),0); - vel.mult(2); - loc = l.get(); - lifespan = 255; - } - - void run() { - update(); - render(); - } - - // Method to update location - void update() { - vel.add(acc); - loc.add(vel); - lifespan -= 2.0; - } - - // Method to display - void render() { - imageMode(CENTER); - tint(lifespan); - image(img,loc.x,loc.y); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan <= 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde deleted file mode 100644 index 208bd5418..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/ParticleSystem.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An arraylist for all the particles - PVector origin; // An origin point for where particles are birthed - - PImage tex; - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the arraylist - origin = v.get(); // Store the origin point - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin)); // Add "num" amount of particles to the arraylist - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } - - void addParticle() { - particles.add(new Particle(origin)); - } - - void addParticle(Particle p) { - particles.add(p); - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd b/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd deleted file mode 100644 index d532f15aa..000000000 Binary files a/java/examples/Books/Nature of Code/chp4_systems/NOC_4_09_AdditiveBlending/data/texture.psd and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde deleted file mode 100644 index bc2e58cb3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/Particle.pde +++ /dev/null @@ -1,61 +0,0 @@ -// Simple Particle System -// Daniel Shiffman - -// A simple Particle class - -class Particle { - - PVector location; - PVector velocity; - PVector acceleration; - float lifespan; - - Particle(PVector l) { - acceleration = new PVector(0,0.05); - velocity = new PVector(random(-1,1),random(-2,0)); - location = l.get(); - lifespan = 255.0; - } - - void run() { - update(); - push(); - display(); - pop(); - } - - // Method to update location - void update() { - velocity.add(acceleration); - location.add(velocity); - lifespan -= 2.0; - } - - - void push() { - pushMatrix(); - } - - void pop() { - popMatrix(); - } - - // Method to display - void display() { - stroke(0,lifespan); - fill(0,lifespan); - translate(location.x,location.y); - ellipse(0,0,8,8); - } - - // Is the particle still useful? - boolean isDead() { - if (lifespan < 0.0) { - return true; - } else { - return false; - } - } -} - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde deleted file mode 100644 index 95b089aa3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleChild.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleChild extends Particle { - - // We could add variables for only Confetti here if we so - - ParticleChild(PVector l) { - super(l); - } - - // Inherits update() from parent - - // Override the display method - void display() { - super.display(); - float theta = map(location.x,0,width,0,TWO_PI*2); - rotate(theta); - stroke(0); - line(0,0,50,0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde deleted file mode 100644 index 3e439bd84..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystem.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class ParticleSystem { - ArrayList particles; - PVector origin; - - ParticleSystem(PVector location) { - origin = location.get(); - particles = new ArrayList(); - } - - void addParticle() { - float r = random(1); - if (r < 0.5) { - particles.add(new Particle(origin)); - } - else { - particles.add(new ParticleChild(origin)); - } - } - - void run() { - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.run(); - if (p.isDead()) { - particles.remove(i); - } - } - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde b/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde deleted file mode 100644 index 935a214da..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/ParticleSystemInheritance_pushpop/ParticleSystemInheritance_pushpop.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -ParticleSystem ps; - -void setup() { - size(640,360); - ps = new ParticleSystem(new PVector(width/2,50)); -} - -void draw() { - background(255); - ps.addParticle(); - ps.run(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde deleted file mode 100755 index f96fc9d07..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/NOC_gl.pde +++ /dev/null @@ -1,13 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void renderImage(PImage img, Vec3D _loc, float _diam, color _col, float _alpha ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - tint(red(_col), green(_col), blue(_col), _alpha); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde deleted file mode 100755 index 0e6eb38fe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/emitter.pde +++ /dev/null @@ -1,89 +0,0 @@ - -/* -The emitter is just an object that follows the cursor and -can spawn new particle objects. It would be easier to just make -the location vector match the cursor position but I have opted -to use a velocity vector because later I will be allowing for -multiple emitters. -*/ - -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - - color myColor; - - ArrayList particles; - - Emitter( ){ - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - } - - void exist(){ - setVelToMouse(); - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - pgl.disable( PGL.TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void setVelToMouse(){ - velToMouse.set( mouseX - loc.x, mouseY - loc.y, 0 ); - } - - void findVelocity(){ - vel.interpolateToSelf( velToMouse, .35 ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - if( !p.ISDEAD ){ - p.exist(); - } else { - it.remove(); - } - } - } - - - void render(){ - renderImage( emitterImg, loc, 150, myColor, 1.0 ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( loc, vel ) ); - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde deleted file mode 100644 index 549c8dccc..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/flight404_particles_1_simple.pde +++ /dev/null @@ -1,158 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Updated version of flight404 Particle Emitter release 1 -// This works with Processing 2.0 - -// February 28 2011 -// Daniel Shiffman - -// Source Code release 1 -// Particle Emitter -// -// February 11th 2008 -// -// Built with Processing v.135 which you can download at http://www.processing.org/download -// -// Robert Hodgin -// flight404.com -// barbariangroup.com - -// features: -// Toxi's magnificent Vec3D library -// perlin noise flow fields -// ribbon trails -// OpenGL additive blending -// OpenGL display lists -// -// Uses the very useful Vec3D library by Karsten Schmidt (toxi) -// You can download it at http://code.google.com/p/toxiclibs/downloads/list -// -// Please post suggestions and improvements at the flight404 blog. When nicer/faster/better -// practices are suggested, I will incorporate them into the source and repost. I think that -// will be a reasonable system for now. -// -// Future additions will include: -// Rudimentary camera movement -// Magnetic repulsion -// More textures means more iron -// -// UPDATES -// -// February 11th 2008 -// Reorganized some of the OpenGL calls as per Simon Gelfius' suggestion. -// http://www.kinesis.be/ - - -import toxi.geom.*; -import java.util.*; - -PGL pgl; - -Emitter emitter; -Vec3D gravity; -float floorLevel; - -PImage particleImg; -PImage emitterImg; - -int counter; - - -boolean ALLOWGRAVITY; // add gravity vector? -boolean ALLOWPERLIN; // add perlin noise flow field vector? -boolean ALLOWTRAILS; // render particle trails? -boolean ALLOWFLOOR; // add a floor? - // Turning on all of these options will make things - // slow down. - -void setup(){ - size( 600, 600, P3D ); - smooth(4); - // Lately I have gotten into the habit of limiting the color range to be - // 0.0 to 1.0. It works this way in OpenGL so I might as well get used to it. - colorMode( RGB, 1.0 ); - - // Turn on 4X antialiasing - //hint( ENABLE_OPENGL_4X_SMOOTH ); - - // More OpenGL necessity. - pgl = ((PGraphicsOpenGL) g).pgl; - - // Loads in a particle image from the data folder. Image size should be a power of 2. - particleImg = loadImage( "particle.png" ); - emitterImg = loadImage( "emitter.png" ); - - emitter = new Emitter(); - gravity = new Vec3D( 0, .35, 0 ); // gravity vector - floorLevel = 400; -} - -void draw(){ - background( 0.0 ); - perspective( PI/3.0, (float)width/(float)height, 1, 5000 ); - - // Turns on additive blending so we can draw a bunch of glowing images without - // needing to do any depth testing. - pgl.depthMask(false); - pgl.enable( PGL.BLEND ); - pgl.blendFunc(PGL.SRC_ALPHA, PGL.ONE); - - emitter.exist(); - - // If the mouse button is pressed, then add 10 new particles. - if( mousePressed ){ - if( ALLOWTRAILS && ALLOWFLOOR ){ - emitter.addParticles( 5 ); - } else { - emitter.addParticles( 10 ); - } - } - - counter ++; -} - - -void keyPressed(){ - if( key == 'g' || key == 'G' ) - ALLOWGRAVITY = !ALLOWGRAVITY; - - if( key == 'p' || key == 'P' ) - ALLOWPERLIN = !ALLOWPERLIN; - - if( key == 't' || key == 'T' ) - ALLOWTRAILS = !ALLOWTRAILS; - - if( key == 'f' || key == 'F' ) - ALLOWFLOOR = !ALLOWFLOOR; - -} - - -// This method should be nicer, but it isnt. I use getRads to get a perlin noise -// based angle in radians based on the x and y position of the object asking for it. -// Perlin noise is supposed to give you back a number between 0 and 1, but it wont -// necessarily give you numbers that range from 0 to 1. A usual result is more like -// .25 to .75. -// -// So the point of this method is to try to normalize the values to a -// range of 0 to 1. It's not perfect, and I still get weird results. -// For instance, the mult variable is supposed to be the multiplier for the range. -// So if i wanted a random angle between 0 and TWO_PI, I would set the mult = TWO_PI. -// But when I do that, I find the Perlin noise tends to give me a left-pointing angle. -// To counteract, I end up setting the mult to 10.0 in order to increase the chances -// that I get a nice range from at least 0 to TWO_PI. -float minNoise = 0.499; -float maxNoise = 0.501; -float getRads(float val1, float val2, float mult, float div){ - float rads = noise(val1/div, val2/div, counter/div); - - if (rads < minNoise) minNoise = rads; - if (rads > maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde deleted file mode 100755 index 16441c9c5..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_1_simple/particle.pde +++ /dev/null @@ -1,208 +0,0 @@ -/* -General Structure notes. - My classes tend to have a similar naming scheme and flow. I start with the 'exist' method. - Exist is what an object needs to do every frame. Usually 'existing' consists of four main things. - 1) Find the velocity. This involves determining what influences there are on the velocity. - 2) Apply the velocity to the location. - 3) Render the object. - 4) Age the object. - - I also use the metaphor of aging and death. When first made, a particle's age will be zero. - Every frame, the age will increment. If the age reaches the lifeSpan (which is a random number - that I set in the constructor), then the boolean ISDEAD is set to true and the arraylist iterator - removes the dead element from the list. - */ - - - -class Particle { - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - float bounceAge; // amount to age particle when it bounces off floor - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - - - Particle( Vec3D _loc, Vec3D _vel ) { - radius = random( 10, 40 ); - len = (int)( radius ); - loc = new Vec3D[ len ]; - - // This confusing-looking line does three things at once. - // First, you make a random vector. - // new Vec3D().randomVector() - // Next, you multiply that vector by a random number from 0.0 to 5.0. - // scaleSelf( 5.0 ); - // Finally, you add this new vector to the original sent vector. - // _loc.add( ); - // This is just a way to make sure all the particles made this frame - // don't all start on the exact same pixel. This staggering will be useful - // when we incorporate magnetic repulsion in a later tutorial. - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 5.0 ) ) ) ); - - for( int i=0; i floorLevel ) { - ISBOUNCING = true; - } - else { - ISBOUNCING = false; - } - } - - if( ISBOUNCING ) { - vel.scaleSelf( .75 ); - vel.y *= -.5; - } - } - - void setPosition() { - // Every frame, the current location will be passed on to - // the next element in the location array. Think 'cursor trail effect'. - for( int i=len-1; i>0; i-- ) { - loc[i].set( loc[i-1] ); - } - - // Set the initial location. - // loc[0] represents the current position of the particle. - loc[0].addSelf( vel ); - } - - void render() { - // As the particle ages, it will gain blue but will lose red and green. - color c = color( agePer, agePer*.75, 1.0 - agePer ); - renderImage(particleImg, loc[0], radius * agePer, c, 1.0 ); - } - - void renderTrails() { - float xp, yp, zp; - float xOff, yOff, zOff; - beginShape(QUAD_STRIP); - for ( int i=0; i lifeSpan ) { - ISDEAD = true; - } - else { - // When spawned, the agePer is 1.0. - // When death occurs, the agePer is 0.0. - agePer = 1.0 - age/(float)lifeSpan; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde deleted file mode 100644 index 2f91c0f1b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/NOC_gl.pde +++ /dev/null @@ -1,49 +0,0 @@ - -int squareList; -void initGL(){ - pgl.beginGL(); - squareList = gl.glGenLists(1); - gl.glNewList(squareList, GL.GL_COMPILE); - gl.glBegin(GL.GL_POLYGON); - gl.glTexCoord2f(0, 0); gl.glVertex2f(-.5, -.5); - gl.glTexCoord2f(1, 0); gl.glVertex2f( .5, -.5); - gl.glTexCoord2f(1, 1); gl.glVertex2f( .5, .5); - gl.glTexCoord2f(0, 1); gl.glVertex2f(-.5, .5); - gl.glEnd(); - gl.glEndList(); - pgl.endGL(); -} - -void renderImage( Vec3D _loc, float _diam, color _col, float _alpha ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - pov.glReverseCamera(); - gl.glScalef( _diam, _diam, _diam ); - gl.glColor4f( red(_col), green(_col), blue(_col), _alpha ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} - -// This will allow you to draw images that are oriented to the floor plane. -void renderImageOnFloor( Vec3D _loc, float _diam, color _col, float _aa ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - gl.glScalef( _diam, _diam, _diam ); - gl.glRotatef( 90, 1.0, 0.0, 0.0 ); - gl.glColor4f( red(_col), green(_col), blue(_col), _aa ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} - -// This will allow you to specify a rotation for images that are oriented perpendicular to the eyeNormal -// which is the vector pointing from the camera's eye to the camera's point of interest. -void renderImageAndRotate( Vec3D _loc, float _diam, color _col, float _aa, float _rot ){ - gl.glPushMatrix(); - gl.glTranslatef( _loc.x, -_loc.y, _loc.z ); - gl.glRotatef( degrees( _rot ), pov.eyeNormal.x, pov.eyeNormal.y, pov.eyeNormal.z ); - pov.glReverseCamera(); - gl.glScalef( _diam, _diam, _diam ); - gl.glColor4f( red(_col), green(_col), blue(_col), _aa ); - gl.glCallList( squareList ); - gl.glPopMatrix(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde deleted file mode 100644 index ee2909cb9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/cursor.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Cursor{ - Vec3D loc; - Vec3D vel; - - Cursor(){ - loc = new Vec3D(); - vel = new Vec3D(); - } - - void exist(){ - // 2.35 is an arbitrary number. Ideally, this cursor would function - // properly regardless of the camera's rotation and distance from the object. - // Im not sure how to make that happen... 3D interaction with the cursor has - // been low on my research list. Think of this as a crappy placeholder. - loc.set( ( mouseX - xMid ) * 2.25, ( mouseY - yMid ) * 2.25, 0 ); - } - - void render(){ - pushMatrix(); - translate( loc.x, loc.y, loc.z ); - fill( 1, 0, 0 ); - sphere( 10 ); - popMatrix(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde deleted file mode 100644 index 04eb2045a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/emitter.pde +++ /dev/null @@ -1,182 +0,0 @@ -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - float radius; - - Texture coronaTex; - Texture emitterTex; - Texture particleTex; - Texture reflectionTex; - - color myColor; - - ArrayList particles; - ArrayList nebulae; - - Emitter( ){ - - try { - coronaTex = TextureIO.newTexture(new File(dataPath("corona.png")), true); - emitterTex = TextureIO.newTexture(new File(dataPath("emitter.png")), true); - particleTex = TextureIO.newTexture(new File(dataPath("particle.png")), true); - reflectionTex = TextureIO.newTexture(new File(dataPath("reflection.png")), true); - } - catch (IOException e) { - println("Texture file is missing"); - exit(); // or handle it some other way - } - - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - radius = 100; - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - nebulae = new ArrayList(); - } - - void exist(){ - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - gl.glDisable( GL.GL_TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void findVelocity(){ - Vec3D dirToMouse = new Vec3D( mouse.loc.sub( loc ).scale( .15 ) ); - vel.set( dirToMouse ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - gl.glEnable( GL.GL_TEXTURE_2D ); - - - int mylength = particles.size(); - for( int i=mylength-1; i>=0; i-- ){ - Particle p = ( Particle )particles.get(i); - if( p.ISSPLIT ) - addParticles( p ); - - if ( !p.ISDEAD ){ - // pgl.bindTexture( images.particle ); - particleTex.bind(); - particleTex.enable(); - p.exist(); - particleTex.disable(); - - } - else { - particles.set( i, particles.get( particles.size() - 1 ) ); - particles.remove( particles.size() - 1 ); - } - } - - if( ALLOWFLOOR ){ - // pgl.bindTexture( images.reflection ); - reflectionTex.bind(); - reflectionTex.enable(); - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderReflection(); - } - reflectionTex.disable(); - } - - // pgl.bindTexture( images.corona ); - coronaTex.bind(); - coronaTex.enable(); - for( Iterator it = nebulae.iterator(); it.hasNext(); ){ - Nebula n = (Nebula) it.next(); - if( !n.ISDEAD ){ - n.exist(); - } - else { - it.remove(); - } - } - coronaTex.disable(); - } - - - void render(){ - // pgl.bindTexture( images.emitter ); - emitterTex.bind(); - emitterTex.enable(); - renderImage( loc, radius, myColor, 1.0 ); - emitterTex.enable(); - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 15.0, true ) ); - nebulae.add( new Nebula( loc, 45.0, true ) ); - } - - - if( ALLOWFLOOR ){ - // pgl.bindTexture( images.reflection ); - reflectionTex.bind(); - reflectionTex.enable(); - renderReflection(); - reflectionTex.disable(); - } - } - - void renderReflection(){ - float altitude = floorLevel - loc.y; - float reflectMaxAltitude = 300.0; - float yPer = 1.0 - altitude/reflectMaxAltitude; - - if( yPer > .05 ) - renderImageOnFloor( new Vec3D( loc.x, floorLevel, loc.z ), radius * 10.0, color( 0.5, 1.0, yPer*.25 ), yPer ); - - if( mousePressed ) - renderImageOnFloor( new Vec3D( loc.x, floorLevel, loc.z ), radius + ( yPer + 1.0 ) * radius * random( 2.0, 3.5 ), color( 1.0, 0, 0 ), yPer ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( 1, loc, vel ) ); - } - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 40.0, false ) ); - nebulae.add( new Nebula( loc, 100.0, false ) ); - } - } - - void addParticles( Particle _p ){ - // play with amt if you want to control how many particles spawn when splitting - int amt = (int)( _p.radius * .15 ); - for( int i=0; i maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde deleted file mode 100644 index 821c91230..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/images.pde +++ /dev/null @@ -1,13 +0,0 @@ -class Images{ - PImage particle; - PImage emitter; - PImage corona; - PImage reflection; - - Images(){ - particle = loadImage( "particle.png" ); - emitter = loadImage( "emitter.png" ); - corona = loadImage( "corona.png" ); - reflection = loadImage( "reflection.png" ); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde deleted file mode 100644 index 573378708..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/nebula.pde +++ /dev/null @@ -1,56 +0,0 @@ -class Nebula{ - Vec3D loc; - Vec3D vel; - float radius; - float scaleFac; - float age; - int lifeSpan; - float agePer; - float rot; - color c; - - boolean ISDEAD; - boolean ISGROUNDED; - - Nebula( Vec3D _loc, float _radius, boolean _ISGROUNDED ){ - loc = new Vec3D( _loc ); - vel = new Vec3D( pov.eyeNormal.scale( 2.0 ) ); - radius = random( _radius*.8, _radius*1.75 ); - - scaleFac = random( 1.005, 1.10 ); - age = 0; - lifeSpan = (int)random(10,30); - rot = random( TWO_PI ); - c = color( random(.75, 1.0), random(.5,.75), random(.2,.8) ); - ISGROUNDED = _ISGROUNDED; - - if( ISGROUNDED ){ - scaleFac = random( 1.01, 1.025 ); - vel.y -= random( 1.0 ); - radius *= 2.0; - } - } - - void exist(){ - move(); - render(); - checkAge(); - } - - void move(){ - radius *= scaleFac; - loc.addSelf( vel ); - } - - void render(){ - renderImageAndRotate( loc, radius, c, sin(agePer*PI) * .4, rot ); - } - - void checkAge(){ - age ++; - agePer = 1.0 - age/(float)lifeSpan; - - if (age > lifeSpan) - ISDEAD = true; - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde deleted file mode 100644 index 53cbf839b..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/particle.pde +++ /dev/null @@ -1,171 +0,0 @@ - -class Particle{ - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - int gen; // number of times particle has been involved in a SPLIT - float bounceAge; // amount to age particle when it bounces off floor - float bounceVel; // speed at impact - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - boolean ISSPLIT; // if particle hits the floor with enough speed... - - - Particle( int _gen, Vec3D _loc, Vec3D _vel ){ - gen = _gen; - radius = random( 10 - gen, 50 - ( gen-1)*10 ); - - len = (int)( radius*.5 ); - loc = new Vec3D[ len ]; - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 1.0 ) ) ) ); - - for( int i=0; i 1 ){ - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 7.0 ) ) ); - } else { - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 10.0 ) ) ); - } - - perlin = new Vec3D(); - - age = 0; - bounceAge = 2; - lifeSpan = (int)( radius ); - } - - void exist(){ - if( ALLOWPERLIN ) - findPerlin(); - - findVelocity(); - setPosition(); - render(); - setAge(); - } - - void findPerlin(){ - float xyRads = getRads( loc[0].x, loc[0].z, 20.0, 50.0 ); - float yRads = getRads( loc[0].x, loc[0].y, 20.0, 50.0 ); - perlin.set( cos(xyRads), -sin(yRads), sin(xyRads) ); - perlin.scaleSelf( .5 ); - } - - void findVelocity(){ - if( ALLOWGRAVITY ) - vel.addSelf( gravity ); - - if( ALLOWPERLIN ) - vel.addSelf( perlin ); - - if( ALLOWFLOOR ){ - if( loc[0].y + vel.y > floorLevel ){ - ISBOUNCING = true; - } else { - ISBOUNCING = false; - } - } - - // if the particle is moving fast enough, when it hits the ground it can - // split into a bunch of smaller particles. - if( ISBOUNCING ){ - bounceVel = vel.magnitude(); - - vel.scaleSelf( .7 ); - vel.y *= -( ( radius/40.0 ) * .5 ); - - if( bounceVel > 15.0 && gen < 4 ) - ISSPLIT = true; - - } else { - ISSPLIT = false; - } - } - - void setPosition(){ - for( int i=len-1; i>0; i-- ){ - loc[i].set( loc[i-1] ); - } - - loc[0].addSelf( vel ); - } - - void render(){ - color c = color( agePer - .5, agePer*.25, 1.5 - agePer ); - renderImage( loc[0], radius * agePer, c, 1.0 ); - - // Rendering two graphics here. Makes the particles more vivid, - // but will hinder the performance. - c = color( 1, agePer, agePer ); - renderImage( loc[0], radius * agePer * .5, c, agePer ); - } - - void renderReflection(){ - float altitude = floorLevel - loc[0].y; - float reflectMaxAltitude = 25.0; - float yPer = ( 1.0 - ( altitude/reflectMaxAltitude ) ) * .5; - - if( yPer > .05 ) - renderImageOnFloor( new Vec3D( loc[0].x, floorLevel, loc[0].z ), radius * agePer * 8.0 * yPer, color( agePer, agePer*.25, 0 ), yPer + random( .2 ) ); - } - - void renderTrails(){ - float xp, yp, zp; - float xOff, yOff, zOff; - - gl.glBegin( GL.GL_QUAD_STRIP ); - - for ( int i=0; i lifeSpan ){ - ISDEAD = true; - } else { - agePer = 1.0 - age/(float)lifeSpan; - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde deleted file mode 100644 index 1d5bf01d7..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_GLtexture/pov.pde +++ /dev/null @@ -1,62 +0,0 @@ -// Camera class which uses Kristian Damkjer's OCD library -// http://www.cise.ufl.edu/~kdamkjer/processing/libraries/ocd/ - -class POV{ - PApplet parent; - Camera cam; - - Vec3D eye; - Vec3D center; - - Vec3D eyeNormal; - - boolean ISDRAGGING; - - POV( PApplet _parent ){ - parent = _parent; - cam = new Camera( parent, 0, 100, 1500 ); - - eye = new Vec3D(); - center = new Vec3D(); - eyeNormal = new Vec3D(); - } - - void exist(){ - perspective( PI/3.0, (float)xSize/(float)ySize, .5, 5000 ); - if( ISDRAGGING ){ - cam.circle( radians( ( mouseX - pmouseX ) * .25 ) ); - cam.arc( radians( ( mouseY - pmouseY ) * .25 ) ); - } - - cam.feed(); - setPosition(); - } - - - // Code by JohnG from the Processing forum - // http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1170790832 - // - // Does the camera transformations in reverse to allow for images that always face the camera. - void glReverseCamera(){ - float deltaX = eye.x - center.x; - float deltaY = eye.y - center.y; - float deltaZ = eye.z - center.z; - - float angleZ = atan2( deltaY,deltaX ); - float hyp = sqrt( sq( deltaX ) + sq( deltaY ) ); - float angleY = atan2( hyp,deltaZ ); - - gl.glRotatef( degrees( angleZ ), 0, 0, 1.0 ); - gl.glRotatef( degrees( angleY ), 0, 1.0, 0 ); - } - - - void setPosition(){ - float[] e = cam.position(); - float[] c = cam.target(); - - eye.set( e[0], e[1], e[2] ); - center.set( c[0], c[1], c[2] ); - eyeNormal = eye.sub(center).normalize(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde deleted file mode 100755 index 44705cdbd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/NOC_gl.pde +++ /dev/null @@ -1,31 +0,0 @@ - -void renderImage(PImage img, Vec3D _loc, float _diam, color _col, float _alpha ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _alpha); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - -void renderImageOnFloor(PImage img, Vec3D _loc, float _diam, color _col, float _aa ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - rotateX(PI/2); - //pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _aa); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} - -void renderImageAndRotate(PImage img, Vec3D _loc, float _diam, color _col, float _aa, float _rot ) { - pushMatrix(); - translate( _loc.x, _loc.y, _loc.z ); - pov.glReverseCamera(); - tint(red(_col), green(_col), blue(_col), _aa); - imageMode(CENTER); - image(img,0,0,_diam,_diam); - popMatrix(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde deleted file mode 100755 index ee2909cb9..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/cursor.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Cursor{ - Vec3D loc; - Vec3D vel; - - Cursor(){ - loc = new Vec3D(); - vel = new Vec3D(); - } - - void exist(){ - // 2.35 is an arbitrary number. Ideally, this cursor would function - // properly regardless of the camera's rotation and distance from the object. - // Im not sure how to make that happen... 3D interaction with the cursor has - // been low on my research list. Think of this as a crappy placeholder. - loc.set( ( mouseX - xMid ) * 2.25, ( mouseY - yMid ) * 2.25, 0 ); - } - - void render(){ - pushMatrix(); - translate( loc.x, loc.y, loc.z ); - fill( 1, 0, 0 ); - sphere( 10 ); - popMatrix(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde deleted file mode 100755 index d405be8fd..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/emitter.pde +++ /dev/null @@ -1,149 +0,0 @@ -class Emitter{ - Vec3D loc; - Vec3D vel; - Vec3D velToMouse; - float radius; - - color myColor; - - ArrayList particles; - ArrayList nebulae; - - Emitter( ){ - loc = new Vec3D(); - vel = new Vec3D(); - velToMouse = new Vec3D(); - - radius = 100; - - myColor = color( 1, 1, 1 ); - - particles = new ArrayList(); - nebulae = new ArrayList(); - } - - void exist(){ - findVelocity(); - setPosition(); - iterateListExist(); - render(); - - pgl.disable( PGL.TEXTURE_2D ); - - if( ALLOWTRAILS ) - iterateListRenderTrails(); - } - - void findVelocity(){ - Vec3D dirToMouse = new Vec3D( mouse.loc.sub( loc ).scale( .15 ) ); - vel.set( dirToMouse ); - } - - void setPosition(){ - loc.addSelf( vel ); - - if( ALLOWFLOOR ){ - if( loc.y > floorLevel ){ - loc.y = floorLevel; - vel.y = 0; - } - } - } - - void iterateListExist(){ - pgl.enable( PGL.TEXTURE_2D ); - - - int mylength = particles.size(); - for( int i=mylength-1; i>=0; i-- ){ - Particle p = ( Particle )particles.get(i); - if( p.ISSPLIT ) - addParticles( p ); - - if ( !p.ISDEAD ){ - //pgl.bindTexture( images.particle ); - p.exist(); - - } else { - particles.set( i, particles.get( particles.size() - 1 ) ); - particles.remove( particles.size() - 1 ); - } - } - - if( ALLOWFLOOR ){ - //pgl.bindTexture( images.reflection ); - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderReflection(); - } - } - - //pgl.bindTexture( images.corona ); - for( Iterator it = nebulae.iterator(); it.hasNext(); ){ - Nebula n = (Nebula) it.next(); - if( !n.ISDEAD ){ - n.exist(); - } else { - it.remove(); - } - } - } - - - void render(){ - //pgl.bindTexture( images.emitter ); - renderImage( images.emitter,loc, radius, myColor, 1.0 ); - - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 15.0, true ) ); - nebulae.add( new Nebula( loc, 45.0, true ) ); - } - - - if( ALLOWFLOOR ){ - //pgl.bindTexture( images.reflection ); - renderReflection(images.reflection); - } - } - - void renderReflection(PImage img){ - float altitude = floorLevel - loc.y; - float reflectMaxAltitude = 300.0; - float yPer = 1.0 - altitude/reflectMaxAltitude; - - if( yPer > .05 ) - renderImageOnFloor(img, new Vec3D( loc.x, floorLevel, loc.z ), radius * 10.0, color( 0.5, 1.0, yPer*.25 ), yPer ); - - if( mousePressed ) - renderImageOnFloor(img, new Vec3D( loc.x, floorLevel, loc.z ), radius + ( yPer + 1.0 ) * radius * random( 2.0, 3.5 ), color( 1.0, 0, 0 ), yPer ); - } - - void iterateListRenderTrails(){ - for( Iterator it = particles.iterator(); it.hasNext(); ){ - Particle p = (Particle) it.next(); - p.renderTrails(); - } - } - - void addParticles( int _amt ){ - for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( 1, loc, vel ) ); - } - - if( ALLOWNEBULA ){ - nebulae.add( new Nebula( loc, 40.0, false ) ); - nebulae.add( new Nebula( loc, 100.0, false ) ); - } - } - - void addParticles( Particle _p ){ - // play with amt if you want to control how many particles spawn when splitting - int amt = (int)( _p.radius * .15 ); - for( int i=0; i maxNoise) maxNoise = rads; - - rads -= minNoise; - rads *= 1.0/(maxNoise - minNoise); - - return rads * mult; -} - diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde deleted file mode 100755 index 821c91230..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/images.pde +++ /dev/null @@ -1,13 +0,0 @@ -class Images{ - PImage particle; - PImage emitter; - PImage corona; - PImage reflection; - - Images(){ - particle = loadImage( "particle.png" ); - emitter = loadImage( "emitter.png" ); - corona = loadImage( "corona.png" ); - reflection = loadImage( "reflection.png" ); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde deleted file mode 100755 index 3412c110f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/nebula.pde +++ /dev/null @@ -1,56 +0,0 @@ -class Nebula{ - Vec3D loc; - Vec3D vel; - float radius; - float scaleFac; - float age; - int lifeSpan; - float agePer; - float rot; - color c; - - boolean ISDEAD; - boolean ISGROUNDED; - - Nebula( Vec3D _loc, float _radius, boolean _ISGROUNDED ){ - loc = new Vec3D( _loc ); - vel = new Vec3D( pov.eyeNormal.scale( 2.0 ) ); - radius = random( _radius*.8, _radius*1.75 ); - - scaleFac = random( 1.005, 1.10 ); - age = 0; - lifeSpan = (int)random(10,30); - rot = random( TWO_PI ); - c = color( random(.75, 1.0), random(.5,.75), random(.2,.8) ); - ISGROUNDED = _ISGROUNDED; - - if( ISGROUNDED ){ - scaleFac = random( 1.01, 1.025 ); - vel.y -= random( 1.0 ); - radius *= 2.0; - } - } - - void exist(){ - move(); - render(); - checkAge(); - } - - void move(){ - radius *= scaleFac; - loc.addSelf( vel ); - } - - void render(){ - renderImageAndRotate(images.corona, loc, radius, c, sin(agePer*PI) * .4, rot ); - } - - void checkAge(){ - age ++; - agePer = 1.0 - age/(float)lifeSpan; - - if (age > lifeSpan) - ISDEAD = true; - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde deleted file mode 100755 index 893d3631f..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/particle.pde +++ /dev/null @@ -1,172 +0,0 @@ - -class Particle{ - int len; // number of elements in position array - Vec3D[] loc; // array of position vectors - Vec3D startLoc; // just used to make sure every loc[] is initialized to the same position - Vec3D vel; // velocity vector - Vec3D perlin; // perlin noise vector - float radius; // particle's size - float age; // current age of particle - int lifeSpan; // max allowed age of particle - float agePer; // range from 1.0 (birth) to 0.0 (death) - int gen; // number of times particle has been involved in a SPLIT - float bounceAge; // amount to age particle when it bounces off floor - float bounceVel; // speed at impact - boolean ISDEAD; // if age == lifeSpan, make particle die - boolean ISBOUNCING; // if particle hits the floor... - boolean ISSPLIT; // if particle hits the floor with enough speed... - - - Particle( int _gen, Vec3D _loc, Vec3D _vel ){ - gen = _gen; - radius = random( 10 - gen, 50 - ( gen-1)*10 ); - - len = (int)( radius*.5 ); - loc = new Vec3D[ len ]; - startLoc = new Vec3D( _loc.add( new Vec3D().randomVector().scaleSelf( random( 1.0 ) ) ) ); - - for( int i=0; i 1 ){ - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 7.0 ) ) ); - } else { - vel.addSelf( new Vec3D().randomVector().scaleSelf( random( 10.0 ) ) ); - } - - perlin = new Vec3D(); - - age = 0; - bounceAge = 2; - lifeSpan = (int)( radius ); - } - - void exist(){ - if( ALLOWPERLIN ) - findPerlin(); - - findVelocity(); - setPosition(); - render(); - setAge(); - } - - void findPerlin(){ - float xyRads = getRads( loc[0].x, loc[0].z, 20.0, 50.0 ); - float yRads = getRads( loc[0].x, loc[0].y, 20.0, 50.0 ); - perlin.set( cos(xyRads), -sin(yRads), sin(xyRads) ); - perlin.scaleSelf( .5 ); - } - - void findVelocity(){ - if( ALLOWGRAVITY ) - vel.addSelf( gravity ); - - if( ALLOWPERLIN ) - vel.addSelf( perlin ); - - if( ALLOWFLOOR ){ - if( loc[0].y + vel.y > floorLevel ){ - ISBOUNCING = true; - } else { - ISBOUNCING = false; - } - } - - // if the particle is moving fast enough, when it hits the ground it can - // split into a bunch of smaller particles. - if( ISBOUNCING ){ - bounceVel = vel.magnitude(); - - vel.scaleSelf( .7 ); - vel.y *= -( ( radius/40.0 ) * .5 ); - - if( bounceVel > 15.0 && gen < 4 ) - ISSPLIT = true; - - } else { - ISSPLIT = false; - } - } - - void setPosition(){ - for( int i=len-1; i>0; i-- ){ - loc[i].set( loc[i-1] ); - } - - loc[0].addSelf( vel ); - } - - void render(){ - color c = color( agePer - .5, agePer*.25, 1.5 - agePer ); - renderImage(images.particle, loc[0], radius * agePer, c, 1.0 ); - - // Rendering two graphics here. Makes the particles more vivid, - // but will hinder the performance. - c = color( 1, agePer, agePer ); - renderImage(images.particle, loc[0], radius * agePer * .5, c, agePer ); - } - - void renderReflection(){ - float altitude = floorLevel - loc[0].y; - float reflectMaxAltitude = 25.0; - float yPer = ( 1.0 - ( altitude/reflectMaxAltitude ) ) * .5; - - if( yPer > .05 ) - renderImageOnFloor(images.particle, new Vec3D( loc[0].x, floorLevel, loc[0].z ), radius * agePer * 8.0 * yPer, color( agePer, agePer*.25, 0 ), yPer + random( .2 ) ); - } - - void renderTrails(){ - float xp, yp, zp; - float xOff, yOff, zOff; - - beginShape(QUAD_STRIP); - - for ( int i=0; i lifeSpan ){ - ISDEAD = true; - } else { - agePer = 1.0 - age/(float)lifeSpan; - } - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde b/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde deleted file mode 100755 index cc41c1360..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/flight404/flight404_particles_2_simple/pov.pde +++ /dev/null @@ -1,64 +0,0 @@ -// Camera class which uses Kristian Damkjer's OCD library -// http://www.cise.ufl.edu/~kdamkjer/processing/libraries/ocd/ - -class POV{ - PApplet parent; - Camera cam; - - Vec3D eye; - Vec3D center; - - Vec3D eyeNormal; - - boolean ISDRAGGING; - - POV( PApplet _parent ){ - parent = _parent; - cam = new Camera( parent, 0, -100, 1500 ); - - eye = new Vec3D(); - center = new Vec3D(); - eyeNormal = new Vec3D(); - } - - void exist(){ - perspective( PI/3.0, (float)xSize/(float)ySize, .5, 5000 ); - if( ISDRAGGING ){ - cam.circle( radians( ( mouseX - pmouseX ) * .25 ) ); - cam.arc( radians( ( mouseY - pmouseY ) * .25 ) ); - } - - cam.feed(); - setPosition(); - } - - - // Code by JohnG from the Processing forum - // http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1170790832 - // - // Does the camera transformations in reverse to allow for images that always face the camera. - void glReverseCamera(){ - float deltaX = eye.x - center.x; - float deltaY = eye.y - center.y; - float deltaZ = eye.z - center.z; - - float angleZ = atan2( deltaY,deltaX ); - float hyp = sqrt( sq( deltaX ) + sq( deltaY ) ); - float angleY = atan2( hyp,deltaZ ); - - rotateZ(angleZ); - rotateY(angleY); - //gl.glRotatef( degrees( angleZ ), 0, 0, 1.0 ); - //gl.glRotatef( degrees( angleY ), 0, 1.0, 0 ); - } - - - void setPosition(){ - float[] e = cam.position(); - float[] c = cam.target(); - - eye.set( e[0], e[1], e[2] ); - center.set( c[0], c[1], c[2] ); - eyeNormal = eye.sub(center).normalize(); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde deleted file mode 100644 index f45630f37..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Circle.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Circle extends Shape { - - // Inherits all instance variables from parent + adding one - color c; - - Circle(float x_, float y_, float r_, color c_) { - super(x_,y_,r_); // Call the parent constructor - c = c_; // Also deal with this new instance variable - } - - // Call the parent jiggle, but do some more stuff too - void jiggle() { - super.jiggle(); - // The Circle jiggles its size as well as its x,y location. - r += random(-1,1); - r = constrain(r,0,100); - } - - // The changeColor() function is unique to the Circle class. - void changeColor() { - c = color(random(255)); - } - - void display() { - ellipseMode(CENTER); - fill(c); - stroke(0); - ellipse(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde deleted file mode 100644 index a4d8a723a..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Shape.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Learning Processing -// Daniel Shiffman -// http://www.learningprocessing.com - -// Example 22-1: Inheritance - -class Shape { - float x; - float y; - float r; - - Shape(float x_, float y_, float r_) { - x = x_; - y = y_; - r = r_; - } - - void jiggle() { - x += random(-1,1); - y += random(-1,1); - } - - // A generic shape does not really know how to be displayed. - // This will be overridden in the child classes. - void display() { - point(x,y); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde deleted file mode 100644 index 72831cabe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/Square.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Square extends Shape { - // Variables are inherited from the parent. - // We could also add variables unique to the Square class if we so desire - - Square(float x_, float y_, float r_) { - // If the parent constructor takes arguments then super() needs to pass in those arguments. - super(x_,y_,r_); - } - - // Inherits jiggle() from parent - - // The square overrides its parent for display. - void display() { - rectMode(CENTER); - fill(175); - stroke(0); - rect(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde b/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde deleted file mode 100644 index d76add5e3..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simpleInheritance/simpleInheritance.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Object oriented programming allows us to defi ne classes in terms of other classes. -// A class can be a subclass (aka " child " ) of a super class (aka "parent"). -// This is a simple example demonstrating this concept, known as "inheritance." - -Square s; -Circle c; - -void setup() { - size(200,200); - // A square and circle - s = new Square(75,75,10); - c = new Circle(125,125,20,color(175)); -} - -void draw() { - background(255); - c.jiggle(); - s.jiggle(); - c.display(); - s.display(); -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde deleted file mode 100644 index f45630f37..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Circle.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Circle extends Shape { - - // Inherits all instance variables from parent + adding one - color c; - - Circle(float x_, float y_, float r_, color c_) { - super(x_,y_,r_); // Call the parent constructor - c = c_; // Also deal with this new instance variable - } - - // Call the parent jiggle, but do some more stuff too - void jiggle() { - super.jiggle(); - // The Circle jiggles its size as well as its x,y location. - r += random(-1,1); - r = constrain(r,0,100); - } - - // The changeColor() function is unique to the Circle class. - void changeColor() { - c = color(random(255)); - } - - void display() { - ellipseMode(CENTER); - fill(c); - stroke(0); - ellipse(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde deleted file mode 100644 index 671b45edf..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Shape.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Shape { - float x; - float y; - float r; - - Shape(float x_, float y_, float r_) { - x = x_; - y = y_; - r = r_; - } - - void jiggle() { - x += random(-1,1); - y += random(-1,1); - } - - // A generic shape does not really know how to be displayed. - // This will be overridden in the child classes. - void display() { - point(x,y); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde deleted file mode 100644 index 72831cabe..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/Square.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Square extends Shape { - // Variables are inherited from the parent. - // We could also add variables unique to the Square class if we so desire - - Square(float x_, float y_, float r_) { - // If the parent constructor takes arguments then super() needs to pass in those arguments. - super(x_,y_,r_); - } - - // Inherits jiggle() from parent - - // The square overrides its parent for display. - void display() { - rectMode(CENTER); - fill(175); - stroke(0); - rect(x,y,r,r); - } -} diff --git a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde b/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde deleted file mode 100644 index b7e667acf..000000000 --- a/java/examples/Books/Nature of Code/chp4_systems/simplePolymorphism/simplePolymorphism.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// One array of Shapes -Shape[] shapes = new Shape[30]; - -void setup() { - size(200,200); - for (int i = 0; i < shapes.length; i++ ) { - int r = int(random(2)); - // Randomly put either circles or squares in our array - if (r == 0) { - shapes[i] = new Circle(100,100,10,color(random(255),100)); - } else { - shapes[i] = new Square(100,100,10); - } - } -} - -void draw() { - background(255); - // Jiggle and display all shapes - for (int i = 0; i < shapes.length; i++ ) { - shapes[i].jiggle(); - shapes[i].display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde deleted file mode 100644 index bbb54b071..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/CollisionsEqualMass.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Collisions -- Elastic, Equal Mass, Two objects only - -// Based off of Chapter 9: Resolving Collisions -// Mathematics and Physics for Programmers by Danny Kodicek - -// A Thing class for idealized collisions - -Mover a; -Mover b; - -boolean showVectors = true; - -void setup() { - size(200,200); - a = new Mover(new PVector(random(5),random(-5,5)),new PVector(10,10)); - b = new Mover(new PVector(-2,1),new PVector(150,150)); -} - -void draw() { - background(255); - a.go(); - b.go(); - - // Note this function will ONLY WORK with two objects - // Needs to be revised in the case of an array of objects - a.collideEqualMass(b); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde deleted file mode 100644 index 3281a9850..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/Mover.pde +++ /dev/null @@ -1,100 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Collisions - -class Mover { - - PVector loc; - PVector vel; - float bounce = 1.0; - float r = 20; - boolean colliding = false; - - Mover(PVector v, PVector l) { - vel = v.get(); - loc = l.get(); - } - - // Main method to operate object - void go() { - update(); - borders(); - display(); - } - - // Method to update location - void update() { - loc.add(vel); - } - - // Check for bouncing off borders - void borders() { - if (loc.y > height) { - vel.y *= -bounce; - loc.y = height; - } - else if (loc.y < 0) { - vel.y *= -bounce; - loc.y = 0; - } - if (loc.x > width) { - vel.x *= -bounce; - loc.x = width; - } - else if (loc.x < 0) { - vel.x *= -bounce; - loc.x = 0; - } - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0); - fill(175,200); - ellipse(loc.x,loc.y,r*2,r*2); - if (showVectors) { - drawVector(vel,loc,10); - } - } - - void collideEqualMass(Mover other) { - float d = PVector.dist(loc,other.loc); - float sumR = r + other.r; - // Are they colliding? - if (!colliding && d < sumR) { - // Yes, make new velocities! - colliding = true; - // Direction of one object another - PVector n = PVector.sub(other.loc,loc); - n.normalize(); - - // Difference of velocities so that we think of one object as stationary - PVector u = PVector.sub(vel,other.vel); - - // Separate out components -- one in direction of normal - PVector un = componentVector(u,n); - // Other component - u.sub(un); - // These are the new velocities plus the velocity of the object we consider as stastionary - vel = PVector.add(u,other.vel); - other.vel = PVector.add(un,other.vel); - } - else if (d > sumR) { - colliding = false; - } - } -} - -PVector componentVector (PVector vector, PVector directionVector) { - //--! ARGUMENTS: vector, directionVector (2D vectors) - //--! RETURNS: the component vector of vector in the direction directionVector - //-- normalize directionVector - directionVector.normalize(); - directionVector.mult(vector.dot(directionVector)); - return directionVector; -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde deleted file mode 100644 index 141c06960..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/CollisionsEqualMass/drawVector.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(loc.x,loc.y); - stroke(0); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); -} - - -void mousePressed() { - showVectors = !showVectors; -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde deleted file mode 100644 index d2cd65eb1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Blob.pde +++ /dev/null @@ -1,195 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -class Skeleton { - - // A list to keep track of all the bodies and joints - ArrayList bodies; - ArrayList joints; - - float bodyRadius; // The radius of each body that makes up the skeleton - float radius; // The radius of the entire blob - float totalPoints; // How many points make up the blob - - - // We should modify this constructor to receive arguments - // So that we can make many different types of blobs - Skeleton() { - - // Create the empty ArrayLists - bodies = new ArrayList(); - joints = new ArrayList(); - - // Where and how big is the blob - Vec2 center = new Vec2(width/2, height/2); - radius = 100; - totalPoints = 32; - bodyRadius = 10; - - // Initialize all the points in a circle - for (int i = 0; i < totalPoints; i++) { - // Look polar to cartesian coordinate transformation! - float theta = PApplet.map(i, 0, totalPoints, 0, TWO_PI); - float x = center.x + radius * sin(theta); - float y = center.y + radius * cos(theta); - - // Make each individual body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.fixedRotation = true; // no rotation! - bd.position.set(box2d.coordPixelsToWorld(x, y)); - Body body = box2d.createBody(bd); - - // The body is a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(bodyRadius); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - fd.density = 1; - fd.friction = 0.5; - fd.restitution = 0.3; - - // Finalize the body - body.createFixture(fd); - - // Store our own copy for later rendering - bodies.add(body); - } - - // Now connect the outline of the shape all with joints - for (int i = 0; i < bodies.size(); i++) { - DistanceJointDef djd = new DistanceJointDef(); - Body a = bodies.get(i); - int next = i+1; - if (i == bodies.size()-1) { - next = 0; - } - Body b = bodies.get(next); - // Connection between previous particle and this one - djd.bodyA = a; - djd.bodyB = b; - // Equilibrium length is distance between these bodies - Vec2 apos = a.getWorldCenter(); - Vec2 bpos = b.getWorldCenter(); - float d = dist(apos.x, apos.y, bpos.x, bpos.y); - djd.length = d; - // These properties affect how springy the joint is - djd.frequencyHz = 10; - djd.dampingRatio = 0.9; - - // Make the joint. - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - joints.add(dj); - } - - - // Make some joints that cross the center of the blob between bodies - for (int i = 0; i < bodies.size(); i++) { - for (int j = i+2; j < bodies.size(); j+=4) { - DistanceJointDef djd = new DistanceJointDef(); - Body a = bodies.get(i); - Body b = bodies.get(j); - // Connection between two bides - djd.bodyA = a; - djd.bodyB = b; - // Equilibrium length is distance between these bodies - Vec2 apos = a.getWorldCenter(); - Vec2 bpos = b.getWorldCenter(); - float d = dist(apos.x, apos.y, bpos.x, bpos.y); - - djd.length = d; - // These properties affect how springy the joint is - djd.frequencyHz = 3; - djd.dampingRatio = 0.1; - - // Make the joint. - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - joints.add(dj); - } - } - } - - - // Draw the skeleton as circles for bodies and lines for joints - void displaySkeleton() { - // Draw the outline - stroke(0); - strokeWeight(1); - for (Joint j: joints) { - Body a = j.getBodyA(); - Body b = j.getBodyB(); - Vec2 posa = box2d.getBodyPixelCoord(a); - Vec2 posb = box2d.getBodyPixelCoord(b); - line(posa.x, posa.y, posb.x, posb.y); - } - - // Draw the individual circles - for (Body b: bodies) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - // Get its angle of rotation - float a = b.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0, 0, bodyRadius*2, bodyRadius*2); - popMatrix(); - } - } - - - // Draw it as a creature - void displayCreature() { - // Let's compute the center! - Vec2 center = new Vec2(0, 0); - - // Make a curvy polygon - beginShape(); - stroke(175); - strokeWeight(bodyRadius*2); - fill(175); - for (Body b: bodies) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - curveVertex(pos.x, pos.y); - center.addLocal(pos); - } - endShape(CLOSE); - // Center is average of all points - center.mulLocal(1.0/bodies.size()); - - // Find angle between center and side body - Vec2 pos = box2d.getBodyPixelCoord(bodies.get(0)); - float dx = pos.x - center.x; - float dy = pos.y - center.y; - float angle = atan2(dy, dx)-PI/2; - - // Draw eyes and mouth relative to center - pushMatrix(); - strokeWeight(1); - stroke(0); - translate(center.x, center.y); - rotate(angle); - fill(0); - ellipse(-25, -50, 16, 16); - ellipse(25, -50, 16, 16); - line(-50, 50, 50, 50); - popMatrix(); - } - - Body getFirstBody() { - return bodies.get(0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde deleted file mode 100644 index c9f4ee0a0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/BlobSkeleton.pde +++ /dev/null @@ -1,109 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -import pbox2d.*; - -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.joints.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Our "blob" object -Skeleton blob; - -// Just a single box this time -Box box; -// The Spring that will attach to the box from the mouse -Spring spring; - -// Draw creature design or skeleton? -boolean skeleton; - -void setup() { - size(640, 360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add some boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2, height-5, width, 10)); - boundaries.add(new Boundary(width/2, 5, width, 10)); - boundaries.add(new Boundary(width-5, height/2, 10, height)); - boundaries.add(new Boundary(5, height/2, 10, height)); - - // Make a new blob - blob = new Skeleton(); - - // Make the box - box = new Box(width/2, 100); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); -} - -// When the mouse is released we're done with the spring -void mouseReleased() { - spring.destroy(); -} - -// When the mouse is pressed we. . . -void mousePressed() { - // Check to see if the mouse was clicked on the box - if (box.contains(mouseX, mouseY)) { - // And if so, bind the mouse location to the box with a spring - spring.bind(mouseX, mouseY, box); - } -} - -void draw() { - background(255); - - // We must always step through time! - - box2d.step(); - - - // Show the blob! - if (skeleton) { - blob.displaySkeleton(); - } - else { - blob.displayCreature(); - } - - // Show the boundaries! - for (Boundary wall: boundaries) { - wall.display(); - } - - // Always alert the spring to the new mouse location - spring.update(mouseX, mouseY); - - // Draw the box - box.display(); - // Draw the spring (it only appears when active) - spring.display(); - - fill(0); - text("Space bar to toggle creature/skeleton.\nClick and drag the box.", 20, height-30); -} - - -void keyPressed() { - if (key == ' ') { - skeleton = !skeleton; - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde deleted file mode 100644 index 16a2c18b2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 50; - h = 50; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(50); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde deleted file mode 100644 index 02fd1612b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/BlobSkeleton/Spring.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde deleted file mode 100644 index 1919d79e2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blob.pde +++ /dev/null @@ -1,118 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// PBox2D example - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -class Blob { - - // A list to keep track of all the points in our blob - ArrayList skeleton; - - float bodyRadius; // The radius of each body that makes up the skeleton - float radius; // The radius of the entire blob - float totalPoints; // How many points make up the blob - - - // We should modify this constructor to receive arguments - // So that we can make many different types of blobs - Blob() { - - // Create the empty - skeleton = new ArrayList(); - - // Let's make a volume of joints! - ConstantVolumeJointDef cvjd = new ConstantVolumeJointDef(); - - // Where and how big is the blob - Vec2 center = new Vec2(width/2, height/2); - radius = 100; - totalPoints = 20; - bodyRadius = 12; - - - // Initialize all the points - for (int i = 0; i < totalPoints; i++) { - // Look polar to cartesian coordinate transformation! - float theta = PApplet.map(i, 0, totalPoints, 0, TWO_PI); - float x = center.x + radius * sin(theta); - float y = center.y + radius * cos(theta); - - // Make each individual body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.fixedRotation = true; // no rotation! - bd.position.set(box2d.coordPixelsToWorld(x, y)); - Body body = box2d.createBody(bd); - - // The body is a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(bodyRadius); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - // For filtering out collisions - //fd.filter.groupIndex = -2; - - // Parameters that affect physics - fd.density = 1; - - // Finalize the body - body.createFixture(fd); - // Add it to the volume - cvjd.addBody(body); - - - // Store our own copy for later rendering - skeleton.add(body); - } - - // These parameters control how stiff vs. jiggly the blob is - cvjd.frequencyHz = 10.0f; - cvjd.dampingRatio = 1.0f; - - // Put the joint thing in our world! - box2d.world.createJoint(cvjd); - } - - - // Time to draw the blob! - // Can you make it a cute character, a la http://postspectacular.com/work/nokia/friends/start - void display() { - - // Draw the outline - beginShape(); - noFill(); - stroke(0); - strokeWeight(1); - for (Body b: skeleton) { - Vec2 pos = box2d.getBodyPixelCoord(b); - vertex(pos.x, pos.y); - } - endShape(CLOSE); - - // Draw the individual circles - for (Body b: skeleton) { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(b); - // Get its angle of rotation - float a = b.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0, 0, bodyRadius*2, bodyRadius*2); - popMatrix(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde deleted file mode 100644 index d5df8e919..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Blobby.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A blob skeleton -// Could be used to create blobbly characters a la Nokia Friends -// http://postspectacular.com/work/nokia/friends/start - -// This seems to be broken with the Box2D 2.1.2 version I'm using - -import pbox2d.*; - -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.joints.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Our "blob" object -Blob blob; - - void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add some boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10)); - boundaries.add(new Boundary(width/2,5,width,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); - - // Make a new blob - blob = new Blob(); -} - - void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Show the blob! - blob.display(); - - // Show the boundaries! - for (Boundary wall: boundaries) { - wall.display(); - } - - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Blobby/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde deleted file mode 100644 index ff6226252..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Boundary.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - - b.setUserData(this); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde deleted file mode 100644 index 37c6ee51d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/CollisionListeningDeletionExercise.pde +++ /dev/null @@ -1,118 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -Boundary wall; - -void setup() { - size(400, 300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Create the empty list - particles = new ArrayList(); - - wall = new Boundary(width/2, height-5, width, 10); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4, 8); - particles.add(new Particle(random(width), 20, sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - wall.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both shapes - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - if (o1.getClass() == Particle.class && o2.getClass() == Particle.class) { - Particle p1 = (Particle) o1; - p1.delete(); - Particle p2 = (Particle) o2; - p2.delete(); - } - - if (o1.getClass() == Boundary.class) { - Particle p = (Particle) o2; - p.change(); - } - if (o2.getClass() == Boundary.class) { - Particle p = (Particle) o1; - p.change(); - } - - -} - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde deleted file mode 100644 index 5a4017c84..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionListeningDeletionExercise/Particle.pde +++ /dev/null @@ -1,95 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - boolean delete = false; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - void delete() { - delete = true; - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2 || delete) { - killBody(); - return true; - } - return false; - } - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde deleted file mode 100644 index 1fb05d066..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde deleted file mode 100644 index 7ddaa71b6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/CollisionsAndControl.pde +++ /dev/null @@ -1,150 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// The Spring that will attach to the box from the mouse -Spring spring; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - spring.bind(width/2,height/2,box); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - spring.update(mouseX,mouseY); - spring.display(); - } else { - spring.update(x,y); - } - box.body.setAngularVelocity(0); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } -} - - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde deleted file mode 100644 index 50be57e86..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Particle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde deleted file mode 100644 index cca069b90..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControl/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Wake up body! - //box.body.wakeUp(); - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde deleted file mode 100644 index 1fb05d066..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Box.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde deleted file mode 100644 index 08df03156..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/CollisionsAndControlInterface.pde +++ /dev/null @@ -1,111 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// The Spring that will attach to the box from the mouse -Spring spring; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Add a listener to listen for collisions! - box2d.world.setContactListener(new CustomListener()); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - spring.bind(width/2,height/2,box); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - spring.update(mouseX,mouseY); - } else { - spring.update(x,y); - } - //box.body.setAngularVelocity(0); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde deleted file mode 100644 index 48b5f659e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/ContactListener.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// ContactListener to listen for collisions! - -import org.jbox2d.callbacks.ContactImpulse; -import org.jbox2d.callbacks.ContactListener; -import org.jbox2d.collision.Manifold; -import org.jbox2d.dynamics.contacts.Contact; - - class CustomListener implements ContactListener { - CustomListener() { - } - - // This function is called when a new collision occurs - void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } - } - - void endContact(Contact contact) { - // TODO Auto-generated method stub - } - - void preSolve(Contact contact, Manifold oldManifold) { - // TODO Auto-generated method stub - } - - void postSolve(Contact contact, ContactImpulse impulse) { - // TODO Auto-generated method stub - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde deleted file mode 100644 index 50be57e86..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Particle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde deleted file mode 100644 index c16494932..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/CollisionsAndControlInterface/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = null; - mouseJoint.getAnchorA(v1); - Vec2 v2 = null; - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0f * box.body.m_mass; - md.frequencyHz = 5.0f; - md.dampingRatio = 0.9f; - - // Wake up body! - //box.body.wakeUp(); - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde deleted file mode 100644 index 7847ff65f..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Box.pde +++ /dev/null @@ -1,96 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(8,16); - h = w; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - void attract(float x,float y) { - // From BoxWrap2D example - Vec2 worldTarget = box2d.coordPixelsToWorld(x,y); - Vec2 bodyVec = body.getWorldCenter(); - // First find the vector going from this body to the specified point - worldTarget.subLocal(bodyVec); - // Then, scale the vector to the specified force - worldTarget.normalize(); - worldTarget.mulLocal((float) 50); - // Now apply it to the body's center of mass. - body.applyForce(worldTarget, bodyVec); - } - - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde deleted file mode 100644 index 63bf2617b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceAttractMouse/Exercise_5_10_ApplyForceAttractMouse.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - if (random(1) < 0.1) { - Box p = new Box(random(width),10); - boxes.add(p); - } - - if (mousePressed) { - for (Box b: boxes) { - b.attract(mouseX,mouseY); - } - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - fill(0); - text("Click mouse to attract boxes",20,20); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde deleted file mode 100644 index 92c4f0280..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Box.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(8, 16); - h = w; - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - void applyForce(Vec2 force) { - Vec2 pos = body.getWorldCenter(); - body.applyForce(force, pos); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(175); - stroke(0); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.2; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - bd.angle = random(TWO_PI); - - body = box2d.createBody(bd); - body.createFixture(fd); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde deleted file mode 100644 index fa0b3f89c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_ApplyForceSimpleWind/Exercise_5_10_ApplyForceSimpleWind.pde +++ /dev/null @@ -1,83 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-100,10)); - boundaries.add(new Boundary(3*width/4,height-5,width/2-100,10)); - boundaries.add(new Boundary(width-5,height/2,10,height)); - boundaries.add(new Boundary(5,height/2,10,height)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - if (random(1) < 0.1) { - Box p = new Box(random(width),10); - boxes.add(p); - } - - if (mousePressed) { - for (Box b: boxes) { - Vec2 wind = new Vec2(20,0); - b.applyForce(wind); - } - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - fill(0); - text("Click mouse to apply a wind force.",20,20); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde deleted file mode 100644 index 2a9bd9e38..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Attractor.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -// Fixed Attractor (this is redundant with Mover) - -class Attractor { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Attractor(float r_, float x, float y) { - r = r_; - // Define a body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - body.createFixture(cs,1); - - } - - - // Formula for gravitational attraction - // We are computing this in "world" coordinates - // No need to convert to pixels and back - Vec2 attract(Mover m) { - float G = 100; // Strength of force - // clone() makes us a copy - Vec2 pos = body.getWorldCenter(); - Vec2 moverPos = m.body.getWorldCenter(); - // Vector pointing from mover to attractor - Vec2 force = pos.sub(moverPos); - float distance = force.length(); - // Keep force within bounds - distance = constrain(distance,1,5); - force.normalize(); - // Note the attractor's mass is 0 because it's fixed so can't use that - float strength = (G * 1 * m.body.m_mass) / (distance * distance); // Calculate gravitional force magnitude - force.mulLocal(strength); // Get force vector --> magnitude * direction - return force; - } - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde deleted file mode 100644 index c85c91956..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Exercise_5_10_AttractionApplyForce.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// Movers, jsut like before! -Mover[] movers = new Mover[25]; - -// Attractor, just like before! -Attractor a; - -void setup() { - size(800,200); - box2d = new PBox2D(this); - box2d.createWorld(); - // No global gravity force - box2d.setGravity(0,0); - - for (int i = 0; i < movers.length; i++) { - movers[i] = new Mover(random(8,16),random(width),random(height)); - } - a = new Attractor(32,width/2,height/2); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - a.display(); - - for (int i = 0; i < movers.length; i++) { - // Look, this is just like what we had before! - Vec2 force = a.attract(movers[i]); - movers[i].applyForce(force); - movers[i].display(); - } -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde deleted file mode 100644 index df8cafcc5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_10_AttractionApplyForce/Mover.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Showing how to use applyForce() with box2d - -class Mover { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Mover(float r_, float x, float y) { - r = r_; - // Define a body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - - body.setLinearVelocity(new Vec2(random(-5,5),random(-5,-5))); - body.setAngularVelocity(random(-1,1)); - } - - void applyForce(Vec2 v) { - body.applyForce(v, body.getWorldCenter()); - } - - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde deleted file mode 100644 index d4f75ecd5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Exercise_5_3_NoiseChain.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(383,200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (mousePressed) { - float sz = random(2,6); - particles.add(new Particle(mouseX,mouseY,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde deleted file mode 100644 index 05783d49e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde deleted file mode 100644 index 211874b0d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_NoiseChain/Surface.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - // Perlin noise argument - float xoff = 0.0; - - // This has to go backwards so that the objects bounce off the top of the surface - // This "edgechain" will only work in one direction! - for (float x = width+10; x > -10; x -= 5) { - - // Doing some stuff with perlin noise to calculate a surface that points down on one side - // and up on the other - float y; - if (x > width/2) { - y = 50 + (width - x)*1.1 + map(noise(xoff),0,1,-80,80); - } - else { - y = 50 + x*1.1 + map(noise(xoff),0,1,-40,40); - } - - // Store the vertex in screen coordinates - surface.add(new Vec2(x,y)); - - // Move through perlin noise - xoff += 0.1; - - } - - // Build an array of vertices in Box2D coordinates - // from the ArrayList we made - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - Vec2 edge = box2d.coordPixelsToWorld(surface.get(i)); - vertices[i] = edge; - } - - // Create the chain! - chain.createChain(vertices,vertices.length); - - // The edge chain is now attached to a body via a fixture - BodyDef bd = new BodyDef(); - bd.position.set(0.0f,0.0f); - Body body = box2d.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain,1); - - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(2); - stroke(0); - noFill(); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x,v.y); - } - endShape(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde deleted file mode 100644 index b313ef3ce..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Exercise_5_3_SineChain.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(383,200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (random(1) < 0.5) { - float sz = random(2,6); - particles.add(new Particle(width/2,10,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde deleted file mode 100644 index 05783d49e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - stroke(0); - strokeWeight(1); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde deleted file mode 100644 index 3be00b5a9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_3_SineChain/Surface.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - float theta = 0; - - // This has to go backwards so that the objects bounce off the top of the surface - // This "edgechain" will only work in one direction! - for (float x = width+10; x > -10; x -= 5) { - - // Doing some stuff with perlin noise to calculate a surface that points down on one side - // and up on the other - float y = map(cos(theta),-1,1,75,height-10); - theta += 0.15; - - // Store the vertex in screen coordinates - surface.add(new Vec2(x,y)); - - } - - // Build an array of vertices in Box2D coordinates - // from the ArrayList we made - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - Vec2 edge = box2d.coordPixelsToWorld(surface.get(i)); - vertices[i] = edge; - } - - // Create the chain! - chain.createChain(vertices,vertices.length); - - // The edge chain is now attached to a body via a fixture - BodyDef bd = new BodyDef(); - bd.position.set(0.0f,0.0f); - Body body = box2d.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain,1); - - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(2); - stroke(0); - noFill(); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x,v.y); - } - endShape(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde deleted file mode 100644 index f872679b9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Box.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(4, 16); - h = random(4, 16); - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - stroke(0); - fill(127); - strokeWeight(2); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde deleted file mode 100644 index eafb42cdc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Bridge.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Series of Particles connected with distance joints - -class Bridge { - - // Bridge properties - float totalLength; // How long - int numPoints; // How many points - - // Our chain is a list of particles - ArrayList particles; - - // Chain constructor - Bridge(float l, int n) { - - totalLength = l; - numPoints = n; - - particles = new ArrayList(); - - float len = totalLength / numPoints; - - // Here is the real work, go through and add particles to the chain itself - for(int i=0; i < numPoints+1; i++) { - // Make a new particle - Particle p = null; - - // First and last particles are made with density of zero - if (i == 0 || i == numPoints) p = new Particle(i*len,height/4,4,true); - else p = new Particle(i*len,height/4,4,false); - particles.add(p); - - // Connect the particles with a distance joint - if (i > 0) { - DistanceJointDef djd = new DistanceJointDef(); - Particle previous = particles.get(i-1); - // Connection between previous particle and this one - djd.bodyA = previous.body; - djd.bodyB = p.body; - // Equilibrium length - djd.length = box2d.scalarPixelsToWorld(len); - // These properties affect how springy the joint is - djd.frequencyHz = 0; - djd.dampingRatio = 0; - - // Make the joint. Note we aren't storing a reference to the joint ourselves anywhere! - // We might need to someday, but for now it's ok - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - } - } - } - - // Draw the bridge - void display() { - for (Particle p: particles) { - p.display(); - } - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde deleted file mode 100644 index 2946efe93..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Exercise_5_6_Bridge.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating distance joints -// A bridge is formed by connected a series of particles with joints - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An object to describe a Bridget (a list of particles with joint connections) -Bridge bridge; - -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(800, 200); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - - // Make the bridge - bridge = new Bridge(width, width/10); - - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - - // When the mouse is clicked, add a new Box object - if (mousePressed) { - Box p = new Box(mouseX, mouseY); - boxes.add(p); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } - - // Draw the windmill - bridge.display(); - - - fill(0); - //text("Click mouse to add boxes.", 10, height-10); -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde deleted file mode 100644 index c545127cc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Exercise_5_6_Bridge/Particle.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_, boolean fixed) { - r = r_; - - // Define a body - BodyDef bd = new BodyDef(); - if (fixed) bd.type = BodyType.STATIC; - else bd.type = BodyType.DYNAMIC; - - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - stroke(0); - fill(127); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde deleted file mode 100644 index c6a8aed73..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Box.pde +++ /dev/null @@ -1,102 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - boolean dragged = false; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - void setAngularVelocity(float a) { - body.setAngularVelocity(a); - } - void setVelocity(Vec2 v) { - body.setLinearVelocity(v); - } - - void setLocation(float x, float y) { - Vec2 pos = body.getWorldCenter(); - Vec2 target = box2d.coordPixelsToWorld(x,y); - Vec2 diff = new Vec2(target.x-pos.x,target.y-pos.y); - diff.mulLocal(50); - setVelocity(diff); - setAngularVelocity(0); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.KINEMATIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - bd.fixedRotation = true; - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - ps.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = ps; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde deleted file mode 100644 index 758299639..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/KinematicTest.pde +++ /dev/null @@ -1,141 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// Just a single box this time -Box box; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// Perlin noise values -float xoff = 0; -float yoff = 1000; - - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Make the box - box = new Box(width/2,height/2); - - // Create the empty list - particles = new ArrayList(); - - -} - -void draw() { - background(255); - - if (random(1) < 0.2) { - float sz = random(4,8); - particles.add(new Particle(width/2,-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Make an x,y coordinate out of perlin noise - float x = noise(xoff)*width; - float y = noise(yoff)*height; - xoff += 0.01; - yoff += 0.01; - - // This is tempting but will not work! - // box.body.setXForm(box2d.screenToWorld(x,y),0); - - // Instead update the spring which pulls the mouse along - if (mousePressed) { - box.setLocation(mouseX,mouseY); - } else { - //box.setLocation(x,y); - } - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the box - box.display(); - - // Draw the spring - // spring.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - // If object 1 is a Box, then object 2 must be a particle - // Note we are ignoring particle on particle collisions - if (o1.getClass() == Box.class) { - Particle p = (Particle) o2; - p.change(); - } - // If object 2 is a Box, then object 1 must be a particle - else if (o2.getClass() == Box.class) { - Particle p = (Particle) o1; - p.change(); - } -} - - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde deleted file mode 100644 index 12c50f772..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/KinematicTest/Particle.pde +++ /dev/null @@ -1,93 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// PBox2D example - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(175); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(1); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde deleted file mode 100644 index 71c6a82d0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde deleted file mode 100644 index fa7ab19aa..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Liquidy.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Box2D particle system example - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - - - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// A list for all particle systems -ArrayList systems; - -void setup() { - size(400,300); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - systems = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(50,100,300,5,-0.3)); - boundaries.add(new Boundary(250,175,300,5,0.5)); - -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Run all the particle systems - for (ParticleSystem system: systems) { - system.run(); - - int n = (int) random(0,2); - system.addParticles(n); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } -} - - -void mousePressed() { - // Add a new Particle System whenever the mouse is clicked - systems.add(new ParticleSystem(0, new PVector(mouseX,mouseY))); -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde deleted file mode 100644 index dd1f4f564..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/Particle.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A Particle - -class Particle { - - // We need to keep track of a Body - Body body; - - PVector[] trail; - - // Constructor - Particle(float x_, float y_) { - float x = x_; - float y = y_; - trail = new PVector[6]; - for (int i = 0; i < trail.length; i++) { - trail[i] = new PVector(x, y); - } - - // Add the box to the box2d world - // Here's a little trick, let's make a tiny tiny radius - // This way we have collisions, but they don't overwhelm the system - makeBody(new Vec2(x, y), 0.2f); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+20) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - - // Keep track of a history of screen positions in an array - for (int i = 0; i < trail.length-1; i++) { - trail[i] = trail[i+1]; - } - trail[trail.length-1] = new PVector(pos.x, pos.y); - - // Draw particle as a trail - beginShape(); - noFill(); - strokeWeight(2); - stroke(0, 150); - for (int i = 0; i < trail.length; i++) { - vertex(trail[i].x, trail[i].y); - } - endShape(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float r) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-1, 1), random(-1, 1))); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - fd.density = 1; - fd.friction = 0; // Slippery when wet! - fd.restitution = 0.5; - - // We could use this if we want to turn collisions off - //cd.filter.groupIndex = -10; - - // Attach fixture to body - body.createFixture(fd); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde deleted file mode 100644 index 08e74e0b4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/Liquidy/ParticleSystem.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Box2D Particle System - -// A class to describe a group of Particles -// An ArrayList is used to manage the list of Particles - -class ParticleSystem { - - ArrayList particles; // An ArrayList for all the particles - PVector origin; // An origin point for where particles are birthed - - ParticleSystem(int num, PVector v) { - particles = new ArrayList(); // Initialize the ArrayList - origin = v.get(); // Store the origin point - - for (int i = 0; i < num; i++) { - particles.add(new Particle(origin.x,origin.y)); // Add "num" amount of particles to the ArrayList - } - } - - void run() { - // Display all the particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } - } - - void addParticles(int n) { - for (int i = 0; i < n; i++) { - particles.add(new Particle(origin.x,origin.y)); - } - } - - // A method to test if the particle system still has particles - boolean dead() { - if (particles.isEmpty()) { - return true; - } - else { - return false; - } - } - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde deleted file mode 100644 index 71c6a82d0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde deleted file mode 100644 index 806f51daa..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/Box.pde +++ /dev/null @@ -1,105 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - boolean dragged = false; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - void setAngularVelocity(float a) { - body.setAngularVelocity(a); - } - void setVelocity(Vec2 v) { - body.setLinearVelocity(v); - } - - void setLocation(float x, float y) { - Vec2 pos = body.getWorldCenter(); - Vec2 target = box2d.coordPixelsToWorld(x,y); - Vec2 diff = target.sub(pos); - diff.mulLocal(50); - setVelocity(diff); - setAngularVelocity(0); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(175); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.KINEMATIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde deleted file mode 100644 index a2e2bdba3..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/MouseKinematic/MouseKinematic.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with the mouse (by attaching a spring) - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Just a single box this time -Box box; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the box - box = new Box(width/2,height/2); - - // Add a bunch of fixed boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10,0)); - boundaries.add(new Boundary(width/2,5,width,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - - -void draw() { - background(255); - - // We must always step through time! - - //if (box.dragged) { - box.setLocation(mouseX,mouseY); - //} - - box2d.step(); - - // Draw the boundaries - for (Boundary wall : boundaries) { - wall.display(); - } - - // Draw the box - box.display(); - - -} - -void mousePressed() { - if (box.contains(mouseX,mouseY)) { - box.dragged = true; - } -} - -void mouseReleased() { - box.dragged = false; -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde deleted file mode 100644 index e9774abf0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/Box.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - float x,y; - float w,h; - - // Constructor - Box(float x_, float y_) { - x = x_; - y = y_; - w = 16; - h = 16; - } - - // Drawing the box - void display() { - fill(127); - stroke(0); - strokeWeight(2); - rectMode(CENTER); - rect(x,y,w,h); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde deleted file mode 100644 index 111643b0c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise/NOC_5_1_box2d_exercise.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // When the mouse is clicked, add a new Box object - if (mousePressed) { - Box p = new Box(mouseX,mouseY); - boxes.add(p); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde deleted file mode 100644 index 2be8fa137..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/Box.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - // Instead of any of the usual variables, we will store a reference to a Box2D Body - Body body; - - float w,h; - - Box(float x, float y) { - w = 16; - h = 16; - - // Build Body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - body = box2d.createBody(bd); - - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); // Box2D considers the width and height of a - ps.setAsBox(box2dW, box2dH); // rectangle to be the distance from the - // center to the edge (so half of what we - // normally think of as width or height.) - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = ps; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Attach Fixture to Body - body.createFixture(fd); - } - - void display() { - // We need the Body’s location and angle - Vec2 pos = box2d.getBodyPixelCoord(body); - float a = body.getAngle(); - - pushMatrix(); - translate(pos.x,pos.y); // Using the Vec2 position and float angle to - rotate(-a); // translate and rotate the rectangle - fill(127); - stroke(0); - strokeWeight(2); - rectMode(CENTER); - rect(0,0,w,h); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde deleted file mode 100644 index 22d39e2a9..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_1_box2d_exercise_solved/NOC_5_1_box2d_exercise_solved.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A list for all of our rectangles -ArrayList boxes; - -PBox2D box2d; - -void setup() { - size(640, 360); - // Initialize and create the Box2D world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Create ArrayLists - boxes = new ArrayList(); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - Box p = new Box(mouseX, mouseY); - boxes.add(p); - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde deleted file mode 100644 index 54e662ceb..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape ps = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - ps.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(ps,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde deleted file mode 100644 index 344e1f108..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/Box.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y) { - w = random(4, 16); - h = random(4, 16); - // Add the box to the box2d world - makeBody(new Vec2(x, y), w, h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0, 0, w, h); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde deleted file mode 100644 index 23193aa97..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_2_Boxes/NOC_5_2_Boxes.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList boxes; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create ArrayLists - boxes = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Boxes fall from the top every so often - if (random(1) < 0.2) { - Box p = new Box(width/2,30); - boxes.add(p); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the boxes - for (Box b: boxes) { - b.display(); - } - - // Boxes that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = boxes.size()-1; i >= 0; i--) { - Box b = boxes.get(i); - if (b.done()) { - boxes.remove(i); - } - } -} - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde deleted file mode 100644 index cee4a66e1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/NOC_5_3_ChainShape_Simple.pde +++ /dev/null @@ -1,69 +0,0 @@ -// The Nature of Code -// -// Spring 2011 -// PBox2D example - -// An uneven surface - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -// An object to store information about the uneven surface -Surface surface; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -10); - - // Create the empty list - particles = new ArrayList(); - // Create the surface - surface = new Surface(); -} - -void draw() { - // If the mouse is pressed, we make new particles - if (random(1) < 0.5) { - float sz = random(4,8); - particles.add(new Particle(width/2,10,sz)); - } - - // We must always step through time! - box2d.step(); - - background(255); - - // Draw the surface - surface.display(); - - // Draw all particles - for (Particle p: particles) { - p.display(); - } - - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - if (p.done()) { - particles.remove(i); - } - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde deleted file mode 100644 index a7d390361..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Particle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x,y,r); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10,10)); - } - - - - - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde deleted file mode 100644 index 09da0d535..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_3_ChainShape_Simple/Surface.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An uneven surface boundary - -class Surface { - // We'll keep track of all of the surface points - ArrayList surface; - - - Surface() { - surface = new ArrayList(); - // Here we keep track of the screen coordinates of the chain - surface.add(new Vec2(0, height/2)); - surface.add(new Vec2(width/2, height/2+50)); - surface.add(new Vec2(width, height/2)); - - // This is what box2d uses to put the surface in its world - ChainShape chain = new ChainShape(); - - // We can add 3 vertices by making an array of 3 Vec2 objects - Vec2[] vertices = new Vec2[surface.size()]; - for (int i = 0; i < vertices.length; i++) { - vertices[i] = box2d.coordPixelsToWorld(surface.get(i)); - } - - chain.createChain(vertices, vertices.length); - - // The edge chain is now a body! - BodyDef bd = new BodyDef(); - Body body = box2d.world.createBody(bd); - // Shortcut, we could define a fixture if we - // want to specify frictions, restitution, etc. - body.createFixture(chain, 1); - } - - // A simple function to just draw the edge chain as a series of vertex points - void display() { - strokeWeight(1); - stroke(0); - fill(0); - beginShape(); - for (Vec2 v: surface) { - vertex(v.x, v.y); - } - vertex(width, height); - vertex(0, height); - endShape(CLOSE); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde deleted file mode 100644 index ebf6b04bf..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/Boundary.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, it doesn't move so we don't have to ask the Body for location - void display() { - fill(0); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - float a = b.getAngle(); - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde deleted file mode 100644 index 9e0180a59..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/CustomShape.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class CustomShape { - - // We need to keep track of a Body and a width and height - Body body; - - // Constructor - CustomShape(float x, float y) { - // Add the box to the box2d world - makeBody(new Vec2(x, y)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height) { - killBody(); - return true; - } - return false; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - Fixture f = body.getFixtureList(); - PolygonShape ps = (PolygonShape) f.getShape(); - - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - beginShape(); - //println(vertices.length); - // For every vertex, convert to pixel vector - for (int i = 0; i < ps.getVertexCount(); i++) { - Vec2 v = box2d.vectorWorldToPixels(ps.getVertex(i)); - vertex(v.x, v.y); - } - endShape(CLOSE); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center) { - - Vec2[] vertices = new Vec2[4]; - vertices[0] = box2d.vectorPixelsToWorld(new Vec2(-15, 25)); - vertices[1] = box2d.vectorPixelsToWorld(new Vec2(15, 0)); - vertices[2] = box2d.vectorPixelsToWorld(new Vec2(20, -15)); - vertices[3] = box2d.vectorPixelsToWorld(new Vec2(-10, -10)); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape ps = new PolygonShape(); - ps.set(vertices, vertices.length); - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - body.createFixture(ps, 1.0); - - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde deleted file mode 100644 index 283741835..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_4_Polygons/NOC_5_4_Polygons.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList polygons; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - polygons = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10,0)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the people - for (CustomShape cs: polygons) { - cs.display(); - } - - // people that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = polygons.size()-1; i >= 0; i--) { - CustomShape cs = polygons.get(i); - if (cs.done()) { - polygons.remove(i); - } - } -} - -void mousePressed() { - CustomShape cs = new CustomShape(mouseX,mouseY); - polygons.add(cs); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde deleted file mode 100644 index afe2ab2f5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Boundary.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde deleted file mode 100644 index 65805e008..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/Lollipop.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box -class Lollipop { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - float r; - - // Constructor - Lollipop(float x, float y) { - w = 8; - h = 24; - r = 8; - // Add the box to the box2d world - makeBody(new Vec2(x, y)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+w*h) { - killBody(); - return true; - } - return false; - } - - // Drawing the lollipop - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x, pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - - rect(0,0,w,h); - ellipse(0, -h/2, r*2, r*2); - popMatrix(); - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center) { - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - CircleShape circle = new CircleShape(); - circle.m_radius = box2d.scalarPixelsToWorld(r); - Vec2 offset = new Vec2(0,-h/2); - offset = box2d.vectorPixelsToWorld(offset); - circle.m_p.set(offset.x,offset.y); - - PolygonShape ps = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - ps.setAsBox(box2dW, box2dH); - - body.createFixture(ps,1.0); - body.createFixture(circle, 1.0); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde deleted file mode 100644 index 132b03ba6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_5_MultiShapes/NOC_5_5_MultiShapes.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of falling rectangles - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; -// A list for all of our rectangles -ArrayList pops; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this,20); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0, -20); - - // Create ArrayLists - pops = new ArrayList(); - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10,0)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - // Display all the people - for (Lollipop p: pops) { - p.display(); - } - - // people that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - for (int i = pops.size()-1; i >= 0; i--) { - Lollipop p = pops.get(i); - if (p.done()) { - pops.remove(i); - } - } -} - -void mousePressed() { - Lollipop p = new Lollipop(mouseX,mouseY); - pops.add(p); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde deleted file mode 100644 index 9a17026a1..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Boundary.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde deleted file mode 100644 index 489468ebb..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/NOC_5_6_DistanceJoint.pde +++ /dev/null @@ -1,78 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating distance joints -// A bridge is formed by connected a series of particles with joints - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - - -// A list for all of our rectangles -ArrayList pairs; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Create ArrayLists - pairs = new ArrayList(); - - boundaries = new ArrayList(); - - // Add a bunch of fixed boundaries - boundaries.add(new Boundary(width/4,height-5,width/2-50,10)); - boundaries.add(new Boundary(3*width/4,height-50,width/2-50,10)); - -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // When the mouse is clicked, add a new Box object - - // Display all the boxes - for (Pair p: pairs) { - p.display(); - } - - // Display all the boundaries - for (Boundary wall: boundaries) { - wall.display(); - } - - fill(0); - text("Click mouse to add connected particles.",10,20); -} - -void mousePressed() { - Pair p = new Pair(mouseX,mouseY); - pairs.add(p); -} - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde deleted file mode 100644 index 780a8e316..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Pair.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Series of Particles connected with distance joints - -class Pair { - - Particle p1; - Particle p2; - - float len; - // Chain constructor - Pair(float x, float y) { - len = 32; - - p1 = new Particle(x,y); - p2 = new Particle(x+random(-1,1),y+random(-1,1)); - - DistanceJointDef djd = new DistanceJointDef(); - // Connection between previous particle and this one - djd.bodyA = p1.body; - djd.bodyB = p2.body; - // Equilibrium length - djd.length = box2d.scalarPixelsToWorld(len); - - // These properties affect how springy the joint is - djd.frequencyHz = 3; // Try a value less than 5 (0 for no elasticity) - djd.dampingRatio = 0.1; // Ranges between 0 and 1 (1 for no springiness) - - // Make the joint. Note we aren't storing a reference to the joint ourselves anywhere! - // We might need to someday, but for now it's ok - DistanceJoint dj = (DistanceJoint) box2d.world.createJoint(djd); - } - - void display() { - Vec2 pos1 = box2d.getBodyPixelCoord(p1.body); - Vec2 pos2 = box2d.getBodyPixelCoord(p2.body); - stroke(0); - strokeWeight(2); - line(pos1.x,pos1.y,pos2.x,pos2.y); - - p1.display(); - p2.display(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde deleted file mode 100644 index ed3d34199..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_6_DistanceJoint/Particle.pde +++ /dev/null @@ -1,76 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y) { - r = 8; - - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x,y); - bd.type = BodyType.DYNAMIC; - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0,0,r*2,r*2); - // Let's add a line so we can see the rotation - line(0,0,r,0); - popMatrix(); - } - - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde deleted file mode 100644 index acf4abdec..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Box.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x, float y, float w_, float h_, boolean lock) { - w = w_; - h = h_; - - // Define and create the body - BodyDef bd = new BodyDef(); - bd.position.set(box2d.coordPixelsToWorld(new Vec2(x,y))); - if (lock) bd.type = BodyType.STATIC; - else bd.type = BodyType.DYNAMIC; - - body = box2d.createBody(bd); - - // Define the shape -- a (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5,5),random(2,5))); - body.setAngularVelocity(random(-5,5)); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0,0,w,h); - popMatrix(); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde deleted file mode 100644 index 74ab0e3f2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/NOC_5_7_RevoluteJoint.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Example demonstrating revolute joint - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An object to describe a Windmill (two bodies and one joint) -Windmill windmill; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the windmill at an x,y location - windmill = new Windmill(width/2,175); - - // Create the empty list - particles = new ArrayList(); - -} - -// Click the mouse to turn on or off the motor -void mousePressed() { - windmill.toggleMotor(); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4,8); - particles.add(new Particle(random(width/2-100,width/2+100),-20,sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - // Draw the windmill - windmill.display(); - - String status = "OFF"; - if (windmill.motorOn()) status = "ON"; - - fill(0); - text("Click mouse to toggle motor.\nMotor: " + status,10,height-30); - - -} - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde deleted file mode 100644 index 89fb8b443..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Particle.pde +++ /dev/null @@ -1,84 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - - rotate(-a); - fill(127); - stroke(0); - strokeWeight(2); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - - body = box2d.world.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - - fd.density = 2.0; - fd.friction = 0.01; - fd.restitution = 0.3; // Restitution is bounciness - - body.createFixture(fd); - - // Give it a random initial velocity (and angular velocity) - //body.setLinearVelocity(new Vec2(random(-10f,10f),random(5f,10f))); - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde deleted file mode 100644 index 5a819a81e..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_7_RevoluteJoint/Windmill.pde +++ /dev/null @@ -1,61 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe a fixed spinning object - -class Windmill { - - // Our object is two boxes and one joint - // Consider making the fixed box much smaller and not drawing it - RevoluteJoint joint; - Box box1; - Box box2; - - Windmill(float x, float y) { - - // Initialize locations of two boxes - box1 = new Box(x, y-20, 120, 10, false); - box2 = new Box(x, y, 10, 40, true); - - // Define joint as between two bodies - RevoluteJointDef rjd = new RevoluteJointDef(); - - rjd.initialize(box1.body, box2.body, box1.body.getWorldCenter()); - - // Turning on a motor (optional) - rjd.motorSpeed = PI*2; // how fast? - rjd.maxMotorTorque = 1000.0; // how powerful? - rjd.enableMotor = false; // is it on? - - // There are many other properties you can set for a Revolute joint - // For example, you can limit its angle between a minimum and a maximum - // See box2d manual for more - - - // Create the joint - joint = (RevoluteJoint) box2d.world.createJoint(rjd); - } - - // Turn the motor on or off - void toggleMotor() { - joint.enableMotor(!joint.isMotorEnabled()); - } - - boolean motorOn() { - return joint.isMotorEnabled(); - } - - - void display() { - box2.display(); - box1.display(); - - // Draw anchor just for debug - Vec2 anchor = box2d.coordWorldToPixels(box1.body.getWorldCenter()); - fill(0); - noStroke(); - ellipse(anchor.x, anchor.y, 8, 8); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde deleted file mode 100644 index 61491af26..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Boundary.pde +++ /dev/null @@ -1,62 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class (now incorporates angle) - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_, float a) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.angle = a; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - noFill(); - stroke(127); - fill(127); - strokeWeight(1); - rectMode(CENTER); - - float a = b.getAngle(); - - pushMatrix(); - translate(x,y); - rotate(-a); - rect(0,0,w,h); - popMatrix(); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde deleted file mode 100644 index db935b7a4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Box.pde +++ /dev/null @@ -1,88 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A rectangular box - -class Box { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - // Constructor - Box(float x_, float y_) { - float x = x_; - float y = y_; - w = 24; - h = 24; - // Add the box to the box2d world - makeBody(new Vec2(x,y),w,h); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - boolean contains(float x, float y) { - Vec2 worldPoint = box2d.coordPixelsToWorld(x, y); - Fixture f = body.getFixtureList(); - boolean inside = f.testPoint(worldPoint); - return inside; - } - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(PConstants.CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(a); - fill(127); - stroke(0); - strokeWeight(2); - rect(0,0,w,h); - popMatrix(); - } - - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_) { - // Define and create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - body = box2d.createBody(bd); - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - body.createFixture(fd); - //body.setMassFromShapes(); - - // Give it some initial random velocity - body.setLinearVelocity(new Vec2(random(-5, 5), random(2, 5))); - body.setAngularVelocity(random(-5, 5)); - } - -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde deleted file mode 100644 index 0d77536d6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/NOC_5_8_MouseJoint.pde +++ /dev/null @@ -1,83 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with the mouse (by attaching a spring) - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -// A list we'll use to track fixed objects -ArrayList boundaries; - -// Just a single box this time -Box box; - -// The Spring that will attach to the box from the mouse -Spring spring; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Make the box - box = new Box(width/2,height/2); - - // Make the spring (it doesn't really get initialized until the mouse is clicked) - spring = new Spring(); - - // Add a bunch of fixed boundaries - boundaries = new ArrayList(); - boundaries.add(new Boundary(width/2,height-5,width,10,0)); - boundaries.add(new Boundary(width/2,5,width,10,0)); - boundaries.add(new Boundary(width-5,height/2,10,height,0)); - boundaries.add(new Boundary(5,height/2,10,height,0)); -} - -// When the mouse is released we're done with the spring -void mouseReleased() { - spring.destroy(); -} - -// When the mouse is pressed we. . . -void mousePressed() { - // Check to see if the mouse was clicked on the box - if (box.contains(mouseX, mouseY)) { - // And if so, bind the mouse location to the box with a spring - spring.bind(mouseX,mouseY,box); - } -} - -void draw() { - background(255); - - // We must always step through time! - box2d.step(); - - // Always alert the spring to the new mouse location - spring.update(mouseX,mouseY); - - // Draw the boundaries - for (int i = 0; i < boundaries.size(); i++) { - Boundary wall = (Boundary) boundaries.get(i); - wall.display(); - } - - // Draw the box - box.display(); - // Draw the spring (it only appears when active) - spring.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde deleted file mode 100644 index 4daa97765..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_8_MouseJoint/Spring.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Class to describe the spring joint (displayed as a line) - -class Spring { - - // This is the box2d object we need to create - MouseJoint mouseJoint; - - Spring() { - // At first it doesn't exist - mouseJoint = null; - } - - // If it exists we set its target to the mouse location - void update(float x, float y) { - if (mouseJoint != null) { - // Always convert to world coordinates! - Vec2 mouseWorld = box2d.coordPixelsToWorld(x,y); - mouseJoint.setTarget(mouseWorld); - } - } - - void display() { - if (mouseJoint != null) { - // We can get the two anchor points - Vec2 v1 = new Vec2(0,0); - mouseJoint.getAnchorA(v1); - Vec2 v2 = new Vec2(0,0); - mouseJoint.getAnchorB(v2); - // Convert them to screen coordinates - v1 = box2d.coordWorldToPixels(v1); - v2 = box2d.coordWorldToPixels(v2); - // And just draw a line - stroke(0); - strokeWeight(1); - line(v1.x,v1.y,v2.x,v2.y); - } - } - - - // This is the key function where - // we attach the spring to an x,y location - // and the Box object's location - void bind(float x, float y, Box box) { - // Define the joint - MouseJointDef md = new MouseJointDef(); - // Body A is just a fake ground body for simplicity (there isn't anything at the mouse) - md.bodyA = box2d.getGroundBody(); - // Body 2 is the box's boxy - md.bodyB = box.body; - // Get the mouse location in world coordinates - Vec2 mp = box2d.coordPixelsToWorld(x,y); - // And that's the target - md.target.set(mp); - // Some stuff about how strong and bouncy the spring should be - md.maxForce = 1000.0 * box.body.m_mass; - md.frequencyHz = 5.0; - md.dampingRatio = 0.9; - - // Make the joint! - mouseJoint = (MouseJoint) box2d.world.createJoint(md); - } - - void destroy() { - // We can get rid of the joint when the mouse is released - if (mouseJoint != null) { - box2d.world.destroyJoint(mouseJoint); - mouseJoint = null; - } - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde deleted file mode 100644 index ff6226252..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Boundary.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A fixed boundary class - -class Boundary { - - // A boundary is a simple rectangle with x,y,width,and height - float x; - float y; - float w; - float h; - - // But we also have to make a body for box2d to know about it - Body b; - - Boundary(float x_,float y_, float w_, float h_) { - x = x_; - y = y_; - w = w_; - h = h_; - - // Define the polygon - PolygonShape sd = new PolygonShape(); - // Figure out the box2d coordinates - float box2dW = box2d.scalarPixelsToWorld(w/2); - float box2dH = box2d.scalarPixelsToWorld(h/2); - // We're just a box - sd.setAsBox(box2dW, box2dH); - - - // Create the body - BodyDef bd = new BodyDef(); - bd.type = BodyType.STATIC; - bd.position.set(box2d.coordPixelsToWorld(x,y)); - b = box2d.createBody(bd); - - // Attached the shape to the body using a Fixture - b.createFixture(sd,1); - - b.setUserData(this); - } - - // Draw the boundary, if it were at an angle we'd have to do something fancier - void display() { - fill(0); - stroke(0); - rectMode(CENTER); - rect(x,y,w,h); - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde deleted file mode 100644 index c4b1688c7..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/NOC_5_9_CollisionListening.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Basic example of controlling an object with our own motion (by attaching a MouseJoint) -// Also demonstrates how to know which object was hit - -import pbox2d.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.joints.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.collision.shapes.Shape; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; -import org.jbox2d.dynamics.contacts.*; - -// A reference to our box2d world -PBox2D box2d; - -// An ArrayList of particles that will fall on the surface -ArrayList particles; - -Boundary wall; - -void setup() { - size(640, 360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - - // Turn on collision listening! - box2d.listenForCollisions(); - - // Create the empty list - particles = new ArrayList(); - - wall = new Boundary(width/2, height-5, width, 10); -} - -void draw() { - background(255); - - if (random(1) < 0.1) { - float sz = random(4, 8); - particles.add(new Particle(random(width), 20, sz)); - } - - - // We must always step through time! - box2d.step(); - - // Look at all particles - for (int i = particles.size()-1; i >= 0; i--) { - Particle p = particles.get(i); - p.display(); - // Particles that leave the screen, we delete them - // (note they have to be deleted from both the box2d world and our list - if (p.done()) { - particles.remove(i); - } - } - - wall.display(); -} - - -// Collision event functions! -void beginContact(Contact cp) { - // Get both fixtures - Fixture f1 = cp.getFixtureA(); - Fixture f2 = cp.getFixtureB(); - // Get both bodies - Body b1 = f1.getBody(); - Body b2 = f2.getBody(); - - // Get our objects that reference these bodies - Object o1 = b1.getUserData(); - Object o2 = b2.getUserData(); - - if (o1.getClass() == Particle.class && o2.getClass() == Particle.class) { - Particle p1 = (Particle) o1; - p1.change(); - Particle p2 = (Particle) o2; - p2.change(); - } - -} - -// Objects stop touching each other -void endContact(Contact cp) { -} - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde deleted file mode 100644 index 6d3bf38d5..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/NOC_5_9_CollisionListening/Particle.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A circular particle - -class Particle { - - // We need to keep track of a Body and a radius - Body body; - float r; - - color col; - - Particle(float x, float y, float r_) { - r = r_; - // This function puts the particle in the Box2d world - makeBody(x, y, r); - body.setUserData(this); - col = color(127); - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - // Change color when hit - void change() { - col = color(255, 0, 0); - } - - // Is the particle ready for deletion? - boolean done() { - // Let's find the screen position of the particle - Vec2 pos = box2d.getBodyPixelCoord(body); - // Is it off the bottom of the screen? - if (pos.y > height+r*2) { - killBody(); - return true; - } - return false; - } - - - // - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - // Get its angle of rotation - float a = body.getAngle(); - pushMatrix(); - translate(pos.x, pos.y); - rotate(a); - fill(col); - stroke(0); - strokeWeight(2); - ellipse(0, 0, r*2, r*2); - // Let's add a line so we can see the rotation - line(0, 0, r, 0); - popMatrix(); - } - - // Here's our function that adds the particle to the Box2D world - void makeBody(float x, float y, float r) { - // Define a body - BodyDef bd = new BodyDef(); - // Set its position - bd.position = box2d.coordPixelsToWorld(x, y); - bd.type = BodyType.DYNAMIC; - body = box2d.createBody(bd); - - // Make the body's shape a circle - CircleShape cs = new CircleShape(); - cs.m_radius = box2d.scalarPixelsToWorld(r); - - FixtureDef fd = new FixtureDef(); - fd.shape = cs; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.01; - fd.restitution = 0.3; - - // Attach fixture to body - body.createFixture(fd); - - body.setAngularVelocity(random(-10, 10)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde deleted file mode 100644 index 49345575d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/box2d/VectorStuff/VectorStuff.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Just demo-ing the basics of Vec2 vs. PVector - -import org.jbox2d.common.*; - -void setup() { - size(400,300); -// PVector a = new PVector(1,-1); -// PVector b = new PVector(3,4); -// a.add(b); -// -// PVector a = new PVector(1,-1); -// PVector b = new PVector(3,4); -// PVector c = PVector.add(a,b); -// -// Vec2 a = new Vec2(1,-1); -// Vec2 b = new Vec2(3,4); -// a.addLocal(b); -// -// Vec2 a = new Vec2(1,-1); -// Vec2 b = new Vec2(3,4); -// Vec2 c = a.add(b); -// -// PVector a = new PVector(1,-1); -// float n = 5; -// a.mult(n); -// -// PVector a = new PVector(1,-1); -// float n = 5; -// PVector c = PVector.mult(a,n); -// -// Vec2 a = new Vec2(1,-1); -// float n = 5; -// a.mulLocal(n); -// -// Vec2 a = new Vec2(1,-1); -// float n = 5; -// Vec2 c = a.mul(n); -// -// PVector a = new PVector(1,-1); -// float m = a.mag(); -// a.normalize(); - - Vec2 a = new Vec2(1,-1); - float m = a.length(); - a.normalize(); - println(a.x + "," + a.y); -} - -void draw() { - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt b/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt deleted file mode 100644 index 99d3a27ad..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/readme.txt +++ /dev/null @@ -1,3 +0,0 @@ -For the box2d examples you will need PBox2D! - -https://github.com/shiffman/PBox2D \ No newline at end of file diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde deleted file mode 100644 index 1efcdb2ef..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Blanket.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Blanket { - ArrayList particles; - ArrayList springs; - - Blanket() { - particles = new ArrayList(); - springs = new ArrayList(); - - int w = 20; - int h = 20; - - float len = 10; - float strength = 0.125; - - for(int y=0; y< h; y++) { - for(int x=0; x < w; x++) { - - Particle p = new Particle(new Vec2D(width/2+x*len-w*len/2,y*len)); - physics.addParticle(p); - particles.add(p); - - if (x > 0) { - Particle previous = particles.get(particles.size()-2); - Connection c = new Connection(p,previous,len,strength); - physics.addSpring(c); - springs.add(c); - } - - if (y > 0) { - Particle above = particles.get(particles.size()-w-1); - Connection c=new Connection(p,above,len,strength); - physics.addSpring(c); - springs.add(c); - } - } - } - - Particle topleft= particles.get(0); - topleft.lock(); - - Particle topright = particles.get(w-1); - topright.lock(); - } - - void display() { - for (Connection c : springs) { - c.display(); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde deleted file mode 100644 index bbbe2655c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Connection.pde +++ /dev/null @@ -1,15 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Connection extends VerletSpring2D { - Connection(Particle p1, Particle p2, float len, float strength) { - super(p1,p2,len,strength); - } - - void display() { - stroke(0); - line(a.x,a.y,b.x,b.y); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde deleted file mode 100644 index cf2b469c7..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Exercise_5_13_SoftBodySquareAdapted.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -/** - * This example is adapted from Karsten Schmidt's SoftBodySquare example - */ - -/*

Softbody square demo is showing how to create a 2D square mesh out of - * verlet particles and make it stable enough to avoid total structural - * deformation by including an inner skeleton.

- * - *

Usage: move mouse to drag/deform the square

- */ - -/* - * Copyright (c) 2008-2009 Karsten Schmidt - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -import toxi.physics2d.behaviors.*; -import toxi.physics2d.*; - -import toxi.geom.*; -import toxi.math.*; - -VerletPhysics2D physics; - -Blanket b; - - -void setup() { - size(640,360); - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0,0.1))); - - b = new Blanket(); -} - -void draw() { - - background(255); - - physics.update(); - - b.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde deleted file mode 100644 index c4fef5474..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_13_SoftBodySquareAdapted/Particle.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - Particle(Vec2D loc) { - super(loc); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(175); - stroke(0); - ellipse(x,y,16,16); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde deleted file mode 100644 index db0cfe2c2..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Cluster.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -class Cluster { - - // A cluster is a grouping of nodes - ArrayList nodes; - - float diameter; - - // We initialize a Cluster with a number of nodes, a diameter, and centerpoint - Cluster(int n, float d, Vec2D center) { - - // Initialize the ArrayList - nodes = new ArrayList(); - - // Set the diameter - diameter = d; - - // Create the nodes - for (int i = 0; i < n; i++) { - // We can't put them right on top of each other - nodes.add(new Node(center.add(Vec2D.randomVector()))); - } - - // Connect all the nodes with a Spring - for (int i = 1; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < i; j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - // A Spring needs two particles, a resting length, and a strength - physics.addSpring(new VerletSpring2D(pi,pj,diameter,0.01)); - } - } - } - - void display() { - // Show all the nodes - for (int i = 0; i < nodes.size(); i++) { - Node n = (Node) nodes.get(i); - n.display(); - } - } - - // This functons connects one cluster to another - // Each point of one cluster connects to each point of the other cluster - // The connection is a "VerletMinDistanceSpring" - // A VerletMinDistanceSpring is a string which only enforces its rest length if the - // current distance is less than its rest length. This is handy if you just want to - // ensure objects are at least a certain distance from each other, but don't - // care if it's bigger than the enforced minimum. - void connect(Cluster other) { - ArrayList otherNodes = other.getNodes(); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < otherNodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) otherNodes.get(j); - // Create the spring - physics.addSpring(new VerletMinDistanceSpring2D(pi,pj,(diameter+other.diameter)*0.5,0.05)); - } - } - } - - - // Draw all the internal connections - void showConnections() { - stroke(0,150); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - line(pi.x,pi.y,pj.x,pj.y); - } - } - } - - // Draw all the connections between this Cluster and another Cluster - void showConnections(Cluster other) { - stroke(0,50); - strokeWeight(2); - ArrayList otherNodes = other.getNodes(); - for (int i = 0; i < nodes.size(); i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = 0; j < otherNodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) otherNodes.get(j); - line(pi.x,pi.y,pj.x,pj.y); - } - } - } - - ArrayList getNodes() { - return nodes; - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde deleted file mode 100644 index f3dd8e190..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Exercise_5_15_ForceDirectedGraph.pde +++ /dev/null @@ -1,133 +0,0 @@ -/** - *

Force directed graph, - * heavily based on: fid.gen
- * The Nature of Code
- * Spring 2010

- */ - -/* - * Copyright (c) 2010 Daniel Shiffman - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -import toxi.geom.*; -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; - -// Reference to physics world -VerletPhysics2D physics; - -// A list of cluster objects -ArrayList clusters; - -// Boolean that indicates whether we draw connections or not -boolean showPhysics = true; -boolean showParticles = true; - -// Font -PFont f; - -void setup() { - size(640,360); - f = createFont("Georgia",12,true); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.setWorldBounds(new Rect(10,10,width-20,height-20)); - - // Spawn a new random graph - newGraph(); - -} - -// Spawn a new random graph -void newGraph() { - - // Clear physics - physics.clear(); - - // Create new ArrayList (clears old one) - clusters = new ArrayList(); - - // Create 8 random clusters - for (int i = 0; i < 8; i++) { - Vec2D center = new Vec2D(width/2,height/2); - clusters.add(new Cluster((int) random(3,8),random(20,100),center)); - } - - // All clusters connect to all clusters - for (int i = 0; i < clusters.size(); i++) { - for (int j = i+1; j < clusters.size(); j++) { - Cluster ci = (Cluster) clusters.get(i); - Cluster cj = (Cluster) clusters.get(j); - ci.connect(cj); - } - } - -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Display all points - if (showParticles) { - for (int i = 0; i < clusters.size(); i++) { - Cluster c = (Cluster) clusters.get(i); - c.display(); - } - } - - // If we want to see the physics - if (showPhysics) { - for (int i = 0; i < clusters.size(); i++) { - // Cluster internal connections - Cluster ci = (Cluster) clusters.get(i); - ci.showConnections(); - - // Cluster connections to other clusters - for (int j = i+1; j < clusters.size(); j++) { - Cluster cj = (Cluster) clusters.get(j); - ci.showConnections(cj); - } - } - } - - // Instructions - fill(0); - textFont(f); - text("'p' to display or hide particles\n'c' to display or hide connections\n'n' for new graph",10,20); -} - -// Key press commands -void keyPressed() { - if (key == 'c') { - showPhysics = !showPhysics; - if (!showPhysics) showParticles = true; - } - else if (key == 'p') { - showParticles = !showParticles; - if (!showParticles) showPhysics = true; - } - else if (key == 'n') { - newGraph(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde deleted file mode 100644 index 54dc835b4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/Exercise_5_15_ForceDirectedGraph/Node.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Node class, but inheritance is a nice alternative - -class Node extends VerletParticle2D { - - Node(Vec2D pos) { - super(pos); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(0,150); - stroke(0); - strokeWeight(2); - ellipse(x,y,16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde deleted file mode 100644 index eeaaf48e0..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/NOC_5_10_SimpleSpring.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Toxiclibs Spring - -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; -import toxi.geom.*; - -// Reference to physics world -VerletPhysics2D physics; - -Particle p1; -Particle p2; - -void setup() { - size(640,360); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0,0.5))); - - // Set the world's bounding box - physics.setWorldBounds(new Rect(0,0,width,height)); - - // Make two particles - p1 = new Particle(new Vec2D(width/2,20)); - p2 = new Particle(new Vec2D(width/2+160,20)); - // Lock one in place - p1.lock(); - - // Make a spring connecting both Particles - VerletSpring2D spring=new VerletSpring2D(p1,p2,160,0.01); - - // Anything we make, we have to add into the physics world - physics.addParticle(p1); - physics.addParticle(p2); - physics.addSpring(spring); -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Draw a line between the particles - stroke(0); - strokeWeight(2); - line(p1.x,p1.y,p2.x,p2.y); - - // Display the particles - p1.display(); - p2.display(); - - // Move the second one according to the mouse - if (mousePressed) { - p2.lock(); - p2.x = mouseX; - p2.y = mouseY; - p2.unlock(); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde deleted file mode 100644 index 06bb533dc..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_10_SimpleSpring/Particle.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Notice how we are using inheritance here! - -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - Particle(Vec2D loc) { - super(loc); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(127); - stroke(0); - strokeWeight(2); - ellipse(x,y,32,32); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde deleted file mode 100644 index 91b68c9b6..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Chain.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A soft pendulum (series of connected springs) - -class Chain { - - // Chain properties - float totalLength; // How long - int numPoints; // How many points - float strength; // Strength of springs - float radius; // Radius of ball at tail - - // This list is redundant since we can ask for physics.particles, but in case we have many of these - // it's a convenient to keep track of our own list - ArrayList particles; - - // Let's keep an extra reference to the tail particle - // This is just the last particle in the ArrayList - Particle tail; - - // Some variables for mouse dragging - PVector offset = new PVector(); - boolean dragged = false; - - // Chain constructor - Chain(float l, int n, float r, float s) { - particles = new ArrayList(); - - totalLength = l; - numPoints = n; - radius = r; - strength = s; - - float len = totalLength / numPoints; - - // Here is the real work, go through and add particles to the chain itself - for(int i=0; i < numPoints; i++) { - // Make a new particle with an initial starting location - Particle particle=new Particle(width/2,i*len); - - // Redundancy, we put the particles both in physics and in our own ArrayList - physics.addParticle(particle); - particles.add(particle); - - // Connect the particles with a Spring (except for the head) - if (i != 0) { - Particle previous = particles.get(i-1); - VerletSpring2D spring = new VerletSpring2D(particle,previous,len,strength); - // Add the spring to the physics world - physics.addSpring(spring); - } - } - - // Keep the top fixed - Particle head=particles.get(0); - head.lock(); - - // Store reference to the tail - tail = particles.get(numPoints-1); - tail.radius = radius; - } - - // Check if a point is within the ball at the end of the chain - // If so, set dragged = true; - void contains(int x, int y) { - float d = dist(x,y,tail.x,tail.y); - if (d < radius) { - offset.x = tail.x - x; - offset.y = tail.y - y; - tail.lock(); - dragged = true; - } - } - - // Release the ball - void release() { - tail.unlock(); - dragged = false; - } - - // Update tail location if being dragged - void updateTail(int x, int y) { - if (dragged) { - tail.set(x+offset.x,y+offset.y); - } - } - - // Draw the chain - void display() { - // Draw line connecting all points - beginShape(); - stroke(0); - strokeWeight(2); - noFill(); - for (Particle p : particles) { - vertex(p.x,p.y); - } - endShape(); - tail.display(); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde deleted file mode 100644 index 1e9b6aa25..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/NOC_5_11_SoftStringPendulum.pde +++ /dev/null @@ -1,68 +0,0 @@ -/** - *

A soft pendulum (series of connected springs)
- * The Nature of Code
- * Spring 2010

- */ - -/* - * Copyright (c) 2010 Daniel Shiffman - * - * This demo & library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * http://creativecommons.org/licenses/LGPL/2.1/ - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; -import toxi.geom.*; - -// Reference to physics "world" (2D) -VerletPhysics2D physics; - -// Our "Chain" object -Chain chain; - -void setup() { - size(640, 360); - // Initialize the physics world - physics=new VerletPhysics2D(); - physics.addBehavior(new GravityBehavior(new Vec2D(0, 0.1))); - physics.setWorldBounds(new Rect(0, 0, width, height)); - - // Initialize the chain - chain = new Chain(180, 20, 16, 0.2); -} - -void draw() { - background(255); - - // Update physics - physics.update(); - // Update chain's tail according to mouse location - chain.updateTail(mouseX, mouseY); - // Display chain - chain.display(); -} - -void mousePressed() { - // Check to see if we're grabbing the chain - chain.contains(mouseX, mouseY); -} - -void mouseReleased() { - // Release the chain - chain.release(); -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde deleted file mode 100644 index 99ca7dac3..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_11_SoftStringPendulum/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Particle class, but inheritance is a nice alternative - -class Particle extends VerletParticle2D { - - float radius = 4; // Adding a radius for each particle - - Particle(float x, float y) { - super(x,y); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(127); - stroke(0); - strokeWeight(2); - ellipse(x,y,radius*2,radius*2); - } -} diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde deleted file mode 100644 index 241520f2b..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Cluster.pde +++ /dev/null @@ -1,64 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// Toxiclibs example: http://toxiclibs.org/ - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -class Cluster { - - // A cluster is a grouping of nodes - ArrayList nodes; - - float diameter; - - // We initialize a Cluster with a number of nodes, a diameter, and centerpoint - Cluster(int n, float d, Vec2D center) { - - // Initialize the ArrayList - nodes = new ArrayList(); - - // Set the diameter - diameter = d; - - // Create the nodes - for (int i = 0; i < n; i++) { - // We can't put them right on top of each other - nodes.add(new Node(center.add(Vec2D.randomVector()))); - } - - // Connect all the nodes with a Spring - for (int i = 0; i < nodes.size()-1; i++) { - VerletParticle2D ni = nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D nj = nodes.get(j); - // A Spring needs two particles, a resting length, and a strength - physics.addSpring(new VerletSpring2D(ni, nj, diameter, 0.01)); - } - } - } - - void display() { - // Show all the nodes - for (Node n : nodes) { - n.display(); - } - } - - - // Draw all the internal connections - void showConnections() { - stroke(0, 150); - strokeWeight(2); - for (int i = 0; i < nodes.size()-1; i++) { - VerletParticle2D pi = (VerletParticle2D) nodes.get(i); - for (int j = i+1; j < nodes.size(); j++) { - VerletParticle2D pj = (VerletParticle2D) nodes.get(j); - - line(pi.x, pi.y, pj.x, pj.y); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde deleted file mode 100644 index 043803d67..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/NOC_5_12_SimpleCluster.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Force directed graph, -// heavily based on: http://code.google.com/p/fidgen/ - -import toxi.geom.*; -import toxi.physics2d.*; - -// Reference to physics world -VerletPhysics2D physics; - -// A list of cluster objects -Cluster cluster; - -// Boolean that indicates whether we draw connections or not -boolean showPhysics = true; -boolean showParticles = true; - -// Font -PFont f; - -void setup() { - size(640, 360); - f = createFont("Georgia", 12, true); - - // Initialize the physics - physics=new VerletPhysics2D(); - physics.setWorldBounds(new Rect(10, 10, width-20, height-20)); - - // Spawn a new random graph - cluster = new Cluster(8, 100, new Vec2D(width/2, height/2)); -} - -void draw() { - - // Update the physics world - physics.update(); - - background(255); - - // Display all points - if (showParticles) { - cluster.display(); - } - - // If we want to see the physics - if (showPhysics) { - cluster.showConnections(); - } - - // Instructions - fill(0); - textFont(f); - text("'p' to display or hide particles\n'c' to display or hide connections\n'n' for new graph",10,20); -} - -// Key press commands -void keyPressed() { - if (key == 'c') { - showPhysics = !showPhysics; - if (!showPhysics) showParticles = true; - } - else if (key == 'p') { - showParticles = !showParticles; - if (!showParticles) showPhysics = true; - } - else if (key == 'n') { - physics.clear(); - cluster = new Cluster(int(random(2, 20)), random(10, width/2), new Vec2D(width/2, height/2)); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde deleted file mode 100644 index 6fe3b5144..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_12_SimpleCluster/Node.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// -// Spring 2010 -// Toxiclibs example: http://toxiclibs.org/ - -// Force directed graph -// Heavily based on: http://code.google.com/p/fidgen/ - -// Notice how we are using inheritance here! -// We could have just stored a reference to a VerletParticle object -// inside the Node class, but inheritance is a nice alternative - -class Node extends VerletParticle2D { - - Node(Vec2D pos) { - super(pos); - } - - // All we're doing really is adding a display() function to a VerletParticle - void display() { - fill(0,150); - stroke(0); - strokeWeight(2); - ellipse(x,y,16,16); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde deleted file mode 100644 index 69e7ecb1d..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Attractor.pde +++ /dev/null @@ -1,21 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Attractor extends VerletParticle2D { - - float r; - - Attractor (Vec2D loc) { - super (loc); - r = 24; - physics.addParticle(this); - physics.addBehavior(new AttractionBehavior(this, width, 0.1)); - } - - void display () { - fill(0); - ellipse (x, y, r*2, r*2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde deleted file mode 100644 index 4359d202c..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/NOC_5_13_AttractRepel.pde +++ /dev/null @@ -1,40 +0,0 @@ -import toxi.geom.*; -import toxi.physics2d.*; -import toxi.physics2d.behaviors.*; - -ArrayList particles; -Attractor attractor; - -VerletPhysics2D physics; - -void setup () { - size (640, 360); - physics = new VerletPhysics2D (); - physics.setDrag (0.01); - - particles = new ArrayList(); - for (int i = 0; i < 50; i++) { - particles.add(new Particle(new Vec2D(random(width),random(height)))); - } - - attractor = new Attractor(new Vec2D(width/2,height/2)); -} - - -void draw () { - background (255); - physics.update (); - - attractor.display(); - for (Particle p: particles) { - p.display(); - } - - if (mousePressed) { - attractor.lock(); - attractor.set(mouseX,mouseY); - } else { - attractor.unlock(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde b/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde deleted file mode 100644 index 8096405d4..000000000 --- a/java/examples/Books/Nature of Code/chp5_physicslibraries/toxiclibs/NOC_5_13_AttractRepel/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// class Spore extends the class "VerletParticle2D" -class Particle extends VerletParticle2D { - - float r; - - Particle (Vec2D loc) { - super(loc); - r = 8; - physics.addParticle(this); - physics.addBehavior(new AttractionBehavior(this, r*4, -1)); - } - - void display () { - fill (127); - stroke (0); - strokeWeight(2); - ellipse (x, y, r*2, r*2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde b/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde deleted file mode 100644 index 09404bbe5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Alignment.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Separation -// Via Reynolds: http://www.red3d.com/cwr/steer/ - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.align(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.borders(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde deleted file mode 100644 index 43e3f8bbc..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Alignment/Vehicle.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = PVector.random2D(); - velocity.mult(random(1,4)); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - void align (ArrayList boids) { - float neighbordist = 30; - PVector sum = new PVector(0, 0); - int count = 0; - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde deleted file mode 100644 index daeda1da7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Exercise_6_04_Wander.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of Craig Reynolds' "Wandering" behavior -// See: http://www.red3d.com/cwr/ - -// Click mouse to turn on and off rendering of the wander circle - -Vehicle wanderer; -boolean debug = true; - -void setup() { - size(640,360); - wanderer = new Vehicle(width/2,height/2); -} - -void draw() { - background(255); - wanderer.wander(); - wanderer.run(); -} - -void mousePressed() { - debug = !debug; -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde deleted file mode 100644 index fb979e8c5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_04_Wander/Vehicle.pde +++ /dev/null @@ -1,123 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class (for wandering) - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float wandertheta; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 6; - wandertheta = 0; - maxspeed = 2; - maxforce = 0.05; - } - - void run() { - update(); - borders(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void wander() { - float wanderR = 25; // Radius for our "wander circle" - float wanderD = 80; // Distance for our "wander circle" - float change = 0.3; - wandertheta += random(-change,change); // Randomly change wander theta - - // Now we have to calculate the new location to steer towards on the wander circle - PVector circleloc = velocity.get(); // Start with velocity - circleloc.normalize(); // Normalize to get heading - circleloc.mult(wanderD); // Multiply by distance - circleloc.add(location); // Make it relative to boid's location - - float h = velocity.heading2D(); // We need to know the heading to offset wandertheta - - PVector circleOffSet = new PVector(wanderR*cos(wandertheta+h),wanderR*sin(wandertheta+h)); - PVector target = PVector.add(circleloc,circleOffSet); - seek(target); - - // Render wandering circle, etc. - if (debug) drawWanderStuff(location,circleloc,target,wanderR); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - -// A method just to draw the circle associated with wandering -void drawWanderStuff(PVector location, PVector circle, PVector target, float rad) { - stroke(0); - noFill(); - ellipseMode(CENTER); - ellipse(circle.x,circle.y,rad*2,rad*2); - ellipse(target.x,target.y,4,4); - line(location.x,location.y,circle.x,circle.y); - line(circle.x,circle.y,target.x,target.y); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde deleted file mode 100644 index 88a6b3bf6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Exercise_6_08_FlowField3DNoise.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(640, 360); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - flowfield.update(); - - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde deleted file mode 100644 index f10539eb6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/FlowField.pde +++ /dev/null @@ -1,81 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - float zoff = 0.0; // 3rd dimension of noise - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - update(); - } - - void update() { - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - float theta = map(noise(xoff,yoff,zoff),0,1,0,TWO_PI); - // Make a vector from an angle - field[i][j] = PVector.fromAngle(theta); - yoff += 0.1; - } - xoff += 0.1; - } - // Animate by changing 3rd dimension of noise every frame - zoff += 0.01; - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,150); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_08_FlowField3DNoise/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde deleted file mode 100644 index b5f145f6b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_09_AngleBetween/Exercise_6_09_AngleBetween.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Angle Between Two Vectors -// Using the dot product to compute the angle between two vectors - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - - // A "vector" (really a point) to store the mouse location and screen center location - PVector mouseLoc = new PVector(mouseX, mouseY); - PVector centerLoc = new PVector(width/2, height/2); - - // Aha, a vector to store the displacement between the mouse and center - PVector v = PVector.sub(mouseLoc, centerLoc); - v.normalize(); - v.mult(75); - - PVector xaxis = new PVector(75, 0); - // Render the vector - drawVector(v, centerLoc, 1.0); - drawVector(xaxis, centerLoc, 1.0); - - - float theta = PVector.angleBetween(v, xaxis); - - fill(0); - text(int(degrees(theta)) + " degrees\n" + theta + " radians", 10, 160); -} - -// Renders a vector object 'v' as an arrow and a location 'loc' -void drawVector(PVector v, PVector loc, float scayl) { - pushMatrix(); - float arrowsize = 6; - // Translate to location to render vector - translate(loc.x, loc.y); - stroke(0); - strokeWeight(2); - // Call vector heading function to get direction (pointing up is a heading of 0) - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow - line(0, 0, len, 0); - line(len, 0, len-arrowsize, +arrowsize/2); - line(len, 0, len-arrowsize, -arrowsize/2); - popMatrix(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde deleted file mode 100644 index 43be58653..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Exercise_6_13_CrowdPathFollowing.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Crowd Path Following -// Via Reynolds: http://www.red3d.com/cwr/steer/CrowdPath.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = false; - - -// A path object (series of connected points) -Path path; - -// Two vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // Call a function to generate new Path object - newPath(); - - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 120; i++) { - newVehicle(random(width),random(height)); - } -} - -void draw() { - background(255); - // Display the path - path.display(); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.applyBehaviors(vehicles,path); - // Call the generic run method (update, borders, display, etc.) - v.run(); - } - - // Instructions - fill(0); - textAlign(CENTER); - text("Hit 'd' to toggle debugging lines.\nClick the mouse to generate new vehicles.",width/2,height-20); -} - -void newPath() { - // A path is a series of connected points - // A more sophisticated path might be a curve - path = new Path(); - float offset = 30; - path.addPoint(offset,offset); - path.addPoint(width-offset,offset); - path.addPoint(width-offset,height-offset); - path.addPoint(width/2,height-offset*3); - path.addPoint(offset,height-offset); -} - -void newVehicle(float x, float y) { - float maxspeed = random(2,4); - float maxforce = 0.3; - vehicles.add(new Vehicle(new PVector(x,y),maxspeed,maxforce)); -} - -void keyPressed() { - if (key == 'd') { - debug = !debug; - } -} - -void mousePressed() { - newVehicle(mouseX,mouseY); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde deleted file mode 100644 index 755be5b1f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Path.pde +++ /dev/null @@ -1,52 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is an arraylist of points (PVector objects) - ArrayList points; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - points = new ArrayList(); - } - - // Add a point to the path - void addPoint(float x, float y) { - PVector point = new PVector(x, y); - points.add(point); - } - - // Draw the path - void display() { - strokeJoin(ROUND); - - // Draw thick line for radius - stroke(175); - strokeWeight(radius*2); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(CLOSE); - // Draw thin line for center of path - stroke(0); - strokeWeight(1); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(CLOSE); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde deleted file mode 100644 index 14a2947e7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_13_CrowdPathFollowing/Vehicle.pde +++ /dev/null @@ -1,240 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 12; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // A function to deal with path following and separation - void applyBehaviors(ArrayList vehicles, Path path) { - // Follow path force - PVector f = follow(path); - // Separate from other boids force - PVector s = separate(vehicles); - // Arbitrary weighting - f.mult(3); - s.mult(1); - // Accumulate in acceleration - applyForce(f); - applyForce(s); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - - // Main "run" function - public void run() { - update(); - borders(); - render(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - PVector follow(Path p) { - - // Predict location 25 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(25); - PVector predictLoc = PVector.add(location, predict); - - // Now we must find the normal to the path from the predicted location - // We look at the normal for each line segment and pick out the closest one - PVector normal = null; - PVector target = null; - float worldRecord = 1000000; // Start with a very high worldRecord distance that can easily be beaten - - // Loop through all points of the path - for (int i = 0; i < p.points.size(); i++) { - - // Look at a line segment - PVector a = p.points.get(i); - PVector b = p.points.get((i+1)%p.points.size()); // Note Path has to wraparound - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - - // Check if normal is on line segment - PVector dir = PVector.sub(b, a); - // If it's not within the line segment, consider the normal to just be the end of the line segment (point b) - //if (da + db > line.mag()+1) { - if (normalPoint.x < min(a.x,b.x) || normalPoint.x > max(a.x,b.x) || normalPoint.y < min(a.y,b.y) || normalPoint.y > max(a.y,b.y)) { - normalPoint = b.get(); - // If we're at the end we really want the next line segment for looking ahead - a = p.points.get((i+1)%p.points.size()); - b = p.points.get((i+2)%p.points.size()); // Path wraps around - dir = PVector.sub(b, a); - } - - // How far away are we from the path? - float d = PVector.dist(predictLoc, normalPoint); - // Did we beat the worldRecord and find the closest line segment? - if (d < worldRecord) { - worldRecord = d; - normal = normalPoint; - - // Look at the direction of the line segment so we can seek a little bit ahead of the normal - dir.normalize(); - // This is an oversimplification - // Should be based on distance to path & velocity - dir.mult(25); - target = normal.get(); - target.add(dir); - - } - } - - // Draw the debugging stuff - if (debug) { - // Draw predicted future location - stroke(0); - fill(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - stroke(0); - fill(0); - ellipse(normal.x, normal.y, 4, 4); - // Draw actual target (red if steering towards it) - line(predictLoc.x, predictLoc.y, target.x, target.y); - if (worldRecord > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x, target.y, 8, 8); - } - - // Only if the distance is greater than the path's radius do we bother to steer - if (worldRecord > p.radius) { - return seek(target); - } - else { - return new PVector(0, 0); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = r*2; - PVector steer = new PVector(0, 0, 0); - int count = 0; - // For every boid in the system, check if it's too close - for (int i = 0 ; i < boids.size(); i++) { - Vehicle other = (Vehicle) boids.get(i); - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocationity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - - void render() { - // Simpler boid is just a circle - fill(75); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - //if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - //if (location.y > height+r) location.y = -r; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde deleted file mode 100644 index e5ba60546..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Boid.pde +++ /dev/null @@ -1,242 +0,0 @@ -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - - color col; - Boid(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(random(-1, 1), random(-1, 1)); - location = new PVector(x, y); - r = 5.0; - maxspeed = 3; - maxforce = 0.05; - - col = color(175); - } - - void run(ArrayList boids) { - //flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - - // Not for every boid yet - // PVector view = view(boids); // view - - // Arbitrarily weight these forces - sep.mult(1.5); - ali.mult(1.0); - coh.mult(1.0); - - // Not for every boid yet - // view.mult(1.0); - - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - - // Not for every boid yet - // applyForce(view); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading() + radians(90); - fill(col); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0f; - PVector steer = new PVector(0, 0, 0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - return steer; - } - else { - return new PVector(0, 0); - } - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0, 0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location, other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.location); // Add location - count++; - } - } - if (count > 0) { - sum.div(count); - return seek(sum); // Steer towards the location - } - else { - return new PVector(0, 0); - } - } - - // View - // move laterally away from any boid that blocks the view - // Right now we are just drawing the view and highlighting boids - PVector view (ArrayList boids) { - - // How far can it see? - float sightDistance = 100; - float periphery = PI/4; - - for (Boid other : boids) { - // A vector that points to another boid and that angle - PVector comparison = PVector.sub(other.location, location); - - // How far is it - float d = PVector.dist(location, other.location); - - // What is the angle between the other boid and this one's current direction - float diff = PVector.angleBetween(comparison, velocity); - - // If it's within the periphery and close enough to see it - if (diff < periphery && d > 0 && d < sightDistance) { - // Just change its color - other.highlight(); - } - } - - - // Debug Drawing - float currentHeading = velocity.heading(); - pushMatrix(); - translate(location.x, location.y); - rotate(currentHeading); - fill(0, 100); - arc(0, 0, sightDistance*2, sightDistance*2, -periphery, periphery); - popMatrix(); - - return new PVector(); - } - - void highlight() { - col = color(255, 0, 0); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde deleted file mode 100644 index 8aa3f5011..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Exercise_6_17_View.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Exercise 6.17: Implement Flake's "View" rule - -// This answer doesn't implement the rule, but rather demonstrates how a boid can -// detect what is "in front" of it based on peripheral vision - -Flock flock; - -void setup() { - size(640,360); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 25; i++) { - Boid b = new Boid(width/2+random(0,75),height/2+random(0,75)); - flock.addBoid(b); - } -} - -void draw() { - background(255); - - flock.run(); -} - -// Add a new boid into the System -void mouseDragged() { - flock.addBoid(new Boid(mouseX,mouseY)); -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde deleted file mode 100644 index 6b7b1c9e0..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/Exercise_6_17_View/Flock.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2011 - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.col = color(175); - } - - Boid b1 = boids.get(0); - b1.col = color(0, 0, 255); - b1.view(boids); - - for (Boid b : boids) { - b.flock(boids); // Passing the entire list of boids to each boid individually - } - - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde deleted file mode 100644 index 370c83f47..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowField.pde +++ /dev/null @@ -1,85 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - - int x = i*resolution; - int y = j*resolution; - int c = img.pixels[x + y * img.width]; - - // Map brightness to an angle - float theta = 0;//map(brightness(c),0,255,0,PI/2); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = PVector.fromAngle(theta); - - // Map magnitude to an angle (how fast is the desired velocity in the flow field) - float m = map(brightness(c),0,255,0,1); - field[i][j].mult(m); - } - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - strokeWeight(2); - stroke(255,0,0); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde deleted file mode 100644 index b023de6d6..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/FlowfieldImage.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -PImage img; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(600, 568); - img = loadImage("sil.jpg"); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - image(img,0,0); - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/FlowfieldImage/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde deleted file mode 100644 index f06b2d10f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/NOC_6_01_Seek.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Two "vehicles" follow the mouse position - -// Implements Craig Reynold's autonomous steering behaviors -// One vehicle "seeks" -// One vehicle "arrives" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.seek(mouse); - v.update(); - v.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde deleted file mode 100644 index 8c469b5d5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek/Vehicle.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Seek_Arrive - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,-2); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Scale to maximum speed - desired.setMag(maxspeed); - - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde deleted file mode 100644 index 5ec2d5091..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/NOC_6_01_Seek_trail.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Implements Craig Reynold's autonomous steering behaviors -// One vehicle "seeks" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(800, 200); - v = new Vehicle(width/2, height/2); -} - -void draw() { - - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.seek(mouse); - v.update(); - v.display(); -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde deleted file mode 100644 index d0b33d652..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_01_Seek_trail/Vehicle.pde +++ /dev/null @@ -1,91 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - ArrayList history = new ArrayList(); - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,-2); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - - history.add(location.get()); - if (history.size() > 100) { - history.remove(0); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - beginShape(); - stroke(0); - strokeWeight(1); - noFill(); - for(PVector v: history) { - vertex(v.x,v.y); - } - endShape(); - - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde deleted file mode 100644 index bd445d818..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/NOC_6_02_Arrive.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// One vehicle "arrives" -// See: http://www.red3d.com/cwr/ - -Vehicle v; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - PVector mouse = new PVector(mouseX, mouseY); - - // Draw an ellipse at the mouse location - fill(200); - stroke(0); - strokeWeight(2); - ellipse(mouse.x, mouse.y, 48, 48); - - // Call the appropriate steering behaviors for our agents - v.arrive(mouse); - v.update(); - v.display(); -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde deleted file mode 100644 index a00eb9c4f..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_02_Arrive/Vehicle.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - location = new PVector(x,y); - r = 6; - maxspeed = 4; - maxforce = 0.1; - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelerationelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void arrive(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - float d = desired.mag(); - // Scale with arbitrary damping within 100 pixels - if (d < 100) { - float m = map(d,0,100,0,maxspeed); - desired.setMag(m); - } else { - desired.setMag(maxspeed); - } - - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void display() { - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + PI/2; - fill(127); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(CLOSE); - popMatrix(); - - - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde deleted file mode 100644 index dbc5d3a5a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/NOC_6_03_StayWithinWalls.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Walls -// "Made-up" Steering behavior to stay within walls - - -Vehicle v; -boolean debug = true; - -float d = 25; - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - rectMode(CENTER); - rect(width/2, height/2, width-d*2, height-d*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde deleted file mode 100644 index 9a507181c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls/Vehicle.pde +++ /dev/null @@ -1,92 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The "Vehicle" class - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(3, -2); - velocity.mult(5); - location = new PVector(x, y); - r = 6; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void boundaries() { - - PVector desired = null; - - if (location.x < d) { - desired = new PVector(maxspeed, velocity.y); - } - else if (location.x > width -d) { - desired = new PVector(-maxspeed, velocity.y); - } - - if (location.y < d) { - desired = new PVector(velocity.x, maxspeed); - } - else if (location.y > height-d) { - desired = new PVector(velocity.x, -maxspeed); - } - - if (desired != null) { - desired.normalize(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde deleted file mode 100644 index c260f716a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/NOC_6_03_StayWithinWalls_trail.pde +++ /dev/null @@ -1,37 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Walls -// "Made-up" Steering behavior to stay within walls - - -Vehicle v; -boolean debug = true; - -float d = 25; - - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/2); -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - rectMode(CENTER); - rect(width/2, height/2, width-d*2, height-d*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde deleted file mode 100644 index 0d94054a4..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_03_StayWithinWalls_trail/Vehicle.pde +++ /dev/null @@ -1,108 +0,0 @@ -// Wander -// Daniel Shiffman -// The Nature of Code - -// The "Vehicle" class - -class Vehicle { - ArrayList history = new ArrayList(); - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(3, -2); - velocity.mult(5); - location = new PVector(x, y); - r = 6; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - - history.add(location.get()); - if (history.size() > 500) { - history.remove(0); - } - } - - void boundaries() { - - PVector desired = null; - - if (location.x < d) { - desired = new PVector(maxspeed, velocity.y); - } - else if (location.x > width -d) { - desired = new PVector(-maxspeed, velocity.y); - } - - if (location.y < d) { - desired = new PVector(velocity.x, maxspeed); - } - else if (location.y > height-d) { - desired = new PVector(velocity.x, -maxspeed); - } - - if (desired != null) { - desired.normalize(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - beginShape(); - stroke(0); - strokeWeight(1); - noFill(); - for(PVector v: history) { - vertex(v.x,v.y); - } - endShape(); - - - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(127); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde deleted file mode 100644 index 75b471b29..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/FlowField.pde +++ /dev/null @@ -1,94 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - noiseSeed((int)random(10000)); - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - //float theta = random(TWO_PI); - //float theta = map(noise(xoff,yoff),0,1,0,TWO_PI); - float x = i*resolution; - float y = j*resolution; - PVector v = new PVector(width/2-x,-y); - v.normalize(); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = v;// new PVector(cos(theta),sin(theta)); - yoff += 0.1; - } - xoff += 0.1; - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - //drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - pushMatrix(); - //translate(i*resolution+arrow.width/2,j*resolution+arrow.height/2); - translate(i*resolution,j*resolution); - rotate(field[i][j].heading2D()); - imageMode(CENTER); - //scale(0.2); - image(a,0,0); - //shape(arrow,-arrow.width/2,-arrow.height/2); - //ellipse(0,0,8,8); - popMatrix(); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - line(len,0,len-arrowsize,+arrowsize/2); - line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde deleted file mode 100644 index beb0642c9..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/NOC_6_04_Flow_Figures.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Flowfield object -FlowField flowfield; -PShape arrow; -PImage a; - -void setup() { - size(1800, 60*9); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(60); - arrow = loadShape("arrow.svg"); - a = loadImage("arrow60.png"); -} - -void draw() { - background(255); - // Display the flowfield in "debug" mode - translate(30,30); - flowfield.display(); - saveFrame("ch6_exc6.png"); - noLoop(); -} -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg deleted file mode 100644 index 0f34115e7..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flow_Figures/data/arrow.svg +++ /dev/null @@ -1,5149 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde deleted file mode 100644 index 08bf7eb23..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/FlowField.pde +++ /dev/null @@ -1,79 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class FlowField { - - // A flow field is a two dimensional array of PVectors - PVector[][] field; - int cols, rows; // Columns and Rows - int resolution; // How large is each "cell" of the flow field - - FlowField(int r) { - resolution = r; - // Determine the number of columns and rows based on sketch's width and height - cols = width/resolution; - rows = height/resolution; - field = new PVector[cols][rows]; - init(); - } - - void init() { - // Reseed noise so we get a new flow field every time - noiseSeed((int)random(10000)); - float xoff = 0; - for (int i = 0; i < cols; i++) { - float yoff = 0; - for (int j = 0; j < rows; j++) { - float theta = map(noise(xoff,yoff),0,1,0,TWO_PI); - // Polar to cartesian coordinate transformation to get x and y components of the vector - field[i][j] = new PVector(cos(theta),sin(theta)); - yoff += 0.1; - } - xoff += 0.1; - } - } - - // Draw every vector - void display() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(field[i][j],i*resolution,j*resolution,resolution-2); - } - } - - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading2D()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(0,0,len,0); - //line(len,0,len-arrowsize,+arrowsize/2); - //line(len,0,len-arrowsize,-arrowsize/2); - popMatrix(); - } - - PVector lookup(PVector lookup) { - int column = int(constrain(lookup.x/resolution,0,cols-1)); - int row = int(constrain(lookup.y/resolution,0,rows-1)); - return field[column][row].get(); - } - - -} - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde deleted file mode 100644 index 86a2c4c29..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/NOC_6_04_Flowfield.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following -// Via Reynolds: http://www.red3d.com/cwr/steer/FlowFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// Flowfield object -FlowField flowfield; -// An ArrayList of vehicles -ArrayList vehicles; - -void setup() { - size(640, 360); - // Make a new flow field with "resolution" of 16 - flowfield = new FlowField(20); - vehicles = new ArrayList(); - // Make a whole bunch of vehicles with random maxspeed and maxforce values - for (int i = 0; i < 120; i++) { - vehicles.add(new Vehicle(new PVector(random(width), random(height)), random(2, 5), random(0.1, 0.5))); - } -} - -void draw() { - background(255); - // Display the flowfield in "debug" mode - if (debug) flowfield.display(); - // Tell all the vehicles to follow the flow field - for (Vehicle v : vehicles) { - v.follow(flowfield); - v.run(); - } - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new flow field.",10,height-20); -} - - -void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -// Make a new flowfield -void mousePressed() { - flowfield.init(); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde deleted file mode 100644 index 2326a1e7c..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_04_Flowfield/Vehicle.pde +++ /dev/null @@ -1,87 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flow Field Following - -class Vehicle { - - // The usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Vehicle(PVector l, float ms, float mf) { - location = l.get(); - r = 3.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0,0); - velocity = new PVector(0,0); - } - - public void run() { - update(); - borders(); - display(); - } - - - // Implementing Reynolds' flow field following algorithm - // http://www.red3d.com/cwr/steer/FlowFollow.html - void follow(FlowField flow) { - // What is the vector at that spot in the flow field? - PVector desired = flow.lookup(location); - // Scale it up by maxspeed - desired.mult(maxspeed); - // Steering is desired minus velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - applyForce(steer); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde deleted file mode 100644 index abe2f5e9a..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/NOC_6_05_PathFollowingSimple.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Path is a just a straight line in this example -// Via Reynolds: // http://www.red3d.com/cwr/steer/PathFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// A path object (series of connected points) -Path path; - -// Two vehicles -Vehicle car1; -Vehicle car2; - -void setup() { - size(640, 360); - path = new Path(); - - // Each vehicle has different maxspeed and maxforce for demo purposes - car1 = new Vehicle(new PVector(0, height/2), 2, 0.02); - car2 = new Vehicle(new PVector(0, height/2), 3, 0.05); -} - -void draw() { - background(255); - // Display the path - path.display(); - // The boids follow the path - car1.follow(path); - car2.follow(path); - // Call the generic run method (update, borders, display, etc.) - car1.run(); - car2.run(); - - // Check if it gets to the end of the path since it's not a loop - car1.borders(path); - car2.borders(path); - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.", 10, height-30); -} - -public void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde deleted file mode 100644 index 3d222214d..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Path.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is line between two points (PVector objects) - PVector start; - PVector end; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - start = new PVector(0,height/3); - end = new PVector(width,2*height/3); - } - - // Draw the path - void display() { - - strokeWeight(radius*2); - stroke(0,100); - line(start.x,start.y,end.x,end.y); - - strokeWeight(1); - stroke(0); - line(start.x,start.y,end.x,end.y); - } -} - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde deleted file mode 100644 index 1fdbd172e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_05_PathFollowingSimple/Vehicle.pde +++ /dev/null @@ -1,160 +0,0 @@ -// Path Following -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 4.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // Main "run" function - void run() { - update(); - display(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - void follow(Path p) { - - // Predict location 50 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(50); - PVector predictLoc = PVector.add(location, predict); - - // Look at the line segment - PVector a = p.start; - PVector b = p.end; - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - - // Find target point a little further ahead of normal - PVector dir = PVector.sub(b, a); - dir.normalize(); - dir.mult(10); // This could be based on velocity instead of just an arbitrary 10 pixels - PVector target = PVector.add(normalPoint, dir); - - // How far away are we from the path? - float distance = PVector.dist(predictLoc, normalPoint); - // Only if the distance is greater than the path's radius do we bother to steer - if (distance > p.radius) { - seek(target); - } - - - // Draw the debugging stuff - if (debug) { - fill(0); - stroke(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - fill(0); - stroke(0); - line(predictLoc.x, predictLoc.y, normalPoint.x, normalPoint.y); - ellipse(normalPoint.x, normalPoint.y, 4, 4); - stroke(0); - if (distance > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x+dir.x, target.y+dir.y, 8, 8); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.mag() == 0) return; - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(PConstants.TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders(Path p) { - if (location.x > p.end.x + r) { - location.x = p.start.x - r; - location.y = p.start.y + (location.y-p.end.y); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde deleted file mode 100644 index b07b478dd..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/NOC_6_06_PathFollowing.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following -// Via Reynolds: // http://www.red3d.com/cwr/steer/PathFollow.html - -// Using this variable to decide whether to draw all the stuff -boolean debug = true; - -// A path object (series of connected points) -Path path; - -// Two vehicles -Vehicle car1; -Vehicle car2; - -void setup() { - size(640, 360); - // Call a function to generate new Path object - newPath(); - - // Each vehicle has different maxspeed and maxforce for demo purposes - car1 = new Vehicle(new PVector(0, height/2), 2, 0.04); - car2 = new Vehicle(new PVector(0, height/2), 3, 0.1); -} - -void draw() { - background(255); - // Display the path - path.display(); - // The boids follow the path - car1.follow(path); - car2.follow(path); - // Call the generic run method (update, borders, display, etc.) - car1.run(); - car2.run(); - - car1.borders(path); - car2.borders(path); - - // Instructions - fill(0); - text("Hit space bar to toggle debugging lines.\nClick the mouse to generate a new path.", 10, height-30); -} - -void newPath() { - // A path is a series of connected points - // A more sophisticated path might be a curve - path = new Path(); - path.addPoint(-20, height/2); - path.addPoint(random(0, width/2), random(0, height)); - path.addPoint(random(width/2, width), random(0, height)); - path.addPoint(width+20, height/2); -} - -public void keyPressed() { - if (key == ' ') { - debug = !debug; - } -} - -public void mousePressed() { - newPath(); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde deleted file mode 100644 index 8d28b73cb..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Path.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -class Path { - - // A Path is an arraylist of points (PVector objects) - ArrayList points; - // A path has a radius, i.e how far is it ok for the boid to wander off - float radius; - - Path() { - // Arbitrary radius of 20 - radius = 20; - points = new ArrayList(); - } - - // Add a point to the path - void addPoint(float x, float y) { - PVector point = new PVector(x, y); - points.add(point); - } - - PVector getStart() { - return points.get(0); - } - - PVector getEnd() { - return points.get(points.size()-1); - } - - - // Draw the path - void display() { - // Draw thick line for radius - stroke(175); - strokeWeight(radius*2); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(); - // Draw thin line for center of path - stroke(0); - strokeWeight(1); - noFill(); - beginShape(); - for (PVector v : points) { - vertex(v.x, v.y); - } - endShape(); - } -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde deleted file mode 100644 index 72bd7d1fe..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_06_PathFollowing/Vehicle.pde +++ /dev/null @@ -1,192 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Path Following - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle( PVector l, float ms, float mf) { - location = l.get(); - r = 4.0; - maxspeed = ms; - maxforce = mf; - acceleration = new PVector(0, 0); - velocity = new PVector(maxspeed, 0); - } - - // Main "run" function - public void run() { - update(); - display(); - } - - - // This function implements Craig Reynolds' path following algorithm - // http://www.red3d.com/cwr/steer/PathFollow.html - void follow(Path p) { - - // Predict location 50 (arbitrary choice) frames ahead - // This could be based on speed - PVector predict = velocity.get(); - predict.normalize(); - predict.mult(50); - PVector predictLoc = PVector.add(location, predict); - - // Now we must find the normal to the path from the predicted location - // We look at the normal for each line segment and pick out the closest one - - PVector normal = null; - PVector target = null; - float worldRecord = 1000000; // Start with a very high record distance that can easily be beaten - - // Loop through all points of the path - for (int i = 0; i < p.points.size()-1; i++) { - - // Look at a line segment - PVector a = p.points.get(i); - PVector b = p.points.get(i+1); - - // Get the normal point to that line - PVector normalPoint = getNormalPoint(predictLoc, a, b); - // This only works because we know our path goes from left to right - // We could have a more sophisticated test to tell if the point is in the line segment or not - if (normalPoint.x < a.x || normalPoint.x > b.x) { - // This is something of a hacky solution, but if it's not within the line segment - // consider the normal to just be the end of the line segment (point b) - normalPoint = b.get(); - } - - // How far away are we from the path? - float distance = PVector.dist(predictLoc, normalPoint); - // Did we beat the record and find the closest line segment? - if (distance < worldRecord) { - worldRecord = distance; - // If so the target we want to steer towards is the normal - normal = normalPoint; - - // Look at the direction of the line segment so we can seek a little bit ahead of the normal - PVector dir = PVector.sub(b, a); - dir.normalize(); - // This is an oversimplification - // Should be based on distance to path & velocity - dir.mult(10); - target = normalPoint.get(); - target.add(dir); - } - } - - // Only if the distance is greater than the path's radius do we bother to steer - if (worldRecord > p.radius) { - seek(target); - } - - - // Draw the debugging stuff - if (debug) { - // Draw predicted future location - stroke(0); - fill(0); - line(location.x, location.y, predictLoc.x, predictLoc.y); - ellipse(predictLoc.x, predictLoc.y, 4, 4); - - // Draw normal location - stroke(0); - fill(0); - ellipse(normal.x, normal.y, 4, 4); - // Draw actual target (red if steering towards it) - line(predictLoc.x, predictLoc.y, normal.x, normal.y); - if (worldRecord > p.radius) fill(255, 0, 0); - noStroke(); - ellipse(target.x, target.y, 8, 8); - } - } - - - // A function to get the normal point from a point (p) to a line segment (a-b) - // This function could be optimized to make fewer new Vector objects - PVector getNormalPoint(PVector p, PVector a, PVector b) { - // Vector from a to p - PVector ap = PVector.sub(p, a); - // Vector from a to b - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - // Project vector "diff" onto line by using the dot product - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - void seek(PVector target) { - PVector desired = PVector.sub(target, location); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.mag() == 0) return; - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); // Limit to maximum steering force - - applyForce(steer); - } - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(PConstants.TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders(Path p) { - if (location.x > p.getEnd().x + r) { - location.x = p.getStart().x - r; - location.y = p.getStart().y + (location.y-p.getEnd().y); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde deleted file mode 100644 index d884461f2..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/NOC_6_07_Separation.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Separation -// Via Reynolds: http://www.red3d.com/cwr/steer/ - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.separate(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.borders(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde deleted file mode 100644 index f0a5ddb96..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_07_Separation/Vehicle.pde +++ /dev/null @@ -1,99 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Vehicle class - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = new PVector(0, 0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // Separation - // Method checks for nearby vehicles and steers away - void separate (ArrayList vehicles) { - float desiredseparation = r*2; - PVector sum = new PVector(); - int count = 0; - // For every boid in the system, check if it's too close - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - sum.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - sum.div(count); - // Our desired vector is the average scaled to maximum speed - sum.normalize(); - sum.mult(maxspeed); - // Implement Reynolds: Steering = Desired - Velocity - PVector steer = PVector.sub(sum, velocity); - steer.limit(maxforce); - applyForce(steer); - } - } - - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } -} - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde deleted file mode 100644 index bc744a1b8..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/NOC_6_08_SeparationAndSeek.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A list of vehicles -ArrayList vehicles; - -void setup() { - size(640,360); - // We are now making random vehicles and storing them in an ArrayList - vehicles = new ArrayList(); - for (int i = 0; i < 100; i++) { - vehicles.add(new Vehicle(random(width),random(height))); - } -} - -void draw() { - background(255); - - for (Vehicle v : vehicles) { - // Path following and separation are worked on in this function - v.applyBehaviors(vehicles); - // Call the generic run method (update, borders, display, etc.) - v.update(); - v.display(); - } - - // Instructions - fill(0); - text("Drag the mouse to generate new vehicles.",10,height-16); -} - - -void mouseDragged() { - vehicles.add(new Vehicle(mouseX,mouseY)); -} - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde deleted file mode 100644 index b4270972e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_08_SeparationAndSeek/Vehicle.pde +++ /dev/null @@ -1,113 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Vehicle { - - // All the usual stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - // Constructor initialize all values - Vehicle(float x, float y) { - location = new PVector(x, y); - r = 12; - maxspeed = 3; - maxforce = 0.2; - acceleration = new PVector(0, 0); - velocity = new PVector(0, 0); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - void applyBehaviors(ArrayList vehicles) { - PVector separateForce = separate(vehicles); - PVector seekForce = seek(new PVector(mouseX,mouseY)); - separateForce.mult(2); - seekForce.mult(1); - applyForce(separateForce); - applyForce(seekForce); - } - - // A method that calculates a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - // Separation - // Method checks for nearby vehicles and steers away - PVector separate (ArrayList vehicles) { - float desiredseparation = r*2; - PVector sum = new PVector(); - int count = 0; - // For every boid in the system, check if it's too close - for (Vehicle other : vehicles) { - float d = PVector.dist(location, other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location, other.location); - diff.normalize(); - diff.div(d); // Weight by distance - sum.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - sum.div(count); - // Our desired vector is the average scaled to maximum speed - sum.normalize(); - sum.mult(maxspeed); - // Implement Reynolds: Steering = Desired - Velocity - sum.sub(velocity); - sum.limit(maxforce); - } - return sum; - } - - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void display() { - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - ellipse(0, 0, r, r); - popMatrix(); - } - -} - - - - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde deleted file mode 100644 index 194dfc362..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Boid.pde +++ /dev/null @@ -1,182 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Boid(float x, float y) { - acceleration = new PVector(0,0); - velocity = new PVector(random(-1,1),random(-1,1)); - location = new PVector(x,y); - r = 3.0; - maxspeed = 3; - maxforce = 0.05; - } - - void run(ArrayList boids) { - flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mult(1.5); - ali.mult(1.0); - coh.mult(1.0); - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,location); // A vector pointing from the location to the target - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,velocity); - steer.limit(maxforce); // Limit to maximum steering force - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0f; - PVector steer = new PVector(0,0,0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(location,other.location); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - } - - // As long as the vector is greater than 0 - if (steer.mag() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(velocity); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0,0); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.velocity); - count++; - } - } - if (count > 0) { - sum.div((float)count); - sum.normalize(); - sum.mult(maxspeed); - PVector steer = PVector.sub(sum,velocity); - steer.limit(maxforce); - return steer; - } else { - return new PVector(0,0); - } - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50; - PVector sum = new PVector(0,0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(location,other.location); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.location); // Add location - count++; - } - } - if (count > 0) { - sum.div(count); - return seek(sum); // Steer towards the location - } else { - return new PVector(0,0); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde deleted file mode 100644 index b548b2469..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/Flock.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde b/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde deleted file mode 100644 index 921f0d250..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/NOC_6_09_Flocking/NOC_6_09_Flocking.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system - -Flock flock; - -void setup() { - size(640,360); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 200; i++) { - Boid b = new Boid(width/2,height/2); - flock.addBoid(b); - } - smooth(); -} - -void draw() { - background(255); - flock.run(); - - // Instructions - fill(0); - //text("Drag the mouse to generate new boids.",10,height-16); -} - -// Add a new boid into the System -void mouseDragged() { - flock.addBoid(new Boid(mouseX,mouseY)); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde b/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde deleted file mode 100644 index dbd09f94e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/SimpleScalarProjection/SimpleScalarProjection.pde +++ /dev/null @@ -1,41 +0,0 @@ - -void setup() { - size(600, 360); -} - -void draw() { - background(255); - - PVector a = new PVector(20,300); - PVector b = new PVector(500,250); - PVector mouse = new PVector(mouseX,mouseY); - - stroke(0); - strokeWeight(2); - line(a.x,a.y,b.x,b.y); - line(a.x,a.y,mouse.x,mouse.y); - fill(0); - ellipse(a.x,a.y,8,8); - ellipse(b.x,b.y,8,8); - ellipse(mouse.x,mouse.y,8,8); - - PVector norm = scalarProjection(mouse,a,b); - strokeWeight(1); - stroke(50); - line(mouse.x,mouse.y,norm.x,norm.y); - - noStroke(); - fill(255,0,0); - ellipse(norm.x,norm.y,16,16); -} - - -PVector scalarProjection(PVector p, PVector a, PVector b) { - PVector ap = PVector.sub(p, a); - PVector ab = PVector.sub(b, a); - ab.normalize(); // Normalize the line - ab.mult(ap.dot(ab)); - PVector normalPoint = PVector.add(a, ab); - return normalPoint; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde b/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde deleted file mode 100644 index 0c2d43c86..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/StayWithinCircle.pde +++ /dev/null @@ -1,41 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stay Within Circle -// "Made-up" Steering behavior to stay within walls - -Vehicle v; -boolean debug = true; - - -PVector circleLocation; -float circleRadius; - - - -void setup() { - size(640, 360); - v = new Vehicle(width/2, height/4); - - circleLocation = new PVector(width/2,height/2); - circleRadius = height/2-25; -} - -void draw() { - background(255); - - if (debug) { - stroke(175); - noFill(); - ellipse(circleLocation.x,circleLocation.y, circleRadius*2,circleRadius*2); - } - - v.boundaries(); - v.run(); -} - -void mousePressed() { - debug = !debug; -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde b/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde deleted file mode 100644 index 7bc96d2fa..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/StayWithinCircle/Vehicle.pde +++ /dev/null @@ -1,93 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Vehicle { - - PVector location; - PVector velocity; - PVector acceleration; - float r; - - float maxspeed; - float maxforce; - - Vehicle(float x, float y) { - acceleration = new PVector(0, 0); - velocity = new PVector(1,0); - velocity.mult(5); - location = new PVector(x, y); - r = 3; - maxspeed = 3; - maxforce = 0.15; - } - - void run() { - update(); - display(); - } - - // Method to update location - void update() { - // Update velocity - velocity.add(acceleration); - // Limit speed - velocity.limit(maxspeed); - location.add(velocity); - // Reset accelertion to 0 each cycle - acceleration.mult(0); - } - - void boundaries() { - - PVector desired = null; - - // Predict location 25 (arbitrary choice) frames ahead - PVector predict = velocity.get(); - predict.mult(25); - PVector futureLocation = PVector.add(location, predict); - float distance = PVector.dist(futureLocation,circleLocation); - - if (distance > circleRadius) { - PVector toCenter = PVector.sub(circleLocation,location); - toCenter.normalize(); - toCenter.mult(velocity.mag()); - desired = PVector.add(velocity,toCenter); - desired.normalize(); - desired.mult(maxspeed); - } - - if (desired != null) { - PVector steer = PVector.sub(desired, velocity); - steer.limit(maxforce); - applyForce(steer); - } - - fill(255,0,0); - ellipse(futureLocation.x,futureLocation.y,4,4); - - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acceleration.add(force); - } - - - void display() { - // Draw a triangle rotated in the direction of velocity - float theta = velocity.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde deleted file mode 100644 index 7a739186b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/Thing.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Daniel Shiffman - -// Simple class describing an ellipse living on our screen - -class Thing { - - float x,y; - boolean highlight; - float r; - - Thing (float x_, float y_) { - x = x_; - y = y_; - highlight = false; - r = random(8) + 1; - } - - void move() { - x += random(-1,1); - y += random(-1,1); - } - - void render() { - noStroke(); - if (highlight) fill(255); - else fill(100); - ellipse(x,y,r,r); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde deleted file mode 100644 index a8474b9c3..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection/intersection.pde +++ /dev/null @@ -1,105 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Bin-Lattice Spatial Subdivision -// http://www.red3d.com/cwr/papers/2000/pip.pdf - -// Example demonstrating optimized intersection test for large # of objects -// Each object registers its location in a virtual grid -// Only the objects in neighboring cells on the grid are tested against each other - -int totalThings = 2000; - -ArrayList a; // ArrayList for all "things" -ArrayList[][] grid; // Grid of ArrayLists for intersection test -int scl = 4; // Size of each grid cell -int cols, rows; // Total coluns and rows - -void setup() { - size(640,360); - a = new ArrayList(); // Create the list - cols = width/scl; // Calculate cols & rows - rows = height/scl; - - // Initialize grid as 2D array of empty ArrayLists - grid = new ArrayList[cols][rows]; - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - grid[i][j] = new ArrayList(); - } - } - - // Put 2000 Things in the system - for (int i = 0; i < totalThings; i++) { - a.add(new Thing(random(width),random(height))); - } - -} - -void draw() { - background(0); - - // Every time through draw clear all the lists - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - grid[i][j].clear(); - } - } - - // Register every Thing object in the grid according to it's location - for (Thing t : a) { - t.highlight = false; - int x = int(t.x) / scl; - int y = int (t.y) /scl; - // It goes in 9 cells, i.e. every Thing is tested against other Things in its cell - // as well as its 8 neighbors - for (int n = -1; n <= 1; n++) { - for (int m = -1; m <= 1; m++) { - if (x+n >= 0 && x+n < cols && y+m >= 0 && y+m< rows) grid[x+n][y+m].add(t); - } - } - } - - // Run through the Grid - stroke(255); - for (int i = 0; i < cols; i++) { - //line(i*scl,0,i*scl,height); - for (int j = 0; j < rows; j++) { - //line(0,j*scl,width,j*scl); - - // For every list in the grid - ArrayList temp = grid[i][j]; - // Check every Thing - for (Thing t : temp) { - // Against every other Thing - for (Thing other : temp) { - // As long as its not the same one - if (other != t) { - // Check to see if they are touching - // (We could do many other things here besides just intersection tests, such - // as apply forces, etc.) - float d = dist(t.x,t.y,other.x,other.y); - if (d < t.r/2 + other.r/2) { - t.highlight = true; - } - } - } - } - } - } - - // Display and move all Things - for (Thing t : a) { - t.render(); - t.move(); - } - - fill(0); - rect(0,height-20,width,20); - fill(255); - text("Framerate: " + int(frameRate),10,height-6); - - - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde deleted file mode 100644 index 7a739186b..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/Thing.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Daniel Shiffman - -// Simple class describing an ellipse living on our screen - -class Thing { - - float x,y; - boolean highlight; - float r; - - Thing (float x_, float y_) { - x = x_; - y = y_; - highlight = false; - r = random(8) + 1; - } - - void move() { - x += random(-1,1); - y += random(-1,1); - } - - void render() { - noStroke(); - if (highlight) fill(255); - else fill(100); - ellipse(x,y,r,r); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde b/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde deleted file mode 100644 index f8303c06e..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/binlatticespatialsubdivision/intersection/intersection_slow/intersection_slow.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The old way to do intersection tests, look how slow!! - -int totalThings = 2000; - -ArrayList a; // ArrayList for all "things" - -void setup() { - size(640,360); - a = new ArrayList(); // Create the list - - // Put 2000 Things in the system - for (int i = 0; i < totalThings; i++) { - a.add(new Thing(random(width),random(height))); - } - -} - -void draw() { - background(0); - fill(255); - noStroke(); - // Run through the Grid - stroke(255); - for (Thing t : a) { - t.highlight = false; - for (Thing other : a) { - // As long as its not the same one - if (t != other) { - // Check to see if they are touching - // (We could do many other things here besides just intersection tests, such - // as apply forces, etc.) - float d = dist(t.x,t.y,other.x,other.y); - if (d < t.r/2 + other.r/2) { - t.highlight = true; - } - } - } - } - - // Display and move all Things - for (Thing t : a) { - t.render(); - t.move(); - } - - fill(0); - rect(0,height-20,width,20); - fill(255); - text("Framerate: " + int(frameRate),10,height-6); - - - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde deleted file mode 100644 index 85150e404..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Boid.pde +++ /dev/null @@ -1,257 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - // We need to keep track of a Body and a width and height - Body body; - float w; - float h; - - float maxforce; // Maximum steering force - float maxspeed; // Maximum speed - - Boid(PVector loc) { - w = 12; - h = 12; - // Add the box to the box2d world - makeBody(new Vec2(loc.x,loc.y),w,h,new Vec2(0,0),0); - maxspeed = 20; - maxforce = 10; - } - - // This function removes the particle from the box2d world - void killBody() { - box2d.destroyBody(body); - } - - void run(ArrayList boids) { - flock(boids); - borders(); - display(); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - Vec2 sep = separate(boids); // Separation - Vec2 ali = align(boids); // Alignment - Vec2 coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mulLocal(1.5); - ali.mulLocal(1); - coh.mulLocal(1); - // Add the force vectors to acceleration - Vec2 loc = body.getWorldCenter(); - body.applyForce(sep,loc); - body.applyForce(ali,loc); - body.applyForce(coh,loc); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - Vec2 seek(Vec2 target) { - Vec2 loc = body.getWorldCenter(); - Vec2 desired = target.sub(loc); // A vector pointing from the location to the target - - // If the magnitude of desired equals 0, skip out of here - // (We could optimize this to check if x and y are 0 to avoid mag() square root - if (desired.length() == 0) return new Vec2(0,0); - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mulLocal(maxspeed); - // Steering = Desired minus Velocity - - Vec2 vel = body.getLinearVelocity(); - Vec2 steer = desired.sub(vel); - - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - return steer; - } - - - - // Drawing the box - void display() { - // We look at each body and get its screen position - Vec2 pos = box2d.getBodyPixelCoord(body); - - // Get its angle of rotation - float a = body.getAngle(); - - rectMode(CENTER); - pushMatrix(); - translate(pos.x,pos.y); - rotate(-a); - fill(175); - strokeWeight(2); - stroke(0); - rect(0,0,w,h); - popMatrix(); - } - - // Wraparound - void borders() { - Vec2 loc = box2d.getBodyPixelCoord(body); - Vec2 vel = body.getLinearVelocity(); - float a = body.getAngularVelocity(); - if (loc.x < -w) { - killBody(); - makeBody(new Vec2(width+w,loc.y),w,h,vel,a); - } else if (loc.y < -w) { - killBody(); - makeBody(new Vec2(loc.x,height+w),w,h,vel,a); - } else if (loc.x > width+w) { - killBody(); - makeBody(new Vec2(-w,loc.y),w,h,vel,a); - } else if (loc.y > height+w) { - killBody(); - makeBody(new Vec2(loc.x,-w),w,h,vel,a); - } - } - - // Separation - // Method checks for nearby boids and steers away - Vec2 separate (ArrayList boids) { - float desiredseparation = box2d.scalarPixelsToWorld(30); - - Vec2 steer = new Vec2(0,0); - int count = 0; - // For every boid in the system, check if it's too close - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - float d = dist(locA.x,locA.y,locB.x,locB.y); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - Vec2 diff = locA.sub(locB); - diff.normalize(); - diff.mulLocal(1.0/d); // Weight by distance - steer.addLocal(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.mulLocal(1.0/count); - } - - // As long as the vector is greater than 0 - if (steer.length() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mulLocal(maxspeed); - Vec2 vel = body.getLinearVelocity(); - steer.subLocal(vel); - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - Vec2 align (ArrayList boids) { - float neighbordist = box2d.scalarPixelsToWorld(50); - Vec2 steer = new Vec2(0,0); - int count = 0; - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - float d = dist(locA.x,locA.y,locB.x,locB.y); - if ((d > 0) && (d < neighbordist)) { - Vec2 vel = other.body.getLinearVelocity(); - steer.addLocal(vel); - count++; - } - } - if (count > 0) { - steer.mulLocal(1.0/count); - } - - // As long as the vector is greater than 0 - if (steer.length() > 0) { - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mulLocal(maxspeed); - Vec2 vel = body.getLinearVelocity(); - steer.subLocal(vel); - float len = steer.length(); - if (len > maxforce) { - steer.normalize(); - steer.mulLocal(maxforce); - } - } - return steer; - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - Vec2 cohesion (ArrayList boids) { - float neighbordist = box2d.scalarPixelsToWorld(50); - Vec2 sum = new Vec2(0,0); // Start with empty vector to accumulate all locations - int count = 0; - Vec2 locA = body.getWorldCenter(); - for (Boid other : boids) { - Vec2 locB = other.body.getWorldCenter(); - - float d = dist(locA.x,locA.y,locB.x,locB.y); - if ((d > 0) && (d < neighbordist)) { - sum.addLocal(locB); // Add location - count++; - } - } - if (count > 0) { - sum.mulLocal(1.0/count); - return seek(sum); // Steer towards the location - } - return sum; - } - - // This function adds the rectangle to the box2d world - void makeBody(Vec2 center, float w_, float h_, Vec2 vel, float avel) { - - // Define a polygon (this is what we use for a rectangle) - PolygonShape sd = new PolygonShape(); - float box2dW = box2d.scalarPixelsToWorld(w_/2); - float box2dH = box2d.scalarPixelsToWorld(h_/2); - sd.setAsBox(box2dW, box2dH); - - // Define a fixture - FixtureDef fd = new FixtureDef(); - fd.shape = sd; - // Parameters that affect physics - fd.density = 1; - fd.friction = 0.3; - fd.restitution = 0.5; - - // Define the body and make it from the shape - BodyDef bd = new BodyDef(); - bd.type = BodyType.DYNAMIC; - bd.position.set(box2d.coordPixelsToWorld(center)); - - body = box2d.createBody(bd); - body.createFixture(fd); - - body.setLinearVelocity(vel); - body.setAngularVelocity(avel); - - } - - -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde deleted file mode 100644 index 47b0e7b16..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flock.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An arraylist for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the arraylist - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde b/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde deleted file mode 100644 index e037a4db9..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/box2d/Flocking_box2d/Flocking_box2d.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flocking - -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system - -import pbox2d.*; -import org.jbox2d.collision.shapes.*; -import org.jbox2d.common.*; -import org.jbox2d.dynamics.*; - -// A reference to our box2d world -PBox2D box2d; - -Flock flock; - -void setup() { - size(640,360); - // Initialize box2d physics and create the world - box2d = new PBox2D(this); - box2d.createWorld(); - // We are setting a custom gravity - box2d.setGravity(0,0); - - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 50; i++) { - flock.addBoid(new Boid(new PVector(random(width),random(height)))); - } -} - -void draw() { - // We must always step through time! - box2d.step(); - - background(255); - flock.run(); -} - -void mousePressed() { - flock.addBoid(new Boid(new PVector(mouseX,mouseY))); -} - -void mouseDragged() { - flock.addBoid(new Boid(new PVector(mouseX,mouseY))); -} - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde deleted file mode 100644 index 808b7c6d5..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Boid.pde +++ /dev/null @@ -1,185 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float swt = 25.0; //sep.mult(25.0f); -float awt = 4.0; //ali.mult(4.0f); -float cwt = 5.0; //coh.mult(5.0f); -float maxspeed = 1; -float maxforce = 0.025; - - -// Flocking -// Daniel Shiffman -// The Nature of Code, Spring 2009 - -// Boid class -// Methods for Separation, Cohesion, Alignment added - -class Boid { - - PVector loc; - PVector vel; - PVector acc; - float r; - - Boid(float x, float y) { - acc = new PVector(0,0); - vel = new PVector(random(-1,1),random(-1,1)); - loc = new PVector(x,y); - r = 2.0; - } - - void run(ArrayList boids) { - flock(boids); - update(); - borders(); - render(); - } - - void applyForce(PVector force) { - // We could add mass here if we want A = F / M - acc.add(force); - } - - // We accumulate a new acceleration each time based on three rules - void flock(ArrayList boids) { - PVector sep = separate(boids); // Separation - PVector ali = align(boids); // Alignment - PVector coh = cohesion(boids); // Cohesion - // Arbitrarily weight these forces - sep.mult(swt); - ali.mult(awt); - coh.mult(cwt); - // Add the force vectors to acceleration - applyForce(sep); - applyForce(ali); - applyForce(coh); - } - - // Method to update location - void update() { - // Update velocity - vel.add(acc); - // Limit speed - vel.limit(maxspeed); - loc.add(vel); - // Reset accelertion to 0 each cycle - acc.mult(0); - } - - // A method that calculates and applies a steering force towards a target - // STEER = DESIRED MINUS VELOCITY - PVector seek(PVector target) { - PVector desired = PVector.sub(target,loc); // A vector pointing from the location to the target - - // Normalize desired and scale to maximum speed - desired.normalize(); - desired.mult(maxspeed); - // Steering = Desired minus Velocity - PVector steer = PVector.sub(desired,vel); - steer.limit(maxforce); // Limit to maximum steering force - - return steer; - } - - void render() { - // Draw a triangle rotated in the direction of velocity - float theta = vel.heading2D() + radians(90); - fill(175); - stroke(0); - pushMatrix(); - translate(loc.x,loc.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - // Wraparound - void borders() { - if (loc.x < -r) loc.x = width+r; - if (loc.y < -r) loc.y = height+r; - if (loc.x > width+r) loc.x = -r; - if (loc.y > height+r) loc.y = -r; - } - - // Separation - // Method checks for nearby boids and steers away - PVector separate (ArrayList boids) { - float desiredseparation = 25.0; - PVector steer = new PVector(0,0); - int count = 0; - // For every boid in the system, check if it's too close - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - // If the distance is greater than 0 and less than an arbitrary amount (0 when you are yourself) - if ((d > 0) && (d < desiredseparation)) { - // Calculate vector pointing away from neighbor - PVector diff = PVector.sub(loc,other.loc); - diff.normalize(); - diff.div(d); // Weight by distance - steer.add(diff); - count++; // Keep track of how many - } - } - // Average -- divide by how many - if (count > 0) { - steer.div((float)count); - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(vel); - steer.limit(maxforce); - } - return steer; - } - - // Alignment - // For every nearby boid in the system, calculate the average velocity - PVector align (ArrayList boids) { - float neighbordist = 50.0; - PVector steer = new PVector(); - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - if ((d > 0) && (d < neighbordist)) { - steer.add(other.vel); - count++; - } - } - if (count > 0) { - steer.div((float)count); - // Implement Reynolds: Steering = Desired - Velocity - steer.normalize(); - steer.mult(maxspeed); - steer.sub(vel); - steer.limit(maxforce); - } - return steer; - } - - // Cohesion - // For the average location (i.e. center) of all nearby boids, calculate steering vector towards that location - PVector cohesion (ArrayList boids) { - float neighbordist = 50.0; - PVector sum = new PVector(0,0); // Start with empty vector to accumulate all locations - int count = 0; - for (Boid other : boids) { - float d = PVector.dist(loc,other.loc); - if ((d > 0) && (d < neighbordist)) { - sum.add(other.loc); // Add location - count++; - } - } - if (count > 0) { - sum.div((float)count); - return seek(sum); // Steer towards the location - } - return sum; - } -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde deleted file mode 100644 index b548b2469..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/Flock.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Flock class -// Does very little, simply manages the ArrayList of all the boids - -class Flock { - ArrayList boids; // An ArrayList for all the boids - - Flock() { - boids = new ArrayList(); // Initialize the ArrayList - } - - void run() { - for (Boid b : boids) { - b.run(boids); // Passing the entire list of boids to each boid individually - } - } - - void addBoid(Boid b) { - boids.add(b); - } - -} diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde deleted file mode 100644 index afbf53ec4..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/flocking_sliders.pde +++ /dev/null @@ -1,57 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - - -// Flocking -// Demonstration of Craig Reynolds' "Flocking" behavior -// See: http://www.red3d.com/cwr/ -// Rules: Cohesion, Separation, Alignment - -// Click mouse to add boids into the system -Flock flock; -PVector center; - -boolean showvalues = true; -boolean scrollbar = false; - - -void setup() { - size(displayWidth,displayHeight,P2D); - setupScrollbars(); - center = new PVector(width/2,height/2); - colorMode(RGB,255,255,255,100); - flock = new Flock(); - // Add an initial set of boids into the system - for (int i = 0; i < 120; i++) { - flock.addBoid(new Boid(width/2,height/2)); - } - smooth(); -} - - -void draw() { - - background(255); - flock.run(); - drawScrollbars(); - - if (mousePressed && !scrollbar) { - flock.addBoid(new Boid(mouseX,mouseY)); - } - - - if (showvalues) { - fill(0); - textAlign(LEFT); - text("Total boids: " + flock.boids.size() + "\n" + "Framerate: " + round(frameRate) + "\nPress any key to show/hide sliders and text\nClick mouse to add more boids",5,100); - } -} - -void keyPressed() { - showvalues = !showvalues; -} - -void mousePressed() { -} - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde deleted file mode 100644 index b28b04f64..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/keyPressed.pde +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde b/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde deleted file mode 100644 index 3a6bc39be..000000000 --- a/java/examples/Books/Nature of Code/chp6_agents/flocking_sliders/scrollbar.pde +++ /dev/null @@ -1,137 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Code based on "Scrollbar" by Casey Reas - -HScrollbar[] hs = new HScrollbar[5];// -String[] labels = {"separation", "alignment","cohesion","maxspeed","maxforce"}; - -int x = 5; -int y = 20; -int w = 50; -int h = 8; -int l = 2; -int spacing = 4; - -void setupScrollbars() { - for (int i = 0; i < hs.length; i++) { - hs[i] = new HScrollbar(x, y + i*(h+spacing), w, h, l); - } - - hs[0].setPos(0.5); - hs[1].setPos(0.5); - hs[2].setPos(0.5); - hs[3].setPos(0.5); - hs[4].setPos(0.05); - -} - -void drawScrollbars() { - //if (showvalues) { - swt = hs[0].getPos()*10.0f; //sep.mult(25.0f); - awt = hs[1].getPos()*2.0f; //sep.mult(25.0f); - cwt = hs[2].getPos()*2.0f; //sep.mult(25.0f); - maxspeed = hs[3].getPos()*10.0f; - maxforce = hs[4].getPos()*0.5; - - - if (showvalues) { - for (int i = 0; i < hs.length; i++) { - hs[i].update(); - hs[i].draw(); - fill(0); - textAlign(LEFT); - text(labels[i],x+w+spacing,y+i*(h+spacing)+spacing); - //text(hs[i].getPos(),x+w+spacing+75,y+i*(h+spacing)+spacing); - } - } -} - - -class HScrollbar -{ - int swidth, sheight; // width and height of bar - int xpos, ypos; // x and y position of bar - float spos, newspos; // x position of slider - int sposMin, sposMax; // max and min values of slider - int loose; // how loose/heavy - boolean over; // is the mouse over the slider? - boolean locked; - float ratio; - - HScrollbar (int xp, int yp, int sw, int sh, int l) { - swidth = sw; - sheight = sh; - int widthtoheight = sw - sh; - ratio = (float)sw / (float)widthtoheight; - xpos = xp; - ypos = yp-sheight/2; - spos = xpos; - newspos = spos; - sposMin = xpos; - sposMax = xpos + swidth - sheight; - loose = l; - } - - void update() { - if(over()) { - over = true; - } - else { - over = false; - } - if(mousePressed && over) { - scrollbar = true; - locked = true; - } - if(!mousePressed) { - locked = false; - scrollbar = false; - } - if(locked) { - newspos = constrain(mouseX-sheight/2, sposMin, sposMax); - } - if(abs(newspos - spos) > 0) { - spos = spos + (newspos-spos)/loose; - } - } - - int constrain(int val, int minv, int maxv) { - return min(max(val, minv), maxv); - } - - boolean over() { - if(mouseX > xpos && mouseX < xpos+swidth && - mouseY > ypos && mouseY < ypos+sheight) { - return true; - } - else { - return false; - } - } - - void draw() { - fill(255); - rectMode(CORNER); - rect(xpos, ypos, swidth, sheight); - if(over || locked) { - fill(153, 102, 0); - } - else { - fill(102, 102, 102); - } - rect(spos, ypos, sheight, sheight); - } - - void setPos(float s) { - spos = xpos + s*(sposMax-sposMin); - newspos = spos; - } - - float getPos() { - // convert spos to be values between - // 0 and the total width of the scrollbar - return ((spos-xpos))/(sposMax-sposMin);// * ratio; - } -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde deleted file mode 100644 index 57f208c2c..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/CA.pde +++ /dev/null @@ -1,98 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - int w = 5; - - CA(int[] r) { - ruleset = r; - cells = new int[width/w]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, generation*w, w, w); - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[0]; - if (a == 1 && b == 1 && c == 0) return ruleset[1]; - if (a == 1 && b == 0 && c == 1) return ruleset[2]; - if (a == 1 && b == 0 && c == 0) return ruleset[3]; - if (a == 0 && b == 1 && c == 1) return ruleset[4]; - if (a == 0 && b == 1 && c == 0) return ruleset[5]; - if (a == 0 && b == 0 && c == 1) return ruleset[6]; - if (a == 0 && b == 0 && c == 0) return ruleset[7]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde deleted file mode 100644 index f39ae6b7f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_01_WolframCA_randomizedrules/Exercise_7_01_WolframCA_randomizedrules.pde +++ /dev/null @@ -1,45 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// When the system reaches bottom of the window, it restarts with a new ruleset -// Mouse click restarts as well - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - -int delay = 0; - -void setup() { - size(800, 200); - background(255); - int[] ruleset = { - 0, 1, 0, 1, 1, 0, 1, 0 - }; // An initial rule system - ca = new CA(ruleset); // Initialize CA - frameRate(30); -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); - - if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart - delay++; - if (delay > 30) { - background(255); - ca.randomize(); - ca.restart(); - delay = 0; - } - } -} - -void mousePressed() { - background(255); - ca.randomize(); - ca.restart(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde deleted file mode 100644 index aadb60528..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/CA.pde +++ /dev/null @@ -1,97 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 4; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - // Only draw if cell state is 1 - if (matrix[i][j] == 1) { - fill(0); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde deleted file mode 100644 index 4107ec882..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling/Exercise_7_04_WolframCA_scrolling.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(640, 800); - frameRate(24); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - int[] ruleset = {0,1,0,1,1,0,1,0}; // Rule 90 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - background(255); - ca.display(); // Draw the CA - ca.generate(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde deleted file mode 100644 index fbf426702..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_110/Exercise_7_04_WolframCA_scrolling_110.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde deleted file mode 100644 index bf9542216..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_190/Exercise_7_04_WolframCA_scrolling_190.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde deleted file mode 100644 index fa62c817f..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/CA.pde +++ /dev/null @@ -1,107 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde deleted file mode 100644 index 24f356e7e..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_222/Exercise_7_04_WolframCA_scrolling_222.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - //int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde deleted file mode 100644 index 2353dcb9b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/CA.pde +++ /dev/null @@ -1,106 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int generation; // How many generations? - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - int w = 5; - int[][] matrix; // Store a history of generations in 2D array, not just one - - int cols; - int rows; - - - CA(int[] r) { - ruleset = r; - cols = width/w; - rows = height/w; - matrix = new int[cols][rows]; - restart(); - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - matrix[i][j] = 0; - } - } - matrix[cols/2][0] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - - // The process of creating the new generation - void generate() { - - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 0; i < cols; i++) { - int left = matrix[(i+cols-1)%cols][generation%rows]; // Left neighbor state - int me = matrix[i][generation%rows]; // Current state - int right = matrix[(i+1)%cols][generation%rows]; // Right neighbor state - matrix[i][(generation+1)%rows] = rules(left, me, right); // Compute next generation state based on ruleset - } - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - int offset = generation%rows; - - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - int y = j - offset; - if (y <= 0) y = rows + y; - if (matrix[i][j] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, (y-1)*w, w, w); - } - } - } - // Implementing the Wolfram rules - // This is the concise conversion to binary way - /*int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s, 2); - return ruleset[index]; - }*/ - // For JavaScript Mode - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[7]; - if (a == 1 && b == 1 && c == 0) return ruleset[6]; - if (a == 1 && b == 0 && c == 1) return ruleset[5]; - if (a == 1 && b == 0 && c == 0) return ruleset[4]; - if (a == 0 && b == 1 && c == 1) return ruleset[3]; - if (a == 0 && b == 1 && c == 0) return ruleset[2]; - if (a == 0 && b == 0 && c == 1) return ruleset[1]; - if (a == 0 && b == 0 && c == 0) return ruleset[0]; - return 0; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/w) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde deleted file mode 100644 index f77d59cb1..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_04_WolframCA_scrolling_30/Exercise_7_04_WolframCA_scrolling_30.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// with the system scrolling by -// Also implements wrap around - -CA ca; // An object to describe a Wolfram elementary Cellular Automata - - -void setup() { - size(800, 100); - frameRate(30); - background(255); - //int[] ruleset = {0,1,1,1,1,0,1,1}; // Rule 222 - //int[] ruleset = {0,1,1,1,1,1,0,1}; // Rule 190 - int[] ruleset = {0,1,1,1,1,0,0,0}; // Rule 30 - //int[] ruleset = {0,1,1,1,0,1,1,0}; // Rule 110 - - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - ca.generate(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde deleted file mode 100644 index 13acf5b88..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Cell.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - float xoff; - float yoff; - - int state; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - xoff = w/2; - yoff = sin(radians(60))*w; - state = int(random(2)); - } - - - void display() { - - fill(state*255); - stroke(0); - pushMatrix(); - translate(x,y); - beginShape(); - vertex(0, yoff); - vertex(xoff, 0); - vertex(xoff+w, 0); - vertex(2*w, yoff); - vertex(xoff+w, 2*yoff); - vertex(xoff, 2*yoff); - vertex(0, yoff); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde deleted file mode 100644 index 38b7e4e27..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/Exercise_7_09_HexagonCells.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Outline for game of life -// This is just a grid of hexagons right now - -GOL gol; - -void setup() { - size(640, 360); - gol = new GOL(); -} - -void draw() { - background(255); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde deleted file mode 100644 index 1f1491abe..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Exercise_7_09_HexagonCells/GOL.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - float w = 20; - float h = sin(radians(60))*w; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/int(w*3); - rows = height/int(h); - board = new Cell[columns][rows]; - init(); - } - - void init() { - float h = sin(radians(60))*w; - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - if (j % 2 == 0) board[i][j] = new Cell(i*w*3, j*h,w); - else board[i][j] = new Cell(i*w*3+w+h/2, j*h, w); - } - } - } - - - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde b/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde deleted file mode 100644 index ef16d1b06..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/Figure_7_17_cells.pde +++ /dev/null @@ -1,31 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -size(1800,90); - -int w = 90; - -int total = width/w; - -int[] cells = {1,0,1,0,0,0,0,1,0,1,1,1,0,0,0,1,1,1,0,0}; - - -print("int[] cells = {"); -for (int i = 0; i < cells.length; i++) { - if (cells[i] == 0) fill(255); - else fill(64); - stroke(0); - rect(i*w,0,w-1,w-1); - print(cells[i] +","); -} - -saveFrame("cells.png"); - - - - - - - - diff --git a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif b/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif deleted file mode 100644 index 38ef13501..000000000 Binary files a/java/examples/Books/Nature of Code/chp7_CA/Figure_7_17_cells/cells.tif and /dev/null differ diff --git a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde deleted file mode 100644 index 3fd3a82d5..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GOL.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - int[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new int[columns][rows]; - //next = new int[columns][rows]; - // Call function to fill array with random values 0 or 1 - init(); - } - - void init() { - for (int i =1;i < columns-1;i++) { - for (int j =1;j < rows-1;j++) { - board[i][j] = int(random(2)); - } - } - } - - // The process of creating the new generation - void generate() { - - int[][] next = new int[columns][rows]; - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 0; x < columns; x++) { - for (int y = 0; y < rows; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[(x+i+columns)%columns][(y+j+rows)%rows]; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y]; - - // Rules of Life - if ((board[x][y] == 1) && (neighbors < 2)) next[x][y] = 0; // Loneliness - else if ((board[x][y] == 1) && (neighbors > 3)) next[x][y] = 0; // Overpopulation - else if ((board[x][y] == 0) && (neighbors == 3)) next[x][y] = 1; // Reproduction - else next[x][y] = board[x][y]; // Stasis - } - } - - // Next is now our board - board = next; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - if ((board[i][j] == 1)) fill(0); - else fill(255); - stroke(0); - rect(i*w, j*w, w, w); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde b/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde deleted file mode 100644 index f807dbebc..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/GameOfLifeWrapAround/GameOfLifeWrapAround.pde +++ /dev/null @@ -1,33 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Daniel Shiffman, Nature of Code - -// A basic implementation of John Conway's Game of Life CA -// how could this be improved to use object oriented programming? -// think of it as similar to our particle system, with a "cell" class -// to describe each individual cell and a "cellular automata" class -// to describe a collection of cells - -// Cells wrap around - -GOL gol; - -void setup() { - size(400, 400); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde deleted file mode 100644 index 13acf5b88..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/Cell.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - float xoff; - float yoff; - - int state; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - xoff = w/2; - yoff = sin(radians(60))*w; - state = int(random(2)); - } - - - void display() { - - fill(state*255); - stroke(0); - pushMatrix(); - translate(x,y); - beginShape(); - vertex(0, yoff); - vertex(xoff, 0); - vertex(xoff+w, 0); - vertex(2*w, yoff); - vertex(xoff+w, 2*yoff); - vertex(xoff, 2*yoff); - vertex(0, yoff); - endShape(); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde deleted file mode 100644 index 1f1491abe..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/GOL.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - float w = 20; - float h = sin(radians(60))*w; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/int(w*3); - rows = height/int(h); - board = new Cell[columns][rows]; - init(); - } - - void init() { - float h = sin(radians(60))*w; - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - if (j % 2 == 0) board[i][j] = new Cell(i*w*3, j*h,w); - else board[i][j] = new Cell(i*w*3+w+h/2, j*h, w); - } - } - } - - - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde b/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde deleted file mode 100644 index 6bd52053b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/HexagonCells/HexagonCells.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Outline for game of life -// This is just a grid of hexagons right now - -GOL gol; - -void setup() { - size(600, 600); - gol = new GOL(); -} - -void draw() { - background(255); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde deleted file mode 100644 index b0309e63b..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/CA.pde +++ /dev/null @@ -1,95 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - CA(int[] r) { - ruleset = r; - cells = new int[width/scl]; - restart(); - } - - CA() { - scl = 1; - cells = new int[width/scl]; - randomize(); - restart(); - } - - // Set the rules of the CA - void setRules(int[] r) { - ruleset = r; - } - - // Make a random ruleset - void randomize() { - for (int i = 0; i < 8; i++) { - ruleset[i] = int(random(2)); - } - } - - // Reset to generation 0 - void restart() { - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void render() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - stroke(0); - rect(i*scl, generation*scl, scl, scl); - } - } - - // Implementing the Wolfram rules - // Could be improved and made more concise, but here we can explicitly see what is going on for each case - int rules (int a, int b, int c) { - String s = "" + a + b + c; - int index = Integer.parseInt(s,2); - return ruleset[index]; - } - - // The CA is done if it reaches the bottom of the screen - boolean finished() { - if (generation > height/scl) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde deleted file mode 100644 index 8e7ea3f4c..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_figures/NOC_7_01_WolframCA_figures.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata -// When the system reaches bottom of the window, it restarts with a new ruleset -// Mouse click restarts as well - - -CA ca; // An instance object to describe the Wolfram basic Cellular Automata - -int scl = 20; - -void setup() { - size(1800,600); - background(255); - //int[] ruleset = {0,1,0,1,1,0,1,0}; // 90 - int[] ruleset = {0,1,1,1,1,0,1,1}; // An initial rule system - ca = new CA(ruleset); // Initialize CA -} - -void draw() { - ca.render(); // Draw the CA - ca.generate(); // Generate the next level - - if (ca.finished()) { // If we're done, clear the screen, pick a new ruleset and restart - saveFrame("rule222.png"); - noLoop(); - } -} - -void mousePressed() { - background(255); - ca.randomize(); - ca.restart(); -} diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde deleted file mode 100644 index a6e158470..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/CA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Wolfram Cellular Automata - -// A class to manage the CA - -class CA { - - int[] cells; // An array of 0s and 1s - int generation; // How many generations? - - int[] ruleset = {0, 1, 0, 1, 1, 0, 1, 0}; // An array to store the ruleset, for example {0,1,1,0,1,1,0,1} - - int w = 10; - - CA() { - cells = new int[width/w]; - for (int i = 0; i < cells.length; i++) { - cells[i] = 0; - } - cells[cells.length/2] = 1; // We arbitrarily start with just the middle cell having a state of "1" - generation = 0; - } - - // The process of creating the new generation - void generate() { - // First we create an empty array for the new values - int[] nextgen = new int[cells.length]; - // For every spot, determine new state by examing current state, and neighbor states - // Ignore edges that only have one neighor - for (int i = 1; i < cells.length-1; i++) { - int left = cells[i-1]; // Left neighbor state - int me = cells[i]; // Current state - int right = cells[i+1]; // Right neighbor state - nextgen[i] = rules(left, me, right); // Compute next generation state based on ruleset - } - // The current generation is the new generation - cells = nextgen; - generation++; - - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for (int i = 0; i < cells.length; i++) { - if (cells[i] == 1) fill(0); - else fill(255); - noStroke(); - rect(i*w, generation*w, w, w); - } - } - - - - // Implementing the Wolfram rules - // Could be improved and made more concise, but here we can explicitly see what is going on for each case - int rules (int a, int b, int c) { - if (a == 1 && b == 1 && c == 1) return ruleset[0]; - if (a == 1 && b == 1 && c == 0) return ruleset[1]; - if (a == 1 && b == 0 && c == 1) return ruleset[2]; - if (a == 1 && b == 0 && c == 0) return ruleset[3]; - if (a == 0 && b == 1 && c == 1) return ruleset[4]; - if (a == 0 && b == 1 && c == 0) return ruleset[5]; - if (a == 0 && b == 0 && c == 1) return ruleset[6]; - if (a == 0 && b == 0 && c == 0) return ruleset[7]; - return 0; - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde deleted file mode 100644 index e26b35453..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_01_WolframCA_simple/NOC_7_01_WolframCA_simple.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Wolfram Cellular Automata - -// Simple demonstration of a Wolfram 1-dimensional cellular automata - -CA ca; // An instance object to describe the Wolfram basic Cellular Automata - - -void setup() { - size(800, 400); - background(255); - ca = new CA(); // Initialize CA -} - -void draw() { - ca.display(); // Draw the CA - if (ca.generation < height/ca.w) { - ca.generate(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde deleted file mode 100644 index 413318d9d..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/GOL.pde +++ /dev/null @@ -1,77 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - int[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new int[columns][rows]; - //next = new int[columns][rows]; - // Call function to fill array with random values 0 or 1 - init(); - } - - void init() { - for (int i =1;i < columns-1;i++) { - for (int j =1;j < rows-1;j++) { - board[i][j] = int(random(2)); - } - } - } - - // The process of creating the new generation - void generate() { - - int[][] next = new int[columns][rows]; - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 1; x < columns-1; x++) { - for (int y = 1; y < rows-1; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[x+i][y+j]; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y]; - - // Rules of Life - if ((board[x][y] == 1) && (neighbors < 2)) next[x][y] = 0; // Loneliness - else if ((board[x][y] == 1) && (neighbors > 3)) next[x][y] = 0; // Overpopulation - else if ((board[x][y] == 0) && (neighbors == 3)) next[x][y] = 1; // Reproduction - else next[x][y] = board[x][y]; // Stasis - } - } - - // Next is now our board - board = next; - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - if ((board[i][j] == 1)) fill(0); - else fill(255); - stroke(0); - rect(i*w, j*w, w, w); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde deleted file mode 100644 index 4526630f8..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_02_GameOfLifeSimple/NOC_7_02_GameOfLifeSimple.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A basic implementation of John Conway's Game of Life CA -// how could this be improved to use object oriented programming? -// think of it as similar to our particle system, with a "cell" class -// to describe each individual cell and a "cellular automata" class -// to describe a collection of cells - -GOL gol; - -void setup() { - size(640, 360); - frameRate(24); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde deleted file mode 100644 index d18e16933..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/Cell.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Cell { - - float x, y; - float w; - - int state; - int previous; - - Cell(float x_, float y_, float w_) { - x = x_; - y = y_; - w = w_; - - state = int(random(2)); - previous = state; - } - - void savePrevious() { - previous = state; - } - - void newState(int s) { - state = s; - } - - void display() { - if (previous == 0 && state == 1) fill(0,0,255); - else if (state == 1) fill(0); - else if (previous == 1 && state == 0) fill(255,0,0); - else fill(255); - stroke(0); - rect(x, y, w, w); - } -} - - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde deleted file mode 100644 index cdf3f3ad2..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/GOL.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class GOL { - - int w = 8; - int columns, rows; - - // Game of life board - Cell[][] board; - - - GOL() { - // Initialize rows, columns and set-up arrays - columns = width/w; - rows = height/w; - board = new Cell[columns][rows]; - init(); - } - - void init() { - for (int i = 0; i < columns; i++) { - for (int j = 0; j < rows; j++) { - board[i][j] = new Cell(i*w, j*w, w); - } - } - } - - // The process of creating the new generation - void generate() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].savePrevious(); - } - } - - - // Loop through every spot in our 2D array and check spots neighbors - for (int x = 0; x < columns; x++) { - for (int y = 0; y < rows; y++) { - - // Add up all the states in a 3x3 surrounding grid - int neighbors = 0; - for (int i = -1; i <= 1; i++) { - for (int j = -1; j <= 1; j++) { - neighbors += board[(x+i+columns)%columns][(y+j+rows)%rows].previous; - } - } - - // A little trick to subtract the current cell's state since - // we added it in the above loop - neighbors -= board[x][y].previous; - - // Rules of Life - if ((board[x][y].state == 1) && (neighbors < 2)) board[x][y].newState(0); // Loneliness - else if ((board[x][y].state == 1) && (neighbors > 3)) board[x][y].newState(0); // Overpopulation - else if ((board[x][y].state == 0) && (neighbors == 3)) board[x][y].newState(1); // Reproduction - // else do nothing! - } - } - } - - // This is the easy part, just draw the cells, fill 255 for '1', fill 0 for '0' - void display() { - for ( int i = 0; i < columns;i++) { - for ( int j = 0; j < rows;j++) { - board[i][j].display(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde b/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde deleted file mode 100644 index 32227dd01..000000000 --- a/java/examples/Books/Nature of Code/chp7_CA/NOC_7_03_GameOfLifeOOP/NOC_7_03_GameOfLifeOOP.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A basic implementation of John Conway's Game of Life CA - -// Each cell is now an object! - -GOL gol; - -void setup() { - size(640, 360); - gol = new GOL(); -} - -void draw() { - background(255); - - gol.generate(); - gol.display(); -} - -// reset board when mouse is pressed -void mousePressed() { - gol.init(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde b/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde deleted file mode 100644 index 3c3d86023..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/CantorSetArrayList.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor Set -// Renders a simple fractal, the Cantor Set -// Uses an ArrayList to store list of objects -// Generates when mouse is pressed - -float h = 30; - -// List of line objects -ArrayList cantor; - -void setup() { - size(729, 200); - - // Start with one line - cantor = new ArrayList(); - cantor.add(new CantorLine(0, 100, width)); -} - -// Click the mouse to advance the sequence -void mousePressed() { - generate(); -} - -void draw() { - background(255); - // Always show all the lines - for (CantorLine cl : cantor) { - cl.display(); - } - - fill(0); - text("Click mouse to generate",10,height-20); -} - -void generate() { - // Generate the next set of lines - ArrayList next = new ArrayList(); - for (CantorLine cl : cantor) { - next.add(new CantorLine(cl.x,cl.y,cl.len/3)); - next.add(new CantorLine(cl.x+cl.len*2/3,cl.y,cl.len/3)); - } - cantor = next; -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde b/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde deleted file mode 100644 index 2677ac37b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/CantorSetArrayList/Line.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor line is a simple horizontal line with a starting point -// and length - -class CantorLine { - float x,y; - float len; - - CantorLine(float x_, float y_, float len_) { - x = x_; - y = y_; - len = len_; - } - - void display() { - stroke(0); - line(x,y,x+len,y); - } - -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde deleted file mode 100644 index e90258a0b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_01_RecursionLines/Exercise_8_01_RecursionLines.pde +++ /dev/null @@ -1,36 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(800, 200); -} - -void draw() { - background(255); - drawLines(100,100,700,100); - noLoop(); -} - -void drawLines(float x1, float y1, float x2, float y2) { - - line(x1,y1,x2,y2); - - float dx = x2-x1; - float dy = y2-y1; - - //println(dx + " " + dy); - - if (dx == 0 && dy > 4) { - //println(dy); - drawLines(x1-dy/3,y1,x1+dy/3,y1); - drawLines(x1-dy/3,y2,x1+dy/3,y2); - } else if (dy == 0 && dx > 4) { - //println(dx); - drawLines(x1,y1-dx/3,x1,y1+dx/3); - drawLines(x2,y1-dx/3,x2,y1+dx/3); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde deleted file mode 100644 index c5e5f6b86..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/Exercise_8_02_KochSnowFlake.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Snowflake - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(600, 692); - background(255); - lines = new ArrayList(); - PVector a = new PVector(0, 173); - PVector b = new PVector(width, 173); - PVector c = new PVector(width/2, 173+width*cos(radians(30))); - - // Starting with additional lines - lines.add(new KochLine(a, b)); - lines.add(new KochLine(b, c)); - lines.add(new KochLine(c, a)); - - for (int i = 0; i < 5; i++) { - generate(); - } -} - -void draw() { - background(255); - for (KochLine l : lines) { - l.display(); - } -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde deleted file mode 100644 index 8b2b5aab9..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_02_KochSnowFlake/KochLine.pde +++ /dev/null @@ -1,75 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - strokeWeight(2); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde deleted file mode 100644 index ced569b79..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_06_Tree/Exercise_8_06_Tree.pde +++ /dev/null @@ -1,58 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(1800, 500); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = PI/6;//map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(200,0); - save("chapter08_exc06.png"); - noLoop(); -} - -void branch(float len, int level) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - level++; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (level < 5) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len,level); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len,level); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde deleted file mode 100644 index 3019d44ca..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_07_Tree/Exercise_8_07_Tree.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - float sw = map(len,2,120,1,10); - strokeWeight(sw); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde deleted file mode 100644 index 7c5e8b9c8..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Branch.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) - -// A class for one branch in the system - -class Branch { - // Each has a location, velocity, and timer - // We could implement this same idea with different data - PVector start; - PVector end; - PVector vel; - float timer; - float timerstart; - - boolean growing = true; - - Branch(PVector l, PVector v, float n) { - start = l.get(); - end = l.get(); - vel = v.get(); - timerstart = n; - timer = timerstart; - } - - // Move location - void update() { - if (growing) { - end.add(vel); - } - } - - // Draw a dot at location - void render() { - stroke(0); - line(start.x,start.y,end.x,end.y); - } - - // Did the timer run out? - boolean timeToBranch() { - timer--; - if (timer < 0 && growing) { - growing = false; - return true; - } - else { - return false; - } - } - - // Create a new branch at the current location, but change direction by a given angle - Branch branch(float angle) { - // What is my current heading - float theta = vel.heading2D(); - // What is my current speed - float mag = vel.mag(); - // Turn me - theta += radians(angle); - // Look, polar coordinates to cartesian!! - PVector newvel = new PVector(mag*cos(theta),mag*sin(theta)); - // Return a new Branch - return new Branch(end,newvel,timerstart*0.66f); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde deleted file mode 100644 index 2900307cf..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Exercise_8_08_09_TreeArrayListLeaves.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) -// Nature of Code, Chapter 8 - -// Recursive branching "structure" without an explicitly recursive function -// Instead we have an ArrayList to hold onto N number of elements -// For every element in the ArrayList, we add 2 more elements, etc. (this is the recursion) - -// An arraylist that will keep track of all current branches -ArrayList tree; -ArrayList leaves; - -void setup() { - size(640,360); - background(255); - // Setup the arraylist and add one branch to it - tree = new ArrayList(); - leaves = new ArrayList(); - // A branch has a starting location, a starting "velocity", and a starting "timer" - Branch b = new Branch(new PVector(width/2,height),new PVector(0,-1),100); - // Add to arraylist - tree.add(b); -} - -void draw() { - background(255); - - // Let's stop when the arraylist gets too big - // For every branch in the arraylist - for (int i = tree.size()-1; i >= 0; i--) { - // Get the branch, update and draw it - Branch b = tree.get(i); - b.update(); - b.render(); - // If it's ready to split - if (b.timeToBranch()) { - if (tree.size() < 1024) { - //tree.remove(i); // Delete it - tree.add(b.branch( 30)); // Add one going right - tree.add(b.branch(-25)); // Add one going left - } - else { - leaves.add(new Leaf(b.end)); - } - } - } - - for (Leaf leaf : leaves) { - leaf.display(); - } - -} - - - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde deleted file mode 100644 index 94ffd407e..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_08_09_TreeArrayListLeaves/Leaf.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree (w/ ArrayList) - -// A class for a leaf that gets placed at the end of -// the last branches - -class Leaf { - PVector loc; - - Leaf(PVector l) { - loc = l.get(); - } - - void display() { - noStroke(); - fill(50,100); - ellipse(loc.x,loc.y,4,4); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde b/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde deleted file mode 100644 index 5a0bf3792..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Exercise_8_10_TreeStochasticNoise/Exercise_8_10_TreeStochasticNoise.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree with angles fluctuating with Perlin noise -// Nature of Code, Chapter 8 - -// Perlin noise offset -float yoff = 0; -// Random seed to control randomness while drawing the tree -int seed = 5; - - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - fill(0); - //text("Click mouse to generate a new tree", 10, height-20); - - stroke(0); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Move alogn through noise - yoff += 0.005; - randomSeed(seed); - // Start the recursive branching! - branch(60, 0); -} - - -void mousePressed() { - // New tree starts with new noise offset and new random seed - yoff = random(1000); - seed = millis(); -} - - -void branch(float h, float xoff) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 100, 1, 5); - strokeWeight(sw); - // Draw the branch - line(0, 0, 0, -h); - // Move along to end - translate(0, -h); - - // Each branch will be 2/3rds the size of the previous one - h *= 0.7f; - - // Move along through noise space - xoff += 0.1; - - if (h > 4) { - // Random number of branches - int n = int(random(0, 5)); - for (int i = 0; i < n; i++) { - - // Here the angle is controlled by perlin noise - // This is a totally arbitrary way to do it, try others! - float theta = map(noise(xoff+i, yoff), 0, 1, -PI/3, PI/3); - if (n%2==0) theta *= -1; - - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(h, xoff); // Ok, now call myself to branch again - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde deleted file mode 100644 index 6883037b6..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_02_Mandelbrot/Figure_8_02_Mandelbrot.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// The Mandelbrot Set - -// Simple rendering of the Mandelbrot set -// c = a + bi -// Iterate z = z^2 + c, i.e. -// z(0) = 0 -// z(1) = 0*0 + c -// z(2) = c*c + c -// z(3) = (c*c + c) * (c*c + c) + c -// etc. - -// c*c = (a+bi) * (a+bi) = a^2 - b^2 + 2abi - -// Establish a range of values on the complex plane -double xmin = -2.5; double ymin = -1; double w = 4; double h = 2; -// A different range will allow us to "zoom" in or out on the fractal -// double xmin = -1.5; double ymin = -.1; double wh = 0.15; - -void setup() { - size(863,863/2); -} - -void draw() { - - loadPixels(); - - // Maximum number of iterations for each point on the complex plane - int maxiterations = 200; - - // x goes from xmin to xmax - double xmax = xmin + w; - // y goes from ymin to ymax - double ymax = ymin + h; - - // Calculate amount we increment x,y for each pixel - double dx = (xmax - xmin) / (width); - double dy = (ymax - ymin) / (height); - - // Start y - double y = ymin; - for(int j = 0; j < height; j++) { - // Start x - double x = xmin; - for(int i = 0; i < width; i++) { - - // Now we test, as we iterate z = z^2 + cm does z tend towards infinity? - double a = x; - double b = y; - int n = 0; - while (n < maxiterations) { - double aa = a * a; - double bb = b * b; - double twoab = 2.0 * a * b; - a = aa - bb + x; - b = twoab + y; - // Infinty in our finite world is simple, let's just consider it 16 - if(aa + bb > 16.0f) { - break; // Bail - } - n++; - } - - // We color each pixel based on how long it takes to get to infinity - // If we never got there, let's pick the color black - if (n == maxiterations) pixels[i+j*width] = color(0); - else pixels[i+j*width] = color(n*16 % 255); // Gosh, we could make fancy colors here if we wanted - x += dx; - } - y += dy; - } - updatePixels(); - - save("chapter08_02.png"); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde deleted file mode 100644 index d9d8b0bee..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/Figure_8_14_Koch.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(1820, 200); - - - smooth(); -} - - - -void draw() { - translate(10,0); - int spacing = 10; - int total = 5; - - background(255); - float w = (1800-spacing*(total-1))/5; - for (int n = 0; n < total; n++) { - lines = new ArrayList(); - PVector start = new PVector(0, height*2/3); - PVector end = new PVector(w, height*2/3); - lines.add(new KochLine(start, end)); - for (int i = 0; i < n; i++) { - generate(); - } - strokeWeight(2); - for (KochLine l : lines) { - l.display(); - } - noFill(); - strokeWeight(1); - stroke(127); - rect(0, 10, w,height-20); - translate(w+spacing, 0); - } - save("chapter08_14.png"); - noLoop(); -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde deleted file mode 100644 index 54ed28120..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_14_Koch/KochLine.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve - -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde deleted file mode 100644 index a81bd3fe8..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_20_Tree/Figure_8_20_Tree.pde +++ /dev/null @@ -1,55 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde deleted file mode 100644 index 135d12ac9..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/Figure_8_CantorLine/Figure_8_CantorLine.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(800, 60); - background(255); -} - -void cantor(float x, float y, float len) { - line(x, y, x+len, y); - - y += 20; - line(x,y,x+len/3,y); //[bold] - line(x+len*2/3,y,x+len,y); //[bold] -} - -void draw() { - cantor(10, 20, width-20); - save("chapter08_12.png"); - noLoop(); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde deleted file mode 100644 index 84b600182..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_01_Recursion/NOC_8_01_Recursion.pde +++ /dev/null @@ -1,27 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640,360); -} - -void draw() { - background(255); - drawCircle(width/2,height/2,width); - noLoop(); -} - -// Very simple function that draws one circle -// and recursively calls itself -void drawCircle(int x, int y, float r) { - ellipse(x, y, r, r); - // Exit condition, stop when radius is too small - if(r > 2) { - r *= 0.75f; - // Call the function inside the function! (recursion!) - drawCircle(x, y, r); - } -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde deleted file mode 100644 index b02eda5fe..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_02_Recursion/NOC_8_02_Recursion.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640,360); -} - -void draw() { - background(255); - drawCircle(width/2,height/2,400); - noLoop(); -} - -// Recursive function -void drawCircle(float x, float y, float r) { - stroke(0); - noFill(); - ellipse(x, y, r, r); - if(r > 2) { - // Now we draw two more circles, one to the left - // and one to the right - drawCircle(x + r/2, y, r/2); - drawCircle(x - r/2, y, r/2); - } -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde deleted file mode 100644 index c7257d242..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_03_Recursion/NOC_8_03_Recursion.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Simple Recursion - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - drawCircle(width/2, height/2, 400); - noLoop(); -} - -void drawCircle(float x, float y, float radius) { - noFill(); - stroke(0); - ellipse(x, y, radius, radius); - if (radius > 8) { - // Four circles! left right, up and down - drawCircle(x + radius/2, y, radius/2); - drawCircle(x - radius/2, y, radius/2); - drawCircle(x, y + radius/2, radius/2); - drawCircle(x, y - radius/2, radius/2); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde deleted file mode 100644 index 47da39851..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_CantorSet/NOC_8_04_CantorSet.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Cantor Set -// Renders a simple fractal, the Cantor Set - -void setup() { - size(800, 200); - background(255); - - // Call the recursive function - cantor(35, 0, 730); -} - -void draw() { - // No need to loop - noLoop(); -} - - -void cantor(float x, float y, float len) { - - float h = 30; - - // recursive exit condition - if (len >= 1) { - // Draw line (as rectangle to make it easier to see) - noStroke(); - fill(0); - rect(x, y, len, h/3); - // Go down to next y position - y += h; - // Draw 2 more lines 1/3rd the length (without the middle section) - cantor(x, y, len/3); - cantor(x+len*2/3, y, len/3); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde deleted file mode 100644 index cb35ab15f..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_04_Tree/NOC_8_04_Tree.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(300, 200); - smooth(); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - float sw = map(len,2,120,1,10); - strokeWeight(sw); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde deleted file mode 100644 index 76a8f1cd7..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochFractal.pde +++ /dev/null @@ -1,71 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to manage the list of line segments in the snowflake pattern - -class KochFractal { - PVector start; // A PVector for the start - PVector end; // A PVector for the end - ArrayList lines; // A list to keep track of all the lines - int count; - - public KochFractal() { - start = new PVector(0,height-20); - end = new PVector(width,height-20); - lines = new ArrayList(); - restart(); - } - - void nextLevel() { - // For every line that is in the arraylist - // create 4 more lines in a new arraylist - lines = iterate(lines); - count++; - } - - void restart() { - count = 0; // Reset count - lines.clear(); // Empty the array list - lines.add(new KochLine(start,end)); // Add the initial line (from one end PVector to the other) - } - - int getCount() { - return count; - } - - // This is easy, just draw all the lines - void render() { - for(KochLine l : lines) { - l.display(); - } - } - - // This is where the **MAGIC** happens - // Step 1: Create an empty arraylist - // Step 2: For every line currently in the arraylist - // - calculate 4 line segments based on Koch algorithm - // - add all 4 line segments into the new arraylist - // Step 3: Return the new arraylist and it becomes the list of line segments for the structure - - // As we do this over and over again, each line gets broken into 4 lines, which gets broken into 4 lines, and so on. . . - ArrayList iterate(ArrayList before) { - ArrayList now = new ArrayList(); // Create emtpy list - for(KochLine l : before) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.start(); - PVector b = l.kochleft(); - PVector c = l.kochmiddle(); - PVector d = l.kochright(); - PVector e = l.end(); - // Make line segments between all the PVectors and add them - now.add(new KochLine(a,b)); - now.add(new KochLine(b,c)); - now.add(new KochLine(c,d)); - now.add(new KochLine(d,e)); - } - return now; - } - -} diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde deleted file mode 100644 index 6f3ff6913..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/KochLine.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector a; - PVector b; - - KochLine(PVector start, PVector end) { - a = start.get(); - b = end.get(); - } - - void display() { - stroke(0); - line(a.x, a.y, b.x, b.y); - } - - PVector start() { - return a.get(); - } - - PVector end() { - return b.get(); - } - - // This is easy, just 1/3 of the way - PVector kochleft() { - PVector v = PVector.sub(b, a); - v.div(3); - v.add(a); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochmiddle() { - PVector v = PVector.sub(b, a); - v.div(3); - - PVector p = a.get(); - p.add(v); - - rotate(v,-radians(60)); - p.add(v); - - return p; - } - - - // Easy, just 2/3 of the way - PVector kochright() { - PVector v = PVector.sub(a, b); - v.div(3); - v.add(b); - return v; - } -} - - public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*cos(theta) - v.y*sin(theta); - v.y = xTemp*sin(theta) + v.y*cos(theta); - } - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde deleted file mode 100644 index f61293171..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_Koch/NOC_8_05_Koch.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com -// Koch Curve - -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -KochFractal k; - -void setup() { - size(800,250); - background(255); - frameRate(1); // Animate slowly - k = new KochFractal(); - smooth(); -} - -void draw() { - background(255); - // Draws the snowflake! - k.render(); - // Iterate - k.nextLevel(); - // Let's not do it more than 5 times. . . - if (k.getCount() > 5) { - k.restart(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde deleted file mode 100644 index f66510428..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/KochLine.pde +++ /dev/null @@ -1,73 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// A class to describe one line segment in the fractal -// Includes methods to calculate midPVectors along the line according to the Koch algorithm - -class KochLine { - - // Two PVectors, - // a is the "left" PVector and - // b is the "right PVector - PVector start; - PVector end; - - KochLine(PVector a, PVector b) { - start = a.get(); - end = b.get(); - } - - void display() { - stroke(0); - line(start.x, start.y, end.x, end.y); - } - - PVector kochA() { - return start.get(); - } - - - // This is easy, just 1/3 of the way - PVector kochB() { - PVector v = PVector.sub(end, start); - v.div(3); - v.add(start); - return v; - } - - // More complicated, have to use a little trig to figure out where this PVector is! - PVector kochC() { - PVector a = start.get(); // Start at the beginning - - PVector v = PVector.sub(end, start); - v.div(3); - a.add(v); // Move to point B - - rotate(v, -radians(60)); // Rotate 60 degrees - a.add(v); // Move to point C - - return a; - } - - // Easy, just 2/3 of the way - PVector kochD() { - PVector v = PVector.sub(end, start); - v.mult(2/3.0); - v.add(start); - return v; - } - - PVector kochE() { - return end.get(); - } -} - -public void rotate(PVector v, float theta) { - float xTemp = v.x; - // Might need to check for rounding errors like with angleBetween function? - v.x = v.x*PApplet.cos(theta) - v.y*PApplet.sin(theta); - v.y = xTemp*PApplet.sin(theta) + v.y*PApplet.cos(theta); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde deleted file mode 100644 index b8268ee9f..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_05_KochSimple/NOC_8_05_KochSimple.pde +++ /dev/null @@ -1,51 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Koch Curve -// Renders a simple fractal, the Koch snowflake -// Each recursive level drawn in sequence - -ArrayList lines ; // A list to keep track of all the lines - -void setup() { - size(383, 200); - background(255); - lines = new ArrayList(); - PVector start = new PVector(0, 150); - PVector end = new PVector(width, 150); - lines.add(new KochLine(start, end)); - - for (int i = 0; i < 5; i++) { - generate(); - } - - smooth(); -} - -void draw() { - background(255); - for (KochLine l : lines) { - l.display(); - } -} - -void generate() { - ArrayList next = new ArrayList(); // Create emtpy list - for (KochLine l : lines) { - // Calculate 5 koch PVectors (done for us by the line object) - PVector a = l.kochA(); - PVector b = l.kochB(); - PVector c = l.kochC(); - PVector d = l.kochD(); - PVector e = l.kochE(); - // Make line segments between all the PVectors and add them - next.add(new KochLine(a, b)); - next.add(new KochLine(b, c)); - next.add(new KochLine(c, d)); - next.add(new KochLine(d, e)); - } - lines = next; -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde deleted file mode 100644 index b14d7b021..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_SimpleLSystem/NOC_8_06_SimpleLSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// L-System -// Just demonstrating working with L-System strings -// No drawing - -// Start with "A" -String current = "A"; -// Number of generations -int count = 0; - -void setup() { - size(200, 200); - println("Generation " + count + ": " + current); -} - -void draw() { - background(255); - fill(0); - text("Click mouse to generate", 10, height-20); - noLoop(); -} - -void mousePressed() { - // A new StringBuffer for the next generation - StringBuffer next = new StringBuffer(); - - // Look through the current String to replace according to L-System rules - for (int i = 0; i < current.length(); i++) { - char c = current.charAt(i); - if (c == 'A') { - // If we find A replace with AB - next.append("AB"); - } else if (c == 'B') { - // If we find B replace with A - next.append("A"); - } - } - // The current String is now the next one - current = next.toString(); - count++; - // Print to message console - println("Generation " + count + ": " + current); - println(count + " " + current.length()); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde deleted file mode 100644 index f2853c124..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree/NOC_8_06_Tree.pde +++ /dev/null @@ -1,53 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Recursive Tree -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -float theta; - -void setup() { - size(640, 360); -} - -void draw() { - background(255); - // Let's pick an angle 0 to 90 degrees based on the mouse position - theta = map(mouseX,0,width,0,PI/2); - - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); -} - -void branch(float len) { - // Each branch will be 2/3rds the size of the previous one - - //float sw = map(len,2,120,1,10); - //strokeWeight(sw); - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-theta); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde deleted file mode 100644 index 92805fdb4..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_06_Tree_static/NOC_8_06_Tree_static.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Recursive Tree -// Daniel Shiffman -// Nature of Code, Chapter 8 - -// Renders a simple tree-like structure via recursion -// Branching angle calculated as a function of horizontal mouse location - -void setup() { - size(800, 200); - smooth(); -} - -void draw() { - background(255); - // Start the tree from the bottom of the screen - translate(width/2, height); - stroke(0); - branch(60); - noLoop(); -} - -void branch(float len) { - strokeWeight(2); - - line(0, 0, 0, -len); - // Move to the end of that line - translate(0, -len); - - len *= 0.66; - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (len > 2) { - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(PI/5); // Rotate by theta - branch(len); // Ok, now call myself to draw two new branches!! - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - - // Repeat the same thing, only branch off to the "left" this time! - pushMatrix(); - rotate(-PI/5); - branch(len); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde deleted file mode 100644 index c0e22fb7b..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic/NOC_8_07_TreeStochastic.pde +++ /dev/null @@ -1,66 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree -// Renders a simple tree-like structure via recursion -// Angles and number of branches are random - -void setup() { - size(800, 200); - newTree(); -} - -void draw() { - noLoop(); -} - -void mousePressed() { - newTree(); - redraw(); -} - -void newTree() { - background(255); - fill(0); - text("Click mouse to generate a new tree", 10, height-10); - - stroke(0); - pushMatrix(); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Start the recursive branching! - branch(80); - popMatrix(); -} - - - -void branch(float h) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 120, 1, 5); - strokeWeight(sw); - // Draw the actual branch - line(0, 0, 0, -h); - // Move along to end - translate(0, -h); - - // Each branch will be 2/3rds the size of the previous one - h *= 0.66f; - - // All recursive functions must have an exit condition!!!! - // Here, ours is when the length of the branch is 2 pixels or less - if (h > 2) { - // A random number of branches - int n = int(random(1, 4)); - for (int i = 0; i < n; i++) { - // Picking a random angle - float theta = random(-PI/2, PI/2); - pushMatrix(); // Save the current state of transformation (i.e. where are we now) - rotate(theta); // Rotate by theta - branch(h); // Ok, now call myself to branch again - popMatrix(); // Whenever we get back here, we "pop" in order to restore the previous matrix state - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde deleted file mode 100644 index 5c73557a5..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_07_TreeStochastic_angleonly/NOC_8_07_TreeStochastic_angleonly.pde +++ /dev/null @@ -1,59 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Stochastic Tree -// Renders a simple tree-like structure via recursion -// Angles and number of branches are random - -void setup() { - size(800, 200); - newTree(); -} - -void draw() { - noLoop(); -} - -void mousePressed() { - pushMatrix(); - newTree(); - popMatrix(); - redraw(); -} - -void newTree() { - background(255); - fill(0); - text("Click mouse to generate a new tree", 10, height-10); - - stroke(0); - // Start the tree from the bottom of the screen - translate(width/2, height); - // Start the recursive branching! - branch(60); -} - - - -void branch(float h) { - // thickness of the branch is mapped to its length - float sw = map(h, 2, 120, 1, 5); - strokeWeight(sw); - float theta = random(0,PI/3); - - line(0, 0, 0, -h); - translate(0, -h); - h *= 0.66; - if (h > 2) { - pushMatrix(); - rotate(theta); - branch(h); - popMatrix(); - pushMatrix(); - rotate(-theta); - branch(h); - popMatrix(); - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde deleted file mode 100644 index 9f1b0dac3..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_08_SimpleLSystem/NOC_8_08_SimpleLSystem.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// L-System -// Just demonstrating working with L-System strings -// No drawing - -// Start with "A" -String current = "A"; -// Number of generations -int count = 0; - -void setup() { - size(800, 200); - println("Generation " + count + ": " + current); -} - -void draw() { - background(255); - fill(0); - text("Click mouse to generate", 10, height-20); - noLoop(); -} - -void mousePressed() { - // A new StringBuffer for the next generation - StringBuffer next = new StringBuffer(); - - // Look through the current String to replace according to L-System rules - for (int i = 0; i < current.length(); i++) { - char c = current.charAt(i); - if (c == 'A') { - // If we find A replace with AB - next.append("AB"); - } else if (c == 'B') { - // If we find B replace with A - next.append("A"); - } - } - // The current String is now the next one - current = next.toString(); - count++; - // Print to message console - println("Generation " + count + ": " + current); - //println(count + " " + current.length()); -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde deleted file mode 100644 index a51c255ee..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/LSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// An LSystem has a starting sentence -// An a ruleset -// Each generation recursively replaces characteres in the sentence -// Based on the rulset - -class LSystem { - - String sentence; // The sentence (a String) - Rule[] ruleset; // The ruleset (an array of Rule objects) - int generation; // Keeping track of the generation # - - // Construct an LSystem with a startin sentence and a ruleset - LSystem(String axiom, Rule[] r) { - sentence = axiom; - ruleset = r; - generation = 0; - } - - // Generate the next generation - void generate() { - // An empty StringBuffer that we will fill - StringBuffer nextgen = new StringBuffer(); - // For every character in the sentence - for (int i = 0; i < sentence.length(); i++) { - // What is the character - char curr = sentence.charAt(i); - // We will replace it with itself unless it matches one of our rules - String replace = "" + curr; - // Check every rule - for (int j = 0; j < ruleset.length; j++) { - char a = ruleset[j].getA(); - // if we match the Rule, get the replacement String out of the Rule - if (a == curr) { - replace = ruleset[j].getB(); - break; - } - } - // Append replacement String - nextgen.append(replace); - } - // Replace sentence - sentence = nextgen.toString(); - // Increment generation - generation++; - } - - String getSentence() { - return sentence; - } - - int getGeneration() { - return generation; - } - - -} - - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde deleted file mode 100644 index 94a960d42..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/NOC_8_09_LSystem.pde +++ /dev/null @@ -1,63 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -LSystem lsys; -Turtle turtle; - -void setup() { - size(600, 600); - /* - // Create an empty ruleset - Rule[] ruleset = new Rule[2]; - // Fill with two rules (These are rules for the Sierpinksi Gasket Triangle) - ruleset[0] = new Rule('F',"F--F--F--G"); - ruleset[1] = new Rule('G',"GG"); - // Create LSystem with axiom and ruleset - lsys = new LSystem("F--F--F",ruleset); - turtle = new Turtle(lsys.getSentence(),width*2,TWO_PI/3); - */ - - /*Rule[] ruleset = new Rule[1]; - //ruleset[0] = new Rule('F',"F[F]-F+F[--F]+F-F"); - ruleset[0] = new Rule['F',"FF+[+F-F-F]-[-F+F+F]"); - lsys = new LSystem("F-F-F-F",ruleset); - turtle = new Turtle(lsys.getSentence(),width-1,PI/2); - */ - - Rule[] ruleset = new Rule[1]; - ruleset[0] = new Rule('F', "FF+[+F-F-F]-[-F+F+F]"); - lsys = new LSystem("F", ruleset); - turtle = new Turtle(lsys.getSentence(), height/3, radians(25)); - - - - smooth(); -} - -void draw() { - background(255); - fill(0); - //text("Click mouse to generate", 10, height-10); - - translate(width/2, height); - rotate(-PI/2); - turtle.render(); - noLoop(); -} - -int counter = 0; - -void mousePressed() { - if (counter < 5) { - pushMatrix(); - lsys.generate(); - //println(lsys.getSentence()); - turtle.setToDo(lsys.getSentence()); - turtle.changeLen(0.5); - popMatrix(); - redraw(); - counter++; - } -} - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde deleted file mode 100644 index 49353e772..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Rule.pde +++ /dev/null @@ -1,26 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// LSystem Rule class - -class Rule { - char a; - String b; - - Rule(char a_, String b_) { - a = a_; - b = b_; - } - - char getA() { - return a; - } - - String getB() { - return b; - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde b/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde deleted file mode 100644 index cede7d5c7..000000000 --- a/java/examples/Books/Nature of Code/chp8_fractals/NOC_8_09_LSystem/Turtle.pde +++ /dev/null @@ -1,54 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -class Turtle { - - String todo; - float len; - float theta; - - Turtle(String s, float l, float t) { - todo = s; - len = l; - theta = t; - } - - void render() { - stroke(0,175); - for (int i = 0; i < todo.length(); i++) { - char c = todo.charAt(i); - if (c == 'F' || c == 'G') { - line(0,0,len,0); - translate(len,0); - } - else if (c == '+') { - rotate(theta); - } - else if (c == '-') { - rotate(-theta); - } - else if (c == '[') { - pushMatrix(); - } - else if (c == ']') { - popMatrix(); - } - } - } - - void setLen(float l) { - len = l; - } - - void changeLen(float percent) { - len *= percent; - } - - void setToDo(String s) { - todo = s; - } - -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde deleted file mode 100644 index 54d988426..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/DNA.pde +++ /dev/null @@ -1,82 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// DNA is an array of vectors - -class DNA { - - // The genetic sequence - PVector[] genes; - - // Constructor (makes a DNA of random PVectors) - DNA(int num) { - genes = new PVector[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = PVector.random2D(); - } - } - - // Constructor #2, creates the instance based on an existing array - DNA(PVector[] newgenes) { - // We could make a copy if necessary - // genes = (PVector []) newgenes.clone(); - genes = newgenes; - } - - // CROSSOVER - // Creates new DNA sequence from two (this & and a partner) - DNA crossover(DNA partner) { - PVector[] child = new PVector[genes.length]; - // Pick a midpoint - int crossover = int(random(genes.length)); - // Take "half" from one and "half" from the other - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = PVector.random2D(); - } - } - } - - void debugDraw() { - int cols = width / gridscale; - int rows = height / gridscale; - for (int i = 0; i < cols; i++) { - for (int j = 0; j < rows; j++) { - drawVector(genes[i+j*cols],i*gridscale,j*gridscale,gridscale-2); - } - } - } - - // Renders a vector object 'v' as an arrow and a location 'x,y' - void drawVector(PVector v, float x, float y, float scayl) { - pushMatrix(); - float arrowsize = 4; - // Translate to location to render vector - translate(x+gridscale/2,y); - stroke(0,100); - // Call vector heading function to get direction (note that pointing up is a heading of 0) and rotate - rotate(v.heading()); - // Calculate length of vector & scale it to be bigger or smaller if necessary - float len = v.mag()*scayl; - // Draw three lines to make an arrow (draw pointing up since we've rotate to the proper direction) - line(-len/2,0,len/2,0); - //noFill(); - //ellipse(-len/2,0,2,2); - popMatrix(); - } - -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde deleted file mode 100644 index 433924997..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/EvolveFlowField.pde +++ /dev/null @@ -1,121 +0,0 @@ - // The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding Flowfield w/ Genetic Algorithms - -// This example produces an obstacle course with a start and finish -// Virtual "creatures" are rewarded for making it closer to the finish - -// Each creature's DNA is a "flowfield" of PVectors that -// determine steering vectors for each cell on the screen - -import java.awt.Rectangle; - -int gridscale = 10; // Scale of grid is 1/24 of screen size - -// DNA needs one vector for every spot on the grid -// (it's like a pixel array, but with vectors instead of colors) -int dnasize; - -int lifetime; // How long should each generation live - - -Population population; // Population -int lifecycle; // Timer for cycle of generation -int recordtime; // Fastest time to target -Obstacle target; // Target location -Obstacle start; // Start location -int diam = 24; // Size of target - -ArrayList obstacles; //an array list to keep track of all the obstacles! - -boolean debug = false; - -Rectangle newObstacle = null; - -void setup() { - size(640,360); - dnasize = (width / gridscale) * (height / gridscale); - lifetime = width/3; - - // Initialize variables - lifecycle = 0; - recordtime = lifetime; - target = new Obstacle(width-diam-diam/2,height/2-diam/2,diam,diam); - start = new Obstacle(diam/2,height/2-diam/2,diam,diam); - - // Create a population with a mutation rate, and population max - int popmax = 1000; - float mutationRate = 0.02; - population = new Population(mutationRate,popmax); - - // Create the obstacle course - obstacles = new ArrayList(); - - - /*obstacles.add(new Obstacle(width/4,80,10,height-160)); - obstacles.add(new Obstacle(width/2,0,10,height/2-20)); - obstacles.add(new Obstacle(width/2,height-height/2+20,10,height/2-20)); - obstacles.add(new Obstacle(2*width/3,height/2-height/8,10,height/4));*/ -} - -void draw() { - background(255); - - // Draw the target locations - target.display(); - - // Draw the obstacles - for (Obstacle obs : obstacles) { - obs.display(); - } - - - // If the generation hasn't ended yet - if (lifecycle < lifetime) { - population.live(obstacles); - if ((population.targetReached()) && (lifecycle < recordtime)) { - recordtime = lifecycle; - } - lifecycle++; - // Otherwise a new generation - } else { - lifecycle = 0; - population.calcFitness(); - population.naturalSelection(); - population.generate(); - } - - // Display some info - textAlign(RIGHT); - fill(0); - text("Generation #:" + population.getGenerations(),width-10,18); - text("Cycles left:" + ((lifetime-lifecycle)),width-10,36); - text("Record cycles: " + recordtime,width-10,54); - - if (newObstacle != null) { - rect(newObstacle.x,newObstacle.y,newObstacle.width,newObstacle.height); - } - -} - -void keyPressed() { - if (key == 'd') { - debug = !debug; - } -} - -void mousePressed() { - newObstacle = new Rectangle(mouseX,mouseY,0,0); -} - -void mouseDragged() { - newObstacle.width = mouseX-newObstacle.x; - newObstacle.height = mouseY-newObstacle.y; -} - -void mouseReleased() { - obstacles.add(new Obstacle(newObstacle)); - newObstacle = null; -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde deleted file mode 100644 index 2658d7bd5..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Obstacle.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class for an obstacle, just a simple rectangle that is drawn -// and can check if a creature touches it - -// Also using this class for starting point and target location - -class Obstacle { - - Rectangle r; - - Obstacle(int x, int y, int w, int h) { - r = new Rectangle(x,y,w,h); - } - - Obstacle(Rectangle r_) { - r = r_; - } - - void display() { - stroke(0); - fill(175); - rectMode(CORNER); - rect(r.x,r.y,r.width,r.height); - } - - boolean contains(PVector spot) { - if (r.contains((int)spot.x,(int)spot.y)) { - return true; - } else { - return false; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde deleted file mode 100644 index baa32703a..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Population.pde +++ /dev/null @@ -1,142 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList darwin; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - int order; // Keep track of the order of creature's finishing the maze - - - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - darwin = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(start.r.x+start.r.width/2, start.r.y+start.r.height/2); - population[i] = new Rocket(location, new DNA(dnasize)); - } - order = 1; // The first one to finish will be #1 - } - - void live (ArrayList o) { - // For every creature - - - - float record = 100000; - int closest = 0; - - for (int i = 0; i < population.length; i++) { - // If it finishes, mark it down as done! - if ((population[i].finished())) { - population[i].setFinish(order); - order++; - } - // Run it - population[i].run(o); - - if (population[i].recordDist < record) {// && !population[i].dead) { - record = population[i].recordDist; - closest = i; - } - } - - population[closest].highlight(); - // Drawing one example of the DNA - if (debug) { - population[closest].dna.debugDraw(); - } - } - - // Did anything finish? - boolean targetReached() { - for (int i = 0; i < population.length; i++) { - if (population[i].finished()) return true; - } - return false; - } - - // Calculate fitness for each creature - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].calcFitness(); - } - order = 1; // Hmmm, awkward place for this, we have to reset this for the next generation - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - darwin.clear(); - - // Calculate total fitness of whole population - float totalFitness = getTotalFitness(); - float avgFitness = totalFitness/population.length; - - // Calculate normalized fitness for each member of the population - // Based on normalized fitness, each member will get added to the mating pool a certain number of times a la roulette wheel - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - int count = 0; - for (int i = 0; i < population.length; i++) { - float fitness = population[i].getFitness(); - //if (fitness > avgFitness) { - count++; - float fitnessNormal = fitness / totalFitness; - int n = (int) (fitnessNormal * 50000); // Arbitrary multiplier, consider mapping fix - for (int j = 0; j < n; j++) { - darwin.add(population[i]); - } - //} - } - //println("Total: " + count + " " + population.length); - } - - // Making the next generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int m = int(random(darwin.size())); - int d = int(random(darwin.size())); - // Pick two parents - Rocket mom = darwin.get(m); - Rocket dad = darwin.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(start.r.x+start.r.width/2, start.r.y+start.r.height/2); - population[i] = new Rocket(location, child); - } - generations++; - } - - int getGenerations() { - return generations; - } - - //compute total fitness for the population - float getTotalFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].getFitness(); - } - return total; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde deleted file mode 100644 index dab8d959c..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/EvolveFlowField/Rocket.pde +++ /dev/null @@ -1,171 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - float r; - float recordDist; - - float fitness; - DNA dna; - - // Could make this part of DNA??) - float maxspeed = 6.0; - float maxforce = 1.0; - - boolean stopped; // Am I stuck? - boolean dead; // Did I hit an obstacle? - - int finish; // What was my finish? (first, second, etc. . . ) - - //constructor - Rocket(PVector l, DNA dna_) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 2; - dna = dna_; - stopped = false; - finish = 100000; // Some high number to begin with - recordDist = width; - } - - // FITNESS FUNCTION - // distance = distance from target - // finish = what order did i finish (first, second, etc. . .) - // f(distance,finish) = (1.0f / finish^1.5) * (1.0f / distance^6); - // a lower finish is rewarded (exponentially) and/or shorter distance to target (exponetially) - void calcFitness() { - float d = recordDist; - if (d < diam/2) { - d = 1.0; - } - // Reward finishing faster and getting closer - fitness = (1.0f / pow(finish,1.5)) * (1 / (pow(d,6))); - - //if (dead) fitness = 0; - } - - void setFinish(int f) { - finish = f; - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run(ArrayList o) { - if (!stopped) { - update(); - // If I hit an edge or an obstacle - if ((borders()) || (obstacles(o))) { - stopped = true; - dead = true; - } - } - // Draw me! - display(); - } - - // Did I hit an edge? - boolean borders() { - if ((location.x < 0) || (location.y < 0) || (location.x > width) || (location.y > height)) { - return true; - } else { - return false; - } - } - - // Did I make it to the target? - boolean finished() { - float d = dist(location.x,location.y,target.r.x,target.r.y); - if (d < recordDist) { - recordDist = d; - } - if (target.contains(location)) { - stopped = true; - return true; - } - return false; - } - - // Did I hit an obstacle? - boolean obstacles(ArrayList o) { - for (Obstacle obs : o) { - if (obs.contains(location)) { - return true; - } - } - return false; - } - - void update() { - if (!finished()) { - // Where are we? Our location will tell us what steering vector to look up in our DNA; - int x = (int) location.x/gridscale; - int y = (int) location.y/gridscale; - x = constrain(x,0,width/gridscale-1); // Make sure we are not off the edge - y = constrain(y,0,height/gridscale-1); // Make sure we are not off the edge - - // Get the steering vector out of our genes in the right spot - // A little Reynolds steering here - PVector desired = dna.genes[x+y*(width/gridscale)].get(); - desired.mult(maxspeed); - PVector steer = PVector.sub(desired,velocity); - acceleration.add(steer); - acceleration.limit(maxforce); - - velocity.add(acceleration); - velocity.limit(maxspeed); - location.add(velocity); - acceleration.mult(0); - } - } - - void display() { - //fill(0,150); - //stroke(0); - //ellipse(location.x,location.y,r,r); - float theta = velocity.heading() + PI/2; - fill(200,100); - stroke(0); - pushMatrix(); - translate(location.x,location.y); - rotate(theta); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - popMatrix(); - } - - void highlight() { - stroke(0); - line(location.x,location.y,target.r.x,target.r.y); - fill(255,0,0,100); - ellipse(location.x,location.y,16,16); - - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - boolean stopped() { - return stopped; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde deleted file mode 100644 index 8286ab0c0..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/DNA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void fitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - fitness = pow(2,score); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde deleted file mode 100644 index a50ef3319..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/GA_Shakespeare_fancyfitness.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The populationation -// # Create an empty populationation (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the populationation, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty populationation -// # Fill the new populationation by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new populationation. -// # Replace the old populationation with the new populationation -// -// # Rinse and repeat - - -PFont f; -String target; -int popmax; -float mutationRate; -Population population; - -void setup() { - size(600, 200); - f = createFont("Courier", 32, true); - target = "To be or not to be."; - popmax = 150; - mutationRate = 0.01; - - // Create a populationation with a target phrase, mutation rate, and populationation max - population = new Population(target, mutationRate, popmax); -} - -void draw() { - // Generate mating pool - population.naturalSelection(); - //Create next generation - population.generate(); - // Calculate fitness - population.calcFitness(); - displayInfo(); - - // If we found the target phrase, stop - if (population.finished()) { - println(millis()/1000.0); - noLoop(); - } -} - -void displayInfo() { - background(255); - // Display current status of populationation - String answer = population.getBest(); - textFont(f); - textAlign(LEFT); - fill(0); - - - textSize(16); - text("Best phrase:",20,30); - textSize(32); - text(answer, 20, 75); - - textSize(12); - text("total generations: " + population.getGenerations(), 20, 140); - text("average fitness: " + nf(population.getAverageFitness(), 0, 2), 20, 155); - text("total populationation: " + popmax, 20, 170); - text("mutation rate: " + int(mutationRate * 100) + "%", 20, 185); - - textSize(10); - text("All phrases:\n" + population.allPhrases(), 450, 10); -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde deleted file mode 100644 index 03630a706..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/GA_Shakespeare_fancyfitness/Population.pde +++ /dev/null @@ -1,127 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a population of virtual organisms -// In this case, each organism is just an instance of a DNA object - -class Population { - - float mutationRate; // Mutation rate - DNA[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - String target; // Target phrase - int generations; // Number of generations - boolean finished; // Are we finished evolving? - int perfectScore; - - Population(String p, float m, int num) { - target = p; - mutationRate = m; - population = new DNA[num]; - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - calcFitness(); - matingPool = new ArrayList(); - finished = false; - generations = 0; - - perfectScore = int(pow(2,target.length())); - } - - // Fill our fitness array with a value for every member of the population - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(target); - } - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - matingPool.clear(); - - float maxFitness = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > maxFitness) { - maxFitness = population[i].fitness; - } - } - - // Based on fitness, each member will get added to the mating pool a certain number of times - // a higher fitness = more entries to mating pool = more likely to be picked as a parent - // a lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - - float fitness = map(population[i].fitness,0,maxFitness,0,1); - int n = int(fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j < n; j++) { // and pick two random numbers - matingPool.add(population[i]); - } - } - } - - // Create a new generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int a = int(random(matingPool.size())); - int b = int(random(matingPool.size())); - DNA partnerA = matingPool.get(a); - DNA partnerB = matingPool.get(b); - DNA child = partnerA.crossover(partnerB); - child.mutate(mutationRate); - population[i] = child; - } - generations++; - } - - - // Compute the current "most fit" member of the population - String getBest() { - float worldrecord = 0.0f; - int index = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > worldrecord) { - index = i; - worldrecord = population[i].fitness; - } - } - - if (worldrecord == perfectScore ) finished = true; - return population[index].getPhrase(); - } - - boolean finished() { - return finished; - } - - int getGenerations() { - return generations; - } - - // Compute average fitness for the population - float getAverageFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].fitness; - } - return total / (population.length); - } - - String allPhrases() { - String everything = ""; - - int displayLimit = min(population.length,50); - - - for (int i = 0; i < displayLimit; i++) { - everything += population[i].getPhrase() + "\n"; - } - return everything; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde deleted file mode 100644 index d3ceb1ce3..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/DNA.pde +++ /dev/null @@ -1,72 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void fitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - - - fitness = (float)score / (float)target.length(); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde deleted file mode 100644 index d4e72a1fc..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/NOC_9_01_GA_Shakespeare.pde +++ /dev/null @@ -1,90 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The Population -// # Create an empty population (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the population, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty population -// # Fill the new population by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new population. -// # Replace the old population with the new population -// -// # Rinse and repeat - - -PFont f; -String target; -int popmax; -float mutationRate; -Population population; - -void setup() { - size(640, 360); - f = createFont("Courier", 32, true); - target = "To be or not to be."; - popmax = 150; - mutationRate = 0.01; - - // Create a populationation with a target phrase, mutation rate, and populationation max - population = new Population(target, mutationRate, popmax); -} - -void draw() { - // Generate mating pool - population.naturalSelection(); - //Create next generation - population.generate(); - // Calculate fitness - population.calcFitness(); - displayInfo(); - - // If we found the target phrase, stop - if (population.finished()) { - println(millis()/1000.0); - noLoop(); - } -} - -void displayInfo() { - background(255); - // Display current status of populationation - String answer = population.getBest(); - textFont(f); - textAlign(LEFT); - fill(0); - - - textSize(24); - text("Best phrase:",20,30); - textSize(40); - text(answer, 20, 100); - - textSize(18); - text("total generations: " + population.getGenerations(), 20, 160); - text("average fitness: " + nf(population.getAverageFitness(), 0, 2), 20, 180); - text("total population: " + popmax, 20, 200); - text("mutation rate: " + int(mutationRate * 100) + "%", 20, 220); - - textSize(10); - text("All phrases:\n" + population.allPhrases(), 500, 10); -} - - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde deleted file mode 100644 index d48ac6c3f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare/Population.pde +++ /dev/null @@ -1,127 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a population of virtual organisms -// In this case, each organism is just an instance of a DNA object - -class Population { - - float mutationRate; // Mutation rate - DNA[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - String target; // Target phrase - int generations; // Number of generations - boolean finished; // Are we finished evolving? - int perfectScore; - - Population(String p, float m, int num) { - target = p; - mutationRate = m; - population = new DNA[num]; - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - calcFitness(); - matingPool = new ArrayList(); - finished = false; - generations = 0; - - perfectScore = 1; - } - - // Fill our fitness array with a value for every member of the population - void calcFitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(target); - } - } - - // Generate a mating pool - void naturalSelection() { - // Clear the ArrayList - matingPool.clear(); - - float maxFitness = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > maxFitness) { - maxFitness = population[i].fitness; - } - } - - // Based on fitness, each member will get added to the mating pool a certain number of times - // a higher fitness = more entries to mating pool = more likely to be picked as a parent - // a lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - - float fitness = map(population[i].fitness,0,maxFitness,0,1); - int n = int(fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j < n; j++) { // and pick two random numbers - matingPool.add(population[i]); - } - } - } - - // Create a new generation - void generate() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - int a = int(random(matingPool.size())); - int b = int(random(matingPool.size())); - DNA partnerA = matingPool.get(a); - DNA partnerB = matingPool.get(b); - DNA child = partnerA.crossover(partnerB); - child.mutate(mutationRate); - population[i] = child; - } - generations++; - } - - - // Compute the current "most fit" member of the population - String getBest() { - float worldrecord = 0.0; - int index = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].fitness > worldrecord) { - index = i; - worldrecord = population[i].fitness; - } - } - - if (worldrecord == perfectScore ) finished = true; - return population[index].getPhrase(); - } - - boolean finished() { - return finished; - } - - int getGenerations() { - return generations; - } - - // Compute average fitness for the population - float getAverageFitness() { - float total = 0; - for (int i = 0; i < population.length; i++) { - total += population[i].fitness; - } - return total / (population.length); - } - - String allPhrases() { - String everything = ""; - - int displayLimit = min(population.length,50); - - - for (int i = 0; i < displayLimit; i++) { - everything += population[i].getPhrase() + "\n"; - } - return everything; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde deleted file mode 100644 index e4ce06c31..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/DNA.pde +++ /dev/null @@ -1,70 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// A class to describe a psuedo-DNA, i.e. genotype -// Here, a virtual organism's DNA is an array of character. -// Functionality: -// -- convert DNA into a string -// -- calculate DNA's "fitness" -// -- mate DNA with another set of DNA -// -- mutate DNA - - -class DNA { - - // The genetic sequence - char[] genes; - - float fitness; - - // Constructor (makes a random DNA) - DNA(int num) { - genes = new char[num]; - for (int i = 0; i < genes.length; i++) { - genes[i] = (char) random(32,128); // Pick from range of chars - } - } - - // Converts character array to a String - String getPhrase() { - return new String(genes); - } - - // Fitness function (returns floating point % of "correct" characters) - void calcFitness (String target) { - int score = 0; - for (int i = 0; i < genes.length; i++) { - if (genes[i] == target.charAt(i)) { - score++; - } - } - fitness = (float)score / (float)target.length(); - } - - // Crossover - DNA crossover(DNA partner) { - // A new child - DNA child = new DNA(genes.length); - - int midpoint = int(random(genes.length)); // Pick a midpoint - - // Half from one, half from the other - for (int i = 0; i < genes.length; i++) { - if (i > midpoint) child.genes[i] = genes[i]; - else child.genes[i] = partner.genes[i]; - } - return child; - } - - // Based on a mutation probability, picks a new random character - void mutate(float mutationRate) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < mutationRate) { - genes[i] = (char) random(32,128); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde deleted file mode 100644 index a46d90a23..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_01_GA_Shakespeare_simplified/NOC_9_01_GA_Shakespeare_simplified.pde +++ /dev/null @@ -1,89 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Genetic Algorithm, Evolving Shakespeare - -// Demonstration of using a genetic algorithm to perform a search - -// setup() -// # Step 1: The Population -// # Create an empty population (an array or ArrayList) -// # Fill it with DNA encoded objects (pick random values to start) - -// draw() -// # Step 1: Selection -// # Create an empty mating pool (an empty ArrayList) -// # For every member of the population, evaluate its fitness based on some criteria / function, -// and add it to the mating pool in a manner consistant with its fitness, i.e. the more fit it -// is the more times it appears in the mating pool, in order to be more likely picked for reproduction. - -// # Step 2: Reproduction Create a new empty population -// # Fill the new population by executing the following steps: -// 1. Pick two "parent" objects from the mating pool. -// 2. Crossover -- create a "child" object by mating these two parents. -// 3. Mutation -- mutate the child's DNA based on a given probability. -// 4. Add the child object to the new population. -// # Replace the old population with the new population -// -// # Rinse and repeat - - -float mutationRate = 0.01; // Mutation rate -int totalPopulation = 150; // Total Population - -DNA[] population; // Array to hold the current population -ArrayList matingPool; // ArrayList which we will use for our "mating pool" -String target; // Target phrase - -PFont f; - -void setup() { - size(800, 200); - target = "to be or not to be"; - - population = new DNA[totalPopulation]; - - for (int i = 0; i < population.length; i++) { - population[i] = new DNA(target.length()); - } - - f = createFont("Courier",12,true); -} - -void draw() { - for (int i = 0; i < population.length; i++) { - population[i].calcFitness(target); - } - - ArrayList matingPool = new ArrayList(); // ArrayList which we will use for our "mating pool" - - for (int i = 0; i < population.length; i++) { - int nnnn = int(population[i].fitness * 100); // Arbitrary multiplier, we can also use monte carlo method - for (int j = 0; j crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde deleted file mode 100644 index 3ae68e806..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/NOC_9_02_SmartRockets_superbasic.pde +++ /dev/null @@ -1,74 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smart Rockets w/ Genetic Algorithms - -// Each Rocket's DNA is an array of PVectors -// Each PVector acts as a force for each frame of animation -// Imagine an booster on the end of the rocket that can point in any direction -// and fire at any strength every frame - -// The Rocket's fitness is a function of how close it gets to the target as well as how fast it gets there - -// This example is inspired by Jer Thorp's Smart Rockets -// http://www.blprnt.com/smartrockets/ - -int lifetime; // How long should each generation live - -Population population; // Population - -int lifeCounter; // Timer for cycle of generation - -PVector target; // Target location - -void setup() { - size(640, 360); - // The number of cycles we will allow a generation to live - lifetime = height; - - // Initialize variables - lifeCounter = 0; - - target = new PVector(width/2, 24); - - // Create a population with a mutation rate, and population max - float mutationRate = 0.01; - population = new Population(mutationRate, 50); - -} - -void draw() { - background(255); - - // Draw the start and target locations - fill(0); - ellipse(target.x,target.y,24,24); - - - // If the generation hasn't ended yet - if (lifeCounter < lifetime) { - population.live(); - lifeCounter++; - // Otherwise a new generation - } - else { - lifeCounter = 0; - population.fitness(); - population.selection(); - population.reproduction(); - } - - // Display some info - fill(0); - text("Generation #: " + population.getGenerations(), 10, 18); - text("Cycles left: " + (lifetime-lifeCounter), 10, 36); -} - -// Move the target if the mouse is pressed -// System will adapt to new target -void mousePressed() { - target.x = mouseX; - target.y = mouseY; -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde deleted file mode 100644 index 128d38636..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Population.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - matingPool = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, new DNA()); - } - } - - void live () { - // Run every rocket - for (int i = 0; i < population.length; i++) { - population[i].run(); - } - } - - // Calculate fitness for each creature - void fitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(),0,maxFitness,0,1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Rocket mom = matingPool.get(m); - Rocket dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, child); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if(population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde deleted file mode 100644 index 2456856e4..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_02_SmartRockets_superbasic/Rocket.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r; - - // Fitness and DNA - float fitness; - DNA dna; - // To count which force we're on in the genes - int geneCounter = 0; - - boolean hitTarget = false; // Did I reach the target - - //constructor - Rocket(PVector l, DNA dna_) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 4; - dna = dna_; - } - - // Fitness function - // fitness = one divided by distance squared - void fitness() { - float d = dist(location.x, location.y, target.x, target.y); - fitness = pow(1/d, 2); - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run() { - checkTarget(); // Check to see if we've reached the target - if (!hitTarget) { - applyForce(dna.genes[geneCounter]); - geneCounter = (geneCounter + 1) % dna.genes.length; - update(); - } - display(); - } - - // Did I make it to the target? - void checkTarget() { - float d = dist(location.x, location.y, target.x, target.y); - if (d < 12) { - hitTarget = true; - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - float theta = velocity.heading2D() + PI/2; - fill(200, 100); - stroke(0); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - - // Thrusters - rectMode(CENTER); - fill(0); - rect(-r/2, r*2, r/2, r); - rect(r/2, r*2, r/2, r); - - // Rocket body - fill(175); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - - popMatrix(); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde deleted file mode 100644 index b4eefe1cf..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/DNA.pde +++ /dev/null @@ -1,68 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// DNA is an array of vectors - -class DNA { - - // The genetic sequence - PVector[] genes; - - // The maximum strength of the forces - float maxforce = 0.1; - - // Constructor (makes a DNA of random PVectors) - DNA() { - genes = new PVector[lifetime]; - for (int i = 0; i < genes.length; i++) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - } - - // Let's give each Rocket an extra boost of strength for its first frame - genes[0].normalize(); - } - - // Constructor #2, creates the instance based on an existing array - DNA(PVector[] newgenes) { - // We could make a copy if necessary - // genes = (PVector []) newgenes.clone(); - genes = newgenes; - } - - // CROSSOVER - // Creates new DNA sequence from two (this & and a partner) - DNA crossover(DNA partner) { - PVector[] child = new PVector[genes.length]; - // Pick a midpoint - int crossover = int(random(genes.length)); - // Take "half" from one and "half" from the other - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random Vector - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - float angle = random(TWO_PI); - genes[i] = new PVector(cos(angle), sin(angle)); - genes[i].mult(random(0, maxforce)); - // float angle = random(-0.1,0.1); - // genes[i].rotate(angle); - // float factor = random(0.9,1.1); - // genes[i].mult(factor); - if (i ==0) genes[i].normalize(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde deleted file mode 100644 index 2ac224f66..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/NOC_9_03_SmartRockets.pde +++ /dev/null @@ -1,94 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Smart Rockets w/ Genetic Algorithms - -// Each Rocket's DNA is an array of PVectors -// Each PVector acts as a force for each frame of animation -// Imagine an booster on the end of the rocket that can point in any direction -// and fire at any strength every frame - -// The Rocket's fitness is a function of how close it gets to the target as well as how fast it gets there - -// This example is inspired by Jer Thorp's Smart Rockets -// http://www.blprnt.com/smartrockets/ - -int lifetime; // How long should each generation live - -Population population; // Population - -int lifecycle; // Timer for cycle of generation -int recordtime; // Fastest time to target - -Obstacle target; // Target location - -//int diam = 24; // Size of target - -ArrayList obstacles; //an array list to keep track of all the obstacles! - -void setup() { - size(640, 360); - // The number of cycles we will allow a generation to live - lifetime = 300; - - // Initialize variables - lifecycle = 0; - recordtime = lifetime; - - target = new Obstacle(width/2-12, 24, 24, 24); - - // Create a population with a mutation rate, and population max - float mutationRate = 0.01; - population = new Population(mutationRate, 50); - - // Create the obstacle course - obstacles = new ArrayList(); - obstacles.add(new Obstacle(width/2-100, height/2, 200, 10)); -} - -void draw() { - background(255); - - // Draw the start and target locations - target.display(); - - - // If the generation hasn't ended yet - if (lifecycle < lifetime) { - population.live(obstacles); - if ((population.targetReached()) && (lifecycle < recordtime)) { - recordtime = lifecycle; - } - lifecycle++; - // Otherwise a new generation - } - else { - lifecycle = 0; - population.fitness(); - population.selection(); - population.reproduction(); - } - - // Draw the obstacles - for (Obstacle obs : obstacles) { - obs.display(); - } - - // Display some info - fill(0); - text("Generation #: " + population.getGenerations(), 10, 18); - text("Cycles left: " + (lifetime-lifecycle), 10, 36); - text("Record cycles: " + recordtime, 10, 54); - - -} - -// Move the target if the mouse is pressed -// System will adapt to new target -void mousePressed() { - target.location.x = mouseX; - target.location.y = mouseY; - recordtime = lifetime; -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde deleted file mode 100644 index e7d3d249f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Obstacle.pde +++ /dev/null @@ -1,40 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class for an obstacle, just a simple rectangle that is drawn -// and can check if a Rocket touches it - -// Also using this class for target location - - -class Obstacle { - - PVector location; - float w,h; - - Obstacle(float x, float y, float w_, float h_) { - location = new PVector(x,y); - w = w_; - h = h_; - } - - void display() { - stroke(0); - fill(175); - strokeWeight(2); - rectMode(CORNER); - rect(location.x,location.y,w,h); - } - - boolean contains(PVector spot) { - if (spot.x > location.x && spot.x < location.x + w && spot.y > location.y && spot.y < location.y + h) { - return true; - } else { - return false; - } - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde deleted file mode 100644 index 432bf3b14..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Population.pde +++ /dev/null @@ -1,113 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Pathfinding w/ Genetic Algorithms - -// A class to describe a population of "creatures" - -class Population { - - float mutationRate; // Mutation rate - Rocket[] population; // Array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Initialize the population - Population(float m, int num) { - mutationRate = m; - population = new Rocket[num]; - matingPool = new ArrayList(); - generations = 0; - //make a new set of creatures - for (int i = 0; i < population.length; i++) { - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, new DNA(),population.length); - } - } - - void live (ArrayList os) { - // For every creature - for (int i = 0; i < population.length; i++) { - // If it finishes, mark it down as done! - population[i].checkTarget(); - population[i].run(os); - } - } - - // Did anything finish? - boolean targetReached() { - for (int i = 0; i < population.length; i++) { - if (population[i].hitTarget) return true; - } - return false; - } - - // Calculate fitness for each creature - void fitness() { - for (int i = 0; i < population.length; i++) { - population[i].fitness(); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(),0,maxFitness,0,1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Rocket mom = matingPool.get(m); - Rocket dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - PVector location = new PVector(width/2,height+20); - population[i] = new Rocket(location, child,population.length); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if(population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde deleted file mode 100644 index 5ce1b313b..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_03_SmartRockets/Rocket.pde +++ /dev/null @@ -1,148 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Rocket class -- this is just like our Boid / Particle class -// the only difference is that it has DNA & fitness - -class Rocket { - - // All of our physics stuff - PVector location; - PVector velocity; - PVector acceleration; - - // Size - float r; - - // How close did it get to the target - float recordDist; - - // Fitness and DNA - float fitness; - DNA dna; - // To count which force we're on in the genes - int geneCounter = 0; - - boolean hitObstacle = false; // Am I stuck on an obstacle? - boolean hitTarget = false; // Did I reach the target - int finishTime; // What was my finish time? - - //constructor - Rocket(PVector l, DNA dna_, int totalRockets) { - acceleration = new PVector(); - velocity = new PVector(); - location = l.get(); - r = 4; - dna = dna_; - finishTime = 0; // We're going to count how long it takes to reach target - recordDist = 10000; // Some high number that will be beat instantly - } - - // FITNESS FUNCTION - // distance = distance from target - // finish = what order did i finish (first, second, etc. . .) - // f(distance,finish) = (1.0f / finish^1.5) * (1.0f / distance^6); - // a lower finish is rewarded (exponentially) and/or shorter distance to target (exponetially) - void fitness() { - if (recordDist < 1) recordDist = 1; - - // Reward finishing faster and getting close - fitness = (1/(finishTime*recordDist)); - - // Make the function exponential - fitness = pow(fitness, 4); - - if (hitObstacle) fitness *= 0.1; // lose 90% of fitness hitting an obstacle - if (hitTarget) fitness *= 2; // twice the fitness for finishing! - } - - // Run in relation to all the obstacles - // If I'm stuck, don't bother updating or checking for intersection - void run(ArrayList os) { - if (!hitObstacle && !hitTarget) { - applyForce(dna.genes[geneCounter]); - geneCounter = (geneCounter + 1) % dna.genes.length; - update(); - // If I hit an edge or an obstacle - obstacles(os); - } - // Draw me! - if (!hitObstacle) { - display(); - } - } - - // Did I make it to the target? - void checkTarget() { - float d = dist(location.x, location.y, target.location.x, target.location.y); - if (d < recordDist) recordDist = d; - - if (target.contains(location) && !hitTarget) { - hitTarget = true; - } - else if (!hitTarget) { - finishTime++; - } - } - - // Did I hit an obstacle? - void obstacles(ArrayList os) { - for (Obstacle obs : os) { - if (obs.contains(location)) { - hitObstacle = true; - } - } - } - - void applyForce(PVector f) { - acceleration.add(f); - } - - - void update() { - velocity.add(acceleration); - location.add(velocity); - acceleration.mult(0); - } - - void display() { - //background(255,0,0); - float theta = velocity.heading2D() + PI/2; - fill(200, 100); - stroke(0); - strokeWeight(1); - pushMatrix(); - translate(location.x, location.y); - rotate(theta); - - // Thrusters - rectMode(CENTER); - fill(0); - rect(-r/2, r*2, r/2, r); - rect(r/2, r*2, r/2, r); - - // Rocket body - fill(175); - beginShape(TRIANGLES); - vertex(0, -r*2); - vertex(-r, r*2); - vertex(r, r*2); - endShape(); - - popMatrix(); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - boolean stopped() { - return hitObstacle; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde deleted file mode 100644 index eb35675ce..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Button.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -//import java.awt.Rectangle; - -class Button { - Rectangle r; // Button's rectangle - String txt; // Button's text - boolean clickedOn; // Did i click on it? - boolean rolloverOn; // Did i rollover it? - - Button(int x, int y, int w, int h, String s) { - r = new Rectangle(x,y,w,h); - txt = s; - } - - void display() { - // Draw rectangle and text based on whether rollover or clicked - rectMode(CORNER); - stroke(0); noFill(); - if (rolloverOn) fill(0.5); - if (clickedOn) fill(0); - rect(r.x,r.y,r.width,r.height); - float b = 0.0; - if (clickedOn) b = 1; - else if (rolloverOn) b = 0.2; - else b = 0; - fill(b); - textAlign(LEFT); - text(txt,r.x+10,r.y+14); - - } - - - // Methods to check rollover, clicked, or released (must be called from appropriate - // Places in draw, mousePressed, mouseReleased - boolean rollover(int mx, int my) { - if (r.contains(mx,my)) rolloverOn = true; - else rolloverOn = false; - return rolloverOn; - } - - boolean clicked(int mx, int my) { - if (r.contains(mx,my)) clickedOn = true; - return clickedOn; - } - - void released() { - clickedOn = false; - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde deleted file mode 100644 index 8825979b1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/DNA.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -class DNA { - - // The genetic sequence - float[] genes; - int len = 20; // Arbitrary length - - //Constructor (makes a random DNA) - DNA() { - // DNA is random floating point values between 0 and 1 (!!) - genes = new float[len]; - for (int i = 0; i < genes.length; i++) { - genes[i] = random(0,1); - } - } - - DNA(float[] newgenes) { - genes = newgenes; - } - - - // Crossover - // Creates new DNA sequence from two (this & - DNA crossover(DNA partner) { - float[] child = new float[genes.length]; - int crossover = int(random(genes.length)); - for (int i = 0; i < genes.length; i++) { - if (i > crossover) child[i] = genes[i]; - else child[i] = partner.genes[i]; - } - DNA newgenes = new DNA(child); - return newgenes; - } - - // Based on a mutation probability, picks a new random character in array spots - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = random(0,1); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde deleted file mode 100644 index 4a2992b6f..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Face.pde +++ /dev/null @@ -1,103 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -// The class for our "face", contains DNA sequence, fitness value, position on screen - -// Fitness Function f(t) = t (where t is "time" mouse rolls over face) - -class Face { - - DNA dna; // Face's DNA - float fitness; // How good is this face? - float x, y; // Position on screen - int wh = 70; // Size of square enclosing face - boolean rolloverOn; // Are we rolling over this face? - - Rectangle r; - - // Create a new face - Face(DNA dna_, float x_, float y_) { - dna = dna_; - x = x_; - y = y_; - fitness = 1; - // Using java.awt.Rectangle (see: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/Rectangle.html) - r = new Rectangle(int(x-wh/2), int(y-wh/2), int(wh), int(wh)); - } - - // Display the face - void display() { - // We are using the face's DNA to pick properties for this face - // such as: head size, color, eye position, etc. - // Now, since every gene is a floating point between 0 and 1, we map the values - float r = map(dna.genes[0],0,1,0,70); - color c = color(dna.genes[1],dna.genes[2],dna.genes[3]); - float eye_y = map(dna.genes[4],0,1,0,5); - float eye_x = map(dna.genes[5],0,1,0,10); - float eye_size = map(dna.genes[5],0,1,0,10); - color eyecolor = color(dna.genes[4],dna.genes[5],dna.genes[6]); - color mouthColor = color(dna.genes[7],dna.genes[8],dna.genes[9]); - float mouth_y = map(dna.genes[5],0,1,0,25); - float mouth_x = map(dna.genes[5],0,1,-25,25); - float mouthw = map(dna.genes[5],0,1,0,50); - float mouthh = map(dna.genes[5],0,1,0,10); - - // Once we calculate all the above properties, we use those variables to draw rects, ellipses, etc. - pushMatrix(); - translate(x, y); - noStroke(); - - // Draw the head - fill(c); - ellipseMode(CENTER); - ellipse(0, 0, r, r); - - // Draw the eyes - fill(eyecolor); - rectMode(CENTER); - rect(-eye_x, -eye_y, eye_size, eye_size); - rect( eye_x, -eye_y, eye_size, eye_size); - - // Draw the mouth - fill(mouthColor); - rectMode(CENTER); - rect(mouth_x, mouth_y, mouthw, mouthh); - - // Draw the bounding box - stroke(0.25); - if (rolloverOn) fill(0, 0.25); - else noFill(); - rectMode(CENTER); - rect(0, 0, wh, wh); - popMatrix(); - - // Display fitness value - textAlign(CENTER); - if (rolloverOn) fill(0); - else fill(0.25); - text(int(fitness), x, y+55); - } - - float getFitness() { - return fitness; - } - - DNA getDNA() { - return dna; - } - - // Increment fitness if mouse is rolling over face - void rollover(int mx, int my) { - if (r.contains(mx, my)) { - rolloverOn = true; - fitness += 0.25; - } else { - rolloverOn = false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde deleted file mode 100644 index e85545805..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/NOC_9_04_Faces_interactiveselection.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -Population population; -Button button; - -void setup() { - size(800,200); - colorMode(RGB,1.0); - int popmax = 10; - float mutationRate = 0.05; // A pretty high mutation rate here, our population is rather small we need to enforce variety - // Create a population with a target phrase, mutation rate, and population max - population = new Population(mutationRate,popmax); - // A simple button class - button = new Button(15,150,160,20, "evolve new generation"); -} - -void draw() { - background(1.0); - // Display the faces - population.display(); - population.rollover(mouseX,mouseY); - // Display some text - textAlign(LEFT); - fill(0); - text("Generation #:" + population.getGenerations(),15,190); - - // Display the button - button.display(); - button.rollover(mouseX,mouseY); - -} - -// If the button is clicked, evolve next generation -void mousePressed() { - if (button.clicked(mouseX,mouseY)) { - population.selection(); - population.reproduction(); - } -} - -void mouseReleased() { - button.released(); -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde deleted file mode 100644 index 625c6f9d1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Population.pde +++ /dev/null @@ -1,102 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Interactive Selection -// http://www.genarts.com/karl/papers/siggraph91.html - -// A class to describe a population of faces -// this hasn't changed very much from example to example - -class Population { - - float mutationRate; // Mutation rate - Face[] population; // array to hold the current population - ArrayList matingPool; // ArrayList which we will use for our "mating pool" - int generations; // Number of generations - - // Create the population - Population(float m, int num) { - mutationRate = m; - population = new Face[num]; - matingPool = new ArrayList(); - generations = 0; - for (int i = 0; i < population.length; i++) { - population[i] = new Face(new DNA(), 50+i*75, 60); - } - } - - // Display all faces - void display() { - for (int i = 0; i < population.length; i++) { - population[i].display(); - } - } - - // Are we rolling over any of the faces? - void rollover(int mx, int my) { - for (int i = 0; i < population.length; i++) { - population[i].rollover(mx, my); - } - } - - // Generate a mating pool - void selection() { - // Clear the ArrayList - matingPool.clear(); - - // Calculate total fitness of whole population - float maxFitness = getMaxFitness(); - - // Calculate fitness for each member of the population (scaled to value between 0 and 1) - // Based on fitness, each member will get added to the mating pool a certain number of times - // A higher fitness = more entries to mating pool = more likely to be picked as a parent - // A lower fitness = fewer entries to mating pool = less likely to be picked as a parent - for (int i = 0; i < population.length; i++) { - float fitnessNormal = map(population[i].getFitness(), 0, maxFitness, 0, 1); - int n = (int) (fitnessNormal * 100); // Arbitrary multiplier - for (int j = 0; j < n; j++) { - matingPool.add(population[i]); - } - } - } - - // Making the next generation - void reproduction() { - // Refill the population with children from the mating pool - for (int i = 0; i < population.length; i++) { - // Sping the wheel of fortune to pick two parents - int m = int(random(matingPool.size())); - int d = int(random(matingPool.size())); - // Pick two parents - Face mom = matingPool.get(m); - Face dad = matingPool.get(d); - // Get their genes - DNA momgenes = mom.getDNA(); - DNA dadgenes = dad.getDNA(); - // Mate their genes - DNA child = momgenes.crossover(dadgenes); - // Mutate their genes - child.mutate(mutationRate); - // Fill the new population with the new child - population[i] = new Face(child, 50+i*75, 60); - } - generations++; - } - - int getGenerations() { - return generations; - } - - // Find highest fintess for the population - float getMaxFitness() { - float record = 0; - for (int i = 0; i < population.length; i++) { - if (population[i].getFitness() > record) { - record = population[i].getFitness(); - } - } - return record; - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde deleted file mode 100644 index ed6d6d70c..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_04_Faces_interactiveselection/Rectangle.pde +++ /dev/null @@ -1,25 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Re-implementing java.awt.Rectangle -// so JS mode works - -class Rectangle { - int x; - int y; - int width; - int height; - - Rectangle(int x_, int y_, int w, int h) { - x = x_; - y = y_; - width = w; - height = h; - } - - boolean contains(int px, int py) { - return (px > x && px < x + width && py > y && py < y + height); - } - -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde deleted file mode 100644 index 7859b6630..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Bloop.pde +++ /dev/null @@ -1,108 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// Creature class - -class Bloop { - PVector location; // Location - DNA dna; // DNA - float health; // Life timer - float xoff; // For perlin noise - float yoff; - // DNA will determine size and maxspeed - float r; - float maxspeed; - - // Create a "bloop" creature - Bloop(PVector l, DNA dna_) { - location = l.get(); - health = 200; - xoff = random(1000); - yoff = random(1000); - dna = dna_; - // Gene 0 determines maxspeed and r - // The bigger the bloop, the slower it is - maxspeed = map(dna.genes[0], 0, 1, 15, 0); - r = map(dna.genes[0], 0, 1, 0, 50); - } - - void run() { - update(); - borders(); - display(); - } - - // A bloop can find food and eat it - void eat(Food f) { - ArrayList food = f.getFood(); - // Are we touching any food objects? - for (int i = food.size()-1; i >= 0; i--) { - PVector foodLocation = food.get(i); - float d = PVector.dist(location, foodLocation); - // If we are, juice up our strength! - if (d < r/2) { - health += 100; - food.remove(i); - } - } - } - - // At any moment there is a teeny, tiny chance a bloop will reproduce - Bloop reproduce() { - // asexual reproduction - if (random(1) < 0.0005) { - // Child is exact copy of single parent - DNA childDNA = dna.copy(); - // Child DNA can mutate - childDNA.mutate(0.01); - return new Bloop(location, childDNA); - } - else { - return null; - } - } - - // Method to update location - void update() { - // Simple movement based on perlin noise - float vx = map(noise(xoff),0,1,-maxspeed,maxspeed); - float vy = map(noise(yoff),0,1,-maxspeed,maxspeed); - PVector velocity = new PVector(vx,vy); - xoff += 0.01; - yoff += 0.01; - - location.add(velocity); - // Death always looming - health -= 0.2; - } - - // Wraparound - void borders() { - if (location.x < -r) location.x = width+r; - if (location.y < -r) location.y = height+r; - if (location.x > width+r) location.x = -r; - if (location.y > height+r) location.y = -r; - } - - // Method to display - void display() { - ellipseMode(CENTER); - stroke(0,health); - fill(0, health); - ellipse(location.x, location.y, r, r); - } - - // Death - boolean dead() { - if (health < 0.0) { - return true; - } - else { - return false; - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde deleted file mode 100644 index 807e776a7..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/DNA.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Evolution EcoSystem -// Daniel Shiffman - -// Class to describe DNA -// Has more features for two parent mating (not used in this example) - -class DNA { - - // The genetic sequence - float[] genes; - - // Constructor (makes a random DNA) - DNA() { - // DNA is random floating point values between 0 and 1 (!!) - genes = new float[1]; - for (int i = 0; i < genes.length; i++) { - genes[i] = random(0,1); - } - } - - DNA(float[] newgenes) { - genes = newgenes; - } - - DNA copy() { - float[] newgenes = new float[genes.length]; - //arraycopy(genes,newgenes); - // JS mode not supporting arraycopy - for (int i = 0; i < newgenes.length; i++) { - newgenes[i] = genes[i]; - } - - return new DNA(newgenes); - } - - // Based on a mutation probability, picks a new random character in array spots - void mutate(float m) { - for (int i = 0; i < genes.length; i++) { - if (random(1) < m) { - genes[i] = random(0,1); - } - } - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde deleted file mode 100644 index ea0cb59b1..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/Food.pde +++ /dev/null @@ -1,44 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// A collection of food in the world - -class Food { - ArrayList food; - - Food(int num) { - // Start with some food - food = new ArrayList(); - for (int i = 0; i < num; i++) { - food.add(new PVector(random(width),random(height))); - } - } - - // Add some food at a location - void add(PVector l) { - food.add(l.get()); - } - - // Display the food - void run() { - for (PVector f : food) { - rectMode(CENTER); - stroke(0); - fill(175); - rect(f.x,f.y,8,8); - } - - // There's a small chance food will appear randomly - if (random(1) < 0.001) { - food.add(new PVector(random(width),random(height))); - } - } - - // Return the list of food - ArrayList getFood() { - return food; - } -} diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde deleted file mode 100644 index f273cfd68..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/NOC_9_05_EvolutionEcosystem.pde +++ /dev/null @@ -1,37 +0,0 @@ -// Evolution EcoSystem -// Daniel Shiffman -// The Nature of Code - -// A World of creatures that eat food -// The more they eat, the longer they survive -// The longer they survive, the more likely they are to reproduce -// The bigger they are, the easier it is to land on food -// The bigger they are, the slower they are to find food -// When the creatures die, food is left behind - - -World world; - -void setup() { - size(640, 360); - // World starts with 20 creatures - // and 20 pieces of food - world = new World(20); - smooth(); -} - -void draw() { - background(255); - world.run(); -} - -// We can add a creature manually if we so desire -void mousePressed() { - world.born(mouseX,mouseY); -} - -void mouseDragged() { - world.born(mouseX,mouseY); -} - - diff --git a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde b/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde deleted file mode 100644 index c0789604d..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/NOC_9_05_EvolutionEcosystem/World.pde +++ /dev/null @@ -1,56 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Evolution EcoSystem - -// The World we live in -// Has bloops and food - -class World { - - ArrayList bloops; // An arraylist for all the creatures - Food food; - - // Constructor - World(int num) { - // Start with initial food and creatures - food = new Food(num); - bloops = new ArrayList(); // Initialize the arraylist - for (int i = 0; i < num; i++) { - PVector l = new PVector(random(width),random(height)); - DNA dna = new DNA(); - bloops.add(new Bloop(l,dna)); - } - } - - // Make a new creature - void born(float x, float y) { - PVector l = new PVector(x,y); - DNA dna = new DNA(); - bloops.add(new Bloop(l,dna)); - } - - // Run the world - void run() { - // Deal with food - food.run(); - - // Cycle through the ArrayList backwards b/c we are deleting - for (int i = bloops.size()-1; i >= 0; i--) { - // All bloops run and eat - Bloop b = bloops.get(i); - b.run(); - b.eat(food); - // If it's dead, kill it and make food - if (b.dead()) { - bloops.remove(i); - food.add(b.location); - } - // Perhaps this bloop would like to make a baby? - Bloop child = b.reproduce(); - if (child != null) bloops.add(child); - } - } -} - diff --git a/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde b/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde deleted file mode 100644 index d502a7151..000000000 --- a/java/examples/Books/Nature of Code/chp9_ga/bruteforce/bruteforce.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int now = millis(); - -int passedTime = millis() - now; -int count = 0; -while (passedTime < 1000) { - for (int i = 0; i < 33; i++) { - float r = random(27); - } - count++; - passedTime = millis() - now; -} -println(count); - - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde deleted file mode 100644 index aae2bf669..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Exercise_I_10_NoiseLandscape.pde +++ /dev/null @@ -1,32 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// Landscape with height values according to Perlin noise - -Landscape land; -float theta = 0.0; - -void setup() { - - size(800,200,P3D); - - // Create a landscape object - land = new Landscape(20,800,400); -} - -void draw() { - - // Ok, visualize the landscape space - background(255); - pushMatrix(); - translate(width/2,height/2+20,-160); - rotateX(PI/3); - rotateZ(theta); - land.render(); - popMatrix(); - - land.calculate(); - - theta += 0.0025; -} diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde deleted file mode 100644 index 661e5502d..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_10_NoiseLandscape/Landscape.pde +++ /dev/null @@ -1,67 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// "Landscape" example - -class Landscape { - - int scl; // size of each cell - int w, h; // width and height of thingie - int rows, cols; // number of rows and columns - float zoff = 0.0; // perlin noise argument - float[][] z; // using an array to store all the height values - - Landscape(int scl_, int w_, int h_) { - scl = scl_; - w = w_; - h = h_; - cols = w/scl; - rows = h/scl; - z = new float[cols][rows]; - } - - - // Calculate height values (based off a neural netork) - void calculate() { - float xoff = 0; - for (int i = 0; i < cols; i++) - { - float yoff = 0; - for (int j = 0; j < rows; j++) - { - z[i][j] = map(noise(xoff, yoff,zoff), 0, 1, -120, 120); - yoff += 0.1; - } - xoff += 0.1; - } - zoff+=0.01; - } - - // Render landscape as grid of quads - void render() { - // Every cell is an individual quad - // (could use quad_strip here, but produces funny results, investigate this) - for (int x = 0; x < z.length-1; x++) - { - for (int y = 0; y < z[x].length-1; y++) - { - // one quad at a time - // each quad's color is determined by the height value at each vertex - // (clean this part up) - stroke(0); - fill(100, 100); - pushMatrix(); - beginShape(QUADS); - translate(x*scl-w/2, y*scl-h/2, 0); - vertex(0, 0, z[x][y]); - vertex(scl, 0, z[x+1][y]); - vertex(scl, scl, z[x+1][y+1]); - vertex(0, scl, z[x][y+1]); - endShape(); - popMatrix(); - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde deleted file mode 100644 index e1c34a553..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Exercise_I_1_WalkerTendsToDownRight.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(800,200); - // Create a walker object - w = new Walker(); - background(255); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde deleted file mode 100644 index 42a020bce..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_1_WalkerTendsToDownRight/Walker.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - int x,y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(0); - strokeWeight(2); - point(x,y); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - float r = random(1); - // A 40% of moving to the right! - if (r < 0.4) { - x++; - } else if (r < 0.5) { - x--; - } else if (r < 0.9) { - y++; - } else { - y--; - } - - x = constrain(x,0,width-1); - y = constrain(y,0,height-1); - } -} diff --git a/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde b/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde deleted file mode 100644 index 3b839de9c..000000000 --- a/java/examples/Books/Nature of Code/introduction/Exercise_I_9_Noise3D/Exercise_I_9_Noise3D.pde +++ /dev/null @@ -1,47 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float increment = 0.01; -// The noise function's 3rd argument, a global variable that increments once per cycle -float zoff = 0.0; -// We will increment zoff differently than xoff and yoff -float zincrement = 0.02; - -void setup() { - size(200,200); -} - -void draw() { - background(0); - - // Optional: adjust noise detail here - // noiseDetail(8,0.65f); - - loadPixels(); - - float xoff = 0.0; // Start xoff at 0 - - // For every x,y coordinate in a 2D space, calculate a noise value and produce a brightness value - for (int x = 0; x < width; x++) { - xoff += increment; // Increment xoff - float yoff = 0.0; // For every xoff, start yoff at 0 - for (int y = 0; y < height; y++) { - yoff += increment; // Increment yoff - - // Calculate noise and scale by 255 - float bright = noise(xoff,yoff,zoff)*255; - - // Try using this line instead - //float bright = random(0,255); - - // Set each pixel onscreen to a grayscale value - pixels[x+y*width] = color(bright,bright,bright); - } - } - updatePixels(); - - zoff += zincrement; // Increment zoff - - -} diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde deleted file mode 100644 index af69b84fd..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_2_BellCurve/Figure_I_2_BellCurve.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float[] heights; - -void setup() { - size(400, 200); - smooth(); -} - -void draw() { - background(255); - float e = 2.71828183; //"e", see http://mathforum.org/dr.math/faq/faq.e.html for more info - float[] heights = new float[width]; //use an array to store all the "y" values - float m = 0; //default mean of 0 - float sd = map(mouseX,0,width,0.4,2); //standard deviation based on mouseX - for (int i = 0; i < heights.length; i++) { - float xcoord = map(i,0,width,-3,3); - float sq2pi = sqrt(2*PI); //square root of 2 * PI - float xmsq = -1*(xcoord-m)*(xcoord-m); //-(x - mu)^2 - float sdsq = sd*sd; //variance (standard deviation squared) - heights[i] = (1 / (sd * sq2pi)) * (pow(e, (xmsq/sdsq))); //P(x) function - } - - // a little for loop that draws a line between each point on the graph - stroke(0); - strokeWeight(2); - noFill(); - beginShape(); - for (int i = 0; i < heights.length-1; i++) { - float x = i; - float y = map(heights[i], 0, 1, height-2, 2); - vertex(x, y); - } - endShape(); -} - diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde deleted file mode 100644 index 1d3dc21d8..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_5_Noise1DGraph/Figure_I_5_Noise1DGraph.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// TIME -float t = 0.0; - -void setup() { - size(400,200); - smooth(); -} - - -void draw() { - background(255); - float xoff = t; - noFill(); - stroke(0); - strokeWeight(2); - beginShape(); - for (int i = 0; i < width; i++) { - float y = noise(xoff)*height; - xoff += 0.01; - vertex(i,y); - } - endShape(); - t+= 0.01; -} diff --git a/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde b/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde deleted file mode 100644 index fad4fe2d7..000000000 --- a/java/examples/Books/Nature of Code/introduction/Figure_I_6_RandomGraph/Figure_I_6_RandomGraph.pde +++ /dev/null @@ -1,23 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -void setup() { - size(400,200); - smooth(); -} - - -void draw() { - background(255); - noFill(); - stroke(0); - strokeWeight(2); - beginShape(); - for (int i = 0; i < width; i++) { - float y = random(height); - vertex(i,y); - } - endShape(); - noLoop(); -} diff --git a/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde b/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde deleted file mode 100644 index 50eb81f69..000000000 --- a/java/examples/Books/Nature of Code/introduction/Gaussian2/Gaussian2.pde +++ /dev/null @@ -1,48 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Random generator; - -void setup() { - size(200,200); - background(0); - generator = new Random(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //get 3 gaussian random numbers w/ mean of 0 and standard deviation of 1.0 - float r = (float) generator.nextGaussian(); - float g = (float) generator.nextGaussian(); - float b = (float) generator.nextGaussian(); - - //define standard deviation and mean - float sd = 100; float mean = 100; - //scale by standard deviation and mean - //also constrain to between (0,255) since we are dealing with color - r = constrain((r * sd) + mean,0,255); - - //repeat for g & b - sd = 20; mean = 200; - g = constrain((g * sd) + mean,0,255); - sd = 50; mean = 0; - b = constrain((b * sd) + mean,0,255); - - //get more gaussian numbers, this time for location - float xloc = (float) generator.nextGaussian(); - float yloc = (float) generator.nextGaussian(); - sd = width/10; - mean = width/2; - xloc = ( xloc * sd ) + mean; - yloc = ( yloc * sd ) + mean; - - //draw an ellipse with gaussian generated color and location - noStroke(); - fill(r,g,b); - ellipse(xloc,yloc,8,8); -} - diff --git a/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde b/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde deleted file mode 100644 index ea68bef4b..000000000 --- a/java/examples/Books/Nature of Code/introduction/MonteCarloDistribution/MonteCarloDistribution.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -float[] vals; // Array to count how often a random # is picked -float[] norms; // Normalized version of above - -void setup() { - size(200, 200); - vals = new float[width]; - norms = new float[width]; -} - -void draw() { - background(100); - - // Pick a random number between 0 and 1 based on custom probability function - float n = montecarlo(); - - // What spot in the array did we pick - int index = int(n*width); - vals[index]++; - stroke(255); - - boolean normalization = false; - float maxy = 0.0; - - // Draw graph based on values in norms array - // If a value is greater than the height, set normalization to true - for (int x = 0; x < vals.length; x++) { - line(x, height, x, height-norms[x]); - if (vals[x] > height) normalization = true; - if (vals[x] > maxy) maxy = vals[x]; - } - - // If normalization is true then normalize to height - // Otherwise, just copy the info - for (int x = 0; x < vals.length; x++) { - if (normalization) norms[x] = (vals[x] / maxy) * (height); - else norms[x] = vals[x]; - } -} - -// An algorithm for picking a random number based on monte carlo method -// Here probability is determined by formula y = x -float montecarlo() { - // Have we found one yet - boolean foundone = false; - int hack = 0; // let's count just so we don't get stuck in an infinite loop by accident - while (!foundone && hack < 10000) { - // Pick two random numbers - float r1 = (float) random(1); - float r2 = (float) random(1); - float y = r1*r1; // y = x*x (change for different results) - // If r2 is valid, we'll use this one - if (r2 < y) { - foundone = true; - return r1; - } - hack++; - } - // Hack in case we run into a problem (need to improve this) - return 0; -} - diff --git a/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde b/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde deleted file mode 100644 index 21ac11af4..000000000 --- a/java/examples/Books/Nature of Code/introduction/MultipleProbability/MultipleProbability.pde +++ /dev/null @@ -1,38 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int x,y; - -void setup() { - size(200,200); - background(0); - smooth(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //probabilities for 3 different cases (these need to add up to 100% since something always occurs here!) - float p1 = 0.05; // 5% chance of pure white occurring - float p2 = 0.80 + p1; // 80% chance of gray occuring - //float p3 = 1.0 - p2 ; // 15% chance of black (we don't actually need this line since it is - // by definit n, the "in all other cases" part of our else - float num = random(1); // pick a random number between 0 and 1 - if (num height) normalization = true; - if(vals[x] > maxy) maxy = vals[x]; - } - for (int x = 0; x < vals.length; x++) { - if (normalization) norms[x] = (vals[x] / maxy) * (height); - else norms[x] = vals[x]; - } -} diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde deleted file mode 100644 index 0f516cb1a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/NoiseWalkAcceleration.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,360); - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde deleted file mode 100644 index ebedbbd66..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkAcceleration/Walker.pde +++ /dev/null @@ -1,65 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - PVector velocity; - PVector acceleration; - - ArrayList history; - - PVector noff; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - noff = new PVector(random(1000), random(1000)); - velocity = new PVector(); - acceleration = new PVector(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - - acceleration.x = map(noise(noff.x), 0, 1, -1, 1); - acceleration.y = map(noise(noff.y), 0, 1, -1, 1); - acceleration.mult(0.1); - - noff.add(0.01, 0.01, 0); - - velocity.add(acceleration); - velocity.limit(1); - location.add(velocity); - - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde deleted file mode 100644 index aaca5448a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/NoiseWalkVelocity.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde deleted file mode 100644 index 2749b5095..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalkVelocity/Walker.pde +++ /dev/null @@ -1,60 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - PVector velocity; - - ArrayList history; - - PVector noff; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - noff = new PVector(random(1000), random(1000)); - velocity = new PVector(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - - velocity.x = map(noise(noff.x), 0, 1, -1, 1); - velocity.y = map(noise(noff.y), 0, 1, -1, 1); - velocity.mult(5); - - noff.add(0.01, 0.01, 0); - - location.add(velocity); - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde deleted file mode 100644 index 9c37a168a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/NoiseWalk_Many.pde +++ /dev/null @@ -1,35 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker[] w; - -int total = 0; - -void setup() { - size(600, 400); - - w = new Walker[10]; - for (int i = 0; i < w.length; i++) { - w[i] = new Walker(); - } -} - -void draw() { - background(255); - int o = int(map(mouseX,0,width,1,8)); - noiseDetail(o,0.3); - - if (frameCount % 30 == 0) { - total = total + 1; - if (total > w.length-1) { - total = w.length-1; - } - } - - for (int i = 0; i < total; i++) { - w[i].walk(); - w[i].display(); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde b/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde deleted file mode 100644 index 19a42fd4a..000000000 --- a/java/examples/Books/Nature of Code/introduction/NoiseWalk_Many/Walker.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - - PVector noff; - - Walker() { - location = new PVector(width/2, height/2); - noff = new PVector(random(1000),random(1000)); - } - - void display() { - strokeWeight(2); - fill(127); - stroke(0); - ellipse(location.x, location.y, 48, 48); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - - location.x = map(noise(noff.x),0,1,0,width); - location.y = map(noise(noff.y),0,1,0,height); - - noff.x += 0.01; - noff.y += 0.01; - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde b/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde deleted file mode 100644 index 7832e2b77..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalk/RandomWalk.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.render(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde deleted file mode 100644 index 55d0dc60a..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalk/Walker.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - float x, y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(x, y, 40, 40); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - float vx = random(-2, 2); - float vy = random(-2, 2); - x += vx; - y += vy; - - // Stay on the screen - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde deleted file mode 100644 index 32a0d4a54..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/RandomWalkLevy.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,480); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde deleted file mode 100644 index fa48396e2..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkLevy/Walker.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - - float prevX, prevY; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - line(prevX,prevY,x, y); - } - - // Randomly move according to floating point values - void step() { - prevX = x; - prevY = y; - - float stepx = random(-1, 1); - float stepy = random(-1, 1); - - float stepsize = montecarlo()*50; - stepx *= stepsize; - stepy *= stepsize; - - x += stepx; - y += stepy; - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - - -float montecarlo() { - while (true) { - - float r1 = random(1); - float probability = pow(1.0 - r1,8); - - float r2 = random(1); - if (r2 < probability) { - return r1; - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde deleted file mode 100644 index cb1143921..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/RandomWalkNoise.pde +++ /dev/null @@ -1,19 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(640,360); - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde deleted file mode 100644 index be8f1b716..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkNoise/Walker.pde +++ /dev/null @@ -1,39 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - float tx, ty; - - float prevX, prevY; - - Walker() { - tx = 0; - ty = 10000; - x = map(noise(tx), 0, 1, 0, width); - y = map(noise(ty), 0, 1, 0, height); - } - - void render() { - stroke(255); - line(prevX, prevY, x, y); - } - - // Randomly move according to floating point values - void step() { - - prevX = x; - prevY = y; - - x = map(noise(tx), 0, 1, 0, width); - y = map(noise(ty), 0, 1, 0, height); - - tx += 0.01; - ty += 0.01; - - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde deleted file mode 100644 index 7832e2b77..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/RandomWalkPVector.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.render(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde deleted file mode 100644 index 27e4f6a22..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkPVector/Walker.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector loc; - - Walker() { - loc = new PVector(width/2,height/2); - } - - void render() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(loc.x,loc.y,40,40); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - PVector vel = new PVector(random(-2,2),random(-2,2)); - loc.add(vel); - - // Stay on the screen - loc.x = constrain(loc.x,0,width-1); - loc.y = constrain(loc.y,0,height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde deleted file mode 100644 index 9cb6af8c6..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/RandomWalkTraditional2.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(200,200); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde deleted file mode 100644 index 856cf0bb5..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional2/Walker.pde +++ /dev/null @@ -1,29 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - int x,y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - point(x,y); - } - - // Randomly move to any neighboring pixel (or stay in the same spot) - void step() { - int stepx = int(random(3))-1; - int stepy = int(random(3))-1; - x += stepx; - y += stepy; - x = constrain(x,0,width-1); - y = constrain(y,0,height-1); - } -} diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde deleted file mode 100644 index 9cb6af8c6..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/RandomWalkTraditional3.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(200,200); - // Create a walker object - w = new Walker(); - background(0); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde deleted file mode 100644 index fdd0271d0..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTraditional3/Walker.pde +++ /dev/null @@ -1,30 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - float x, y; - - Walker() { - x = width/2; - y = height/2; - } - - void render() { - stroke(255); - point(x, y); - } - - // Randomly move according to floating point values - void step() { - float stepx = random(-1, 1); - float stepy = random(-1, 1); - x += stepx; - y += stepy; - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde deleted file mode 100644 index aaca5448a..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/RandomWalkTrail.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400,400); - frameRate(30); - - // Create a walker object - w = new Walker(); - -} - -void draw() { - background(255); - // Run the walker object - w.walk(); - w.display(); -} - - - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde deleted file mode 100644 index d0dddfa8b..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrail/Walker.pde +++ /dev/null @@ -1,49 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker class! - -class Walker { - PVector location; - - ArrayList history; - - - Walker() { - location = new PVector(width/2, height/2); - history = new ArrayList(); - } - - void display() { - stroke(0); - fill(175); - rectMode(CENTER); - rect(location.x, location.y, 16, 16); - - beginShape(); - stroke(0); - noFill(); - for (PVector v: history) { - vertex(v.x, v.y); - } - endShape(); - } - - // Randomly move up, down, left, right, or stay in one place - void walk() { - PVector vel = new PVector(random(-2, 2), random(-2, 2)); - location.add(vel); - - // Stay on the screen - location.x = constrain(location.x, 0, width-1); - location.y = constrain(location.y, 0, height-1); - - - history.add(location.get()); - if (history.size() > 1000) { - history.remove(0); - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde deleted file mode 100644 index 763c3db0d..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/RandomWalkTrailCurve.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -Walker w; - -void setup() { - size(400, 300); - // Create a walker object - w = new Walker(); -} - -void draw() { - background(255); - - // Run the walker object - w.step(); - w.render(); -} - diff --git a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde b/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde deleted file mode 100644 index fc5eba07d..000000000 --- a/java/examples/Books/Nature of Code/introduction/RandomWalkTrailCurve/Walker.pde +++ /dev/null @@ -1,42 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -// A random walker object! - -class Walker { - PVector position; - - ArrayList history = new ArrayList(); - - Walker() { - position = new PVector(width/2, height/2); - } - - void render() { - stroke(0); - beginShape(); - for (PVector v : history) { - curveVertex(v.x, v.y); - } - endShape(); - - noFill(); - stroke(0); - ellipse(position.x, position.y, 16, 16); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - position.x += random(-10, 10); - position.y += random(-10, 10); - - - position.x = constrain(position.x, 0, width-1); - position.y = constrain(position.y, 0, height-1); - - history.add(position.get()); - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde deleted file mode 100644 index 6e7cbb253..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/SelfAvoidingWalk.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://www.shiffman.net/ - -Walker w; - -void setup() { - size(600,400); - // Create a walker object - w = new Walker(); - background(255); -} - -void draw() { - // Run the walker object - w.step(); - w.render(); -} - - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde deleted file mode 100644 index b36cdf45b..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/Walker.pde +++ /dev/null @@ -1,73 +0,0 @@ -// Daniel Shiffman -// The Nature of Code -// http://www.shiffman.net/ - -// A random walker object! - -class Walker { - int x, y; - - boolean[][] grid; - - Walker() { - x = width/2; - y = height/2; - grid = new boolean[width][height]; - } - - void render() { - stroke(0); - line(x,y,x,y); - } - - // Randomly move up, down, left, right, or stay in one place - void step() { - - boolean ok = false; - - int helpme = 0; - - while (!ok) { - - int choice = int(random(4)); - - int saveX = x; - int saveY = y; - - if (choice == 0) { - x++; - } - else if (choice == 1) { - x--; - } - else if (choice == 2) { - y++; - } - else { - y--; - } - - x = constrain(x, 0, width-1); - y = constrain(y, 0, height-1); - - if (grid[x][y] == false) { - ok = true; - grid[x][y] = true; - } - else { - x = saveX; - y = saveY; - } - - - helpme++; - - if (helpme > 1000) { - println("STUCK"); - noLoop(); - ok = true; - } - } - } -} - diff --git a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg b/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg deleted file mode 100644 index 62563a04d..000000000 --- a/java/examples/Books/Nature of Code/introduction/SelfAvoidingWalk/goal.svg +++ /dev/null @@ -1,2353 +0,0 @@ - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde b/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde deleted file mode 100644 index d3d5511be..000000000 --- a/java/examples/Books/Nature of Code/introduction/SimpleProbablility/SimpleProbablility.pde +++ /dev/null @@ -1,34 +0,0 @@ -// The Nature of Code -// Daniel Shiffman -// http://natureofcode.com - -int x,y; - -void setup() { - size(200,200); - background(0); - smooth(); -} - -void draw() { - //create an alpha blended background - fill(0,1); - rect(0,0,width,height); - - //calculate a probability between 0 and 100% based on mouseX location - float prob = (mouseX / (float) width); - - //get a random floating point value between 0 and 1 - float r = random(1); - - //test the random value against the probability and trigger an event - if (r < prob) { - noStroke(); - fill(255); - ellipse(x,y,10,10); - } - - // X and Y walk through a grid - x = (x + 10) % width; - if (x == 0) y = (y + 10) % width; -} diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde deleted file mode 100755 index 4b29336b7..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -// The expression 4 + 5 evaluates to 9, then the -// value 9 is assigned to the variable x -int x = 4 + 5; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde deleted file mode 100755 index 2d9c2fff9..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -// The expression 5 * 10 evaluates to 50, then the -// expression 4 + 50 evaluates to 54, then the -// value 54 is then assigned to the variable x -int x = 4 + 5 * 10; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde deleted file mode 100755 index 5adf4599e..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -// The expression 4 + 5 evaluates to 9, then the -// expression 9 * 10 evaluates to 90, then the -// value 90 is assigned to the variable x -int x = (4 + 5) * 10; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde deleted file mode 100755 index 8e91ed6a5..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix A/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -float w = 12.0 - 6.0 + 3.0; // Assigns 9 to w -float x = 3.0 + 6.0 / 12.0; // Assigns 3.5 to x -float y = 12.0 / 6.0 * 3.0; // Assigns 6 to y -float z = 3.0 * 6.0 / 12.0; // Assigns 1.5 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde deleted file mode 100644 index ca4ac5adb..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_01/Ex_01.pde +++ /dev/null @@ -1,2 +0,0 @@ -float int = 50; // ERROR! Unexpected token: float -line(int, 0, int, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde deleted file mode 100644 index 943b6a544..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix B/Ex_02/Ex_02.pde +++ /dev/null @@ -1,2 +0,0 @@ -int line = 50; // This does not create a program error -line(line, 0, line, 100); // but it's very confusing \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde deleted file mode 100644 index d9dbe821d..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix D/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -int a = 205; // In binary: 00000000000000000000000011001101 -int b = 45; // In binary: 00000000000000000000000000101101 -a = a << 24; // Converts to 11001101000000000000000000000000 -b = b << 8; // Converts to 00000000000000000010110100000000 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde deleted file mode 100644 index 16482ecfd..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -color c = color(204, 153, 102, 255); -float r = (c >> 16) & 0xFF; // Faster version of red(c) -float g = (c >> 8) & 0xFF; // Faster version of green(c) -float b = c & 0xFF; // Faster version of blue(c) -float a = (c >> 24) & 0xFF; // Faster version of alpha(c) -println(r + ", " + g + ", " + b + ", " + a); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde deleted file mode 100644 index b708d9097..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -int a = 255; -int r = 102; -int g = 51; -int b = 255; -color c = (a << 24) | (r << 16) | (g << 8) | b; \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde deleted file mode 100644 index c4d3f97d3..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_03/Ex_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -// AVOID loading an image within draw(), it is slow -void draw() { - PImage img = loadImage("tower.jpg"); - image(img, 0, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde deleted file mode 100644 index 14db1cb30..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -// AVOID creating an array inside draw(), it is slow -void draw() { - int[] values = new int[200]; - // Do something with the array here -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde deleted file mode 100644 index 5525bdb18..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Converts (x,y) coordinates into a position in the pixels[] array -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[y*height + x] = color(102); - } -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde deleted file mode 100644 index a3d95a9de..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Replaces the multiplication y*height with an addition -int offset = 0; -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[offset + x] = color(102); - } - offset += width; // Avoids the multiply -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde deleted file mode 100644 index bac1a3f05..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_07/Ex_07.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Avoid the calculation y*height+width -int index = 0; -loadPixels(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - pixels[index++] = color(102); - } -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde deleted file mode 100644 index 2ef67c770..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Avoids (x,y) coordinates -int wh = width*height; -loadPixels(); -for (int index = 0; index < wh; index++) { - pixels[index] = color(102); -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde deleted file mode 100644 index cd0949c3e..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_09/Ex_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Only calculate the color once -int wh = width*height; -color c = color(102); -loadPixels(); -for (int index = 0; index < wh; index++) { - pixels[index] = c; -} -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde deleted file mode 100644 index 8e22c85cc..000000000 --- a/java/examples/Books/Processing Handbook/Appendices/Appendix E/Ex_10/Ex_10.pde +++ /dev/null @@ -1,17 +0,0 @@ -int res = 16; // Number of data elements -float[] x = new float[res]; // Create x-coordinate array -float[] y = new float[res]; // Create y-coordinate array - -void setup() { - size(100, 100); - for (int i = 0; i < res; i++) { - x[i] = cos(PI/res * i); // Sets x-coordinates - y[i] = sin(PI/res * i); // Sets y-coordinates - } -} - -void draw() { - for (int i = 0; i < res; i++) { // Access each point - point(50 + x[i]*40, 50 + y[i]*40); // Draws point on a curve - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde deleted file mode 100755 index 7ecd97454..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_01/Ex_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Rotate a rectangle around the y-axis and x-axis -void setup() { - size(400, 400, P3D); - fill(204); -} - -void draw() { - background(0); - translate(width / 2, height / 2, -width); - rotateY(map(mouseX, 0, width, -PI, PI)); - rotateX(map(mouseY, 0, height, -PI, PI)); - noStroke(); - rect(-200, -200, 400, 400); - stroke(255); - line(0, 0, -200, 0, 0, 200); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde deleted file mode 100755 index 290b6bc36..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Draw a sphere on top of a box and moves the coordinates with the mouse -// Press a mouse button to turn on the lights -void setup() { - size(400, 400, P3D); -} - -void draw() { - background(0); - if (mousePressed == true) { // If the mouse is pressed, - lights(); // turn on lights - } - noStroke(); - pushMatrix(); - translate(mouseX, mouseY, -500); - rotateY(PI / 6); // Rotate around y-axis - box(400, 100, 400); // Draw box - pushMatrix(); - popMatrix(); - translate(0, -200, 0); // Position the sphere - sphere(150); // Draw sphere on top of box - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde deleted file mode 100755 index f0b73f079..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_03/Ex_03.pde +++ /dev/null @@ -1,61 +0,0 @@ -// Draw a cylinder centered on the y-axis, going down from y=0 to y=height. -// The radius at the top can be different from the radius at the bottom, -// and the number of sides drawn is variable. - -void setup() { - size(400, 400, P3D); -} - -void draw() { - background(0); - lights(); - translate(width / 2, height / 2); - rotateY(map(mouseX, 0, width, 0, PI)); - rotateZ(map(mouseY, 0, height, 0, -PI)); - noStroke(); - fill(255, 255, 255); - translate(0, -40, 0); - drawCylinder(10, 180, 200, 16); // Draw a mix between a cylinder and a cone -//drawCylinder(70, 70, 120, 64); // Draw a cylinder -//drawCylinder(0, 180, 200, 4); // Draw a pyramid -} - -void drawCylinder(float topRadius, float bottomRadius, float tall, int sides) { - float angle = 0; - float angleIncrement = TWO_PI / sides; - beginShape(QUAD_STRIP); - for (int i = 0; i < sides + 1; ++i) { - vertex(topRadius*cos(angle), 0, topRadius*sin(angle)); - vertex(bottomRadius*cos(angle), tall, bottomRadius*sin(angle)); - angle += angleIncrement; - } - endShape(); - - // If it is not a cone, draw the circular top cap - if (topRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, 0, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(topRadius * cos(angle), 0, topRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } - - // If it is not a cone, draw the circular bottom cap - if (bottomRadius != 0) { - angle = 0; - beginShape(TRIANGLE_FAN); - - // Center point - vertex(0, tall, 0); - for (int i = 0; i < sides + 1; i++) { - vertex(bottomRadius * cos(angle), tall, bottomRadius * sin(angle)); - angle += angleIncrement; - } - endShape(); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde deleted file mode 100755 index 870329256..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_04/Ex_04.pde +++ /dev/null @@ -1,41 +0,0 @@ -// Export a DXF file when the R key is pressed -import processing.dxf.*; -boolean record = false; - -void setup() { - size(400, 400, P3D); - noStroke(); - sphereDetail(12); -} - -void draw() { - if (record == true) { - beginRaw(DXF, "output.dxf"); // Start recording to the file - } - lights(); - background(0); - translate(width / 3, height / 3, -200); - rotateZ(map(mouseY, 0, height, 0, PI)); - rotateY(map(mouseX, 0, width, 0, HALF_PI)); - for (int y = -2; y < 2; y++) { - for (int x = -2; x < 2; x++) { - for (int z = -2; z < 2; z++) { - pushMatrix(); - translate(120*x, 120*y, -120*z); - sphere(30); - popMatrix(); - } - } - } - if (record == true) { - endRaw(); - record = false; // Stop recording to the file - } -} - -void keyPressed() { - if (key == 'R' || key == 'r') { // Press R to save the file - record = true; - } -} - diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde deleted file mode 100755 index 526632607..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/Ex_05.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Import and display an OBJ model -// requires OBJ loader from: http://users.design.ucla.edu/%7Etatsuyas/tools/objloader/index.htm -import saito.objloader.*; -OBJModel model; - -void setup() { - size(400, 400, P3D); - model = new OBJModel(this); - model.load("chair.obj"); // Model must be in the data directory - model.drawMode(POLYGON); - noStroke(); -} - -void draw() { - background(0); - lights(); - pushMatrix(); - translate(width / 2, height, -width); - rotateY(map(mouseX, 0, width, -PI, PI)); - rotateX(PI / 4); - scale(6.0); - model.draw(); - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj deleted file mode 100755 index e5d68177d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_05/data/chair.obj +++ /dev/null @@ -1,418 +0,0 @@ -# Max2Obj Version 6.0 Jul 29th, 2003 -# -# object Zidle_A_01 to come ... -# -v 25.899904251099 23.408611297607 -0.629936158657 -v 25.836200714111 25.364303588867 -0.263177931309 -v 27.800601959229 25.365760803223 0.069837525487 -v 27.862743377686 23.408617019653 -0.297489136457 -v 18.490375518799 14.684046745300 47.418430328369 -v 18.440059661865 16.955835342407 47.789150238037 -v 20.043802261353 16.503309249878 49.659057617188 -v 20.093072891235 14.531045913696 49.332595825195 -v -16.846343994141 14.688239097595 46.918945312500 -v -16.802133560181 16.952724456787 47.287803649902 -v -18.368827819824 16.504928588867 49.132251739502 -v -18.412220001221 14.528832435608 48.805358886719 -v -25.921289443970 23.417802810669 -0.664852082729 -v -25.860712051392 25.372976303101 -0.295692503452 -v -27.811634063721 25.357145309448 0.108631089330 -v -27.870645523071 23.400211334229 -0.261199921370 -v 25.899911880493 -23.408607482910 -0.629936039448 -v 18.490377426147 -14.684038162231 47.418426513672 -v 18.440063476563 -16.955827713013 47.789150238037 -v 25.836208343506 -25.364299774170 -0.263179510832 -v 20.043806076050 -16.503301620483 49.659053802490 -v 27.800609588623 -25.365755081177 0.069835931063 -v 20.093074798584 -14.531042098999 49.332595825195 -v 27.862751007080 -23.408609390259 -0.297488987446 -v -16.846340179443 -14.688243865967 46.918941497803 -v -16.802129745483 -16.952732086182 47.287799835205 -v -18.368824005127 -16.504932403564 49.132247924805 -v -18.412216186523 -14.528839111328 48.805355072021 -v -25.921281814575 -23.417812347412 -0.664851963520 -v -25.860704421997 -25.372985839844 -0.295694082975 -v -27.811626434326 -25.357158660889 0.108629494905 -v -27.870637893677 -23.400218963623 -0.261199772358 -v -18.623430252075 16.727024078369 47.560352325439 -v -16.677518844604 16.706054687500 47.985088348389 -v -16.678075790405 14.717395782471 47.891605377197 -v -18.623422622681 14.736910820007 47.466884613037 -v -27.272499084473 15.222574234009 84.866127014160 -v -25.269447326660 15.205821037292 85.282051086426 -v -24.996809005737 13.190135955811 84.316917419434 -v -27.163030624390 13.216644287109 83.865890502930 -v -28.435161590576 9.060468673706 90.615600585938 -v -26.399826049805 9.061535835266 91.022407531738 -v -25.888158798218 8.663914680481 88.721542358398 -v -28.023075103760 8.663537025452 88.295997619629 -v -27.277370452881 -14.577423095703 84.897369384766 -v -25.276775360107 -14.559969902039 85.312210083008 -v -24.988948822021 -12.567503929138 84.289779663086 -v -27.159948348999 -12.594882965088 83.838508605957 -v -18.626295089722 -16.608646392822 47.575656890869 -v -16.680219650269 -16.586662292480 48.000041961670 -v -16.675401687622 -14.599632263184 47.876705169678 -v -18.620721817017 -14.620159149170 47.452362060547 -v -28.497978210449 -7.499320507050 90.926193237305 -v -26.461677551270 -7.500489711761 91.333389282227 -v -25.948324203491 -7.194749355316 89.017547607422 -v -28.081348419189 -7.194259643555 88.592170715332 -v -28.929925918579 0.780594170094 93.339157104492 -v -26.910228729248 0.780539214611 93.742111206055 -v -26.363113403320 0.734772324562 91.350273132324 -v -28.515964508057 0.734819710255 90.918952941895 -v 19.686010360718 14.649426460266 47.787284851074 -v -17.228097915649 14.649420738220 47.787284851074 -v 19.686014175415 -14.441827774048 47.787284851074 -v -17.228094100952 -14.441833496094 47.787284851074 -v 19.686010360718 14.649426460266 48.887374877930 -v -17.228097915649 14.649420738220 48.887374877930 -v 19.686014175415 -14.441827774048 48.887374877930 -v -17.228094100952 -14.441833496094 48.887374877930 -v 19.105789184570 14.173642158508 49.527408599854 -v -16.647876739502 14.173636436462 49.527408599854 -v -16.647872924805 -13.966049194336 49.527408599854 -v 19.105792999268 -13.966043472290 49.527408599854 -v 12.830347061157 9.088206291199 49.338916778564 -v -10.372433662415 9.088202476501 49.338916778564 -v -10.372431755066 -8.880614280701 49.338916778564 -v 12.830348968506 -8.880610466003 49.338916778564 -v 22.474662780762 4.952341556549 44.959941864014 -v 22.474662780762 -4.744742870331 44.959941864014 -v 23.136726379395 -4.744740962982 45.838500976563 -v 23.136726379395 4.952343463898 45.838500976563 -v 23.058534622192 -4.586146831512 46.698844909668 -v 23.058536529541 4.793749332428 46.698841094971 -v 16.227718353271 -2.891003131866 49.338916778564 -v 16.227716445923 3.098601818085 49.338916778564 -v -26.214628219604 -13.175243377686 83.052528381348 -v -19.325101852417 -14.434352874756 53.286815643311 -v -26.214639663696 13.382827758789 83.052528381348 -v -19.325113296509 14.641944885254 53.286819458008 -v -25.143526077271 -13.175243377686 83.303398132324 -v -18.253999710083 -14.434352874756 53.537693023682 -v -25.143537521362 13.382827758789 83.303405761719 -v -18.254011154175 14.641945838928 53.537693023682 -v -24.388038635254 -12.740889549255 82.884429931641 -v -17.763151168823 -13.958812713623 54.248584747314 -v -17.763162612915 14.166405677795 54.248584747314 -v -24.388048171997 12.948475837708 82.884429931641 -v -22.705802917480 -8.098277091980 76.833168029785 -v -18.943153381348 -8.875991821289 60.417484283447 -v -18.943161010742 9.083584785461 60.417484283447 -v -22.705812454224 8.305867195129 76.833168029785 -v -26.989404678345 -4.322551250458 86.360374450684 -v -26.989406585693 4.530138492584 86.360374450684 -v -25.918304443359 4.530136585236 86.611251831055 -v -25.918302536011 -4.322553157806 86.611244201660 -v -25.162815093994 4.385353565216 86.192276000977 -v -25.162813186646 -4.177768230438 86.192276000977 -v -23.480581283569 2.837816715240 80.141014099121 -v -23.480579376221 -2.630231380463 80.141014099121 -v -19.325109481812 4.949844360352 53.286819458008 -v -19.325107574463 -4.742256164551 53.286819458008 -v -18.254005432129 -4.742254257202 53.537693023682 -v -18.254007339478 4.949846267700 53.537693023682 -v -17.763156890869 -4.583739757538 54.248584747314 -v -17.763158798218 4.791332721710 54.248584747314 -v -18.943157196045 -2.889466762543 60.417484283447 -v -18.943159103394 3.097059726715 60.417484283447 -# 116 vertices - -vt -24.983833312988 -26.063531875610 -0.694362461567 -vt -24.938697814941 -25.800083160400 0.694362521172 -vt -26.332603454590 -25.561277389526 0.694362461567 -vt -26.377738952637 -25.824726104736 -0.694362521172 -vt -17.487480163574 21.850849151611 -9.238789558411 -vt -17.448310852051 22.079463958740 -7.843263626099 -vt -18.641181945801 23.491695404053 -8.072401046753 -vt -18.680351257324 23.263076782227 -9.467928886414 -vt 18.140369415283 21.356575012207 -9.239566802979 -vt 18.105138778687 21.584888458252 -7.843820571899 -vt 19.258998870850 22.964744567871 -8.071624755859 -vt 19.294229507446 22.736431121826 -9.467370033264 -vt 27.285417556763 -26.089975357056 -0.687983930111 -vt 27.242393493652 -25.824773788452 0.700474679470 -vt 28.626508712769 -25.534833908081 0.687984049320 -vt 28.669532775879 -25.800035476685 -0.700474560261 -vt -24.983833312988 -26.063533782959 -47.974983215332 -vt -17.487480163574 21.850845336914 -39.430557250977 -vt -17.448310852051 22.079463958740 -40.826084136963 -vt -24.938697814941 -25.800086975098 -49.363708496094 -vt -18.641181945801 23.491691589355 -40.596946716309 -vt -26.332603454590 -25.561281204224 -49.363708496094 -vt -18.680351257324 23.263076782227 -39.201419830322 -vt -26.377738952637 -25.824728012085 -47.974983215332 -vt 18.140369415283 21.356571197510 -39.429779052734 -vt 18.105138778687 21.584884643555 -40.825527191162 -vt 19.258998870850 22.964740753174 -40.597721099854 -vt 19.294229507446 22.736427307129 -39.201976776123 -vt 27.285417556763 -26.089977264404 -47.981361389160 -vt 27.242393493652 -25.824777603149 -49.369819641113 -vt 28.626508712769 -25.534837722778 -49.357330322266 -vt 28.669532775879 -25.800037384033 -47.968868255615 -vt 19.550821304321 22.079088211060 -7.911951065063 -vt 18.168672561646 22.378185272217 -7.926216125488 -vt 18.168672561646 22.310815811157 -9.338824272156 -vt 19.550821304321 22.011718750000 -9.324559211731 -vt 28.077938079834 58.962402343750 -9.466709136963 -vt 26.692619323730 59.246894836426 -9.480277061462 -vt 26.553951263428 58.540180206299 -10.862394332886 -vt 27.939270019531 58.255687713623 -10.848826408386 -vt 29.193300247192 64.552856445313 -15.466491699219 -vt 27.806550979614 64.830207824707 -15.467369079590 -vt 27.461914062500 63.104469299316 -15.501105308533 -vt 28.848716735840 62.827384948730 -15.500129699707 -vt 28.081987380981 58.982704162598 -38.561283111572 -vt 26.696582794189 59.266757965088 -38.547275543213 -vt 26.549911499023 58.519870758057 -37.177703857422 -vt 27.935316085815 58.235816955566 -37.191711425781 -vt 19.552829742432 22.089979171753 -40.634887695313 -vt 18.170631408691 22.388816833496 -40.619941711426 -vt 18.166673660278 22.299924850464 -39.208530426025 -vt 19.548871994019 22.001087188721 -39.223476409912 -vt 29.254201889038 64.856658935547 -31.654993057251 -vt 27.867467880249 65.134078979492 -31.654163360596 -vt 27.522718429565 63.408370971680 -31.687810897827 -vt 28.909502029419 63.131198883057 -31.688722610474 -vt 29.685031890869 67.214920043945 -23.560743331909 -vt 28.298290252686 67.492309570313 -23.560766220093 -vt 27.953598022461 65.766586303711 -23.594459533691 -vt 29.340389251709 65.489463806152 -23.594427108765 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 0.000000000000 0.000000000000 -vt 1.000000000000 1.000000000000 0.000000000000 -vt 0.000000000000 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.000000000000 0.666666626930 0.000000000000 -vt 0.000000000000 0.333333313465 0.000000000000 -vt 0.666666626930 0.000000000000 0.000000000000 -vt 0.333333313465 0.000000000000 0.000000000000 -vt 0.333333343267 1.000000000000 0.000000000000 -vt 0.666666686535 1.000000000000 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -vt 1.000000000000 0.333333343267 0.000000000000 -vt 1.000000000000 0.666666686535 0.000000000000 -# 146 texture vertices - -g Zidle_A_01 -s 1 -f 1/1 5/5 6/6 2/2 -f 2/2 6/6 7/7 3/3 -f 3/3 7/7 8/8 4/4 -f 4/4 8/8 5/5 1/1 -f 5/5 9/9 10/10 6/6 -f 6/6 10/10 11/11 7/7 -f 7/7 11/11 12/12 8/8 -f 8/8 12/12 9/9 5/5 -f 9/9 13/13 14/14 10/10 -f 10/10 14/14 15/15 11/11 -f 11/11 15/15 16/16 12/12 -f 12/12 16/16 13/13 9/9 -f 1/1 2/2 3/3 4/4 -f 17/17 20/20 19/19 18/18 -f 20/20 22/22 21/21 19/19 -f 22/22 24/24 23/23 21/21 -f 24/24 17/17 18/18 23/23 -f 18/18 19/19 26/26 25/25 -f 19/19 21/21 27/27 26/26 -f 21/21 23/23 28/28 27/27 -f 23/23 18/18 25/25 28/28 -f 25/25 26/26 30/30 29/29 -f 26/26 27/27 31/31 30/30 -f 27/27 28/28 32/32 31/31 -f 28/28 25/25 29/29 32/32 -f 17/17 24/24 22/22 20/20 -f 33/33 37/37 38/38 34/34 -f 34/34 38/38 39/39 35/35 -f 35/35 39/39 40/40 36/36 -f 36/36 40/40 37/37 33/33 -f 37/37 41/41 42/42 38/38 -f 38/38 42/42 43/43 39/39 -f 39/39 43/43 44/44 40/40 -f 40/40 44/44 41/41 37/37 -f 53/53 45/45 46/46 54/54 -f 54/54 46/46 47/47 55/55 -f 55/55 47/47 48/48 56/56 -f 56/56 48/48 45/45 53/53 -f 45/45 49/49 50/50 46/46 -f 46/46 50/50 51/51 47/47 -f 47/47 51/51 52/52 48/48 -f 48/48 52/52 49/49 45/45 -f 33/33 34/34 35/35 36/36 -f 42/42 41/41 57/57 58/58 -f 43/43 42/42 58/58 59/59 -f 44/44 43/43 59/59 60/60 -f 41/41 44/44 60/60 57/57 -f 58/58 57/57 53/53 54/54 -f 59/59 58/58 54/54 55/55 -f 60/60 59/59 55/55 56/56 -f 57/57 60/60 56/56 53/53 -s 0 -f 64/64 77/89 78/90 63/63 -f 64/64 62/62 61/61 77/89 -s 1 -f 75/87 84/98 73/85 74/86 -f 83/97 84/98 75/87 76/88 -s 2 -f 66/68 65/67 61/65 62/66 -s 4 -f 68/72 66/71 62/69 64/70 -s 2 -f 67/76 68/75 64/73 63/74 -s 4 -f 79/93 78/92 77/91 80/94 -s 2 -f 70/82 69/81 65/67 66/68 -s 4 -f 71/83 70/82 66/71 68/72 -s 2 -f 72/84 71/83 68/75 67/76 -s 5 -f 81/95 79/93 80/94 82/96 -s 3 -f 74/86 73/85 69/81 70/82 -s 5 -f 75/87 74/86 70/82 71/83 -s 3 -f 76/88 75/87 71/83 72/84 -s 1 -f 83/97 81/95 82/96 84/98 -s 4 -f 80/94 77/91 61/78 65/80 -f 78/92 79/93 67/79 63/77 -f 69/81 82/96 80/94 65/80 -f 79/93 81/95 72/84 67/79 -s 5 -f 73/85 84/98 82/96 69/81 -f 81/95 83/97 76/88 72/84 -s 2 -f 110/138 86/100 85/99 101/127 -s 1 -f 115/145 116/146 97/123 98/124 -f 99/125 108/136 97/123 116/146 -f 107/135 108/136 99/125 100/126 -s 4 -f 90/106 89/105 85/103 86/104 -s 8 -f 111/141 110/140 109/139 112/142 -s 4 -f 91/114 92/113 88/111 87/112 -f 103/131 102/130 101/129 104/132 -f 94/120 93/119 89/105 90/106 -s 9 -f 113/143 111/141 112/142 114/144 -s 4 -f 96/122 95/121 92/113 91/114 -s 5 -f 105/133 103/131 104/132 106/134 -f 98/124 97/123 93/119 94/120 -s 1 -f 115/145 113/143 114/144 116/146 -s 5 -f 100/126 99/125 95/121 96/122 -s 1 -f 107/135 105/133 106/134 108/136 -s 4 -f 104/132 101/129 85/116 89/118 -f 102/130 103/131 91/117 87/115 -s 5 -f 93/119 106/134 104/132 89/118 -f 103/131 105/133 96/122 91/117 -s 1 -f 97/123 108/136 106/134 93/119 -f 105/133 107/135 100/126 96/122 -s 8 -f 112/142 109/139 88/108 92/110 -f 110/140 111/141 90/109 86/107 -f 95/121 114/144 112/142 92/110 -f 111/141 113/143 94/120 90/109 -s 9 -f 99/125 116/146 114/144 95/121 -f 113/143 115/145 98/124 94/120 -s 2 -f 109/137 102/128 87/101 88/102 -f 110/138 101/127 102/128 109/137 -s 1 -f 15/15 14/14 13/13 -f 16/16 15/15 13/13 -f 31/31 29/29 30/30 -f 32/32 29/29 31/31 -f 51/51 50/50 49/49 -f 52/52 51/51 49/49 -# 109 faces - -g diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde deleted file mode 100755 index 23ca4b7fa..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -// The camera lifts up while looking at the same point -void setup() { - size(400, 400, P3D); - fill(204); -} - -void draw() { - lights(); - background(0); - // Change height of the camera with mouseY - camera(30.0, mouseY, 220.0, // eyeX, eyeY, eyeZ - 0.0, 0.0, 0.0, // centerX, centerY, centerZ - 0.0, 1.0, 0.0); // upX, upY, upZ - noStroke(); - box(90); - stroke(255); - line(-100, 0, 0, 100, 0, 0); - line(0, -100, 0, 0, 100, 0); - line(0, 0, -100, 0, 0, 100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde deleted file mode 100755 index a0dc5c7ca..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Vary the specular reflection component of a material -// with vertical position of the mouse -void setup() { - size(400, 400, P3D); - noStroke(); - colorMode(RGB, 1); - fill(0.4); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - // Set the specular color of lights that follow - lightSpecular(1, 1, 1); - directionalLight(0.8, 0.8, 0.8, 0, 0, -1); - float s = mouseX / float(width); - specular(s, s, s); - sphere(100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde deleted file mode 100755 index a9125aba5..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_08/Ex_08.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Draw a box with three different kinds of lights -void setup() { - size(400, 400, P3D); - noStroke(); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - // Orange point light on the right - pointLight(150, 100, 0, // Color - 200, -150, 0); // Position - - // Blue directional light from the left - directionalLight(0, 102, 255, // Color - 1, 0, 0); // The x-, y-, z-axis direction - - // Yellow spotlight from the front - spotLight(255, 255, 109, // Color - 0, 40, 200, // Position - 0, -0.5, -0.5, // Direction - PI / 2, 2); // Angle, concentration - - rotateY(map(mouseX, 0, width, 0, PI)); - rotateX(map(mouseY, 0, height, 0, PI)); - box(200); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde deleted file mode 100755 index 49a3f3f5d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/3D/Ex_09/Ex_09.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Load an image and draw it onto a cylinder and a quad -int tubeRes = 32; -float[] tubeX = new float[tubeRes]; -float[] tubeY = new float[tubeRes]; -PImage img; - -void setup() { - size(400, 400, P3D); - img = loadImage("berlin-1.jpg"); - float angle = 270.0 / tubeRes; - for (int i = 0; i < tubeRes; i++) { - tubeX[i] = cos(radians(i * angle)); - tubeY[i] = sin(radians(i * angle)); - } - noStroke(); -} - -void draw() { - background(0); - translate(width / 2, height / 2); - rotateX(map(mouseY, 0, height, -PI, PI)); - rotateY(map(mouseX, 0, width, -PI, PI)); - beginShape(QUAD_STRIP); - texture(img); - for (int i = 0; i < tubeRes; i++) { - float x = tubeX[i] * 100; - float z = tubeY[i] * 100; - float u = img.width / tubeRes * i; - vertex(x, -100, z, u, 0); - vertex(x, 100, z, u, img.height); - } - endShape(); - beginShape(QUADS); - texture(img); - vertex(0, -100, 0, 0, 0); - vertex(100, -100, 0, 100, 0); - vertex(100, 100, 0, 100, 100); - vertex(0, 100, 0, 0, 100); - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde deleted file mode 100755 index d7a6b1af7..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01A/Ex_01A.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Code for sensing a switch status and writing the value to the serial port -int switchPin = 0; // Switch connected to pin 0 - -void setup() { - pinMode(switchPin, INPUT); // Set pin 0 as an input - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (digitalRead(switchPin) == HIGH) { // If switch is ON, - Serial.print(1, BYTE); // send 1 to Processing - } else { // If the switch is not ON, - Serial.print(0, BYTE); // send 0 to Processing - } - delay(100); // Wait 100 milliseconds -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde deleted file mode 100755 index b6284fa05..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_01B/Ex_01B.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Read data from the serial port and change the color of a rectangle -// when a switch connected to the board is pressed and released -import processing.serial.*; -Serial port; // Create object from Serial class -int val; // Data received from the serial port - -void setup() { - size(200, 200); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - if (0 < port.available()) { // If data is available, - val = port.read(); // read it and store it in val - } - background(255); // Set background to white - if (val == 0) { // If the serial value is 0, - fill(0); // set fill to black - } else { // If the serial value is not 0, - fill(204); // set fill to light gray - } - rect(50, 50, 100, 100); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde deleted file mode 100755 index 586b5804d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02A/Ex_02A.pde +++ /dev/null @@ -1,13 +0,0 @@ -// Code to read an analog value and write it to the serial port -int val; -int inputPin = 0; // Set the input to analog in pin 0 - -void setup() { - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - val = analogRead(inputPin) / 4; // Read analog input pin, put in range 0 to 255 - Serial.print(val, BYTE); // Send the value - delay(100); // Wait 100ms for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde deleted file mode 100755 index 463173016..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_02B/Ex_02B.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Read data from the serial port and assign it to a variable. Set the fill a -// rectangle on the screen using the value read from a light sensor connected -// to the Wiring or Arduino board -import processing.serial.*; -Serial port; // Create object from Serial class -int val; // Data received from the serial port - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); // Run 10 frames per second -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - if (0 < port.available()) { // If data is available to read, - val = port.read(); // read it and store it in val - } - background(204); // Clear background - fill(val); // Set fill color with the value read - rect(50, 50, 100, 100); // Draw square -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde deleted file mode 100755 index af0a68de7..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03A/Ex_03A.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Read data from the serial and turn ON or OFF a light depending on the value -char val; // Data received from the serial port -int ledPin = 0; // Set the pin to digital I/O 0 - -void setup() { - pinMode(ledPin, OUTPUT); // Set pin as OUTPUT - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available to read, - val = Serial.read(); // read it and store it in val - } - if (val == 'H') { // If H was received - digitalWrite(ledPin, HIGH); // turn the LED on - } else { - digitalWrite(ledPin, LOW); // Otherwise turn it OFF - } - delay(100); // Wait 100 milliseconds for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde deleted file mode 100755 index 2241f664f..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_03B/Ex_03B.pde +++ /dev/null @@ -1,28 +0,0 @@ -// Check if the mouse is over a rectangle and writes the status to the serial port -import processing.serial.*; - -Serial port; // Create object from Serial class - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - background(255); - if (mouseOverRect() == true) { // If mouse is over square, - fill(204); // change color and - port.write('H'); // send an H to indicate mouse is over square - } else { // If mouse is not over square, - fill(0); // change color and - port.write('L'); // send an L otherwise - } - rect(50, 50, 100, 100); // Draw a square -} - -boolean mouseOverRect() { // Test if mouse is over square - return ((mouseX >= 50) && (mouseX <= 150) && (mouseY >= 50) && (mouseY <= 150)); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde deleted file mode 100755 index d5203ea31..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04A/Ex_04A.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Read data from the serial port and set the position of a servomotor -// according to the value -Servo myservo; // Create servo object to control a servo - -int servoPin = 0; // Connect yellow servo wire to digital I/O pin 0 -int val = 0; // Data received from the serial port - -void setup() { - myservo.attach(servoPin); // Attach the servo to the PWM pin - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available to read, - val = Serial.read(); // read it and store it in val - } - myservo.write(val); // Set the servo position - delay(15); // Wait for the servo to get there -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde deleted file mode 100755 index 3382f1fa2..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_04B/Ex_04B.pde +++ /dev/null @@ -1,32 +0,0 @@ -// Write data to the serial port according to the mouseX value -import processing.serial.*; - -Serial port; // Create object from Serial class -float mx = 0.0; - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - background(0); // Clear background - fill(204); // Set fill color - rect(40, height / 2 - 15, 120, 25); // Draw square - float dif = mouseX - mx; - if (abs(dif) > 1.0) { - mx += dif / 4.0; - } - mx = constrain(mx, 50, 149); // Keeps marker on the screen - noStroke(); - fill(255); - rect(50, (height / 2) - 5, 100, 5); - fill(204, 102, 0); - rect(mx - 2, height / 2 - 5, 4, 5); // Draw the position marker - int angle = int(map(mx, 50, 149, 0, 180)); // Scale the value the range 0-180 -//print(angle + " "); // Print the current angle (debug) - port.write(angle); // Write the angle to the serial port -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde deleted file mode 100755 index 85fe0be50..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05A/Ex_05A.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Read data from the serial and turns a DC motor on or off according to the value -char val; // Data received from the serial port -int motorpin = 0; // Wiring: Connect L293D Pin En1 connected to Pin PWM 0 -// int motorpin = 9; // Arduino: Connect L293D Pin En1 to Pin PWM 9 - -void setup() { - Serial.begin(9600); // Start serial communication at 9600 bps -} - -void loop() { - if (Serial.available()) { // If data is available, - val = Serial.read(); // read it and store it in val - } - if (val == 'H') { // If 'H' was received, - analogWrite(motorpin, 125); // turn the motor on at medium speed - } else { // If 'H' was not received - analogWrite(motorpin, 0); // turn the motor off - } - delay(100); // Wait 100 milliseconds for next reading -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde b/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde deleted file mode 100755 index dae509627..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Electronics/Ex_05B/Ex_05B.pde +++ /dev/null @@ -1,56 +0,0 @@ -// Write data to the serial port according to the status of a button controlled -// by the mouse -import processing.serial.*; -Serial port; // Create serial port object -boolean rectOver = false; -int rectX, rectY; // Position of square button -int rectSize = 100; // Diameter of rect -color rectColor; -boolean buttonOn = false; // Status of the button - -void setup() { - size(200, 200); - noStroke(); - frameRate(10); - rectColor = color(100); - rectX = width / 2 - rectSize / 2; - rectY = height / 2 - rectSize / 2; -// Open the port that the board is connected to and use the same speed (9600 bps) - port = new Serial(this, 9600); -} - -void draw() { - update(mouseX, mouseY); - background(0); // Clear background to black - fill(rectColor); - rect(rectX, rectY, rectSize, rectSize); -} -void update(int x, int y) { - if (overRect(rectX, rectY, rectSize, rectSize) == true) { - rectOver = true; - } else { - rectOver = false; - } -} - -void mouseReleased() { - if (rectOver == true) { - if (buttonOn == true) { - rectColor = color(100); - buttonOn = false; - port.write('L'); // Send an L to indicate button is OFF - } else { - rectColor = color(180); - buttonOn = true; - port.write('H'); // Send an H to indicate button is ON - } - } -} -boolean overRect(int x, int y, int width, int height) { - if ((mouseX >= x) && (mouseX <= x + width) && - (mouseY >= y) && (mouseY <= y + height)) { - return true; - } else { - return false; - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde deleted file mode 100755 index 160fa2647..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_01/Ex_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -// The image file, named sprite.png in this example, must be located in the -// sketch data folder. From the Sketch menu, choose "Add File" to copy files into -// the sketch data folder. -PImage img = loadImage("sprite.png"); -// The coordinates (0, 0) refer to the top-left corder of the screen -image(img, 0, 0); -// The following coordinate calculations will center the image in the screen -image(img, (width - img.width) / 2, (height - img.height) / 2); -// Finally, the next line will position the image in the bottom-right corner -image(img, width - img.width, height - img.height); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde deleted file mode 100755 index c54213f18..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -String s; -PFont font; -void setup() { - font = loadFont(); // Load and set the default font for drawing text - textFont(font); - softkey("Input"); // Create a softkey called Input - s = "No input"; // Initialize s with an initial message -} -void draw() { - background(200); - text(s, 0, height / 2); // Draw the String s in the middle of the screen -} - -void softkeyPressed(String label) { -// Check the value of the softkey label to determine the action to take - if (label.equals("Input")) { -// If the Input softkey is pressed, open a textInput window for the user -// to type text. It will be drawn on the screen by the draw() method - s = textInput(); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde deleted file mode 100755 index 3753a6162..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_03/Ex_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -PFont font; - -void setup() { - font = loadFont(); - textFont(font); - softkey("Delete"); // Use softkey to to delete characters from the multitap buffer - multitap(); // Turn on multitap key input -} - -void draw() { - background(200); - text(multitapText, 0, height / 2); // Draw the text captured with multitap -} -void softkeyPressed(String label) { - if (label.equals("Delete")) { - multitapDeleteChar(); // Delete a character - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde deleted file mode 100755 index aef2e609e..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_04/Ex_04.pde +++ /dev/null @@ -1,80 +0,0 @@ -// The PClient object is used to initiate requests to the server -PClient c; -// The PRequest object represents an active request from which we receive -// status information and data from the server -PRequest request; -int counter; -PFont font; -PImage img; -String version; -String error; - -void setup() { - font = loadFont(); // Load and set the default font for drawing text - textFont(font); - fill(0); -// Create a new network connection to connect to the Mobile Processing website - c = new PClient(this, "mobile.processing.org"); -// Start by fetching the logo for Mobile Processing the filename is a relative path -// specified in the same way as a URL in a webpage - request = c.GET("/images/mobile.png"); -// Use the counter to keep track of what we're fetching - counter = 0; -} - -void draw() { - background(255); - int y = 0; - if (error != null) { -// A network error has occured, so display the message - y += font.baseline; - text(error, 0, y); - } else if (img == null) { -// The img is not yet fetched, so draw a status message - y += font.baseline; - text("Fetching image...", 0, y); - } else { -// Draw the image - image(img, (width - img.width) / 2, y); - y += img.height + font.baseline; - if (version == null) { -// The version text is not yet fetched, so draw a status message - text("Checking version...", 0, y); - } else { -// Draw the version as reported by the website - text("Latest version: " + version, 0, y); - } - } -} -// The libraryEvent() will be called when a library, in this case the Net -// library, has an event to report back to the program -void libraryEvent(Object library, int event, Object data) { -// Make sure we handle the event from the right library - if (library == request) { - if (event == PRequest.EVENT_CONNECTED) { -// This event occurs when the connection is complete, so we can start -// reading the data. The readBytes() method will read all the data returned -// by the server and send another event when completed. - request.readBytes(); - } else if (event == PRequest.EVENT_DONE) { -// Reading is complete! Check the counter to see what we're transferring, -// then process the data. The data object in this case is an array of bytes. - byte[] bytes = (byte[]) data; - if (counter == 0) { -// This is the logo, so create an image from the bytes - img = new PImage(bytes); -// Now that we have the logo image, fetch the latest version text for -// Mobile Processing. We use the client object to initiate a new request - request = c.GET("/download/latest.txt"); -// Set the counter to 1 to represent the tex - counter = 1; - } else if (counter == 1) { -// This is the version text, so create a string from the bytes - version = new String(bytes); - } - } else if (event == PRequest.EVENT_ERROR) { -// The data object in this case is an error message - error = (String) data; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde deleted file mode 100755 index a0c20636c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_05/Ex_05.pde +++ /dev/null @@ -1,14 +0,0 @@ -import processing.sound.*; -// Notes range from 0 to 127 as in the MIDI specification -int[] notes = { 60, 62, 64, 65, 67, 69, 71, 72, 74 }; - -void setup() { - noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop -} - -void keyPressed() { - if ((key >= '1') && (key <= '9')) { -// Use the key as an index into the array of notes - Sound.playTone(notes[key - '1'], 500, 80); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde deleted file mode 100755 index 6054f8b1c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_06/Ex_06.pde +++ /dev/null @@ -1,18 +0,0 @@ -import processing.sound.*; -Sound s; - -void setup() { -// The file, soundtrack.mid, must be copied into the data folder of this sketch - s = new Sound("soundtrack.mid"); - softkey("Play"); - noLoop(); -} -void softkeyPressed(String label) { - if (label.equals("Play")) { - s.play(); - softkey("Pause"); // Change the label of the softkey to Pause - } else if (label.equals("Pause")) { - s.pause(); - softkey("Play"); // Change the label of the softkey back to Play - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde deleted file mode 100755 index 43dcc79eb..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_07/Ex_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -import processing.sound.*; -PFont font = loadFont(); -textFont(font); -background(255); -fill(0); - -// Get a list of the supported types of media on the phone -String[] types = Sound.supportedTypes(); -// Start at the top of the screen -int y = font.baseline; -// Draw each of the supported types on the screen -for (int i = 0, length = types.length; i < length; i++) { -// Draw the supported type (represented as an -// Internet MIME type string, such as audio/x-wav) - text(types[i], 0, y); -// Go to the next line - y += font.height; -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde deleted file mode 100755 index 71a8cb2a3..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Mobile/Ex_08/Ex_08.pde +++ /dev/null @@ -1,30 +0,0 @@ -import processing.phone.*; -Phone p; - -void setup() { - p = new Phone(this); - noLoop(); // No drawing in this sketch, so we don't need to run the draw() loop -} - -void keyPressed() { - switch (key) { - case '1': - // Vibrate the phone for 200 milliseconds - p.vibrate(200); - break; - - case '2': - // Flash the backlight for 200 milliseconds - p.flash(200); - break; - - case '3': - // Dial 411 on the phone - p.call("411"); - break; - case '4': - // Launch the Web browser - p.launch("http://mobile.processing.org/"); - break; - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde deleted file mode 100755 index b95744578..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_01/Ex_01.pde +++ /dev/null @@ -1,21 +0,0 @@ -// A simple Web client using HTTP -import processing.net.*; - -Client c; -String data; - -void setup() { - size(200, 200); - background(50); - fill(200); - c = new Client(this, "www.processing.org", 80); // Connect to server on port 80 - c.write("GET / HTTP/1.0\n"); // Use the HTTP "GET" command to ask for a Web page - c.write("Host: my_domain_name.com\n\n"); // Be polite and say who we are -} - -void draw() { - if (c.available() > 0) { // If there's incoming data from the client... - data += c.readString(); // ...then grab it and print it - println(data); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde deleted file mode 100755 index 688f76f34..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02A/Ex_02A.pde +++ /dev/null @@ -1,34 +0,0 @@ -import processing.net.*; - -Server s; -Client c; -String input; -int data[]; - -void setup() { - size(450, 255); - background(204); - stroke(0); - frameRate(5); // Slow it down a little - s = new Server(this, 12345); // Start a simple server on a port -} - -void draw() { - if (mousePressed == true) { -// Draw our line - stroke(255); - line(pmouseX, pmouseY, mouseX, mouseY); -// Send mouse coords to other person - s.write(pmouseX + " " + pmouseY + " " + mouseX + " " + mouseY + "\n"); - } -// Receive data from client - c = s.available(); - if (c != null) { - input = c.readString(); - input = input.substring(0, input.indexOf("\n")); // Only up to the newline - data = int(split(input, ' ')); // Split values into an array -// Draw line using received coords - stroke(0); - line(data[0], data[1], data[2], data[3]); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde deleted file mode 100755 index e15c2ed5c..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_02B/Ex_02B.pde +++ /dev/null @@ -1,33 +0,0 @@ -import processing.net.*; - -Client c; -String input; -int data[]; - -void setup() { - size(450, 255); - background(204); - stroke(0); - frameRate(5); // Slow it down a little -// Connect to the server’s IP address and port - c = new Client(this, "127.0.0.1", 12345); // Replace with your server’s IP and port -} - -void draw() { - if (mousePressed == true) { -// Draw our line - stroke(255); - line(pmouseX, pmouseY, mouseX, mouseY); -// Send mouse coords to other person - c.write(pmouseX + " " + pmouseY + " " + mouseX + " " + mouseY + "\n"); - } -// Receive data from server - if (c.available() > 0) { - input = c.readString(); - input = input.substring(0, input.indexOf("\n")); // Only up to the newline - data = int(split(input, ' ')); // Split values into an array -// Draw line using received coords - stroke(0); - line(data[0], data[1], data[2], data[3]); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde deleted file mode 100755 index caedf07ae..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_03/Ex_03.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Download the Yahoo! Search SDK from http://developer.yahoo.com/download -// Inside the download, find the yahoo_search-2.X.X.jar file somewhere inside -// the "Java" subdirectory. Drag the jar file to your sketch and it will be -// added to your 'code' folder for use. -// This example is based on the based on yahoo api example -// Replace this with a developer key from http://developer.yahoo.com -String appid = "YOUR_DEVELOPER_KEY_HERE"; -SearchClient client = new SearchClient(appid); -String query = "processing.org"; -WebSearchRequest request = new WebSearchRequest(query); - -// (Optional) Set the maximum number of results to download -//request.setResults(30); - -try { - WebSearchResults results = client.webSearch(request); - // Print out how many hits were found - println("Displaying " + results.getTotalResultsReturned() + - " out of " + results.getTotalResultsAvailable() + " hits."); - println(); - // Get a list of the search results - WebSearchResult[] resultList = results.listResults(); - // Loop through the results and print them to the console - - for (int i = 0; i < resultList.length; i++) { - // Print out the document title and URL. - println((i + 1) + "."); - println(resultList[i].getTitle()); - println(resultList[i].getUrl()); - println(); - } - -// Error handling below, see the documentation of the Yahoo! API for details -} catch (IOException e) { - println("Error calling Yahoo! Search Service: " + e.toString()); - e.printStackTrace(); -} catch (SearchException e) { - println("Error calling Yahoo! Search Service: " + e.toString()); - e.printStackTrace(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde deleted file mode 100755 index 0931acf86..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/Ex_04.pde +++ /dev/null @@ -1,68 +0,0 @@ -// Note: requires Carnivore Library for Processing v2.2 (http://r-s-g.org/carnivore) -// Windows, first install winpcap (http://winpcap.org) -// Mac, first open a Terminal and execute this commmand: sudo chmod 777 /dev/bpf* -// (must be done each time you reboot your mac) -import java.util.Iterator; -import org.rsg.carnivore.*; -import org.rsg.carnivore.net.*; -HashMap nodes = new HashMap(); -float startDiameter = 100.0; -float shrinkSpeed = 0.97; -int splitter, x, y; -PFont font; -void setup() { - size(800, 600); - background(255); - frameRate(10); - Log.setDebug(true); // Uncomment this for verbose mode - CarnivoreP5 c = new CarnivoreP5(this); -//c.setVolumeLimit(4); -// Use the "Create Font" tool to add a 12 point font to your sketch, -// then use its name as the parameter to loadFont(). - font = loadFont("CourierNew-12.vlw"); - textFont(font); -} - -void draw() { - background(255); - drawNodes(); -} - -// Iterate through each node -synchronized void drawNodes() { - Iterator it = nodes.keySet().iterator(); - while (it.hasNext()) { - String ip = (String)it.next(); - float d = float(nodes.get(ip).toString()); - - // Use last two IP address bytes for x/y coords - splitter = ip.lastIndexOf("."); - y = int(ip.substring(splitter + 1)) * height / 255; // Scale to applet size - String tmp = ip.substring(0, splitter); - splitter = tmp.lastIndexOf("."); - x = int(tmp.substring(splitter + 1)) * width / 255; // Scale to applet size - - // Draw the node - stroke(0); - fill(color(100, 200)); // Rim - ellipse(x, y, d, d); // Node circle - noStroke(); - fill(color(100, 50)); // Halo - ellipse(x, y, d + 20, d + 20); - - // Draw the text - fill(0); - text(ip, x, y); - - // Shrink the nodes a little - nodes.put(ip, str(d * shrinkSpeed)); - } -} - -// Called each time a new packet arrives -synchronized void packetEvent(CarnivorePacket packet) { - println("[PDE] packetEvent: " + packet); -// Remember these nodes in our hash map - nodes.put(packet.receiverAddress.toString(), str(startDiameter)); - nodes.put(packet.senderAddress.toString(), str(startDiameter)); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw b/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw deleted file mode 100755 index a4e5d9737..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Network/Ex_04/data/CourierNew-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde deleted file mode 100755 index c8b239cdb..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -import processing.pdf.*; // Import PDF code - -size(600, 600, PDF, "line.pdf"); // Set PDF as the renderer -background(255); -stroke(0); -line(200, 0, width/2, height); // Draw line to PDF -exit(); // Stop the program \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde deleted file mode 100755 index c4909ef60..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_02/Ex_02.pde +++ /dev/null @@ -1,9 +0,0 @@ -import processing.pdf.*; // Import PDF code - -size(600, 600); -beginRecord(PDF, "line.pdf"); // Start writing to PDF -background(255); -stroke(0, 20); -strokeWeight(20); -line(200, 0, 400, height); // Draw line to screen and to PDF -endRecord(); // Stop writing to PDF \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde deleted file mode 100755 index a4fed7165..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_03/Ex_03.pde +++ /dev/null @@ -1,25 +0,0 @@ -import processing.pdf.*; // Import PDF code - -boolean saveOneFrame = false; - -void setup() { - size(600, 600); -} - -void draw() { - if (saveOneFrame == true) { // When the saveOneFrame boolean is true, - beginRecord(PDF, "line-####.pdf"); // start recording to the PDF - } - background(255); - stroke(0, 20); - strokeWeight(20); - line(mouseX, 0, width - mouseY, height); - if (saveOneFrame == true) { // If the PDF has been recording, - endRecord(); // stop recording, - saveOneFrame = false; // and set the boolean value to false - } -} - -void mousePressed() { // When a mouse button is pressed, - saveOneFrame = true; // trigger PDF recording within the draw() -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde deleted file mode 100755 index ff4664d9a..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_04/Ex_04.pde +++ /dev/null @@ -1,22 +0,0 @@ -import processing.pdf.*; // Import PDF code - -void setup() { - size(600, 600); - background(255); -} - -void draw() { - stroke(0, 20); - strokeWeight(20); - line(mouseX, 0, width - mouseY, height); -} - -void keyPressed() { - if (key == 'B' || key == 'b') { // When 'B' or 'b' is pressed, - beginRecord(PDF, "lines.pdf"); // start recording to the PDF - background(255); // Set a white background - } else if (key == 'E' || key == 'e') { // When 'E' or 'e' is pressed, - endRecord(); // stop recording the PDF and - exit(); // quit the program - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde deleted file mode 100755 index 2ab41b3ad..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_05/Ex_05.pde +++ /dev/null @@ -1,10 +0,0 @@ -PGraphics big; // Declare a PGraphics variable - -void setup() { - big = createGraphics(3000, 3000); // Create a new PGraphics object - big.beginDraw(); // Start drawing to the PGraphics object - big.background(128); // Set the background - big.line(20, 1800, 1800, 900); // Draw a line - big.endDraw(); // Stop drawing to the PGraphics object - big.save("big.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde deleted file mode 100755 index a9c09e569..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Print/Ex_06/Ex_06.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Draws an image larger than the screen by tiling it into small sections. -// The scaleValue variable sets amount of scaling: 1 is 100%, 2 is 200%, etc. -int scaleValue = 3; // Multiplication factor -int xoffset = 0; // x-axis offset -int yoffset = 0; // y-axis offset - -void setup() { - size(600, 600); - stroke(0, 100); -} - -void draw() { - scale(scaleValue); - translate(xoffset *(-width / scaleValue), yoffset *(-height / scaleValue)); - line(10, 150, 500, 50); - line(0, 600, 600, 0); - setOffset(); -} - -void setOffset() { - save("lines-" + xoffset + "-" + yoffset + ".jpg"); - xoffset++; - if (xoffset == scaleValue) { - xoffset = 0; - yoffset++; - if (yoffset == scaleValue) { - exit(); - } - } - background(204); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde deleted file mode 100755 index 673c05f0f..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_01/Ex_01.pde +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Sound is generated in real time by summing together harmonically related - * sine tones. Overall pitch and harmonic detuning is controlled by the mouse. - * Based on the Spooky Stream Save Ess example - */ - -import krister.Ess.*; - -int numSines = 5; // Number of oscillators to use -AudioStream myStream; // Audio stream to write into -SineWave[] myWave; // Array of sines -FadeOut myFadeOut; // Amplitude ramp function -FadeIn myFadeIn; // Amplitude ramp function - -void setup() { - size(256, 200); - Ess.start(this); // Start Ess - myStream = new AudioStream(); // Create a new AudioStream - myStream.smoothPan = true; - myWave = new SineWave[numSines]; // Initialize the oscillators - for (int i = 0; i < myWave.length; i++) { - float sinVolume = (1.0 / myWave.length) / (i + 1); - myWave[i] = new SineWave(0, sinVolume); - } - myFadeOut = new FadeOut(); // Create amplitude ramp - myFadeIn = new FadeIn(); // Create amplitude ramp - myStream.start(); // Start audio -} - -void draw() { - noStroke(); - fill(0, 20); - rect(0, 0, width, height); // Draw the background - float offset = millis() - myStream.bufferStartTime; - int interp = int((offset / myStream.duration) * myStream.size); - stroke(255); - for (int i = 0; i < width; i++) { - float y1 = mouseY; - float y2 = y1; - if (i + interp + 1 < myStream.buffer2.length) { - y1 -= myStream.buffer2[i+interp] * height / 2; - y2 -= myStream.buffer2[i+interp+1] * height / 2; - } - line(i, y1, i + 1, y2); // Draw the waves - } -} -void audioStreamWrite(AudioStream s) { - // Figure out frequencies and detune amounts from the mouse - // using exponential scaling to approximate pitch perception - float yoffset = (height - mouseY) / float(height); - float frequency = pow(1000, yoffset) + 150; - float detune = float(mouseX) / width - 0.5; - myWave[0].generate(myStream); // Generate first sine, replace Stream - myWave[0].phase += myStream.size; // Increment the phase - myWave[0].phase %= myStream.sampleRate; - for (int i = 1; i < myWave.length; i++) { // Add remaining sines into the Stream - myWave[i].generate(myStream, Ess.ADD); - myWave[i].phase = myWave[0].phase; - } - myFadeOut.filter(myStream); // Fade down the audio - for (int i = 0; i < myWave.length; i++) { // Set the frequencies - myWave[i].frequency = round(frequency * (i + 1 + i * detune)); - myWave[i].phase = 0; - } - myFadeIn.filter(myStream); // Fade up the audio -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde deleted file mode 100755 index 7dd298db6..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_02/Ex_02.pde +++ /dev/null @@ -1,47 +0,0 @@ -/** -Sound is generated at setup with a triangle waveform and a simple envelope -generator. Insert your own array of notes as 'rawSequence' and let it roll. -*/ -import krister.Ess.*; -AudioChannel myChannel; // Create channel -TriangleWave myWave; // Create triangle waveform -Envelope myEnvelope; // Create envelope -int numNotes = 200; // Number of notes -int noteDuration = 300; // Duration of each note in milliseconds -float[] rawSequence = { 293.6648, 293.6648, 329.62756, 329.62756, 391.995, 369.99445 , 293.6648, 293.6648, - 329.62756, 293.6648, 439.997, 391.995, 293.6648, 293.6648, 587.3294, 493.8834, - 391.995, 369.9945, 329.62756, 523.2516, 523.2516, 493.8834, 391.995, - 439.997, 391.995 }; // Happy birthday - -void setup() { - size(100, 100); - Ess.start(this); // Start Ess - myChannel = new AudioChannel(); // Create a new AudioChannel - myChannel.initChannel(myChannel.frames(rawSequence.length * noteDuration)); - int current = 0; - myWave = new TriangleWave(480, 0.3); // Create triangle wave - EPoint[] myEnv = new EPoint[3]; // Three-step breakpoint function - myEnv[0] = new EPoint(0, 0); // Start at 0 - myEnv[1] = new EPoint(0.25, 1); // Attack - myEnv[2] = new EPoint(2, 0); // Release - myEnvelope = new Envelope(myEnv); // Bind Envelope to the breakpoint function - int time = 0; - for (int i = 0; i < rawSequence.length; i++) { - myWave.frequency = rawSequence[current]; // Update waveform frequency - int begin = myChannel.frames(time); // Starting position within Channel - int e = int(noteDuration * 0.8); - int end = myChannel.frames(e); // Ending position with Channel - myWave.generate(myChannel, begin, end); // Render triangle wave - myEnvelope.filter(myChannel, begin, end); // Apply envelope - current++; // Move to next note - time += noteDuration; // Increment the Channel output point - } - myChannel.play(); // Play the sound! -} - -void draw() { } // Empty draw() keeps the program running - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde deleted file mode 100755 index 61810b8c8..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/Ex_03.pde +++ /dev/null @@ -1,88 +0,0 @@ -/** -Loads a sound file off disk and plays it in multiple voices at multiple sampling -increments (demonstrating voice allocation), panning it back and forth between -the speakers. Based on Ping Pong by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel[] mySound = new AudioChannel[6]; // Six channels of audio playback -Envelope myEnvelope; // Create Envelope -boolean left = true; -boolean middle = false; -boolean right = false; -// Sampling rates to choose from -int[] rates = { 44100, 22050, 2943, 49500, 11025, 37083 }; - -void setup() { - size(256, 200); - stroke(255); - Ess.start(this); // Start Ess -// Load sounds and set initial panning -// Sounds must be located in the sketch's "data" folder - for (int i = 0; i < 6; i++) { - mySound[i] = new AudioChannel("cela3.aif"); - mySound[i].smoothPan = true; - mySound[i].pan(Ess.LEFT); - mySound[i].panTo(1, 4000); - } - EPoint[] myEnv = new EPoint[3]; // Three-step breakpoint function - myEnv[0] = new EPoint(0, 0); // Start at 0 - myEnv[1] = new EPoint(0.25, 1); // Attack - myEnv[2] = new EPoint(2, 0); // Release - myEnvelope = new Envelope(myEnv); // Bind an Envelope to the breakpoint function -} - -void draw() { - int playSound = 0; // How many sounds do we play on this frame? - int which = -1; // If so, on which voice? - noStroke(); - fill(0, 15); - rect(0, 0, width, height); // Fade background - stroke(102); - line(width / 2, 0, width / 2, height); // Center line - float interp = lerp(0, width, (mySound[0].pan + 1) / 2.0); - stroke(255); - line(interp, 0, interp, height); // Moving line -// Trigger 1-3 samples when the line passes the center line or hits an edge - if ((mySound[0].pan < 0) && (middle == true)) { - playSound = int(random(1, 3)); - middle = false; - } else if ((mySound[0].pan > 0) && (middle == false)) { - playSound = int(random(1, 3)); - middle = true; - } else if ((mySound[0].pan < -0.9) && (left == true)) { - playSound = int(random(1, 3)); - left = false; - } else if ((mySound[0].pan > -0.9) && (left == false)) { - left = true; - } else if ((mySound[0].pan > 0.9) && (right == true)) { - playSound = int(random(1, 3)); - right = false; - } else if ((mySound[0].pan < 0.9) && (right == false)) { - right = true; - } -// Voice allocation block, figure out which AudioChannels are free - while (playSound > 0) { - for (int i = 0; i < mySound.length; i++) { - if (mySound[i].state == Ess.STOPPED) { - which = i; // Find a free voice - } - } -// If a voice is available and selected, play it - if (which != -1) { - mySound[which].sampleRate(rates[int(random(0,6))], false); - mySound[which].play(); - myEnvelope.filter(mySound[which]); // Apply envelope - } - playSound--; - } -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} - -void audioOutputPan(AudioOutput c) { - c.panTo(-c.pan, 4000); // Reverse pan direction -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif deleted file mode 100755 index bf5693586..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_03/data/cela3.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde deleted file mode 100755 index 9eb3ae08d..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/Ex_04.pde +++ /dev/null @@ -1,51 +0,0 @@ -/** -Applies reverb 10 times to a succession of guitar chords. -Inspired by Alvin Lucier's "I am Sitting in a Room." -Based on Reverb by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel myChannel; -Reverb myReverb; -Normalize myNormalize; -int numRepeats = 9; -int repeats = 0; -float rectWidth; - -void setup() { - size(256, 200); - noStroke(); - background(0); - rectWidth = width / (numRepeats + 1.0); - Ess.start(this); // Start Ess -// Load audio file into a AudioChannel, file must be in the sketch's "data" folder - myChannel = new AudioChannel("guitar.aif"); - myReverb = new Reverb(); - myNormalize = new Normalize(); - myNormalize.filter(myChannel); // Normalize the audio - myChannel.play(1); -} - -void draw() { - if (repeats < numRepeats) { - if (myChannel.state == Ess.STOPPED) { // If the audio isn't playing - myChannel.adjustChannel(myChannel.size / 16, Ess.END); - myChannel.out(myChannel.size); -// Apply reverberation "in place" to the audio in the channel - myReverb.filter(myChannel); -// Normalize the signal - myNormalize.filter(myChannel); - myChannel.play(1); - repeats++; - } - } else { - exit(); // Quit the program - } -// Draw rectangle to show the current repeat (1 of 9) - rect(rectWidth * repeats, 0, rectWidth - 1, height); -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif deleted file mode 100755 index e9a55c5b1..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_04/data/guitar.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde deleted file mode 100755 index 9ead96051..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/Ex_05.pde +++ /dev/null @@ -1,43 +0,0 @@ -/** -Analyzes a sound file using a Fast Fourier Transform, and plots both the current -spectral frame and a "peak-hold" plot of the maximum over time using logarithmic -scaling. Based on examples by Krister Olsson -*/ -import krister.Ess.*; - -AudioChannel myChannel; -FFT myFFT; -int bands = 256; // Number of FFT frequency bands to calculate - -void setup() { - size(1024, 200); - Ess.start(this); // Start Ess -// Load "test.aif" into a new AudioChannel, file must be in the "data" folder - myChannel = new AudioChannel("test.aif"); - myChannel.play(Ess.FOREVER); - myFFT = new FFT(bands * 2); // We want 256 frequency bands, so we pass in 512 -} - -void draw() { - background(176); -// Get spectrum - myFFT.getSpectrum(myChannel); -// Draw FFT data - stroke(255); - for (int i = 0; i < bands; i++) { - float x = width - pow(1024, (255.0 - i) / bands); - float maxY = max(0, myFFT.maxSpectrum[i] * height * 2); - float freY = max(0, myFFT.spectrum[i] * height * 2); -// Draw maximum lines - stroke(255); - line(x, height, x, height - maxY); -// Draw frequency lines - stroke(0); - line(x, height, x, height - freY); - } -} - -public void stop() { - Ess.stop(); // When program stops, stop Ess too - super.stop(); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif b/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif deleted file mode 100755 index c119326a7..000000000 Binary files a/java/examples/Books/Processing Handbook/Extensions/Sound/Ex_05/data/test.aif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde deleted file mode 100755 index c196d9c34..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_01/Ex_01.pde +++ /dev/null @@ -1,54 +0,0 @@ -// Quantify the amount of movement in the video frame using frame-differencing -import processing.video.*; - -int numPixels; -int[] previousFrame; -Capture video; -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - // Create an array to store the previously captured frame - previousFrame = new int[numPixels]; -} - -void draw() { - if (video.available()) { - // When using video to manipulate the screen, use video.available() and - // video.read() inside the draw() method so that it's safe to draw to the screen - video.read(); // Read the new frame from the camera - video.loadPixels(); // Make its pixels[] array available - int movementSum = 0; // Amount of movement in the frame - loadPixels(); - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - color currColor = video.pixels[i]; - color prevColor = previousFrame[i]; - // Extract the red, green, and blue components from current pixel - int currR = (currColor >> 16) & 0xFF; // Like red(), but faster (see p. 673) - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract red, green, and blue components from previous pixel - int prevR = (prevColor >> 16) & 0xFF; - int prevG = (prevColor >> 8) & 0xFF; - int prevB = prevColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - prevR); - int diffG = abs(currG - prevG); - int diffB = abs(currB - prevB); - // Add these differences to the running tally - movementSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line is much faster, but more confusing to read - //pixels[i] = 0xff000000 | (diffR << 16) | (diffG << 8) | diffB; - // Save the current color into the 'previous' buffer - previousFrame[i] = currColor; - } - // To prevent flicker from frames that are all black (no movement), - // only update the screen if the image has changed. - if (movementSum > 0) { - updatePixels(); - println(movementSum); // Print the total amount of movement to the console - } - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde deleted file mode 100755 index e5650ef35..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_02/Ex_02.pde +++ /dev/null @@ -1,59 +0,0 @@ -// Detect the presence of people and objects in the frame using a simple -// background-subtraction technique. To initialize the background, press a key. -import processing.video.*; - -int numPixels; -int[] backgroundPixels; -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - // Create array to store the background image - backgroundPixels = new int[numPixels]; - // Make the pixels[] array available for direct manipulation - loadPixels(); -} - -void draw() { - if (video.available()) { - video.read(); // Read a new video frame - video.loadPixels(); // Make the pixels of video available - // Difference between the current frame and the stored background - int presenceSum = 0; - for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame... - // Fetch the current color in that location, and also the color - // of the background in that spot - color currColor = video.pixels[i]; - color bkgdColor = backgroundPixels[i]; - // Extract the red, green, and blue components of the current pixels color - int currR = (currColor >> 16) & 0xFF; - int currG = (currColor >> 8) & 0xFF; - int currB = currColor & 0xFF; - // Extract the red, green, and blue components of the background pixels color - int bkgdR = (bkgdColor >> 16) & 0xFF; - int bkgdG = (bkgdColor >> 8) & 0xFF; - int bkgdB = bkgdColor & 0xFF; - // Compute the difference of the red, green, and blue values - int diffR = abs(currR - bkgdR); - int diffG = abs(currG - bkgdG); - int diffB = abs(currB - bkgdB); - // Add these differences to the running tally - presenceSum += diffR + diffG + diffB; - // Render the difference image to the screen - pixels[i] = color(diffR, diffG, diffB); - // The following line does the same thing much faster, but is more technical - //pixels[i] = 0xFF000000 | (diffR << 16) | (diffG << 8) | diffB; - } - updatePixels(); // Notify that the pixels[] array has changed - println(presenceSum); // Print out the total amount of movement - } -} - -// When a key is pressed, capture the background image into the backgroundPixels -// buffer, by copying each of the current frames pixels into it. -void keyPressed() { - video.loadPixels(); - arraycopy(video.pixels, backgroundPixels); -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde deleted file mode 100755 index 5a0646e02..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_03/Ex_03.pde +++ /dev/null @@ -1,49 +0,0 @@ -// Determines whether a test location (such as the cursor) is contained within -// the silhouette of a dark object -import processing.video.*; - -color black = color(0); -color white = color(255); -int numPixels; -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - strokeWeight(5); - video = new Capture(this, width, height, 24); - numPixels = video.width * video.height; - noCursor(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - video.loadPixels(); - int threshold = 127; // Set the threshold value - float pixelBrightness; // Declare variable to store a pixel's color - // Turn each pixel in the video frame black or white depending on its brightness - loadPixels(); - for (int i = 0; i < numPixels; i++) { - pixelBrightness = brightness(video.pixels[i]); - if (pixelBrightness > threshold) { // If the pixel is brighter than the - pixels[i] = white; // threshold value, make it white - } - else { // Otherwise, - pixels[i] = black; // make it black - } - } - updatePixels(); - // Test a location to see where it is contained. Fetch the pixel at the test - // location (the cursor), and compute its brightness - int testValue = get(mouseX, mouseY); - float testBrightness = brightness(testValue); - if (testBrightness > threshold) { // If the test location is brighter than - fill(black); // the threshold set the fill to black - } - else { // Otherwise, - fill(white); // set the fill to white - } - ellipse(mouseX, mouseY, 20, 20); - } -} diff --git a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde deleted file mode 100755 index 3d3d3d3ca..000000000 --- a/java/examples/Books/Processing Handbook/Extensions/Vision/Ex_04/Ex_04.pde +++ /dev/null @@ -1,44 +0,0 @@ -// Tracks the brightest pixel in a live video signal -import processing.video.*; - -Capture video; - -void setup() { - size(640, 480); // Change size to 320 x 240 if too slow at 640 x 480 - video = new Capture(this, width, height, 30); - noStroke(); - smooth(); -} - -void draw() { - if (video.available()) { - video.read(); - image(video, 0, 0, width, height); // Draw the webcam video onto the screen - int brightestX = 0; // X-coordinate of the brightest video pixel - int brightestY = 0; // Y-coordinate of the brightest video pixel - float brightestValue = 0; // Brightness of the brightest video pixel - // Search for the brightest pixel: For each row of pixels in the video image and - // for each pixel in the yth row, compute each pixel's index in the video - video.loadPixels(); - int index = 0; - for (int y = 0; y < video.height; y++) { - for (int x = 0; x < video.width; x++) { - // Get the color stored in the pixel - int pixelValue = video.pixels[index]; - // Determine the brightness of the pixel - float pixelBrightness = brightness(pixelValue); - // If that value is brighter than any previous, then store the - // brightness of that pixel, as well as its (x,y) location - if (pixelBrightness > brightestValue) { - brightestValue = pixelBrightness; - brightestY = y; - brightestX = x; - } - index++; - } - } - // Draw a large, yellow circle at the brightest pixel - fill(255, 204, 0, 128); - ellipse(brightestX, brightestY, 200, 200); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde b/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde deleted file mode 100644 index d1dd79b7c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_022/page_022.pde +++ /dev/null @@ -1,32 +0,0 @@ - -// Based on code from Shape 1 (p. 23) and code 6-07 (p. 65) - - -size(713, 938); -//size(713, 938, PDF, "page_022.pdf"); -background(255); -int ydiv = height/54; - -strokeWeight(0.25); -noStroke(); -fill(0); -rectMode(CENTER); - -for (int y = 0; y < height; y += ydiv) { - for (int x = 0; x < width; x += ydiv) { - ellipse(x, y, 0.5, 0.5); - } -} - -float s = ydiv * 10; -float x = ydiv * 28; - -ellipse(x, ydiv * 12, s, s); -rect(x, ydiv*26, ydiv*12, ydiv*12); -fill(255); -ellipse(x, ydiv*26, s, s); - -fill(0); -ellipse(x, ydiv*40, s*1.07, s*1.07); -fill(255); -rect(x, ydiv*40, s*.7, s*.7); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde b/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde deleted file mode 100644 index a004e2571..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_042/page_042.pde +++ /dev/null @@ -1,35 +0,0 @@ - -// Based on code 4-02 (p. 44) and code 6-01 (p. 63) - - -size(442, 550); -//size(442, 550, PDF, "page_042.pdf"); -background(255); -strokeWeight(0.25); -strokeCap(SQUARE); - -float x1 = 0; -float x2 = 0; -float x3 = 0; -float x5 = 0; -float x4 = 0; - -for(int i = 0; i <= 50; i++) { - - line(width-x2, height * 0.0, width-x2, height * 0.2); - x2 += 4.5; - - line(width-x1, height * 0.2, width-x1, height * 0.4); - x1 += 9; - - line(width-x3, height * 0.4, width-x3, height * 0.6); - x3 += 6.25; - - line(width-x5, height * 0.6, width-x5, height * 0.8); - x5 += 3.125; - - line(width-x4, height * 0.8, width-x4, height); - x4 += 5.375; - -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde b/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde deleted file mode 100644 index 6f3bbdabc..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_060/page_060.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on the code examples on page 66 - - -size(180, 666); -//size(180, 666, PDF, "page_060.pdf"); -background(255); -strokeWeight(0.25); -strokeCap(SQUARE); - -for (int y = 0; y <= height; y += 5) { - for (int x = 0; x <= width; x += 5) { - if (x % 20 == 0) { - line(x, y, x-3, y-3); - } - else { - line(x, y, x-3, y+3); - } - } -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde b/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde deleted file mode 100644 index ab58fb65c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_078/page_078.pde +++ /dev/null @@ -1,28 +0,0 @@ - -// Based on code 8-08 (p. 83) - - -size(360, 550); -//size(360, 550, PDF, "page_078.pdf"); -background(255); -stroke(0); -noFill(); - -float ax = 0.0; -float ay = 0.0; - -for (float e = 2; e < 36; e += 1.0) { - for (int x = 0; x < width; x += 2) { - float n = norm(x, 0.0, width); // Range 0.0 to 1.0 - float y = 1 - pow(n, e); // Calculate curve - y *= height; // Range 0.0 to height - if (x > 0) { - line(ax, ay, x, y); - } - ax = x; - ay = y; - } -} - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde b/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde deleted file mode 100644 index 8ef404ee6..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_094/page_094.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on code 10-07 (p. 98) and code 35-03 (p. 322) - - -size(2400, 1200); -background(255); -noStroke(); -fill(0); - -PImage img = loadImage("rockies-color.jpg"); - -for(int i = 0; i < width; i += 50) { - int x = int(random(img.width-50)); - PImage crop = img.get(x, 0, 50, height); - image(crop, i, 0); -} - -//saveFrame("page_094.tif"); - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde b/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde deleted file mode 100755 index 811e6a192..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_100/page_100.pde +++ /dev/null @@ -1,45 +0,0 @@ - -// Based on code 11-04 (p. 103) and code 13-01 (p. 113) - - -//size(360, 666, PDF, "page_100.pdf"); -size(360, 666); -background(255); - -println(PFont.list()); // List the available fonts -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -textFont(font); - -fill(204); - -int a = 37; - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 50, i); - textSize(10); - text(a, 10, i-9); - a++; -} - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 170, i); - textSize(10); - text(a, 130, i-9); - a++; -} - -for (int i = 20; i < height+40; i += 38) { - textSize(34); - text(char(a), 290, i); - textSize(10); - text(a, 250, i-9); - a++; -} - - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde b/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde deleted file mode 100755 index 10f5d1489..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_110/page_110.pde +++ /dev/null @@ -1,32 +0,0 @@ - -// Based on code 13-05 (p. 113) - - -size(360, 550); -//size(360, 550, PDF, "page_110.pdf"); -background(255); - -println(PFont.list()); // List the available fonts -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -//PFont font = createFont("ZigguratHTFBlack", 34); -textFont(font); - -textAlign(CENTER); - -fill(0, 50); // Black with low opacity - -textSize(460); - -for(int i=0; i<6; i++) { - text(i, width/2, height*0.98 - i*40); -} - - -/* -text("1", width/2, height*.9); -text("2", width/2, height*.9); -text("3", width/2, height*.9); -text("4", width/2, height*.9); -text("5", width/2, height*.9); -*/ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde b/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde deleted file mode 100755 index adf977af3..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_126/page_126.pde +++ /dev/null @@ -1,21 +0,0 @@ - -// Based on code 15-09 (p. 131) - - -size(750, 2775); - -float xnoise = 0.0; -float ynoise = 0.0; -float inc = 0.005; -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float gray = noise(xnoise, ynoise) * 255; - stroke(gray); - point(x, y); - xnoise = xnoise + inc; - } - xnoise = 0; - ynoise = ynoise + inc; -} - -//saveFrame("page_126.tif"); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde b/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde deleted file mode 100755 index 791f1c8a1..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_136/page_136.pde +++ /dev/null @@ -1,17 +0,0 @@ - -// Based on code 17-14 (p. 142) - - -size(360, 550); -//size(360, 550, PDF, "page_136.pdf"); -background(255); - -smooth(); -noStroke(); -fill(0, 10); - -translate(33, 66); // Set initial offset -for (int i = 0; i < 45; i++) { // 12 repetitions - scale(1.02); // Accumulate the scaling - ellipse(25, 90, 200, 200); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde b/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde deleted file mode 100755 index 6edb06bbd..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_144/page_144.pde +++ /dev/null @@ -1,23 +0,0 @@ - -// Based on code 14-11 (p. 123) - - -size(440, 666); -//size(440, 666, PDF, "page_144.pdf"); -background(255); -stroke(0); -strokeWeight(0.25); -fill(0); - -float scaleVal = 16.0; -float angleInc = PI/24.0; -float angle = 0.0; - -for (int offset = 20; offset < width-20; offset += 5) { - for (int y = 0; y <= height; y += 2) { - float x = offset + (sin(angle) * scaleVal); - line(x, y, x+0.125, y+0.125); - angle += angleInc; - } - angle += PI; -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db b/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db deleted file mode 100755 index 64650786a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_148/data/Thumbs.db and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde b/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde deleted file mode 100755 index 751477073..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_148/page_148.pde +++ /dev/null @@ -1,304 +0,0 @@ - -// Based on the Collage Engine code on page 150 - - -PImage nyt01 = loadImage("nyt_01.jpg"); -PImage nyt02 = loadImage("nyt_02.jpg"); -PImage nyt03 = loadImage("nyt_03.jpg"); -PImage nyt04 = loadImage("nyt_04.jpg"); -PImage nyt05 = loadImage("nyt_05.jpg"); -PImage nyt06 = loadImage("nyt_06.jpg"); -PImage nyt07 = loadImage("nyt_07.jpg"); -PImage nyt08 = loadImage("nyt_08.jpg"); -PImage nyt09 = loadImage("nyt_09.jpg"); -PImage nyt10 = loadImage("nyt_10.jpg"); -PImage nyt11 = loadImage("nyt_11.jpg"); -PImage nyt12 = loadImage("nyt_12.jpg"); -PImage nyt13 = loadImage("nyt_13.jpg"); -PImage nyt14 = loadImage("nyt_14.jpg"); -PImage nyt15 = loadImage("nyt_15.jpg"); -PImage nyt16 = loadImage("nyt_16.jpg"); -PImage nyt17 = loadImage("nyt_17.jpg"); -PImage nyt18 = loadImage("nyt_18.jpg"); -PImage nyt19 = loadImage("nyt_19.jpg"); -PImage nyt20 = loadImage("nyt_20.jpg"); -PImage nyt21 = loadImage("nyt_21.jpg"); -PImage nyt22 = loadImage("nyt_22.jpg"); -PImage nyt23 = loadImage("nyt_23.jpg"); -PImage nyt24 = loadImage("nyt_24.jpg"); -PImage nyt25 = loadImage("nyt_25.jpg"); -PImage nyt26 = loadImage("nyt_26.jpg"); -PImage nyt27 = loadImage("nyt_27.jpg"); -PImage nyt28 = loadImage("nyt_28.jpg"); -PImage nyt29 = loadImage("nyt_29.jpg"); - -float x, y, r; - -size(750, 2275); -smooth(); -background(255); -tint(255, 204); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt02, -nyt02.width/2, -nyt02.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt03, -nyt03.width/2, -nyt03.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt04, -nyt04.width/2, -nyt04.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt05, -nyt05.width/2, -nyt05.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt06, -nyt06.width/2, -nyt06.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt07, -nyt07.width/2, -nyt07.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt08, -nyt08.width/2, -nyt08.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt09, -nyt09.width/2, -nyt09.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt10, -nyt10.width/2, -nyt10.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt11, -nyt11.width/2, -nyt11.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt12, -nyt12.width/2, -nyt12.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt13, -nyt13.width/2, -nyt13.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt14, -nyt14.width/2, -nyt14.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt15, -nyt15.width/2, -nyt15.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt16, -nyt16.width/2, -nyt16.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt17, -nyt17.width/2, -nyt17.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt18, -nyt18.width/2, -nyt18.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt19, -nyt19.width/2, -nyt19.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt20, -nyt20.width/2, -nyt20.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt21, -nyt21.width/2, -nyt21.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt22, -nyt22.width/2, -nyt22.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt23, -nyt23.width/2, -nyt23.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt24, -nyt24.width/2, -nyt24.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt25, -nyt25.width/2, -nyt25.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt26, -nyt26.width/2, -nyt26.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt27, -nyt27.width/2, -nyt27.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt28, -nyt28.width/2, -nyt28.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt29, -nyt29.width/2, -nyt29.height/2); -popMatrix(); - - -//saveFrame("page-148--" + int(random(0, 1000)) + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde b/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde deleted file mode 100755 index 862324f2f..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_172/page_172.pde +++ /dev/null @@ -1,48 +0,0 @@ - -// Based on code 21-14 (p. 192) - - -void setup() { - size(200, 666); - //size(200, 666, PDF, "page_172.pdf"); - background(255); - smooth(); - noStroke(); - noLoop(); - fill(100); - randomSeed(0); - strokeWeight(0.25); -} - -void draw() { - for(int i=0; i<12; i++) { - vine(10+int(random(width-20)), int(random(10, 50)), int(random(2, 6))); - } - //exit(); -} - -void vine(int x, int numLeaves, int leafSize ) { - stroke(0); - line(x, 0, x, height); - noStroke(); - int gap = (height)/numLeaves; - int direction = 1; - for (int i = 0; i < numLeaves; i++) { - int r = int(random(gap)); - leaf( x, gap*i + r, leafSize, direction); - direction = direction * -1; - } -} - -void leaf(int x, int y, int size, int d) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*d, -0.7); - bezierVertex(1.0*d, -0.7, 0.4*d, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*d, 0.4, 1.0*d, -0.7); - endShape(); - popMatrix(); -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde b/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde deleted file mode 100755 index dff651a1b..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_216/page_216.pde +++ /dev/null @@ -1,25 +0,0 @@ - -// Based on code 24-08 (p. 221) - - -PImage lineImage; -int x; - -void setup() { - size(750/2, 2292/2); - background(255); - lineImage = loadImage("paris-line.jpg"); -} - -void draw() { - if(mousePressed) { - x = mouseX; - } - - image(lineImage, x-lineImage.width/2, mouseY); - image(lineImage, x-lineImage.width/2, height-mouseY); -} - -void keyPressed() { - saveFrame("page-216-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde b/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde deleted file mode 100755 index 797fd2b64..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_222/page_222.pde +++ /dev/null @@ -1,52 +0,0 @@ - -// Based on code 13-01 (p. 113) and code 33-11 (p. 305) - - -size(460, 225); -//size(460, 225, PDF, "page_222.pdf"); -background(255); -fill(204); - -println(PFont.list()); // Select a font from this list -String s = "Ziggurat-HTF-Black"; -PFont font = createFont(s, 34); -textFont(font); - -char[] c1 = {'1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '='}; -char[] c2 = {'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '[', ']'}; -char[] c3 = {'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';'}; -char[] c4 = {'Z', 'X', 'C', 'V', 'B', 'N', 'M', ',', '.', '/'}; - -textAlign(CENTER); -textSize(50); -stroke(204); - -strokeWeight(0.5); - -for (int i = 0; i < c1.length; i++) { - text(c1[i], 20+i*78, 50); - if(i%2 != 0) { - line(20+i*39, 40, 20+i*39, 20); - } -} - -for (int i = 0; i < c2.length; i++) { - text(c2[i], 46+i*78, 105); - if(i%2 != 0) { - line(46+i*39, 95, 46+i*39, 75); - } -} - -for (int i = 0; i < c3.length; i++) { - text(c3[i], 65+i*78, 160); - if(i%2 != 0) { - line(65+i*39, 150, 65+i*39, 130); - } -} - -for (int i = 0; i < c4.length; i++) { - text(c4[i], 90+i*78, 215); - if(i%2 != 0) { - line(90+i*39, 205, 90+i*39, 185); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde b/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde deleted file mode 100755 index e7c782ebd..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_228/page_228.pde +++ /dev/null @@ -1,46 +0,0 @@ - -// Based on code 26-04 (p. 231) - -import processing.pdf.*; - -int dragX, dragY, moveX, moveY; -boolean record = false; - -void setup() { - size(360, 666); -} - -void draw() { - if (record) { - beginRecord(PDF, "page_228.pdf"); - } - - background(255); - noFill(); - stroke(0); - ellipse(dragX, dragY, 200, 200); // Black circle - fill(153); - noStroke(); - ellipse(moveX, moveY, 200, 200); // Gray circle - - if (record) { - endRecord(); - record = false; - } - -} - -void mouseMoved() { // Move gray circle - moveX = mouseX; - moveY = mouseY; -} - -void mouseDragged() { // Move black circle - dragX = mouseX; - dragY = mouseY; -} - -void keyReleased() { - record = true; -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde b/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde deleted file mode 100755 index b4a270f54..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_250/page_250.pde +++ /dev/null @@ -1,40 +0,0 @@ - -size(442, 500); -//size(442, 500, PDF, "page_250.pdf"); -background(255); -fill(0); - -println(PFont.list()); -String s = "TheSansMono Light Italic"; -PFont font = createFont(s, 24); -textFont(font); - -String s1 = "void draw() {"; -String s2 = " background(126);"; -String s3 = " ellipse(mouseX, mouseY, 33, 33);"; -String s4 = "}"; - -String s5 = "void Draw() ("; -String s6 = " background(126)"; -String s7 = " ellipse(mouseX. mousey, 33, 33);"; -String s8 = "}"; - -textAlign(LEFT); -textSize(26); -stroke(204); - -text(s5, 0, 30); -text(s6, 0, 70); -text(s7, 0, 110); -text(s8, 0, 150); - -text(s1, 0, 250); -text(s2, 0, 290); -text(s3, 0, 320); -text(s4, 0, 370); - - - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde b/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde deleted file mode 100755 index 3fdfe638c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_254/page_254.pde +++ /dev/null @@ -1,108 +0,0 @@ - -// Based on the Cursor example on page 257 - - -import processing.pdf.*; - -boolean record = false; - -int gx, gy; -int mode, nextmode; -int nummodes; -boolean forapplet = false; - -float mx, my, lastmx, lastmy; -float lastrot, lastsc; - -float bgx, bgy; - -float p_x, p_y; -float p_fx, p_fy; -float p_v2, p_vx, p_vy; -float p_a2, p_ax, p_ay; -float p_mass, p_drag; - -void setup() { - size(442, 550); - gx = width; - gy = height; - colorMode(RGB, 1.0); - strokeWeight(0.5); - strokeJoin(ROUND); - - nummodes = 4; - mode = 4; - - bgx = 0; - bgy = 0; - mx = gx/2; - my = gy/2; -} - - -void draw() { - - if(record) { - beginRecord(PDF, "page_254.pdf"); // Start writing to PDF - } - - lastmx = mx; - lastmy = my; - - mx = mouseX; - my = mouseY; - - background(1.0); - - // Grid - fill(1,1,1); - stroke(.2,.2,.2); - - float rot; - for (int i=16; i width-radius) || (x < radius)) { - directionX = -directionX; // Change direction - } - y += speedY * directionY; - if ((y > height-radius) || (y < radius)) { - directionY = -directionY; // Change direction - } - } - -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde b/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde deleted file mode 100755 index 1234f6316..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_290/page_290.pde +++ /dev/null @@ -1,60 +0,0 @@ - -// Based on code 32-07 (p. 297) - -import processing.pdf.*; - -float inc = 0.0; - -boolean record = false; - -void setup() { - size(513, 462); - smooth(); -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_290.pdf"); - } - - stroke(0, 143); - randomSeed(0); - background(255); - inc += 0.01; - float angle = sin(inc)/10.0 + sin(inc*1.2)/20.0; - //tail(18, 9, angle/1.3); - //tail(33, 12, angle); - //tail(44, 10, angle/1.3); - //tail(62, 5, angle); - //tail(88, 7, angle*2); - for(int i=-20; i 0; i--) { - strokeWeight(i/2.0); - line(0, 0, 0, -8); - translate(0.0, -8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde b/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde deleted file mode 100755 index f223d90e7..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_300/page_300.pde +++ /dev/null @@ -1,76 +0,0 @@ - -// Based on code 33-14 (p. 307) - -import processing.pdf.*; - -float inc = 0.0; - -boolean record = false; - -int numLines = 170; -float[] y; -float[] x; - -float mx; -float my; - -void setup() { - size(180, 666); - smooth(); - noFill(); - strokeWeight(0.25); - y = new float[height]; - x = new float[height]; - -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_300.pdf"); - } - - background(255); - - // Shift the values to the right - for (int i = y.length-1; i > 0; i--) { - y[i] = y[i-1]; - } - // Add new values to the beginning - my += (mouseX-my) * 0.1; - y[0] = my; - - beginShape(); - for (int i = 1; i < y.length; i++) { - vertex(y[i], i); - } - endShape(); - - // Shift the values to the right - for (int i = x.length-1; i > 0; i--) { - x[i] = x[i-1]; - } - // Add new values to the beginning - mx += (mouseY-mx) * 0.1; - x[0] = mx; - - - beginShape(); - for (int i = 1; i < x.length; i++) { - vertex(x[i] * float(width)/height, i); - } - endShape(); - - if(record) { - endRecord(); - record = false; - } - -} - -void mousePressed() { - record = true; -} - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif deleted file mode 100755 index 1a9893ad2..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif deleted file mode 100755 index 1a9893ad2..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif deleted file mode 100755 index c53edb943..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif deleted file mode 100755 index b9c4fc675..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif deleted file mode 100755 index b43d0b308..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif deleted file mode 100755 index 36f373249..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif deleted file mode 100755 index b4c6ab5e6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif deleted file mode 100755 index a53c6abc7..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif deleted file mode 100755 index 1ce59b9a6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif deleted file mode 100755 index 557bedf8e..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif deleted file mode 100755 index 31fd776e4..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif deleted file mode 100755 index a69083697..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif deleted file mode 100755 index fe81e42ac..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0012.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif deleted file mode 100755 index c8ede5df6..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0013.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif deleted file mode 100755 index 1f1413761..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0014.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif deleted file mode 100755 index de472dfe7..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0015.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif deleted file mode 100755 index 5bc583f0a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0016.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif deleted file mode 100755 index 8ff438690..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0017.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif deleted file mode 100755 index 0b99e3727..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0018.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif deleted file mode 100755 index 7a9217ad3..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0019.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif deleted file mode 100755 index fe8fdae31..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0020.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif deleted file mode 100755 index ab36afe0d..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0021.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif deleted file mode 100755 index 98dc00b57..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0022.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif deleted file mode 100755 index a3dd7f38c..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0023.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif deleted file mode 100755 index f8287855a..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0024.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif deleted file mode 100755 index 0107f470c..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0025.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif deleted file mode 100755 index e05a13944..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0026.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif deleted file mode 100755 index decdebe59..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0027.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif deleted file mode 100755 index ec2bae766..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0028.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif deleted file mode 100755 index 67d14b168..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0029.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif deleted file mode 100755 index 619c30c94..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0030.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif deleted file mode 100755 index aae6bfbf3..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0031.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif deleted file mode 100755 index 7cdd3561b..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0032.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif deleted file mode 100755 index 97fc08480..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0033.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif deleted file mode 100755 index 85e71dd53..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0034.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif deleted file mode 100755 index 752393673..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0035.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif deleted file mode 100755 index 92bf1c3da..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0036.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif b/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif deleted file mode 100755 index 397590e38..000000000 Binary files a/java/examples/Books/Processing Handbook/Illustrations/page_314/data/PT_Shifty_0037.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde b/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde deleted file mode 100755 index 262e8e167..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_314/page_314.pde +++ /dev/null @@ -1,61 +0,0 @@ - -// Based on code 34-05 (p. 319) - - -int numFrames = 37; // The number of frames in the animation -PImage[] images = new PImage[numFrames]; -int which = 0; - -void setup() { - size(200*11, 200); - for (int i = 0; i < images.length; i++) { - String imageName = "PT_Shifty_" + nf(i, 4) + ".gif"; - images[i] = loadImage(imageName); - } - noLoop(); -} - - -void draw() { - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-1.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-2.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-3.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-4.tif"); - - background(255); - - for(int i=0; i < 11; i++) { - image(images[which], i*200, 0); - which = (which+1)%images.length; - } - save("page_314-5.tif"); - -} - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde b/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde deleted file mode 100755 index efbbbfa1b..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_326/page_326.pde +++ /dev/null @@ -1,99 +0,0 @@ - -// Based on code 36-07 (p. 331) - -import processing.pdf.*; - -PFont f; -String s = "012345678901234567890123456789"; -float angle = 0.0; - -boolean record = false; - -void setup() { - size(842, 550); - println(PFont.list()); // Select a font from this list - String s = "TheSansMono-ExtraLightItalic-48"; - f = createFont(s, 24); - textFont(f); - fill(204); -} - -void draw() { - - if(record) { - beginRecord(PDF, "page_326.pdf"); - } - - textFont(f); - background(255); - translate(10, 0); - angle += 0.1; - - float cw = 0; - //for (int i = 0; i < s.length(); i++) { - for (int i = 0; i < s.length(); i++) { - float c = sin(angle + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 60); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 120); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 180); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+QUARTER_PI+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 240); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 300); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI+QUARTER_PI/2) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 360); - cw += textWidth(s.charAt(i)) * 1.2; - } - - cw = 0; - for (int i = 0; i < s.length(); i++) { - float c = sin((angle+HALF_PI+QUARTER_PI) + i/PI); - textSize((c + 1.0) * 18 + 6); - text(s.charAt(i), cw, 420); - cw += textWidth(s.charAt(i)) * 1.2; - } - - if(record) { - endRecord(); - record = false; - } - -} - - -void keyPressed() { - record = true; -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde b/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde deleted file mode 100755 index a642b5c4c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_346/page_346.pde +++ /dev/null @@ -1,19 +0,0 @@ - -// Based on code 39-03 (p. 349) - - -size(750, 2775); -background(255); -smooth(); -strokeWeight(1.0); - -for(int i = 20; i < height-50; i += 50) { - filter(BLUR, 1); - line(0, i, width, i+20); -} - -saveFrame("page_346.tif"); - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde b/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde deleted file mode 100755 index 763a1cd2c..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_366/page_366.pde +++ /dev/null @@ -1,37 +0,0 @@ - -// Based on code 32-04 (p. 294) - - -float angle = 0.0; // Changing angle -float speed = 0.2; // Speed of growth - -void setup() { - size(200*11, 200*10); - noStroke(); - smooth(); - fill(0, 60); -} - -void draw() { - background(255); - - for(int y = 0; y < 10; y++) { - for(int i = 0; i < 11; i++) { - pushMatrix(); - translate(i*200, y*220); - circlePhase(0.0); - circlePhase(QUARTER_PI); - circlePhase(HALF_PI); - angle += speed; - popMatrix(); - } - - } - save("page_366.tif"); - exit(); -} - -void circlePhase(float phase) { - float diameter = 65 + (sin(angle + phase) * 130); - ellipse(100, 100, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde b/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde deleted file mode 100755 index 23f66b34e..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_394/page_394.pde +++ /dev/null @@ -1,81 +0,0 @@ - -// Based on code 43-02 (p. 409) - -import processing.pdf.*; - -Ring[] rings; // Declare the array -int numRings = 50; -int currentRing = 0; - -boolean record = false; - -void setup() { - size(513, 666); - smooth(); - rings = new Ring[numRings]; // Construct the array - for (int i = 0; i < numRings; i++) { - rings[i] = new Ring(); // Construct each object - } -} - -void draw() { - if(record) { - beginRecord(PDF, "page_394-alt.pdf"); - } - - background(255); - for (int i = 0; i < numRings; i++) { - rings[i].grow(); - rings[i].display(); - } - - if(record) { - endRecord(); - record = false; - } - -} - -void keyPressed() { - record = true; -} - -// Click to create a new Ring -void mousePressed() { - rings[currentRing].start(mouseX, mouseY); - currentRing++; - if (currentRing >= numRings) { - currentRing = 0; - } -} - -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > height*2) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(1); - stroke(102, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde b/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde deleted file mode 100755 index 53b974596..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_412/page_412.pde +++ /dev/null @@ -1,29 +0,0 @@ - -// Based on code 44-01 (p. 414) - - -void setup() { - size(400, 666); - smooth(); -} - -void draw() { - if(mouseX != 0 && mouseY != 0 && pmouseX !=0 && pmouseY != 0) { - float s = dist(mouseX, mouseY, pmouseX, pmouseY) + 1; - noStroke(); - fill(0, 102); - ellipse(mouseX, mouseY, s, s); - stroke(255); - point(mouseX, mouseY); - } -} - -void mousePressed() { - beginRecord(PDF, "page_412.pdf"); - background(255); -} - -void mouseReleased() { - endRecord(); - exit(); -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde b/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde deleted file mode 100755 index ecdc57fd3..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_420/page_420.pde +++ /dev/null @@ -1,30 +0,0 @@ - -// Based on code 45-04 (p. 424) - -import processing.pdf.*; - -void setup() { - size(513, 666); -} - -void draw() { - if (mousePressed == true) { - point(mouseX, mouseY); - println("hi"); - } -} - -void mousePressed() { - beginRecord(PDF, "page_420.pdf"); - background(255); - stroke(0); - strokeCap(ROUND); -} - -void mouseReleased() { - endRecord(); -} - - - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde deleted file mode 100755 index d53213436..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/ArrowParticle.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(0); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0/shaftLength); - line(0, 0, .25, 0); - line(.25, 0, .174, -.075); - line(.25, 0, .174, .075); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde deleted file mode 100755 index ff23912c2..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // X-coordinate, y-coordinate - float vx, vy; // X velocity, y velocity - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde b/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde deleted file mode 100755 index f08f7efe8..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_476/page_476.pde +++ /dev/null @@ -1,45 +0,0 @@ - -// Based on code 50-12 (p. 486) -// Requires Particle, ArrowParticle classes - -import processing.pdf.*; - -int num = 900; -ArrowParticle[] p = new ArrowParticle[num]; -float radius = 1.2; - -boolean record = false; - -void setup() { - size(513, 666); - strokeWeight(0.25); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-1, 10); - float velY = random(-20, -6); - // Parameters: X, Y, X velocity, Y velocity, Radius - p[i] = new ArrowParticle(width/4, height, velX, velY, 0.4); - } -} - -void draw() { - if(record) { - beginRecord(PDF, "page_476-alt.pdf"); - } - background(255); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } - if(record) { - endRecord(); - record = false; - } -} - - -void mousePressed() { - record = true; -} - - diff --git a/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde b/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde deleted file mode 100755 index ed2b00bb4..000000000 --- a/java/examples/Books/Processing Handbook/Illustrations/page_xx/page_xx.pde +++ /dev/null @@ -1,44 +0,0 @@ - -// Based on code 22-11 (p. 204) - - -import processing.pdf.*; - -int x; // X-coordinate -int y; // Y-coordinate -int r = 350; // Starting radius -int n = 8; // Number of recursions -int rs = 12; // Random seed value - -void setup() { - size(250, 925); - //size(250, 925, PDF, "page_xx.pdf"); - noStroke(); - smooth(); - randomSeed(rs); - y = int (height * 0.33); - x = width/2; - noLoop(); -} - -void draw() { - background(255); - drawCircle(x, y, r, n); - exit(); -} - -void drawCircle(float x, float y, int radius, int num) { - float value = 126 * num / 6.0; - fill(value, 153); - ellipse(x, y, radius*2, radius*2); - if (num > 1) { - num = num - 1; - int branches = int(random(2, 6)); - for (int i = 0; i < branches; i++) { - float a = random(0, TWO_PI); - float newx = x + cos(a) * 6.0 * num; - float newy = y + sin(a) * 6.0 * num; - drawCircle(newx, newy+26, radius/2, num); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde deleted file mode 100644 index a1fa62960..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_01/Synthesis_01_collage_01.pde +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Synthesis 1: Form and Code, - * Collage Engine by Casey Reas (www.processing.org) - * p. 150 - * - * Step 1, working with one image. -*/ - -// Load the image -PImage nyt01 = loadImage("nyt_01.jpg"); - -float x, y; // Image position -float r; // Image rotation - -size(400, 300); -background(255); -tint(255, 204); - -x = random(width); // Set random x-coordinate -y = random(height); // Set random y-coordinate -r = random(0, TWO_PI); // Set random rotation -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde deleted file mode 100644 index ec63f26f2..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_01_collage_02/Synthesis_01_collage_02.pde +++ /dev/null @@ -1,313 +0,0 @@ -/** - * Synthesis 1: Form and Code, - * Collage Engine by Casey Reas (www.processing.org) - * p. 150 - * - * Step 2, working with many images. - * - * More advanced code structures such - * as functions, arrays, and objects can make - * this code shorter. -*/ - - -PImage nyt01 = loadImage("nyt_01.jpg"); -PImage nyt02 = loadImage("nyt_02.jpg"); -PImage nyt03 = loadImage("nyt_03.jpg"); -PImage nyt04 = loadImage("nyt_04.jpg"); -PImage nyt05 = loadImage("nyt_05.jpg"); -PImage nyt06 = loadImage("nyt_06.jpg"); -PImage nyt07 = loadImage("nyt_07.jpg"); -PImage nyt08 = loadImage("nyt_08.jpg"); -PImage nyt09 = loadImage("nyt_09.jpg"); -PImage nyt10 = loadImage("nyt_10.jpg"); -PImage nyt11 = loadImage("nyt_11.jpg"); -PImage nyt12 = loadImage("nyt_12.jpg"); -PImage nyt13 = loadImage("nyt_13.jpg"); -PImage nyt14 = loadImage("nyt_14.jpg"); -PImage nyt15 = loadImage("nyt_15.jpg"); -PImage nyt16 = loadImage("nyt_16.jpg"); -PImage nyt17 = loadImage("nyt_17.jpg"); -PImage nyt18 = loadImage("nyt_18.jpg"); -PImage nyt19 = loadImage("nyt_19.jpg"); -PImage nyt20 = loadImage("nyt_20.jpg"); -PImage nyt21 = loadImage("nyt_21.jpg"); -PImage nyt22 = loadImage("nyt_22.jpg"); -PImage nyt23 = loadImage("nyt_23.jpg"); -PImage nyt24 = loadImage("nyt_24.jpg"); -PImage nyt25 = loadImage("nyt_25.jpg"); -PImage nyt26 = loadImage("nyt_26.jpg"); -PImage nyt27 = loadImage("nyt_27.jpg"); -PImage nyt28 = loadImage("nyt_28.jpg"); -PImage nyt29 = loadImage("nyt_29.jpg"); - -float x, y, r; - -size(600, 600); -smooth(); -background(255); -tint(255, 204); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt01, -nyt01.width/2, -nyt01.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt02, -nyt02.width/2, -nyt02.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt03, -nyt03.width/2, -nyt03.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt04, -nyt04.width/2, -nyt04.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt05, -nyt05.width/2, -nyt05.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt06, -nyt06.width/2, -nyt06.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt07, -nyt07.width/2, -nyt07.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt08, -nyt08.width/2, -nyt08.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt09, -nyt09.width/2, -nyt09.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt10, -nyt10.width/2, -nyt10.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt11, -nyt11.width/2, -nyt11.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt12, -nyt12.width/2, -nyt12.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt13, -nyt13.width/2, -nyt13.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt14, -nyt14.width/2, -nyt14.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt15, -nyt15.width/2, -nyt15.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt16, -nyt16.width/2, -nyt16.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt17, -nyt17.width/2, -nyt17.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt18, -nyt18.width/2, -nyt18.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt19, -nyt19.width/2, -nyt19.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt20, -nyt20.width/2, -nyt20.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt21, -nyt21.width/2, -nyt21.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt22, -nyt22.width/2, -nyt22.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt23, -nyt23.width/2, -nyt23.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt24, -nyt24.width/2, -nyt24.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt25, -nyt25.width/2, -nyt25.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt26, -nyt26.width/2, -nyt26.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt27, -nyt27.width/2, -nyt27.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt28, -nyt28.width/2, -nyt28.height/2); -popMatrix(); - -x = random(width); -y = random(height); -r = random(0, TWO_PI); -pushMatrix(); -translate(x, y); -rotate(r); -image(nyt29, -nyt29.width/2, -nyt29.height/2); -popMatrix(); - - -// saveFrame("Synthesis-1--" + int(random(0, 1000)) + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde deleted file mode 100644 index 31d2dd90f..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_01/Synthesis_02_waves_01.pde +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 1, creating the basic form. -*/ - - -size(400, 400); -background(255); -float angle = 0.0; -float magnitude = 24.0; - -beginShape(TRIANGLE_STRIP); -for(int x=0; x<=width; x=x+8) { - float y = 50 + (sin(angle)* magnitude); - angle += PI/48.0; - float y2 = 70 + (sin(angle+PI/6)* magnitude); - vertex(x, y); - vertex(x, y2); -} -endShape(); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde deleted file mode 100644 index b923a3b55..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_02/Synthesis_02_waves_02.pde +++ /dev/null @@ -1,27 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 2, the basic form is drawn many times inside a for structure. -*/ - - -size(400, 400); -background(255); -float angle = 0.0; -int magnitude = 18; - -for(int i =- magnitude; i < height+magnitude; i = i+24) { - - beginShape(TRIANGLE_STRIP); - for(int x = 0; x <= width; x = x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+10 + (sin(angle+PI/12) * magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde deleted file mode 100644 index 5932fa877..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_03/Synthesis_02_waves_03.pde +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -float angle = 0.0; -float angle2 = 0.0; -int magnitude = 8; - -for(int i = -magnitude; i < height+magnitude; i = i+18) { - - angle2 = angle; - - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+4 + (sin(angle+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - fill(204); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i+4 + (sin(angle2+PI/12)* magnitude); - angle2 += PI/24.0; - float y2 = i+8 + (sin(angle2+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - /* - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/16.0; - float y2 = i+4 + (sin(angle+PI/24)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - - fill(204); - beginShape(TRIANGLE_STRIP); - for(int x=0; x<=width; x=x+8) { - float y = i+4 + (sin(angle2+PI/24)* magnitude); - angle2 += PI/16.0; - float y2 = i+8 + (sin(angle2+PI/24)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - */ -} - - -// save("Synthesis-2--1.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde deleted file mode 100644 index fb80ac2bd..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_04/Synthesis_02_waves_04.pde +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -fill(0); -float angle = 0.0; -int magnitude = 16; - -for(int i = -magnitude; i < width+magnitude; i = i+16) { - - fill(float(i)/width * 255); - - beginShape(TRIANGLE_STRIP); - for(int y = 0; y <= height; y = y+6) { - float x = i + (sin(angle)* magnitude); - angle += PI/22.0; - float x2 = i+8 + (sin(angle+PI/22)* magnitude); - vertex(x, y); - vertex(x2, y); - } - endShape(); - -} - -// saveFrame("Synthesis-2--2.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde deleted file mode 100644 index 423453ad9..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_02_waves_05/Synthesis_02_waves_05.pde +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Riley Waves by Casey Reas (www.processing.org) - * p. 151 - * - * Step 3, values are modified to create a new pattern. -*/ - - -size(1200, 280); -background(255); -smooth(); -noStroke(); -//fill(0); -float angle = PI; -float angle2 = PI; -int magnitude = 3; - -for(int i = -magnitude; i < height+magnitude; i = i+12) { - - angle2 = angle; - - fill(0); - beginShape(TRIANGLE_STRIP); - for(int x = 0; x <= width; x = x+8) { - float y = i + (sin(angle)* magnitude); - angle += PI/24.0; - float y2 = i+4 + (sin(angle+PI/12)* magnitude); - vertex(x, y); - vertex(x, y2); - } - endShape(); - -} - - -// save("Synthesis-2--3.tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde deleted file mode 100644 index fe719e4f3..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_01/Synthesis_03_grids_01.pde +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 1, basic embedded for structure. -*/ - - -size(600, 600); -background(255); -int sqNum = 12; -int sqSize = width/sqNum; -int halfSize = sqSize/2; - -for (int y = halfSize; y < width; y = y+sqSize) { - for (int x = halfSize; x < height; x = x+sqSize) { - rect(x-halfSize+2, y-halfSize+2, sqSize-4, sqSize-4); - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde deleted file mode 100644 index 8f5b4a361..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_02/Synthesis_03_grids_02.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 2, textures inside the grid by adding a third for structure. -*/ - - -size(600, 600); -background(255); -int numSquares = 12; -int gap = 4; -int sqSize = (width-gap*2)/numSquares; -int halfSize = sqSize/2; -int offset = halfSize+gap; -int ydiv = sqSize/12; - -for(int y = 0; y < numSquares; y++) { - for(int x = 0; x < numSquares; x++) { - float xp = offset + (x*sqSize); - float yp = offset + (y*sqSize); - for(int i=0; i<=sqSize-gap*2; i=i+ydiv) { - float yy = i*halfSize+gap+i; - line(xp-halfSize+gap, yp-halfSize+gap+i, xp+halfSize-gap, yp-halfSize+gap+i); - } - } - -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde deleted file mode 100644 index 9d4d5f670..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_03_grids_03/Synthesis_03_grids_03.pde +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Synthesis 1: Form and Code - * Wilson Grids by Casey Reas (www.processing.org) - * p. 152 - * - * Step 3, changing the size of each grid element. -*/ - - -size(600, 600); -background(0); -stroke(255, 204); -int numSquares = 6; -int gap = 8; -int sqSize = (width-gap*2)/numSquares; - -for (float y=0; y 2 ) { - co = 1 - k/float(accuracy); - break; // NOTE: This is new syntax!!! - } - } - stroke(color(255*co, 255*co, 255*co)); - point(i, j); - } -} - - -// save("Synthesis-04--" + zoom + ".tif"); diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde deleted file mode 100644 index 4dc267f43..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_05_tennis/Synthesis_05_tennis.pde +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Tennis by Casey Reas (www.processing.org) - * p. 256 - * - * Only the right paddle works. As a challenge, try to - * add code to activate the left paddle. You can make decide to make - * it a one-player or two-player game. As an additional challenge, - * have the program keep score. - */ - - -int ballX; -int ballY; -int ballDir = 1; -int ballSize = 10; // Radius -float ballAngle = 0.0; // Direction - -// Global variables for the paddle -int paddleWidth = 20; -int paddleHeight = 40; - -int wallGap = 50; - -int netSegment; - -void setup() { - size(640, 480); - noStroke(); - ballY = height/2; - ballX = 0; - noCursor(); - netSegment = height/32; -} - -void draw() { - background(0); - - stroke(255); - // Draw Net - for(int i=0; i width+ballSize*2) { - ballX = -ballSize; - ballY = int(random(0, height-ballSize)); - ballAngle = 0; - println(ballX + ":" + ballY + ":" + ballAngle); - } - - if(ballX < -ballSize*2) { - ballX = width; - ballY = int(random(0, height-ballSize)); - ballAngle = 0; - println(ballX + ":" + ballY + ":" + ballAngle); - } - - // Constrain paddle to screen - float paddleY = constrain(mouseY, 0, height-paddleHeight); - - // Test to see if the ball is touching the paddle - float py = width-wallGap-ballSize; - if(ballX >= py && ( ballY+ballSize >= paddleY && ballY <= paddleY + paddleHeight)) { - - ballDir *= -1; - if(mouseY != pmouseY) { - ballAngle = (mouseY-pmouseY)/2.0; - ballAngle = constrain(ballAngle, -5, 5); - } - } - - // If ball hits back wall, reverse direction - if(ballX < 0) { - ballDir *= -1; - } - - // If the ball is touching top or bottom edge, reverse direction - if((ballY > height-ballSize) || (ballY < 0)) { - ballAngle = ballAngle * -1; - } - - // Draw ball - fill(255); - rect(ballX, ballY, ballSize, ballSize); - - // Draw the paddle - fill(153); - rect(width-wallGap, paddleY, paddleWidth, paddleHeight); - - // Draw the paddle - rect(wallGap, height-paddleY-paddleHeight, paddleWidth, paddleHeight); -} - - -void keyPressed() { - //saveFrame("pong-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde deleted file mode 100644 index ef52995ee..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_06_cursor/Synthesis_06_cursor.pde +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Cursor by Peter Cho (www.typotopo.com) - * p. 257 - * - * There are four modes, each is a different - * way to use the input from the mouse to control - * the cursor(s). Click on a number to select that - * mode. - */ - - -PFont fontA; -int gx, gy; -int mode, nextmode; -int nummodes; -boolean forapplet = false; - -float mx, my, lastmx, lastmy; -float lastrot, lastsc; - -float bgx, bgy; - - -float p_x, p_y; -float p_fx, p_fy; -float p_v2, p_vx, p_vy; -float p_a2, p_ax, p_ay; -float p_mass, p_drag; - - -void setup() -{ - size(600, 600); - gx = width; - gy = height; - size(gx, gy); - colorMode(RGB, 1.0); - strokeWeight(1.3); - loop(); - smooth(); - strokeJoin(ROUND); - - init_particle(0.6, 0.9, width/2, height/2); - - fontA = loadFont("NewsGothicBT-Bold-48.vlw"); - nummodes = 4; - mode = 1; - - bgx = 0; - bgy = 0; - mx = gx/2; - my = gy/2; - - noCursor(); - - if (forapplet) { - cursor(CROSS); - } -} - - -void init_particle(float _mass, float _drag, float ox, float oy) -{ - p_x = ox; - p_y = oy; - p_v2 = 0.0f; - p_vx = 0.0f; - p_vy = 0.0f; - p_a2 = 0.0f; - p_ax = 0.0f; - p_ay = 0.0f; - p_mass = _mass; - p_drag = _drag; -} - -void iterate_particle(float fkx, float fky) -{ - // iterate for a single force acting on the particle - p_fx = fkx; - p_fy = fky; - p_a2 = p_fx*p_fx + p_fy*p_fy; - if (p_a2 < 0.0000001) return; - p_ax = p_fx/p_mass; - p_ay = p_fy/p_mass; - p_vx += p_ax; - p_vy += p_ay; - p_v2 = p_vx*p_vx + p_vy*p_vy; - if (p_v2 < 0.0000001) return; - p_vx *= (1.0 - p_drag); - p_vy *= (1.0 - p_drag); - p_x += p_vx; - p_y += p_vy; -} - -void drawCursor(float x, float y, float myscale, float myrot) { - // draw generic arrow cursor - if (forapplet) y -= gy/2; - pushMatrix(); - translate(x, y); - rotate(myrot); - scale(myscale, myscale); - beginShape(POLYGON); - vertex(7, 21); - vertex(4, 13); - vertex(1, 16); - vertex(0, 16); - vertex(0, 0); // tip of cursor shape - vertex(1, 0); - vertex(12, 11); - vertex(12, 12); - vertex(7, 12); - vertex(10, 20); - vertex(9, 21); - vertex(7, 21); - endShape(); - popMatrix(); -} - -void blurdot(float x, float y, float sc) { - ellipse(x, y, sc*5, sc*5); - ellipse(x, y, sc*23, sc*23); - ellipse(x, y, sc*57, sc*57); - ellipse(x, y, sc*93, sc*93); -} - -void drawBlurCursor(float x, float y, float myscale, float dotval) { - // draw generic arrow cursor - if (forapplet) y -= gy/2; - pushMatrix(); - translate(x, y); - scale(myscale, myscale); - float dotval2 = .5 + (1-dotval)*5; - dotval = .5 + (1-dotval)*9; - blurdot(7, 21, dotval2); - blurdot(1, 16, dotval); - blurdot(0, 8, dotval2); // midpt - blurdot(0, 0, dotval); // tip of cursor shape - blurdot(1, 0, dotval2); - blurdot(6, 6, dotval); // midpt - blurdot(12, 12, dotval2); - blurdot(10, 20, dotval); - popMatrix(); -} - - -int n = 1; -void keyPressed() { - if (key == '1') { - mode = 1; - } else if (key == '2') { - mode = 2; - } else if (key == '3') { - mode = 3; - } else if (key == '4') { - mode = 4; - } - - // saveFrame("cursor--" + mode + "-" + n + ".tif"); - n++; -} - -boolean isInside(float x, float y, float rx, float ry, float rw, float rh) { - return (x >= rx && x <= rx+rw && y >= ry && y <= ry+rh); -} - -void scrollbg(float x, float y) { - // scroll the bg - float amt = 30; - if (x < gx*.5) { - bgx += amt*(gx*.5 - x)*(gx*.5 - x)/(gx*gx); - } else if (x > gx - gx*.5) { - bgx -= amt*(x - (gx-gx*.5))*(x - (gx-gx*.5))/(gx*gx); - } - bgx = bgx % gx; - if (bgx < 0) bgx += gx; - - if (y < gy*.5) { - bgy += amt*(gy*.5 - y)*(gy*.5 - y)/(gy*gy); - } else if (y > gy - gy*.5) { - bgy -= amt*(y - (gy-gy*.5))*(y - (gy-gy*.5))/(gy*gy); - } - bgy = bgy % gy; - if (bgy < 0) bgy += gy; -} - -void draw() -{ - lastmx = mx; - lastmy = my; - - mx = mouseX; - my = mouseY; - - if (mode == 3) { - mx = mx*.01 + lastmx*.99; - my = my*.01 + lastmy*.99; - - } else if (mode == 4) { - mx = mx*.25 + lastmx*.75; - my = my*.25 + lastmy*.75; - - } else { - mx = mx*.5 + lastmx*.5; - my = my*.5 + lastmy*.5; - } - - iterate_particle(.15*(-p_x+mx), .15*(-p_y+my)); - scrollbg(p_x, p_y); - - background(.8,.8,.8); - // Set the font and its size (in units of pixels) - textFont(fontA, 24); - - float x, y; - int w=95, h=75; - for (int i=0; i 5) { - mode = 1; - } - } - else if (key == BACKSPACE) { - if(mode == 1) { - if(text1.length() > 0) { - text1 = text1.substring(0, text1.length() - 1); - } - } - else if (mode ==2 ) { - if(text2.length() > 0) { - text2 = text2.substring(0, text2.length() - 1); - } - } - else if (mode == 3) { - if(text3.length() > 0) { - text3 = text3.substring(0, text3.length() - 1); - } - } - else if (mode == 4) { - if(text4.length() > 0) { - text4 = text4.substring(0, text4.length() - 1); - } - } - else if (mode == 5) { - if(text5.length() > 0) { - text5 = text5.substring(0, text5.length() - 1); - } - } - } - else { - if(mode == 1) { - text1 += key; - } - else if (mode ==2 ) { - text2 += key; - } - else if (mode == 3) { - text3 += key; - } - else if (mode == 4) { - text4 += key; - } - else if (mode == 5) { - text5 += key; - } - } -} - -void mousePressed() { - mx = mouseX; - my = mouseY; -} - -void mouseMoved() { - x = mouseX; - y = mouseY; - mx = mouseX; - my = mouseY; - - if(mode == 1) { - x1 = x; - y1 = y; - } - else if (mode ==2 ) { - x2 = x; - y2 = y; - } - else if (mode == 3) { - x3 = x; - y3 = y; - } - else if (mode == 4) { - x4 = x; - y4 = y; - } - else if (mode == 5) { - x5 = x; - y5 = y; - } -} - -void mouseDragged() { - //float mr = float(mouseX - mx) / width * TWO_PI; - - - float mr = atan2(mouseY-my, mouseX-mx); - //float ms = abs(float(mouseY-my) / height * 5.0) + 0.25; - float ms = dist(mouseX, mouseY, mx, my) / 100.0; - if(mode == 1) { - r1 = mr; - s1 = ms; - } - else if (mode ==2 ) { - r2 = mr; - s2 = ms; - } - else if (mode == 3) { - r3 = mr; - s3 = ms; - } - else if (mode == 4) { - r4 = mr; - s4 = ms; - } - else if (mode == 5) { - r5 = mr; - s5 = ms; - } -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw deleted file mode 100644 index d03189b65..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-128.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw deleted file mode 100644 index 246476063..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_07_typing/data/TheSerif-Plain-96.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde deleted file mode 100644 index c11ce559d..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_08_clock/Synthesis_08_clock.pde +++ /dev/null @@ -1,190 +0,0 @@ -/** - * Synthesis 2: Input and Response - * Banded Clock by Golan Levin (www.flong.com) - * p. 259 - * - * - * - */ - - -//================================================ -int prevX = 0; -int prevY = 0; -int clickX = 0; -int clickY = 0; - -final int NCOLORS = 256; -color colorArray[]; -float S, M, H; -int Scolors[]; -int Mcolors[]; -int Hcolors[]; -int ys0, ys1; -int ym0, ym1; -int yh0, yh1; - -float Soffset = 0; -float Hoffset = 0; -float Moffset = 0; -float Svel = 0; -float Hvel = 0; -float Mvel = 0; -float damp = 0.94f; - -int mil, sec, minut, hou; -int milError = 0; -int canvasWidth; -int canvasHeight; - -//================================================ -void setup(){ - - size(600, 600); - canvasWidth = width; - canvasHeight = height; - - Scolors = new int[canvasWidth]; - Mcolors = new int[canvasWidth]; - Hcolors = new int[canvasWidth]; - colorArray = new color[NCOLORS]; - for (int i=0; i sec){ - milError = millis()%1000; - } -} - -//------------------ -float GMOD (float A, float B){ - return (float)(A - (floor(A/B)*B)); -} - -//------------------ -int wave(float a){ - // inexpensive ramp function, - // but not as nice as true sine wave (below) - int val = 0; - float cscale = 2.0f*255.0f; - if (a < 0.5){ - val = (int) round (a *cscale); - } - else { - val = (int) round ((1.0f-a)*cscale); - } - return val; -} - -//------------------ -int sinWave (float a){ - // expensive trigonometric function, but nicer looking - float sina = (1.0+sin(TWO_PI*a))*255.0/2.0; - int val = (int)round(sina); - return val; -} - -//-------------------------------------------------------------------------- -// interaction methods - -void mousePressed (){ - prevX = mouseX; - prevY = mouseY; - clickX = mouseX; - clickY = mouseY; -} - -void mouseDragged() { - // allow bands to be shifted around, for "fun" - float accel = (prevX - mouseX)*0.004f; - if ((clickY >= ys0) && (clickY < ys1)){ - Svel += accel; - } - else if ((clickY >= ym0) && (clickY < ym1)){ - Mvel += accel; - } - else if ((clickY >= yh0) && (clickY < yh1)){ - Hvel += accel; - } - prevX = mouseX; - prevY = mouseY; -} - - - - -void keyPressed() { - saveFrame("clock--" + hour() + "-" + minute() + "-" + second() + ".tif"); -} - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde deleted file mode 100644 index 76959237a..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_09_centipede/Synthesis_09_centipede.pde +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Synthesis 3: Motion and Arrays - * Centipede by Ariel Malka (www.chronotext.org) - * p. 372 - */ - - -float x, y; -float node_length = 30; -float node_size = node_length-1; -int n_nodes = 70; -float[] nodes_x; -float[] nodes_y; -float delay = 20; -color col_head = color(255, 0, 0); -color col_body = color(0); - - -void setup() -{ - size(600, 600); - smooth(); - noStroke(); - - x = width/2; - y = height/2; - - int r1 = 10; - int r2 = 100; - int dr = r2-r1; - float D = 0; - - nodes_x = new float[n_nodes]; - nodes_y = new float[n_nodes]; - - for (int i=0; i= 0) && (mouseX < width) && (mouseY >= 0) && (mouseY < height)){ - drawline(mouseX, mouseY, pmouseX, pmouseY); - if (fat) { - drawthickline(mouseX, mouseY, pmouseX, pmouseY, 2); - drawdot(mouseX+1, mouseY); - drawdot(mouseX, mouseY+1); - drawdot(mouseX, mouseY-1); - drawdot(mouseX-1, mouseY); - drawdot(mouseX+1, mouseY-1); - drawdot(mouseX+1, mouseY+1); - drawdot(mouseX-1, mouseY-1); - drawdot(mouseX-1, mouseY+1); - } - } - } - - // draw frames - int p = currentpic; - for (int j=0; j= framerest) { - framecounter = 0; - currentpic--; - if (currentpic < 0) { - currentpic = buflength - 1; - } - } - - // btncheck - if (keyPressed && key==' ') { - btnheight = height / 2; - if (mouseY < btnheight && mouseY >=0){ - framestep = - int(btnreso / 2) + int(mouseX/(width/btnreso)); - //println(framestep); - } else if (mouseY > btnheight && mouseY < height){ - framerest = int(mouseX/(width/btnreso))*btnresomulti; - } - } else { - btnheight = 8; - } - - // drawgrid - if (grid) { - drawgrid(); - } - - // drawbtn1 - noStroke(); - fill(0,0,255,60); - int btnxoffset = width/btnreso * (btnreso / 2 + framestep); - rect(btnxoffset, 0, width/btnreso, btnheight); - - // drawbtn2 - fill(255,0,0,60); - btnxoffset = width/btnreso * framerest / btnresomulti; - rect(btnxoffset, height - btnheight, width/btnreso, btnheight); -} - -void clearall(){ - for (int i=0; i=sizey) { - y=sizex>>1; - for(int i=0;i=sizex) { - y-=sizex; - county+=incy; - } - countx+=incx; - drawdot(countx, county); - } - } else { - x=sizey>>1; - for(int i=0;i=sizey) { - x-=sizey; - countx+=incx; - } - county+=incy; - drawdot(countx, county); - } - } -} - - -//idem -void drawthickline(int x1, int y1, int x2, int y2, int thickness) { - - int dX = x2 - x1; - int dY = y2 - y1; - - double lineLength = Math.sqrt(dX * dX + dY * dY); - double scale = (double)(thickness) / (2 * lineLength); - double ddx = -scale * (double)dY; - double ddy = scale * (double)dX; - ddx += (ddx > 0) ? 0.5 : -0.5; - ddy += (ddy > 0) ? 0.5 : -0.5; - int dx = (int)ddx; - int dy = (int)ddy; - - int xPoints[] = new int[4]; - int yPoints[] = new int[4]; - - xPoints[0] = x1 + dx; yPoints[0] = y1 + dy; - xPoints[1] = x1 - dx; yPoints[1] = y1 - dy; - xPoints[2] = x2 - dx; yPoints[2] = y2 - dy; - xPoints[3] = x2 + dx; yPoints[3] = y2 + dy; - - drawline(xPoints[0], yPoints[0], xPoints[1], yPoints[1]); - drawline(xPoints[1], yPoints[1], xPoints[2], yPoints[2]); - drawline(xPoints[2], yPoints[2], xPoints[3], yPoints[3]); - drawline(xPoints[3], yPoints[3], xPoints[0], yPoints[0]); -} - - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde deleted file mode 100644 index 607b23578..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_11_amoebaAbstract/Synthesis_11_amoebaAbstract.pde +++ /dev/null @@ -1,175 +0,0 @@ -/** - * Synthesis 3: Motion and Arrays - * AmoebaAbstract_03 by Marius Watz - * p. 374 - * - * Move the mouse to control the speed of the elements. Click to - * restart with different colors. - * - * Notes from Marius: - * Abstract computational animation for the exhibition "Abstraction Now", - * Kunstlerhaus Vienna, 29.08-28.09 2003. - * You are allowed to play with this code as much as you like, but - * you may not publish pieces based directly on it. -*/ - - -int num,cnt,colNum,colScheme; -float h,maxSpeed; -float[] x,y,speed; -boolean initialised; -float[] colR,colG,colB; - -void setup() { - size(700, 400); - background(255); - smooth(); - frameRate(30); - - cnt=0; - maxSpeed=8; - num=20; - x=new float[num]; - y=new float[num]; - speed=new float[num]; - h=height/num; - for(int i=0; i50) speed[i]=-speed[i]; - } - noStroke(); - - colR=new float[1000]; - colG=new float[1000]; - colB=new float[1000]; - - colScheme=-1; - initColors(); -} - -void draw() { - int c; - - cnt++; - for(int i=0; i width) { - x[i] -= width; - } - - c = ((i*11+cnt*3+int(speed[i]*10))/20)%colNum; - if(c<0) { - c=0; - } - fill(colR[c],colG[c],colB[c],150); - - if(i%2==0) { - rect(x[i]%width, y[i], 6, h); - } - else { - ellipse(x[i]%width, y[i]+h/2, h-6, h-6); - } - } - - stroke(255,255,255,10); - noFill(); - strokeWeight(2); - for(int i=0; i < num-3; i++) { - line(x[i], y[i]+h/2, x[(i+3)%num], y[(i+3)%num]+h/2); - line(x[num-i-1], y[num-i-1]+h/2, x[(num-i-2)%num], y[(num-i-2)%num]+h/2); - } - noStroke(); - fill(255); - rect(0, 0, 2, height); - rect(width-2, 0, 2, height); -} - -void initColors() { - colNum=0; - colScheme=(colScheme+1)%3; - if(colScheme==0) { - addColor(12, 100,200,255, 50,100,128); - addColor(8, 26,41,58, 50,100,128); - addColor(2, 255,255,255, 255,255,255); - addColor(16, 0,0,50, 40,40,80); - addColor(12, 100,200,255, 50,100,128); - addColor(8, 26,41,58, 50,100,128); - addColor(6, 0,200,20, 0,255,100); - addColor(2, 255,255,255, 255,255,255); - addColor(16, 0,0,50, 40,40,80); - addColor(5, 255,200,0, 255,170,0); - } - else if(colScheme==1) { - addColor(20, 255,0,100, 128,0,0); - addColor(6, 255,100,0, 255,150,0); - addColor(6, 128,0,0, 50,20,20); - addColor(12, 255,255,255, 255,100,100); - addColor(4, 255,100,0, 102,0,0); - } - else if(colScheme==2) { - addColor(14, 128,163,120, 27,53,38); - addColor(8, 64,95,0, 225,227,0); - addColor(8, 0,150,150, 215,255,255); - addColor(4, 168,106,170, 235,183,237); - addColor(14, 128,163,120, 27,53,38); - addColor(8, 64,95,0, 225,227,0); - addColor(8, 0,150,150, 215,255,255); - addColor(12, 92,18,96, 217,111,226); - } -} - -void addColor(float r,float g,float b) { - colR[colNum]=r; - colG[colNum]=g; - colB[colNum]=b; - colNum++; -} - -void addColor(int num, float r1,float g1,float b1, float r2,float g2,float b2) { - - r2=(r2-r1)/float(num-1); - g2=(g2-g1)/float(num-1); - b2=(b2-b1)/float(num-1); - - for(int i=0; i20 && abs(mx-mouseX)>5){ - image (body,0,135); - image (head,0,sinval*20-40); - } - else{ - image (body2,0,135); - image (head2,0,sinval*20-40); - } - interpolate(); - popMatrix(); - pushMatrix(); - if (abs(my-mouseY)>20 && abs(mx-mouseX)>5){ - battery(true); - } - else{ - battery (false); - } - popMatrix(); -} - -void battery(boolean test){ - if (test==true){ - image (batt, mouseX-50, mouseY-20); - } - else{ - image (batteat, mouseX-50+random(-20,20), mouseY-20+random(-20,20)); - } -} - -void interpolate(){ - float diffx = mouseX-mx; - if(abs(diffx) > 1) { - mx = mx + diffx/delay; - } - float diffy = mouseY-my; - if(abs(diffy) > 1) { - my = my + diffy/delay; - } -} - -void keyPressed() { - // saveFrame("robot-####.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif deleted file mode 100644 index 8c2ed3ea0..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/battalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif deleted file mode 100644 index 36a12ae34..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteat.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif deleted file mode 100644 index 19ce7a9be..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/batteatalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif deleted file mode 100644 index 0527d026f..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_12_robot/data/headalpha.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde deleted file mode 100644 index 83b628975..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Module.pde +++ /dev/null @@ -1,18 +0,0 @@ - -class Module { - int i; - float x, y, myAngle, myRadius, dir; - float mx = width/2; - float my = height/2; - float delay = 40.0; - - Module(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - i = spriteNum; - x = xx; - y = yy; - myAngle = deg; - myRadius = rad; - dir = pp; - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde deleted file mode 100644 index 4743b5b66..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleA.pde +++ /dev/null @@ -1,33 +0,0 @@ - -class ModuleA extends Module { - - ModuleA(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - super(spriteNum, xx, yy, deg, rad, pp); - } - - void updateMe() { - float mh = x - mouseX; - float mv = y - mouseY; - float mdif = sqrt(mh*mh+mv*mv); - float dh = width/2 - mouseX; - float dv = height/2 - mouseY; - float ddif = sqrt(dh*dh+dv*dv); - if(dir == 1){ - myAngle += abs(ddif - mdif)/50.0; - } - else{ - myAngle -= abs(ddif - mdif)/50.0; - } - myRadius += mdif/100.00; - if(myRadius > width){ - myRadius = random(10,40); - } - mx += (mouseX - mx)/delay; - my += (mouseY - my)/delay; - x = mx + (myRadius * cos(radians(myAngle))); - y = my + (myRadius * sin(radians(myAngle))); - stroke(num/(i+1), num/(i+1), num/(i+1)); - point(x,y); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde deleted file mode 100644 index 50bb85667..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/ModuleB.pde +++ /dev/null @@ -1,27 +0,0 @@ - -class ModuleB extends Module { - - ModuleB(int spriteNum, float xx, float yy, float deg, float rad, float pp) { - super(spriteNum, xx, yy, deg, rad, pp); - } - - void updateMe(){ - mx += (mouseX - mx)/delay; - my += (mouseY - my)/delay; - x = mx + (myRadius * cos(radians(myAngle))); - y = my + (myRadius * sin(radians(myAngle))); - stroke(num/2, num/2, num/2); - point(x,y); - - // from connectMe2 - noStroke(); - fill(0, num/7.0, num/(i+1)+num/4.0, 20); - beginShape(QUADS); - vertex(modsA[i].x, modsA[i].y); - vertex(modsA[i].x+1, modsA[i].y+1); - vertex(x, y); - vertex(x+1, y+1); - endShape(); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde deleted file mode 100644 index 1e5ccb570..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/Synthesis_13_withoutTitle.pde +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * WithoutTitle by Lia (http://lia.sil.at) - * p. 496 - * - * Move the mouse to create the drawing. Click to refresh the window. - */ - - -int num = 50; -ModuleA[] modsA; -ModuleB[] modsB; -boolean initialized = false; - -void setup() { - size(600, 600); - colorMode(RGB, num); - background(num); - smooth(); - - modsA = new ModuleA[num]; - modsB = new ModuleB[num]; - - for (int i=0; i 0.5) { - qq = 1; - } else { - qq = -1; - } - float x = random(width); - float y = random(height); - float angle = random(360); - float direction = random(10, 40); - modsA[i] = new ModuleA(i, x, y, angle, direction, qq); - modsB[i] = new ModuleB(i, x, y, angle, direction, qq); - } - -} - -void draw() { - if(initialized == true){ - for (int i=0; i width) || (modsA[i].y < 0) || (modsA[i].y > height) ){ - modsA[i].x = mouseX; - modsA[i].y = mouseY; - modsB[i].x = mouseX; - modsB[i].y = mouseY; - float a = random(360); - modsA[i].myAngle = a; - modsB[i].myAngle = a; - float r = random(10, 40); - modsA[i].myRadius = r; - modsB[i].myRadius = r+i*i; - } - } - } -} - -void mousePressed() { - background(num); -} - -void mouseMoved() { - initialized = true; -} - -void keyPressed() { - // saveFrame("withouttitle-####.tif"); -} - - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db deleted file mode 100644 index 4d6134850..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/Thumbs.db and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif deleted file mode 100644 index 2b300b2c2..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_down.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif deleted file mode 100644 index 6f971e9e0..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_hi.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif deleted file mode 100644 index 5db0ee614..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/down_lo.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif deleted file mode 100644 index 0a2367d69..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_down.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif deleted file mode 100644 index 10bf1e299..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_hi.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif deleted file mode 100644 index e919d4bb6..000000000 Binary files a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_13_withoutTitle/data/up_lo.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde deleted file mode 100644 index e663426f3..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_14_pond/Synthesis_14_pond.pde +++ /dev/null @@ -1,671 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * Pond by William Ngan (www.metaphorical.net) - * p. 197 - * - * Click to generate ripples and attract the fish. - * Press keys 0-3 to turn that number of big fish ON or OFF. - */ - - -int NUM = 75; // number of fish - -Fish[] flock = new Fish[NUM]; -Fish bigfish1; -Fish bigfish2; -Fish bigfish3; - -//ripple -float rippleX, rippleY; -float[] ripple = new float[20]; -boolean hasRipple; -int countRipple; - -int hasPredator = 1; // Number of predator (big fish) - - -void setup() { - - size(600, 600); - - colorMode(HSB, 360, 100, 100); - background(85,46,83); - - frameRate(30); - - // Small fish - for (int i=0; i0) { - - bigfish1.scanPrey( flock, 150f ); - bigfish1.predator( bigfish2.x, bigfish2.y, 100f, 6*PI/180f, 2f); - bigfish1.predator( bigfish3.x, bigfish3.y, 100f, 6*PI/180f, 2f); - bigfish1.predator( mouseX, mouseY, 50f, 5*PI/180f, 1f); - bigfish1.move(); - stroke( bigfish1.colour[0], bigfish1.colour[1], bigfish1.colour[2]); - bigfish1.getFish(); - - if (hasPredator>1) { - bigfish2.scanPrey( flock, 120f ); - bigfish2.predator( bigfish1.x, bigfish1.y, 100f, 5*PI/180f, 1.5f); - bigfish2.predator( bigfish3.x, bigfish3.y, 100f, 5*PI/180f, 1.5f); - bigfish2.predator( mouseX, mouseY, 50f, 4*PI/180f, 0.8f); - bigfish2.move(); - stroke( bigfish2.colour[0], bigfish2.colour[1], bigfish2.colour[2]); - bigfish2.getFish(); - - if (hasPredator>2) { - bigfish3.scanPrey( flock, 100f ); - bigfish3.predator( bigfish1.x, bigfish1.y, 100f, 5*PI/180f, 1.5f); - bigfish3.predator( bigfish2.x, bigfish2.y, 100f, 5*PI/180f, 1.5f); - bigfish3.predator( mouseX, mouseY, 50f, 3*PI/180f, 0.5f); - bigfish3.move(); - stroke( bigfish3.colour[0], bigfish3.colour[1], bigfish3.colour[2]); - bigfish3.getFish(); - } - } - } - - - // Draw small fish - noStroke(); - for (int i=0; i0) { - flock[i].predator( bigfish1.x, bigfish1.y, 100f, 8*PI/180f, 1.5f); - if (hasPredator>1) { - flock[i].predator( bigfish2.x, bigfish2.y, 100f, 8*PI/180f, 1.5f); - if (hasPredator>2) flock[i].predator( bigfish3.x, bigfish3.y, 100f, 8*PI/180f, 1.5f); - } - } - if (!hasRipple) flock[i].predator( mouseX, mouseY, 100f, 5*PI/180f, 1f); - flock[i].move(); - flock[i].getFish(); - - } - - // Draw ripple - stroke(84,66,96); - noFill(); - - if (hasRipple) { - if (countRipple>0) { // ripple done, but active for another second - countRipple++; - } - else { // draw ripple - countRipple = 1; - for (int k=0; k60) ? false : true; - } - -} - - -void mouseDragged() { - rippleX = mouseX; - rippleY = mouseY; -} - -void mousePressed() { - rippleX = mouseX; - rippleY = mouseY; -} - -void mouseReleased() { - if (!hasRipple) { - for (int k=0; k 1) { // if it has energy - wcount+=energy*2; // tail sine-wave movement - } - - // Sine-wave oscillation - if (wcount>120) { - wcount = 0; - energy =0; - } - - wave = sin( wcount*3*PI/180 ); //sine wave - float strength = energy/5 * tailLength/2; //tail strength - - // Set tail position - setTail( strength, wave ); - move(); - } - - - ////////////////////////////////// / - - - // Find distance - float dist( float px, float py ) { - px -= x; - py -= y; - return sqrt( px*px + py*py ); - } - - float dist( Fish p ) { - float dx = p.x - x; - float dy = p.y - y; - return sqrt( dx*dx + dy*dy ); - } - - // Find angle - float angle( float px, float py ) { - return atan2( (py-y), (px-x) ); - } - - float angle( Fish p ) { - return atan2( (p.y-y), (p.x-x) ); - } - - // Move one step - void move() { - x = x+( cos(angle)*speed ); - y = y+( sin(angle)*speed ); - } - - // Speed change - void speedChange( float inc ) { - speed += inc; - if (speedmaxSpeed) { speed=maxSpeed; } - } - - // Direction change - void angleChange( float inc ) { - angle += inc; - } - - // Set speed limit - void setSpeedLimit( float max, float min ) { - maxSpeed = max; - minSpeed = min; - } - - // Set angle - void setAngle( float a ) { - angle = a; - } - - // Turn towards an angle - void turnTo( float ta, float inc ) { - - if (angle < ta) { - angleChange( inc ); - } - else { - angleChange( inc*-1 ); - } - } - - - // Set Color - void setColor( float c1, float c2, float c3 ) { - colour[0] = c1; - colour[1] = c2; - colour[2] = c3; - } - - - // Copy another fish's angle and pos - void copyFish( Fish f ) { - x = f.x; - y = f.y; - angle = f.angle; - speed = f.speed; - } - - ////////////////////////////////// - - // Check bounds and U-turn when near bounds - boolean checkBounds( float turn ) { - - boolean inbound = false; - - turn += boundTime/100; - - // Calculate the "buffer area" and turning angle - float gap = speed * PI/2/turn; - if (gap > width/4) { - gap = width/4; - turn = (gap/speed)/PI/2; - } - - // Which direction to u-turn? - if ( x-gap < 0 || x+gap > width || y-gap < 0 || y+gap > height) { - - if (uturn == 0) { - - float temp = angle; - if (temp < 0) temp += PI*2; - - if ( temp >0 && tempPI/2 && tempPI && tempPI*3/2 && temp height) uturn *=-1; - } - - // Turn - angleChange( turn*uturn ); - - inbound = true; - - } - else { // when out, clear uturn - uturn = 0; - inbound = false; - } - - x = (x<0) ? 0 : ( (x>width) ? width : x ); - y = (y<0) ? 0 : ( (y>height) ? height : y ); - - isBound = inbound; - boundTime = (inbound) ? boundTime+1 : 0; - - return inbound; - - } - - - // Alignment -- move towards the same direction as the flock within sight - void align( Fish fp, float angleSpeed, float moveSpeed ) { - - turnTo( fp.angle, angleSpeed+random(angleSpeed*3) ); // 0.001 - - if ( speed > fp.speed ) { - speedChange( moveSpeed*(-1-random(1)) ); //0.2 - } - else { - speedChange( moveSpeed ); - } - - } - - - // Cohesion -- move towards the center of the flock within sight - void cohere( Fish[] flocks, float angleSpeed, float moveSpeed ) { - - // get normalised position - float nx = 0; - float ny = 0; - - for (int i=0; i0) tone-=2; - } - - speedChange( moveSpeed ); - } - - - // Attracts towards a point (ie, ripple) - void swarm( float px, float py, float d ) { - float dA = angle(px, py); - - turnTo( dA, d ); - if (isBound) { - turnTo( dA, d ); - } - } - - //////////////////////////// // - - // Scan for the environment and determines behaviour - void scanFlock( Fish[] flocks, float cohereR, float avoidR ) { - - - Fish[] near = new Fish[NUM]; - int nCount = 0; - Fish[] tooNear = new Fish[NUM]; - int tnCount = 0; - Fish[] collide = new Fish[NUM]; - int cCount = 0; - Fish nearest = null; - float dist = 99999; - - float tempA = angle; - - // Check boundaries - boolean inbound = (hasPredator>0) ? checkBounds(PI/16) : checkBounds( PI/24); - - - for (int i=0; i d ) { - dist = d; - nearest = fp; - } - if ( d <= avoidR ) { - tooNear[tnCount++] = fp; - if ( d <= avoidR/2 ) { - collide[cCount++] = fp; - } - } - } - } - - // Calc and make flocking behaviours - Fish[] near2 = new Fish[nCount]; - Fish[] tooNear2 = new Fish[tnCount]; - Fish[] collide2 = new Fish[cCount]; - - int j=0; - for (j=0; j d ) { - dist = d; - nearest = flocks[i]; - } - } - - // Move towards food - if (dist < range) { - - if (dist > range/2) { - speedChange( 0.5f ); - } - else { - speedChange( -0.5f ); - } - - turnTo( angle( nearest ), 0.05f ); - - float diffA = (angle - tempA)*10; - - float c = diffA*180/PI; - - energy += abs( c/150 ); - } - - // Check boundaries - checkBounds( PI/16 ); - - // Wriggle tail - wriggle(); - - } - - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde deleted file mode 100644 index 4db33ac72..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Branch.pde +++ /dev/null @@ -1,69 +0,0 @@ - -class Branch { - int x1, y1, z1, x2, y2, z2, id; - String xyz1, xyz2; // xyz1 = starting point; xyz2 = endingpoint - - Branch parent = null; - Branch[] children; - int childCounter = 0; - float len,angle; - - Branch(String _id, String _xyz1, String _xyz2) { - id = stringToInt(_id); - String[] tmpList = split(_xyz1,' '); - x1 = stringToInt(tmpList[0]); - y1 = stringToInt(tmpList[1]); - z1 = stringToInt(tmpList[2]); - tmpList = split(_xyz2,' '); - x2 = stringToInt(tmpList[0]); - y2 = stringToInt(tmpList[1]); - z2 = stringToInt(tmpList[2]); - xyz1 = _xyz1; - xyz2 = _xyz2; - children = new Branch[4]; - calc2Dcoords(); - } - - void calc2Dcoords() { - len = sqrt(sq(this.x2-this.x1)+sq(this.y2-this.y1)); - angle = atan2(this.y2-this.y1,this.x2-this.x1); - } - - int stringToInt(String s) { - Integer tmp = new Integer(s); - return tmp.intValue(); - } - - boolean checkParent(Branch _b) { - if((x2==_b.x1) && (y2==_b.y1) && (z2==_b.z1)) { - children[this.childCounter++] = _b; - return true; - } else { - return false; - } - } - - void checkForParents() { - for(int i=0;i"+this.id+" *** child(s) ->"); - for(int i=0;i"+parent.id); - } else { - print(" *** ROOT"); - } - println(""); - } - -} diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde deleted file mode 100644 index bd0f99cef..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Segment.pde +++ /dev/null @@ -1,156 +0,0 @@ - -class Segment { - - float x, y, z, len, angle; - float xAbsolute, yAbsolute, zAbsolute, angleAbsolute; - float originLength, futureLength; - - Segment parent = null; - Segment[] children = new Segment[4]; - int childCounter = 0; - int id; - int depth; - Branch branch = null; - - Segment(int _id) { id = _id;} - - void addChild(Segment _c) {children[childCounter++] = _c;} // println("adding child ->"+_c.id+" "+childCounter); - void setParent(Segment _p) {parent = _p;} - - void setXY(float _x,float _y) {x = _x; y = _y;} - void setX(float _x) {x = _x;} - void setY(float _y) {y = _y;} - void setZ(float _z) {z = _z;} - - void setAngle(float _a) {angle = _a;} - void setLength(float _len) {len = _len; originLength = _len; } - void setFutureToOrigin() {futureLength = originLength;} - void setFutureLength(float _len) {futureLength = _len;} - - void setXabsolute(float _xAbsolute) {xAbsolute = _xAbsolute;} - void setYabsolute(float _yAbsolute) {yAbsolute = _yAbsolute;} - void setZabsolute(float _zAbsolute) {zAbsolute = _zAbsolute;} - void setAngleAbsolute(float _angleAbsolute) {angleAbsolute = _angleAbsolute;} - - void scaleLength(float _scalar) {len *= _scalar;} - void scaleLengthFromOrigin(float _scalar) {len = originLength*_scalar;} - void scaleFutureLength(float _scalar) {futureLength *= _scalar;} - - float getX() {return x;} - float getY() {return y;} - float getZ() {return z;} - float getAngle() {return angle;} - float getLength() {return len;} - float getXabsolute() {return xAbsolute;} - float getYabsolute() {return yAbsolute;} - float getZabsolute() {return zAbsolute;} - float getAngleAbsolute() {return angleAbsolute;} - - void calcCoords() { - if(parent==null) { - angleAbsolute = angle; - setX(cos(radToPol(angle))*len); - setY(sin(radToPol(angle))*len); - setXabsolute(rootX+x); - setYabsolute(rootY-y); - } else { - angleAbsolute += ((parent.getAngleAbsolute()+angle)-angleAbsolute)/20; - setX(cos(radToPol(angleAbsolute))*len); - setY(sin(radToPol(angleAbsolute))*len); - setXabsolute(parent.getXabsolute()+x); - setYabsolute(parent.getYabsolute()-y); - } - } - - float radToPol(float _deg) { return _deg/57.2958; } - float polToRad(float _pol) { return _pol*57.2958; } - - void render() { - calcCoords(); - activateChildren(); - - originLength += (futureLength-originLength)/100; - len = originLength; - - if(parent==null) { - drawAsLine(rootX,rootY,getXabsolute(), getYabsolute()); - } else { - drawAsLine( parent.getXabsolute(), - parent.getYabsolute(), - getXabsolute(), - getYabsolute() - ); - } - } - - void activateChildren() { - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].render(); - } - } - } - - void setBranch(Branch _branch) { - branch = _branch; - try { - parent = s[branch.parent.id]; - for(int i=0;i<4;i++) { - if(branch.children[i]!=null) { - addChild(s[branch.children[i].id]); - } - } - } catch (NullPointerException npe) { - for(int i=0; i<4; i++) { - if(branch.children[i] != null) { - addChild(s[branch.children[i].id]); - } - } - } - } - - void setParamsFromBranch() { - try { - int tmp = branch.parent.id; - setParent(s[tmp]); - setAngle(polToRad(branch.angle)); - setAngleAbsolute(polToRad(branch.angle)); - } catch (NullPointerException npe){ - setParent(null); - setAngle(polToRad(branch.angle)); - setAngleAbsolute(polToRad(branch.angle)); - println("NULLPOINTER"); - } - setLength(branch.len); - } - - void adjustAngle(float _angle) { - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].adjustAngle(angle); - } - } - angle -= _angle; - } - - void adjustDepth(int _depth) { - depth = _depth; - for(int i=0;i<4;i++) { - if(children[i]!=null) { - children[i].adjustDepth(depth-1); - } - } - } - - void drawAsLine(float _x1, float _y1, float _x2, float _y2) { - strokeWeight(2); - if(id == redNum) { - stroke(255,0,0); - } else { - stroke(0, 80); - } - line(_x1,_y1,_x2,_y2); - } - -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde deleted file mode 100644 index 63c691c29..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_15_tree/Synthesis_15_tree.pde +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * Swingtree by Andreas Schlegel (www.sojamo.de) at ART+COM (www.artcom.de) - * p. 498 - * - * Loads a data file to create the connections of the tree elements. - * The size and motion is affected by the mouse. - */ - - -Branch[] b; -Segment[] s; - -int rootX; -int rootY; -int rootId; -int redNum = 139; - -float pX,pY; -int frameCounter = 0; - -void setup() { - size(400, 900); - rootX = width/2; - rootY = height; - parseTree(); - for(int i=0; i " + rootId); - - for(int i=0; ix&&mouseXy&&mouseYspeedFrictionThreshold) - fs *= speedFrictionThreshold/speed; - xv *= fs; - yv *= fs; - - x += xv; - y += yv; - - if (xwidth-radius) { - x -= x-(width-radius); - xv = -xv; - } - if (yheight-radius) { - y -= y-(height-radius); - yv = -yv; - } - } - - void clamp() { - if (xwidth-radius) { - x = width-radius; - } - if (yheight-radius) { - y = height-radius; - } - } - - void display() { - if (this == overMass) { - stroke(0x00,0x99,0xFF); - line(x,y,mouseX,mouseY); - noStroke(); - fill(0x00,0x99,0xFF); - } - else { - noStroke(); - fill(0); - } - ellipse(x,y,diamter,diamter); - } - - float distanceTo(Mass m) { - return distanceTo(m.x,m.y); - } - - float distanceTo(float x,float y) { - float dx = this.x-x; - float dy = this.y-y; - return sqrt(dx*dx+dy*dy); - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde deleted file mode 100644 index 25a9b1772..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Slider.pde +++ /dev/null @@ -1,48 +0,0 @@ - -class Slider extends Control { - float min,max,value; - int labelW = 8; - - Slider(int x, int y, int w, int h, float min, float max, float value,String label) { - super(x,y,w,h,label); - this.min = min; - this.max = max; - this.value = value; - } - - void mouseDragged() { - setValueToMouse(); - } - - boolean mousePressed() { - boolean down; - if (down = super.mousePressed()) - setValueToMouse(); - return down; - } - - void setValueToMouse() { - int mw = (w-labelW)-1; - float mv = (mouseX-(x+labelW+1.0))/mw; - if (mv>0) - value = min+(mv*mv)*(max-min); - else - value = min; - value = min(value,max); - } - - void drawContents() { - fill(0x00,0x99,0xFF); - noStroke(); - int mw = (w-labelW)-1; - float vw = sqrt((value-min)/(max-min))*mw; - rect(x+labelW+1,y+1,vw,h-1); - } - - void display() { - super.display(); - stroke(0x00,0x99,0xFF); - line(x+labelW,y,x+labelW,y+h); - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde deleted file mode 100644 index ba5cb5514..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Spring.pde +++ /dev/null @@ -1,81 +0,0 @@ - -class Spring { - Mass a,b; - float restLength; - - Spring(Mass a,Mass b) { - this.a = a; - this.b = b; - restLength = a.distanceTo(b); - } - - void display() { - if (this == overSpring) { - stroke(0x00,0x99,0xFF); - float vx = b.x-a.x; - float vy = b.y-a.y; - float dot = (vx*vx + vy*vy); - float rx = mouseX-a.x; - float ry = mouseY-a.y; - float dot2 = (vx*rx + vy*ry); - float value = dot2/dot; - value = min(value,1); - value = max(value,0); - float x = ((b.x*value)+(a.x*(1-value))); - float y = ((b.y*value)+(a.y*(1-value))); - line(x,y,mouseX,mouseY); - } - else { - stroke(0); - } - line(a.x,a.y,b.x,b.y); - } - - void applyForces() { - double d = a.distanceTo(b); - if (d>0) - { - double f = (d-restLength)*k.value; - double fH = (f/d)*(a.x-b.x); - double fV = (f/d)*(a.y-b.y); - a.xv -= fH; - a.yv -= fV; - b.xv += fH; - b.yv += fV; - } - } - - float distanceTo(float x,float y) { - if (x>(min(a.x,b.x)-mouseTolerance) - &&x<(max(a.x,b.x)+mouseTolerance) - &&y>(min(a.y,b.y)-mouseTolerance) - &&y<(max(a.y,b.y)+mouseTolerance)) - { - float vx = b.x-a.x; - float vy = b.y-a.y; - float dot = (vx*vx + vy*vy); - float rx = x-a.x; - float ry = y-a.y; - float dot2 = (vx*rx + vy*ry); - float value = dot2/dot; - - if (value<0) { - float d = a.distanceTo(x,y); - return d <= mouseTolerance?d:-1; - } else if (value>1) { - float d = b.distanceTo(x,y); - return d <= mouseTolerance?d:-1; - } - - float px = ((b.x*value)+(a.x*(1-value)))-x; - float py = ((b.y*value)+(a.y*(1-value)))-y; - - float d = sqrt(px*px+py*py); - - return d <= mouseTolerance?d:-1; - } - else - return -1; - } -} - diff --git a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde b/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde deleted file mode 100644 index 29e93cee5..000000000 --- a/java/examples/Books/Processing Handbook/Synthesis/Synthesis_16_sodaprocessing/Synthesis_16_sodaprocessing.pde +++ /dev/null @@ -1,329 +0,0 @@ -/** - * Synthesis 4: Structure and Interface - * SodaProcessing by Ed Burton (www.soda.co.k) - * p. 499 - * - * A simplified version of the Soda Constructor to demonstrate how it works. - * The complete Soda Constructor may be visited at http://www.sodaplay.com. - */ - -Mass masses[]; -int massCount = 0; - -float mouseTolerance = 15; - -Mass dragMass = null; -float dragDx,dragDy; -float tempDistance; - -Mass drawMass = null; -Mass overMass; - -Spring springs[]; -int springCount = 0; -Spring overSpring; - -Control controls[]; -Control activeControl = null; - -Button make,move,delete; -Slider g,f,k; -int sliderHeight = 13; - -float speedFrictionThreshold = 20; - -PFont font; - -int mode; -static final int MAKE = 0; -static final int MOVE = 1; -static final int DELETE = 2; - -String toolTips[]; - -void setup() -{ - size(600, 600); - background(0xFF); - - masses = new Mass[8]; - springs = new Spring[8]; - - font = loadFont("RotisSanSer-Bold.vlw.gz"); - textFont(font, 15); - //hint(SMOOTH_IMAGES); - smooth(); - controls = new Control[6]; - int x = 0; - int i = 0; - int controlWidth = width/(controls.length)+1; - controls[i++] = make = new Button(0,0,controlWidth-1,sliderHeight,"make"); - controls[i++] = move = new Button(controls[i-2].x+controls[i-2].w,0,controlWidth-1,sliderHeight,"move"); - controls[i++] = delete = new Button(controls[i-2].x+controls[i-2].w,0,controlWidth-1,sliderHeight,"delete"); - controls[i++] = g = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,4,0.0,"g"); - controls[i++] = f = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,1,0.1,"f"); - controls[i++] = k = new Slider(controls[i-2].x+controls[i-2].w,0,controlWidth,sliderHeight,0,0.75,0.5,"k"); - make.selected = true; - checkMode(); - - toolTips = new String [] { - ": click to make masses and springs" - ,": click, drag and throw masses" - ,": click to delete masses and springs" - ," = gravity (hint, set to zero to before choosing to make)" - ," = friction" - ," = spring stiffness"}; -} - -void draw() -{ - doUpdate(); - display(); -} - -void checkMode() { - for (int i = 0;i= 0) - deleteMassIndex(index); -} - -void deleteMassIndex(int index) { - if (index= 0) - deleteSpringIndex(index); -} - -void deleteSpringIndex(int index) { - if (index 100) { // If x is greater than 100 - x = -40; // Assign -40 to x - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde deleted file mode 100755 index 0dc1ffce8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_05/Ex_05.pde +++ /dev/null @@ -1,14 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - background(204); - // Assigns the horizontal value of the cursor to x - float x = mouseX; - // Assigns the vertical value of the cursor to y - float y = mouseY; - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde deleted file mode 100755 index 1d6623ab1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - diagonals(40, 90); - diagonals(60, 62); - diagonals(20, 40); -} - -void diagonals(int x, int y) { - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde deleted file mode 100755 index 5e2ee9ca5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_07/Ex_07.pde +++ /dev/null @@ -1,28 +0,0 @@ -int num = 20; -int[] dx = new int[num]; // Declare and create an array -int[] dy = new int[num]; // Declare and create an array - -void setup() { - size(100, 100); - for (int i=0; i 100) { - dx[i] = -100; - } - diagonals(dx[i], dy[i]); - } -} - -void diagonals(int x, int y) { - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde deleted file mode 100755 index 4df9de71b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/00 Using Processing/Ex_08/Ex_08.pde +++ /dev/null @@ -1,38 +0,0 @@ -Diagonals da, db; - -void setup() { - size(100, 100); - smooth(); - // Inputs: x, y, speed, thick, gray - da = new Diagonals(0, 80, 1, 2, 0); - db = new Diagonals(0, 55, 2, 6, 255); -} - -void draw() { - background(204); - da.update(); - db.update(); -} - -class Diagonals { - int x, y, speed, thick, gray; - - Diagonals(int xpos, int ypos, int s, int t, int g) { - x = xpos; - y = ypos; - speed = s; - thick = t; - gray = g; - } - void update() { - strokeWeight(thick); - stroke(gray); - line(x, y, x+20, y-40); - line(x+10, y, x+30, y-40); - line(x+20, y, x+40, y-40); - x = x + speed; - if (x > 100) { - x = -100; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde deleted file mode 100755 index 95baefd49..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Two forward slashes are used to denote a comment. -// All text on the same line is a part of the comment. -// There must be no spaces between the slashes. For example, -// the code "/ /" is not a comment and will cause an error -// If you want to have a comment that is many -// lines long, you may prefer to use the syntax for a -// multiline comment - -/* - A forward slash followed by an asterisk allows the - comment to continue until the opposite -*/ - -// All letters and symbols that are not comments are translated -// by the compiler. Because the following lines are not comments, -// they are run and draw a display window of 200 x 200 pixels -size(200, 200); -background(102); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde deleted file mode 100755 index 96380a327..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -// The size function has two parameters. The first sets the width -// of the display window and the second sets the height -size(200, 200); - -// This version of the background function has one parameter. -// It sets the gray value for the background of the display window -// in the range of 0 (black) to 255 (white) -background(102); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde deleted file mode 100755 index fd281381b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -size(200, 200); // Runs the size() function -int x; // Declares a new variable x -x = 102; // Assigns the value 102 to the variable x -background(x); // Runs the background() function diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde deleted file mode 100755 index 59791b825..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(200, 200); -Background(102); // ERROR! The B in "background" is capitalized \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde deleted file mode 100755 index 061c8de5a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(200, 200); -background(102); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde deleted file mode 100755 index b28dbf6a3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,5 +0,0 @@ -size -( 200, - 200) ; -background ( 102) - ; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde deleted file mode 100755 index 802b49bf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/01 Structure 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// To print text to the screen, place the desired output in quotes -println("Processing..."); // Prints "Processing..." to the console - -// To print the value of a variable, rather than its name, don't put -// the name of the variable in quotes. -int x = 20; -println(x); // Prints "20" to the console - -// While println() moves to the next line after the text -// is output, print() does not. -print("10"); -println("20"); // Prints "1020" to the console -println("30"); // Prints "30" to the console - -// The "+" operator can be used for combining multiple text -// elements into one line. -int x2 = 20; -int y2 = 80; -println(x2 + " : " + y2); // Prints "20 : 80" to the message window diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5156eb781..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 120 pixels wide -// and 200 pixels high -size(120, 200); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde deleted file mode 100755 index 3022a4fd7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 320 pixels wide -// and 240 pixels high -size(320, 240); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde deleted file mode 100755 index 95db6395e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Draw the display window 200 pixels wide -// and 120 pixels high -size(200, 120); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde deleted file mode 100755 index c6fa1fcbd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same X and Y parameters -// form a diagonal line from the -// upper-left corner to the lower-right corner -point(20, 20); -point(30, 30); -point(40, 40); -point(50, 50); -point(60, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde deleted file mode 100755 index 436a2f573..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same Y parameter have the -// same distance from the top and bottom -// edges of the frame -point(50, 30); -point(55, 30); -point(60, 30); -point(65, 30); -point(70, 30); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde deleted file mode 100755 index 976e508e4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Points with the same X parameter have the -// same distance from the left and right -// edge of the frame -point(70, 50); -point(70, 55); -point(70, 60); -point(70, 65); -point(70, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde deleted file mode 100755 index f54a56f78..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Placing a group of points next to one -// another creates a line -point(50, 50); -point(50, 51); -point(50, 52); -point(50, 53); -point(50, 54); -point(50, 55); -point(50, 56); -point(50, 57); -point(50, 58); -point(50, 59); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde deleted file mode 100755 index a734e6b9e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Setting points outside the display -// area will not cause an error, -// but the points won't be visible -point(-500, 100); -point(400, -600); -point(140, 2500); -point(2500, 100); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde deleted file mode 100755 index 1a3fd4cf1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When the y-coordinates for a line are the -// same, the line is horizontal -line(10, 30, 90, 30); -line(10, 40, 90, 40); -line(10, 50, 90, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde deleted file mode 100755 index 46419eb9f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When the x-coordinates for a line are the -// same, the line is vertical -line(40, 10, 40, 90); -line(50, 10, 50, 90); -line(60, 10, 60, 90); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde deleted file mode 100755 index b884549a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,5 +0,0 @@ -// When all four parameters are different, -// the lines are diagonal -line(25, 90, 80, 60); -line(50, 12, 42, 90); -line(45, 30, 18, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde deleted file mode 100755 index 2b40abf11..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,3 +0,0 @@ -// When two lines share the same point they connect -line(15, 20, 5, 80); -line(90, 65, 5, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde deleted file mode 100755 index f3ae8f1e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,4 +0,0 @@ -triangle(60, 10, 25, 60, 75, 65); // Filled triangle -line(60, 30, 25, 80); // Outlined triangle edge -line(25, 80, 75, 85); // Outlined triangle edge -line(75, 85, 60, 30); // Outlined triangle edge diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde deleted file mode 100755 index 02f6b57e4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,4 +0,0 @@ -triangle(55, 9, 110, 100, 85, 100); -triangle(55, 9, 85, 100, 75, 100); -triangle(-1, 46, 16, 34, -7, 100); -triangle(16, 34, -7, 100, 40, 100); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde deleted file mode 100755 index 0e1b88969..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1 +0,0 @@ -quad(38, 31, 86, 20, 69, 63, 30, 76); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde deleted file mode 100755 index 670399eee..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,2 +0,0 @@ -quad(20, 20, 20, 70, 60, 90, 60, 40); -quad(20, 20, 70, -20, 110, 0, 60, 40); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde deleted file mode 100755 index a4053738e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,2 +0,0 @@ -rect(15, 15, 40, 40); // Large square -rect(55, 55, 25, 25); // Small square diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde deleted file mode 100755 index 1b528ab03..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,6 +0,0 @@ -rect(0, 0, 90, 50); -rect(5, 50, 75, 4); -rect(24, 54, 6, 6); -rect(64, 54, 6, 6); -rect(20, 60, 75, 10); -rect(10, 70, 80, 2); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde deleted file mode 100755 index 1778c4c51..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,2 +0,0 @@ -ellipse(40, 40, 60, 60); // Large circle -ellipse(75, 75, 32, 32); // Small circle diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde deleted file mode 100755 index c86e00271..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,3 +0,0 @@ -ellipse(35, 0, 120, 120); -ellipse(38, 62, 6, 6); -ellipse(40, 100, 70, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde deleted file mode 100755 index be92b8d79..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,6 +0,0 @@ -bezier(32, 20, 80, 5, 80, 75, 30, 75); -// Draw the control points -line(32, 20, 80, 5); -ellipse(80, 5, 4, 4); -line(80, 75, 30, 75); -ellipse(80, 75, 4, 4); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde deleted file mode 100755 index 0cef70aae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_22/Ex_22.pde +++ /dev/null @@ -1,6 +0,0 @@ -bezier(85, 20, 40, 10, 60, 90, 15, 80); -// Draw the control points -line(85, 20, 40, 10); -ellipse(40, 10, 4, 4); -line(60, 90, 15, 80); -ellipse(60, 90, 4, 4); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde deleted file mode 100755 index 52fa4d21c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_23/Ex_23.pde +++ /dev/null @@ -1,2 +0,0 @@ -rect(15, 15, 50, 50); // Bottom -ellipse(60, 60, 55, 55); // Top diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde deleted file mode 100755 index 9f3e7a90c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_24/Ex_24.pde +++ /dev/null @@ -1,2 +0,0 @@ -ellipse(60, 60, 55, 55); // Bottom -rect(15, 15, 50, 50); // Top diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde deleted file mode 100755 index 7ebef58c1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_25/Ex_25.pde +++ /dev/null @@ -1 +0,0 @@ -background(0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde deleted file mode 100755 index e48c9887a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_26/Ex_26.pde +++ /dev/null @@ -1 +0,0 @@ -background(124); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde deleted file mode 100755 index 34d4c0da7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_27/Ex_27.pde +++ /dev/null @@ -1 +0,0 @@ -background(230); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde deleted file mode 100755 index 1feed8ca2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_28/Ex_28.pde +++ /dev/null @@ -1,7 +0,0 @@ -rect(10, 10, 50, 50); -fill(204); // Light gray -rect(20, 20, 50, 50); -fill(153); // Middle gray -rect(30, 30, 50, 50); -fill(102); // Dark gray -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde deleted file mode 100755 index 36a0de381..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_29/Ex_29.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(0); -rect(10, 10, 50, 50); -stroke(102); // Dark gray -rect(20, 20, 50, 50); -stroke(153); // Middle gray -rect(30, 30, 50, 50); -stroke(204); // Light gray -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde deleted file mode 100755 index 66989a9e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_30/Ex_30.pde +++ /dev/null @@ -1,6 +0,0 @@ -fill(255); // White -rect(10, 10, 50, 50); -rect(20, 20, 50, 50); -rect(30, 30, 50, 50); -fill(0); // Black -rect(40, 40, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde deleted file mode 100755 index a386aaa96..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_31/Ex_31.pde +++ /dev/null @@ -1,4 +0,0 @@ -background(0); -fill(255, 220); -rect(15, 15, 50, 50); -rect(35, 35, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde deleted file mode 100755 index cecfa7513..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_32/Ex_32.pde +++ /dev/null @@ -1,8 +0,0 @@ -fill(0); -rect(0, 40, 100, 20); -fill(255, 51); // Low opacity -rect(0, 20, 33, 60); -fill(255, 127); // Medium opacity -rect(33, 20, 33, 60); -fill(255, 204); // High opacity -rect(66, 20, 33, 60); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde deleted file mode 100755 index 24cc6d6e9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_33/Ex_33.pde +++ /dev/null @@ -1,4 +0,0 @@ -rect(10, 10, 50, 50); -noFill(); // Disable the fill -rect(20, 20, 50, 50); -rect(30, 30, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde deleted file mode 100755 index d7f85b70f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_34/Ex_34.pde +++ /dev/null @@ -1,4 +0,0 @@ -rect(20, 15, 20, 70); -noStroke(); // Disable the stroke -rect(50, 15, 20, 70); -rect(80, 15, 20, 70); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde deleted file mode 100755 index c37670bbf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_35/Ex_35.pde +++ /dev/null @@ -1,3 +0,0 @@ -ellipse(30, 48, 36, 36); -smooth(); -ellipse(70, 48, 36, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde deleted file mode 100755 index 736a97f35..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_36/Ex_36.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(30, 48, 36, 36); -noSmooth(); -ellipse(70, 48, 36, 36); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde deleted file mode 100755 index 7a1293551..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_37/Ex_37.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -line(20, 20, 80, 20); // Default line weight of 1 -strokeWeight(6); -line(20, 40, 80, 40); // Thicker line -strokeWeight(18); -line(20, 70, 80, 70); // Beastly line \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde deleted file mode 100755 index 2d9c0876b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_38/Ex_38.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(12); -strokeCap(ROUND); -line(20, 30, 80, 30); // Top line -strokeCap(SQUARE); -line(20, 50, 80, 50); // Middle line -strokeCap(PROJECT); -line(20, 70, 80, 70); // Bottom line diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde deleted file mode 100755 index e504a13a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_39/Ex_39.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(12); -strokeJoin(BEVEL); -rect(12, 33, 15, 33); // Left shape -strokeJoin(MITER); -rect(42, 33, 15, 33); // Middle shape -strokeJoin(ROUND); -rect(72, 33, 15, 33); // Right shape diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde deleted file mode 100755 index 2444927e2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_40/Ex_40.pde +++ /dev/null @@ -1,11 +0,0 @@ -smooth(); -noStroke(); -ellipseMode(RADIUS); -fill(126); -ellipse(33, 33, 60, 60); // Gray ellipse -fill(255); -ellipseMode(CORNER); -ellipse(33, 33, 60, 60); // White ellipse -fill(0); -ellipseMode(CORNERS); -ellipse(33, 33, 60, 60); // Black ellipse \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde b/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde deleted file mode 100755 index 45e26b32e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/02 Shape 1/Ex_41/Ex_41.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -rectMode(CORNER); -fill(126); -rect(40, 40, 60, 60); // Gray ellipse -rectMode(CENTER); -fill(255); -rect(40, 40, 60, 60); // White ellipse -rectMode(CORNERS); -fill(0); -rect(40, 40, 60, 60); // Black ellipse \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde deleted file mode 100755 index 89594ff23..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -int x; // Declare the variable x of type int -float y; // Declare the variable y of type float -boolean b; // Declare the variable b of type boolean -x = 50; // Assign the value 50 to x -y = 12.6; // Assign the value 12.6 to f -b = true; // Assign the value true to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde deleted file mode 100755 index b00dc26eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 50; -float y = 12.6; -boolean b = true; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde deleted file mode 100755 index 1f8fc600b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -float x, y, z; -x = -3.9; -y = 10.1; -z = 124.23; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde deleted file mode 100755 index 99266daf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 69; // Assign 69 to x -x = 70; // Assign 70 to x -int x = 71; // ERROR! The data type for x is duplicated diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde deleted file mode 100755 index 713822fa1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Error! The left side of an assignment must be a variable -5 = 12; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde deleted file mode 100755 index 06c4a4f37..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Error! It's not possible to fit a floating point number into an int -int x = 24.8; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde deleted file mode 100755 index ae7c113a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -float f = 12.5; -// Error! It's not possible to fit a floating point number into an int -int y = f; diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde deleted file mode 100755 index 905e9f715..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1 +0,0 @@ -println(width + ", " + height); // Prints 100, 100 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde deleted file mode 100755 index d609463d9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(300, 400); -println(width + ", " + height); // Prints 300, 400 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde deleted file mode 100755 index 560cb6fe8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,2 +0,0 @@ -size(1280, 1024); -println(width + ", " + height); // Prints 1280, 1024 to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde deleted file mode 100755 index cfb9681c3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/03 Data 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -size(100, 100); -ellipse(width*0.5, height*0.5, width*0.66, height*0.66); -line(width*0.5, 0, width*0.5, height); -line(0, height*0.5, width, height*0.5); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde deleted file mode 100755 index 686245d97..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,6 +0,0 @@ -int grayVal = 153; -fill(grayVal); -rect(10, 10, 55, 55); // Draw gray rectangle -grayVal = grayVal + 102; // Assign 255 to grayVal -fill(grayVal); -rect(35, 30, 55, 55); // Draw white triangle diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde deleted file mode 100755 index c72317580..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -int a = 30; -line(a, 0, a, height); -a = a + 40; // Assign 70 to a -strokeWeight(4); -line(a, 0, a, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde deleted file mode 100755 index 59aabc84c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,7 +0,0 @@ -int a = 30; -int b = 40; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -// The result of a calculation can be used as input to a function -line(b-a, 0, b-a, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde deleted file mode 100755 index eda7bca7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 8; -int b = 10; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -line(a*b, 0, a*b, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde deleted file mode 100755 index 7436baf8b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 8; -int b = 10; -line(a, 0, a, height); -line(b, 0, b, height); -strokeWeight(4); -line(a/b, 0, a/b, height); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde deleted file mode 100755 index 5e7006a90..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -int y = 20; -line(0, y, width, y); -y = y + 6; // Assign 26 to y -line(0, y, width, y); -y = y + 6; // Assign 32 to y -line(0, y, width, y); -y = y + 6; // Assign 38 to y -line(0, y, width, y); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde deleted file mode 100755 index ab521185e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 20; -line(0, y, width, y); -y = y * 1.6; // Assign 32 to y -line(0, y, width, y); -y = y * 1.6; // Assign 51.2 to y -line(0, y, width, y); -y = y * 1.6; // Assign 81.920006 to y -line(0, y, width, y); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde deleted file mode 100755 index a3b824bb5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,4 +0,0 @@ -println(4/3); // Prints "1" -println(4.0/3); // Prints "1.3333334" -println(4/3.0); // Prints "1.3333334" -println(4.0/3.0); // Prints "1.3333334" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde deleted file mode 100755 index 605673c03..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -int a = 4/3; // Assign 1 to a -int b = 3/4; // Assign 0 to b -int c = 4.0/3; // ERROR! -int d = 4.0/3.0; // ERROR! -float e = 4.0/3; // Assign 1.3333334 to e -float f = 4.0/3.0; // Assign 1.3333334 to f diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde deleted file mode 100755 index 591ba1406..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,2 +0,0 @@ -float a = 4/3; // Assign 1.0 to a -float b = 3/4; // Assign 0.0 to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde deleted file mode 100755 index d18af8dc7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 4; -float f = 3.0; -int a = i/f; // ERROR! Assigning a float value to an int variable -float b = i/f; // Assign 1.3333334 to b diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde deleted file mode 100755 index dbbefddb4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,2 +0,0 @@ -int a = 0; -int b = 12/a; // ERROR! ArithmeticException: / by zero diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde deleted file mode 100755 index 447cb965f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,4 +0,0 @@ -float a = 0.0001; -float b = 12/a; // Assign 120000.0 to b - - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde deleted file mode 100755 index 832d87edf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,2 +0,0 @@ -int x = 3 + 4 * 5; // Assign 23 to x -int y = (3 + 4) * 5; // Assign 35 to y diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde deleted file mode 100755 index f6e891a30..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,2 +0,0 @@ -int x = 10 * 20 + 5; // Assign 205 to x -int y = (10 * 20) + 5; // Assign 205 to y diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde deleted file mode 100755 index 43b78c19f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 1; -println(x); // Prints "1" to the console -x++; // Equivalent to x = x + 1 -println(x); // Prints "2" to the console - -int y = 1; -println(y); // Prints "1" to the console -y--; // Equivalent to y = y - 1 -println(y); // Prints "0" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde deleted file mode 100755 index caff0cc8a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 1; -println(x++); // Prints "1" to the console -println(x); // Prints "2" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde deleted file mode 100755 index 89b1981a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 1; -println(++x); // Prints "2" to the console -println(x); // Prints "2" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde deleted file mode 100755 index daf8a63fb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 1; -println(x); // Prints "1" to the console -x += 5; // Equivalent to x = x + 5 -println(x); // Prints "6" to the console - -int y = 1; -println(y); // Prints "1" to the console -y -= 5; // Equivalent to y = y - 5 -println(y); // Prints "-4" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde deleted file mode 100755 index b7a9db96c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,9 +0,0 @@ -int x = 4; -println(x); // Prints "4" to the console -x *= 2; // Equivalent to x = x * 2 -println(x); // Prints "8" to the console - -int y = 4; -println(y); // Prints "4" to the console -y /= 2; // Equivalent to y = y / 2 -println(y); // Prints "2" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde deleted file mode 100755 index 27e0d2f4b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = 5; // Assigns 5 to x -x = -x; // Equivalent to x = x * -1 -println(x); // Prints "-5" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde deleted file mode 100755 index 40eb07cff..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_22/Ex_22.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = ceil(2.0); // Assign 2 to w -int x = ceil(2.1); // Assign 3 to x -int y = ceil(2.5); // Assign 3 to y -int z = ceil(2.9); // Assign 3 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde deleted file mode 100755 index 1b98ad531..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_23/Ex_23.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = floor(2.0); // Assign 2 to w -int x = floor(2.1); // Assign 2 to x -int y = floor(2.5); // Assign 2 to y -int z = floor(2.9); // Assign 2 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde deleted file mode 100755 index 5fcba8f53..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_24/Ex_24.pde +++ /dev/null @@ -1,4 +0,0 @@ -int w = round(2.0); // Assign 2 to w -int x = round(2.1); // Assign 2 to x -int y = round(2.5); // Assign 3 to y -int z = round(2.9); // Assign 3 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde deleted file mode 100755 index c03e6bce8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_25/Ex_25.pde +++ /dev/null @@ -1 +0,0 @@ -float w = round(2.1); // Assign 2.0 to w \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde b/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde deleted file mode 100755 index 5b095d326..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/04 Math 1/Ex_26/Ex_26.pde +++ /dev/null @@ -1,6 +0,0 @@ -int u = min(5, 9); // Assign 5 to u -int v = min(-4, -12, -9); // Assign -12 to v -float w = min(12.3, 230.24); // Assign 12.3 to w -int x = max(5, 9); // Assign 9 to x -int y = max(-4, -12, -9); // Assign -4 to y -float z = max(12.3, 230.24); // Assign 230.24 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde deleted file mode 100755 index d95a460e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -println(3 > 5); // Prints "false" -println(5 > 3); // Prints "true" -println(5 > 5); // Prints "false" - -println(3 < 5); // Prints "true" -println(5 < 3); // Prints "false" -println(5 < 5); // Prints "false" - -println(3 >= 5); // Prints "false" -println(5 >= 3); // Prints "true" -println(5 >= 5); // Prints "true" - -println(3 <= 5); // Prints "true" -println(5 <= 3); // Prints "false" -println(5 <= 5); // Prints "true" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde deleted file mode 100755 index af88e9c89..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -println(3 == 5); // Prints "false" -println(5 == 3); // Prints "false" -println(5 == 5); // Prints "true" - -println(3 != 5); // Prints "true" -println(5 != 3); // Prints "true" -println(5 != 5); // Prints "false" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde deleted file mode 100755 index 2fc67ae01..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -// The text expressions are "x > 100" and "x < 100" -// Because x is 150, the code inside the first block -// runs and the ellipse draws, but the code in the second -// block is not run and the rectangle is not drawn -int x = 150; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100 - rect(35, 35, 30, 30); // draw this rectangle -} -line(20, 20, 80, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde deleted file mode 100755 index f3627ed1b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Because x is 50, only the rectangle draws -int x = 50; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde deleted file mode 100755 index d0de5a65e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Because x is 100, only the line draws -int x = 100; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse -} -if (x < 100) { // If x is less than 100, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); - - - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde deleted file mode 100755 index 7dcfdda6d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Because x is 90, only the rectangle draws -int x = 90; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse. -} else { // Otherwise, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde deleted file mode 100755 index 84d03bf1b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Because x is 190, only the ellipse draws -int x = 290; -if (x > 100) { // If x is greater than 100, - ellipse(50, 50, 36, 36); // draw this ellipse. -} else { // Otherwise, - rect(33, 33, 34, 34); // draw this rectangle -} -line(20, 20, 80, 80); - diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde deleted file mode 100755 index a3ec4acba..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,14 +0,0 @@ -// If x is greater than 100 and less than 300, draw the -// ellipse. If x is greater than or equal to 300, draw -// the line. If x is not greater than 100, draw the -// rectangle. Because x is 420, only the line draws. -int x = 420; -if (x > 100) { // First test to draw ellipse or line - if (x < 300) { // Second test determines which to draw - ellipse(50, 50, 36, 36); - } else { - line(50, 0, 50, 100); - } -} else { - rect(33, 33, 34, 34); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde deleted file mode 100755 index 6e470009b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,13 +0,0 @@ -// If x is less than or equal to 100, then draw -// the rectangle. Otherwise, if x is greater than -// or equal to 300, draw the line. If x is between -// 100 and 300, draw the ellipse. Because x is 101, -// only the ellipse draws. -int x = 101; -if (x <= 100) { - rect(33, 33, 34, 34); -} else if (x >= 300) { - line(50, 0, 50, 100); -} else { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde deleted file mode 100755 index 6954152b7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,15 +0,0 @@ -int a = 10; -int b = 20; -// The expression "a > 5" must be true OR "b < 30" -// must be true. Because they are both true, the code -// in the block will run. -if ((a > 5) || (b < 30)) { - line(20, 50, 80, 50); -} -// The expression "a > 15" is false, but "b < 30" -// is true. Because the OR operator requires only one part -// to be true in the entire expression, the code in the -// block will run. -if ((a > 15) || (b < 30)) { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde deleted file mode 100755 index cce0901ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,14 +0,0 @@ -int a = 10; -int b = 20; -// The expression "a > 5" must be true AND "b < 30" -// must be true. Because they are both true, the code -// in the block will run. -if ((a > 5) && (b < 30)) { - line(20, 50, 80, 50); -} -// The expression "a > 15" is false, but "b < 30" is -// true. Because the AND operator requires both to be -// true, the code in the block will not run. -if ((a > 15) && (b < 30)) { - ellipse(50, 50, 36, 36); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde deleted file mode 100755 index e46a25927..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -boolean b = true; // Assign true to b -println(b); // Prints "true" -println(!b); // Prints "false" -b = !b; // Assign false to b -println(b); // Prints "false" -println(!b); // Prints "true" -println(5 > 3); // Prints "true" -println(!(5 > 3)); // Prints "false" -int x = 5; -println(!x); // ERROR! It's only possible to ! a boolean variable \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde deleted file mode 100755 index 48edc1f46..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/05 Control 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Because b is true, the line draws -boolean b = true; -if (b == true) { // If b is true, - line(20, 50, 80, 50); // draw the line -} -if (!b == true) { // If b is false, - ellipse(50, 50, 36, 36); // draw the ellipse -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde deleted file mode 100755 index 977a31635..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,8 +0,0 @@ -// The init is "int i = 20", the test is "i < 80", -// and the update is "i += 5". Notice the semicolon -// terminating the first two elements -for (int i = 20; i < 80; i += 5) { - // This line will continue to run until "i" - // is greater than or equal to 80 - line(20, i, 80, i+15); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6e2bc070a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -for (int x=-16; x<100; x+=10) { - line(x, 0, x+15, 50); -} -strokeWeight(4); -for (int x=-8; x<100; x+=10) { - line(x, 50, x+15, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde deleted file mode 100755 index 5b1c885c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -noFill(); -for (int d = 150; d > 0; d -= 10) { - ellipse(50, 50, d, d); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde deleted file mode 100755 index 715f172ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -for (int i=0; i<100; i+=2) { - stroke(255-i); - line(i, 0, i, 200); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde deleted file mode 100755 index e5862b727..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (int y=10; y<100; y+=10) { - point(10, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde deleted file mode 100755 index c615a3f7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (int x = 10; x < 100; x += 10) { - point(x, 10); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde deleted file mode 100755 index 0a9b7dc19..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,5 +0,0 @@ -for (int y = 10; y < 100; y += 10) { - for (int x = 10; x < 100; x += 10) { - point(x, y); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde deleted file mode 100755 index 911131456..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -fill(0, 76); -noStroke(); -smooth(); -for (int y = -10; y <= 100; y += 10) { - for (int x = -10; x <= 100; x += 10) { - ellipse(x + y/8.0, y + x/8.0, 15 + x/2, 10); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde deleted file mode 100755 index d434817f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,7 +0,0 @@ -noStroke(); -for (int y=0; y<100; y+=10) { - for (int x=0; x<100; x+=10) { - fill((x+y) * 1.4); - rect(x, y, 10, 10); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde deleted file mode 100755 index 1e9a2069d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int y=1; y<100; y+=10) { - for (int x=1; x 100) { - line(20, 20, 80, 80); -} else { - line(80, 20, 20, 80); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde deleted file mode 100755 index 093d77cc1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -int x = 50; - -if (x > 100) -{ - line(20, 20, 80, 80); -} -else -{ - line(20, 80, 80, 20); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde deleted file mode 100755 index 6a715a41c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/06 Control 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,11 +0,0 @@ -int x = 50; - -if (x > 100) { -line(20, 20, 80, 80); -} else { -line(80, 20, 20, 80); -} - -for (int i=0; i<100; i+=2) { -line(20, i, 80, i); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde deleted file mode 100755 index c7a59bb3d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde deleted file mode 100755 index 2f9e656c3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(CLOSE); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde deleted file mode 100755 index fa638ff28..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -beginShape(); -vertex(30, 20); -vertex(85, 20); -vertex(30, 75); -vertex(85, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde deleted file mode 100755 index 535d46c6b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,11 +0,0 @@ -fill(0); -noStroke(); -smooth(); -beginShape(); -vertex(10, 0); -vertex(100, 30); -vertex(90, 70); -vertex(100, 70); -vertex(10, 90); -vertex(50, 40); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde deleted file mode 100755 index 3f5cd6c1c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -noFill(); -smooth(); -strokeWeight(20); -beginShape(); -vertex(52, 29); -vertex(74, 35); -vertex(60, 52); -vertex(61, 75); -vertex(40, 69); -vertex(19, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde deleted file mode 100755 index 55cf3542f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -fill(0); -beginShape(); -vertex(40, 10); -for (int i = 20; i <= 100; i += 5) { - vertex(20, i); - vertex(30, i); -} -vertex(40, 100); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde deleted file mode 100755 index cd29d6421..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Draws a point at each vertex -beginShape(POINTS); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde deleted file mode 100755 index 69f8f1a41..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Draws a line between each pair of vertices -beginShape(LINES); -vertex(30, 20); -vertex(85, 20); -vertex(85, 75); -vertex(30, 75); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde deleted file mode 100755 index 05d590723..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Connects each grouping of three vertices as a triangle -beginShape(TRIANGLES); -vertex(75, 30); -vertex(10, 20); -vertex(75, 50); -vertex(20, 60); -vertex(90, 70); -vertex(35, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde deleted file mode 100755 index 9f60ff566..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Starting with the third vertex, connects each -// subsequent vertex to the previous two -beginShape(TRIANGLE_STRIP); -vertex(75, 30); -vertex(10, 20); -vertex(75, 50); -vertex(20, 60); -vertex(90, 70); -vertex(35, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde deleted file mode 100755 index a2714ae29..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,7 +0,0 @@ -beginShape(TRIANGLE_FAN); -vertex(10, 20); -vertex(75, 30); -vertex(75, 50); -vertex(90, 70); -vertex(10, 20); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde deleted file mode 100755 index f5d979e3a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,10 +0,0 @@ -beginShape(QUADS); -vertex(30, 25); -vertex(85, 30); -vertex(85, 50); -vertex(30, 45); -vertex(30, 60); -vertex(85, 65); -vertex(85, 85); -vertex(30, 80); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde deleted file mode 100755 index deafeb3b6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,10 +0,0 @@ -beginShape(QUAD_STRIP); -vertex(30, 25); -vertex(85, 30); -vertex(30, 45); -vertex(85, 50); -vertex(30, 60); -vertex(85, 65); -vertex(30, 80); -vertex(85, 85); -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde deleted file mode 100755 index 8033658e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); -noFill(); -beginShape(); -curveVertex(20, 80); // C1 (see p.76) -curveVertex(20, 40); // V1 -curveVertex(30, 30); // V2 -curveVertex(40, 80); // V3 -curveVertex(80, 80); // C2 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde deleted file mode 100755 index 788a9bb75..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,5 +0,0 @@ -noFill(); -beginShape(); -vertex(32, 20); // V1 (see p.76) -bezierVertex(80, 5, 80, 75, 30, 75); // C1, C2, V2 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde deleted file mode 100755 index caebf4d86..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,7 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 30); // V1 (see p.76) -bezierVertex(20, -5, 70, 5, 40, 35); // C1, C2, V2 -bezierVertex(5, 70, 45, 105, 70, 70); // C3, C4, V3 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde deleted file mode 100755 index caebf4d86..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,7 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 30); // V1 (see p.76) -bezierVertex(20, -5, 70, 5, 40, 35); // C1, C2, V2 -bezierVertex(5, 70, 45, 105, 70, 70); // C3, C4, V3 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde deleted file mode 100755 index 179527d4b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/07 Shape 2/Ex_18/Ex_18.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); -noFill(); -beginShape(); -vertex(15, 40); // V1 (see p.76) -bezierVertex(5, 0, 80, 0, 50, 55); // C1, C2, V2 -vertex(30, 45); // V3 -vertex(25, 75); // V4 -bezierVertex(50, 70, 75, 90, 80, 70); // C3, C4, V5 -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde deleted file mode 100755 index c5fc7d6fa..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = sq(1); // Assign 1 to a: Equivalent to 1 * 1 -float b = sq(-5); // Assign 25 to b: Equivalent to -5 * -5 -float c = sq(9); // Assign 81 to c: Equivalent to 9 * 9 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde deleted file mode 100755 index d55bd3631..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = sqrt(6561); // Assign 81 to a -float b = sqrt(625); // Assign 25 to b -float c = sqrt(1); // Assign 1 to c \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde deleted file mode 100755 index 7c1c3cff0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -float a = pow(1, 3); // Assign 1.0 to a: Equivalent to 1*1*1 -float b = pow(3, 4); // Assign 81.0 to b: Equivalent to 3*3*3*3 -float c = pow(3, -2); // Assign 0.11 to c: Equivalent to 1 / 3*3 -float d = pow(-3, 3); // Assign -27.0 to d: Equivalent to -3*-3*-3 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde deleted file mode 100755 index 6a11fa3a9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -float a = pow(8, 0); // Assign 1 to a -float b = pow(3, 1); // Assign 3 to b -float c = pow(4, 1); // Assign 4 to c \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde deleted file mode 100755 index 9d042c510..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = norm(0.0, 0.0, 255.0); // Assign 0.0 to x -float y = norm(102.0, 0.0, 255.0); // Assign 0.4 to y -float z = norm(255.0, 0.0, 255.0); // Assign 1.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde deleted file mode 100755 index fe309ed57..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = lerp(-20.0, 60.0, 0.0); // Assign -20.0 to x -float y = lerp(-20.0, 60.0, 0.5); // Assign 20.0 to y -float z = lerp(-20.0, 60.0, 1.0); // Assign 60.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde deleted file mode 100755 index bbd1f1d92..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = map(20.0, 0.0, 255.0, -1.0, 1.0); // Assign -0.84 to x -float y = map(0.0, 0.0, 255.0, -1.0, 1.0); // Assign -1.0 to y -float z = map(255.0, 0.0, 255.0, -1.0, 1.0); // Assign 1.0 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde deleted file mode 100755 index c0b7d668e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int x = 0; x < 100; x++) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 4); // Calculate curve - y *= 100; // Range 0.0 to 100.0 - point(x, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde deleted file mode 100755 index f0f9e967d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int x = 0; x < 100; x++) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 0.4); // Calculate curve - y *= 100; // Range 0.0 to 100.0 - point(x, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde deleted file mode 100755 index 2f2e56c5f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Draw circles at points along the curve y = x^4 -noFill(); -smooth(); -for (int x = 0; x < 100; x += 5) { - float n = norm(x, 0.0, 100.0); // Range 0.0 to 1.0 - float y = pow(n, 4); // Calculate curve - y *= 100; // Scale y to range 0.0 to 100.0 - strokeWeight(n * 5); // Increase thickness - ellipse(x, y, 120, 120); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde deleted file mode 100755 index de5275bde..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw a line from the top of the display window to -// points on a curve y = x^4 from x in range -1.0 to 1.0 -for (int x = 5; x < 100; x += 5) { - float n = map(x, 5, 95, -1, 1); - float p = pow(n, 4); - float ypos = lerp(20, 80, p); - line(x, 0, x, ypos); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde deleted file mode 100755 index de5275bde..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/08 Math 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw a line from the top of the display window to -// points on a curve y = x^4 from x in range -1.0 to 1.0 -for (int x = 5; x < 100; x += 5) { - float n = map(x, 5, 95, -1, 1); - float p = pow(n, 4); - float ypos = lerp(20, 80, p); - line(x, 0, x, ypos); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde deleted file mode 100755 index 92971b4d7..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1 +0,0 @@ -background(242, 204, 47); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde deleted file mode 100755 index 01994bba4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1 +0,0 @@ -background(174, 221, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde deleted file mode 100755 index a117663ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -background(129, 130, 87); -noStroke(); -fill(174, 221, 60); -rect(17, 17, 66, 66); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde deleted file mode 100755 index e0fba09ea..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -background(129, 130, 87); -noFill(); -strokeWeight(4); -stroke(174, 221, 60); -rect(19, 19, 62, 62); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde deleted file mode 100755 index e105c7947..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -background(116, 193, 206); -noStroke(); -fill(129, 130, 87, 102); // More transparent -rect(20, 20, 30, 60); -fill(129, 130, 87, 204); // Less transparent -rect(50, 20, 30, 60); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde deleted file mode 100755 index d62471109..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(116, 193, 206); -int x = 0; -noStroke(); -for (int i = 51; i <= 255; i += 51) { - fill(129, 130, 87, i); - rect(x, 20, 20, 60); - x += 20; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde deleted file mode 100755 index 2e789774c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,7 +0,0 @@ -background(56, 90, 94); -smooth(); -strokeWeight(12); -stroke(242, 204, 47, 102); // More transparency -line(30, 20, 50, 80); -stroke(242, 204, 47, 204); // Less transparency -line(50, 20, 70, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde deleted file mode 100755 index b5a058e58..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(56, 90, 94); -smooth(); -int x = 0; -strokeWeight(12); -for (int i = 51; i <= 255; i += 51) { - stroke(242, 204, 47, i); - line(x, 20, x+20, 80); - x += 20; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde deleted file mode 100755 index fc730d6e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -noStroke(); -smooth(); -fill(242, 204, 47, 160); // Yellow -ellipse(47, 36, 64, 64); -fill(174, 221, 60, 160); // Green -ellipse(90, 47, 64, 64); -fill(116, 193, 206, 160); // Blue -ellipse(57, 79, 64, 64); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde deleted file mode 100755 index 1ee13d798..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(255); -noStroke(); -smooth(); -fill(242, 204, 47, 160); // Yellow -ellipse(47, 36, 64, 64); -fill(174, 221, 60, 160); // Green -ellipse(90, 47, 64, 64); -fill(116, 193, 206, 160); // Blue -ellipse(57, 79, 64, 64); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde deleted file mode 100755 index 73f49eb06..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c1 = color(51); // Creates gray -color c2 = color(51, 204); // Creates gray with transparency -color c3 = color(51, 102, 153); // Creates blue -color c4 = color(51, 102, 153, 51); // Creates blue with transparency \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde deleted file mode 100755 index 545a9b9dd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,6 +0,0 @@ -color ruby = color(211, 24, 24, 160); -color pink = color(237, 159, 176); -background(pink); -noStroke(); -fill(ruby); -rect(35, 0, 20, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde deleted file mode 100755 index 93c72f1ea..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,2 +0,0 @@ -// Set the range for the red, green, and blue values from 0.0 to 1.0 -colorMode(RGB, 1.0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde deleted file mode 100755 index 1a07807a0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,3 +0,0 @@ -// Set the range for the hue to values from 0 to 360 and the -// saturation and brightness to values between 0 and 100 -colorMode(HSB, 360, 100, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde deleted file mode 100755 index 9ddcb65c6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the hue, saturation and brightness constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(i*2.5, 255, 255); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde deleted file mode 100755 index 5b56d2993..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the saturation, hue and brightness constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(132, i*2.5, 204); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde deleted file mode 100755 index 8f4dd60b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Change the brightness, hue and saturation constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - stroke(132, 108, i*2.5); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde deleted file mode 100755 index 090d7e3a1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Change the saturation and brightness, hue constant -colorMode(HSB); -for (int i = 0; i < 100; i++) { - for (int j = 0; j < 100; j++) { - stroke(132, j*2.5, i*2.5); - point(i, j); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde deleted file mode 100755 index a86450793..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Shift from blue to green in RGB mode -colorMode(RGB); -for (int i = 0; i < 100; i++) { - float r = 61 + (i*0.92); - float g = 156 + (i*0.48); - float b = 204 - (i*1.43); - stroke(r, g, b); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde deleted file mode 100755 index 0cda24fa8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Shift from blue to green in HSB mode -colorMode(HSB, 360, 100, 100); -for (int i = 0; i < 100; i++) { - float newHue = 200 - (i*1.2); - stroke(newHue, 70, 80); - line(i, 0, i, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde deleted file mode 100755 index f4d689915..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/09 Color 1/Ex_21/Ex_21.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Code 9-03 rewritten using hex numbers -background(#818257); -noStroke(); -fill(#AEDD3C); -rect(17, 17, 66, 66); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5bee29af8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img; -// Image must be in the sketch's "data" folder -img = loadImage("arch.jpg"); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde deleted file mode 100755 index ce5f8a972..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img; -// Image must be in the sketch's "data" folder to load -img = loadImage("arch.jpg"); -image(img, 20, 20, 60, 60); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde deleted file mode 100755 index 175ab183e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -tint(102); // Tint gray -image(img, 0, 0); -noTint(); // Disable tint -image(img, 50, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde deleted file mode 100755 index 9fe123241..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -tint(0, 153, 204); // Tint blue -image(img, 0, 0); -noTint(); // Disable tint -image(img, 50, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde deleted file mode 100755 index 3c3f26f77..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,11 +0,0 @@ -color yellow = color(220, 214, 41); -color green = color(110, 164, 32); -color tan = color(180, 17, 132); -PImage img; -img = loadImage("arch.jpg"); -tint(yellow); -image(img, 0, 0); -tint(green); -image(img, 33, 0); -tint(tan); -image(img, 66, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde deleted file mode 100755 index 449c956d5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,7 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -background(255); -tint(255, 102); // Alpha to 102 without changing the tint -image(img, 0, 0, 100, 100); -tint(255, 204, 0, 153); // Tint to yellow, alpha to 153 -image(img, 20, 20, 100, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde deleted file mode 100755 index c9bdfc77b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage img; -img = loadImage("arch.jpg"); -background(255); -tint(255, 51); -// Draw the image 10 times, moving each to the right -for (int i = 0; i < 10; i++) { - image(img, i*10, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde deleted file mode 100755 index 6b584835b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads a GIF image with 1-bit transparency -PImage img; -img = loadImage("archTrans.gif"); -background(255); -image(img, 0, 0); -image(img, -20, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif deleted file mode 100755 index 808499d3f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_08/data/mud-trans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde deleted file mode 100755 index e5260d770..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/10 Image 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads a PNG image with 8-bit transparency -PImage img; -img = loadImage("arch.png"); -background(255); -image(img, 0, 0); -image(img, -20, 0); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde deleted file mode 100755 index 02d482311..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -char a = 'n'; // Assigns 'n' to variable a -char b = n; // ERROR! Without the '', n expected to be a variable -char c = "n"; // ERROR! The "" defines n as a String, not a char -char d = 'not'; // ERROR! The char type can hold only one character diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_01/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde deleted file mode 100755 index daea5872f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -char letter; -letter = 'A'; // Assign 'A' to variable letter -println(letter); // Prints "A" to the console -letter = 'B'; // Assign 'B' to variable letter -println(letter); // Prints "B" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_02/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde deleted file mode 100755 index 07488bcdc..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -char letter = 'A'; // Declare variable letter and assign 'A' -println(letter); // Prints "A" to the console -int n = letter; // Assign the numerical value 'A' to variable n -println(n); // Prints "65" to the console diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_03/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde deleted file mode 100755 index df97c271f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -char letter = 'A'; // Declare variable letter and assign 'A' -for (int i=0; i<26; i++) { - print(letter); // Prints a character to the console - letter++; // Add 1 to the value of the character -} -println('.'); // Adds a period to the end of the alphabet diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_04/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde deleted file mode 100755 index 8cf506b59..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -String a = "Eponymous"; // Assign "Eponymous" to a -String b = 'E'; // ERROR! The '' define E as a char -String c = "E"; // Assign "E" to c -string d = "E"; // ERROR! String must be capitalized diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_05/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde deleted file mode 100755 index 40e8806ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,11 +0,0 @@ -// The String data type can contain long and short text elements -String s1 = "Rakete bee bee?"; -String s2 = "Rrrrrrrrrrrrrrrrummmmmpffff tillffff tooooooo?"; -println(s1); // Prints "Rakete bee bee?" -println(s2); // Prints "Rrrrrrrrrrrrrrrrummmmmpffff tillffff tooooooo?" - -// Strings can be combined with the + operator -String s3 = "Rakete "; -String s4 = "rinnzekete"; -String s5 = s3 + s4; -println(s5); // Prints "Rakete rinnzekete" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif b/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif deleted file mode 100755 index d4b0348a1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/11 Data 2/Ex_06/data/archTrans.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde deleted file mode 100755 index cd6c249cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -float f = 12.6; -int i = 127; -f = i; // Converts 127 to 127.0 -i = f; // Error: Can't automatically convert a float to an int diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde deleted file mode 100755 index 7978747d3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -int i = 0; -boolean b = boolean(i); // Assign false to b -int n = 12; -b = boolean(n); // Assign true to b -String s = "false"; -b = boolean(s); // Assign false to b \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde deleted file mode 100755 index d3d911a26..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -float f = 65.0; -byte b = byte(f); // Assign 65 to b -char c = 'E'; -b = byte(c); // Assign 69 to b -f = 130.0; -b = byte(f); // Assign -126 to b \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde deleted file mode 100755 index b3f58a05a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 65; -byte y = 72; -char c = char(i); // Assign 'A' to c -c = char(y); // Assign 'H' to c diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde deleted file mode 100755 index 18e544d21..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -int i = 2; -int j = 3; -float f1 = i/j; // Assign 0.0 to f1 -float f2 = i/float(j); // Assign 0.6666667 to f2 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde deleted file mode 100755 index 45e800a0f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -float f = 65.3; -int i = int(f); // Assign 65 to i -char c = 'E'; -i = int(c); // Assign 69 to i diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde deleted file mode 100755 index 02ff8dbe9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,6 +0,0 @@ -int i = 3; -String s = str(i); // Assign "3" to s -float f = -12.6; -s = str(f); // Assign "-12.6" to s -boolean b = true; -s = str(b); // Assign "true" to s diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde deleted file mode 100755 index 044618d25..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -// Loads an image that is 320 pixels wide and 240 pixels high -PImage img = loadImage("ohio.jpg"); -int w = img.width; // Assign 320 to w -int h = img.height; // Assign 240 to h -println(w); // Prints "320" -println(h); // Prints "240" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde deleted file mode 100755 index ea8fe761e..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s1 = "Player Piano"; -String s2 = "P"; -println( s1.length() ); // Prints "12" -println( s2.length() ); // Prints "1" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde deleted file mode 100755 index 4a643846f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s1 = "Slaughterhouse Five"; -println(s1.startsWith("S")); // Prints "true" -println(s1.startsWith("Five")); // Prints "false" -println(s1.endsWith("Five")); // Prints "true" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde deleted file mode 100755 index 4d1ebc2f6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "Verde"; -println(s.charAt(0)); // Prints "V" -println(s.charAt(2)); // Prints "r" -println(s.charAt(4)); // Prints "e" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde deleted file mode 100755 index 2ab240e22..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "Azzurro"; -char[] c = s.toCharArray(); -println(c[0]); // Prints "A" -println(c[1]); // Prints "z" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde deleted file mode 100755 index 12256f153..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,5 +0,0 @@ -String s = "Giallo"; -println(s.substring(2)); // Prints "allo" -println(s.substring(4)); // Prints "lo" -println(s.substring(1, 4)); // Prints "ial" -println(s.substring(0, s.length()-1)); // Prints "Giall" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde deleted file mode 100755 index e6bc979cb..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,3 +0,0 @@ -String s = "Nero"; -println(s.toLowerCase()); // Prints "nero" -println(s.toUpperCase()); // Prints "NERO" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde deleted file mode 100755 index 0bd59b105..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/12 Data 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,5 +0,0 @@ -String s1 = "Bianco"; -String s2 = "Bianco"; -String s3 = "Nero"; -println(s1.equals(s2)); // Prints "true" -println(s1.equals(s3)); // Prints "false" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde deleted file mode 100755 index b33b593cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -PFont font; // Declare the variable -font = loadFont("Ziggurat-32.vlw"); // Load the font -textFont(font); // Set the current text font -fill(0); -text("LAX", 0, 40); // Write "LAX" at coordinate (0,40) -text("AMS", 0, 70); // Write "AMS" at coordinate (0,70) -text("FRA", 0, 100); // Write "FRA" at coordinate (0,100) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_01/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde deleted file mode 100755 index 2f39988b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,7 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -text(19, 0, 36); // Write 19 at coordinate (0,36) -text(72, 0, 70); // Write 72 at coordinate (0,70) -text('R', 62, 70); // Write 'R' at coordinate (62,70) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_02/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde deleted file mode 100755 index 2cc8b7f2c..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -fill(0); -String s = "Response is the medium"; -text(s, 10, 20, 80, 50); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_03/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde deleted file mode 100755 index 51fbb19c8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,9 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(255); // White -text("DAY", 0, 40); -fill(0); // Black -text("CVG", 0, 70); -fill(102); // Gray -text("ATL", 0, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_04/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde deleted file mode 100755 index ab8c060f4..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,9 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-72.vlw"); -textFont(font); -fill(0, 160); // Black with low opacity -text("1", 0, 80); -text("2", 15, 80); -text("3", 30, 80); -text("4", 45, 80); -text("5", 60, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw deleted file mode 100755 index 5609ca52f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Courier-96.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw deleted file mode 100755 index 2517b88aa..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw deleted file mode 100755 index fe2da33e9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_05/data/Ziggurat-72.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde deleted file mode 100755 index b50ccd6d5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -PFont font1, font2; -font1 = loadFont("Ziggurat-32.vlw"); -font2 = loadFont("ZigguratItalic-32.vlw"); -fill(0); -// Set the font to Ziggurat-32.vlw -textFont(font1); -text("GNU", 6, 45); -// Set the font to ZigguratItalic-32.vlw -textFont(font2); -text("GNU", 2, 80); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw deleted file mode 100755 index 1c54c2188..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/CourierItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw deleted file mode 100755 index 7bbb1f6bd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw deleted file mode 100755 index 83a1668d5..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_06/data/ZigguratItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde deleted file mode 100755 index b14ac71e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -// Reducing a font created at 32 pixels -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -text("LNZ", 0, 40); // Large -textSize(18); -text("STN", 0, 75); // Medium -textSize(12); -text("BOS", 0, 100); // Small \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw deleted file mode 100755 index e87ef86b2..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Courier-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw deleted file mode 100755 index 1c54c2188..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/CourierItalic-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_07/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde deleted file mode 100755 index a8fb96eaf..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Enlarging a font created at 12 pixels -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -textSize(32); -fill(0); -text("LNZ", 0, 40); // Large -textSize(18); -text("STN", 0, 75); // Medium -textSize(12); -text("BOS", 0, 100); // Small \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw deleted file mode 100755 index a4e5d9737..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_08/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde deleted file mode 100755 index f63c75d40..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,11 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -String lines = "L1 L2 L3"; -textLeading(10); -fill(0); -text(lines, 5, 15, 30, 100); -textLeading(20); -text(lines, 36, 15, 30, 100); -textLeading(30); -text(lines, 68, 15, 30, 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_09/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde deleted file mode 100755 index a5d4706e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,11 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-12.vlw"); -textFont(font); -line(50, 0, 50, 100); -fill(0); -textAlign(LEFT); -text("Left", 50, 20); -textAlign(RIGHT); -text("Right", 50, 40); -textAlign(CENTER); -text("Center", 50, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw deleted file mode 100755 index fe569b3dc..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Courier-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw deleted file mode 100755 index c6bde4e4d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_10/data/Ziggurat-12.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde deleted file mode 100755 index f7ed3ef76..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,12 +0,0 @@ -PFont font; -font = loadFont("Ziggurat-32.vlw"); -textFont(font); -fill(0); -char c = 'U'; -float cw = textWidth(c); -text(c, 22, 40); -rect(22, 42, cw, 5); -String s = "UC"; -float sw = textWidth(s); -text(s, 22, 76); -rect(22, 78, sw, 5); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw deleted file mode 100755 index 1dbdeb8f1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Courier-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw b/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw deleted file mode 100755 index abe7061e7..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/13 Typography 1/Ex_11/data/Ziggurat-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde deleted file mode 100755 index db8c53f67..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1 +0,0 @@ -println(PI); // Prints the value of PI to the text area \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde deleted file mode 100755 index 929c64dd6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -float r1 = radians(90); -float r2 = radians(180); -println(r1); // Prints "1.5707964" -println(r2); // Prints "3.1415927" -float d1 = degrees(PI); -float d2 = degrees(TWO_PI); -println(d1); // Prints "180.0" -println(d2); // Prints "360.0" diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde deleted file mode 100755 index ca7e77bd9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - println(sin(angle)); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde deleted file mode 100755 index 985954b01..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - println(sin(angle) * 50.0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde deleted file mode 100755 index 2713dd807..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,4 +0,0 @@ -for (float angle = 0; angle < TWO_PI; angle += PI/24.0) { - float newValue = map(sin(angle), -1, 1, 0, 1000); - println(newValue); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde deleted file mode 100755 index c3cecdee9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -size(700, 100); -noStroke(); -fill(0); -float angle = 0.0; -for (int x = 0; x <= width; x += 5) { - float y = 50 + (sin(angle) * 35.0); - rect(x, y, 2, 4); - angle += PI/40.0; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde deleted file mode 100755 index 34804510d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,13 +0,0 @@ -size(700, 100); -noStroke(); -smooth(); -fill(0); -float offset = 50.0; // Y offset -float scaleVal = 35.0; // Scale value for the wave magnitude -float angleInc = PI/28.0; // Increment between the next angle -float angle = 0.0; // Angle to receive sine values from -for (int x = 0; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - rect(x, y, 2, 4); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif deleted file mode 100644 index a3dce6057..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/14-08.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde deleted file mode 100755 index fc434aa61..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,16 +0,0 @@ -size(700, 100); -noStroke(); -smooth(); -float offset = 50.0; -float scaleVal = 20.0; -float angleInc = PI/18.0; -float angle = 0.0; -for (int x = 0; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - fill(255); - rect(x, y, 2, 4); - y = offset + (cos(angle) * scaleVal); - fill(0); - rect(x, y, 2, 4); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde deleted file mode 100755 index 99ab6a969..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -size(700, 100); -float offset = 50; -float scaleVal = 30.0; -float angleInc = PI/56.0; -float angle = 0.0; -beginShape(TRIANGLE_STRIP); -for (int x = 4 ; x <= width+5; x += 5) { - float y = sin(angle) * scaleVal; - if ((x % 2) == 0) { // Every other time through the loop - vertex(x, offset + y); - } else { - vertex(x, offset - y); - } - angle += angleInc; -} -endShape(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde deleted file mode 100755 index 162b12988..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,13 +0,0 @@ -size(700, 100); -smooth(); -strokeWeight(2); -float offset = 126.0; -float scaleVal = 126.0; -float angleInc = 0.42; -float angle = 0.0; -for (int x = -52; x <= width; x += 5) { - float y = offset + (sin(angle) * scaleVal); - stroke(y); - line(x, 0, x+50, height); - angle += angleInc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde deleted file mode 100755 index 07f589c83..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,17 +0,0 @@ -size(700, 100); -smooth(); -fill(255, 20); -float scaleVal = 18.0; -float angleInc = PI/28.0; -float angle = 0.0; -for (int offset = -10; offset < width+10; offset += 5) { - for (int y = 0; y <= height; y += 2) { - float x = offset + (sin(angle) * scaleVal); - noStroke(); - ellipse(x, y, 10, 10); - stroke(0); - point(x, y); - angle += angleInc; - } - angle += PI; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde deleted file mode 100755 index 77e40dda6..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,9 +0,0 @@ -noStroke(); -smooth(); -int radius = 38; -for (int deg = 0; deg < 360; deg += 12) { - float angle = radians(deg); - float x = 50 + (cos(angle) * radius); - float y = 50 + (sin(angle) * radius); - ellipse(x, y, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde deleted file mode 100755 index 5e94fcf10..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,9 +0,0 @@ -noStroke(); -smooth(); -int radius = 38; -for (int deg = 0; deg < 220; deg += 12) { - float angle = radians(deg); - float x = 50 + (cos(angle) * radius); - float y = 50 + (sin(angle) * radius); - ellipse(x, y, 6, 6); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde deleted file mode 100755 index 92d2b0f07..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,6 +0,0 @@ -strokeWeight(2); -arc(50, 55, 50, 50, 0, HALF_PI); -arc(50, 55, 60, 60, HALF_PI, PI); -arc(50, 55, 70, 70, PI, TWO_PI - HALF_PI); -noFill(); -arc(50, 55, 80, 80, TWO_PI - HALF_PI, TWO_PI); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde deleted file mode 100755 index c27b94ba1..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,10 +0,0 @@ -smooth(); -noFill(); -randomSeed(0); -strokeWeight(10); -stroke(0, 150); -for (int i = 0; i < 160; i += 10) { - float begin = radians(i); - float end = begin + HALF_PI; - arc(67, 37, i, i, begin, end); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde deleted file mode 100755 index 461f67988..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_16/Ex_16.pde +++ /dev/null @@ -1,10 +0,0 @@ -noStroke(); -smooth(); -float radius = 1.0; -for (int deg = 0; deg < 360*6; deg += 11) { - float angle = radians(deg); - float x = 75 + (cos(angle) * radius); - float y = 42 + (sin(angle) * radius); - ellipse(x, y, 6, 6); - radius = radius + 0.34; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde deleted file mode 100755 index 5a608b373..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/14 Math 3/Ex_17/Ex_17.pde +++ /dev/null @@ -1,15 +0,0 @@ -smooth(); -float radius = 0.15; -float cx = 33; // Center x- and y-coordinates -float cy = 66; -float px = cx; // Start with center as the -float py = cy; // previous coordinate -for (int deg = 0; deg < 360*5; deg += 12) { - float angle = radians(deg); - float x = cx + (cos(angle) * radius); - float y = cy + (sin(angle) * radius); - line(px, py, x, y); - radius = radius * 1.045; - px = x; - py = y; -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde deleted file mode 100755 index af1057026..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -float f = random(5.2); // Assign f a float value from 0 to 5.2 -int i = random(5.2); // ERROR! Can't assign a float to an int -int j = int(random(5.2)); // Assign j an int value from 0 to 5 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde deleted file mode 100755 index 5316e4ac0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(10); -stroke(0, 130); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); -line(0, random(100), 100, random(100)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde deleted file mode 100755 index 13e0ca06f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -smooth(); -strokeWeight(20); -stroke(0, 230); -float r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); -r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); -r = random(5, 45); -stroke(r * 5.6, 230); -line(0, r, 100, random(55, 95)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde deleted file mode 100755 index f584dcaa5..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -background(0); -stroke(255, 60); -for (int i = 0; i < 100; i++) { - float r = random(10); - strokeWeight(r); - float offset = r * 5.0; - line(i-20, 100, i+offset, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde deleted file mode 100755 index 2edfe0ab3..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -float r = random(100); -if (r < 50.0) { - line(0, 0, 100, 100); -} else { - ellipse(50, 50, 75, 75); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde deleted file mode 100755 index c4bd1d123..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -int num = int(random(50)) + 1; -for (int i = 0; i < num; i++) { - line(i * 2, 0, i * 2, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde deleted file mode 100755 index 4eb73ad11..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -int s = 6; // Seed value -background(0); -stroke(255, 60); -randomSeed(s); // Produce the same numbers each time -for (int i = 0; i < 100; i++) { - float r = random(10); - strokeWeight(r); - float offset = r * 5; - line(i-20, 100, i+offset, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde deleted file mode 100755 index a9291783f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -size(600, 100); -float v = 0.0; -float inc = 0.1; -noStroke(); -fill(0); -noiseSeed(0); -for (int i = 0; i < width; i = i+4) { - float n = noise(v) * 70.0; - rect(i, 10 + n, 3, 20); - v = v + inc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde deleted file mode 100755 index be65dd2c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,13 +0,0 @@ -float xnoise = 0.0; -float ynoise = 0.0; -float inc = 0.04; -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float gray = noise(xnoise, ynoise) * 255; - stroke(gray); - point(x, y); - xnoise = xnoise + inc; - } - xnoise = 0; - ynoise = ynoise + inc; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde deleted file mode 100755 index 1a0015f78..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/15 Math 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,17 +0,0 @@ -float power = 3; // Turbulence power -float d = 8; // Turbulence density -noStroke(); -for (int y = 0; y < height; y++) { - for (int x = 0; x < width; x++) { - float total = 0.0; - for (float i = d; i >= 1; i = i/2.0) { - total += noise(x/d, y/d) * d; - } - float turbulence = 128.0 * total / d; - float base = (x * 0.2) + (y * 0.12); - float offset = base + (power * turbulence / 256.0); - float gray = abs(sin(offset)) * 256.0; - stroke(gray); - point(x, y); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde deleted file mode 100755 index a9f96ae5f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,5 +0,0 @@ -// The same rectangle is drawn, but only the second is -// affected by translate() because it is drawn after -rect(0, 5, 70, 30); -translate(10, 30); // Shifts 10 pixels right and 30 down -rect(0, 5, 70, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde deleted file mode 100755 index 60d64375b..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// A negative number used as a parameter to translate() -// moves the coordinates in the opposite direction -rect(0, 5, 70, 30); -translate(10, -10); // Shifts 10 pixels right and up -rect(0, 5, 70, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde deleted file mode 100755 index c7a24fc6a..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,5 +0,0 @@ -rect(0, 5, 70, 30); -translate(10, 30); // Shifts 10 pixels right and 30 down -rect(0, 5, 70, 30); -translate(10, 30); // Shifts everything again for a total -rect(0, 5, 70, 30); // 20 pixels right and 60 down \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde deleted file mode 100755 index a89653ec9..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,3 +0,0 @@ -translate(33, 0); // Shift 33 pixels right -rect(0, 20, 66, 30); -rect(0, 50, 66, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde deleted file mode 100755 index 838e913b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -pushMatrix(); -translate(33, 0); // Shift 33 pixels right -rect(0, 20, 66, 30); -popMatrix(); // Remove the shift -// This shape is not affected by translate() because -// the transformation is isolated between the pushMatrix() -// and popMatrix() -rect(0, 50, 66, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde deleted file mode 100755 index a15e7466d..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/16 Transform 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -pushMatrix(); -translate(20, 0); -rect(0, 10, 70, 20); // Draws at (20, 30) -pushMatrix(); -translate(30, 0); -rect(0, 30, 70, 20); // Draws at (50, 30) -popMatrix(); -rect(0, 50, 70, 20); // Draws at (20, 50) -popMatrix(); -rect(0, 70, 70, 20); // Draws at (0, 70) \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde deleted file mode 100755 index 8c61af522..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -rect(55, 0, 30, 45); -rotate(PI/8); -rect(55, 0, 30, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde deleted file mode 100755 index 4842e75ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -rect(10, 60, 70, 20); -rotate(-PI/16); -rect(10, 60, 70, 20); -rotate(-PI/8); -rect(10, 60, 70, 20); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde deleted file mode 100755 index 4168dbbbd..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(32, 32, 30, 30); -scale(1.8); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde deleted file mode 100755 index 843563dca..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -smooth(); -ellipse(32, 32, 30, 30); -scale(2.8, 1.8); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde deleted file mode 100755 index aade47402..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,6 +0,0 @@ -float s = 1.8; -smooth(); -ellipse(32, 32, 30, 30); -scale(s); -strokeWeight(1.0 / s); -ellipse(32, 32, 30, 30); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde deleted file mode 100755 index 6ef427e53..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,5 +0,0 @@ -rect(10, 20, 70, 20); -scale(1.7); -rect(10, 20, 70, 20); -scale(1.7); -rect(10, 20, 70, 20); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde deleted file mode 100755 index 741431c35..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,3 +0,0 @@ -translate(width/2, height/2); -rotate(PI/8); -rect(-25, -25, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde deleted file mode 100755 index 8f0a73169..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,3 +0,0 @@ -rotate(PI/8); -translate(width/2, height/2); -rect(-25, -25, 50, 50); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde deleted file mode 100755 index 42db71d49..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -translate(10, 60); -rect(0, 0, 70, 20); -rotate(-PI/12); -rect(0, 0, 70, 20); -rotate(-PI/6); -rect(0, 0, 70, 20); diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde deleted file mode 100755 index 049a5b4de..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -translate(45, 60); -rect(-35, -5, 70, 10); -rotate(-PI/8); -rect(-35, -5, 70, 10); -rotate(-PI/8); -rect(-35, -5, 70, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde deleted file mode 100755 index f10a4b270..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,7 +0,0 @@ -noFill(); -translate(10, 20); -rect(0, 0, 20, 10); -scale(2.2); -rect(0, 0, 20, 10); -scale(2.2); -rect(0, 0, 20, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde deleted file mode 100755 index 80411886f..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,5 +0,0 @@ -noFill(); -translate(50, 30); -rect(-10, 5, 20, 10); -scale(2.5); -rect(-10, 5, 20, 10); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde deleted file mode 100755 index 7b7298cec..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -smooth(); -stroke(255, 120); -translate(66, 33); // Set initial offset -for (int i = 0; i < 18; i++) { // 18 repetitions - strokeWeight(i); // Increase stroke weight - rotate(PI/12); // Accumulate the rotation - line(0, 0, 55, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde deleted file mode 100755 index 6275686a8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,9 +0,0 @@ -background(0); -smooth(); -noStroke(); -fill(255, 48); -translate(33, 66); // Set initial offset -for (int i = 0; i < 12; i++) { // 12 repetitions - scale(1.2); // Accumulate the scaling - ellipse(4, 2, 20, 20); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde deleted file mode 100755 index f7ee067b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Shift the origin (0,0) to the center -size(100, 100); -translate(width/2, height/2); -line(-width/2, 0, width/2, 0); // Draw x-axis -line(0, -height/2, 0, height/2); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 45, 45); // Draw at the origin -ellipse(-width/2, height/2, 45, 45); -ellipse(width/2, -height/2, 45, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde deleted file mode 100755 index b59304907..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Shift the origin (0,0) to the center -// and resizes the coordinate system -size(100, 100); -scale(width/2, height/2); -translate(1.0, 1.0); -strokeWeight(1.0/width); -line(-1, 0, 1, 0); // Draw x-axis -line(0, -1, 0, 1); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 0.9, 0.9); // Draw at the origin -ellipse(-1.0, 1.0, 0.9, 0.9); -ellipse(1.0, -1.0, 0.9, 0.9); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde deleted file mode 100755 index 20b681469..000000000 --- a/java/examples/Books/Processing Handbook/Units 00-17/17 Transform 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Shift the origin (0,0) to the lower-left corner -size(100, 100); -translate(0, height); -scale(1.0, -1.0); -line(0, 1, width, 1); // Draw x-axis -line(0, 1, 0, height ); // Draw y-axis -smooth(); -noStroke(); -fill(255, 204); -ellipse(0, 0, 45, 45); // Draw at the origin -ellipse(width/2, height/2, 45, 45); -ellipse(width, height, 45, 45); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde deleted file mode 100755 index 0c78fd42b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -// Reveals each frame passing as a number drawn to the console -void draw() { - println(frameCount); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde deleted file mode 100755 index 73c1b9341..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -// Runs at around 4 fps, prints each frame number to the console -void draw() { -frameRate(4); -println(frameCount); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde deleted file mode 100755 index 1cb730154..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -float y = 0.0; -void draw() { - frameRate(30); - line(0, y, 100, y); - y = y + 0.5; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde deleted file mode 100755 index 91eefe57c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 0.0; - -void draw() { - frameRate(30); - background(204); - y = y + 0.5; - line(0, y, 100, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde deleted file mode 100755 index 635991950..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -float y = 0.0; - -void draw() { - frameRate(30); - background(y * 2.5); - y = y + 0.5; - line(0, y, 100, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde deleted file mode 100755 index 934c3f24f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,10 +0,0 @@ -float y = 0.0; -void draw() { - frameRate(30); - background(y * 2.5); - y = y + 0.5; - line(0, y, 100, y); - if (y > 100) { - y = 0; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde deleted file mode 100755 index 10e155cac..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -float y = 0.0; - -void setup() { - size(100, 100); - smooth(); - fill(0); -} - -void draw() { - background(204); - ellipse(50, y, 70, 70); - y += 0.5; - if (y > 150) { - y = -50.0; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde deleted file mode 100755 index 4f428dc56..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - fill(0); - ellipse(50, 50, 66, 66); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde deleted file mode 100755 index 3339c6df8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - fill(0); - noLoop(); -} - -void draw() { - ellipse(50, 50, 66, 66); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde deleted file mode 100755 index b27580e0d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -int d = 51; // Variable d can be used everywhere - -void setup() { - size(100, 100); - int val = d * 2; // Local variable val can only be used in setup() - fill(val); -} - -void draw() { - int y = 60; // Local variable y can only be used in draw() - line(0, y, d, y); - y -= 25; - line(0, y, d, y); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde deleted file mode 100755 index d23c36ef8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,9 +0,0 @@ -void draw() { - int d = 80; // This variable can be used everywhere in draw() - if (d > 50) { - int x = 10; // This variable can be used only in this if block - line(x, 40, x+d, 40); - } - line(0, 50, d, 50); - line(x, 60, x+d, 60); // ERROR! x can't be read outside block -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde deleted file mode 100755 index 64cdee44f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,6 +0,0 @@ -void draw() { - for (int y = 20; y < 80; y += 6) { // The variable y can be used - line(20, y, 50, y); // only within the for block - } - line(y, 0, y, 100); // ERROR! y can't be accessed outside for -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde deleted file mode 100755 index 62e55b2b3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/20 Structure 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,11 +0,0 @@ -int d = 45; // Assign 45 to variable d - -void setup() { - size(100, 100); - int d = 90; // Assign 90 to local variable d - rect(0, 0, 33, d); // Use local d with value 90 -} - -void draw() { - rect(33, 0, 33, d); // Use d with value 45 -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde deleted file mode 100755 index fdc759392..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - fill(255); - ellipse(50, 50, 60, 60); // White circle - fill(0); - ellipse(50+10, 50, 30, 30); // Black circle - fill(255); - ellipse(50+16, 45, 6, 6); // Small, white circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde deleted file mode 100755 index 62ccb124d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,23 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - noLoop(); - smooth(); -} - -void draw() { - // Right shape - fill(255); - ellipse(65, 44, 60, 60); - fill(0); - ellipse(75, 44, 30, 30); - fill(255); - ellipse(81, 39, 6, 6); - // Left shape - fill(255); - ellipse(20, 50, 60, 60); - fill(0); - ellipse(30, 50, 30, 30); - fill(255); - ellipse(36, 45, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde deleted file mode 100755 index 571666c97..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,20 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - eye(65, 44); - eye(20, 50); -} - -void eye(int x, int y) { - fill(255); - ellipse(x, y, 60, 60); - fill(0); - ellipse(x+10, y, 30, 30); - fill(255); - ellipse(x+16, y-5, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde deleted file mode 100755 index 41089ca7f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,24 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - eye(65, 44); - eye(20, 50); - eye(65, 74); - eye(20, 80); - eye(65, 104); - eye(20, 110); -} - -void eye(int x, int y) { - fill(255); - ellipse(x, y, 60, 60); - fill(0); - ellipse(x+10, y, 30, 30); - fill(255); - ellipse(x+16, y-5, 6, 6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde deleted file mode 100755 index 09da61101..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,23 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - stroke(160); // Thick, light gray - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); - - stroke(0); // Medium, black - strokeWeight(10); - line(30, 20, 90, 80); - line(90, 20, 30, 80); - - // Draw thin, white X - stroke(255); - strokeWeight(2); - line(20, 38, 80, 98); - line(80, 38, 20, 98); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde deleted file mode 100755 index 8111884a2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(); -} - -void drawX() { - stroke(160); - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde deleted file mode 100755 index 0657d690c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0); // Passes 0 to drawX(), runs drawX() -} - -void drawX(int gray) { // Declares and assigns gray - stroke(gray); // Uses gray to set the stroke - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde deleted file mode 100755 index 73ddd6861..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0, 30); -} - -void drawX(int gray, int weight) { - stroke(gray); - strokeWeight(weight); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde deleted file mode 100755 index 3186367ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(0, 30, 40, 30, 36); -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde deleted file mode 100755 index ea810cc76..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - drawX(160, 20, 0, 5, 60); // Draw thick, light gray X - drawX(0, 10, 30, 20, 60); // Draw medium, black X - drawX(255, 2, 20, 38, 60); // Draw thin, white X -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde deleted file mode 100755 index c96e0351e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - for (int i=0; i<20; i++) { - drawX(200-(i*10), (20-i)*2, i, i/2, 70); - } -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde deleted file mode 100755 index 7c1ed23c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,19 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); - smooth(); -} - -void draw() { - for (int i = 0; i < 70; i++) { // Draw 70 X shapes - drawX(int(random(255)), int(random(30)), - int(random(width)), int(random(height)), 100); - } -} - -void drawX(int gray, int weight, int x, int y, int size) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+size, y+size); - line(x+size, y, x, y+size); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde deleted file mode 100755 index 08925e387..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_13/Ex_13.pde +++ /dev/null @@ -1,22 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noStroke(); - noLoop(); -} - -void draw() { - leaf(26, 83, 60, 1); -} - -void leaf(int x, int y, int size, int dir) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*dir, -0.7); - bezierVertex(1.0*dir, -0.7, 0.4*dir, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*dir, 0.4, 1.0*dir, -0.7); - endShape(); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde deleted file mode 100755 index 9b21411c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_14/Ex_14.pde +++ /dev/null @@ -1,35 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noStroke(); - noLoop(); -} - -void draw() { - vine(33, 9, 16); -} - -void vine(int x, int numLeaves, int leafSize ) { - stroke(255); - line(x, 0, x, height); - noStroke(); - int gap = height / numLeaves; - int direction = 1; - for (int i = 0; i < numLeaves; i++) { - int r = int(random(gap)); - leaf(x, gap*i + r, leafSize, direction); - direction = -direction; - } -} - -void leaf(int x, int y, int size, int dir) { - pushMatrix(); - translate(x, y); // Move to position - scale(size); // Scale to size - beginShape(); // Draw the shape - vertex(1.0*dir, -0.7); - bezierVertex(1.0*dir, -0.7, 0.4*dir, -1.0, 0.0, 0.0); - bezierVertex(0.0, 0.0, 1.0*dir, 0.4, 1.0*dir, -0.7); - endShape(); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde deleted file mode 100755 index 2c3675433..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_15/Ex_15.pde +++ /dev/null @@ -1,36 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - drawX(255); // Run first drawX() - drawX(5.5); // Run second drawX() - drawX(0, 2, 44, 48, 36); // Run third drawX() -} - -// Draw an X with the gray value set by the parameter -void drawX(int gray) { - stroke(gray); - strokeWeight(20); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} - -// Draw a black X with the thickness set by the parameter -void drawX(float weight) { - stroke(0); - strokeWeight(weight); - line(0, 5, 60, 65); - line(60, 5, 0, 65); -} - -// Draws an X with the gray value, thickness, -// position, and size set by the parameters -void drawX(int gray, int weight, int x, int y, int s) { - stroke(gray); - strokeWeight(weight); - line(x, y, x+s, y+s); - line(x+s, y, x, y+s); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde deleted file mode 100755 index 6ca652e7d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_16/Ex_16.pde +++ /dev/null @@ -1,2 +0,0 @@ -float d = random(0, 100); -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde deleted file mode 100755 index 67af87054..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_17/Ex_17.pde +++ /dev/null @@ -1,2 +0,0 @@ -int d = random(0, 100); // ERROR! random() returns floats -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde deleted file mode 100755 index 9c0e638d2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_18/Ex_18.pde +++ /dev/null @@ -1,2 +0,0 @@ -int d = int(random(0, 100)); // int() converts the float value -ellipse(50, 50, d, d); diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde deleted file mode 100755 index 7e476d1eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_19/Ex_19.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - float f = average(12.0, 6.0); // Assign 9.0 to f - println(f); -} - -float average(float num1, float num2) { - float av = (num1 + num2) / 2.0; - return av; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde deleted file mode 100755 index 86d6ed202..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/21 Structure 3/Ex_20/Ex_20.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - float c = fahrenheitToCelsius(451.0); // Assign 232.77779 to c - println(c); -} - -float fahrenheitToCelsius(float t) { - float f = (t-32.0) * (5.0/9.0); - return f; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde deleted file mode 100755 index 34f971cdf..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -size(120, 100); -int front = int(random(1, 10)); // Select the front card -int back = int(random(1, 10)); // Select the back card -PImage imgFront = loadImage(front + "f.jpg"); -PImage imgBack = loadImage(back + "b.jpg"); -image(imgFront, 0, 0); -image(imgBack, 60, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde deleted file mode 100755 index 5e0b66a83..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -float c = 25.0; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - arch(c); -} - -void arch(float curvature) { - float y = 90.0; - strokeWeight(6); - noFill(); - beginShape(); - vertex(15.0, y); - bezierVertex(15.0, y-curvature, 30.0, 55.0, 50.0, 55.0); - bezierVertex(70.0, 55.0, 85.0, y-curvature, 85.0, y); - endShape(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde deleted file mode 100755 index b42c79d6b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -float c = 25.0; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -} - -void draw() { - arch(c); -} - -void arch(float curvature) { - float y = 90.0; - float sw = (65.0 - curvature) / 4.0; - strokeWeight(sw); - noFill(); - beginShape(); - vertex(15.0, y); - bezierVertex(15.0, y-curvature, 30.0, 55.0, 50.0, 55.0); - bezierVertex(70.0, 55.0, 85.0, y-curvature, 85.0, y); - endShape(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde deleted file mode 100755 index 4543603f5..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -int x = 20; // X-coordinate -int u = 14; // Units -float a = -0.12; // Angle - -void setup() { - size(100, 100); - stroke(0, 153); - smooth(); - noLoop(); -} - -void draw() { - background(204); - tail(x, u, a); -} - -void tail(int xpos, int units, float angle) { - pushMatrix(); - translate(xpos, 0); - for (int i = units; i > 0; i--) { // Count in reverse - strokeWeight(i); - line(0, 0, 0, 8); - translate(0, 8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde deleted file mode 100755 index a3925adb3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -int x = 40; // X-coordinate -int y = 30; // Y-coordinate -int g = 20; // Gap between eyes -void setup() { - size(100, 100); - smooth(); - fill(0); - noLoop(); -} - -void draw() { - background(204); - face(x, y, g); -} - -void face(int x, int y, int gap) { - line(x, 0, x, y); // Nose Bridge - line(x, y, x+gap, y); // Nose - line(x+gap, y, x+gap, 100); - int mouthY = height - (height-y)/2; - line(x, mouthY, x+gap, mouthY); // Mouth - noStroke(); - ellipse(x-gap/2, y/2, 5, 5); // Left eye - ellipse(x+gap, y/2, 5, 5); // Right eye -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde deleted file mode 100755 index 5b3b93d73..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,6 +0,0 @@ -int x = 5; - -for (int num = 15; num >= 0; num -= 1) { - line(x, 20, x, 80); - x += 5; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde deleted file mode 100755 index 4f7131402..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - drawLines(5, 15); -} - -void drawLines(int x, int num) { - line(x, 20, x, 80); - if (num > 0) { - drawLines(x+5, num-1); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde deleted file mode 100755 index 403d6d295..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,17 +0,0 @@ -int x = 50; // X-coordinate of the center -int y = 100; // Y-coordinate of the bottom -int a = 35; // Half the width of the top bar - -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - drawT(x, y, a); -} - -void drawT(int xpos, int ypos, int apex) { - line(xpos, ypos, xpos, ypos-apex); - line(xpos-(apex/2), ypos-apex, xpos+(apex/2), ypos-apex); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde deleted file mode 100755 index 4fdd2a440..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -int x = 50; // X-coordinate of the center -int y = 100; // Y-coordinate of the bottom -int a = 35; // Half the width of the top bar -int n = 3; // Number of recursions - -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - drawT(x, y, a, n); -} - -void drawT(int x, int y, int apex, int num) { - line(x, y, x, y-apex); - line(x-apex, y-apex, x+apex, y-apex); - // This relational expression must eventually be - // false to stop the recursion and draw the lines - if (num > 0) { - drawT(x-apex, y-apex, apex/2, num-1); - drawT(x+apex, y-apex, apex/2, num-1); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde deleted file mode 100755 index 0dfa95f7d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,25 +0,0 @@ -int x = 63; // X-coordinate -int r = 85; // Starting radius -int n = 6; // Number of recursions - -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); -} - -void draw() { - drawCircle(63, 85, 6); -} - -void drawCircle(int x, int radius, int num) { - float tt = 126 * num/4.0; - fill(tt); - ellipse(x, 50, radius*2, radius*2); - if (num > 1) { - num = num - 1; - drawCircle(x - radius/2, radius/2, num); - drawCircle(x + radius/2, radius/2, num); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde deleted file mode 100755 index 18edd3be3..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/22 Shape 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,33 +0,0 @@ -int x = 63; // X-coordinate -int y = 50; // Y-coordinate -int r = 80; // Starting radius -int n = 7; // Number of recursions -int rs = 12; // Random seed value - -void setup() { - size(100, 100); - noStroke(); - smooth(); - noLoop(); - randomSeed(rs); -} - -void draw() { - drawCircle(x, y, r, n); -} - -void drawCircle(float x, float y, int radius, int num) { - float value = 126 * num / 6.0; - fill(value, 153); - ellipse(x, y, radius*2, radius*2); - if (num > 1) { - num = num - 1; - int branches = int(random(2, 6)); - for (int i = 0; i < branches; i++) { - float a = random(0, TWO_PI); - float newx = x + cos(a) * 6.0 * num; - float newy = y + sin(a) * 6.0 * num; - drawCircle(newx, newy, radius/2, num); - } - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde deleted file mode 100755 index 0eba0d87a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -void draw() { - frameRate(12); - println(mouseX + " : " + mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde deleted file mode 100755 index 0f7761fc8..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Circle follows the cursor -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - ellipse(mouseX, mouseY, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde deleted file mode 100755 index cb71a9cb0..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Add and subtract to create offsets -void setup() { -size(100, 100); - smooth(); - noStroke(); -} -void draw() { - background(126); - ellipse(mouseX, 16, 33, 33); // Top circle - ellipse(mouseX+20, 50, 33, 33); // Middle circle - ellipse(mouseX-20, 84, 33, 33); // Bottom circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde deleted file mode 100755 index f8a623a07..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Multiplying and dividing creates scaling offsets -void setup() { - size(100, 100); - smooth(); - noStroke(); -} -void draw() { - background(126); - ellipse(mouseX, 16, 33, 33); // Top circle - ellipse(mouseX/2, 50, 33, 33); // Middle circle - ellipse(mouseX*2, 84, 33, 33); // Bottom circle -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde deleted file mode 100755 index 0e8666809..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Invert cursor position to create a secondary response -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - float x = mouseX; - float y = mouseY; - float ix = width - mouseX; // Inverse X - float iy = mouseY - height; // Inverse Y - background(126); - fill(255, 150); - ellipse(x, height/2, y, y); - fill(0, 159); - ellipse(ix, height/2, iy, iy); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde deleted file mode 100755 index 788a2b954..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Exponential functions can create nonlinear relations -// between the mouse and shapes affected by the mouse -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - float normX = mouseX / float(width); - ellipse(mouseX, 16, 33, 33); // Top - ellipse(pow(normX, 4) * width, 50, 33, 33); // Middle - ellipse(pow(normX, 8) * width, 84, 33, 33); // Bottom -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde deleted file mode 100755 index 335fc65ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,4 +0,0 @@ -void draw() { - frameRate(12); - println(pmouseX - mouseX); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde deleted file mode 100755 index 8285f3d3c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Draw a line between the current and previous positions -void setup() { - size(100, 100); - strokeWeight(8); - smooth(); -} - -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde deleted file mode 100755 index c9516fde7..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Use translate() to move a shape -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(126); - translate(mouseX, mouseY); - ellipse(0, 0, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde deleted file mode 100755 index e3e83b132..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Use rotate() to move a shape -void setup() { - size(100, 100); - strokeWeight(8); - smooth(); -} - -void draw() { - background(204); - float angle = map(mouseX, 0, width, 0, TWO_PI); - translate(50, 50); - rotate(angle); - line(0, 0, 40, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde deleted file mode 100755 index ef60afd06..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Cursor position selects the left or right half -// of the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if (mouseX < 50) { - rect(0, 0, 50, 100); // Left - } else { - rect(50, 0, 50, 100); // Right - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde deleted file mode 100755 index 78026ab79..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Cursor position selects the left, middle, -// or right third of the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if (mouseX < 33) { - rect(0, 0, 33, 100); // Left - } else if ((mouseX >= 33) && (mouseX <= 66)) { - rect(33, 0, 33, 100); // Middle - } else { - rect(66, 0, 33, 100); // Right - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde deleted file mode 100755 index d1975513c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Cursor position selects a quadrant of -// the display window -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if ((mouseX <= 50) && (mouseY <= 50)) { - rect(0, 0, 50, 50); // Upper-left - } else if ((mouseX <= 50) && (mouseY > 50)) { - rect(0, 50, 50, 50); // Lower-left - } else if ((mouseX > 50) && (mouseY < 50)) { - rect(50, 0, 50, 50); // Upper-right - } else { - rect(50, 50, 50, 50); // Lower-right - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde deleted file mode 100755 index 389639ba2..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_14/Ex_14.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Cursor position selects a rectangular area to -// change the fill color -void setup() { - size(100, 100); - noStroke(); - fill(0); -} - -void draw() { - background(204); - if ((mouseX > 40) && (mouseX < 80) && - (mouseY > 20) && (mouseY < 80)) { - fill(255); - } else { - fill(0); - } - rect(40, 20, 40, 60); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde deleted file mode 100755 index a1a808ada..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_15/Ex_15.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Set the square to white when a mouse button is pressed -void setup() { - size(100, 100); -} - -void draw() { - background(204); - if (mousePressed == true) { - fill(255); // White - } else { - fill(0); // Black - } - rect(25, 25, 50, 50); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde deleted file mode 100755 index 5b5202845..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_16/Ex_16.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Set the square to black when the left mouse button -// is pressed and white when the right button is pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mouseButton == LEFT) { - fill(0); // Black - } else if (mouseButton == RIGHT) { - fill(255); // White - } else { - fill(126); // Gray - } - rect(25, 25, 50, 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde deleted file mode 100755 index a5b3c8638..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_17/Ex_17.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Set the square to black when the left mouse button -// is pressed, white when the right button is pressed, -// and gray when a button is not pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { - if (mouseButton == LEFT) { - fill(0); // Black - } else if (mouseButton == RIGHT) { - fill(255); // White - } - } else { - fill(126); // Gray - } - rect(25, 25, 50, 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde deleted file mode 100755 index 1b2062e3e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_18/Ex_18.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Draw an ellipse to show the position of the hidden cursor -void setup() { - size(100, 100); - strokeWeight(7); - smooth(); - noCursor(); -} - -void draw() { - background(204); - ellipse(mouseX, mouseY, 10, 10); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde deleted file mode 100755 index c92d14fec..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_19/Ex_19.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Hides the cursor until a mouse button is pressed -void setup() { - size(100, 100); - noCursor(); -} - -void draw() { - background(204); - if (mousePressed == true) { - cursor(); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde deleted file mode 100755 index 118df4e86..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/23 Input 1/Ex_20/Ex_20.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Draws the cursor as a hand when a mouse button is pressed -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(204); - if (mousePressed == true) { - cursor(HAND); - } else { - cursor(MOVE); - } - line(mouseX, 0, mouseX, height); - line(0, mouseY, height, mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif deleted file mode 100644 index dd71e9d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/24-01--1.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde deleted file mode 100755 index 7f6a25bcb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Draw dots at the position of the cursor -void setup() { - size(100, 100); -} - -void draw() { - point(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde deleted file mode 100755 index 84198c2cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,9 +0,0 @@ -// Draw from the previous mouse location to the current -// mouse location to create a continuous line -void setup() { - size(100, 100); -} - -void draw() { - line(mouseX, mouseY, pmouseX, pmouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif deleted file mode 100644 index 3bfde5772..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/24-03--34556.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde deleted file mode 100755 index a3dd0e0bb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,11 +0,0 @@ -// Draw a line only when a mouse button is pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { - line(mouseX, mouseY, pmouseX, pmouseY); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde deleted file mode 100755 index 859910488..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Draw lines with different gray values when a mouse -// button is pressed or not pressed -void setup() { - size(100, 100); -} - -void draw() { - if (mousePressed == true) { // If mouse is pressed, - stroke(255); // set the stroke to white - } else { // Otherwise, - stroke(0); // set to black - } - line(mouseX, mouseY, pmouseX, pmouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde deleted file mode 100755 index 026ea5c07..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,9 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - for (int i = 0; i < 50; i += 2) { - point(mouseX+i, mouseY+i); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde deleted file mode 100755 index 4c873a25c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,9 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - for (int i = -14; i <= 14; i += 2) { - point(mouseX+i, mouseY); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde deleted file mode 100755 index 69d37d01a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,18 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - fill(255, 40); - background(0); -} - -void draw() { - if (mousePressed == true) { - fill(0, 26); - } else { - fill(255, 26); - } - - for (int i = 0; i < 6; i++) { - ellipse(mouseX + i*i, mouseY, i, i); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde deleted file mode 100755 index 2e95df14d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,12 +0,0 @@ -// Draw with an image sliver -PImage lineImage; - -void setup() { - size(100, 100); - // This image is 100 pixels wide, but one pixel tall - lineImage = loadImage("imageline.jpg"); -} - -void draw() { - image(lineImage, mouseX-lineImage.width/2, mouseY); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde deleted file mode 100755 index 1b7e56802..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/24 Drawing 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Draw with an image that has transparency -PImage alphaImg; - -void setup() { - size(100, 100); - // This image is partially transparent - alphaImg = loadImage("alphaArch.png"); -} - -void draw() { - int ix = mouseX - alphaImg.width/2; - int iy = mouseY - alphaImg.height/2; - image(alphaImg, ix, iy); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde deleted file mode 100755 index e626ac6af..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,15 +0,0 @@ -// Draw a rectangle when any key is pressed -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - if (keyPressed == true) { // If the key is pressed, - line(20, 20, 80, 80); // draw a line - } else { // Otherwise, - rect(40, 40, 20, 20); // draw a rectangle - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde deleted file mode 100755 index bd36ce149..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,16 +0,0 @@ -// Move a line while any key is pressed -int x = 20; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - if (keyPressed == true) { // If the key is pressed - x++; // add 1 to x - } - line(x, 20, x-60, 80); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde deleted file mode 100755 index 500cd0898..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("ThesisMonoLight-72.vlw"); - textFont(font); -} - -void draw() { - background(0); - text(key, 28, 75); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw deleted file mode 100755 index 17627ddd8..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_03/data/ThesisMonoLight-72.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde deleted file mode 100755 index 1b1533d76..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - strokeWeight(4); -} - -void draw() { - background(204); - // If the 'A' key is pressed draw a line - if ((keyPressed == true) && (key == 'A')) { - line(50, 25, 50, 75); - } else { // Otherwise, draw an ellipse - ellipse(50, 50, 50, 50); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde deleted file mode 100755 index c38a6d80f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -int x = 0; - -void setup() { - size(100, 100); -} - -void draw() { - if (keyPressed == true) { - x = key - 32; - rect(x, -1, 20, 101); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde deleted file mode 100755 index 7eb2dea99..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,19 +0,0 @@ -float angle = 0; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(8); -} - -void draw() { - background(204); - if (keyPressed == true) { - if ((key >= 32) && (key <= 126)) { - // If the key is alphanumeric, - // convert its value into an angle - angle = map(key, 32, 126, 0, TWO_PI); - } - } - arc(50, 50, 66, 66, angle-PI/6, angle+PI/6); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde deleted file mode 100755 index 4d9d838d6..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/25 Input 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,20 +0,0 @@ -color y = 35; - -void setup() { - size(100, 100); -} - -void draw() { - background(204); - line(10, 50, 90, 50); - if (key == CODED) { - if (keyCode == UP) { - y = 20; - } else if (keyCode == DOWN) { - y = 50; - } - } else { - y = 35; - } - rect(25, y, 50, 30); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde deleted file mode 100755 index 7b9bb18c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -float gray = 0; - -void setup() { - size(100, 100); -} - -void draw() { - background(gray); -} - -void mousePressed() { - gray += 20; -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde deleted file mode 100755 index 4e8e38c01..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,13 +0,0 @@ -float gray = 0; - -void setup() { - size(100, 100); -} - -void draw() { - background(gray); -} - -void mouseReleased() { - gray += 20; -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde deleted file mode 100755 index 40860c9ee..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,10 +0,0 @@ -void setup() { - size(100, 100); - fill(0, 102); -} - -void draw() { } // Empty draw() keeps the program running - -void mousePressed() { - rect(mouseX, mouseY, 33, 33); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde deleted file mode 100755 index d1f2bb46f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,25 +0,0 @@ -int dragX, dragY, moveX, moveY; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(204); - fill(0); - ellipse(dragX, dragY, 33, 33); // Black circle - fill(153); - ellipse(moveX, moveY, 33, 33); // Gray circle -} - -void mouseMoved() { // Move gray circle - moveX = mouseX; - moveY = mouseY; -} - -void mouseDragged() { // Move black circle - dragX = mouseX; - dragY = mouseY; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde deleted file mode 100755 index e9dd201c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - fill(255, 51); -} - -void draw() { } // Empty draw() keeps the program running - -void keyPressed() { - int y = key - 32; - rect(0, y, 100, 4); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde deleted file mode 100755 index d9c93e79f..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,24 +0,0 @@ -boolean drawT = false; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - background(204); - if (drawT == true) { - rect(20, 20, 60, 20); - rect(39, 40, 22, 45); - } -} - -void keyPressed() { - if ((key == 'T') || (key == 't')) { - drawT = true; - } -} - -void keyReleased() { - drawT = false; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde deleted file mode 100755 index 11b7189fb..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,29 +0,0 @@ -// An extremely minimal text editor, it can only insert -// and remove characters from a single line -PFont font; -String letters = ""; - -void setup() { - size(100, 100); - font = loadFont("Eureka-24.vlw"); - textFont(font); - stroke(255); - fill(0); -} - -void draw() { - background(204); - float cursorPosition = textWidth(letters); - line(cursorPosition, 0, cursorPosition, 100); - text(letters, 0, 50); -} - -void keyPressed() { - if (key == BACKSPACE) { // Backspace - if (letters.length() > 0) { - letters = letters.substring(0, letters.length()-1); - } - } else if (textWidth(letters+key) < width){ - letters = letters+key; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_07/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde deleted file mode 100755 index d5a2688a6..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,32 +0,0 @@ -PFont font; -String letters = ""; -int back = 102; - -void setup() { - size(100, 100); - font = loadFont("Eureka-24.vlw"); - textFont(font); - textAlign(CENTER); -} - -void draw() { - background(back); - text(letters, 50, 50); -} - -void keyPressed() { - if ((key == ENTER) || (key == RETURN)) { - letters = letters.toLowerCase(); - println(letters); // Print to console to see input - if (letters.equals("black")) { - back = 0; - } else if (letters.equals("gray")) { - back = 204; - } - letters = ""; // Clear the variable - - } else if ((key > 31) && (key != CODED)) { - // If the key is alphanumeric, add it to the String - letters = letters + key; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_08/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde deleted file mode 100755 index adf0cece0..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,23 +0,0 @@ -int frame = 0; - -void setup() { - size(100, 100); - frameRate(30); -} - -void draw() { - if (frame > 60) { // If 60 frames since the mouse - noLoop(); // was pressed, stop the program - background(0); // and turn the background black. - } else { // Otherwise, set the background - background(204); // to light gray and draw lines - line(mouseX, 0, mouseX, 100); // at the mouse position - line(0, mouseY, 100, mouseY); - frame++; - } -} - -void mousePressed() { - loop(); - frame = 0; -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde deleted file mode 100755 index 138cfdd18..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/26 Input 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,13 +0,0 @@ -void setup() { - size(100, 100); - noLoop(); -} - -void draw() { - background(204); - line(mouseX, 0, mouseX, 100); -} - -void mousePressed() { - redraw(); // Run the code in draw one time -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde deleted file mode 100755 index deb22e72a..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -int x = constrain(35, 10, 90); // Assign 35 to x -int y = constrain(5, 10, 90); // Assign 10 to y -int z = constrain(91, 10, 90); // Assign 90 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde deleted file mode 100755 index 97cd57125..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Constrains the position of the ellipse to a region -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - // Limits mx between 35 and 65 - float mx = constrain(mouseX, 35, 65); - // Limits my between 40 and 60 - float my = constrain(mouseY, 40, 60); - fill(102); - rect(20, 25, 60, 50); - fill(255); - ellipse(mx, my, 30, 30); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde deleted file mode 100755 index b6715b22e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,3 +0,0 @@ -float x = dist(0, 0, 50, 0); // Assign 50.0 to x -float y = dist(50, 0, 50, 90); // Assign 90.0 to y -float z = dist(30, 20, 80, 90); // Assign 86.023254 to z \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde deleted file mode 100755 index 7fc06d7d9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -// The distance between the center of the display -// window and the cursor sets the diameter of the circle -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float d = dist(width/2, height/2, mouseX, mouseY); - ellipse(width/2, height/2, d*2, d*2); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde deleted file mode 100755 index 5aad01531..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Draw a grid of circles and calculate the -// distance to each to set the size -float maxDistance; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(0); - maxDistance = dist(0, 0, width, height); -} - -void draw() { - background(204); - for (int i = 0; i <= width; i += 20) { - for (int j = 0; j <= height; j += 20) { - float mouseDist = dist(mouseX, mouseY, i, j); - float diameter = (mouseDist / maxDistance) * 66.0; - ellipse(i, j, diameter, diameter); - } - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde deleted file mode 100755 index d7f7b6d90..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -float x = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float targetX = mouseX; - x += (targetX - x) * easing; - ellipse(mouseX, 30, 40, 40); - ellipse(x, 70, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde deleted file mode 100755 index f2943279d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,20 +0,0 @@ -float x = 0; -float y = 0; -float easing = 0.05; // Numbers 0.0 to 1.0 -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - float targetX = mouseX; - float targetY = mouseY; - x += (targetX - x) * easing; - y += (targetY - y) * easing; - fill(153); - ellipse(mouseX, mouseY, 20, 20); - fill(255); - ellipse(x, y, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde deleted file mode 100755 index aa0059873..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,21 +0,0 @@ -float x = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - background(0); - float targetX = mouseX; - // Distance from position and target - float dx = targetX - x; - // If the distance between the current position and the - // destination is greater than 1.0, update the position - if (abs(dx) > 1.0) { - x += dx * easing; - } - ellipse(mouseX, 30, 40, 40); - ellipse(x, 70, 40, 40); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde deleted file mode 100755 index 0ef36f37b..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - float speed = dist(mouseX, mouseY, pmouseX, pmouseY); - float diameter = speed * 3.0; - ellipse(50, 50, diameter, diameter); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde deleted file mode 100755 index a0db3adca..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,16 +0,0 @@ -float speed = 0.0; -float easing = 0.05; // Numbers 0.0 to 1.0 - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - float target = dist(mouseX, mouseY, pmouseX, pmouseY); - speed += (target - speed) * easing; - rect(0, 33, target, 17); - rect(0, 50, speed, 17); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde deleted file mode 100755 index 2aa9a315c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,18 +0,0 @@ -// The angles increase as the mouse moves from the upper-right -// corner of the screen to the lower-left corner - -void setup() { - size(100, 100); - frameRate(15); - fill(0); -} - -void draw() { - float angle = atan2(mouseY, mouseX); - float deg = degrees(angle); - println(deg); - background(204); - ellipse(mouseX, mouseY, 8, 8); - rotate(angle); - line(0, 0, 150, 0); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde deleted file mode 100755 index 41155ae59..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/27 Input 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Rotate the triangles so they always point -// to the cursor -float x = 50; -float y1 = 33; -float y2 = 66; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - - // Top triangle - float angle = atan2(mouseY-y1, mouseX-x); - pushMatrix(); - translate(x, y1); - rotate(angle); - triangle(-20, -8, 20, 0, -20, 8); - popMatrix(); - pushMatrix(); - - // Bottom triangle - float angle2 = atan2(mouseY-(y2), mouseX-x); - translate(x, y2); - rotate(angle2); - triangle(-20, -8, 20, 0, -20, 8); - popMatrix(); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde deleted file mode 100755 index 3047aa80e..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -int s = second(); // Returns values from 0 to 59 -int m = minute(); // Returns values from 0 to 59 -int h = hour(); // Returns values from 0 to 23 -println(h + ":" + m + ":" + s); // Prints the time to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde deleted file mode 100755 index f02327e4c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,16 +0,0 @@ -int lastSecond = 0; - -void setup() { - size(100, 100); -} - -void draw() { - int s = second(); - int m = minute(); - int h = hour(); - // Only prints once when the second changes - if (s != lastSecond) { - println(h + ":" + m + ":" + s); - lastSecond = s; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde deleted file mode 100755 index 5d33c3a6d..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,17 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Pro-20.vlw"); - textFont(font); -} - -void draw() { - background(0); - int s = second(); - int m = minute(); - int h = hour(); - // The nf() function spaces the numbers nicely - String t = nf(h,2) + ":" + nf(m,2) + ":" + nf(s,2); - text(t, 10, 55); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw deleted file mode 100755 index 52c855953..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_03/data/Pro-20.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde deleted file mode 100755 index 5fae747b9..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,14 +0,0 @@ -void setup() { - size(100, 100); - stroke(255); -} - -void draw() { - background(0); - float s = map(second(), 0, 60, 0, 100); - float m = map(minute(), 0, 60, 0, 100); - float h = map(hour(), 0, 24, 0, 100); - line(s, 0, s, 33); - line(m, 34, m, 66); - line(h, 67, h, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde deleted file mode 100755 index 3fe885b5c..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,20 +0,0 @@ -void setup() { - size(100, 100); - stroke(255); -} - -void draw() { - background(0); - fill(80); - noStroke(); - // Angles for sin() and cos() start a 3 o'clock, - // subtract HALF_PI to make them start at the top - ellipse(50, 50, 80, 80); - float s = map(second(), 0, 60, 0, TWO_PI) - HALF_PI; - float m = map(minute(), 0, 60, 0, TWO_PI) - HALF_PI; - float h = map(hour() % 12, 0, 12, 0, TWO_PI) - HALF_PI; - stroke(255); - line(50, 50, cos(s) * 38 + 50, sin(s) * 38 + 50); - line(50, 50, cos(m) * 30 + 50, sin(m) * 30 + 50); - line(50, 50, cos(h) * 25 + 50, sin(h) * 25 + 50); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde deleted file mode 100755 index 5515a3c31..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -// Uses millis() to start a line in motion three seconds -// after the program starts -int x = 0; - -void setup() { - size(100, 100); -} - -void draw() { - if (millis() > 3000) { - x++; - } - line(x, 0, x, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde deleted file mode 100755 index bd5377213..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,12 +0,0 @@ -int x = 0; -void setup() { - size(100, 100); -} - -void draw() { - float sec = millis() / 1000.0; - if (sec > 3.0) { - x++; - } - line(x, 0, x, 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde deleted file mode 100755 index fa53f16ec..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,4 +0,0 @@ -int d = day(); // Returns values from 1 to 31 -int m = month(); // Returns values from 1 to 12 -int y = year(); // Returns four-digit year (2007, 2008, etc.) -println(d + " " + m + " " + y); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde deleted file mode 100755 index 8fb04d418..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,6 +0,0 @@ -void draw() { - int d = day(); // Values from 1 to 31 - if (d == 1) { - println("Welcome to a new month."); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde deleted file mode 100755 index 3b9e6a8db..000000000 --- a/java/examples/Books/Processing Handbook/Units 20-29/28 Input 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,7 +0,0 @@ -void draw() { - int d = day(); // Values from 1 to 31 - int m = month(); // Values from 1 to 12 - if ((d == 1) && (m == 1)) { - println("Today is the first day of the year!"); - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde deleted file mode 100755 index 035e7cdd3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,19 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - background(0); - ellipse(33, y, radius, radius); - y = y + speed; - if (y > height+radius) { - y = -radius; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde deleted file mode 100755 index 82fa086f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,22 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; -int direction = 1; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - y += speed * direction; - if ((y > height-radius) || (y < radius)) { - direction = -direction; - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde deleted file mode 100755 index 46fb94ebf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,30 +0,0 @@ -float x = 50.0; // X-coordinate -float y = 50.0; // Y-coordinate -float radius = 15.0; // Radius of the circle -float speedX = 1.0; // Speed of motion on the x-axis -float speedY = 0.4; // Speed of motion on the y-axis -int directionX = 1; // Direction of motion on the x-axis -int directionY = -1; // Direction of motion on the y-axis - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(x, y, radius, radius); - x += speedX * directionX; - if ((x > width-radius) || (x < radius)) { - directionX = -directionX; // Change direction - } - y += speedY * directionY; - - if ((y > height-radius) || (y < radius)) { - directionY = -directionY; // Change direction - } -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde deleted file mode 100755 index 6fb32e634..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,25 +0,0 @@ -float d = 20.0; -float speed = 1.0; -int direction = 1; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - fill(255, 204); -} - -void draw() { - background(0); - ellipse(0, 50, d, d); - ellipse(100, 50, d, d); - ellipse(50, 0, d, d); - ellipse(50, 100, d, d); - d += speed * direction; - if ((d > width) || (d < width / 10)) { - direction = -direction; - } -} - - - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde deleted file mode 100755 index 677f774bf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,34 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.02; // Size of each step (0.0 to 1.0) -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - pct += step; - - if (pct < 1.0) { - x = beginX + (pct * distX); - y = beginY + (pct * distY); - } - - fill(255); - - ellipse(x, y, 20, 20); -} - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde deleted file mode 100755 index 5dd00950e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,26 +0,0 @@ -float x = 20.0; // Initial x-coordinate -float y = 10.0; // Initial y-coordinate -float targetX = 70.0; // Destination x-coordinate -float targetY = 80.0; // Destination y-coordinate -float easing = 0.05; // Size of each step along the path - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - float d = dist(x, y, targetX, targetY); - - if (d > 1.0) { - x += (targetX - x) * easing; - y += (targetY - y) * easing; - } - - fill(255); - - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde deleted file mode 100755 index 58d8372ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_07/Ex_07.pde +++ /dev/null @@ -1,34 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 0.5; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - pct += step; - - if (pct < 1.0) { - x = beginX + (pct * distX); - y = beginY + (pow(pct, exponent) * distY); - } - - fill(255); - - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde deleted file mode 100755 index 27033702d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_08/Ex_08.pde +++ /dev/null @@ -1,40 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 3.0; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) -int direction = 1; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - pct += step * direction; - if ((pct > 1.0) || (pct < 0.0)) { - direction = direction * -1; - } - if (direction == 1) { - x = beginX + (pct * distX); - float e = pow(pct, exponent); - y = beginY + (e * distY); - } else { - x = beginX + (pct * distX); - float e = pow(1.0 - pct, exponent * 2); - y = beginY + (e * -distY) + distY; - } - fill(255); - ellipse(x, y, 20, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde deleted file mode 100755 index 58d2d906d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_09/Ex_09.pde +++ /dev/null @@ -1,39 +0,0 @@ -float beginX = 20.0; // Initial x-coordinate -float beginY = 10.0; // Initial y-coordinate -float endX = 70.0; // Final x-coordinate -float endY = 80.0; // Final y-coordinate -float distX; // X-axis distance to move -float distY; // Y-axis distance to move -float exponent = 3.0; // Determines the curve -float x = 0.0; // Current x-coordinate -float y = 0.0; // Current y-coordinate -float step = 0.01; // Size of each step along the path -float pct = 0.0; // Percentage traveled (0.0 to 1.0) - -void setup() { - size(100, 100); - noStroke(); - smooth(); - distX = endX - beginX; - distY = endY - beginY; -} - -void draw() { - fill(0, 2); - rect(0, 0, width, height); - if (pct < 1.0) { - pct = pct + step; - float rate = pow(pct, exponent); - x = beginX + (rate * distX); - y = beginY + (rate * distY); - } - fill(255); - ellipse(x, y, 20, 20); -} -void mousePressed() { - pct = 0.0; - beginX = x; - beginY = y; - distX = mouseX - x; - distY = mouseY - y; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde deleted file mode 100755 index d644d6532..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_10/Ex_10.pde +++ /dev/null @@ -1,11 +0,0 @@ -void setup() { - size(100, 100); - smooth(); - noLoop(); - translate(50, 0); // Has no effect -} - -void draw() { - background(0); - ellipse(0, 50, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde deleted file mode 100755 index 9011447f0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_11/Ex_11.pde +++ /dev/null @@ -1,22 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - translate(0, y); // Set the y-coordinate of the circle - ellipse(33, 0, radius, radius); - y += speed; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde deleted file mode 100755 index c4069c47b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_12/Ex_12.pde +++ /dev/null @@ -1,33 +0,0 @@ -float y = 50.0; -float speed = 1.0; -float radius = 15.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - pushMatrix(); - translate(0, y); - - // Affected by first translate() - ellipse(33, 0, radius, radius); - translate(0, y); - - // Affected by first and second translate() - ellipse(66, 0, radius, radius); - popMatrix(); - - // Not affected by either translate() - ellipse(99, 50, radius, radius); - y = y + speed; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde deleted file mode 100755 index d95f3ed1f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/31 Motion 1/Ex_13/Ex_13.pde +++ /dev/null @@ -1,17 +0,0 @@ -float angle = 0.0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - angle = angle + 0.02; - translate(70, 40); - rotate(angle); - rect(-30, -30, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde deleted file mode 100755 index 0c4feb2ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,19 +0,0 @@ -float angle = 0.0; // Current angle -float speed = 0.1; // Speed of motion -float radius = 40.0; // Range of motion - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - angle += speed; - float sinval = sin(angle); - float yoffset = sinval * radius; - ellipse(50, 50 + yoffset, 80, 80); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6282c4924..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,32 +0,0 @@ -float angle = 0.0; // Current angle -float speed = 0.05; // Speed of motion -float radius = 30.0; // Range of motion -float sx = 2.0; -float sy = 2.0; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - fill(0, 4); - rect(0, 0, width, height); - angle += speed; // Update the angle - float sinval = sin(angle); - float cosval = cos(angle); - - // Set the position of the small circle based on new - // values from sine and cosine - float x = 50 + (cosval * radius); - float y = 50 + (sinval * radius); - fill(255); - ellipse(x, y, 2, 2); // Draw smaller circle - - // Set the position of the large circles based on the - // new position of the small circle - float x2 = x + cos(angle * sx) * radius / 2; - float y2 = y + sin(angle * sy) * radius / 2; - ellipse(x2, y2, 6, 6); // Draw larger circle -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde deleted file mode 100755 index 73b2fa5ef..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,16 +0,0 @@ -float angle = 0.0; -float speed = 0.1; - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(0); - angle = angle + speed; - ellipse(50 + (sin(angle + PI) * 5), 25, 30, 30); - ellipse(50 + (sin(angle + HALF_PI) * 5), 55, 30, 30); - ellipse(50 + (sin(angle + QUARTER_PI) * 5), 85, 30, 30); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde deleted file mode 100755 index 8da3b3df1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,21 +0,0 @@ -float angle = 0.0; // Changing angle -float speed = 0.05; // Speed of growth - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 180); -} - -void draw() { - background(0); - circlePhase(0.0); - circlePhase(QUARTER_PI); - circlePhase(HALF_PI); - angle += speed; -} -void circlePhase(float phase) { - float diameter = 65 + (sin(angle + phase) * 45); - ellipse(50, 50, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde deleted file mode 100755 index f5ce8b674..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,15 +0,0 @@ -float x = 50.0; // X-coordinate -float y = 80.0; // Y-coordinate - -void setup() { - size(100, 100); - randomSeed(0); // Force the same random values - background(0); - stroke(255); -} - -void draw() { - x += random(-2, 2); // Assign new x-coordinate - y += random(-2, 2); // Assign new y-coordinate - point(x, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde deleted file mode 100755 index 6b10511ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -float x = 0.0; // X-coordinate -float y = 50.0; // Y-coordinate -float angle = 0.0; // Direction of motion -float speed = 0.5; // Speed of motion - -void setup() { - size(100, 100); - background(0); - stroke(255, 130); - randomSeed(121); // Force the same random values -} - -void draw() { - angle += random(-0.3, 0.3); - x += cos(angle) * speed; // Update x-coordinate - y += sin(angle) * speed; // Update y-coordinate - translate(x, y); - rotate(angle); - line(0, -10, 0, 10); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde deleted file mode 100755 index 204d6b224..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,29 +0,0 @@ -float inc = 0.0; - -void setup() { - size(100, 100); - stroke(255, 204); - smooth(); -} - -void draw() { - background(0); - inc += 0.01; - float angle = sin(inc) / 10.0 + sin(inc * 1.2) / 20.0; - tail(18, 9, angle / 1.3); - tail(33, 12, angle); - tail(44, 10, angle / 1.3); - tail(62, 5, angle); - tail(88, 7, angle*2); -} -void tail(int x, int units, float angle) { - pushMatrix(); - translate(x, 100); - for (int i = units; i > 0; i--) { - strokeWeight(i); - line(0, 0, 0, -8); - translate(0, -8); - rotate(angle); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde deleted file mode 100755 index 0ebda1665..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,21 +0,0 @@ -float inc1 = 0.1; -float n1 = 0.0; -float inc2 = 0.09; -float n2 = 0.0; - -void setup() { - size(100, 100); - stroke(255); - strokeWeight(20); - smooth(); -} - -void draw() { - background(0); - float y1 = (noise(n1) - 0.5) * 30.0; // Values -15 to 15 - float y2 = (noise(n2) - 0.5) * 30.0; // Values -15 to 15 - line(0, 50, 40, 50 + y1); - line(100, 50, 60, 50 + y2); - n1 += inc1; - n2 += inc2; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde deleted file mode 100755 index 985f10237..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/32 Motion 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -float inc = 0.06; -int density = 4; -float znoise = 0.0; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - float xnoise = 0.0; - float ynoise = 0.0; - for (int y = 0; y < height; y += density) { - for (int x = 0; x < width; x += density) { - float n = noise(xnoise, ynoise, znoise) * 256; - fill(n); - rect(y, x, density, density); - xnoise += inc; - } - xnoise = 0; - ynoise += inc; - } - znoise += inc; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde deleted file mode 100755 index 982f35faa..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,9 +0,0 @@ -int[] x = {50, 61, 83, 69, 71, 50, 29, 31, 17, 39}; -int[] y = { 18, 37, 43, 60, 82, 73, 82, 60, 43, 37 }; - -beginShape(); -// Reads one array element every time through the for() -for (int i = 0; i < x.length; i++) { - vertex(x[i], y[i]); -} -endShape(CLOSE); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde deleted file mode 100755 index 6b01e006b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,11 +0,0 @@ -int[] data; // Declare - -void setup() { - size(100, 100); - data = new int[5]; // Create - data[0] = 19; // Assign - data[1] = 40; - data[2] = 75; - data[3] = 76; - data[4] = 90; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde deleted file mode 100755 index 0593fc8e0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,10 +0,0 @@ -int[] data = new int[5]; // Declare and create - -void setup() { - size(100, 100); - data[0] = 19; // Assign - data[1] = 40; - data[2] = 75; - data[3] = 76; - data[4] = 90; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde deleted file mode 100755 index a3e2de725..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; // Declare, create, and assign -void setup() { - size(100, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde deleted file mode 100755 index 3313dbf4f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -int[] data; // Declare -data = new int[5]; // Create -data[0] = 19; // Assign -data[1] = 40; -data[2] = 75; -data[3] = 76; -data[4] = 90; diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde deleted file mode 100755 index f68b34e99..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data = new int[5]; // Declare and create -data[0] = 19; // Assign -data[1] = 40; -data[2] = 75; -data[3] = 76; -data[4] = 90; diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde deleted file mode 100755 index ada474042..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; // Declare, create, and assign diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde deleted file mode 100755 index a47eb0cf9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -line(data[0], 0, data[0], 100); -line(data[1], 0, data[1], 100); -line(data[2], 0, data[2], 100); -line(data[3], 0, data[3], 100); -line(data[4], 0, data[4], 100); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde deleted file mode 100755 index b8ff1471d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -println(data[0]); // Prints 19 to the console -println(data[2]); // Prints 75 to the console -println(data[5]); // ERROR! The last element of the array is 4 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde deleted file mode 100755 index abaa7d214..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -int[] data1 = { 19, 40, 75, 76, 90 }; -int[] data2 = { 19, 40 }; -int[] data3 = new int[127]; -println(data1.length); // Prints "5" to the console -println(data2.length); // Prints "2" to the console -println(data3.length); // Prints "127" to the console \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde deleted file mode 100755 index 94ab3ba81..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,4 +0,0 @@ -int[] data = { 19, 40, 75, 76, 90 }; -for (int i = 0; i < data.length; i++) { - line(data[i], 0, data[i], 100); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde deleted file mode 100755 index 301b5d563..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,13 +0,0 @@ -float[] sineWave = new float[width]; - -for (int i = 0; i < width; i++) { - // Fill the array with values from sin() - float r = map(i, 0, width, 0, TWO_PI); - sineWave[i] = abs(sin(r)); -} - -for (int i = 0; i < sineWave.length; i++) { - // Set the stroke values to numbers read from the array - stroke(sineWave[i] * 255); - line(i, 0, i, height); -} \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde deleted file mode 100755 index ec939e409..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_13/Ex_13.pde +++ /dev/null @@ -1,26 +0,0 @@ -int numLines = 12; -float[] x = new float[numLines]; -float[] speed = new float[numLines]; -float offset = 8; // Set space between lines - -void setup() { - size(100, 100); - smooth(); - strokeWeight(10); - for (int i = 0; i < numLines; i++) { - x[i] = i; // Set initial position - speed[i] = 0.1 + (i / offset); // Set initial speed - } -} - -void draw() { - background(204); - for (int i = 0; i < x.length; i++) { - x[i] += speed[i]; // Update line position - if (x[i] > (width + offset)) { // If off the right, - x[i] = -offset * 2; // return to the left - } - float y = i * offset; // Set y-coordinate for line - line(x[i], y, x[i] + offset, y + offset); // Draw line - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde deleted file mode 100755 index 810210c2a..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_14/Ex_14.pde +++ /dev/null @@ -1,20 +0,0 @@ -int[] y; - -void setup() { - size(100, 100); - y = new int[width]; -} - -void draw() { - background(204); -// Shift the values to the right - for (int i = y.length - 1; i > 0; i--) { - y[i] = y[i-1]; - } -// Add new values to the beginning - y[0] = constrain(mouseY, 0, height - 1); -// Display each pair of values as a line - for (int i = 1; i < y.length; i++) { - line(i, y[i], i - 1, y[i-1]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde deleted file mode 100755 index 2640e3799..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_15/Ex_15.pde +++ /dev/null @@ -1,26 +0,0 @@ -int num = 50; -int[] x = new int[num]; -int[] y = new int[num]; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 102); -} - -void draw() { - background(0); -// Shift the values to the right - for (int i = num - 1; i > 0; i--) { - x[i] = x[i-1]; - y[i] = y[i-1]; - } -// Add the new values to the beginning of the array - x[0] = mouseX; - y[0] = mouseY; -// Draw the circles - for (int i = 0; i < num; i++) { - ellipse(x[i], y[i], i / 2.0, i / 2.0); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde deleted file mode 100755 index 9ba9478b7..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_16/Ex_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -int num = 50; -int[] x = new int[num]; -int[] y = new int[num]; -int indexPosition = 0; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - fill(255, 102); -} - -void draw() { - background(0); - x[indexPosition] = mouseX; - y[indexPosition] = mouseY; -// Cycle between 0 and the number of elements - indexPosition = (indexPosition + 1) % num; - for (int i = 0; i < num; i++) { -// Set the array position to read - int pos = (indexPosition + i) % num; - float radius = (num - i) / 2.0; - ellipse(x[pos], y[pos], radius, radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde deleted file mode 100755 index d06f3c965..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_17/Ex_17.pde +++ /dev/null @@ -1,11 +0,0 @@ -String[] trees = { "ash", "oak" }; -append(trees, "maple"); // INCORRECT! Does not change the array -print(trees); // Prints "ash oak" -println(); -trees = append(trees, "maple"); // Add "maple" to the end -print(trees); // Prints "ash oak maple" -println(); -// Add "beech" to the end of the trees array, and creates a new -// array to store the change -String[] moretrees = append(trees, "beech"); -print(moretrees); // Prints "ash oak maple beech" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde deleted file mode 100755 index a2dbc480c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_18/Ex_18.pde +++ /dev/null @@ -1,6 +0,0 @@ -String[] trees = { "lychee", "coconut", "fig"}; -trees = shorten(trees); // Remove the last element from the array -println(trees); // Prints "lychee coconut" - -trees = shorten(trees); // Remove the last element from the array -println(trees); // Prints "lychee" diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde deleted file mode 100755 index e3efad100..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_19/Ex_19.pde +++ /dev/null @@ -1,15 +0,0 @@ -int[] x = new int[100]; // Array to store x-coordinates -int count; // Store the number of array positions - -void setup() { - size(100, 100); -} - -void draw() { - x[count] = mouseX; // Assign new x-coordinate to the array - count++; // Increment the counter - if (count == x.length) { // If the x array is full, - x = expand(x); // double the size of x - println(x.length); // Write the new size to the console - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde deleted file mode 100755 index fe953a888..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_20/Ex_20.pde +++ /dev/null @@ -1,9 +0,0 @@ -String[] north = { "OH", "IN", "MI" }; -String[] south = { "GA", "FL", "NC" }; -arraycopy(north, south); // Copy from north array to south array -print(south); // Prints "OH IN MI" -println(); -String[] east = { "MA", "NY", "RI" }; -String[] west = new String[east.length]; // Create a new array -arraycopy(east, west); // Copy from east array to west array -print(west); // Prints "MA NY RI" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde deleted file mode 100755 index d0a2a7c46..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_21/Ex_21.pde +++ /dev/null @@ -1,15 +0,0 @@ -float[] data = {19.0, 40.0, 75.0, 76.0, 90.0}; - -void setup() { - halve(data); - println(data[0]); // Prints "9.5" - println(data[1]); // Prints "20.0" - println(data[2]); // Prints "37.5" - println(data[3]); // Prints "38.0" - println(data[4]); // Prints "45.0" -} -void halve(float[] d) { - for (int i = 0; i < d.length; i++) { // For each array element, - d[i] = d[i] / 2.0; // divide the value by 2 - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde deleted file mode 100755 index 900526da1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_22/Ex_22.pde +++ /dev/null @@ -1,19 +0,0 @@ -float[] data = {19.0, 40.0, 75.0, 76.0, 90.0}; -float[] halfData; - -void setup() { - halfData = halve(data); // Run the halve() function - println(data[0] + ", " + halfData[0]); // Prints "19.0, 9.5" - println(data[1] + ", " + halfData[1]); // Prints "40.0, 20.0" - println(data[2] + ", " + halfData[2]); // Prints "75.0, 37.5" - println(data[3] + ", " + halfData[3]); // Prints "76.0, 38.0" - println(data[4] + ", " + halfData[4]); // Prints "90.0, 45.0" -} -float[] halve(float[] d) { - float[] numbers = new float[d.length]; // Create a new array - arraycopy(d, numbers); - for (int i = 0; i < numbers.length; i++) { // For each element, - numbers[i] = numbers[i] / 2; // divide the value by 2 - } - return numbers; // Return the new array -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde deleted file mode 100755 index 9599e1d64..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_23/Ex_23.pde +++ /dev/null @@ -1,7 +0,0 @@ -int[][] points = { {50,18}, {61,37}, {83,43}, {69,60}, {71,82}, - {50,73}, {29,82}, {31,60}, {17,43}, {39,37} }; -println(points[4][0]); // Prints 71 -println(points[4][1]); // Prints 82 -println(points[4][2]); // ERROR! This element is outside the array -println(points[0][0]); // Prints 50 -println(points[9][1]); // Prints 37 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde b/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde deleted file mode 100755 index c86a4d44d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/33 Data 4/Ex_24/Ex_24.pde +++ /dev/null @@ -1,19 +0,0 @@ -int[][] points = { {50, 18}, {61, 37}, {83, 43}, {69, 60}, - {71, 82}, {50, 73}, {29, 82}, {31, 60}, - {17, 43}, {39, 37} }; - -void setup() { - size(100, 100); - fill(0); - smooth(); -} - -void draw() { - background(204); - translate(mouseX - 50, mouseY - 50); - beginShape(); - for (int i = 0; i < points.length; i++) { - vertex(points[i][0], points[i][1]); - } - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde deleted file mode 100755 index 86648c705..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,28 +0,0 @@ -int numFrames = 12; // The number of animation frames -int frame = 0; // The frame to display -PImage[] images = new PImage[numFrames]; // Image array - -void setup() { - size(100, 100); - frameRate(30); // Maximum 30 frames per second - images[0] = loadImage("ani-000.gif"); - images[1] = loadImage("ani-001.gif"); - images[2] = loadImage("ani-002.gif"); - images[3] = loadImage("ani-003.gif"); - images[4] = loadImage("ani-004.gif"); - images[5] = loadImage("ani-005.gif"); - images[6] = loadImage("ani-006.gif"); - images[7] = loadImage("ani-007.gif"); - images[8] = loadImage("ani-008.gif"); - images[9] = loadImage("ani-009.gif"); - images[10] = loadImage("ani-010.gif"); - images[11] = loadImage("ani-011.gif"); -} - -void draw() { - frame++; - if (frame == numFrames) { - frame = 0; - } - image(images[frame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_01/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde deleted file mode 100755 index 163a551e2..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -int numFrames = 12; // The number of animation frames -PImage[] images = new PImage[numFrames]; // Image array - -void setup() { - size(100, 100); - frameRate(30); // Maximum 30 frames per second - - // Automate the image loading procedure. Numbers less than 100 - // need an extra zero added to fit the names of the files. - for (int i = 0; i < images.length; i++) { - // Construct the name of the image to load - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - // Calculate the frame to display, use % to cycle through frames - int frame = frameCount % numFrames; - image(images[frame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_02/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde deleted file mode 100755 index d8112bcdd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,16 +0,0 @@ -int numFrames = 5; // The number of animation frames -PImage[] images = new PImage[numFrames]; - -void setup() { - size(100, 100); - for (int i = 0; i < images.length; i++) { - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - int frame = int(random(0, numFrames)); // The frame to display - image(images[frame], 0, 0); - frameRate(random(1, 60.0)); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_03/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde deleted file mode 100755 index c0ef62a79..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,24 +0,0 @@ -int numFrames = 12; // The number of animation frames -int topFrame = 0; // The top frame to display -int bottomFrame = 0; // The bottom frame to display -PImage[] images = new PImage[numFrames]; -int lastTime = 0; - -void setup() { - size(100, 100); - frameRate(30); - for (int i = 0; i < images.length; i++) { - String imageName = "ani-" + nf(i, 3) + ".gif"; - images[i] = loadImage(imageName); - } -} - -void draw() { - topFrame = (topFrame + 1) % numFrames; - image(images[topFrame], 0, 0); - if ((millis() - lastTime) > 500) { - bottomFrame = (bottomFrame + 1) % numFrames; - lastTime = millis(); - } - image(images[bottomFrame], 0, 50); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif deleted file mode 100755 index 1a62c89dd..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-000.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif deleted file mode 100755 index 8fa73ba5f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-001.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif deleted file mode 100755 index b9862cdb9..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-002.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif deleted file mode 100755 index 78d757200..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-003.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif deleted file mode 100755 index bc9a90347..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-004.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif deleted file mode 100755 index 55454e80f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-005.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif deleted file mode 100755 index ed3fd318f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-006.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif deleted file mode 100755 index b91b69d94..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-007.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif deleted file mode 100755 index b32af1571..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-008.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif deleted file mode 100755 index da247b92e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-009.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif deleted file mode 100755 index 6752a466e..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-010.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif deleted file mode 100755 index 332652d91..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_04/data/ani-011.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde deleted file mode 100755 index f6de70c87..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage img; -float x; - -void setup() { - size(100, 100); - img = loadImage("PT-Shifty-0020.gif"); -} - -void draw() { - background(204); - x += 0.5; - if (x > width) { - x = -width; - } - image(img, x, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif deleted file mode 100755 index 1bd580361..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_05/data/PT-Shifty-0020.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde deleted file mode 100755 index 38805ecd6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,15 +0,0 @@ -PImage img; -float angle; - -void setup() { - size(100, 100); - img = loadImage("PT-Shifty-0023.gif"); -} - -void draw() { - background(204); - angle += 0.01; - translate(50, 50); - rotate(angle); - image(img, -100, -100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif deleted file mode 100755 index a3dd7f38c..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_06/data/PT-Shifty-0023.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde deleted file mode 100755 index 42c78090b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage img; -float opacity = 0; // Set opacity to the minimum - -void setup() { - size(100, 100); - img = loadImage("PT-Teddy-0017.gif"); -} - -void draw() { - background(0); - if (opacity < 255) { // When less than the maximum, - opacity += 0.5; // increase opacity - } - tint(255, opacity); - image(img, -25, -75); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif b/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif deleted file mode 100755 index be36c20b1..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/34 Image 2/Ex_07/data/PT-Teddy-0017.gif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde deleted file mode 100755 index 4a873ca22..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,5 +0,0 @@ -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -PImage cross = get(); // Get the entire window -image(cross, 0, 50); // Draw the image in a new position \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde deleted file mode 100755 index b5f90a720..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -noStroke(); -ellipse(18, 50, 16, 16); -PImage cross = get(); // Get the entire window -image(cross, 42, 30, 40, 40); // Resize to 40 x 40 pixels \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde deleted file mode 100755 index 2bcd09949..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -strokeWeight(8); -line(0, 0, width, height); -line(0, height, width, 0); -PImage slice = get(0, 0, 20, 100); // Get window section -set(18, 0, slice); -set(50, 0, slice); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde deleted file mode 100755 index 185b449b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,5 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -image(trees, 0, 0); -PImage crop = get(); // Get the entire window -image(crop, 0, 50); // Draw the image in a new position \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde deleted file mode 100755 index 9f62f3cdb..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -noStroke(); -image(trees, 0, 0); -color c = get(20, 30); // Get color at (20, 30) -fill(c); -rect(20, 30, 40, 40); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde deleted file mode 100755 index 37246b24d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_06/Ex_06.pde +++ /dev/null @@ -1,14 +0,0 @@ -PImage trees; - -void setup() { - size(100, 100); - noStroke(); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - image(trees, 0, 0); - color c = get(mouseX, mouseY); - fill(c); - rect(50, 0, 50, 100); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde deleted file mode 100755 index f6cb47176..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -PImage trees; -int y = 0; - -void setup() { - size(100, 100); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - image(trees, 0, 0); - y = constrain(mouseY, 0, 99); - for (int i = 0; i < 49; i++) { - color c = get(i, y); - stroke(c); - line(i + 50, 0, i + 50, 100); - } - stroke(255); - line(0, y, 49, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde deleted file mode 100755 index 1853c59ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_08/Ex_08.pde +++ /dev/null @@ -1,9 +0,0 @@ -PImage trees; -trees = loadImage("topanga.jpg"); -stroke(255); -strokeWeight(12); -image(trees, 0, 0); -line(0, 0, width, height); -line(0, height, width, 0); -PImage treesCrop = trees.get(20, 20, 60, 60); -image(treesCrop, 20, 20); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde deleted file mode 100755 index 34b01cbe3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_09/Ex_09.pde +++ /dev/null @@ -1,5 +0,0 @@ -color black = color(0); -set(20, 80, black); -set(20, 81, black); -set(20, 82, black); -set(20, 83, black); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde deleted file mode 100755 index 29c18f6aa..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_10/Ex_10.pde +++ /dev/null @@ -1,6 +0,0 @@ -for (int i = 0; i < 55; i++) { - for (int j = 0; j < 55; j++) { - color c = color((i + j) * 1.8); - set(30 + i, 20 + j, c); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde deleted file mode 100755 index df70f1f2e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_11/Ex_11.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage trees; - -void setup() { - size(100, 100); - trees = loadImage("topangaCrop.jpg"); -} - -void draw() { - int x = constrain(mouseX, 0, 50); - set(x, 0, trees); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde deleted file mode 100755 index 78f585f75..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/35 Image 3/Ex_12/Ex_12.pde +++ /dev/null @@ -1,9 +0,0 @@ -PImage trees; -trees = loadImage("topangaCrop.jpg"); -background(0); -color white = color(255); -trees.set(0, 50, white); -trees.set(1, 50, white); -trees.set(2, 50, white); -trees.set(3, 50, white); -image(trees, 20, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde deleted file mode 100755 index 230e422e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -PFont font; -String s = "Pea"; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - text(s, 22, 20); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_01/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde deleted file mode 100755 index 23ac07e89..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -PFont font; -float x1 = 0; -float x2 = 100; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - text("Right", x1, 50); - text("Left", x2, 100); - x1 += 1.0; - if (x1 > 100) { - x1 = -150; - } - x2 -= 0.8; - if (x2 < -150) { - x2 = 100; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_02/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde deleted file mode 100755 index 7f25250d3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,15 +0,0 @@ -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - noStroke(); -} - -void draw() { - fill(204, 24); - rect(0, 0, width, height); - fill(0); - text("flicker", random(-100, 100), random(-20, 120)); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_03/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde deleted file mode 100755 index f61e7a883..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,19 +0,0 @@ -PFont font; -int opacity = 0; -int direction = 1; - -void setup() { - size(100, 100); - font = loadFont("EurekaSmallCaps-36.vlw"); - textFont(font); -} - -void draw() { - background(204); - opacity += 2 * direction; - if ((opacity < 0) || (opacity > 255)) { - direction = -direction; - } - fill(0, opacity); - text("fade", 4, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw deleted file mode 100755 index c59430232..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_04/data/EurekaSmallCaps-36.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde deleted file mode 100755 index 87f2cb32e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,21 +0,0 @@ -PFont font; -String s = "VERTIGO"; -float angle = 0.0; - -void setup() { - size(100, 100); - font = loadFont("Eureka-90.vlw"); - textFont(font, 24); - fill(0); -} - -void draw() { - background(204); - angle += 0.02; - pushMatrix(); - translate(33, 50); - scale((cos(angle / 4.0) + 1.2) * 2.0); - rotate(angle); - text(s, 0, 0); - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw deleted file mode 100755 index 9da1ffa8d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_05/data/Eureka-90.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde deleted file mode 100755 index 05551c47a..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,20 +0,0 @@ -PFont font; -String[] words = { "Three", "strikes", "and", "you're", "out...", " " }; -int whichWord = 0; - -void setup() { - size(100, 100); - font = loadFont("Eureka-32.vlw"); - textFont(font); - textAlign(CENTER); - frameRate(4); -} - -void draw() { - background(204); - whichWord++; - if (whichWord == words.length) { - whichWord = 0; - } - text(words[whichWord], width / 2, 55); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw deleted file mode 100755 index baa632fc8..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_06/data/Eureka-32.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde deleted file mode 100755 index e99f7ff8e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,22 +0,0 @@ -// The size of each letter grows and shrinks from -// left to right -PFont font; -String s = "AREA"; -float angle = 0.0; - -void setup() { - size(100, 100); - font = loadFont("EurekaMono-48.vlw"); - textFont(font); - fill(0); -} - -void draw() { - background(204); - angle += 0.1; - for (int i = 0; i < s.length(); i++) { - float c = sin(angle + i / PI); - textSize((c + 1.0) * 32 + 10); - text(s.charAt(i), i*26, 60); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw deleted file mode 100755 index 90ed8654d..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_07/data/EurekaMono-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde deleted file mode 100755 index 676fe996d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,36 +0,0 @@ -// Each letter enters from the bottom in sequence and -// stops when it reaches its destination -PFont font; -String word = "rise"; -char[] letters; -float[] y; // Y-coordinate for each letter -int currentLetter = 0; // Letter currently in motion - -void setup() { - size(100, 100); - font = loadFont("EurekaSmallCaps-36.vlw"); - textFont(font); - letters = word.toCharArray(); - y = new float[letters.length]; - for (int i = 0; i < letters.length; i++) { - y[i] = 130; // Position off the screen - } - fill(0); -} - -void draw() { - background(204); - if (y[currentLetter] > 35) { - y[currentLetter] -= 3; // Move current letter up - } else { - if (currentLetter < letters.length - 1) { - currentLetter++; // Switch to next letter - } - } -// Calculate x to center the word on screen - float x = (width - textWidth(word)) / 2; - for (int i = 0; i < letters.length; i++) { - text(letters[i], x, y[i]); - x += textWidth(letters[i]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw b/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw deleted file mode 100755 index c59430232..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/36 Typography 2/Ex_08/data/EurekaSmallCaps-36.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde deleted file mode 100755 index c3662720e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/Ex_01.pde +++ /dev/null @@ -1,16 +0,0 @@ -// The word "avoid" stays away from the mouse because its -// position is set to the inverse of the cursor position -PFont f; - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - textAlign(CENTER); - fill(0); -} - -void draw() { - background(204); - text("avoid", width - mouseX, height - mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_01/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde deleted file mode 100755 index a7d786ac6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -// The word "tickle" jitters when the cursor hovers over -PFont f; -float x = 33; // X-coordinate of text -float y = 60; // Y-coordinate of text - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - noStroke(); -} - -void draw() { - fill(204, 120); - rect(0, 0, width, height); - fill(0); -// If the cursor is over the text, change the position - if ((mouseX >= x) && (mouseX <= x + 55) && - (mouseY >= y - 24) && (mouseY <= y)) { - x += random(-5, 5); - y += random(-5, 5); - } - text("tickle", x, y); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_02/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde deleted file mode 100755 index 15110a981..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/Ex_03.pde +++ /dev/null @@ -1,28 +0,0 @@ -// The horizontal position of the mouse determines the -// rotation angle. The angle accumulates with each letter -// drawn to make the typography curve. -String word = "Flexibility"; -PFont f; -char[] letters; - -void setup() { - size(100, 100); - f = loadFont("Eureka-24.vlw"); - textFont(f); - letters = word.toCharArray(); - fill(0); -} - -void draw() { - background(204); - pushMatrix(); - translate(0, 33); - for (int i = 0; i < letters.length; i++) { - float angle = map(mouseX, 0, width, 0, PI / 8); - rotate(angle); - text(letters[i], 0, 0); -// Offset by the width of the current letter - translate(textWidth(letters[i]), 0); - } - popMatrix(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_03/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde deleted file mode 100755 index 308db6aee..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/Ex_04.pde +++ /dev/null @@ -1,35 +0,0 @@ -// Calculates the size of each letter based on the -// position of the cursor so the letters are larger -// when the cursor is closer -String word = "BULGE"; -char[] letters; -float totalOffset = 0; -PFont font; - -void setup() { - size(100, 100); - font = loadFont("Eureka-48.vlw"); - textFont(font); - letters = word.toCharArray(); - textAlign(CENTER); - fill(0); -} - -void draw() { - background(204); - translate((width - totalOffset) / 2, 0); - totalOffset = 0; - float firstWidth = (width / letters.length) / 4.0; - translate(firstWidth, 0); - for (int i = 0; i < letters.length; i++) { - float distance = abs(totalOffset - mouseX); - distance = constrain(distance, 24, 60); - textSize(84 - distance); - text(letters[i], 0, height - 2); - float letterWidth = textWidth(letters[i]); - if (i != letters.length - 1) { - totalOffset = totalOffset + letterWidth; - translate(letterWidth, 0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw b/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw deleted file mode 100755 index 9d4083d6b..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 31-42/37 Typography 3/Ex_04/data/Eureka-48.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde deleted file mode 100755 index e46c7e453..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,10 +0,0 @@ -color c1 = color(0, 126, 255); // Create a new color -float r = red(c1); // Assign 0.0 to r -float g = green(c1); // Assign 126.0 to g -float b = blue(c1); // Assign 255.0 to b -println(r + ", " + g + ", " + b); // Prints "0.0, 126.0, 255.0" -color c2 = color(102); // Create a new gray value -float r2 = red(c2); // Assign 102.0 to r2 -float g2 = green(c2); // Assign 102.0 to g2 -float b2 = blue(c2); // Assign 102.0 to b2 -println(r2 + ", " + g2 + ", " + b2); // Prints "102.0, 102.0, 102.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde deleted file mode 100755 index 48578ef0b..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,5 +0,0 @@ -color c = color(0, 51, 102); // Create a new color -color g = color(0, 126, 255, 220); // Create a new color -float a = alpha(c); // Assign 255.0 to a -float b = alpha(g); // Assign 220.0 to b -println(a + ", " + b); // Prints "255.0, 220.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde deleted file mode 100755 index 193a7adff..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,6 +0,0 @@ -colorMode(HSB, 360, 100, 100); // Set color mode to HSB -color c = color(210, 100, 40); // Create a new color -float h = hue(c); // Assign 210.0 to h -float s = saturation(c); // Assign 100.0 to s -float b = brightness(c); // Assign 40.0 to b -println(h + ", " + s + ", " + b); // Prints "210.0, 100.0, 40.0" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde deleted file mode 100755 index 0c6cc1b91..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c = color(217, 41, 117); // Create a new color -float r = red(c); // Assign 217.0 to r -float h = hue(c); // Assign 236.64774 to h -println(r + ", " + h); // Prints "217.0, 236.64774" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde deleted file mode 100755 index 066e89c26..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,5 +0,0 @@ -colorMode(RGB, 1.0); // Sets color mode to HSB -color c = color(0.2, 0.8, 1.0); // Creates a new color -float r = red(c); // Assign 0.2 to r -float h = hue(c); // Assign 0.5416667 to h -println(r + ", " + h); // Prints "0.2, 0.5416667" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde deleted file mode 100755 index eb01830ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,4 +0,0 @@ -color c = color(118, 22, 24); // Create a new color -int r1 = red(c); // ERROR! red() returns a float -float r2 = red(c); // Assign 118.0 to r2 -int r3 = int(red(c)); // Assign 118 to r3 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde deleted file mode 100755 index be9bae4b1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -// Sets the stroke color of the lines to the -// red component of the pixel below their intersection - -void setup() { - size(100, 100); - smooth(); - fill(204, 0, 0); -} - -void draw() { - background(0); - noStroke(); - ellipse(66, 46, 80, 80); - color c = get(mouseX, mouseY); - float r = red(c); // Extract red component - stroke(255 - r); // Set the stroke based on red value - line(mouseX, 0, mouseX, height); - line(0, mouseY, width, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde deleted file mode 100755 index b023881e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Simulates one pixel of a flat-panel display -PImage wall; - -void setup() { - size(100, 100); - wall = loadImage("veg.jpg"); - stroke(255); -} - -void draw() { - background(wall); - color c = get(mouseX, mouseY); - float r = red(c); // Extract red - float g = green(c); // Extract green - float b = blue(c); // Extract blue - fill(r, 0, 0); - rect(32, 20, 12, 60); // Red component - fill(0, g, 0); - rect(44, 20, 12, 60); // Green component - fill(0, 0, b); - rect(56, 20, 12, 60); // Blue component -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde deleted file mode 100755 index 83ccd475c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,29 +0,0 @@ -int num = 400; -float[] x = new float[num]; -float[] y = new float[num]; -PImage img; - -void setup() { - size(100, 100); - img = loadImage("standing-alt.jpg"); - for (int i = 0; i < num; i++) { - x[i] = random(width); - y[i] = random(height); - } - stroke(255); -} - -void draw() { - background(0); - for (int i = 0; i < num; i++) { - color c = img.get(int(x[i]), int(y[i])); - float b = brightness(c) / 255.0; - float speed = pow(b, 2) + 0.05; - x[i] += speed; - if (x[i] > width) { - x[i] = 0; - y[i] = random(height); - } - point(x[i], y[i]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde deleted file mode 100755 index bbb4763e1..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,23 +0,0 @@ -color olive, gray; - -void setup() { - size(100, 100); - colorMode(HSB, 360, 100, 100, 100); - noStroke(); - smooth(); - olive = color(75, 61, 59); - gray = color(30, 17, 42); -} - -void draw() { - float y = mouseY / float(height); - background(gray); - fill(olive); - quad(70 + y*6, 0, 100, 0, 100, 100, 30 - y*6, 100); - color yellow = color(48 + y * 20, 100, 88 - y * 20); - fill(yellow); - ellipse(50, 45 + y*10, 60, 60); - color orange = color(29, 100, 83 - y * 10); - fill(orange); - ellipse(54, 42 + y*16, 24, 24); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde deleted file mode 100755 index c3ddc1282..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,21 +0,0 @@ -PImage img; - -void setup() { - size(100, 100); - smooth(); - frameRate(0.5); - img = loadImage("palette10x10.jpg"); -} - -void draw() { - background(0); - for (int x = 0; x < img.width; x++) { - for (int y = 0; y < img.height; y++) { - float xpos1 = random(x * 10); - float xpos2 = width - random(y * 10); - color c = img.get(x, y); - stroke(c); - line(xpos1, 0, xpos2, height); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde deleted file mode 100755 index 898b226a3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,17 +0,0 @@ -PImage img; - -void setup() { - size(100, 100); - noStroke(); - img = loadImage("palette10x10.jpg"); -} - -void draw() { - int ix = int(random(img.width)); - int iy = int(random(img.height)); - color c = img.get(ix, iy); - fill(c, 102); - int xgrid = int(random(-2, 5)) * 25; - int ygrid = int(random(-2, 5)) * 25; - rect(xgrid, ygrid, 40, 40); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde deleted file mode 100755 index dca011728..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/38 Color 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,42 +0,0 @@ -PImage img; -color[] imageColors; - -void setup() { - size(100, 100); - frameRate(0.5); - smooth(); - noFill(); - img = loadImage("palette10x10.jpg"); - imageColors = new color[img.width*img.height]; - for (int y = 0; y < img.height; y++) { - for (int x = 0; x < img.width; x++) { - imageColors[y*img.height + x] = img.get(x, y); - } - } - imageColors = sortColors(imageColors); -} - -void draw() { - background(255); - for (int x = 10; x < width; x += 10) { - int r = int(random(imageColors.length)); - float thick = ((100 - r) / 4.0) + 1.0; - stroke(imageColors[r]); - strokeWeight(thick); - line(x, height, x, height - r + thick); - line(x, 0, x, height - r - thick); - } -} -color[] sortColors(color[] colors) { - color[] sorted = new color[colors.length]; - int num = 0; - for (int i = 0; i <= 255; i++) { - for (int j = 0; j < colors.length; j++) { - if (int(brightness(colors[j])) == i) { - sorted[num] = colors[j]; - num++; - } - } - } - return sorted; -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde deleted file mode 100755 index 0fa02b463..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("topanga.jpg"); -image(img, 0, 0); -filter(THRESHOLD, 0.3); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde deleted file mode 100755 index 8ed3b646f..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -smooth(); -strokeWeight(5); -noFill(); -line(0, 30, 100, 60); -filter(BLUR, 3); -line(0, 50, 100, 80); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde deleted file mode 100755 index 89c7c083d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,18 +0,0 @@ -float fuzzy = 0.0; - -void setup() { - size(100, 100); - smooth(); - strokeWeight(5); - noFill(); -} - -void draw() { - background(204); - if (fuzzy < 16.0) { - fuzzy += 0.05; - } - line(0, 30, 100, 60); - filter(BLUR, fuzzy); - line(0, 50, 100, 80); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde deleted file mode 100755 index 08fd4b9b0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img = loadImage("forest.jpg"); -image(img, 0, 0); -img.filter(INVERT); -image(img, 50, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde deleted file mode 100755 index b3d8dd0c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,7 +0,0 @@ -background(0); -stroke(153); -strokeWeight(24); -smooth(); -line(44, 0, 24, 80); -line(0, 24, 80, 44); -blend(0, 0, 100, 100, 16, 0, 100, 100, ADD); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde deleted file mode 100755 index aa5a768ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage img = loadImage("topanga.jpg"); -background(0); -stroke(255); -strokeWeight(24); -smooth(); -line(44, 0, 24, 80); -line(0, 24, 80, 44); -blend(img, 0, 0, 100, 100, 0, 0, 100, 100, DARKEST); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde deleted file mode 100755 index 29d149526..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,4 +0,0 @@ -PImage img = loadImage("forest.jpg"); -PImage img2 = loadImage("airport.jpg"); -img.blend(img2, 12, 12, 76, 76, 12, 12, 76, 76, ADD); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde deleted file mode 100755 index 97218ec20..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,10 +0,0 @@ -color g1 = color(102); // Middle gray -color g2 = color(51); // Dark gray -color g3 = blendColor(g1, g2, MULTIPLY); // Create black -noStroke(); -fill(g1); -rect(50, 0, 50, 100); // Right rect -fill(g2); -rect(20, 25, 30, 50); // Left rect -fill(g3); -rect(50, 25, 20, 50); // Overlay rect \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde deleted file mode 100755 index 8e5f4c30c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("forest.jpg"); -image(img, 0, 0); -copy(0, 0, 100, 50, 0, 50, 100, 50); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde deleted file mode 100755 index 6157a4b7e..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,14 +0,0 @@ -PImage img1, img2; - -void setup() { - size(100, 100); - img1 = loadImage("forest.jpg"); - img2 = loadImage("airport.jpg"); -} - -void draw() { - background(255); - image(img1, 0, 0); - int my = constrain(mouseY, 0, 67); - copy(img2, 0, my, 100, 33, 0, my, 100, 33); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde deleted file mode 100755 index e57d043cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,3 +0,0 @@ -PImage img = loadImage("tower.jpg"); -img.copy(50, 0, 50, 100, 0, 0, 50, 100); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde deleted file mode 100755 index b1a28faf9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/39 Image 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,5 +0,0 @@ -background(255); -PImage img = loadImage("airport.jpg"); -PImage maskImg = loadImage("airportmask.jpg"); -img.mask(maskImg); -image(img, 0, 0); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde deleted file mode 100755 index 8d696e3a4..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - float gray = map(second(), 0, 59, 0, 255); - color c = color(gray); - int index = frameCount % (width * height); - loadPixels(); - pixels[index] = c; - updatePixels(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde deleted file mode 100755 index 9cce82801..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -// These 3 lines of code is equivalent to: set(25, 50, color(0)) -loadPixels(); -pixels[50*width + 25] = color(0); -updatePixels(); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde deleted file mode 100755 index 3c55060ca..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -// These 3 lines are equivalent to: pixels[5075] = color(0) -int y = 5075 / width; -int x = 5075 % width; -set(x, y, color(0)); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde deleted file mode 100755 index 35f7231cf..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { -// Constrain to not exceed the boundary of the array - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - loadPixels(); - pixels[my*width + mx] = color(0); - updatePixels(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde deleted file mode 100755 index 41995d7f9..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,18 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - noStroke(); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(arch); -// Constrain to not exceed the boundary of the array - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - loadPixels(); - color c = pixels[my*width + mx]; - fill(c); - rect(20, 20, 60, 60); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde deleted file mode 100755 index 5ea2f46c5..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(204); - int mx = constrain(mouseX, 0, 99); - int my = constrain(mouseY, 0, 99); - arch.loadPixels(); - arch.pixels[my*width + mx] = color(0); - arch.updatePixels(); - image(arch, 50, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde deleted file mode 100755 index b403166f8..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i += 2) { - pixels[i] = arch.pixels[i]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde deleted file mode 100755 index c943891a6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i += 3) { - pixels[i] = arch.pixels[i]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde deleted file mode 100755 index 2b5f5e57c..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i++) { - pixels[i] = arch.pixels[count - i - 1]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde deleted file mode 100755 index bf8f4adc8..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,8 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -int count = arch.width * arch.height; -arch.loadPixels(); -loadPixels(); -for (int i = 0; i < count; i++) { - pixels[i] = arch.pixels[i/2]; -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde deleted file mode 100755 index 0abc1cb2d..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_11/Ex_11.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage arch = loadImage("arch.jpg"); -background(arch); -loadPixels(); -for (int i = 0; i < width*height; i++) { - color p = pixels[i]; // Grab pixel - float r = 255 - red(p); // Modify red value - float g = 255 - green(p); // Modify green value - float b = 255 - blue(p); // Modify blue value - pixels[i] = color(r, g, b); // Assign modified value -} -updatePixels(); diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde deleted file mode 100755 index ff9881cf6..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_12/Ex_12.pde +++ /dev/null @@ -1,22 +0,0 @@ -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); -} - -void draw() { - background(arch); - loadPixels(); - for (int i = 0; i < width*height; i++) { - color p = pixels[i]; // Read color from screen - float r = red(p); // Modify red value - float g = green(p); // Modify green value - float b = blue(p); // Modify blue value - float bw = (r + g + b) / 3.0; - bw = constrain(bw + mouseX, 0, 255); - pixels[i] = color(bw); // Assign modified value - } - updatePixels(); - line(mouseX, 0, mouseX, height); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde deleted file mode 100755 index 0a53a6f65..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_13/Ex_13.pde +++ /dev/null @@ -1,31 +0,0 @@ -float[][] kernel = { {-1, 0, 1}, - {-2, 0, 2}, - {-1, 0, 1} }; -size(100, 100); -PImage img = loadImage("arch.jpg"); // Load the original image -img.loadPixels(); -// Create an opaque image of the same size as the original -PImage edgeImg = createImage(img.width, img.height, RGB); -// Loop through every pixel in the image. -for (int y = 1; y < img.height - 1; y++) { // Skip top and bottom edges - for (int x = 1; x < img.width - 1; x++) { // Skip left and right edges - float sum = 0; // Kernel sum for this pixel - for (int ky = -1; ky <= 1; ky++) { - for (int kx = -1; kx <= 1; kx++) { - // Calculate the adjacent pixel for this kernel point - int pos = (y + ky) * width + (x + kx); - // Image is grayscale, red/green/blue are identical - float val = red(img.pixels[pos]); - // Multiply adjacent pixels based on the kernel values - sum += kernel[ky+1][kx+1] * val; - } - } - // For this pixel in the new image, set the gray value - // based on the sum from the kernel - edgeImg.pixels[y*img.width + x] = color(sum); - } -} -// State that there are changes to edgeImg.pixels[] -edgeImg.updatePixels(); -image(edgeImg, 0, 0); // Draw the new image - diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde deleted file mode 100755 index 4bd855226..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_14/Ex_14.pde +++ /dev/null @@ -1,22 +0,0 @@ -// Convert pixel values into a circle's diameter -PImage arch; -int index; - -void setup() { - size(100, 100); - smooth(); - fill(0); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - color c = arch.pixels[index]; // Get a pixel - float r = red(c) / 3.0; // Get the red value - ellipse(width / 2, height / 2, r, r); - index++; - if (index == width*height) { - index = 0; // Return to the first pixel - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde deleted file mode 100755 index 2999458b3..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_15/Ex_15.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Convert the red values of pixels to line lengths -PImage arch; - -void setup() { - size(100, 100); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - int my = constrain(mouseY, 0, 99); - for (int i = 0; i < arch.height; i++) { - color c = arch.pixels[my*width + i]; // Get a pixel - float r = red(c); // Get the red value - line(i, 0, i, height / 2 + r / 6); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde deleted file mode 100755 index 3576ea260..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/40 Image 5/Ex_16/Ex_16.pde +++ /dev/null @@ -1,25 +0,0 @@ -// Convert the blue values from one row of the image -// to the coordinates for a series of lines -PImage arch; - -void setup() { - size(100, 100); - smooth(); - arch = loadImage("arch.jpg"); - arch.loadPixels(); -} - -void draw() { - background(204); - int mx = constrain(mouseX, 0, arch.width - 1); - int offset = mx * arch.width; - beginShape(LINES); - for (int i = 0; i < arch.width; i += 2) { - float r1 = blue(arch.pixels[offset + i]); - float r2 = blue(arch.pixels[offset + i + 1]); - float vx = map(r1, 0, 255, 0, height); - float vy = map(r2, 0, 255, 0, height); - vertex(vx, vy); - } - endShape(); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde deleted file mode 100755 index 7e7be5678..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,4 +0,0 @@ -line(0, 0, width, height); -line(width, 0, 0, height); -// Saves the TIFF file "x.tif" to the current sketch's folder -save("x.tif"); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde deleted file mode 100755 index 565a6bef4..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -line(0, 0, width, height); -// Saves the TIFF file "line.tif" to the current sketch's folder -save("line.tif"); -line(width, 0, 0, height); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde deleted file mode 100755 index 82136d8cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,12 +0,0 @@ -void setup() { - size(100, 100); -} - -void draw() { - background(204); - line(0, 0, mouseX, height); - line(width, 0, 0, mouseY); -} -void mousePressed() { - save("line.tif"); -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde deleted file mode 100755 index 6d9aca159..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,18 +0,0 @@ -// Save the first 50 frames -float x = 33; -float numFrames = 50; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - x += random(-2, 2); - ellipse(x, 50, 40, 40); - if (frameCount <= numFrames) { - saveFrame("circles-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde deleted file mode 100755 index 5c51a4916..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Save 24 frames, from x-1000.tif to x-1023.tif -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); - if ((frameCount > 99) && (frameCount < 1024)) { - saveFrame("x-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde deleted file mode 100755 index 9781d98ae..000000000 --- a/java/examples/Books/Processing Handbook/Units 31-42/41 Output 1/Ex_06/Ex_06.pde +++ /dev/null @@ -1,8 +0,0 @@ -// Save every fifth frame (i.e., x-0005.tif, x-0005.tif, x-0010.tif) -void draw() { - background(204); - line(mouseX, mouseY, pmouseX, pmouseY); - if ((frameCount % 5) == 0) { - saveFrame("x-####.tif"); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde deleted file mode 100755 index 1e16e7107..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_01/Ex_01.pde +++ /dev/null @@ -1,14 +0,0 @@ -int x = 33; -int y = 50; -int diameter = 30; - -void setup() { - size(100, 100); - smooth(); - noStroke(); -} - -void draw() { - background(0); - ellipse(x, y, diameter, diameter); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde deleted file mode 100755 index d127da35f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_02/Ex_02.pde +++ /dev/null @@ -1,21 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(); // Construct the object - sp.x = 33; // Assign 33 to the x field - sp.y = 50; // Assign 50 to the y field - sp.diameter = 30; // Assign 30 to the diameter field -} - -void draw() { - background(0); - ellipse(sp.x, sp.y, sp.diameter, sp.diameter); -} - -class Spot { - float x, y; // The x- and y-coordinate - float diameter; // Diameter of the circle -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde deleted file mode 100755 index 8e9cd706a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(); // Construct the object - sp.x = 33; - sp.y = 50; - sp.diameter = 30; -} - -void draw() { - background(0); - sp.display(); -} - -class Spot { - float x, y, diameter; - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde deleted file mode 100755 index 98814ec72..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(33, 50, 30); // Construct the object -} - -void draw() { - background(0); - sp.display(); -} - -class Spot { - float x, y, diameter; - - Spot(float xpos, float ypos, float dia) { - x = xpos; // Assign 33 to x - y = ypos; // Assign 50 to y - diameter = dia; // Assign 30 to diameter - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde deleted file mode 100755 index 188240b18..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_05/Ex_05.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde deleted file mode 100755 index faa47a70b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_06/Ex_06.pde +++ /dev/null @@ -1,42 +0,0 @@ -Spot sp; // Declare the object - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp = new Spot(33, 50, 30, 1.5); // Construct the object -} - -void draw() { - fill(0, 15); - rect(0, 0, width, height); - fill(255); - sp.move(); - sp.display(); -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde deleted file mode 100755 index cd31bc1f4..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_07/Ex_07.pde +++ /dev/null @@ -1,49 +0,0 @@ -Spot sp1, sp2, sp3; // Declare the objects - -void setup() { - size(100, 100); - smooth(); - noStroke(); - sp1 = new Spot(20, 50, 40, 0.5); // Construct sp1 - sp2 = new Spot(50, 50, 10, 2.0); // Construct sp2 - sp3 = new Spot(80, 50, 30, 1.5); // Construct sp3 -} - -void draw() { - fill(0, 15); - rect(0, 0, width, height); - fill(255); - sp1.move(); - sp2.move(); - sp3.move(); - sp1.display(); - sp2.display(); - sp3.display(); -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_08/Ex_08.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde deleted file mode 100755 index 85f36def1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_09/Ex_09.pde +++ /dev/null @@ -1,51 +0,0 @@ -Egg humpty; // Declare the object - -void setup() { - size(100, 100); - smooth(); -// Inputs: x-coordinate, y-coordinate, tilt, height - humpty = new Egg(50, 100, PI / 32, 80); -} - -void draw() { - background(0); - humpty.wobble(); - humpty.display(); -} - -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde deleted file mode 100755 index 4c5f47eb1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_10/Ex_10.pde +++ /dev/null @@ -1,53 +0,0 @@ -int numSpots = 6; -// Declare and create the array -Spot[] spots = new Spot[numSpots]; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - for (int i = 0; i < spots.length; i++) { - float x = 10 + i * 16; - float rate = 0.5 + i * 0.05; -// Create each object - spots[i] = new Spot(x, 50, 16, rate); - } -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - for (int i = 0; i < spots.length; i++) { - spots[i].move(); // Move each object - spots[i].display(); // Display each object - } -} - -class Spot { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the circle - float speed; // Distance moved each frame - int direction = 1; // Direction of motion (1 is down, -1 is up) - - // Constructor - Spot(float xpos, float ypos, float dia, float sp) { - x = xpos; - y = ypos; - diameter = dia; - speed = sp; - } - - void move() { - y += (speed * direction); - if ((y > (height - diameter / 2)) || (y < diameter / 2)) { - direction *= -1; - } - } - - void display() { - ellipse(x, y, diameter, diameter); - } -} - - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_11/Ex_11.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde deleted file mode 100755 index f3ba8257c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/43 Structure 4/Ex_12/Ex_12.pde +++ /dev/null @@ -1,60 +0,0 @@ -Ring[] rings; // Declare the array -int numRings = 50; -int currentRing = 0; - -void setup() { - size(100, 100); - smooth(); - rings = new Ring[numRings]; // Create the array - for (int i = 0; i < numRings; i++) { - rings[i] = new Ring(); // Create each object - } -} - -void draw() { - background(0); - for (int i = 0; i < numRings; i++) { - rings[i].grow(); - rings[i].display(); - } -} - -// Click to create a new Ring -void mousePressed() { - rings[currentRing].start(mouseX, mouseY); - currentRing++; - if (currentRing >= numRings) { - currentRing = 0; - } -} - -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde deleted file mode 100755 index 9659cf1c0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -void setup() { - size(100, 100); - smooth(); -} - -void draw() { - float s = dist(mouseX, mouseY, pmouseX, pmouseY) + 1; - noStroke(); - fill(0, 102); - ellipse(mouseX, mouseY, s, s); - stroke(255); - point(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6bb961cc6..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,24 +0,0 @@ -int angle = 0; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - fill(0, 102); -} - -void draw() { -// Draw only when mouse is pressed - if (mousePressed == true) { - angle += 10; - float val = cos(radians(angle)) * 6.0; - for (int a = 0; a < 360; a += 75) { - float xoff = cos(radians(a)) * val; - float yoff = sin(radians(a)) * val; - fill(0); - ellipse(mouseX + xoff, mouseY + yoff, val / 2, val / 2); - } - fill(255); - ellipse(mouseX, mouseY, 2, 2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde deleted file mode 100755 index 78845ddcf..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,31 +0,0 @@ -Blade diagonal; - -void setup() { - size(100, 100); - diagonal = new Blade(30, 80); -} - -void draw() { - diagonal.grow(); -} - -void mouseMoved() { - diagonal.seed(mouseX, mouseY); -} - -class Blade { - float x, y; - Blade(int xpos, int ypos) { - x = xpos; - y = ypos; - } - void seed(int xpos, int ypos) { - x = xpos; - y = ypos; - } - void grow() { - x += 0.5; - y -= 1.0; - point(x, y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde deleted file mode 100755 index e85a5bf81..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,19 +0,0 @@ -float x1, y1, x2, y2; - -void setup() { - size(100, 100); - smooth(); - x1 = width / 4.0; - y1 = x1; - x2 = width - x1; - y2 = x2; -} - -void draw() { - background(204); - x1 += random(-0.5, 0.5); - y1 += random(-0.5, 0.5); - x2 += random(-0.5, 0.5); - y2 += random(-0.5, 0.5); - line(x1, y1, x2, y2); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde deleted file mode 100755 index 9c310d4cd..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,46 +0,0 @@ -int numLines = 500; -MovingLine[] lines = new MovingLine[numLines]; -int currentLine = 0; - -void setup() { - size(100, 100); - smooth(); - frameRate(30); - for (int i = 0; i < numLines; i++) { - lines[i] = new MovingLine(); - } -} - -void draw() { - background(204); - for (int i = 0; i < currentLine; i++) { - lines[i].display(); - } -} - -void mouseDragged() { - lines[currentLine].setPosition(mouseX, mouseY, - pmouseX, pmouseY); - if (currentLine < numLines - 1) { - currentLine++; - } -} - -class MovingLine { - float x1, y1, x2, y2; - - void setPosition(int x, int y, int px, int py) { - x1 = x; - y1 = y; - x2 = px; - y2 = py; - } - - void display() { - x1 += random(-0.1, 0.1); - y1 += random(-0.1, 0.1); - x2 += random(-0.1, 0.1); - y2 += random(-0.1, 0.1); - line(x1, y1, x2, y2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif deleted file mode 100644 index 1d12b4c3c..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--0775.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif deleted file mode 100644 index 6809749fb..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--1287.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif deleted file mode 100644 index e67028578..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--2208.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif deleted file mode 100644 index e6218b499..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/44-06--6438.tif and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde deleted file mode 100755 index 3197cc0a2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/44 Drawing 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,33 +0,0 @@ -int currentFrame = 0; -PImage[] frames = new PImage[12]; -int lastTime = 0; - -void setup() { - size(100, 100); - strokeWeight(4); - smooth(); - background(204); - for (int i = 0; i < frames.length; i++) { - frames[i] = get(); // Create a blank frame - } -} - -void draw() { - int currentTime = millis(); - if (currentTime > lastTime + 100) { - nextFrame(); - lastTime = currentTime; - } - if (mousePressed == true) { - line(pmouseX, pmouseY, mouseX, mouseY); - } -} - -void nextFrame() { - frames[currentFrame] = get(); // Get the display window - currentFrame++; // Increment to next frame - if (currentFrame >= frames.length) { - currentFrame = 0; - } - image(frames[currentFrame], 0, 0); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde deleted file mode 100755 index 4a5abc28d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,7 +0,0 @@ -// Prints "tab space" -println("tab\tspace"); -// Prints each word after "\n" on a new line: -// line1 -// line2 -// line3 -println("line1\nline2\nline3"); diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde deleted file mode 100755 index 5366abe32..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,6 +0,0 @@ -println(nf(200, 10)); // Prints "0000000200" -println(nf(40, 5)); // Prints "00040" -println(nf(90, 3)); // Prints "090" -println(nf(200.94, 10, 4)); // Prints "0000000200.9400" -println(nf(40.2, 5, 3)); // Prints "00040.200" -println(nf(9.012, 3, 5)); // Prints "009.01200" diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde deleted file mode 100755 index 20eb0a6f9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,36 +0,0 @@ -int[] x = new int[0]; -int[] y = new int[0]; - -void setup() { - size(100, 100); -} - -void draw() { - background(204); - stroke(0); - noFill(); - beginShape(); - for (int i = 0; i < x.length; i++) { - vertex(x[i], y[i]); - } - endShape(); -// Show the next segment to be added - if (x.length >= 1) { - stroke(255); - line(mouseX, mouseY, x[x.length-1], y[x.length-1]); - } -} - -void mousePressed() { // Click to add a line segment - x = append(x, mouseX); - y = append(y, mouseY); -} - -void keyPressed() { // Press a key to save the data - String[] lines = new String[x.length]; - for (int i = 0; i < x.length; i++) { - lines[i] = x[i] + "\t" + y[i]; - } - saveStrings("lines.txt", lines); - exit(); // Stop the program -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt deleted file mode 100644 index 8c8304391..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_03/lines.txt +++ /dev/null @@ -1,9 +0,0 @@ -29 1 -68 80 -60 22 -27 71 -35 27 -90 22 -75 77 -33 94 -27 71 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde deleted file mode 100755 index f33aea6f5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,23 +0,0 @@ -PrintWriter output; - -void setup() { - size(100, 100); - // Create a new file in the sketch directory - output = createWriter("positions.txt"); - frameRate(12); -} - -void draw() { - if (mousePressed) { - point(mouseX, mouseY); - // Write the coordinate to a file with a - // "\t" (TAB character) between each entry - output.println(mouseX + "\t" + mouseY); - } -} - -void keyPressed() { // Press a key to save the data - output.flush(); // Write the remaining data - output.close(); // Finish the file - exit(); // Stop the program -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde deleted file mode 100755 index 31274ad55..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,31 +0,0 @@ -PFont font; -String letters = ""; -PrintWriter output; - -void setup() { - size(100, 100); - fill(0); - font = loadFont("Eureka-24.vlw"); - textFont(font); - // Create a new file in the sketch directory - output = createWriter("words.txt"); -} - -void draw() { - background(204); - text(letters, 5, 50); -} - -void keyPressed() { - if (key == ' ') { // Spacebar pressed - output.println(letters); // Write data to words.txt - letters = ""; // Clear the letter String - } else { - letters = letters + key; - } - if (key == ENTER) { - output.flush(); // Write the remaining data - output.close(); // Finish the file - exit(); // Stop the program - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw deleted file mode 100755 index d827a031f..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/data/Eureka-24.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/words.txt b/java/examples/Books/Processing Handbook/Units 43-51/45 Output 2/Ex_05/words.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde deleted file mode 100755 index a62f84313..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/Ex_01.pde +++ /dev/null @@ -1,13 +0,0 @@ -String[] lines = loadStrings("positions.txt"); - -for (int i = 0; i < lines.length; i++) { -// Split this line into pieces at each tab character - String[] pieces = split(lines[i], '\t'); -// Take action only if there are two values on the line -// (this will avoid blank or incomplete lines) - if (pieces.length == 2) { - int x = int(pieces[0]); - int y = int(pieces[1]); - point(x, y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt deleted file mode 100755 index 3b8ff2e23..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_01/data/positions.txt +++ /dev/null @@ -1,206 +0,0 @@ -70 35 -69 35 -68 39 -67 42 -66 47 -64 51 -64 54 -63 57 -60 60 -58 64 -51 69 -48 72 -44 73 -39 75 -35 75 -30 75 -25 75 -21 75 -17 73 -13 69 -12 66 -11 61 -11 57 -10 49 -10 45 -10 38 -12 32 -13 29 -16 23 -20 19 -24 16 -27 15 -31 13 -33 13 -37 13 -40 15 -42 16 -45 19 -46 21 -47 24 -48 26 -48 29 -48 33 -47 39 -43 45 -42 47 -38 50 -35 51 -32 51 -30 51 -27 50 -27 50 -26 46 -26 41 -29 36 -30 34 -31 33 -31 33 -32 33 -33 33 -34 33 -34 33 -35 33 -37 33 -39 33 -42 32 -44 31 -46 29 -48 29 -49 27 -52 24 -53 23 -57 19 -61 16 -63 14 -67 13 -69 12 -69 12 -77 11 -77 11 -80 11 -86 16 -90 21 -93 25 -95 29 -95 32 -95 33 -95 37 -94 41 -93 44 -92 46 -91 49 -89 51 -87 55 -85 59 -82 62 -80 64 -79 67 -77 69 -74 71 -68 72 -65 73 -63 73 -62 73 -60 72 -58 69 -57 67 -57 66 -56 60 -56 56 -56 54 -58 49 -60 47 -62 47 -63 47 -67 48 -70 52 -73 55 -74 57 -74 58 -74 60 -74 62 -73 65 -70 68 -67 69 -65 70 -63 70 -62 70 -60 68 -57 65 -55 64 -50 62 -46 61 -40 60 -38 60 -36 60 -32 61 -30 62 -27 64 -26 68 -25 71 -25 77 -25 81 -26 84 -28 86 -31 87 -33 88 -36 88 -39 86 -41 85 -43 83 -44 81 -45 76 -45 74 -45 71 -40 67 -37 65 -34 63 -33 61 -33 61 -32 60 -33 49 -37 45 -41 41 -45 39 -47 38 -51 37 -54 37 -58 38 -61 41 -63 44 -65 46 -66 49 -66 51 -67 55 -67 58 -67 60 -66 62 -64 65 -63 66 -61 67 -60 68 -58 68 -55 69 -54 69 -51 69 -48 69 -46 68 -45 66 -44 65 -44 63 -44 61 -44 59 -44 56 -44 55 -45 53 -47 52 -49 50 -50 48 -51 47 -52 46 -54 46 -55 45 -55 45 -56 44 -57 44 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde deleted file mode 100755 index d8680996c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_02/Ex_02.pde +++ /dev/null @@ -1,4 +0,0 @@ -String s = "a, b"; -String[] p = split(s, ", "); -println(p[0]); // Prints "a" -println(p[1]); // Prints "b" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde deleted file mode 100755 index 3671d0350..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_03/Ex_03.pde +++ /dev/null @@ -1,4 +0,0 @@ -String t = "a b"; -String[] q = splitTokens(t); -println(q[0]); // Prints "a" -println(q[1]); // Prints "b" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde deleted file mode 100755 index 61859e11e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_04/Ex_04.pde +++ /dev/null @@ -1,6 +0,0 @@ -String s = "a, b c ,,d "; // Despite the bad formatting, -String[] p = splitTokens(s, ", "); // the data is parsed correctly -println(p[0]); // Prints "a" -println(p[1]); // Prints "b" -println(p[2]); // Prints "c" -println(p[3]); // Prints "d" \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde deleted file mode 100755 index 24d9ada27..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/Ex_05.pde +++ /dev/null @@ -1,20 +0,0 @@ -String[] lines; -int index = 0; - -void setup() { - lines = loadStrings("positions.txt"); - frameRate(12); -} - -void draw() { - if (index < lines.length) { - String[] pieces = split(lines[index], '\t'); - if (pieces.length == 2) { - int x = int(pieces[0]); - int y = int(pieces[1]); - point(x, y); - } - // Go to the next line for the next run through draw() - index = index + 1; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt deleted file mode 100755 index 3b8ff2e23..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_05/data/positions.txt +++ /dev/null @@ -1,206 +0,0 @@ -70 35 -69 35 -68 39 -67 42 -66 47 -64 51 -64 54 -63 57 -60 60 -58 64 -51 69 -48 72 -44 73 -39 75 -35 75 -30 75 -25 75 -21 75 -17 73 -13 69 -12 66 -11 61 -11 57 -10 49 -10 45 -10 38 -12 32 -13 29 -16 23 -20 19 -24 16 -27 15 -31 13 -33 13 -37 13 -40 15 -42 16 -45 19 -46 21 -47 24 -48 26 -48 29 -48 33 -47 39 -43 45 -42 47 -38 50 -35 51 -32 51 -30 51 -27 50 -27 50 -26 46 -26 41 -29 36 -30 34 -31 33 -31 33 -32 33 -33 33 -34 33 -34 33 -35 33 -37 33 -39 33 -42 32 -44 31 -46 29 -48 29 -49 27 -52 24 -53 23 -57 19 -61 16 -63 14 -67 13 -69 12 -69 12 -77 11 -77 11 -80 11 -86 16 -90 21 -93 25 -95 29 -95 32 -95 33 -95 37 -94 41 -93 44 -92 46 -91 49 -89 51 -87 55 -85 59 -82 62 -80 64 -79 67 -77 69 -74 71 -68 72 -65 73 -63 73 -62 73 -60 72 -58 69 -57 67 -57 66 -56 60 -56 56 -56 54 -58 49 -60 47 -62 47 -63 47 -67 48 -70 52 -73 55 -74 57 -74 58 -74 60 -74 62 -73 65 -70 68 -67 69 -65 70 -63 70 -62 70 -60 68 -57 65 -55 64 -50 62 -46 61 -40 60 -38 60 -36 60 -32 61 -30 62 -27 64 -26 68 -25 71 -25 77 -25 81 -26 84 -28 86 -31 87 -33 88 -36 88 -39 86 -41 85 -43 83 -44 81 -45 76 -45 74 -45 71 -40 67 -37 65 -34 63 -33 61 -33 61 -32 60 -33 49 -37 45 -41 41 -45 39 -47 38 -51 37 -54 37 -58 38 -61 41 -63 44 -65 46 -66 49 -66 51 -67 55 -67 58 -67 60 -66 62 -64 65 -63 66 -61 67 -60 68 -58 68 -55 69 -54 69 -51 69 -48 69 -46 68 -45 66 -44 65 -44 63 -44 61 -44 59 -44 56 -44 55 -45 53 -47 52 -49 50 -50 48 -51 47 -52 46 -54 46 -55 45 -55 45 -56 44 -57 44 diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde deleted file mode 100755 index 2c380b7be..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/Ex_06.pde +++ /dev/null @@ -1,40 +0,0 @@ -Record[] records; -int recordCount; - -void setup() { - String[] lines = loadStrings("cars2.tsv"); - records = new Record[lines.length]; - for (int i = 0; i < lines.length; i++) { - String[] pieces = split(lines[i], '\t'); // Load data into array - if (pieces.length == 9) { - records[recordCount] = new Record(pieces); - recordCount++; - } - } - for (int i = 0; i < recordCount; i++) { - println(i + " -> " + records[i].name); // Print name to console - } -} - -class Record { - String name; - float mpg; - int cylinders; - float displacement; - float horsepower; - float weight; - float acceleration; - int year; - float origin; - public Record(String[] pieces) { - name = pieces[0]; - mpg = float(pieces[1]); - cylinders = int(pieces[2]); - displacement = float(pieces[3]); - horsepower = float(pieces[4]); - weight = float(pieces[5]); - acceleration = float(pieces[6]); - year = int(pieces[7]); - origin = float(pieces[8]); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv deleted file mode 100755 index 4beddafbc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_06/data/cars2.tsv +++ /dev/null @@ -1 +0,0 @@ -chevrolet chevelle malibu 18 8 307 130 3504 12 70 1 buick skylark 320 15 8 350 165 3693 11.5 70 1 plymouth satellite 18 8 318 150 3436 11 70 1 amc rebel sst 16 8 304 150 3433 12 70 1 ford torino 17 8 302 140 3449 10.5 70 1 ford galaxie 500 15 8 429 198 4341 10 70 1 chevrolet impala 14 8 454 220 4354 9 70 1 plymouth fury iii 14 8 440 215 4312 8.5 70 1 pontiac catalina 14 8 455 225 4425 10 70 1 amc ambassador dpl 15 8 390 190 3850 8.5 70 1 citroen ds-21 pallas NA 4 133 115 3090 17.5 70 2 chevrolet chevelle concours (sw) NA 8 350 165 4142 11.5 70 1 ford torino (sw) NA 8 351 153 4034 11 70 1 plymouth satellite (sw) NA 8 383 175 4166 10.5 70 1 amc rebel sst (sw) NA 8 360 175 3850 11 70 1 dodge challenger se 15 8 383 170 3563 10 70 1 plymouth 'cuda 340 14 8 340 160 3609 8 70 1 ford mustang boss 302 NA 8 302 140 3353 8 70 1 chevrolet monte carlo 15 8 400 150 3761 9.5 70 1 buick estate wagon (sw) 14 8 455 225 3086 10 70 1 toyota corona mark ii 24 4 113 95 2372 15 70 3 plymouth duster 22 6 198 95 2833 15.5 70 1 amc hornet 18 6 199 97 2774 15.5 70 1 ford maverick 21 6 200 85 2587 16 70 1 datsun pl510 27 4 97 88 2130 14.5 70 3 volkswagen 1131 deluxe sedan 26 4 97 46 1835 20.5 70 2 peugeot 504 25 4 110 87 2672 17.5 70 2 audi 100 ls 24 4 107 90 2430 14.5 70 2 saab 99e 25 4 104 95 2375 17.5 70 2 bmw 2002 26 4 121 113 2234 12.5 70 2 amc gremlin 21 6 199 90 2648 15 70 1 ford f250 10 8 360 215 4615 14 70 1 chevy c20 10 8 307 200 4376 15 70 1 dodge d200 11 8 318 210 4382 13.5 70 1 hi 1200d 9 8 304 193 4732 18.5 70 1 datsun pl510 27 4 97 88 2130 14.5 71 3 chevrolet vega 2300 28 4 140 90 2264 15.5 71 1 toyota corona 25 4 113 95 2228 14 71 3 ford pinto 25 4 98 NA 2046 19 71 1 volkswagen super beetle 117 NA 4 97 48 1978 20 71 2 amc gremlin 19 6 232 100 2634 13 71 1 plymouth satellite custom 16 6 225 105 3439 15.5 71 1 chevrolet chevelle malibu 17 6 250 100 3329 15.5 71 1 ford torino 500 19 6 250 88 3302 15.5 71 1 amc matador 18 6 232 100 3288 15.5 71 1 chevrolet impala 14 8 350 165 4209 12 71 1 pontiac catalina brougham 14 8 400 175 4464 11.5 71 1 ford galaxie 500 14 8 351 153 4154 13.5 71 1 plymouth fury iii 14 8 318 150 4096 13 71 1 dodge monaco (sw) 12 8 383 180 4955 11.5 71 1 ford country squire (sw) 13 8 400 170 4746 12 71 1 pontiac safari (sw) 13 8 400 175 5140 12 71 1 amc hornet sportabout (sw) 18 6 258 110 2962 13.5 71 1 chevrolet vega (sw) 22 4 140 72 2408 19 71 1 pontiac firebird 19 6 250 100 3282 15 71 1 ford mustang 18 6 250 88 3139 14.5 71 1 mercury capri 2000 23 4 122 86 2220 14 71 1 opel 1900 28 4 116 90 2123 14 71 2 peugeot 304 30 4 79 70 2074 19.5 71 2 fiat 124b 30 4 88 76 2065 14.5 71 2 toyota corolla 1200 31 4 71 65 1773 19 71 3 datsun 1200 35 4 72 69 1613 18 71 3 volkswagen model 111 27 4 97 60 1834 19 71 2 plymouth cricket 26 4 91 70 1955 20.5 71 1 toyota corona hardtop 24 4 113 95 2278 15.5 72 3 dodge colt hardtop 25 4 97.5 80 2126 17 72 1 volkswagen type 3 23 4 97 54 2254 23.5 72 2 chevrolet vega 20 4 140 90 2408 19.5 72 1 ford pinto runabout 21 4 122 86 2226 16.5 72 1 chevrolet impala 13 8 350 165 4274 12 72 1 pontiac catalina 14 8 400 175 4385 12 72 1 plymouth fury iii 15 8 318 150 4135 13.5 72 1 ford galaxie 500 14 8 351 153 4129 13 72 1 amc ambassador sst 17 8 304 150 3672 11.5 72 1 mercury marquis 11 8 429 208 4633 11 72 1 buick lesabre custom 13 8 350 155 4502 13.5 72 1 oldsmobile delta 88 royale 12 8 350 160 4456 13.5 72 1 chrysler newport royal 13 8 400 190 4422 12.5 72 1 mazda rx2 coupe 19 3 70 97 2330 13.5 72 3 amc matador (sw) 15 8 304 150 3892 12.5 72 1 chevrolet chevelle concours (sw) 13 8 307 130 4098 14 72 1 ford gran torino (sw) 13 8 302 140 4294 16 72 1 plymouth satellite custom (sw) 14 8 318 150 4077 14 72 1 volvo 145e (sw) 18 4 121 112 2933 14.5 72 2 volkswagen 411 (sw) 22 4 121 76 2511 18 72 2 peugeot 504 (sw) 21 4 120 87 2979 19.5 72 2 renault 12 (sw) 26 4 96 69 2189 18 72 2 ford pinto (sw) 22 4 122 86 2395 16 72 1 datsun 510 (sw) 28 4 97 92 2288 17 72 3 toyouta corona mark ii (sw) 23 4 120 97 2506 14.5 72 3 dodge colt (sw) 28 4 98 80 2164 15 72 1 toyota corolla 1600 (sw) 27 4 97 88 2100 16.5 72 3 buick century 350 13 8 350 175 4100 13 73 1 amc matador 14 8 304 150 3672 11.5 73 1 chevrolet malibu 13 8 350 145 3988 13 73 1 ford gran torino 14 8 302 137 4042 14.5 73 1 dodge coronet custom 15 8 318 150 3777 12.5 73 1 mercury marquis brougham 12 8 429 198 4952 11.5 73 1 chevrolet caprice classic 13 8 400 150 4464 12 73 1 ford ltd 13 8 351 158 4363 13 73 1 plymouth fury gran sedan 14 8 318 150 4237 14.5 73 1 chrysler new yorker brougham 13 8 440 215 4735 11 73 1 buick electra 225 custom 12 8 455 225 4951 11 73 1 amc ambassador brougham 13 8 360 175 3821 11 73 1 plymouth valiant 18 6 225 105 3121 16.5 73 1 chevrolet nova custom 16 6 250 100 3278 18 73 1 amc hornet 18 6 232 100 2945 16 73 1 ford maverick 18 6 250 88 3021 16.5 73 1 plymouth duster 23 6 198 95 2904 16 73 1 volkswagen super beetle 26 4 97 46 1950 21 73 2 chevrolet impala 11 8 400 150 4997 14 73 1 ford country 12 8 400 167 4906 12.5 73 1 plymouth custom suburb 13 8 360 170 4654 13 73 1 oldsmobile vista cruiser 12 8 350 180 4499 12.5 73 1 amc gremlin 18 6 232 100 2789 15 73 1 toyota carina 20 4 97 88 2279 19 73 3 chevrolet vega 21 4 140 72 2401 19.5 73 1 datsun 610 22 4 108 94 2379 16.5 73 3 maxda rx3 18 3 70 90 2124 13.5 73 3 ford pinto 19 4 122 85 2310 18.5 73 1 mercury capri v6 21 6 155 107 2472 14 73 1 fiat 124 sport coupe 26 4 98 90 2265 15.5 73 2 chevrolet monte carlo s 15 8 350 145 4082 13 73 1 pontiac grand prix 16 8 400 230 4278 9.5 73 1 fiat 128 29 4 68 49 1867 19.5 73 2 opel manta 24 4 116 75 2158 15.5 73 2 audi 100ls 20 4 114 91 2582 14 73 2 volvo 144ea 19 4 121 112 2868 15.5 73 2 dodge dart custom 15 8 318 150 3399 11 73 1 saab 99le 24 4 121 110 2660 14 73 2 toyota mark ii 20 6 156 122 2807 13.5 73 3 oldsmobile omega 11 8 350 180 3664 11 73 1 plymouth duster 20 6 198 95 3102 16.5 74 1 ford maverick 21 6 200 NA 2875 17 74 1 amc hornet 19 6 232 100 2901 16 74 1 chevrolet nova 15 6 250 100 3336 17 74 1 datsun b210 31 4 79 67 1950 19 74 3 ford pinto 26 4 122 80 2451 16.5 74 1 toyota corolla 1200 32 4 71 65 1836 21 74 3 chevrolet vega 25 4 140 75 2542 17 74 1 chevrolet chevelle malibu classic 16 6 250 100 3781 17 74 1 amc matador 16 6 258 110 3632 18 74 1 plymouth satellite sebring 18 6 225 105 3613 16.5 74 1 ford gran torino 16 8 302 140 4141 14 74 1 buick century luxus (sw) 13 8 350 150 4699 14.5 74 1 dodge coronet custom (sw) 14 8 318 150 4457 13.5 74 1 ford gran torino (sw) 14 8 302 140 4638 16 74 1 amc matador (sw) 14 8 304 150 4257 15.5 74 1 audi fox 29 4 98 83 2219 16.5 74 2 volkswagen dasher 26 4 79 67 1963 15.5 74 2 opel manta 26 4 97 78 2300 14.5 74 2 toyota corona 31 4 76 52 1649 16.5 74 3 datsun 710 32 4 83 61 2003 19 74 3 dodge colt 28 4 90 75 2125 14.5 74 1 fiat 128 24 4 90 75 2108 15.5 74 2 fiat 124 tc 26 4 116 75 2246 14 74 2 honda civic 24 4 120 97 2489 15 74 3 subaru 26 4 108 93 2391 15.5 74 3 fiat x1.9 31 4 79 67 2000 16 74 2 plymouth valiant custom 19 6 225 95 3264 16 75 1 chevrolet nova 18 6 250 105 3459 16 75 1 mercury monarch 15 6 250 72 3432 21 75 1 ford maverick 15 6 250 72 3158 19.5 75 1 pontiac catalina 16 8 400 170 4668 11.5 75 1 chevrolet bel air 15 8 350 145 4440 14 75 1 plymouth grand fury 16 8 318 150 4498 14.5 75 1 ford ltd 14 8 351 148 4657 13.5 75 1 buick century 17 6 231 110 3907 21 75 1 chevroelt chevelle malibu 16 6 250 105 3897 18.5 75 1 amc matador 15 6 258 110 3730 19 75 1 plymouth fury 18 6 225 95 3785 19 75 1 buick skyhawk 21 6 231 110 3039 15 75 1 chevrolet monza 2+2 20 8 262 110 3221 13.5 75 1 ford mustang ii 13 8 302 129 3169 12 75 1 toyota corolla 29 4 97 75 2171 16 75 3 ford pinto 23 4 140 83 2639 17 75 1 amc gremlin 20 6 232 100 2914 16 75 1 pontiac astro 23 4 140 78 2592 18.5 75 1 toyota corona 24 4 134 96 2702 13.5 75 3 volkswagen dasher 25 4 90 71 2223 16.5 75 2 datsun 710 24 4 119 97 2545 17 75 3 ford pinto 18 6 171 97 2984 14.5 75 1 volkswagen rabbit 29 4 90 70 1937 14 75 2 amc pacer 19 6 232 90 3211 17 75 1 audi 100ls 23 4 115 95 2694 15 75 2 peugeot 504 23 4 120 88 2957 17 75 2 volvo 244dl 22 4 121 98 2945 14.5 75 2 saab 99le 25 4 121 115 2671 13.5 75 2 honda civic cvcc 33 4 91 53 1795 17.5 75 3 fiat 131 28 4 107 86 2464 15.5 76 2 opel 1900 25 4 116 81 2220 16.9 76 2 capri ii 25 4 140 92 2572 14.9 76 1 dodge colt 26 4 98 79 2255 17.7 76 1 renault 12tl 27 4 101 83 2202 15.3 76 2 chevrolet chevelle malibu classic 17.5 8 305 140 4215 13 76 1 dodge coronet brougham 16 8 318 150 4190 13 76 1 amc matador 15.5 8 304 120 3962 13.9 76 1 ford gran torino 14.5 8 351 152 4215 12.8 76 1 plymouth valiant 22 6 225 100 3233 15.4 76 1 chevrolet nova 22 6 250 105 3353 14.5 76 1 ford maverick 24 6 200 81 3012 17.6 76 1 amc hornet 22.5 6 232 90 3085 17.6 76 1 chevrolet chevette 29 4 85 52 2035 22.2 76 1 chevrolet woody 24.5 4 98 60 2164 22.1 76 1 vw rabbit 29 4 90 70 1937 14.2 76 2 honda civic 33 4 91 53 1795 17.4 76 3 dodge aspen se 20 6 225 100 3651 17.7 76 1 ford granada ghia 18 6 250 78 3574 21 76 1 pontiac ventura sj 18.5 6 250 110 3645 16.2 76 1 amc pacer d/l 17.5 6 258 95 3193 17.8 76 1 volkswagen rabbit 29.5 4 97 71 1825 12.2 76 2 datsun b-210 32 4 85 70 1990 17 76 3 toyota corolla 28 4 97 75 2155 16.4 76 3 ford pinto 26.5 4 140 72 2565 13.6 76 1 volvo 245 20 4 130 102 3150 15.7 76 2 plymouth volare premier v8 13 8 318 150 3940 13.2 76 1 peugeot 504 19 4 120 88 3270 21.9 76 2 toyota mark ii 19 6 156 108 2930 15.5 76 3 mercedes-benz 280s 16.5 6 168 120 3820 16.7 76 2 cadillac seville 16.5 8 350 180 4380 12.1 76 1 chevy c10 13 8 350 145 4055 12 76 1 ford f108 13 8 302 130 3870 15 76 1 dodge d100 13 8 318 150 3755 14 76 1 honda accord cvcc 31.5 4 98 68 2045 18.5 77 3 buick opel isuzu deluxe 30 4 111 80 2155 14.8 77 1 renault 5 gtl 36 4 79 58 1825 18.6 77 2 plymouth arrow gs 25.5 4 122 96 2300 15.5 77 1 datsun f-10 hatchback 33.5 4 85 70 1945 16.8 77 3 chevrolet caprice classic 17.5 8 305 145 3880 12.5 77 1 oldsmobile cutlass supreme 17 8 260 110 4060 19 77 1 dodge monaco brougham 15.5 8 318 145 4140 13.7 77 1 mercury cougar brougham 15 8 302 130 4295 14.9 77 1 chevrolet concours 17.5 6 250 110 3520 16.4 77 1 buick skylark 20.5 6 231 105 3425 16.9 77 1 plymouth volare custom 19 6 225 100 3630 17.7 77 1 ford granada 18.5 6 250 98 3525 19 77 1 pontiac grand prix lj 16 8 400 180 4220 11.1 77 1 chevrolet monte carlo landau 15.5 8 350 170 4165 11.4 77 1 chrysler cordoba 15.5 8 400 190 4325 12.2 77 1 ford thunderbird 16 8 351 149 4335 14.5 77 1 volkswagen rabbit custom 29 4 97 78 1940 14.5 77 2 pontiac sunbird coupe 24.5 4 151 88 2740 16 77 1 toyota corolla liftback 26 4 97 75 2265 18.2 77 3 ford mustang ii 2+2 25.5 4 140 89 2755 15.8 77 1 chevrolet chevette 30.5 4 98 63 2051 17 77 1 dodge colt m/m 33.5 4 98 83 2075 15.9 77 1 subaru dl 30 4 97 67 1985 16.4 77 3 volkswagen dasher 30.5 4 97 78 2190 14.1 77 2 datsun 810 22 6 146 97 2815 14.5 77 3 bmw 320i 21.5 4 121 110 2600 12.8 77 2 mazda rx-4 21.5 3 80 110 2720 13.5 77 3 volkswagen rabbit custom diesel 43.1 4 90 48 1985 21.5 78 2 ford fiesta 36.1 4 98 66 1800 14.4 78 1 mazda glc deluxe 32.8 4 78 52 1985 19.4 78 3 datsun b210 gx 39.4 4 85 70 2070 18.6 78 3 honda civic cvcc 36.1 4 91 60 1800 16.4 78 3 oldsmobile cutlass salon brougham 19.9 8 260 110 3365 15.5 78 1 dodge diplomat 19.4 8 318 140 3735 13.2 78 1 mercury monarch ghia 20.2 8 302 139 3570 12.8 78 1 pontiac phoenix lj 19.2 6 231 105 3535 19.2 78 1 chevrolet malibu 20.5 6 200 95 3155 18.2 78 1 ford fairmont (auto) 20.2 6 200 85 2965 15.8 78 1 ford fairmont (man) 25.1 4 140 88 2720 15.4 78 1 plymouth volare 20.5 6 225 100 3430 17.2 78 1 amc concord 19.4 6 232 90 3210 17.2 78 1 buick century special 20.6 6 231 105 3380 15.8 78 1 mercury zephyr 20.8 6 200 85 3070 16.7 78 1 dodge aspen 18.6 6 225 110 3620 18.7 78 1 amc concord d/l 18.1 6 258 120 3410 15.1 78 1 chevrolet monte carlo landau 19.2 8 305 145 3425 13.2 78 1 buick regal sport coupe (turbo) 17.7 6 231 165 3445 13.4 78 1 ford futura 18.1 8 302 139 3205 11.2 78 1 dodge magnum xe 17.5 8 318 140 4080 13.7 78 1 chevrolet chevette 30 4 98 68 2155 16.5 78 1 toyota corona 27.5 4 134 95 2560 14.2 78 3 datsun 510 27.2 4 119 97 2300 14.7 78 3 dodge omni 30.9 4 105 75 2230 14.5 78 1 toyota celica gt liftback 21.1 4 134 95 2515 14.8 78 3 plymouth sapporo 23.2 4 156 105 2745 16.7 78 1 oldsmobile starfire sx 23.8 4 151 85 2855 17.6 78 1 datsun 200-sx 23.9 4 119 97 2405 14.9 78 3 audi 5000 20.3 5 131 103 2830 15.9 78 2 volvo 264gl 17 6 163 125 3140 13.6 78 2 saab 99gle 21.6 4 121 115 2795 15.7 78 2 peugeot 604sl 16.2 6 163 133 3410 15.8 78 2 volkswagen scirocco 31.5 4 89 71 1990 14.9 78 2 honda accord lx 29.5 4 98 68 2135 16.6 78 3 pontiac lemans v6 21.5 6 231 115 3245 15.4 79 1 mercury zephyr 6 19.8 6 200 85 2990 18.2 79 1 ford fairmont 4 22.3 4 140 88 2890 17.3 79 1 amc concord dl 6 20.2 6 232 90 3265 18.2 79 1 dodge aspen 6 20.6 6 225 110 3360 16.6 79 1 chevrolet caprice classic 17 8 305 130 3840 15.4 79 1 ford ltd landau 17.6 8 302 129 3725 13.4 79 1 mercury grand marquis 16.5 8 351 138 3955 13.2 79 1 dodge st. regis 18.2 8 318 135 3830 15.2 79 1 buick estate wagon (sw) 16.9 8 350 155 4360 14.9 79 1 ford country squire (sw) 15.5 8 351 142 4054 14.3 79 1 chevrolet malibu classic (sw) 19.2 8 267 125 3605 15 79 1 chrysler lebaron town @ country (sw) 18.5 8 360 150 3940 13 79 1 vw rabbit custom 31.9 4 89 71 1925 14 79 2 maxda glc deluxe 34.1 4 86 65 1975 15.2 79 3 dodge colt hatchback custom 35.7 4 98 80 1915 14.4 79 1 amc spirit dl 27.4 4 121 80 2670 15 79 1 mercedes benz 300d 25.4 5 183 77 3530 20.1 79 2 cadillac eldorado 23 8 350 125 3900 17.4 79 1 peugeot 504 27.2 4 141 71 3190 24.8 79 2 oldsmobile cutlass salon brougham 23.9 8 260 90 3420 22.2 79 1 plymouth horizon 34.2 4 105 70 2200 13.2 79 1 plymouth horizon tc3 34.5 4 105 70 2150 14.9 79 1 datsun 210 31.8 4 85 65 2020 19.2 79 3 fiat strada custom 37.3 4 91 69 2130 14.7 79 2 buick skylark limited 28.4 4 151 90 2670 16 79 1 chevrolet citation 28.8 6 173 115 2595 11.3 79 1 oldsmobile omega brougham 26.8 6 173 115 2700 12.9 79 1 pontiac phoenix 33.5 4 151 90 2556 13.2 79 1 vw rabbit 41.5 4 98 76 2144 14.7 80 2 toyota corolla tercel 38.1 4 89 60 1968 18.8 80 3 chevrolet chevette 32.1 4 98 70 2120 15.5 80 1 datsun 310 37.2 4 86 65 2019 16.4 80 3 chevrolet citation 28 4 151 90 2678 16.5 80 1 ford fairmont 26.4 4 140 88 2870 18.1 80 1 amc concord 24.3 4 151 90 3003 20.1 80 1 dodge aspen 19.1 6 225 90 3381 18.7 80 1 audi 4000 34.3 4 97 78 2188 15.8 80 2 toyota corona liftback 29.8 4 134 90 2711 15.5 80 3 mazda 626 31.3 4 120 75 2542 17.5 80 3 datsun 510 hatchback 37 4 119 92 2434 15 80 3 toyota corolla 32.2 4 108 75 2265 15.2 80 3 mazda glc 46.6 4 86 65 2110 17.9 80 3 dodge colt 27.9 4 156 105 2800 14.4 80 1 datsun 210 40.8 4 85 65 2110 19.2 80 3 vw rabbit c (diesel) 44.3 4 90 48 2085 21.7 80 2 vw dasher (diesel) 43.4 4 90 48 2335 23.7 80 2 audi 5000s (diesel) 36.4 5 121 67 2950 19.9 80 2 mercedes-benz 240d 30 4 146 67 3250 21.8 80 2 honda civic 1500 gl 44.6 4 91 67 1850 13.8 80 3 renault lecar deluxe 40.9 4 85 NA 1835 17.3 80 2 subaru dl 33.8 4 97 67 2145 18 80 3 vokswagen rabbit 29.8 4 89 62 1845 15.3 80 2 datsun 280-zx 32.7 6 168 132 2910 11.4 80 3 mazda rx-7 gs 23.7 3 70 100 2420 12.5 80 3 triumph tr7 coupe 35 4 122 88 2500 15.1 80 2 ford mustang cobra 23.6 4 140 NA 2905 14.3 80 1 honda accord 32.4 4 107 72 2290 17 80 3 plymouth reliant 27.2 4 135 84 2490 15.7 81 1 buick skylark 26.6 4 151 84 2635 16.4 81 1 dodge aries wagon (sw) 25.8 4 156 92 2620 14.4 81 1 chevrolet citation 23.5 6 173 110 2725 12.6 81 1 plymouth reliant 30 4 135 84 2385 12.9 81 1 toyota starlet 39.1 4 79 58 1755 16.9 81 3 plymouth champ 39 4 86 64 1875 16.4 81 1 honda civic 1300 35.1 4 81 60 1760 16.1 81 3 subaru 32.3 4 97 67 2065 17.8 81 3 datsun 210 mpg 37 4 85 65 1975 19.4 81 3 toyota tercel 37.7 4 89 62 2050 17.3 81 3 mazda glc 4 34.1 4 91 68 1985 16 81 3 plymouth horizon 4 34.7 4 105 63 2215 14.9 81 1 ford escort 4w 34.4 4 98 65 2045 16.2 81 1 ford escort 2h 29.9 4 98 65 2380 20.7 81 1 volkswagen jetta 33 4 105 74 2190 14.2 81 2 renault 18i 34.5 4 100 NA 2320 15.8 81 2 honda prelude 33.7 4 107 75 2210 14.4 81 3 toyota corolla 32.4 4 108 75 2350 16.8 81 3 datsun 200sx 32.9 4 119 100 2615 14.8 81 3 mazda 626 31.6 4 120 74 2635 18.3 81 3 peugeot 505s turbo diesel 28.1 4 141 80 3230 20.4 81 2 saab 900s NA 4 121 110 2800 15.4 81 2 volvo diesel 30.7 6 145 76 3160 19.6 81 2 toyota cressida 25.4 6 168 116 2900 12.6 81 3 datsun 810 maxima 24.2 6 146 120 2930 13.8 81 3 buick century 22.4 6 231 110 3415 15.8 81 1 oldsmobile cutlass ls 26.6 8 350 105 3725 19 81 1 ford granada gl 20.2 6 200 88 3060 17.1 81 1 chrysler lebaron salon 17.6 6 225 85 3465 16.6 81 1 chevrolet cavalier 28 4 112 88 2605 19.6 82 1 chevrolet cavalier wagon 27 4 112 88 2640 18.6 82 1 chevrolet cavalier 2-door 34 4 112 88 2395 18 82 1 pontiac j2000 se hatchback 31 4 112 85 2575 16.2 82 1 dodge aries se 29 4 135 84 2525 16 82 1 pontiac phoenix 27 4 151 90 2735 18 82 1 ford fairmont futura 24 4 140 92 2865 16.4 82 1 amc concord dl 23 4 151 NA 3035 20.5 82 1 volkswagen rabbit l 36 4 105 74 1980 15.3 82 2 mazda glc custom l 37 4 91 68 2025 18.2 82 3 mazda glc custom 31 4 91 68 1970 17.6 82 3 plymouth horizon miser 38 4 105 63 2125 14.7 82 1 mercury lynx l 36 4 98 70 2125 17.3 82 1 nissan stanza xe 36 4 120 88 2160 14.5 82 3 honda accord 36 4 107 75 2205 14.5 82 3 toyota corolla 34 4 108 70 2245 16.9 82 3 honda civic 38 4 91 67 1965 15 82 3 honda civic (auto) 32 4 91 67 1965 15.7 82 3 datsun 310 gx 38 4 91 67 1995 16.2 82 3 buick century limited 25 6 181 110 2945 16.4 82 1 oldsmobile cutlass ciera (diesel) 38 6 262 85 3015 17 82 1 chrysler lebaron medallion 26 4 156 92 2585 14.5 82 1 ford granada l 22 6 232 112 2835 14.7 82 1 toyota celica gt 32 4 144 96 2665 13.9 82 3 dodge charger 2.2 36 4 135 84 2370 13 82 1 chevrolet camaro 27 4 151 90 2950 17.3 82 1 ford mustang gl 27 4 140 86 2790 15.6 82 1 vw pickup 44 4 97 52 2130 24.6 82 2 dodge rampage 32 4 135 84 2295 11.6 82 1 ford ranger 28 4 120 79 2625 18.6 82 1 chevy s-10 31 4 119 82 2720 19.4 82 1 \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde deleted file mode 100755 index 7ba6b82cb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/Ex_07.pde +++ /dev/null @@ -1,30 +0,0 @@ -String[] lines = loadStrings("2895.txt"); -int totalCount = 0; // Total word count for entire book -boolean started = false; // Ignore lines until the *** START line - -for (int i = 0; i < lines.length; i++) { - if (lines[i].startsWith("*** START")) { // Start parsing text - started = true; - } else if (lines[i].startsWith("*** END")) { // Stop parsing text - started = false; - } else if (started == true) { // If we're in the useful region - // List of characters and punctuation to ignore between - // letters. WHITESPACE is all the whitespace characters - String separators = WHITESPACE + ",;.:?()\"-"; - // Split the line anywhere that we see one or more of - // these separators - String[] words = splitTokens(lines[i], separators); - // Add this number to the total - totalCount += words.length; - // Go through the list of words on the line - for (int j = 0; j < words.length; j++) { - String word = words[j].toLowerCase(); - if (word.length() > 10) { - println(word); // Print word if longer than ten letters - } - } - } -} - -// How many words are in the entire book? -println("This book has " + totalCount + " total words."); \ No newline at end of file diff --git a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt b/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt deleted file mode 100755 index aae7d4327..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/46 Input 6/Ex_07/data/2895.txt +++ /dev/null @@ -1,19485 +0,0 @@ -The Project Gutenberg EBook of Following the Equator, Complete -by Mark Twain (Samuel Clemens) - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - - -Title: Following the Equator, Complete - -Author: Mark Twain (Samuel Clemens) - -Release Date: June 24, 2004 [EBook #2895] - -Language: English - -Character set encoding: ASCII - -*** START OF THIS PROJECT GUTENBERG EBOOK FOLLOWING THE EQUATOR, COMPLETE *** - - - - -Produced by David Widger - - - - - - FOLLOWING - THE EQUATOR - A JOURNEY AROUND THE WORLD - BY - MARK TWAIN - SAMUEL L. CLEMENS - HARTFORD, CONNECTICUT - - - - - THIS BOOK - Is affectionately inscribed to - MY YOUNG FRIEND - HARRY ROGERS - WITH RECOGNITION - OF WHAT HE IS, AND APPREHENSION OF WHAT HE MAY BECOME - UNLESS HE FORM HIMSELF A LITTLE MORE CLOSELY - UPON THE MODEL OF - THE AUTHOR. - - - - - - THE PUDD'NHEAD MAXIMS. - THESE WISDOMS ARE FOR THE LURING OF YOUTH TOWARD - HIGH MORAL ALTITUDES. THE AUTHOR DID NOT - GATHER THEM FROM PRACTICE, BUT FROM - OBSERVATION. TO BE GOOD IS NOBLE; - BUT TO SHOW OTHERS HOW - TO BE GOOD IS NOBLER - AND NO TROUBLE. - - - - - CONTENTS - -CHAPTER I. -The Party--Across America to Vancouver--On Board the Warrimo--Steamer -Chairs-The Captain-Going Home under a Cloud--A Gritty Purser--The -Brightest Passenger--Remedy for Bad Habits--The Doctor and the Lumbago ---A Moral Pauper--Limited Smoking--Remittance-men. - - -CHAPTER II. -Change of Costume--Fish, Snake, and Boomerang Stories--Tests of Memory ---A Brahmin Expert--General Grant's Memory--A Delicately Improper Tale - - -CHAPTER III. -Honolulu--Reminiscences of the Sandwich Islands--King Liholiho and His -Royal Equipment--The Tabu--The Population of the Island--A Kanaka Diver ---Cholera at Honolulu--Honolulu; Past and Present--The Leper Colony - - -CHAPTER IV. -Leaving Honolulu--Flying-fish--Approaching the Equator--Why the Ship Went -Slow--The Front Yard of the Ship--Crossing the Equator--Horse Billiards -or Shovel Board--The Waterbury Watch--Washing Decks--Ship Painters--The -Great Meridian--The Loss of a Day--A Babe without a Birthday - - -CHAPTER V. -A lesson in Pronunciation--Reverence for Robert Burns--The Southern -Cross--Troublesome Constellations--Victoria for a Name--Islands on the -Map--Alofa and Fortuna--Recruiting for the Queensland Plantations ---Captain Warren's NoteBook--Recruiting not thoroughly Popular - - -CHAPTER VI. -Missionaries Obstruct Business--The Sugar Planter and the Kanaka--The -Planter's View--Civilizing the Kanaka The Missionary's View--The Result ---Repentant Kanakas--Wrinkles--The Death Rate in Queensland - - -CHAPTER VII. -The Fiji Islands--Suva--The Ship from Duluth--Going Ashore--Midwinter in -Fiji--Seeing the Governor--Why Fiji was Ceded to England--Old time -Fijians--Convicts among the Fijians--A Case Where Marriage was a Failure -Immortality with Limitations - - -CHAPTER VIII. -A Wilderness of Islands--Two Men without a Country--A Naturalist from New -Zealand--The Fauna of Australasia--Animals, Insects, and Birds--The -Ornithorhynchus--Poetry and Plagiarism - - -CHAPTER IX. - -Close to Australia--Porpoises at Night--Entrance to Sydney Harbor--The -Loss of the Duncan Dunbar--The Harbor--The City of Sydney--Spring-time in -Australia--The Climate--Information for Travelers--The Size of Australia ---A Dust-Storm and Hot Wind - - -CHAPTER X. -The Discovery of Australia--Transportation of Convicts--Discipline ---English Laws, Ancient and Modern--Flogging Prisoners to Death--Arrival of -Settlers--New South Wales Corps--Rum Currency--Intemperance Everywhere -$100,000 for One Gallon of Rum--Development of the Country--Immense -Resources - - -CHAPTER XI. -Hospitality of English-speaking People--Writers and their Gratitude--Mr. -Gane and the Panegyrics--Population of Sydney An English City with -American Trimming--"Squatters"--Palaces and Sheep Kingdoms--Wool and -Mutton--Australians and Americans--Costermonger Pronunciation--England is -"Home"--Table Talk--English and Colonial Audiences 124 - - -CHAPTER XII. -Mr. X., a Missionary--Why Christianity Makes Slow Progress in India--A -Large Dream--Hindoo Miracles and Legends--Sampson and Hanuman--The -Sandstone Ridge--Where are the Gates? - - -CHAPTER XIII. -Public Works in Australasia--Botanical Garden of Sydney--Four Special -Socialties--The Government House--A Governor and His Functions--The -Admiralty House--The Tour of the Harbor--Shark Fishing--Cecil Rhodes' -Shark and his First Fortune--Free Board for Sharks. - - -CHAPTER XIV. -Bad Health--To Melbourne by Rail--Maps Defective--The Colony of Victoria ---A Round-trip Ticket from Sydney--Change Cars, from Wide to Narrow -Gauge, a Peculiarity at Albury--Customs-fences--"My Word"--The Blue -Mountains--Rabbit Piles--Government R. R. Restaurants--Duchesses for -Waiters--"Sheep-dip"--Railroad Coffee--Things Seen and Not Seen - - -CHAPTER XV. -Wagga-Wagga--The Tichborne Claimant--A Stock Mystery--The Plan of the -Romance--The Realization--The Henry Bascom Mystery--Bascom Hall--The -Author's Death and Funeral - - -CHAPTER XVI. -Melbourne and its Attractions--The Melbourne Cup Races--Cup Day--Great -Crowds--Clothes Regardless of Cost--The Australian Larrikin--Is He Dead? -Australian Hospitality--Melbourne Wool-brokers--The Museums--The Palaces ---The Origin of Melbourne - - -CHAPTER XVII. -The British Empire--Its Exports and Imports--The Trade of Australia--To -Adelaide--Broken Hill Silver Mine--A Roundabout road--The Scrub and its -Possibilities for the Novelist--The Aboriginal Tracker--A Test Case--How -Does One Cow-Track Differ from Another? - - -CHAPTER XVIII. -Gum Trees--Unsociable Trees--Gorse and Broom--A universal Defect--An -Adventurer--Wanted L200, got L20,000,000--A Vast Land Scheme--The -Smash-up--The Corpse Got Up and Danced--A Unique Business by One Man ---Buying the Kangaroo Skin--The Approach to Adelaide--Everything Comes to -Him who Waits--A Healthy Religious sphere--What is the Matter with the -Specter? - - -CHAPTER XIX. - -The Botanical Gardens--Contributions from all Countries--The -Zoological Gardens of Adelaide--The Laughing Jackass--The Dingo--A -Misnamed Province--Telegraphing from Melbourne to San Francisco--A Mania -for Holidays--The Temperature--The Death Rate--Celebration of the -Reading of the Proclamation of 1836--Some old Settlers at the -Commemoration--Their Staying Powers--The Intelligence of the Aboriginal ---The Antiquity of the Boomerang - - -CHAPTER XX. -A Caller--A Talk about Old Times--The Fox Hunt--An Accurate Judgment of -an Idiot--How We Passed the Custom Officers in Italy - - -CHAPTER XXI. -The "Weet-Weet"--Keeping down the Population--Victoria--Killing the -Aboriginals--Pioneer Days in Queensland--Material for a Drama--The Bush ---Pudding with Arsenic Revenge--A Right Spirit but a Wrong Method--Death of -Donga Billy - - -CHAPTER XXII. -Continued Description of Aboriginals--Manly Qualities--Dodging Balls ---Feats of Spring--Jumping--Where the Kangaroo Learned its Art 'Well -Digging--Endurance--Surgery--Artistic Abilities--Fennimore Cooper's Last -Chance--Australian Slang - - -CHAPTER XXIII. -To Horsham (Colony of Victoria)--Description of Horsham--At the Hotel ---Pepper Tree-The Agricultural College, Forty Pupils--High Temperature ---Width of Road in Chains, Perches, etc.--The Bird with a Forgettable -Name--The Magpie and the Lady--Fruit Trees--Soils--Sheep Shearing--To Stawell ---Gold Mining Country--$75,000 per Month Income and able to Keep House ---Fine Grapes and Wine--The Dryest Community on Earth--The Three Sisters ---Gum Trees and Water - - -CHAPTER XXIV. - -Road to Ballarat--The City--Great Gold Strike, 1851--Rush for Australia ---"Great Nuggets"--Taxation--Revolt and Victory--Peter Lalor and the -Eureka Stockade--"Pencil Mark"--Fine Statuary at Ballarat--Population ---Ballarat English - - -CHAPTER XXV. -Bound for Bendigo--The Priest at Castlemaine--Time Saved by Walking ---Description of Bendigo--A Valuable Nugget--Perseverence and Success ---Mr. Blank and His Influence--Conveyance of an Idea--I Had to Like the -Irishman--Corrigan Castle, and the Mark Twain Club--My Bascom Mystery -Solved - - -CHAPTER XXVI. -Where New Zealand Is--But Few Know--Things People Think They Know--The -Yale Professor and His Visitor from N. Z. - - -CHAPTER XXVII. -The South Pole Swell--Tasmania--Extermination of the Natives--The Picture -Proclamation--The Conciliator--The Formidable Sixteen - - -CHAPTER XXVIII. -When the Moment Comes the Man Appears--Why Ed. Jackson called on -Commodore Vanderbilt--Their Interview--Welcome to the Child of His Friend ---A Big Time but under Inspection--Sent on Important Business--A Visit to -the Boys on the Boat - - -CHAPTER XXIX: -Tasmania, Early Days--Description of the Town of Hobart--An Englishman's -Love of Home Surroundings--Neatest City on Earth--The Museum--A Parrot -with an Acquired Taste--Glass Arrow Beads--Refuge for the Indigent too -healthy - - -CHAPTER XXX. -Arrival at Bluff, N. Z.--Where the Rabbit Plague Began--The Natural Enemy -of the Rabbit--Dunedin--A Lovely Town--Visit to Dr. Hockin--His Museum ---A Liquified Caterpillar--The Unperfected Tape Worm--The Public Museum and -Picture - - -CHAPTER XXXI. The Express Train--"A Hell of a Hotel at Maryborough" ---Clocks and Bells--Railroad Service. - - -CHAPTER XXXII. -Description of the Town of Christ Church--A Fine Museum--Jade-stone -Trinkets--The Great Man--The First Maori in New Zealand--Women Voters ---"Person" in New Zealand Law Includes Woman--Taming an Ornithorhynchus ---A Voyage in the 'Flora' from Lyttelton--Cattle Stalls for Everybody ---A Wonderful Time. - - -CHAPTER XXXIII. -The Town of Nelson--"The Mongatapu Murders," the Great Event of the Town ---Burgess' Confession--Summit of Mount Eden--Rotorua and the Hot Lakes -and Geysers--Thermal Springs District--Kauri Gum--Tangariwa Mountains - - -CHAPTER XXXIV. -The Bay of Gisborne--Taking in Passengers by the Yard Arm--The Green -Ballarat Fly--False Teeth--From Napier to Hastings by the Ballarat Fly -Train--Kauri Trees--A Case of Mental Telegraphy - - -CHAPTER XXXV. -Fifty Miles in Four Hours--Comfortable Cars--Town of Wauganui--Plenty of -Maoris--On the Increase--Compliments to the Maoris--The Missionary Ways -all Wrong--The Tabu among the Maoris--A Mysterious Sign--Curious -War-monuments--Wellington - - -CHAPTER XXXVI. -The Poems of Mrs. Moore--The Sad Fate of William Upson--A Fellow Traveler -Imitating the Prince of Wales--A Would-be Dude--Arrival at Sydney ---Curious Town Names with Poem - - -CHAPTER XXXVII. -From Sydney for Ceylon--A Lascar Crew--A Fine Ship--Three Cats and a -Basket of Kittens--Dinner Conversations--Veuve Cliquot Wine--At Anchor in -King George's Sound Albany Harbor--More Cats--A Vulture on Board--Nearing -the Equator again--Dressing for Dinner--Ceylon, Hotel Bristol--Servant -Brampy--A Feminine Man--Japanese Jinriksha or Cart--Scenes in Ceylon--A -Missionary School--Insincerity of Clothes - - -CHAPTER XXXVIII. -Steamer Rosettes to Bombay--Limes 14 cents a Barrel--Bombay, a Bewitching -City--Descriptions of People and Dress--Woman as a Road Decoration ---India, the Land of Dreams and Romance--Fourteen Porters to Carry Baggage ---Correcting a Servant--Killing a Slave--Arranging a Bedroom--Three Hours' -Work and a Terrible Racket--The Bird of Birds, the Indian Crow - - -CHAPTER XXXIX. -God Vishnu, 108 Names--Change of Titles or Hunting for an Heir--Bombay as -a Kaleidoscope--The Native's Man Servant--Servants' Recommendations--How -Manuel got his Name and his English--Satan--A Visit from God - - -CHAPTER XL. -The Government House at Malabar Point--Mansion of Kumar Shri Samatsin Hji -Bahadur--The Indian Princess--A Difficult Game--Wardrobe and Jewels ---Ceremonials--Decorations when Leaving--The Towers of Silence--A Funeral - - -CHAPTER XLI. -Jain Temple--Mr. Roychand's Bungalow--A Decorated Six-Gun Prince--Human -Fireworks--European Dress, Past and Present--Complexions--Advantages with -the Zulu--Festivities at the Bungalow-Nautch Dancers--Entrance of the -Prince--Address to the Prince - - -CHAPTER XLII. -A Hindoo Betrothal, midnight, Sleepers on the ground, Home of the Bride -of Twelve Years Dressed as a Boy--Illumination Nautch Girls--Imitating -Snakes--Later--Illuminated Porch Filled with Sleepers--The Plague - - -CHAPTER XLIII -Murder Trial in Bombay--Confidence Swindlers--Some Specialities of India ---The Plague, Juggernaut, Suttee, etc.--Everything on Gigantic Scale ---India First in Everything--80 States, more Custom Houses than Cats--Rich -Ground for Thug Society - - -CHAPTER XLIV. -Thug Book--Supplies for Traveling, Bedding, and other Freight--Scene at -Railway Station--Making Way for White Man--Waiting Passengers, High and -Low Caste, Touch in the cars--Our Car--Beds made up--Dreaming of Thugs ---Baroda--Meet Friends--Indian Well--The Old Town--Narrow Streets--A Mad -Elephant - -CHAPTER XLV. - -Elephant Riding--Howdahs--The New Palace--The Prince's Excursion--Gold -and Silver Artillery--A Vice-royal Visit--Remarkable Dog--The Bench Show ---Augustin Daly's Back Door--Fakeer - - -CHAPTER XLVI. -The Thugs--Government Efforts to Exterminate them--Choking a Victim A -Fakeer Spared--Thief Strangled - - -CHAPTER XLVII. -Thugs, Continued--Record of Murders--A Joy of Hunting and Killing Men ---Gordon Gumming--Killing an Elephant--Family Affection among Thugs ---Burial Places - - -CHAPTER XLVIII. -Starting for Allahabad--Lower Berths in Sleepers--Elderly Ladies have -Preference of Berths--An American Lady Takes One Anyhow--How Smythe Lost -his Berth--How He Got Even--The Suttee - - -CHAPTER XLIX. -Pyjamas--Day Scene in India--Clothed in a Turban and a Pocket -Handkerchief--Land Parceled Out--Established Village Servants--Witches in -Families--Hereditary Midwifery--Destruction of Girl Babies--Wedding -Display--Tiger-Persuader--Hailstorm Discourages--The Tyranny of the -Sweeper--Elephant Driver--Water Carrier--Curious Rivers--Arrival at -Allahabad--English Quarter--Lecture Hall Like a Snowstorm--Private -Carriages--A Milliner--Early Morning--The Squatting Servant--A Religious -Fair - - -CHAPTER L. -On the Road to Benares--Dust and Waiting--The Bejeweled Crowd--A Native -Prince and his Guard--Zenana Lady--The Extremes of Fashion--The Hotel at -Benares--An Annex a Mile Away--Doors in India--The Peepul Tree--Warning -against Cold Baths--A Strange Fruit--Description of Benares--The -Beginning of Creation--Pilgrims to Benares--A Priest with a Good Business -Stand--Protestant Missionary--The Trinity Brahma, Shiva, and Vishnu ---Religion the Business at Benares - - -CHAPTER LI. -Benares a Religious Temple--A Guide for Pilgrims to Save Time in Securing -Salvation - - -CHAPTER LII. -A Curious Way to Secure Salvation--The Banks of the Ganges--Architecture -Represents Piety--A Trip on the River--Bathers and their Costumes ---Drinking the Water--A Scientific Test of the Nasty Purifier--Hindoo Faith -in the Ganges--A Cremation--Remembrances of the Suttee--All Life Sacred -Except Human Life--The Goddess Bhowanee, and the Sacrificers--Sacred -Monkeys--Ugly Idols Everywhere--Two White Minarets--A Great View with a -Monkey in it--A Picture on the Water - - -CHAPTER LIII. -Still in Benares--Another Living God--Why Things are Wonderful--Sri 108 -Utterly Perfect--How He Came so--Our Visit to Sri--A Friendly Deity -Exchanging Autographs and Books--Sri's Pupil--An Interesting Man ---Reverence and Irreverence--Dancing in a Sepulchre - - -CHAPTER LIV. -Rail to Calcutta--Population--The "City of Palaces"--A Fluted -Candle-stick--Ochterlony--Newspaper Correspondence--Average Knowledge of -Countries--A Wrong Idea of Chicago--Calcutta and the Black Hole ---Description of the Horrors--Those Who Lived--The Botanical Gardens--The -Afternoon Turnout--Grand Review--Military Tournament--Excursion on the -Hoogly--The Museum--What Winter Means Calcutta - - -CHAPTER LV -On the Road Again--Flannels in Order--Across Country--From Greenland's -Icy Mountain--Swapping Civilization--No Field women in India--How it is -in Other Countries--Canvas-covered Cars--The Tiger Country--My First Hunt -Some Elephants Get Away--The Plains of India--The Ghurkas--Women for -Pack-Horses--A Substitute for a Cab--Darjeeling--The Hotel--The Highest -Thing in the Himalayas--The Club--Kinchinjunga and Mt. Everest ---Thibetans--The Prayer Wheel--People Going to the Bazar - - -CHAPTER LVI. -On the Road Again--The Hand-Car--A Thirty-five-mile Slide--The Banyan -Tree--A Dramatic Performance--The Railroad--The Half-way House--The Brain -Fever Bird--The Coppersmith Bird--Nightingales and Cue Owls - - -CHAPTER LVII. -India the Most Extraordinary Country on Earth--Nothing Forgotten--The -Land of Wonders--Annual Statistics Everywhere about Violence--Tiger vs. -Man--A Handsome Fight--Annual Man Killing and Tiger Killing--Other -Animals--Snakes--Insurance and Snake Tables--The Cobra Bite--Muzaffurpore ---Dinapore--A Train that Stopped for Gossip--Six Hours for Thirty-five -Miles--A Rupee to the Engineer--Ninety Miles an Hour--Again to Benares, -the Piety Hive To Lucknow - - -CHAPTER LVIII. -The Great Mutiny--The Massacre in Cawnpore--Terrible Scenes in Lucknow ---The Residency--The Siege - - -CHAPTER LIX. -A Visit to the Residency--Cawnpore--The Adjutant Bird and the Hindoo -Corpse--The Tai Mahal--The True Conception--The Ice Storm--True Gems ---Syrian Fountains--An Exaggerated Niagara - - -CHAPTER LX. -To Lahore--The Governor's Elephant--Taking a Ride-No Danger from -Collision--Rawal Pindi--Back to Delhi--An Orientalized Englishman ---Monkeys and the Paint-pot--Monkey Crying over my Note-book--Arrival at -Jeypore--In Rajputana--Watching Servants--The Jeypore Hotel--Our Old and -New Satan--Satan as a Liar--The Museum--A Street Show--Blocks of Houses ---A Religious Procession - - -CHAPTER LXI. -Methods in American Deaf and Dumb Asylums--Methods in the Public Schools ---A Letter from a youth in Punjab--Highly Educated Service--A Damage to -the Country--A Little Book from Calcutta--Writing Poor English ---Embarrassed by a Beggar Girl--A Specimen Letter--An Application for -Employment--A Calcutta School Examination--Two Samples of -Literature - - -CHAPTER LXII. -Sail from Calcutta to Madras--Thence to Ceylon--Thence for Mauritius ---The Indian Ocean--Our Captain's Peculiarity The Scot Has one too--The -Flying-fish that Went Hunting in the Field--Fined for Smuggling--Lots of -pets on Board--The Color of the Sea--The Most Important Member of -Nature's Family--The Captain's Story of Cold Weather--Omissions in the -Ship's Library--Washing Decks--Pyjamas on Deck--The Cat's Toilet--No -Interest in the Bulletin--Perfect Rest--The Milky Way and the Magellan -Clouds--Mauritius--Port Louis--A Hot Country--Under French Control ---A Variety of People and Complexions--Train to Curepipe--A Wonderful -Office-holder--The Wooden Peg Ornament--The Prominent Historical Event of -Mauritius--"Paul and Virginia"--One of Virginia's Wedding Gifts--Heaven -Copied after Mauritius--Early History of Mauritius--Quarantines ---Population of all Kinds--What the World Consists of--Where Russia and -Germany are--A Picture of Milan Cathedral--Newspapers--The Language--Best -Sugar in the World--Literature of Mauritius - - -CHAPTER LXIII. -Port Louis--Matches no Good--Good Roads--Death Notices--Why European -Nations Rob Each Other--What Immigrants to Mauritius Do--Population ---Labor Wages--The Camaron--The Palmiste and other Eatables--Monkeys--The -Cyclone of 1892--Mauritius a Sunday Landscape - - -CHAPTER LXIV. -The Steamer "Arundel Castle"--Poor Beds in Ships--The Beds in Noah's Ark ---Getting a Rest in Europe--Ship in Sight--Mozambique Channel--The -Engineer and the Band--Thackeray's "Madagascar"--Africanders Going Home ---Singing on the After Deck--An Out-of-Place Story--Dynamite Explosion in -Johannesburg--Entering Delagoa Bay--Ashore--A Hot Winter--Small Town--No -Sights--No Carriages--Working Women--Barnum's Purchase of Shakespeare's -Birthplace, Jumbo, and the Nelson Monument--Arrival at Durban - - -CHAPTER LXV. -Royal Hotel Durban--Bells that Did not Ring--Early Inquiries for Comforts ---Change of Temperature after Sunset-Rickhaws--The Hotel Chameleon ---Natives not out after the Bell--Preponderance of Blacks in Natal--Hair -Fashions in Natal--Zulus for Police--A Drive round the Berea--The Cactus -and other Trees--Religion a Vital Matter--Peculiar Views about Babies ---Zulu Kings--A Trappist Monastery--Transvaal Politics--Reasons why the -Trouble came About - - -CHAPTER LXVI. -Jameson over the Border--His Defeat and Capture--Sent to England for -Trial--Arrest of Citizens by the Boers--Commuted sentences--Final Release -of all but Two--Interesting Days for a Stranger--Hard to Understand -Either Side--What the Reformers Expected to Accomplish--How They Proposed -to do it--Testimonies a Year Later--A "Woman's Part"--The Truth of the -South African Situation--"Jameson's Ride"--A Poem - - -CHAPTER LXVIL -Jameson's Raid--The Reform Committee's Difficult Task--Possible Plans ---Advice that Jameson Ought to Have--The War of 1881 and its Lessons ---Statistics of Losses of the Combatants--Jameson's Battles--Losses on Both -Sides--The Military Errors--How the Warfare Should Have Been Carried on -to Be Successful - - -CHAPTER LXVIII. -Judicious Mr. Rhodes--What South Africa Consists of--Johannesburg--The -Gold Mines--The Heaven of American Engineers--What the Author Knows about -Mining--Description of the Boer--What Should be Expected of Him--What Was -A Dizzy Jump for Rhodes--Taxes--Rhodesian Method of Reducing Native -Population--Journeying in Cape Colony--The Cars--The Country--The -Weather--Tamed Blacks--Familiar Figures in King William's Town--Boer -Dress--Boer Country Life--Sleeping Accommodations--The Reformers in Boer -Prison--Torturing a Black Prisoner - - -CHAPTER LXIX. -An Absorbing Novelty--The Kimberley Diamond Mines--Discovery of Diamonds ---The Wronged Stranger--Where the Gems Are--A Judicious Change of -Boundary--Modern Machinery and Appliances--Thrilling Excitement in -Finding a Diamond--Testing a Diamond--Fences--Deep Mining by Natives in -the Compound--Stealing--Reward for the Biggest Diamond--A Fortune in -Wine--The Great Diamond--Office of the De Beer Co.--Sorting the Gems ---Cape Town--The Most Imposing Man in British Provinces--Various Reasons -for his Supremacy--How He Makes Friends - - -CONCLUSION. -Table Rock--Table Bay--The Castle--Government and Parliament--The Club ---Dutch Mansions and their Hospitality--Dr. John Barry and his Doings--On -the Ship Norman--Madeira--Arrived in Southampton - - - - - - FOLLOWING THE EQUATOR - - -CHAPTER I. - -A man may have no bad habits and have worse. - --Pudd'nhead Wilson's New Calendar. - -The starting point of this lecturing-trip around the world was Paris, -where we had been living a year or two. - -We sailed for America, and there made certain preparations. This took -but little time. Two members of my family elected to go with me. Also a -carbuncle. The dictionary says a carbuncle is a kind of jewel. Humor is -out of place in a dictionary. - -We started westward from New York in midsummer, with Major Pond to manage -the platform-business as far as the Pacific. It was warm work, all the -way, and the last fortnight of it was suffocatingly smoky, for in Oregon -and Columbia the forest fires were raging. We had an added week of smoke -at the seaboard, where we were obliged awhile for our ship. She had been -getting herself ashore in the smoke, and she had to be docked and -repaired. - -We sailed at last; and so ended a snail-paced march across the continent, -which had lasted forty days. - -We moved westward about mid-afternoon over a rippled and summer sea; an -enticing sea, a clean and cool sea, and apparently a welcome sea to all -on board; it certainly was to the distressful dustings and smokings and -swelterings of the past weeks. The voyage would furnish a three-weeks -holiday, with hardly a break in it. We had the whole Pacific Ocean in -front of us, with nothing to do but do nothing and be comfortable. The -city of Victoria was twinkling dim in the deep heart of her smoke-cloud, -and getting ready to vanish and now we closed the field-glasses and sat -down on our steamer chairs contented and at peace. But they went to -wreck and ruin under us and brought us to shame before all the -passengers. They had been furnished by the largest furniture-dealing -house in Victoria, and were worth a couple of farthings a dozen, though -they had cost us the price of honest chairs. In the Pacific and Indian -Oceans one must still bring his own deck-chair on board or go without, -just as in the old forgotten Atlantic times--those Dark Ages of sea -travel. - -Ours was a reasonably comfortable ship, with the customary sea-going fare ---plenty of good food furnished by the Deity and cooked by the devil. -The discipline observable on board was perhaps as good as it is anywhere -in the Pacific and Indian Oceans. The ship was not very well arranged -for tropical service; but that is nothing, for this is the rule for ships -which ply in the tropics. She had an over-supply of cockroaches, but -this is also the rule with ships doing business in the summer seas--at -least such as have been long in service. Our young captain was a very -handsome man, tall and perfectly formed, the very figure to show up a -smart uniform's best effects. He was a man of the best intentions and -was polite and courteous even to courtliness. There was a soft and -finish about his manners which made whatever place he happened to be in -seem for the moment a drawing room. He avoided the smoking room. He had -no vices. He did not smoke or chew tobacco or take snuff; he did not -swear, or use slang or rude, or coarse, or indelicate language, or make -puns, or tell anecdotes, or laugh intemperately, or raise his voice above -the moderate pitch enjoined by the canons of good form. When he gave an -order, his manner modified it into a request. After dinner he and his -officers joined the ladies and gentlemen in the ladies' saloon, and -shared in the singing and piano playing, and helped turn the music. He -had a sweet and sympathetic tenor voice, and used it with taste and -effect the music he played whist there, always with the same partner and -opponents, until the ladies' bedtime. The electric lights burned there -as late as the ladies and their friends might desire; but they were not -allowed to burn in the smoking-room after eleven. There were many laws -on the ship's statute book of course; but so far as I could see, this and -one other were the only ones that were rigidly enforced. The captain -explained that he enforced this one because his own cabin adjoined the -smoking-room, and the smell of tobacco smoke made him sick. I did not -see how our smoke could reach him, for the smoking-room and his cabin -were on the upper deck, targets for all the winds that blew; and besides -there was no crack of communication between them, no opening of any sort -in the solid intervening bulkhead. Still, to a delicate stomach even -imaginary smoke can convey damage. - -The captain, with his gentle nature, his polish, his sweetness, his moral -and verbal purity, seemed pathetically out of place in his rude and -autocratic vocation. It seemed another instance of the irony of fate. - -He was going home under a cloud. The passengers knew about his trouble, -and were sorry for him. Approaching Vancouver through a narrow and -difficult passage densely befogged with smoke from the forest fires, he -had had the ill-luck to lose his bearings and get his ship on the rocks. -A matter like this would rank merely as an error with you and me; it -ranks as a crime with the directors of steamship companies. The captain -had been tried by the Admiralty Court at Vancouver, and its verdict had -acquitted him of blame. But that was insufficient comfort. A sterner -court would examine the case in Sydney--the Court of Directors, the lords -of a company in whose ships the captain had served as mate a number of -years. This was his first voyage as captain. - -The officers of our ship were hearty and companionable young men, and -they entered into the general amusements and helped the passengers pass -the time. Voyages in the Pacific and Indian Oceans are but pleasure -excursions for all hands. Our purser was a young Scotchman who was -equipped with a grit that was remarkable. He was an invalid, and looked -it, as far as his body was concerned, but illness could not subdue his -spirit. He was full of life, and had a gay and capable tongue. To all -appearances he was a sick man without being aware of it, for he did not -talk about his ailments, and his bearing and conduct were those of a -person in robust health; yet he was the prey, at intervals, of ghastly -sieges of pain in his heart. These lasted many hours, and while the -attack continued he could neither sit nor lie. In one instance he stood -on his feet twenty-four hours fighting for his life with these sharp -agonies, and yet was as full of life and cheer and activity -the next day as if nothing had happened. - -The brightest passenger in the ship, and the most interesting and -felicitous talker, was a young Canadian who was not able to let the -whisky bottle alone. He was of a rich and powerful family, and could have -had a distinguished career and abundance of effective help toward it if -he could have conquered his appetite for drink; but he could not do it, -so his great equipment of talent was of no use to him. He had often taken -the pledge to drink no more, and was a good sample of what that sort of -unwisdom can do for a man--for a man with anything short of an iron will. -The system is wrong in two ways: it does not strike at the root of the -trouble, for one thing, and to make a pledge of any kind is to declare -war against nature; for a pledge is a chain that is always clanking and -reminding the wearer of it that he is not a free man. - -I have said that the system does not strike at the root of the trouble, -and I venture to repeat that. The root is not the drinking, but the -desire to drink. These are very different things. The one merely -requires will--and a great deal of it, both as to bulk and staying -capacity--the other merely requires watchfulness--and for no long time. -The desire of course precedes the act, and should have one's first -attention; it can do but little good to refuse the act over and over -again, always leaving the desire unmolested, unconquered; the desire will -continue to assert itself, and will be almost sure to win in the long -run. When the desire intrudes, it should be at once banished out of the -mind. One should be on the watch for it all the time--otherwise it will -get in. It must be taken in time and not allowed to get a lodgment. A -desire constantly repulsed for a fortnight should die, then. That should -cure the drinking habit. The system of refusing the mere act of -drinking, and leaving the desire in full force, is unintelligent war -tactics, it seems to me. I used to take pledges--and soon violate them. -My will was not strong, and I could not help it. And then, to be tied in -any way naturally irks an otherwise free person and makes him chafe in -his bonds and want to get his liberty. But when I finally ceased from -taking definite pledges, and merely resolved that I would kill an -injurious desire, but leave myself free to resume the desire and the -habit whenever I should choose to do so, I had no more trouble. In five -days I drove out the desire to smoke and was not obliged to keep watch -after that; and I never experienced any strong desire to smoke again. At -the end of a year and a quarter of idleness I began to write a book, and -presently found that the pen was strangely reluctant to go. I tried a -smoke to see if that would help me out of the difficulty. It did. I -smoked eight or ten cigars and as many pipes a day for five months; -finished the book, and did not smoke again until a year had gone by and -another book had to be begun. - -I can quit any of my nineteen injurious habits at any time, and without -discomfort or inconvenience. I think that the Dr. Tanners and those -others who go forty days without eating do it by resolutely keeping out -the desire to eat, in the beginning, and that after a few hours the -desire is discouraged and comes no more. - -Once I tried my scheme in a large medical way. I had been confined to my -bed several days with lumbago. My case refused to improve. Finally the -doctor said,-- - -"My remedies have no fair chance. Consider what they have to fight, -besides the lumbago. You smoke extravagantly, don't you?" - -"Yes." - -"You take coffee immoderately?" - -"Yes." - -"And some tea?" - -"Yes." - -"You eat all kinds of things that are dissatisfied with each other's -company?" - -"Yes." - -"You drink two hot Scotches every night?" - -"Yes." - -"Very well, there you see what I have to contend against. We can't make -progress the way the matter stands. You must make a reduction in these -things; you must cut down your consumption of them considerably for some -days." - -"I can't, doctor." - -"Why can't you." - -"I lack the will-power. I can cut them off entirely, but I can't merely -moderate them." - -He said that that would answer, and said he would come around in -twenty-four hours and begin work again. He was taken ill himself and -could not come; but I did not need him. I cut off all those things for -two days and nights; in fact, I cut off all kinds of food, too, and all -drinks except water, and at the end of the forty-eight hours the lumbago -was discouraged and left me. I was a well man; so I gave thanks and took -to those delicacies again. - -It seemed a valuable medical course, and I recommended it to a lady. She -had run down and down and down, and had at last reached a point where -medicines no longer had any helpful effect upon her. I said I knew I -could put her upon her feet in a week. It brightened her up, it filled -her with hope, and she said she would do everything I told her to do. So -I said she must stop swearing and drinking, and smoking and eating for -four days, and then she would be all right again. And it would have -happened just so, I know it; but she said she could not stop swearing, -and smoking, and drinking, because she had never done those things. So -there it was. She had neglected her habits, and hadn't any. Now that -they would have come good, there were none in stock. She had nothing to -fall back on. She was a sinking vessel, with no freight in her to throw -over lighten ship withal. Why, even one or two little bad habits could -have saved her, but she was just a moral pauper. When she could have -acquired them she was dissuaded by her parents, who were ignorant people -though reared in the best society, and it was too late to begin now. It -seemed such a pity; but there was no help for it. These things ought to -be attended to while a person is young; otherwise, when age and disease -come, there is nothing effectual to fight them with. - -When I was a youth I used to take all kinds of pledges, and do my best to -keep them, but I never could, because I didn't strike at the root of the -habit--the desire; I generally broke down within the month. Once I tried -limiting a habit. That worked tolerably well for a while. I pledged -myself to smoke but one cigar a day. I kept the cigar waiting until -bedtime, then I had a luxurious time with it. But desire persecuted me -every day and all day long; so, within the week I found myself hunting -for larger cigars than I had been used to smoke; then larger ones still, -and still larger ones. Within the fortnight I was getting cigars made -for me--on a yet larger pattern. They still grew and grew in size. -Within the month my cigar had grown to such proportions that I could have -used it as a crutch. It now seemed to me that a one-cigar limit was no -real protection to a person, so I knocked my pledge on the head and -resumed my liberty. - -To go back to that young Canadian. He was a "remittance man," the first -one I had ever seen or heard of. Passengers explained the term to me. -They said that dissipated ne'er-do-wells belonging to important families -in England and Canada were not cast off by their people while there was -any hope of reforming them, but when that last hope perished at last, the -ne'er-do-well was sent abroad to get him out of the way. He was shipped -off with just enough money in his pocket--no, in the purser's pocket--for -the needs of the voyage--and when he reached his destined port he would -find a remittance awaiting him there. Not a large one, but just enough -to keep him a month. A similar remittance would come monthly thereafter. -It was the remittance-man's custom to pay his month's board and lodging -straightway--a duty which his landlord did not allow him to forget--then -spree away the rest of his money in a single night, then brood and mope -and grieve in idleness till the next remittance came. It is a pathetic -life. - -We had other remittance-men on board, it was said. At least they said -they were R. M.'s. There were two. But they did not resemble the -Canadian; they lacked his tidiness, and his brains, and his gentlemanly -ways, and his resolute spirit, and his humanities and generosities. One -of them was a lad of nineteen or twenty, and he was a good deal of a -ruin, as to clothes, and morals, and general aspect. He said he was a -scion of a ducal house in England, and had been shipped to Canada for the -house's relief, that he had fallen into trouble there, and was now being -shipped to Australia. He said he had no title. Beyond this remark he -was economical of the truth. The first thing he did in Australia was to -get into the lockup, and the next thing he did was to proclaim himself an -earl in the police court in the morning and fail to prove it. - - - - -CHAPTER II. - -When in doubt, tell the truth. - --Pudd'nhead Wilson's New Calendar. - -About four days out from Victoria we plunged into hot weather, and all -the male passengers put on white linen clothes. One or two days later we -crossed the 25th parallel of north latitude, and then, by order, the -officers of the ship laid away their blue uniforms and came out in white -linen ones. All the ladies were in white by this time. This prevalence -of snowy costumes gave the promenade deck an invitingly cool, and -cheerful and picnicky aspect. - -From my diary: - -There are several sorts of ills in the world from which a person can -never escape altogether, let him journey as far as he will. One escapes -from one breed of an ill only to encounter another breed of it. We have -come far from the snake liar and the fish liar, and there was rest and -peace in the thought; but now we have reached the realm of the boomerang -liar, and sorrow is with us once more. The first officer has seen a man -try to escape from his enemy by getting behind a tree; but the enemy sent -his boomerang sailing into the sky far above and beyond the tree; then it -turned, descended, and killed the man. The Australian passenger has seen -this thing done to two men, behind two trees--and by the one arrow. This -being received with a large silence that suggested doubt, he buttressed -it with the statement that his brother once saw the boomerang kill a bird -away off a hundred yards and bring it to the thrower. But these are ills -which must be borne. There is no other way. - -The talk passed from the boomerang to dreams--usually a fruitful subject, -afloat or ashore--but this time the output was poor. Then it passed to -instances of extraordinary memory--with better results. Blind Tom, the -negro pianist, was spoken of, and it was said that he could accurately -play any piece of music, howsoever long and difficult, after hearing it -once; and that six months later he could accurately play it again, -without having touched it in the interval. One of the most striking of -the stories told was furnished by a gentleman who had served on the staff -of the Viceroy of India. He read the details from his note-book, and -explained that he had written them down, right after the consummation of -the incident which they described, because he thought that if he did not -put them down in black and white he might presently come to think he had -dreamed them or invented them. - -The Viceroy was making a progress, and among the shows offered by the -Maharajah of Mysore for his entertainment was a memory-exhibition. -The Viceroy and thirty gentlemen of his suite sat in a row, and the -memory-expert, a high-caste Brahmin, was brought in and seated on the -floor in front of them. He said he knew but two languages, the English -and his own, but would not exclude any foreign tongue from the tests to -be applied to his memory. Then he laid before the assemblage his program ---a sufficiently extraordinary one. He proposed that one gentleman -should give him one word of a foreign sentence, and tell him its place in -the sentence. He was furnished with the French word 'est', and was told -it was second in a sentence of three words. The next, gentleman gave him -the German word 'verloren' and said it was the third in a sentence of -four words. He asked the next gentleman for one detail in a sum in -addition; another for one detail in a sum of subtraction; others for -single details in mathematical problems of various kinds; he got them. -Intermediates gave him single words from sentences in Greek, Latin, -Spanish, Portuguese, Italian, and other languages, and told him their -places in the sentences. When at last everybody had furnished him a -single rag from a foreign sentence or a figure from a problem, he went -over the ground again, and got a second word and a second figure and was -told their places in the sentences and the sums; and so on and so on. He -went over the ground again and again until he had collected all the parts -of the sums and all the parts of the sentences--and all in disorder, of -course, not in their proper rotation. This had occupied two hours. - -The Brahmin now sat silent and thinking, a while, then began and repeated -all the sentences, placing the words in their proper order, and untangled -the disordered arithmetical problems and gave accurate answers to them -all. - -In the beginning he had asked the company to throw almonds at him during -the two hours, he to remember how many each gentleman had thrown; but -none were thrown, for the Viceroy said that the test would be a -sufficiently severe strain without adding that burden to it. - -General Grant had a fine memory for all kinds of things, including even -names and faces, and I could have furnished an instance of it if I had -thought of it. The first time I ever saw him was early in his first term -as President. I had just arrived in Washington from the Pacific coast, a -stranger and wholly unknown to the public, and was passing the White -House one morning when I met a friend, a Senator from Nevada. He asked -me if I would like to see the President. I said I should be very glad; -so we entered. I supposed that the President would be in the midst of a -crowd, and that I could look at him in peace and security from a -distance, as another stray cat might look at another king. But it was in -the morning, and the Senator was using a privilege of his office which I -had not heard of--the privilege of intruding upon the Chief Magistrate's -working hours. Before I knew it, the Senator and I were in the presence, -and there was none there but we three. General Grant got slowly up from -his table, put his pen down, and stood before me with the iron expression -of a man who had not smiled for seven years, and was not intending to -smile for another seven. He looked me steadily in the eyes--mine lost -confidence and fell. I had never confronted a great man before, and was -in a miserable state of funk and inefficiency. The Senator said:-- - -"Mr. President, may I have the privilege of introducing Mr. Clemens?" - -The President gave my hand an unsympathetic wag and dropped it. He did -not say a word but just stood. In my trouble I could not think of -anything to say, I merely wanted to resign. There was an awkward pause, -a dreary pause, a horrible pause. Then I thought of something, and -looked up into that unyielding face, and said timidly:-- - -"Mr. President, I--I am embarrassed. Are you?" - -His face broke--just a little--a wee glimmer, the momentary flicker of a -summer-lightning smile, seven years ahead of time--and I was out and gone -as soon as it was. - -Ten years passed away before I saw him the second time. Meantime I was -become better known; and was one of the people appointed to respond to -toasts at the banquet given to General Grant in Chicago--by the Army of -the Tennessee when he came back from his tour around the world. I -arrived late at night and got up late in the morning. All the corridors -of the hotel were crowded with people waiting to get a glimpse of General -Grant when he should pass to the place whence he was to review the great -procession. I worked my way by the suite of packed drawing-rooms, and at -the corner of the house I found a window open where there was a roomy -platform decorated with flags, and carpeted. I stepped out on it, and -saw below me millions of people blocking all the streets, and other -millions caked together in all the windows and on all the house-tops -around. These masses took me for General Grant, and broke into volcanic -explosions and cheers; but it was a good place to see the procession, and -I stayed. Presently I heard the distant blare of military music, and far -up the street I saw the procession come in sight, cleaving its way -through the huzzaing multitudes, with Sheridan, the most martial -figure of the War, riding at its head in the dress uniform of a -Lieutenant-General. - -And now General Grant, arm-in-arm with Major Carter Harrison, stepped out -on the platform, followed two and two by the badged and uniformed -reception committee. General Grant was looking exactly as he had looked -upon that trying occasion of ten years before--all iron and bronze -self-possession. Mr. Harrison came over and led me to the General and -formally introduced me. Before I could put together the proper remark, -General Grant said-- - -"Mr. Clemens, I am not embarrassed. Are you?"--and that little -seven-year smile twinkled across his face again. - -Seventeen years have gone by since then, and to-day, in New York, the -streets are a crush of people who are there to honor the remains of the -great soldier as they pass to their final resting-place under the -monument; and the air is heavy with dirges and the boom of artillery, and -all the millions of America are thinking of the man who restored the -Union and the flag, and gave to democratic government a new lease of -life, and, as we may hope and do believe, a permanent place among the -beneficent institutions of men. - -We had one game in the ship which was a good time-passer--at least it was -at night in the smoking-room when the men were getting freshened up from -the day's monotonies and dullnesses. It was the completing of -non-complete stories. That is to say, a man would tell all of a story -except the finish, then the others would try to supply the ending out of -their own invention. When every one who wanted a chance had had it, the -man who had introduced the story would give it its original ending--then -you could take your choice. Sometimes the new endings turned out to be -better than the old one. But the story which called out the most -persistent and determined and ambitious effort was one which had no -ending, and so there was nothing to compare the new-made endings with. -The man who told it said he could furnish the particulars up to a certain -point only, because that was as much of the tale as he knew. He had read -it in a volume of `sketches twenty-five years ago, and was interrupted -before the end was reached. He would give any one fifty dollars who -would finish the story to the satisfaction of a jury to be appointed by -ourselves. We appointed a jury and wrestled with the tale. We invented -plenty of endings, but the jury voted them all down. The jury was right. -It was a tale which the author of it may possibly have completed -satisfactorily, and if he really had that good fortune I would like to -know what the ending was. Any ordinary man will find that the story's -strength is in its middle, and that there is apparently no way to -transfer it to the close, where of course it ought to be. In substance -the storiette was as follows: - -John Brown, aged thirty-one, good, gentle, bashful, timid, lived in a -quiet village in Missouri. He was superintendent of the Presbyterian -Sunday-school. It was but a humble distinction; still, it was his only -official one, and he was modestly proud of it and was devoted to its work -and its interests. The extreme kindliness of his nature was recognized -by all; in fact, people said that he was made entirely out of good -impulses and bashfulness; that he could always be counted upon for help -when it was needed, and for bashfulness both when it was needed and when -it wasn't. - -Mary Taylor, twenty-three, modest, sweet, winning, and in character and -person beautiful, was all in all to him. And he was very nearly all in -all to her. She was wavering, his hopes were high. Her mother had been -in opposition from the first. But she was wavering, too; he could -see it. She was being touched by his warm interest in her two -charity-proteges and by his contributions toward their support. These -were two forlorn and aged sisters who lived in a log hut in a lonely -place up a cross road four miles from Mrs. Taylor's farm. One of the -sisters was crazy, and sometimes a little violent, but not often. - -At last the time seemed ripe for a final advance, and Brown gathered his -courage together and resolved to make it. He would take along a -contribution of double the usual size, and win the mother over; with her -opposition annulled, the rest of the conquest would be sure and prompt. - -He took to the road in the middle of a placid Sunday afternoon in the -soft Missourian summer, and he was equipped properly for his mission. He -was clothed all in white linen, with a blue ribbon for a necktie, and he -had on dressy tight boots. His horse and buggy were the finest that the -livery stable could furnish. The lap robe was of white linen, it was -new, and it had a hand-worked border that could not be rivaled in that -region for beauty and elaboration. - -When he was four miles out on the lonely road and was walking his horse -over a wooden bridge, his straw hat blew off and fell in the creek, and -floated down and lodged against a bar. He did not quite know what to do. -He must have the hat, that was manifest; but how was he to get it? - -Then he had an idea. The roads were empty, nobody was stirring. Yes, he -would risk it. He led the horse to the roadside and set it to cropping -the grass; then he undressed and put his clothes in the buggy, petted the -horse a moment to secure its compassion and its loyalty, then hurried to -the stream. He swam out and soon had the hat. When he got to the top of -the bank the horse was gone! - -His legs almost gave way under him. The horse was walking leisurely -along the road. Brown trotted after it, saying, "Whoa, whoa, there's a -good fellow;" but whenever he got near enough to chance a jump for the -buggy, the horse quickened its pace a little and defeated him. And so -this went on, the naked man perishing with anxiety, and expecting every -moment to see people come in sight. He tagged on and on, imploring the -horse, beseeching the horse, till he had left a mile behind him, and was -closing up on the Taylor premises; then at last he was successful, and -got into the buggy. He flung on his shirt, his necktie, and his coat; -then reached for--but he was too late; he sat suddenly down and pulled up -the lap-robe, for he saw some one coming out of the gate--a woman; he -thought. He wheeled the horse to the left, and struck briskly up the -cross-road. It was perfectly straight, and exposed on both sides; but -there were woods and a sharp turn three miles ahead, and he was very -grateful when he got there. As he passed around the turn he slowed down -to a walk, and reached for his tr---- too late again. - -He had come upon Mrs. Enderby, Mrs. Glossop, Mrs. Taylor, and Mary. -They were on foot, and seemed tired and excited. They came at once to -the buggy and shook hands, and all spoke at once, and said eagerly and -earnestly, how glad they were that he was come, and how fortunate it was. -And Mrs. Enderby said, impressively: - -"It looks like an accident, his coming at such a time; but let no one -profane it with such a name; he was sent--sent from on high." - -They were all moved, and Mrs. Glossop said in an awed voice: - -"Sarah Enderby, you never said a truer word in your life. This is no -accident, it is a special Providence. He was sent. He is an angel--an -angel as truly as ever angel was--an angel of deliverance. I say angel, -Sarah Enderby, and will have no other word. Don't let any one ever say -to me again, that there's no such thing as special Providences; for if -this isn't one, let them account for it that can." - -"I know it's so," said Mrs. Taylor, fervently. "John Brown, I could -worship you; I could go down on my knees to you. Didn't something tell -you?--didn't you feel that you were sent? I could kiss the hem of your -laprobe." - -He was not able to speak; he was helpless with shame and fright. Mrs. -Taylor went on: - -"Why, just look at it all around, Julia Glossop. Any person can see the -hand of Providence in it. Here at noon what do we see? We see the smoke -rising. I speak up and say, 'That's the Old People's cabin afire.' -Didn't I, Julia Glossop?" - -"The very words you said, Nancy Taylor. I was as close to you as I am -now, and I heard them. You may have said hut instead of cabin, but in -substance it's the same. And you were looking pale, too." - -"Pale? I was that pale that if--why, you just compare it with this -laprobe. Then the next thing I said was, 'Mary Taylor, tell the hired -man to rig up the team-we'll go to the rescue.' And she said, 'Mother, -don't you know you told him he could drive to see his people, and stay -over Sunday?' And it was just so. I declare for it, I had forgotten it. -'Then,' said I, 'we'll go afoot.' And go we did. And found Sarah -Enderby on the road." - -"And we all went together," said Mrs. Enderby. "And found the cabin set -fire to and burnt down by the crazy one, and the poor old things so old -and feeble that they couldn't go afoot. And we got them to a shady place -and made them as comfortable as we could, and began to wonder which way -to turn to find some way to get them conveyed to Nancy Taylor's house. -And I spoke up and said--now what did I say? Didn't I say, 'Providence -will provide'?" - -"Why sure as you live, so you did! I had forgotten it." - -"So had I," said Mrs. Glossop and Mrs. Taylor; "but you certainly said -it. Now wasn't that remarkable?" - -"Yes, I said it. And then we went to Mr. Moseley's, two miles, and all -of them were gone to the camp meeting over on Stony Fork; and then we -came all the way back, two miles, and then here, another mile--and -Providence has provided. You see it yourselves" - -They gazed at each other awe-struck, and lifted their hands and said in -unison: - -"It's per-fectly wonderful." - -"And then," said Mrs. Glossop, "what do you think we had better do let -Mr. Brown drive the Old People to Nancy Taylor's one at a time, or put -both of them in the buggy, and him lead the horse?" - -Brown gasped. - -"Now, then, that's a question," said Mrs. Enderby. "You see, we are all -tired out, and any way we fix it it's going to be difficult. For if Mr. -Brown takes both of them, at least one of us must, go back to help him, -for he can't load them into the buggy by himself, and they so helpless." - -"That is so," said Mrs. Taylor. "It doesn't look-oh, how would this do? ---one of us drive there with Mr. Brown, and the rest of you go along to -my house and get things ready. I'll go with him. He and I together can -lift one of the Old People into the buggy; then drive her to my house -and---- - -"But who will take care of the other one?" said Mrs. Enderby. "We -musn't leave her there in the woods alone, you know--especially the crazy -one. There and back is eight miles, you see." - -They had all been sitting on the grass beside the buggy for a while, now, -trying to rest their weary bodies. They fell silent a moment or two, and -struggled in thought over the baffling situation; then Mrs. Enderby -brightened and said: - -"I think I've got the idea, now. You see, we can't walk any more. Think -what we've done: four miles there, two to Moseley's, is six, then back to -here--nine miles since noon, and not a bite to eat; I declare I don't see -how we've done it; and as for me, I am just famishing. Now, somebody's -got to go back, to help Mr. Brown--there's no getting mound that; but -whoever goes has got to ride, not walk. So my idea is this: one of us to -ride back with Mr. Brown, then ride to Nancy Taylor's house with one of -the Old People, leaving Mr. Brown to keep the other old one company, you -all to go now to Nancy's and rest and wait; then one of you drive back -and get the other one and drive her to Nancy's, and Mr. Brown walk." - -"Splendid!" they all cried. "Oh, that will do--that will answer -perfectly." And they all said that Mrs. Enderby had the best head for -planning, in the company; and they said that they wondered that they -hadn't thought of this simple plan themselves. They hadn't meant to take -back the compliment, good simple souls, and didn't know they had done it. -After a consultation it was decided that Mrs. Enderby should drive back -with Brown, she being entitled to the distinction because she had -invented the plan. Everything now being satisfactorily arranged and -settled, the ladies rose, relieved and happy, and brushed down their -gowns, and three of them started homeward; Mrs. Enderby set her foot on -the buggy-step and was about to climb in, when Brown found a remnant of -his voice and gasped out-- - -"Please Mrs. Enderby, call them back--I am very weak; I can't walk, I -can't, indeed." - -"Why, dear Mr. Brown! You do look pale; I am ashamed of myself that I -didn't notice it sooner. Come back-all of you! Mr. Brown is not well. -Is there anything I can do for you, Mr. Brown?--I'm real sorry. Are you -in pain?" - -"No, madam, only weak; I am not sick, but only just weak--lately; not -long, but just lately." - -The others came back, and poured out their sympathies and commiserations, -and were full of self-reproaches for not having noticed how pale he was. - -And they at once struck out a new plan, and soon agreed that it was by -far the best of all. They would all go to Nancy Taylor's house and see -to Brown's needs first. He could lie on the sofa in the parlor, and -while Mrs. Taylor and Mary took care of him the other two ladies would -take the buggy and go and get one of the Old People, and leave one of -themselves with the other one, and---- - -By this time, without any solicitation, they were at the horse's head and -were beginning to turn him around. The danger was imminent, but Brown -found his voice again and saved himself. He said-- - -"But ladies, you are overlooking something which makes the plan -impracticable. You see, if you bring one of them home, and one remains -behind with the other, there will be three persons there when one of you -comes back for that other, for some one must drive the buggy back, and -three can't come home in it." - -They all exclaimed, "Why, sure-ly, that is so!" and they were, all -perplexed again. - -"Dear, dear, what can we do?" said Mrs. Glossop; "it is the most -mixed-up thing that ever was. The fox and the goose and the corn and -things-- Oh, dear, they are nothing to it." - -They sat wearily down once more, to further torture their tormented heads -for a plan that would work. Presently Mary offered a plan; it was her -first effort. She said: - -"I am young and strong, and am refreshed, now. Take Mr. Brown to our -house, and give him help--you see how plainly he needs it. I will go -back and take care of the Old People; I can be there in twenty minutes. -You can go on and do what you first started to do--wait on the main road -at our house until somebody comes along with a wagon; then send and bring -away the three of us. You won't have to wait long; the farmers will soon -be coming back from town, now. I will keep old Polly patient and cheered -up--the crazy one doesn't need it." - -This plan was discussed and accepted; it seemed the best that could be -done, in the circumstances, and the Old People must be getting -discouraged by this time. - -Brown felt relieved, and was deeply thankful. Let him once get to the -main road and he would find a way to escape. - -Then Mrs. Taylor said: - -"The evening chill will be coming on, pretty soon, and those poor old -burnt-out things will need some kind of covering. Take the lap-robe with -you, dear." - -"Very well, Mother, I will." - -She stepped to the buggy and put out her hand to take it---- - -That was the end of the tale. The passenger who told it said that when -he read the story twenty-five years ago in a train he was interrupted at -that point--the train jumped off a bridge. - -At first we thought we could finish the story quite easily, and we set to -work with confidence; but it soon began to appear that it was not a -simple thing, but difficult and baffling. This was on account of Brown's -character--great generosity and kindliness, but complicated with unusual -shyness and diffidence, particularly in the presence of ladies. There -was his love for Mary, in a hopeful state but not yet secure--just in a -condition, indeed, where its affair must be handled with great tact, and -no mistakes made, no offense given. And there was the mother wavering, -half willing-by adroit and flawless diplomacy to be won over, now, or -perhaps never at all. Also, there were the helpless Old People yonder in -the woods waiting-their fate and Brown's happiness to be determined by -what Brown should do within the next two seconds. Mary was reaching for -the lap-robe; Brown must decide-there was no time to be lost. - -Of course none but a happy ending of the story would be accepted by the -jury; the finish must find Brown in high credit with the ladies, his -behavior without blemish, his modesty unwounded, his character for self -sacrifice maintained, the Old People rescued through him, their -benefactor, all the party proud of him, happy in him, his praises on all -their tongues. - -We tried to arrange this, but it was beset with persistent and -irreconcilable difficulties. We saw that Brown's shyness would not allow -him to give up the lap-robe. This would offend Mary and her mother; and -it would surprise the other ladies, partly because this stinginess toward -the suffering Old People would be out of character with Brown, and partly -because he was a special Providence and could not properly act so. If -asked to explain his conduct, his shyness would not allow him to tell the -truth, and lack of invention and practice would find him incapable of -contriving a lie that would wash. We worked at the troublesome problem -until three in the morning. - -Meantime Mary was still reaching for the lap-robe. We gave it up, and -decided to let her continue to reach. It is the reader's privilege to -determine for himself how the thing came out. - - - - -CHAPTER III. - -It is more trouble to make a maxim than it is to do right. - --Pudd'nhead Wilson's New Calendar. - -On the seventh day out we saw a dim vast bulk standing up out of the -wastes of the Pacific and knew that that spectral promontory was Diamond -Head, a piece of this world which I had not seen before for twenty-nine -years. So we were nearing Honolulu, the capital city of the Sandwich -Islands--those islands which to me were Paradise; a Paradise which I had -been longing all those years to see again. Not any other thing in the -world could have stirred me as the sight of that great rock did. - -In the night we anchored a mile from shore. Through my port I could see -the twinkling lights of Honolulu and the dark bulk of the mountain-range -that stretched away right and left. I could not make out the beautiful -Nuuana valley, but I knew where it lay, and remembered how it used to -look in the old times. We used to ride up it on horseback in those days ---we young people--and branch off and gather bones in a sandy region -where one of the first Kamehameha's battles was fought. He was a -remarkable man, for a king; and he was also a remarkable man for a -savage. He was a mere kinglet and of little or no consequence at the -time of Captain Cook's arrival in 1788; but about four years afterward he -conceived the idea of enlarging his sphere of influence. That is a -courteous modern phrase which means robbing your neighbor--for your -neighbor's benefit; and the great theater of its benevolences is Africa. -Kamehameha went to war, and in the course of ten years he whipped out all -the other kings and made himself master of every one of the nine or ten -islands that form the group. But he did more than that. He bought -ships, freighted them with sandal wood and other native products, and -sent them as far as South America and China; he sold to his savages the -foreign stuffs and tools and utensils which came back in these ships, and -started the march of civilization. It is doubtful if the match to this -extraordinary thing is to be found in the history of any other savage. -Savages are eager to learn from the white man any new way to kill each -other, but it is not their habit to seize with avidity and apply with -energy the larger and nobler ideas which he offers them. The details of -Kamehameha's history show that he was always hospitably ready to examine -the white man's ideas, and that he exercised a tidy discrimination in -making his selections from the samples placed on view. - -A shrewder discrimination than was exhibited by his son and successor, -Liholiho, I think. Liholiho could have qualified as a reformer, perhaps, -but as a king he was a mistake. A mistake because he tried to be both -king and reformer. This is mixing fire and gunpowder together. A king -has no proper business with reforming. His best policy is to keep things -as they are; and if he can't do that, he ought to try to make them worse -than they are. This is not guesswork; I have thought over this matter a -good deal, so that if I should ever have a chance to become a king I -would know how to conduct the business in the best way. - -When Liholiho succeeded his father he found himself possessed of an -equipment of royal tools and safeguards which a wiser king would have -known how to husband, and judiciously employ, and make profitable. The -entire country was under the one scepter, and his was that scepter. -There was an Established Church, and he was the head of it. There was a -Standing Army, and he was the head of that; an Army of 114 privates under -command of 27 Generals and a Field Marshal. There was a proud and -ancient Hereditary Nobility. There was still one other asset. This was -the tabu--an agent endowed with a mysterious and stupendous power, an -agent not found among the properties of any European monarch, a tool of -inestimable value in the business. Liholiho was headmaster of the tabu. -The tabu was the most ingenious and effective of all the inventions that -has ever been devised for keeping a people's privileges satisfactorily -restricted. - -It required the sexes to live in separate houses. It did not allow -people to eat in either house; they must eat in another place. It did -not allow a man's woman-folk to enter his house. It did not allow the -sexes to eat together; the men must eat first, and the women must wait on -them. Then the women could eat what was left--if anything was left--and -wait on themselves. I mean, if anything of a coarse or unpalatable sort -was left, the women could have it. But not the good things, the fine -things, the choice things, such as pork, poultry, bananas, cocoanuts, the -choicer varieties of fish, and so on. By the tabu, all these were sacred -to the men; the women spent their lives longing for them and wondering -what they might taste like; and they died without finding out. - -These rules, as you see, were quite simple and clear. It was easy to -remember them; and useful. For the penalty for infringing any rule in -the whole list was death. Those women easily learned to put up with -shark and taro and dog for a diet when the other things were so -expensive. - -It was death for any one to walk upon tabu'd ground; or defile a tabu'd -thing with his touch; or fail in due servility to a chief; or step upon -the king's shadow. The nobles and the King and the priests were always -suspending little rags here and there and yonder, to give notice to the -people that the decorated spot or thing was tabu, and death lurking near. -The struggle for life was difficult and chancy in the islands in those -days. - -Thus advantageously was the new king situated. Will it be believed that -the first thing he did was to destroy his Established Church, root and -branch? He did indeed do that. To state the case figuratively, he was a -prosperous sailor who burnt his ship and took to a raft. This Church was -a horrid thing. It heavily oppressed the people; it kept them always -trembling in the gloom of mysterious threatenings; it slaughtered them in -sacrifice before its grotesque idols of wood and stone; it cowed them, it -terrorized them, it made them slaves to its priests, and through the -priests to the king. It was the best friend a king could have, and the -most dependable. To a professional reformer who should annihilate so -frightful and so devastating a power as this Church, reverence and praise -would be due; but to a king who should do it, could properly be due -nothing but reproach; reproach softened by sorrow; sorrow for his -unfitness for his position. - -He destroyed his Established Church, and his kingdom is a republic today, -in consequence of that act. - -When he destroyed the Church and burned the idols he did a mighty thing -for civilization and for his people's weal--but it was not "business." -It was unkingly, it was inartistic. It made trouble for his line. The -American missionaries arrived while the burned idols were still smoking. -They found the nation without a religion, and they repaired the defect. -They offered their own religion and it was gladly received. But it was -no support to arbitrary kingship, and so the kingly power began to weaken -from that day. Forty-seven years later, when I was in the islands, -Kainehameha V. was trying to repair Liholiho's blunder, and not -succeeding. He had set up an Established Church and made himself the -head of it. But it was only a pinchbeck thing, an imitation, a bauble, -an empty show. It had no power, no value for a king. It could not harry -or burn or slay, it in no way resembled the admirable machine which -Liholiho destroyed. It was an Established Church without an -Establishment; all the people were Dissenters. - -Long before that, the kingship had itself become but a name, a show. At -an early day the missionaries had turned it into something very much like -a republic; and here lately the business whites have turned it into -something exactly like it. - -In Captain Cook's time (1778), the native population of the islands was -estimated at 400,000; in 1836 at something short of 200,000, in 1866 at -50,000; it is to-day, per census, 25,000. All intelligent people praise -Kamehameha I. and Liholiho for conferring upon their people the great -boon of civilization. I would do it myself, but my intelligence is out -of repair, now, from over-work. - -When I was in the islands nearly a generation ago, I was acquainted with -a young American couple who had among their belongings an attractive -little son of the age of seven--attractive but not practicably -companionable with me, because he knew no English. He had played from -his birth with the little Kanakas on his father's plantation, and had -preferred their language and would learn no other. The family removed to -America a month after I arrived in the islands, and straightway the boy -began to lose his Kanaka and pick up English. By the time he was twelve -be hadn't a word of Kanaka left; the language had wholly departed from -his tongue and from his comprehension. Nine years later, when he was -twenty-one, I came upon the family in one of the lake towns of New York, -and the mother told me about an adventure which her son had been having. -By trade he was now a professional diver. A passenger boat had been -caught in a storm on the lake, and had gone down, carrying her people -with her. A few days later the young diver descended, with his armor on, -and entered the berth-saloon of the boat, and stood at the foot of the -companionway, with his hand on the rail, peering through the dim water. -Presently something touched him on the shoulder, and he turned and found -a dead man swaying and bobbing about him and seemingly inspecting him -inquiringly. He was paralyzed with fright. His entry had disturbed the -water, and now he discerned a number of dim corpses making for him and -wagging their heads and swaying their bodies like sleepy people trying to -dance. His senses forsook him, and in that condition he was drawn to the -surface. He was put to bed at home, and was soon very ill. During some -days he had seasons of delirium which lasted several hours at a time; and -while they lasted he talked Kanaka incessantly and glibly; and Kanaka -only. He was still very ill, and he talked to me in that tongue; but I -did not understand it, of course. The doctor-books tell us that cases -like this are not uncommon. Then the doctors ought to study the cases -and find out how to multiply them. Many languages and things get mislaid -in a person's head, and stay mislaid for lack of this remedy. - -Many memories of my former visit to the islands came up in my mind while -we lay at anchor in front of Honolulu that night. And pictures--pictures -pictures--an enchanting procession of them! I was impatient for the -morning to come. - -When it came it brought disappointment, of course. Cholera had broken -out in the town, and we were not allowed to have any communication with -the shore. Thus suddenly did my dream of twenty-nine years go to ruin. -Messages came from friends, but the friends themselves I was not to have -any sight of. My lecture-hall was ready, but I was not to see that, -either. - -Several of our passengers belonged in Honolulu, and these were sent -ashore; but nobody could go ashore and return. There were people on -shore who were booked to go with us to Australia, but we could not -receive them; to do it would cost us a quarantine-term in Sydney. They -could have escaped the day before, by ship to San Francisco; but the bars -had been put up, now, and they might have to wait weeks before any ship -could venture to give them a passage any whither. And there were -hardships for others. An elderly lady and her son, recreation-seekers -from Massachusetts, had wandered westward, further and further from home, -always intending to take the return track, but always concluding to go -still a little further; and now here they were at anchor before Honolulu -positively their last westward-bound indulgence--they had made up their -minds to that--but where is the use in making up your mind in this world? -It is usually a waste of time to do it. These two would have to stay -with us as far as Australia. Then they could go on around the world, or -go back the way they had come; the distance and the accommodations and -outlay of time would be just the same, whichever of the two routes they -might elect to take. Think of it: a projected excursion of five hundred -miles gradually enlarged, without any elaborate degree of intention, to a -possible twenty-four thousand. However, they were used to extensions by -this time, and did not mind this new one much. - -And we had with us a lawyer from Victoria, who had been sent out by the -Government on an international matter, and he had brought his wife with -him and left the children at home with the servants and now what was to -be done? Go ashore amongst the cholera and take the risks? Most -certainly not. They decided to go on, to the Fiji islands, wait there a -fortnight for the next ship, and then sail for home. They couldn't -foresee that they wouldn't see a homeward-bound ship again for six weeks, -and that no word could come to them from the children, and no word go -from them to the children in all that time. It is easy to make plans in -this world; even a cat can do it; and when one is out in those remote -oceans it is noticeable that a cat's plans and a man's are worth about -the same. There is much the same shrinkage in both, in the matter of -values. - -There was nothing for us to do but sit about the decks in the shade of -the awnings and look at the distant shore. We lay in luminous blue -water; shoreward the water was green-green and brilliant; at the shore -itself it broke in a long white ruffle, and with no crash, no sound that -we could hear. The town was buried under a mat of foliage that looked -like a cushion of moss. The silky mountains were clothed in soft, rich -splendors of melting color, and some of the cliffs were veiled in -slanting mists. I recognized it all. It was just as I had seen it long -before, with nothing of its beauty lost, nothing of its charm wanting. - -A change had come, but that was political, and not visible from the ship. -The monarchy of my day was gone, and a republic was sitting in its seat. -It was not a material change. The old imitation pomps, the fuss and -feathers, have departed, and the royal trademark--that is about all that -one could miss, I suppose. That imitation monarchy, was grotesque -enough, in my time; if it had held on another thirty years it would have -been a monarchy without subjects of the king's race. - -We had a sunset of a very fine sort. The vast plain of the sea was -marked off in bands of sharply-contrasted colors: great stretches of dark -blue, others of purple, others of polished bronze; the billowy mountains -showed all sorts of dainty browns and greens, blues and purples and -blacks, and the rounded velvety backs of certain of them made one want to -stroke them, as one would the sleek back of a cat. The long, sloping -promontory projecting into the sea at the west turned dim and leaden and -spectral, then became suffused with pink--dissolved itself in a pink -dream, so to speak, it seemed so airy and unreal. Presently the -cloud-rack was flooded with fiery splendors, and these were copied on the -surface of the sea, and it made one drunk with delight to look upon it. - -From talks with certain of our passengers whose home was Honolulu, and -from a sketch by Mrs. Mary H. Krout, I was able to perceive what the -Honolulu of to-day is, as compared with the Honolulu of my time. In my -time it was a beautiful little town, made up of snow-white wooden -cottages deliciously smothered in tropical vines and flowers and trees -and shrubs; and its coral roads and streets were hard and smooth, and as -white as the houses. The outside aspects of the place suggested the -presence of a modest and comfortable prosperity--a general prosperity ---perhaps one might strengthen the term and say universal. There were no -fine houses, no fine furniture. There were no decorations. Tallow -candles furnished the light for the bedrooms, a whale-oil lamp furnished -it for the parlor. Native matting served as carpeting. In the parlor -one would find two or three lithographs on the walls--portraits as a -rule: Kamehameha IV., Louis Kossuth, Jenny Lind; and may be an engraving -or two: Rebecca at the Well, Moses smiting the rock, Joseph's servants -finding the cup in Benjamin's sack. There would be a center table, with -books of a tranquil sort on it: The Whole Duty of Man, Baxter's Saints' -Rest, Fox's Martyrs, Tupper's Proverbial Philosophy, bound copies of The -Missionary Herald and of Father Damon's Seaman's Friend. A melodeon; a -music stand, with 'Willie, We have Missed You', 'Star of the Evening', -'Roll on Silver Moon', 'Are We Most There', 'I Would not Live Alway', and -other songs of love and sentiment, together with an assortment of hymns. -A what-not with semi-globular glass paperweights, enclosing miniature -pictures of ships, New England rural snowstorms, and the like; sea-shells -with Bible texts carved on them in cameo style; native curios; whale's -tooth with full-rigged ship carved on it. There was nothing reminiscent -of foreign parts, for nobody had been abroad. Trips were made to San -Francisco, but that could not be called going abroad. Comprehensively -speaking, nobody traveled. - -But Honolulu has grown wealthy since then, and of course wealth has -introduced changes; some of the old simplicities have disappeared. Here -is a modern house, as pictured by Mrs. Krout: - - "Almost every house is surrounded by extensive lawns and gardens - enclosed by walls of volcanic stone or by thick hedges of the - brilliant hibiscus. - - "The houses are most tastefully and comfortably furnished; the - floors are either of hard wood covered with rugs or with fine Indian - matting, while there is a preference, as in most warm countries, for - rattan or bamboo furniture; there are the usual accessories of - bric-a-brac, pictures, books, and curios from all parts of the world, - for these island dwellers are indefatigable travelers. - - "Nearly every house has what is called a lanai. It is a large - apartment, roofed, floored, open on three sides, with a door or a - draped archway opening into the drawing-room. Frequently the roof - is formed by the thick interlacing boughs of the hou tree, - impervious to the sun and even to the rain, except in violent - storms. Vines are trained about the sides--the stephanotis or some - one of the countless fragrant and blossoming trailers which abound - in the islands. There are also curtains of matting that may be - drawn to exclude the sun or rain. The floor is bare for coolness, - or partially covered with rugs, and the lanai is prettily furnished - with comfortable chairs, sofas, and tables loaded with flowers, or - wonderful ferns in pots. - - "The lanai is the favorite reception room, and here at any social - function the musical program is given and cakes and ices are served; - here morning callers are received, or gay riding parties, the ladies - in pretty divided skirts, worn for convenience in riding astride, - --the universal mode adopted by Europeans and Americans, as well as - by the natives. - - "The comfort and luxury of such an apartment, especially at a - seashore villa, can hardly be imagined. The soft breezes sweep - across it, heavy with the fragrance of jasmine and gardenia, and - through the swaying boughs of palm and mimosa there are glimpses of - rugged mountains, their summits veiled in clouds, of purple sea with - the white surf beating eternally against the reefs, whiter still in - the yellow sunlight or the magical moonlight of the tropics." - -There: rugs, ices, pictures, lanais, worldly books, sinful bric-a-brac -fetched from everywhere. And the ladies riding astride. These are -changes, indeed. In my time the native women rode astride, but the white -ones lacked the courage to adopt their wise custom. In my time ice was -seldom seen in Honolulu. It sometimes came in sailing vessels from New -England as ballast; and then, if there happened to be a man-of-war in -port and balls and suppers raging by consequence, the ballast was worth -six hundred dollars a ton, as is evidenced by reputable tradition. But -the ice-machine has traveled all over the world, now, and brought ice -within everybody's reach. In Lapland and Spitzbergen no one uses native -ice in our day, except the bears and the walruses. - -The bicycle is not mentioned. It was not necessary. We know that it is -there, without inquiring. It is everywhere. But for it, people could -never have had summer homes on the summit of Mont Blanc; before its day, -property up there had but a nominal value. The ladies of the Hawaiian -capital learned too late the right way to occupy a horse--too late to get -much benefit from it. The riding-horse is retiring from business -everywhere in the world. In Honolulu a few years from now he will be -only a tradition. - -We all know about Father Damien, the French priest who voluntarily -forsook the world and went to the leper island of Molokai to labor among -its population of sorrowful exiles who wait there, in slow-consuming -misery, for death to cone and release them from their troubles; and we -know that the thing which he knew beforehand would happen, did happen: -that he became a leper himself, and died of that horrible disease. There -was still another case of self-sacrifice, it appears. I asked after -"Billy" Ragsdale, interpreter to the Parliament in my time--a half-white. -He was a brilliant young fellow, and very popular. As an interpreter he -would have been hard to match anywhere. He used to stand up in the -Parliament and turn the English speeches into Hawaiian and the Hawaiian -speeches into English with a readiness and a volubility that were -astonishing. I asked after him, and was told that his prosperous career -was cut short in a sudden and unexpected way, just as he was about to -marry a beautiful half-caste girl. He discovered, by some nearly -invisible sign about his skin, that the poison of leprosy was in him. -The secret was his own, and might be kept concealed for years; but he -would not be treacherous to the girl that loved him; he would not marry -her to a doom like his. And so he put his affairs in order, and went -around to all his friends and bade them good-bye, and sailed in the leper -ship to Molokai. There he died the loathsome and lingering death that -all lepers die. - -In this place let me insert a paragraph or two from "The Paradise of -the Pacific" (Rev. H. H. Gowen)-- - - "Poor lepers! It is easy for those who have no relatives or friends - among them to enforce the decree of segregation to the letter, but - who can write of the terrible, the heart-breaking scenes which that - enforcement has brought about? - - "A man upon Hawaii was suddenly taken away after a summary arrest, - leaving behind him a helpless wife about to give birth to a babe. - The devoted wife with great pain and risk came the whole journey to - Honolulu, and pleaded until the authorities were unable to resist - her entreaty that she might go and live like a leper with her leper - husband. - - "A woman in the prime of life and activity is condemned as an - incipient leper, suddenly removed from her home, and her husband - returns to find his two helpless babes moaning for their lost - mother. - - "Imagine it! The case of the babies is hard, but its bitterness is - a trifle--less than a trifle--less than nothing--compared to what - the mother must suffer; and suffer minute by minute, hour by hour, - day by day, month by month, year by year, without respite, relief, - or any abatement of her pain till she dies. - - "One woman, Luka Kaaukau, has been living with her leper husband in - the settlement for twelve years. The man has scarcely a joint left, - his limbs are only distorted ulcerated stumps, for four years his - wife has put every particle of food into his mouth. He wanted his - wife to abandon his wretched carcass long ago, as she herself was - sound and well, but Luka said that she was content to remain and - wait on the man she loved till the spirit should be freed from its - burden. - - "I myself have known hard cases enough:--of a girl, apparently in - full health, decorating the church with me at Easter, who before - Christmas is taken away as a confirmed leper; of a mother hiding her - child in the mountains for years so that not even her dearest - friends knew that she had a child alive, that he might not be taken - away; of a respectable white man taken away from his wife and - family, and compelled to become a dweller in the Leper Settlement, - where he is counted dead, even by the insurance companies." - -And one great pity of it all is, that these poor sufferers are innocent. -The leprosy does not come of sins which they committed, but of sins -committed by their ancestors, who escaped the curse of leprosy! - -Mr. Gowan has made record of a certain very striking circumstance. Would -you expect to find in that awful Leper Settlement a custom worthy to be -transplanted to your own country? They have one such, and it is -inexpressibly touching and beautiful. When death sets open the -prison-door of life there, the band salutes the freed soul with a burst -of glad music! - - - - -CHAPTER IV. - -A dozen direct censures are easier to bear than one morganatic -compliment. - --Pudd'nhead Wilson's New Calendar. - -Sailed from Honolulu.--From diary: - -Sept. 2. Flocks of flying fish-slim, shapely, graceful, and intensely -white. With the sun on them they look like a flight of silver -fruit-knives. They are able to fly a hundred yards. - -Sept. 3. In 9 deg. 50' north latitude, at breakfast. Approaching the -equator on a long slant. Those of us who have never seen the equator are -a good deal excited. I think I would rather see it than any other thing -in the world. We entered the "doldrums" last night--variable winds, -bursts of rain, intervals of calm, with chopping seas and a wobbly and -drunken motion to the ship--a condition of things findable in -other regions sometimes, but present in the doldrums always. The -globe-girdling belt called the doldrums is 20 degrees wide, and the -thread called the equator lies along the middle of it. - -Sept. 4. Total eclipse of the moon last night. At 1.30 it began to go -off. At total--or about that--it was like a rich rosy cloud with a -tumbled surface framed in the circle and projecting from it--a bulge of -strawberry-ice, so to speak. At half-eclipse the moon was like a gilded -acorn in its cup. - -Sept. 5. Closing in on the equator this noon. A sailor explained to a -young girl that the ship's speed is poor because we are climbing up the -bulge toward the center of the globe; but that when we should once get -over, at the equator, and start down-hill, we should fly. When she asked -him the other day what the fore-yard was, he said it was the front yard, -the open area in the front end of the ship. That man has a good deal of -learning stored up, and the girl is likely to get it all. - -Afternoon. Crossed the equator. In the distance it looked like a blue -ribbon stretched across the ocean. Several passengers kodak'd it. We -had no fool ceremonies, no fantastics, no horse play. All that sort of -thing has gone out. In old times a sailor, dressed as Neptune, used to -come in over the bows, with his suite, and lather up and shave everybody -who was crossing the equator for the first time, and then cleanse these -unfortunates by swinging them from the yard-arm and ducking them three -times in the sea. This was considered funny. Nobody knows why. No, that -is not true. We do know why. Such a thing could never be funny on land; -no part of the old-time grotesque performances gotten up on shipboard to -celebrate the passage of the line would ever be funny on shore--they -would seem dreary and less to shore people. But the shore people would -change their minds about it at sea, on a long voyage. On such a voyage, -with its eternal monotonies, people's intellects deteriorate; the owners -of the intellects soon reach a point where they almost seem to prefer -childish things to things of a maturer degree. One is often surprised at -the juvenilities which grown people indulge in at sea, and the interest -they take in them, and the consuming enjoyment they get out of them. -This is on long voyages only. The mind gradually becomes inert, dull, -blunted; it loses its accustomed interest in intellectual things; nothing -but horse-play can rouse it, nothing but wild and foolish grotesqueries -can entertain it. On short voyages it makes no such exposure of itself; -it hasn't time to slump down to this sorrowful level. - -The short-voyage passenger gets his chief physical exercise out of -"horse-billiards"--shovel-board. It is a good game. We play it in this -ship. A quartermaster chalks off a diagram like this-on the deck. - -The player uses a cue that is like a broom-handle with a quarter-moon of -wood fastened to the end of it. With this he shoves wooden disks the -size of a saucer--he gives the disk a vigorous shove and sends it fifteen -or twenty feet along the deck and lands it in one of the squares if he -can. If it stays there till the inning is played out, it will count as -many points in the game as the figure in the square it has stopped in -represents. The adversary plays to knock that disk out and leave his own -in its place--particularly if it rests upon the 9 or 10 or some other of -the high numbers; but if it rests in the "10off" he backs it up--lands -his disk behind it a foot or two, to make it difficult for its owner to -knock it out of that damaging place and improve his record. When the -inning is played out it may be found that each adversary has placed his -four disks where they count; it may be found that some of them are -touching chalk lines and not counting; and very often it will be found -that there has been a general wreckage, and that not a disk has been left -within the diagram. Anyway, the result is recorded, whatever it is, and -the game goes on. The game is 100 points, and it takes from twenty -minutes to forty to play it, according to luck and the condition of the -sea. It is an exciting game, and the crowd of spectators furnish -abundance of applause for fortunate shots and plenty of laughter for the -other kind. It is a game of skill, but at the same time the uneasy -motion of the ship is constantly interfering with skill; this makes it a -chancy game, and the element of luck comes largely in. - -We had a couple of grand tournaments, to determine who should be -"Champion of the Pacific"; they included among the participants nearly -all the passengers, of both sexes, and the officers of the ship, and they -afforded many days of stupendous interest and excitement, and murderous -exercise--for horse-billiards is a physically violent game. - -The figures in the following record of some of the closing games in the -first tournament will show, better than any description, how very chancy -the game is. The losers here represented had all been winners in the -previous games of the series, some of them by fine majorities: - -Chase,102 Mrs. D.,57 Mortimer, 105 The Surgeon, 92 -Miss C.,105 Mrs. T.,9 Clemens, 101 Taylor,92 -Taylor,109 Davies,95 Miss C., 108 Mortimer,55 -Thomas,102 Roper,76 Clemens, 111 Miss C.,89 -Coomber, 106 Chase,98 - -And so on; until but three couples of winners were left. Then I beat my -man, young Smith beat his man, and Thomas beat his. This reduced the -combatants to three. Smith and I took the deck, and I led off. At the -close of the first inning I was 10 worse than nothing and Smith had -scored 7. The luck continued against me. When I was 57, Smith was 97 ---within 3 of out. The luck changed then. He picked up a 10-off or so, -and couldn't recover. I beat him. - -The next game would end tournament No. 1. - -Mr. Thomas and I were the contestants. He won the lead and went to the -bat--so to speak. And there he stood, with the crotch of his cue resting -against his disk while the ship rose slowly up, sank slowly down, rose -again, sank again. She never seemed to rise to suit him exactly. She -started up once more; and when she was nearly ready for the turn, he let -drive and landed his disk just within the left-hand end of the 10. -(Applause). The umpire proclaimed "a good 10," and the game-keeper set -it down. I played: my disk grazed the edge of Mr. Thomas's disk, and -went out of the diagram. (No applause.) - -Mr. Thomas played again--and landed his second disk alongside of the -first, and almost touching its right-hand side. "Good 10." (Great -applause.) - -I played, and missed both of them. (No applause.) - -Mr. Thomas delivered his third shot and landed his disk just at the right -of the other two. "Good 10." (Immense applause.) - -There they lay, side by side, the three in a row. It did not seem -possible that anybody could miss them. Still I did it. (Immense -silence.) - -Mr. Thomas played his last disk. It seems incredible, but he actually -landed that disk alongside of the others, and just to the right of them-a -straight solid row of 4 disks. (Tumultuous and long-continued applause.) - -Then I played my last disk. Again it did not seem possible that anybody -could miss that row--a row which would have been 14 inches long if the -disks had been clamped together; whereas, with the spaces separating them -they made a longer row than that. But I did it. It may be that I was -getting nervous. - -I think it unlikely that that innings has ever had its parallel in the -history of horse-billiards. To place the four disks side by side in the -10 was an extraordinary feat; indeed, it was a kind of miracle. To miss -them was another miracle. It will take a century to produce another man -who can place the four disks in the 10; and longer than that to find a -man who can't knock them out. I was ashamed of my performance at the -time, but now that I reflect upon it I see that it was rather fine and -difficult. - -Mr. Thomas kept his luck, and won the game, and later the championship. - -In a minor tournament I won the prize, which was a Waterbury watch. I -put it in my trunk. In Pretoria, South Africa, nine months afterward, my -proper watch broke down and I took the Waterbury out, wound it, set it by -the great clock on the Parliament House (8.05), then went back to my room -and went to bed, tired from a long railway journey. The parliamentary -clock had a peculiarity which I was not aware of at the time ---a peculiarity which exists in no other clock, and would not exist in that -one if it had been made by a sane person; on the half-hour it strikes the -succeeding hour, then strikes the hour again, at the proper time. I lay -reading and smoking awhile; then, when I could hold my eyes open no -longer and was about to put out the light, the great clock began to boom, -and I counted ten. I reached for the Waterbury to see how it was getting -along. It was marking 9.30. It seemed rather poor speed for a -three-dollar watch, but I supposed that the climate was affecting it. I -shoved it half an hour ahead; and took to my book and waited to see what -would happen. At 10 the great clock struck ten again. I looked--the -Waterbury was marking half-past 10. This was too much speed for the -money, and it troubled me. I pushed the hands back a half hour, and -waited once more; I had to, for I was vexed and restless now, and my -sleepiness was gone. By and by the great clock struck 11. The Waterbury -was marking 10.30. I pushed it ahead half an hour, with some show of -temper. By and by the great clock struck 11 again. The Waterbury showed -up 11.30, now, and I beat her brains out against the bedstead. I was -sorry next day, when I found out. - -To return to the ship. - -The average human being is a perverse creature; and when he isn't that, -he is a practical joker. The result to the other person concerned is -about the same: that is, he is made to suffer. The washing down of the -decks begins at a very early hour in all ships; in but few ships are any -measures taken to protect the passengers, either by waking or warning -them, or by sending a steward to close their ports. And so the -deckwashers have their opportunity, and they use it. They send a bucket -of water slashing along the side of the ship and into the ports, -drenching the passenger's clothes, and often the passenger himself. This -good old custom prevailed in this ship, and under unusually favorable -circumstances, for in the blazing tropical regions a removable zinc thing -like a sugarshovel projects from the port to catch the wind and bring it -in; this thing catches the wash-water and brings it in, too--and in -flooding abundance. Mrs. L, an invalid, had to sleep on the locker--sofa -under her port, and every time she over-slept and thus failed to take -care of herself, the deck-washers drowned her out. - -And the painters, what a good time they had! This ship would be going -into dock for a month in Sydney for repairs; but no matter, painting was -going on all the time somewhere or other. The ladies' dresses were -constantly getting ruined, nevertheless protests and supplications went -for nothing. Sometimes a lady, taking an afternoon nap on deck near a -ventilator or some other thing that didn't need painting, would wake up -by and by and find that the humorous painter had been noiselessly daubing -that thing and had splattered her white gown all over with little greasy -yellow spots. - -The blame for this untimely painting did not lie with the ship's -officers, but with custom. As far back as Noah's time it became law that -ships must be constantly painted and fussed at when at sea; custom grew -out of the law, and at sea custom knows no death; this custom will -continue until the sea goes dry. - -Sept. 8.--Sunday. We are moving so nearly south that we cross only about -two meridians of longitude a day. This morning we were in longitude 178 -west from Greenwich, and 57 degrees west from San Francisco. To-morrow -we shall be close to the center of the globe--the 180th degree of west -longitude and 180th degree of east longitude. - -And then we must drop out a day-lose a day out of our lives, a day never -to be found again. We shall all die one day earlier than from the -beginning of time we were foreordained to die. We shall be a day -behindhand all through eternity. We shall always be saying to the other -angels, "Fine day today," and they will be always retorting, "But it -isn't to-day, it's tomorrow." We shall be in a state of confusion all the -time and shall never know what true happiness is. - -Next Day. Sure enough, it has happened. Yesterday it was September 8, -Sunday; to-day, per the bulletin-board at the head of the companionway, -it is September 10, Tuesday. There is something uncanny about it. And -uncomfortable. In fact, nearly unthinkable, and wholly unrealizable, -when one comes to consider it. While we were crossing the 180th meridian -it was Sunday in the stern of the ship where my family were, and Tuesday -in the bow where I was. They were there eating the half of a fresh apple -on the 8th, and I was at the same time eating the other half of it on the -10th--and I could notice how stale it was, already. The family were the -same age that they were when I had left them five minutes before, but I -was a day older now than I was then. The day they were living in -stretched behind them half way round the globe, across the Pacific Ocean -and America and Europe; the day I was living in stretched in front of me -around the other half to meet it. They were stupendous days for bulk and -stretch; apparently much larger days than we had ever been in before. -All previous days had been but shrunk-up little things by comparison. -The difference in temperature between the two days was very marked, their -day being hotter than mine because it was closer to the equator. - -Along about the moment that we were crossing the Great Meridian a child -was born in the steerage, and now there is no way to tell which day it -was born on. The nurse thinks it was Sunday, the surgeon thinks it was -Tuesday. The child will never know its own birthday. It will always be -choosing first one and then the other, and will never be able to make up -its mind permanently. This will breed vacillation and uncertainty in its -opinions about religion, and politics, and business, and sweethearts, and -everything, and will undermine its principles, and rot them away, and -make the poor thing characterless, and its success in life impossible. -Every one in the ship says so. And this is not all--in fact, not the -worst. For there is an enormously rich brewer in the ship who said as -much as ten days ago, that if the child was born on his birthday he would -give it ten thousand dollars to start its little life with. His birthday -was Monday, the 9th of September. - -If the ships all moved in the one direction--westward, I mean--the world -would suffer a prodigious loss--in the matter of valuable time, through -the dumping overboard on the Great Meridian of such multitudes of days by -ships crews and passengers. But fortunately the ships do not all sail -west, half of them sail east. So there is no real loss. These latter -pick up all the discarded days and add them to the world's stock again; -and about as good as new, too; for of course the salt water preserves -them. - - - - -CHAPTER V. - -Noise proves nothing. Often a hen who has merely laid an egg cackles as -if she had laid an asteroid. - --Pudd'nhead Wilson's New Calendar. - -WEDNESDAY, Sept. 11. In this world we often make mistakes of judgment. -We do not as a rule get out of them sound and whole, but sometimes we do. -At dinner yesterday evening-present, a mixture of Scotch, English, -American, Canadian, and Australasian folk--a discussion broke out about -the pronunciation of certain Scottish words. This was private ground, -and the non-Scotch nationalities, with one exception, discreetly kept -still. But I am not discreet, and I took a hand. I didn't know anything -about the subject, but I took a hand just to have something to do. At -that moment the word in dispute was the word three. One Scotchman was -claiming that the peasantry of Scotland pronounced it three, his -adversaries claimed that they didn't--that they pronounced it 'thraw'. -The solitary Scot was having a sultry time of it, so I thought I would -enrich him with my help. In my position I was necessarily quite -impartial, and was equally as well and as ill equipped to fight on the -one side as on the other. So I spoke up and said the peasantry -pronounced the word three, not thraw. It was an error of judgment. -There was a moment of astonished and ominous silence, then weather -ensued. The storm rose and spread in a surprising way, and I was snowed -under in a very few minutes. It was a bad defeat for me--a kind of -Waterloo. It promised to remain so, and I wished I had had better sense -than to enter upon such a forlorn enterprise. But just then I had a -saving thought--at least a thought that offered a chance. While the -storm was still raging, I made up a Scotch couplet, and then spoke up and -said: - -"Very well, don't say any more. I confess defeat. I thought I knew, but -I see my mistake. I was deceived by one of your Scotch poets." - -"A Scotch poet! O come! Name him." - -"Robert Burns." - -It is wonderful the power of that name. These men looked doubtful--but -paralyzed, all the same. They were quite silent for a moment; then one -of them said--with the reverence in his voice which is always present in -a Scotchman's tone when he utters the name. - -"Does Robbie Burns say--what does he say?" - -"This is what he says: - - 'There were nae bairns but only three - --Ane at the breast, twa at the knee.'" - -It ended the discussion. There was no man there profane enough, disloyal -enough, to say any word against a thing which Robert Burns had settled. -I shall always honor that great name for the salvation it brought me in -this time of my sore need. - -It is my belief that nearly any invented quotation, played with -confidence, stands a good chance to deceive. There are people who think -that honesty is always the best policy. This is a superstition; there -are times when the appearance of it is worth six of it. - -We are moving steadily southward-getting further and further down under -the projecting paunch of the globe. Yesterday evening we saw the Big -Dipper and the north star sink below the horizon and disappear from our -world. No, not "we," but they. They saw it--somebody saw it--and told -me about it. But it is no matter, I was not caring for those things, I -am tired of them, any way. I think they are well enough, but one doesn't -want them always hanging around. My interest was all in the Southern -Cross. I had never seen that. I had heard about it all my life, and it -was but natural that I should be burning to see it. No other -constellation makes so much talk. I had nothing against the Big Dipper ---and naturally couldn't have anything against it, since it is a citizen of -our own sky, and the property of the United States--but I did want it to -move out of the way and give this foreigner a chance. Judging by the -size of the talk which the Southern Cross had made, I supposed it would -need a sky all to itself. - -But that was a mistake. We saw the Cross to-night, and it is not large. -Not large, and not strikingly bright. But it was low down toward the -horizon, and it may improve when it gets up higher in the sky. It is -ingeniously named, for it looks just as a cross would look if it looked -like something else. But that description does not describe; it is too -vague, too general, too indefinite. It does after a fashion suggest a -cross across that is out of repair--or out of drawing; not correctly -shaped. It is long, with a short cross-bar, and the cross-bar is canted -out of the straight line. - -It consists of four large stars and one little one. The little one is -out of line and further damages the shape. It should have been placed at -the intersection of the stem and the cross-bar. If you do not draw an -imaginary line from star to star it does not suggest a cross--nor -anything in particular. - -One must ignore the little star, and leave it out of the combination--it -confuses everything. If you leave it out, then you can make out of the -four stars a sort of cross--out of true; or a sort of kite--out of true; -or a sort of coffin-out of true. - -Constellations have always been troublesome things to name. If you give -one of them a fanciful name, it will always refuse to live up to it; it -will always persist in not resembling the thing it has been named for. -Ultimately, to satisfy the public, the fanciful name has to be discarded -for a common-sense one, a manifestly descriptive one. The Great Bear -remained the Great Bear--and unrecognizable as such--for thousands of -years; and people complained about it all the time, and quite properly; -but as soon as it became the property of the United States, Congress -changed it to the Big Dipper, and now every body is satisfied, and there -is no more talk about riots. I would not change the Southern Cross to -the Southern Coffin, I would change it to the Southern Kite; for up there -in the general emptiness is the proper home of a kite, but not for -coffins and crosses and dippers. In a little while, now--I cannot -tell exactly how long it will be--the globe will belong to the -English-speaking race; and of course the skies also. Then the -constellations will be re-organized, and polished up, and re-named--the -most of them "Victoria," I reckon, but this one will sail thereafter as -the Southern Kite, or go out of business. Several towns and things, here -and there, have been named for Her Majesty already. - -In these past few days we are plowing through a mighty Milky Way of -islands. They are so thick on the map that one would hardly expect to -find room between them for a canoe; yet we seldom glimpse one. Once we -saw the dim bulk of a couple of them, far away, spectral and dreamy -things; members of the Horne-Alofa and Fortuna. On the larger one are -two rival native kings--and they have a time together. They are -Catholics; so are their people. The missionaries there are French -priests. - -From the multitudinous islands in these regions the "recruits" for the -Queensland plantations were formerly drawn; are still drawn from them, I -believe. Vessels fitted up like old-time slavers came here and carried -off the natives to serve as laborers in the great Australian province. -In the beginning it was plain, simple man-stealing, as per testimony of -the missionaries. This has been denied, but not disproven. Afterward it -was forbidden by law to "recruit" a native without his consent, and -governmental agents were sent in all recruiting vessels to see that the -law was obeyed--which they did, according to the recruiting people; and -which they sometimes didn't, according to the missionaries. A man could -be lawfully recruited for a three-years term of service; he could -volunteer for another term if he so chose; when his time was up he could -return to his island. And would also have the means to do it; for the -government required the employer to put money in its hands for this -purpose before the recruit was delivered to him. - -Captain Wawn was a recruiting ship-master during many years. From his -pleasant book one gets the idea that the recruiting business was quite -popular with the islanders, as a rule. And yet that did not make the -business wholly dull and uninteresting; for one finds rather frequent -little breaks in the monotony of it--like this, for instance: - - "The afternoon of our arrival at Leper Island the schooner was lying - almost becalmed under the lee of the lofty central portion of the - island, about three-quarters of a mile from the shore. The boats - were in sight at some distance. The recruiter-boat had run into a - small nook on the rocky coast, under a high bank, above which stood - a solitary hut backed by dense forest. The government agent and - mate in the second boat lay about 400 yards to the westward. - - "Suddenly we heard the sound of firing, followed by yells from the - natives on shore, and then we saw the recruiter-boat push out with a - seemingly diminished crew. The mate's boat pulled quickly up, took - her in tow, and presently brought her alongside, all her own crew - being more or less hurt. It seems the natives had called them into - the place on pretence of friendship. A crowd gathered about the - stern of the boat, and several fellows even got into her. All of a - sudden our men were attacked with clubs and tomahawks. The - recruiter escaped the first blows aimed at him, making play with his - fists until he had an opportunity to draw his revolver. 'Tom - Sayers,' a Mare man, received a tomahawk blow on the head which laid - the scalp open but did not penetrate his skull, fortunately. 'Bobby - Towns,' another Mare boatman, had both his thumbs cut in warding off - blows, one of them being so nearly severed from the hand that the - doctors had to finish the operation. Lihu, a Lifu boy, the - recruiter's special attendant, was cut and pricked in various - places, but nowhere seriously. Jack, an unlucky Tanna recruit, who - had been engaged to act as boatman, received an arrow through his - forearm, the head of which--apiece of bone seven or eight inches - long--was still in the limb, protruding from both sides, when the - boats returned. The recruiter himself would have got off scot-free - had not an arrow pinned one of his fingers to the loom of the - steering-oar just as they were getting off. The fight had been - short but sharp. The enemy lost two men, both shot dead." - -The truth is, Captain Wawn furnishes such a crowd of instances of fatal -encounters between natives and French and English recruiting-crews (for -the French are in the business for the plantations of New Caledonia), -that one is almost persuaded that recruiting is not thoroughly popular -among the islanders; else why this bristling string of attacks and -bloodcurdling slaughter? The captain lays it all to "Exeter Hall -influence." But for the meddling philanthropists, the native fathers and -mothers would be fond of seeing their children carted into exile and now -and then the grave, instead of weeping about it and trying to kill the -kind recruiters. - - - - -CHAPTER VI. - -He was as shy as a newspaper is when referring to its own merits. - --Pudd'nhead Wilson's New Calendar. - -Captain Wawn is crystal-clear on one point: He does not approve of -missionaries. They obstruct his business. They make "Recruiting," as he -calls it ("Slave-Catching," as they call it in their frank way) a trouble -when it ought to be just a picnic and a pleasure excursion. The -missionaries have their opinion about the manner in which the Labor -Traffic is conducted, and about the recruiter's evasions of the law of -the Traffic, and about the traffic itself--and it is distinctly -uncomplimentary to the Traffic and to everything connected with it, -including the law for its regulation. Captain Wawn's book is of very -recent date; I have by me a pamphlet of still later date--hot from the -press, in fact--by Rev. Wm. Gray, a missionary; and the book and the -pamphlet taken together make exceedingly interesting reading, to my mind. - -Interesting, and easy to understand--except in one detail, which I will -mention presently. It is easy to understand why the Queensland sugar -planter should want the Kanaka recruit: he is cheap. Very cheap, in -fact. These are the figures paid by the planter: L20 to the recruiter -for getting the Kanaka or "catching" him, as the missionary phrase goes; -L3 to the Queensland government for "superintending" the importation; L5 -deposited with the Government for the Kanaka's passage home when his -three years are up, in case he shall live that long; about L25 to the -Kanaka himself for three years' wages and clothing; total payment for the -use of a man three years, L53; or, including diet, L60. Altogether, a -hundred dollars a year. One can understand why the recruiter is fond of -the business; the recruit costs him a few cheap presents (given to the -recruit's relatives, not himself), and the recruit is worth L20 to the -recruiter when delivered in Queensland. All this is clear enough; but -the thing that is not clear is, what there is about it all to persuade -the recruit. He is young and brisk; life at home in his beautiful island -is one lazy, long holiday to him; or if he wants to work he can turn out -a couple of bags of copra per week and sell it for four or five shillings -a bag. In Queensland he must get up at dawn and work from eight to -twelve hours a day in the canefields--in a much hotter climate than he is -used to--and get less than four shillings a week for it. - -I cannot understand his willingness to go to Queensland. It is a deep -puzzle to me. Here is the explanation, from the planter's point of view; -at least I gather from the missionary's pamphlet that it is the -planter's: - - "When he comes from his home he is a savage, pure and simple. He - feels no shame at his nakedness and want of adornment. When he - returns home he does so well dressed, sporting a Waterbury watch, - collars, cuffs, boots, and jewelry. He takes with him one or more - boxes--["Box" is English for trunk.]--well filled with clothing, a - musical instrument or two, and perfumery and other articles of - luxury he has learned to appreciate." - -For just one moment we have a seeming flash of comprehension of, the -Kanaka's reason for exiling himself: he goes away to acquire -civilization. Yes, he was naked and not ashamed, now he is clothed and -knows how to be ashamed; he was unenlightened; now he has a Waterbury -watch; he was unrefined, now he has jewelry, and something to make him -smell good; he was a nobody, a provincial, now he has been to far -countries and can show off. - -It all looks plausible--for a moment. Then the missionary takes hold of -this explanation and pulls it to pieces, and dances on it, and damages it -beyond recognition. - - "Admitting that the foregoing description is the average one, the - average sequel is this: The cuffs and collars, if used at all, are - carried off by youngsters, who fasten them round the leg, just below - the knee, as ornaments. The Waterbury, broken and dirty, finds its - way to the trader, who gives a trifle for it; or the inside is taken - out, the wheels strung on a thread and hung round the neck. Knives, - axes, calico, and handkerchiefs are divided among friends, and there - is hardly one of these apiece. The boxes, the keys often lost on - the road home, can be bought for 2s. 6d. They are to be seen - rotting outside in almost any shore village on Tanna. (I speak of - what I have seen.) A returned Kanaka has been furiously angry with - me because I would not buy his trousers, which he declared were just - my fit. He sold them afterwards to one of my Aniwan teachers for - 9d. worth of tobacco--a pair of trousers that probably cost him 8s. - or 10s. in Queensland. A coat or shirt is handy for cold weather. - The white handkerchiefs, the 'senet' (perfumery), the umbrella, and - perhaps the hat, are kept. The boots have to take their chance, if - they do not happen to fit the copra trader. 'Senet' on the hair, - streaks of paint on the face, a dirty white handkerchief round the - neck, strips of turtle shell in the ears, a belt, a sheath and - knife, and an umbrella constitute the rig of returned Kanaka at home - the day after landing." - -A hat, an umbrella, a belt, a neckerchief. Otherwise stark naked. All -in a day the hard-earned "civilization" has melted away to this. And -even these perishable things must presently go. Indeed, there is but a -single detail of his civilization that can be depended on to stay by him: -according to the missionary, he has learned to swear. This is art, and -art is long, as the poet says. - -In all countries the laws throw light upon the past. The Queensland law -for the regulation of the Labor Traffic is a confession. It is a -confession that the evils charged by the missionaries upon the traffic -had existed in the past, and that they still existed when the law was -made. The missionaries make a further charge: that the law is evaded by -the recruiters, and that the Government Agent sometimes helps them to do -it. Regulation 31 reveals two things: that sometimes a young fool of a -recruit gets his senses back, after being persuaded to sign away his -liberty for three years, and dearly wants to get out of the engagement -and stay at home with his own people; and that threats, intimidation, and -force are used to keep him on board the recruiting-ship, and to hold him -to his contract. Regulation 31 forbids these coercions. The law -requires that he shall be allowed to go free; and another clause of it -requires the recruiter to set him ashore--per boat, because of the -prevalence of sharks. Testimony from Rev. Mr. Gray: - - "There are 'wrinkles' for taking the penitent Kanaka. My first - experience of the Traffic was a case of this kind in 1884. A vessel - anchored just out of sight of our station, word was brought to me - that some boys were stolen, and the relatives wished me to go and - get them back. The facts were, as I found, that six boys had - recruited, had rushed into the boat, the Government Agent informed - me. They had all 'signed'; and, said the Government Agent, 'on - board they shall remain.' I was assured that the six boys were of - age and willing to go. Yet on getting ready to leave the ship I - found four of the lads ready to come ashore in the boat! This I - forbade. One of them jumped into the water and persisted in coming - ashore in my boat. When appealed to, the Government Agent suggested - that we go and leave him to be picked up by the ship's boat, a - quarter mile distant at the time!" - -The law and the missionaries feel for the repentant recruit--and -properly, one may be permitted to think, for he is only a youth and -ignorant and persuadable to his hurt--but sympathy for him is not kept in -stock by the recruiter. Rev. Mr. Gray says: - - "A captain many years in the traffic explained to me how a penitent - could betaken. 'When a boy jumps overboard we just take a boat and - pull ahead of him, then lie between him and the shore. If he has - not tired himself swimming, and passes the boat, keep on heading him - in this way. The dodge rarely fails. The boy generally tires of - swimming, gets into the boat of his own accord, and goes quietly on - board." - -Yes, exhaustion is likely to make a boy quiet. If the distressed boy had -been the speaker's son, and the captors savages, the speaker would have -been surprised to see how differently the thing looked from the new point -of view; however, it is not our custom to put ourselves in the other -person's place. Somehow there is something pathetic about that -disappointed young savage's resignation. I must explain, here, that in -the traffic dialect, "boy" does not always mean boy; it means a youth -above sixteen years of age. That is by Queensland law the age of -consent, though it is held that recruiters allow themselves some latitude -in guessing at ages. - -Captain Wawn of the free spirit chafes under the annoyance of "cast-iron -regulations." They and the missionaries have poisoned his life. He -grieves for the good old days, vanished to come no more. See him weep; -hear him cuss between the lines! - - "For a long time we were allowed to apprehend and detain all - deserters who had signed the agreement on board ship, but the - 'cast-iron' regulations of the Act of 1884 put a stop to that, - allowing the Kanaka to sign the agreement for three years' service, - travel about in the ship in receipt of the regular rations, cadge - all he could, and leave when he thought fit, so long as he did not - extend his pleasure trip to Queensland." - -Rev. Mr. Gray calls this same restrictive cast-iron law a "farce." "There -is as much cruelty and injustice done to natives by acts that are legal -as by deeds unlawful. The regulations that exist are unjust and -inadequate--unjust and inadequate they must ever be." He furnishes his -reasons for his position, but they are too long for reproduction here. - -However, if the most a Kanaka advantages himself by a three-years course -in civilization in Queensland, is a necklace and an umbrella and a showy -imperfection in the art of swearing, it must be that all the profit of -the traffic goes to the white man. This could be twisted into a -plausible argument that the traffic ought to be squarely abolished. - -However, there is reason for hope that that can be left alone to achieve -itself. It is claimed that the traffic will depopulate its sources of -supply within the next twenty or thirty years. Queensland is a very -healthy place for white people--death-rate 12 in 1,000 of the population ---but the Kanaka death-rate is away above that. The vital statistics for -1893 place it at 52; for 1894 (Mackay district), 68. The first six -months of the Kanaka's exile are peculiarly perilous for him because of -the rigors of the new climate. The death-rate among the new men has -reached as high as 180 in the 1,000. In the Kanaka's native home his -death-rate is 12 in time of peace, and 15 in time of war. Thus exile to -Queensland--with the opportunity to acquire civilization, an umbrella, -and a pretty poor quality of profanity--is twelve times as deadly for him -as war. Common Christian charity, common humanity, does seem to require, -not only that these people be returned to their homes, but that war, -pestilence, and famine be introduced among them for their preservation. - -Concerning these Pacific isles and their peoples an eloquent prophet -spoke long years ago--five and fifty years ago. In fact, he spoke a -little too early. Prophecy is a good line of business, but it is full of -risks. This prophet was the Right Rev. M. Russell, LL.D., D.C.L., of -Edinburgh: - - "Is the tide of civilization to roll only to the foot of the Rocky - Mountains, and is the sun of knowledge to set at last in the waves - of the Pacific? No; the mighty day of four thousand years is - drawing to its close; the sun of humanity has performed its destined - course; but long ere its setting rays are extinguished in the west, - its ascending beams have glittered on the isles of the eastern seas - . . . . And now we see the race of Japhet setting forth to - people the isles, and the seeds of another Europe and a second - England sown in the regions of the sun. But mark the words of the - prophecy: 'He shall dwell in the tents of Shem, and Canaan shall be - his servant.' It is not said Canaan shall be his slave. To the - Anglo-Saxon race is given the scepter of the globe, but there is not - given either the lash of the slave-driver or the rack of the - executioner. The East will not be stained with the same atrocities - as the West; the frightful gangrene of an enthralled race is not to - mar the destinies of the family of Japhet in the Oriental world; - humanizing, not destroying, as they advance; uniting with, not - enslaving, the inhabitants with whom they dwell, the British race - may," etc., etc. - -And he closes his vision with an invocation from Thomson: - - "Come, bright Improvement! on the car of Time, - And rule the spacious world from clime to clime." - -Very well, Bright Improvement has arrived, you see, with her -civilization, and her Waterbury, and her umbrella, and her third-quality -profanity, and her humanizing-not-destroying machinery, and her -hundred-and-eighty death-rate, and everything is going along just as -handsome! - -But the prophet that speaks last has an advantage over the pioneer in the -business. Rev. Mr. Gray says: - - "What I am concerned about is that we as a Christian nation should - wipe out these races to enrich ourselves." - -And he closes his pamphlet with a grim Indictment which is as eloquent in -its flowerless straightforward English as is the hand-painted rhapsody of -the early prophet: - - "My indictment of the Queensland-Kanaka Labor Traffic is this - - "1. It generally demoralizes and always impoverishes the Kanaka, - deprives him of his citizenship, and depopulates the islands fitted - to his home. - - "2. It is felt to lower the dignity of the white agricultural - laborer in Queensland, and beyond a doubt it lowers his wages there. - - "3. The whole system is fraught with danger to Australia and the - islands on the score of health. - - "4. On social and political grounds the continuance of the - Queensland Kanaka Labor Traffic must be a barrier to the true - federation of the Australian colonies. - - "5. The Regulations under which the Traffic exists in Queensland are - inadequate to prevent abuses, and in the nature of things they must - remain so. - - "6. The whole system is contrary to the spirit and doctrine of the - Gospel of Jesus Christ. The Gospel requires us to help the weak, - but the Kanaka is fleeced and trodden down. - - "7. The bed-rock of this Traffic is that the life and liberty of a - black man are of less value than those of a white man. And a - Traffic that has grown out of 'slave-hunting' will certainly remain - to the end not unlike its origin." - - - - -CHAPTER VII. - -Truth is the most valuable thing we have. Let us economize it. - --Pudd'nhead Wilson's New Calendar. - -From Diary:--For a day or two we have been plowing among an invisible -vast wilderness of islands, catching now and then a shadowy glimpse of a -member of it. There does seem to be a prodigious lot of islands this -year; the map of this region is freckled and fly-specked all over with -them. Their number would seem to be uncountable. We are moving among -the Fijis now--224 islands and islets in the group. In front of us, to -the west, the wilderness stretches toward Australia, then curves upward -to New Guinea, and still up and up to Japan; behind us, to the east, the -wilderness stretches sixty degrees across the wastes of the Pacific; -south of us is New Zealand. Somewhere or other among these myriads Samoa -is concealed, and not discoverable on the map. Still, if you wish to go -there, you will have no trouble about finding it if you follow the -directions given by Robert Louis Stevenson to Dr. Conan Doyle and to Mr. -J. M. Barrie. "You go to America, cross the continent to San Francisco, -and then it's the second turning to the left." To get the full flavor of -the joke one must take a glance at the map. - -Wednesday, September 11.--Yesterday we passed close to an island or so, -and recognized the published Fiji characteristics: a broad belt of clean -white coral sand around the island; back of it a graceful fringe of -leaning palms, with native huts nestling cosily among the shrubbery at -their bases; back of these a stretch of level land clothed in tropic -vegetation; back of that, rugged and picturesque mountains. A detail -of the immediate foreground: a mouldering ship perched high up on a -reef-bench. This completes the composition, and makes the picture -artistically perfect. - -In the afternoon we sighted Suva, the capital of the group, and threaded -our way into the secluded little harbor--a placid basin of brilliant blue -and green water tucked snugly in among the sheltering hills. A few ships -rode at anchor in it--one of them a sailing vessel flying the American -flag; and they said she came from Duluth! There's a journey! Duluth is -several thousand miles from the sea, and yet she is entitled to the proud -name of Mistress of the Commercial Marine of the United States of -America. There is only one free, independent, unsubsidized American ship -sailing the foreign seas, and Duluth owns it. All by itself that ship is -the American fleet. All by itself it causes the American name and power -to be respected in the far regions of the globe. All by itself it -certifies to the world that the most populous civilized nation, in the -earth has a just pride in her stupendous stretch of sea-front, and is -determined to assert and maintain her rightful place as one of the Great -Maritime Powers of the Planet. All by itself it is making foreign eyes -familiar with a Flag which they have not seen before for forty years, -outside of the museum. For what Duluth has done, in building, equipping, -and maintaining at her sole expense the American Foreign Commercial -Fleet, and in thus rescuing the American name from shame and lifting it -high for the homage of the nations, we owe her a debt of gratitude which -our hearts shall confess with quickened beats whenever her name is named -henceforth. Many national toasts will die in the lapse of time, but -while the flag flies and the Republic survives, they who live under their -shelter will still drink this one, standing and uncovered: Health and -prosperity to Thee, O Duluth, American Queen of the Alien Seas! - -Row-boats began to flock from the shore; their crews were the first -natives we had seen. These men carried no overplus of clothing, and this -was wise, for the weather was hot. Handsome, great dusky men they were, -muscular, clean-limbed, and with faces full of character and -intelligence. It would be hard to find their superiors anywhere among -the dark races, I should think. - -Everybody went ashore to look around, and spy out the land, and have that -luxury of luxuries to sea-voyagers--a land-dinner. And there we saw more -natives: Wrinkled old women, with their flat mammals flung over their -shoulders, or hanging down in front like the cold-weather drip from the -molasses-faucet; plump and smily young girls, blithe and content, easy -and graceful, a pleasure to look at; young matrons, tall, straight, -comely, nobly built, sweeping by with chin up, and a gait incomparable -for unconscious stateliness and dignity; majestic young men athletes for -build and muscle clothed in a loose arrangement of dazzling white, with -bronze breast and bronze legs naked, and the head a cannon-swab of solid -hair combed straight out from the skull and dyed a rich brick-red. Only -sixty years ago they were sunk in darkness; now they have the bicycle. -We strolled about the streets of the white folks' little town, and around -over the hills by paths and roads among European dwellings and gardens -and plantations, and past clumps of hibiscus that made a body blink, the -great blossoms were so intensely red; and by and by we stopped to ask an -elderly English colonist a question or two, and to sympathize with him -concerning the torrid weather; but he was surprised, and said: - -"This? This is not hot. You ought to be here in the summer time once." - -"We supposed that this was summer; it has the ear-marks of it. You could -take it to almost any country and deceive people with it. But if it -isn't summer, what does it lack?" - -"It lacks half a year. This is mid-winter." - -I had been suffering from colds for several months, and a sudden change -of season, like this, could hardly fail to do me hurt. It brought on -another cold. It is odd, these sudden jumps from season to season. A -fortnight ago we left America in mid-summer, now it is midwinter; about a -week hence we shall arrive in Australia in the spring. - -After dinner I found in the billiard-room a resident whom I had known -somewhere else in the world, and presently made, some new friends and -drove with them out into the country to visit his Excellency the head of -the State, who was occupying his country residence, to escape the rigors -of the winter weather, I suppose, for it was on breezy high ground and -much more comfortable than the lower regions, where the town is, and -where the winter has full swing, and often sets a person's hair afire -when he takes off his hat to bow. There is a noble and beautiful view of -ocean and islands and castellated peaks from the governor's high-placed -house, and its immediate surroundings lie drowsing in that dreamy repose -and serenity which are the charm of life in the Pacific Islands. - -One of the new friends who went out there with me was a large man, and I -had been admiring his size all the way. I was still admiring it as he -stood by the governor on the veranda, talking; then the Fijian butler -stepped out there to announce tea, and dwarfed him. Maybe he did not -quite dwarf him, but at any rate the contrast was quite striking. -Perhaps that dark giant was a king in a condition of political -suspension. I think that in the talk there on the veranda it was said -that in Fiji, as in the Sandwich Islands, native kings and chiefs are of -much grander size and build than the commoners. This man was clothed in -flowing white vestments, and they were just the thing for him; they -comported well with his great stature and his kingly port and dignity. -European clothes would have degraded him and made him commonplace. I -know that, because they do that with everybody that wears them. - -It was said that the old-time devotion to chiefs and reverence for their -persons still survive in the native commoner, and in great force. The -educated young gentleman who is chief of the tribe that live in the -region about the capital dresses in the fashion of high-class European -gentlemen, but even his clothes cannot damn him in the reverence of his -people. Their pride in his lofty rank and ancient lineage lives on, in -spite of his lost authority and the evil magic of his tailor. He has no -need to defile himself with work, or trouble his heart with the sordid -cares of life; the tribe will see to it that he shall not want, and that -he shall hold up his head and live like a gentleman. I had a glimpse of -him down in the town. Perhaps he is a descendant of the last king--the -king with the difficult name whose memory is preserved by a notable -monument of cut-stone which one sees in the enclosure in the middle of -the town. Thakombau--I remember, now; that is the name. It is easier to -preserve it on a granite block than in your head. - -Fiji was ceded to England by this king in 1858. One of the gentlemen -present at the governor's quoted a remark made by the king at the time of -the session--a neat retort, and with a touch of pathos in it, too. The -English Commissioner had offered a crumb of comfort to Thakombau by -saying that the transfer of the kingdom to Great Britain was merely "a -sort of hermit-crab formality, you know." "Yes," said poor Thakombau, -"but with this difference--the crab moves into an unoccupied shell, but -mine isn't." - -However, as far as I can make out from the books, the King was between -the devil and the deep sea at the time, and hadn't much choice. He owed -the United States a large debt--a debt which he could pay if allowed -time, but time was denied him. He must pay up right away or the warships -would be upon him. To protect his people from this disaster he ceded his -country to Britain, with a clause in the contract providing for the -ultimate payment of the American debt. - -In old times the Fijians were fierce fighters; they were very religious, -and worshiped idols; the big chiefs were proud and haughty, and they were -men of great style in many ways; all chiefs had several wives, the -biggest chiefs sometimes had as many as fifty; when a chief was dead and -ready for burial, four or five of his wives were strangled and put into -the grave with him. In 1804 twenty-seven British convicts escaped from -Australia to Fiji, and brought guns and ammunition with them. Consider -what a power they were, armed like that, and what an opportunity they -had. If they had been energetic men and sober, and had had brains and -known how to use them, they could have achieved the sovereignty of the -archipelago twenty-seven kings and each with eight or nine islands under -his scepter. But nothing came of this chance. They lived worthless -lives of sin and luxury, and died without honor--in most cases by -violence. Only one of them had any ambition; he was an Irishman named -Connor. He tried to raise a family of fifty children, and scored -forty-eight. He died lamenting his failure. It was a foolish sort -of avarice. Many a father would have been rich enough with forty. - -It is a fine race, the Fijians, with brains in their heads, and an -inquiring turn of mind. It appears that their savage ancestors had a -doctrine of immortality in their scheme of religion--with limitations. -That is to say, their dead friend would go to a happy hereafter if he -could be accumulated, but not otherwise. They drew the line; they -thought that the missionary's doctrine was too sweeping, too -comprehensive. They called his attention to certain facts. For -instance, many of their friends had been devoured by sharks; the sharks, -in their turn, were caught and eaten by other men; later, these men were -captured in war, and eaten by the enemy. The original persons had -entered into the composition of the sharks; next, they and the sharks had -become part of the flesh and blood and bone of the cannibals. How, then, -could the particles of the original men be searched out from the final -conglomerate and put together again? The inquirers were full of doubts, -and considered that the missionary had not examined the matter with--the -gravity and attention which so serious a thing deserved. - -The missionary taught these exacting savages many valuable things, and -got from them one--a very dainty and poetical idea: Those wild and -ignorant poor children of Nature believed that the flowers, after they -perish, rise on the winds and float away to the fair fields of heaven, -and flourish there forever in immortal beauty! - - - - -CHAPTER VIII. - -It could probably be shown by facts and figures that there is no -distinctly native American criminal class except Congress. - --Pudd'nhead Wilson's New Calendar. - -When one glances at the map the members of the stupendous island -wilderness of the Pacific seem to crowd upon each other; but no, there is -no crowding, even in the center of a group; and between groups there are -lonely wide deserts of sea. Not everything is known about the islands, -their peoples and their languages. A startling reminder of this is -furnished by the fact that in Fiji, twenty years ago, were living two -strange and solitary beings who came from an unknown country and spoke an -unknown language. "They were picked up by a passing vessel many hundreds -of miles from any known land, floating in the same tiny canoe in which -they had been blown out to sea. When found they were but skin and bone. -No one could understand what they said, and they have never named their -country; or, if they have, the name does not correspond with that of any -island on any chart. They are now fat and sleek, and as happy as the day -is long. In the ship's log there is an entry of the latitude and -longitude in which they were found, and this is probably all the clue -they will ever have to their lost homes."--[Forbes's "Two Years in -Fiji."] - -What a strange and romantic episode it is; and how one is tortured with -curiosity to know whence those mysterious creatures came, those Men -Without a Country, errant waifs who cannot name their lost home, -wandering Children of Nowhere. - -Indeed, the Island Wilderness is the very home of romance and dreams and -mystery. The loneliness, the solemnity, the beauty, and the deep repose -of this wilderness have a charm which is all their own for the bruised -spirit of men who have fought and failed in the struggle for life in the -great world; and for men who have been hunted out of the great world for -crime; and for other men who love an easy and indolent existence; and for -others who love a roving free life, and stir and change and adventure; -and for yet others who love an easy and comfortable career of trading and -money-getting, mixed with plenty of loose matrimony by purchase, divorce -without trial or expense, and limitless spreeing thrown in to make life -ideally perfect. - -We sailed again, refreshed. - -The most cultivated person in the ship was a young English, man whose -home was in New Zealand. He was a naturalist. His learning in his -specialty was deep and thorough, his interest in his subject amounted to -a passion, he had an easy gift of speech; and so, when he talked about -animals it was a pleasure to listen to him. And profitable, too, though -he was sometimes difficult to understand because now and then he used -scientific technicalities which were above the reach of some of us. They -were pretty sure to be above my reach, but as he was quite willing to -explain them I always made it a point to get him to do it. I had a fair -knowledge of his subject--layman's knowledge--to begin with, but it was -his teachings which crystalized it into scientific form and clarity--in a -word, gave it value. - -His special interest was the fauna of Australasia, and his knowledge of -the matter was as exhaustive as it was accurate. I already knew a good -deal about the rabbits in Australasia and their marvelous fecundity, but -in my talks with him I found that my estimate of the great hindrance and -obstruction inflicted by the rabbit pest upon traffic and travel was far -short of the facts. He told me that the first pair of rabbits imported -into Australasia bred so wonderfully that within six months rabbits were -so thick in the land that people had to dig trenches through them to get -from town to town. - -He told me a great deal about worms, and the kangaroo, and other -coleoptera, and said he knew the history and ways of all such -pachydermata. He said the kangaroo had pockets, and carried its young in -them when it couldn't get apples. And he said that the emu was as big as -an ostrich, and looked like one, and had an amorphous appetite and would -eat bricks. Also, that the dingo was not a dingo at all, but just a wild -dog; and that the only difference between a dingo and a dodo was that -neither of them barked; otherwise they were just the same. He said that -the only game-bird in Australia was the wombat, and the only song-bird -the larrikin, and that both were protected by government. The most -beautiful of the native birds was the bird of Paradise. Next came the -two kinds of lyres; not spelt the same. He said the one kind was dying -out, the other thickening up. He explained that the "Sundowner" was not -a bird it was a man; sundowner was merely the Australian equivalent of -our word, tramp. He is a loafer, a hard drinker, and a sponge. He -tramps across the country in the sheep-shearing season, pretending to -look for work; but he always times himself to arrive at a sheep-run just -at sundown, when the day's labor ends; all he wants is whisky and supper -and bed and breakfast; he gets them and then disappears. The naturalist -spoke of the bell bird, the creature that at short intervals all day -rings out its mellow and exquisite peal from the deeps of the forest. It -is the favorite and best friend of the weary and thirsty sundowner; for -he knows that wherever the bell bird is, there is water; and he goes -somewhere else. The naturalist said that the oddest bird in Australasia -was the, Laughing Jackass, and the biggest the now extinct Great Moa. - -The Moa stood thirteen feet high, and could step over an ordinary man's -head or kick his hat off; and his head, too, for that matter. He said it -was wingless, but a swift runner. The natives used to ride it. It could -make forty miles an hour, and keep it up for four hundred miles and come -out reasonably fresh. It was still in existence when the railway was -introduced into New Zealand; still in existence, and carrying the mails. -The railroad began with the same schedule it has now: two expresses a -week-time, twenty miles an hour. The company exterminated the moa to get -the mails. - -Speaking of the indigenous coneys and bactrian camels, the naturalist -said that the coniferous and bacteriological output of Australasia was -remarkable for its many and curious departures from the accepted laws -governing these species of tubercles, but that in his opinion Nature's -fondness for dabbling in the erratic was most notably exhibited in that -curious combination of bird, fish, amphibian, burrower, crawler, -quadruped, and Christian called the Ornithorhynchus--grotesquest of -animals, king of the animalculae of the world for versatility of -character and make-up. Said he: - - "You can call it anything you want to, and be right. It is a fish, - for it lives in the river half the time; it is a land animal, for it - resides on the land half the time; it is an amphibian, since it - likes both and does not know which it prefers; it is a hybernian, - for when times are dull and nothing much going on it buries itself - under the mud at the bottom of a puddle and hybernates there a - couple of weeks at a time; it is a kind of duck, for it has a - duck-bill and four webbed paddles; it is a fish and quadruped - together, for in the water it swims with the paddles and on shore it - paws itself across country with them; it is a kind of seal, for it - has a seal's fur; it is carnivorous, herbivorous, insectivorous, and - vermifuginous, for it eats fish and grass and butterflies, and in - the season digs worms out of the mud and devours them; it is clearly - a bird, for it lays eggs, and hatches them; it is clearly a mammal, - for it nurses its young; and it is manifestly a kind of Christian, - for it keeps the Sabbath when there is anybody around, and when - there isn't, doesn't. It has all the tastes there are except - refined ones, it has all the habits there are except good ones. - - "It is a survival--a survival of the fittest. Mr. Darwin invented - the theory that goes by that name, but the Ornithorhynchus was the - first to put it to actual experiment and prove that it could be - done. Hence it should have as much of the credit as Mr. Darwin. - It was never in the Ark; you will find no mention of it there; it - nobly stayed out and worked the theory. Of all creatures in the - world it was the only one properly equipped for the test. The Ark - was thirteen months afloat, and all the globe submerged; no land - visible above the flood, no vegetation, no food for a mammal to eat, - nor water for a mammal to drink; for all mammal food was destroyed, - and when the pure floods from heaven and the salt oceans of the - earth mingled their waters and rose above the mountain tops, the - result was a drink which no bird or beast of ordinary construction - could use and live. But this combination was nuts for the - Ornithorhynchus, if I may use a term like that without offense. - Its river home had always been salted by the flood-tides of the sea. - On the face of the Noachian deluge innumerable forest trees were - floating. Upon these the Ornithorhynchus voyaged in peace; voyaged - from clime to clime, from hemisphere to hemisphere, in contentment - and comfort, in virile interest in the constant change Of scene, in - humble thankfulness for its privileges, in ever-increasing - enthusiasm in the development of the great theory upon whose - validity it had staked its life, its fortunes, and its sacred honor, - if I may use such expressions without impropriety in connection with - an episode of this nature. - - "It lived the tranquil and luxurious life of a creature of - independent means. Of things actually necessary to its existence - and its happiness not a detail was wanting. When it wished to walk, - it scrambled along the tree-trunk; it mused in the shade of the - leaves by day, it slept in their shelter by night; when it wanted - the refreshment of a swim, it had it; it ate leaves when it wanted a - vegetable diet, it dug under the bark for worms and grubs; when it - wanted fish it caught them, when it wanted eggs it laid them. If - the grubs gave out in one tree it swam to another; and as for fish, - the very opulence of the supply was an embarrassment. And finally, - when it was thirsty it smacked its chops in gratitude over a blend - that would have slain a crocodile. - - "When at last, after thirteen months of travel and research in all - the Zones it went aground on a mountain-summit, it strode ashore, - saying in its heart, 'Let them that come after me invent theories - and dream dreams about the Survival of the Fittest if they like, but - I am the first that has done it! - - "This wonderful creature dates back like the kangaroo and many other - Australian hydrocephalous invertebrates, to an age long anterior to - the advent of man upon the earth; they date back, indeed, to a time - when a causeway hundreds of miles wide, and thousands of miles long, - joined Australia to Africa, and the animals of the two countries - were alike, and all belonged to that remote geological epoch known - to science as the Old Red Grindstone Post-Pleosaurian. Later the - causeway sank under the sea; subterranean convulsions lifted the - African continent a thousand feet higher than it was before, but - Australia kept her old level. In Africa's new climate the animals - necessarily began to develop and shade off into new forms and - families and species, but the animals of Australia as necessarily - remained stationary, and have so remained until this day. In the - course of some millions of years the African Ornithorhynchus - developed and developed and developed, and sluffed off detail after - detail of its make-up until at last the creature became wholly - disintegrated and scattered. Whenever you see a bird or a beast or - a seal or an otter in Africa you know that he is merely a sorry - surviving fragment of that sublime original of whom I have been - speaking--that creature which was everything in general and nothing - in particular--the opulently endowed 'e pluribus unum' of the animal - world. - - "Such is the history of the most hoary, the most ancient, the most - venerable creature that exists in the earth today--Ornithorhynchus - Platypus Extraordinariensis--whom God preserve!" - -When he was strongly moved he could rise and soar like that with ease. -And not only in the prose form, but in the poetical as well. He had -written many pieces of poetry in his time, and these manuscripts he lent -around among the passengers, and was willing to let them be copied. It -seemed to me that the least technical one in the series, and the one -which reached the loftiest note, perhaps, was his: - - INVOCATION. - - "Come forth from thy oozy couch, - O Ornithorhynchus dear! - And greet with a cordial claw - The stranger that longs to hear - - "From thy own own lips the tale - Of thy origin all unknown: - Thy misplaced bone where flesh should be - And flesh where should be bone; - - "And fishy fin where should be paw, - And beaver-trowel tail, - And snout of beast equip'd with teeth - Where gills ought to prevail. - - "Come, Kangaroo, the good and true - Foreshortened as to legs, - And body tapered like a churn, - And sack marsupial, i' fegs, - - "And tells us why you linger here, - Thou relic of a vanished time, - When all your friends as fossils sleep, - Immortalized in lime!" - - -Perhaps no poet is a conscious plagiarist; but there seems to be warrant -for suspecting that there is no poet who is not at one time or another an -unconscious one. The above verses are indeed beautiful, and, in a way, -touching; but there is a haunting something about them which unavoidably -suggests the Sweet Singer of Michigan. It can hardly be doubted that the -author had read the works of that poet and been impressed by them. It is -not apparent that he has borrowed from them any word or yet any phrase, -but the style and swing and mastery and melody of the Sweet Singer all -are there. Compare this Invocation with "Frank Dutton"--particularly -stanzas first and seventeenth--and I think the reader will feel convinced -that he who wrote the one had read the other: - - I. - - "Frank Dutton was as fine a lad - As ever you wish to see, - And he was drowned in Pine Island Lake - On earth no more will he be, - His age was near fifteen years, - And he was a motherless boy, - He was living with his grandmother - When he was drowned, poor boy." - - - XVII. - - "He was drowned on Tuesday afternoon, - On Sunday he was found, - And the tidings of that drowned boy - Was heard for miles around. - His form was laid by his mother's side, - Beneath the cold, cold ground, - His friends for him will drop a tear - When they view his little mound." - - The Sentimental Song Book. By Mrs. Julia Moore, p. 36. - - - - -CHAPTER IX. - -It is your human environment that makes climate. - --Pudd'nhead Wilson's New Calendar. - -Sept. 15--Night. Close to Australia now. Sydney 50 miles distant. - -That note recalls an experience. The passengers were sent for, to come -up in the bow and see a fine sight. It was very dark. One could not -follow with the eye the surface of the sea more than fifty yards in any -direction it dimmed away and became lost to sight at about that distance -from us. But if you patiently gazed into the darkness a little while, -there was a sure reward for you. Presently, a quarter of a mile away you -would see a blinding splash or explosion of light on the water--a flash -so sudden and so astonishingly brilliant that it would make you catch -your breath; then that blotch of light would instantly extend itself and -take the corkscrew shape and imposing length of the fabled sea-serpent, -with every curve of its body and the "break" spreading away from its -head, and the wake following behind its tail clothed in a fierce splendor -of living fire. And my, but it was coming at a lightning gait! Almost -before you could think, this monster of light, fifty feet long, would go -flaming and storming by, and suddenly disappear. And out in the distance -whence he came you would see another flash; and another and another and -another, and see them turn into sea-serpents on the instant; and once -sixteen flashed up at the same time and came tearing towards us, a swarm -of wiggling curves, a moving conflagration, a vision of bewildering -beauty, a spectacle of fire and energy whose equal the most of those -people will not see again until after they are dead. - -It was porpoises--porpoises aglow with phosphorescent light. They -presently collected in a wild and magnificent jumble under the bows, and -there they played for an hour, leaping and frollicking and carrying on, -turning summersaults in front of the stem or across it and never getting -hit, never making a miscalculation, though the stem missed them only -about an inch, as a rule. They were porpoises of the ordinary length ---eight or ten feet--but every twist of their bodies sent a long -procession of united and glowing curves astern. That fiery jumble was -an enchanting thing to look at, and we stayed out the performance; one -cannot have such a show as that twice in a lifetime. The porpoise is the -kitten of the sea; he never has a serious thought, he cares for nothing -but fun and play. But I think I never saw him at his winsomest until -that night. It was near a center of civilization, and he could have been -drinking. - -By and by, when we had approached to somewhere within thirty miles of -Sydney Heads the great electric light that is posted on one of those -lofty ramparts began to show, and in time the little spark grew to a -great sun and pierced the firmament of darkness with a far-reaching sword -of light. - -Sydney Harbor is shut in behind a precipice that extends some miles like -a wall, and exhibits no break to the ignorant stranger. It has a break -in the middle, but it makes so little show that even Captain Cook sailed -by it without seeing it. Near by that break is a false break which -resembles it, and which used to make trouble for the mariner at night, in -the early days before the place was lighted. It caused the memorable -disaster to the Duncan Dunbar, one of the most pathetic tragedies in the -history of that pitiless ruffian, the sea. The ship was a sailing -vessel; a fine and favorite passenger packet, commanded by a popular -captain of high reputation. She was due from England, and Sydney was -waiting, and counting the hours; counting the hours, and making ready to -give her a heart-stirring welcome; for she was bringing back a great -company of mothers and daughters, the long-missed light and bloom of life -of Sydney homes; daughters that had been years absent at school, and -mothers that had been with them all that time watching over them. Of all -the world only India and Australasia have by custom freighted ships and -fleets with their hearts, and know the tremendous meaning of that phrase; -only they know what the waiting is like when this freightage is entrusted -to the fickle winds, not steam, and what the joy is like when the ship -that is returning this treasure comes safe to port and the long dread is -over. - -On board the Duncan Dunbar, flying toward Sydney Heads in the waning -afternoon, the happy home-comers made busy preparation, for it was not -doubted that they would be in the arms of their friends before the day -was done; they put away their sea-going clothes and put on clothes meeter -for the meeting, their richest and their loveliest, these poor brides of -the grave. But the wind lost force, or there was a miscalculation, and -before the Heads were sighted the darkness came on. It was said that -ordinarily the captain would have made a safe offing and waited for the -morning; but this was no ordinary occasion; all about him were appealing -faces, faces pathetic with disappointment. So his sympathy moved him to -try the dangerous passage in the dark. He had entered the Heads -seventeen times, and believed he knew the ground. So he steered straight -for the false opening, mistaking it for the true one. He did not find -out that he was wrong until it was too late. There was no saving the -ship. The great seas swept her in and crushed her to splinters and -rubbish upon the rock tushes at the base of the precipice. Not one of -all that fair and gracious company was ever seen again alive. The tale -is told to every stranger that passes the spot, and it will continue to -be told to all that come, for generations; but it will never grow old, -custom cannot stale it, the heart-break that is in it can never perish -out of it. - -There were two hundred persons in the ship, and but one survived the -disaster. He was a sailor. A huge sea flung him up the face of the -precipice and stretched him on a narrow shelf of rock midway between the -top and the bottom, and there he lay all night. At any other time he -would have lain there for the rest of his life, without chance of -discovery; but the next morning the ghastly news swept through Sydney -that the Duncan Dunbar had gone down in sight of home, and straightway -the walls of the Heads were black with mourners; and one of these, -stretching himself out over the precipice to spy out what might be seen -below, discovered this miraculously preserved relic of the wreck. Ropes -were brought and the nearly impossible feat of rescuing the man was -accomplished. He was a person with a practical turn of mind, and he -hired a hall in Sydney and exhibited himself at sixpence a head till he -exhausted the output of the gold fields for that year. - -We entered and cast anchor, and in the morning went oh-ing and ah-ing in -admiration up through the crooks and turns of the spacious and beautiful -harbor--a harbor which is the darling of Sydney and the wonder of the -world. It is not surprising that the people are proud of it, nor that -they put their enthusiasm into eloquent words. A returning citizen asked -me what I thought of it, and I testified with a cordiality which I judged -would be up to the market rate. I said it was beautiful--superbly -beautiful. Then by a natural impulse I gave God the praise. The citizen -did not seem altogether satisfied. He said: - -"It is beautiful, of course it's beautiful--the Harbor; but that isn't -all of it, it's only half of it; Sydney's the other half, and it takes -both of them together to ring the supremacy-bell. God made the Harbor, -and that's all right; but Satan made Sydney." - -Of course I made an apology; and asked him to convey it to his friend. -He was right about Sydney being half of it. It would be beautiful -without Sydney, but not above half as beautiful as it is now, with Sydney -added. It is shaped somewhat like an oak-leaf-a roomy sheet of lovely -blue water, with narrow off-shoots of water running up into the country -on both sides between long fingers of land, high wooden ridges with sides -sloped like graves. Handsome villas are perched here and there on these -ridges, snuggling amongst the foliage, and one catches alluring glimpses -of them as the ship swims by toward the city. The city clothes a cluster -of hills and a ruffle of neighboring ridges with its undulating masses of -masonry, and out of these masses spring towers and spires and other -architectural dignities and grandeurs that break the flowing lines and -give picturesqueness to the general effect. - -The narrow inlets which I have mentioned go wandering out into the land -everywhere and hiding themselves in it, and pleasure-launches are always -exploring them with picnic parties on board. It is said by trustworthy -people that if you explore them all you will find that you have covered -700 miles of water passage. But there are liars everywhere this year, -and they will double that when their works are in good going order. -October was close at hand, spring was come. It was really spring ---everybody said so; but you could have sold it for summer in Canada, and -nobody would have suspected. It was the very weather that makes our home -summers the perfection of climatic luxury; I mean, when you are out in -the wood or by the sea. But these people said it was cool, now--a person -ought to see Sydney in the summer time if he wanted to know what warm -weather is; and he ought to go north ten or fifteen hundred miles if he -wanted to know what hot weather is. They said that away up there toward -the equator the hens laid fried eggs. Sydney is the place to go to get -information about other people's climates. It seems to me that the -occupation of Unbiased Traveler Seeking Information is the pleasantest -and most irresponsible trade there is. The traveler can always find out -anything he wants to, merely by asking. He can get at all the facts, and -more. Everybody helps him, nobody hinders him. Anybody who has an old -fact in stock that is no longer negotiable in the domestic market will -let him have it at his own price. An accumulation of such goods is -easily and quickly made. They cost almost nothing and they bring par in -the foreign market. Travelers who come to America always freight up with -the same old nursery tales that their predecessors selected, and they -carry them back and always work them off without any trouble in the home -market. - -If the climates of the world were determined by parallels of latitude, -then we could know a place's climate by its position on the map; and so -we should know that the climate of Sydney was the counterpart of the -climate of Columbia, S. C., and of Little Rock, Arkansas, since Sydney is -about the same distance south of the equator that those other towns are -north of-it-thirty-four degrees. But no, climate disregards the -parallels of latitude. In Arkansas they have a winter; in Sydney they -have the name of it, but not the thing itself. I have seen the ice in -the Mississippi floating past the mouth of the Arkansas river; and at -Memphis, but a little way above, the Mississippi has been frozen over, -from bank to bank. But they have never had a cold spell in Sydney which -brought the mercury down to freezing point. Once in a mid-winter day -there, in the month of July, the mercury went down to 36 deg., and that -remains the memorable "cold day" in the history of the town. No doubt -Little Rock has seen it below zero. Once, in Sydney, in mid-summer, -about New Year's Day, the mercury went up to 106 deg. in the shade, and -that is Sydney's memorable hot day. That would about tally with Little -Rock's hottest day also, I imagine. My Sydney figures are taken from a -government report, and are trustworthy. In the matter of summer weather -Arkansas has no advantage over Sydney, perhaps, but when it comes to -winter weather, that is another affair. You could cut up an Arkansas -winter into a hundred Sydney winters and have enough left for Arkansas -and the poor. - -The whole narrow, hilly belt of the Pacific side of New South Wales has -the climate of its capital--a mean winter temperature of 54 deg. and a -mean summer one of 71 deg. It is a climate which cannot be improved upon -for healthfulness. But the experts say that 90 deg. in New South Wales -is harder to bear than 112 deg. in the neighboring colony of Victoria, -because the atmosphere of the former is humid, and of the latter dry. -The mean temperature of the southernmost point of New South Wales is the -same as that of Nice--60 deg.--yet Nice is further from the equator by -460 miles than is the former. - -But Nature is always stingy of perfect climates; stingier in the case of -Australia than usual. Apparently this vast continent has a really good -climate nowhere but around the edges. - -If we look at a map of the world we are surprised to see how big -Australia is. It is about two-thirds as large as the United States was -before we added Alaska. - -But where as one finds a sufficiently good climate and fertile land -almost everywhere in the United States, it seems settled that inside of -the Australian border-belt one finds many deserts and in spots a climate -which nothing can stand except a few of the hardier kinds of rocks. In -effect, Australia is as yet unoccupied. If you take a map of the United -States and leave the Atlantic sea-board States in their places; also the -fringe of Southern States from Florida west to the Mouth of the -Mississippi; also a narrow, inhabited streak up the Mississippi half-way -to its head waters; also a narrow, inhabited border along the Pacific -coast: then take a brushful of paint and obliterate the whole remaining -mighty stretch of country that lies between the Atlantic States and the -Pacific-coast strip, your map will look like the latest map of Australia. - -This stupendous blank is hot, not to say torrid; a part of it is fertile, -the rest is desert; it is not liberally watered; it has no towns. One -has only to cross the mountains of New South Wales and descend into the -westward-lying regions to find that he has left the choice climate behind -him, and found a new one of a quite different character. In fact, he -would not know by the thermometer that he was not in the blistering -Plains of India. Captain Sturt, the great explorer, gives us a sample of -the heat. - - "The wind, which had been blowing all the morning from the N.E., - increased to a heavy gale, and I shall never forget its withering - effect. I sought shelter behind a large gum-tree, but the blasts of - heat were so terrific that I wondered the very grass did not take - fire. This really was nothing ideal: everything both animate and - inanimate gave way before it; the horses stood with their backs to - the wind and their noses to the ground, without the muscular - strength to raise their heads; the birds were mute, and the leaves - of the trees under which we were sitting fell like a snow shower - around us. At noon I took a thermometer graded to 127 deg., out of - my box, and observed that the mercury was up to 125. Thinking that - it had been unduly influenced, I put it in the fork of a tree close - to me, sheltered alike from the wind and the sun. I went to examine - it about an hour afterwards, when I found the mercury had risen to - the-top of the instrument and had burst the bulb, a circumstance - that I believe no traveler has ever before had to record. I cannot - find language to convey to the reader's mind an idea of the intense - and oppressive nature of the heat that prevailed." - -That hot wind sweeps over Sydney sometimes, and brings with it what is -called a "dust-storm." It is said that most Australian towns are -acquainted with the dust-storm. I think I know what it is like, for the -following description by Mr. Gape tallies very well with the alkali -duststorm of Nevada, if you leave out the "shovel" part. Still the -shovel part is a pretty important part, and seems to indicate that my -Nevada storm is but a poor thing, after all. - - "As we proceeded the altitude became less, and the heat - proportionately greater until we reached Dubbo, which is only 600 - feet above sea-level. It is a pretty town, built on an extensive - plain . . . . After the effects of a shower of rain have passed - away the surface of the ground crumbles into a thick layer of dust, - and occasionally, when the wind is in a particular quarter, it is - lifted bodily from the ground in one long opaque cloud. In the - midst of such a storm nothing can be seen a few yards ahead, and the - unlucky person who happens to be out at the time is compelled to - seek the nearest retreat at hand. When the thrifty housewife sees - in the distance the dark column advancing in a steady whirl towards - her house, she closes the doors and windows with all expedition. A - drawing-room, the window of which has been carelessly left open - during a dust-storm, is indeed an extraordinary sight. A lady who - has resided in Dubbo for some years says that the dust lies so thick - on the carpet that it is necessary to use a shovel to remove it." - -And probably a wagon. I was mistaken; I have not seen a proper -duststorm. To my mind the exterior aspects and character of Australia -are fascinating things to look at and think about, they are so strange, -so weird, so new, so uncommonplace, such a startling and interesting -contrast to the other sections of the planet, the sections that are known -to us all, familiar to us all. In the matter of particulars--a detail -here, a detail there--we have had the choice climate of New South Wales' -seacoast; we have had the Australian heat as furnished by Captain Sturt; -we have had the wonderful dust-storm; and we have considered the -phenomenon of an almost empty hot wilderness half as big as the United -States, with a narrow belt of civilization, population, and good climate -around it. - - - - -CHAPTER X. - -Everything human is pathetic. The secret source of Humor itself is not -joy but sorrow. There is no humor in heaven. - --Pudd'nhead Wilson's New Calendar. - -Captain Cook found Australia in 1770, and eighteen years later the -British Government began to transport convicts to it. Altogether, New -South Wales received 83,000 in 53 years. The convicts wore heavy chains; -they were ill-fed and badly treated by the officers set over them; they -were heavily punished for even slight infractions of the rules; "the -cruelest discipline ever known" is one historian's description of their -life.--[The Story of Australasia. J. S. Laurie.] - -English law was hard-hearted in those days. For trifling offenses which -in our day would be punished by a small fine or a few days' confinement, -men, women, and boys were sent to this other end of the earth to serve -terms of seven and fourteen years; and for serious crimes they were -transported for life. Children were sent to the penal colonies for seven -years for stealing a rabbit! - -When I was in London twenty-three years ago there was a new penalty in -force for diminishing garroting and wife-beating--25 lashes on the bare -back with the cat-o'-nine-tails. It was said that this terrible -punishment was able to bring the stubbornest ruffians to terms; and that -no man had been found with grit enough to keep his emotions to himself -beyond the ninth blow; as a rule the man shrieked earlier. That penalty -had a great and wholesome effect upon the garroters and wife-beaters; but -humane modern London could not endure it; it got its law rescinded. Many -a bruised and battered English wife has since had occasion to deplore -that cruel achievement of sentimental "humanity." - -Twenty-five lashes! In Australia and Tasmania they gave a convict fifty -for almost any little offense; and sometimes a brutal officer would add -fifty, and then another fifty, and so on, as long as the sufferer could -endure the torture and live. In Tasmania I read the entry, in an old -manuscript official record, of a case where a convict was given three -hundred lashes--for stealing some silver spoons. And men got more than -that, sometimes. Who handled the cat? Often it was another convict; -sometimes it was the culprit's dearest comrade; and he had to lay on with -all his might; otherwise he would get a flogging himself for his mercy ---for he was under watch--and yet not do his friend any good: the friend -would be attended to by another hand and suffer no lack in the matter of -full punishment. - -The convict life in Tasmania was so unendurable, and suicide so difficult -to accomplish that once or twice despairing men got together and drew -straws to determine which of them should kill another of the group--this -murder to secure death to the perpetrator and to the witnesses of it by -the hand of the hangman! - -The incidents quoted above are mere hints, mere suggestions of what -convict life was like--they are but a couple of details tossed into view -out of a shoreless sea of such; or, to change the figure, they are but a -pair of flaming steeples photographed from a point which hides from sight -the burning city which stretches away from their bases on every hand. - -Some of the convicts--indeed, a good many of them--were very bad people, -even for that day; but the most of them were probably not noticeably -worse than the average of the people they left behind them at home. We -must believe this; we cannot avoid it. We are obliged to believe that a -nation that could look on, unmoved, and see starving or freezing women -hanged for stealing twenty-six cents' worth of bacon or rags, and boys -snatched from their mothers, and men from their families, and sent to the -other side of the world for long terms of years for similar trifling -offenses, was a nation to whom the term "civilized" could not in any -large way be applied. And we must also believe that a nation that knew, -during more than forty years, what was happening to those exiles and was -still content with it, was not advancing in any showy way toward a higher -grade of civilization. - -If we look into the characters and conduct of the officers and gentlemen -who had charge of the convicts and attended to their backs and stomachs, -we must grant again that as between the convict and his masters, and -between both and the nation at home, there was a quite noticeable -monotony of sameness. - -Four years had gone by, and many convicts had come. Respectable settlers -were beginning to arrive. These two classes of colonists had to be -protected, in case of trouble among themselves or with the natives. It -is proper to mention the natives, though they could hardly count they -were so scarce. At a time when they had not as yet begun to be much -disturbed--not as yet being in the way--it was estimated that in New -South Wales there was but one native to 45,000 acres of territory. - -People had to be protected. Officers of the regular army did not want -this service--away off there where neither honor nor distinction was to -be gained. So England recruited and officered a kind of militia force of -1,000 uniformed civilians called the "New South Wales Corps" and shipped -it. - -This was the worst blow of all. The colony fairly staggered under it. -The Corps was an object-lesson of the moral condition of England outside -of the jails. The colonists trembled. It was feared that next there -would be an importation of the nobility. - -In those early days the colony was non-supporting. All the necessaries -of life--food, clothing, and all--were sent out from England, and kept in -great government store-houses, and given to the convicts and sold to the -settlers--sold at a trifling advance upon cost. The Corps saw its -opportunity. Its officers went into commerce, and in a most lawless way. -They went to importing rum, and also to manufacturing it in private -stills, in defiance of the government's commands and protests. They -leagued themselves together and ruled the market; they boycotted the -government and the other dealers; they established a close monopoly and -kept it strictly in their own hands. When a vessel arrived with spirits, -they allowed nobody to buy but themselves, and they forced the owner to -sell to them at a price named by themselves--and it was always low -enough. They bought rum at an average of two dollars a gallon and sold -it at an average of ten. They made rum the currency of the country--for -there was little or no money--and they maintained their devastating hold -and kept the colony under their heel for eighteen or twenty years before -they were finally conquered and routed by the government. - -Meantime, they had spread intemperance everywhere. And they had squeezed -farm after farm out of the settlers hands for rum, and thus had -bountifully enriched themselves. When a farmer was caught in the last -agonies of thirst they took advantage of him and sweated him for a drink. -In one instance they sold a man a gallon of rum worth two dollars for a -piece of property which was sold some years later for $100,000. -When the colony was about eighteen or twenty years old it was discovered -that the land was specially fitted for the wool-culture. Prosperity -followed, commerce with the world began, by and by rich mines of the -noble metals were opened, immigrants flowed in, capital likewise. The -result is the great and wealthy and enlightened commonwealth of New South -Wales. - -It is a country that is rich in mines, wool ranches, trams, railways, -steamship lines, schools, newspapers, botanical gardens, art galleries, -libraries, museums, hospitals, learned societies; it is the hospitable -home of every species of culture and of every species of material -enterprise, and there is a, church at every man's door, and a race-track -over the way. - - - - -CHAPTER XI. - -We should be careful to get out of an experience only the wisdom that is -in it--and stop there; lest we be like the cat that sits down on a hot -stove-lid. She will never sit down on a hot stove-lid again--and that is -well; but also she will never sit down on a cold one any more. - --Pudd'nhead Wilson's New Calendar. - -All English-speaking colonies are made up of lavishly hospitable people, -and New South Wales and its capital are like the rest in this. The -English-speaking colony of the United States of America is always -called lavishly hospitable by the English traveler. As to the other -English-speaking colonies throughout the world from Canada all around, I -know by experience that the description fits them. I will not go more -particularly into this matter, for I find that when writers try to -distribute their gratitude here and there and yonder by detail they run -across difficulties and do some ungraceful stumbling. - -Mr. Gane ("New South Wales and Victoria in 1885 "), tried to distribute -his gratitude, and was not lucky: - - "The inhabitants of Sydney are renowned for their hospitality. The - treatment which we experienced at the hands of this generous-hearted - people will help more than anything else to make us recollect with - pleasure our stay amongst them. In the character of hosts and - hostesses they excel. The 'new chum' needs only the - acquaintanceship of one of their number, and he becomes at once the - happy recipient of numerous complimentary invitations and thoughtful - kindnesses. Of the towns it has been our good fortune to visit, - none have portrayed home so faithfully as Sydney." - -Nobody could say it finer than that. If he had put in his cork then, and -stayed away from Dubbo----but no; heedless man, he pulled it again. -Pulled it when he was away along in his book, and his memory of what he -had said about Sydney had grown dim: - - "We cannot quit the promising town of Dubbo without testifying, in - warm praise, to the kind-hearted and hospitable usages of its - inhabitants. Sydney, though well deserving the character it bears - of its kindly treatment of strangers, possesses a little formality - and reserve. In Dubbo, on the contrary, though the same congenial - manners prevail, there is a pleasing degree of respectful - familiarity which gives the town a homely comfort not often met with - elsewhere. In laying on one side our pen we feel contented in - having been able, though so late in this work, to bestow a - panegyric, however unpretentious, on a town which, though possessing - no picturesque natural surroundings, nor interesting architectural - productions, has yet a body of citizens whose hearts cannot but - obtain for their town a reputation for benevolence and - kind-heartedness." - -I wonder what soured him on Sydney. It seems strange that a pleasing -degree of three or four fingers of respectful familiarity should fill a -man up and give him the panegyrics so bad. For he has them, the worst -way--any one can see that. A man who is perfectly at himself does not -throw cold detraction at people's architectural productions and -picturesque surroundings, and let on that what he prefers is a Dubbonese -dust-storm and a pleasing degree of respectful familiarity, No, these are -old, old symptoms; and when they appear we know that the man has got the -panegyrics. - -Sydney has a population of 400,000. When a stranger from America steps -ashore there, the first thing that strikes him is that the place is eight -or nine times as large as he was expecting it to be; and the next thing -that strikes him is that it is an English city with American trimmings. -Later on, in Melbourne, he will find the American trimmings still more in -evidence; there, even the architecture will often suggest America; a -photograph of its stateliest business street might be passed upon him for -a picture of the finest street in a large American city. I was told that -the most of the fine residences were the city residences of squatters. -The name seemed out of focus somehow. When the explanation came, it -offered a new instance of the curious changes which words, as well as -animals, undergo through change of habitat and climate. With us, when -you speak of a squatter you are always supposed to be speaking of a poor -man, but in Australia when you speak of a squatter you are supposed to be -speaking of a millionaire; in America the word indicates the possessor of -a few acres and a doubtful title, in Australia it indicates a man whose -landfront is as long as a railroad, and whose title has been perfected in -one way or another; in America the word indicates a man who owns a dozen -head of live stock, in Australia a man who owns anywhere from fifty -thousand up to half a million head; in America the word indicates a man -who is obscure and not important, in Australia a man who is prominent and -of the first importance; in America you take off your hat to no squatter, -in Australia you do; in America if your uncle is a squatter you keep it -dark, in Australia you advertise it; in America if your friend is a -squatter nothing comes of it, but with a squatter for your friend in -Australia you may sup with kings if there are any around. - -In Australia it takes about two acres and a half of pastureland (some -people say twice as many), to support a sheep; and when the squatter has -half a million sheep his private domain is about as large as Rhode -Island, to speak in general terms. His annual wool crop may be worth a -quarter or a half million dollars. - -He will live in a palace in Melbourne or Sydney or some other of the -large cities, and make occasional trips to his sheep-kingdom several -hundred miles away in the great plains to look after his battalions of -riders and shepherds and other hands. He has a commodious dwelling out -there, and if he approve of you he will invite you to spend a week in it, -and will make you at home and comfortable, and let you see the great -industry in all its details, and feed you and slake you and smoke you -with the best that money can buy. - -On at least one of these vast estates there is a considerable town, with -all the various businesses and occupations that go to make an important -town; and the town and the land it stands upon are the property of the -squatters. I have seen that town, and it is not unlikely that there are -other squatter-owned towns in Australia. - -Australia supplies the world not only with fine wool, but with mutton -also. The modern invention of cold storage and its application in ships -has created this great trade. In Sydney I visited a huge establishment -where they kill and clean and solidly freeze a thousand sheep a day, for -shipment to England. - -The Australians did not seem to me to differ noticeably from Americans, -either in dress, carriage, ways, pronunciation, inflections, or general -appearance. There were fleeting and subtle suggestions of their English -origin, but these were not pronounced enough, as a rule, to catch one's -attention. The people have easy and cordial manners from the beginning ---from the moment that the introduction is completed. This is American. -To put it in another way, it is English friendliness with the English -shyness and self-consciousness left out. - -Now and then--but this is rare--one hears such words as piper for paper, -lydy for lady, and tyble for table fall from lips whence one would not -expect such pronunciations to come. There is a superstition prevalent in -Sydney that this pronunciation is an Australianism, but people who have -been "home"--as the native reverently and lovingly calls England--know -better. It is "costermonger." All over Australasia this pronunciation -is nearly as common among servants as it is in London among the -uneducated and the partially educated of all sorts and conditions of -people. That mislaid 'y' is rather striking when a person gets enough of -it into a short sentence to enable it to show up. In the hotel in Sydney -the chambermaid said, one morning: - -"The tyble is set, and here is the piper; and if the lydy is ready I'll -tell the wyter to bring up the breakfast." - -I have made passing mention, a moment ago, of the native Australasian's -custom of speaking of England as "home." It was always pretty to hear -it, and often it was said in an unconsciously caressing way that made it -touching; in a way which transmuted a sentiment into an embodiment, and -made one seem to see Australasia as a young girl stroking mother -England's old gray head. - -In the Australasian home the table-talk is vivacious and unembarrassed; -it is without stiffness or restraint. This does not remind one of -England so much as it does of America. But Australasia is strictly -democratic, and reserves and restraints are things that are bred by -differences of rank. - -English and colonial audiences are phenomenally alert and responsive. -Where masses of people are gathered together in England, caste is -submerged, and with it the English reserve; equality exists for the -moment, and every individual is free; so free from any consciousness of -fetters, indeed, that the Englishman's habit of watching himself and -guarding himself against any injudicious exposure of his feelings is -forgotten, and falls into abeyance--and to such a degree indeed, that he -will bravely applaud all by himself if he wants to--an exhibition of -daring which is unusual elsewhere in the world. - -But it is hard to move a new English acquaintance when he is by himself, -or when the company present is small and new to him. He is on his guard -then, and his natural reserve is to the fore. This has given him the -false reputation of being without humor and without the appreciation of -humor. - -Americans are not Englishmen, and American humor is not English humor; -but both the American and his humor had their origin in England, and have -merely undergone changes brought about by changed conditions and a new -environment. About the best humorous speeches I have yet heard were a -couple that were made in Australia at club suppers--one of them by an -Englishman, the other by an Australian. - - - - -CHAPTER XII. - -There are those who scoff at the schoolboy, calling him frivolous and -shallow: Yet it was the schoolboy who said "Faith is believing what you -know ain't so." - --Pudd'nhead Wilson's New Calendar. - -In Sydney I had a large dream, and in the course of talk I told it to a -missionary from India who was on his way to visit some relatives in New -Zealand. I dreamed that the visible universe is the physical person of -God; that the vast worlds that we see twinkling millions of miles apart -in the fields of space are the blood corpuscles in His veins; and that we -and the other creatures are the microbes that charge with multitudinous -life the corpuscles. - -Mr. X., the missionary, considered the dream awhile, then said: - - "It is not surpassable for magnitude, since its metes and bounds are - the metes and bounds of the universe itself; and it seems to me that - it almost accounts for a thing which is otherwise nearly - unaccountable--the origin of the sacred legends of the Hindoos. - Perhaps they dream them, and then honestly believe them to be divine - revelations of fact. It looks like that, for the legends are built - on so vast a scale that it does not seem reasonable that plodding - priests would happen upon such colossal fancies when awake." - -He told some of the legends, and said that they were implicitly believed -by all classes of Hindoos, including those of high social position and -intelligence; and he said that this universal credulity was a great -hindrance to the missionary in his work. Then he said something like -this: - - "At home, people wonder why Christianity does not make faster - progress in India. They hear that the Indians believe easily, and - that they have a natural trust in miracles and give them a - hospitable reception. Then they argue like this: since the Indian - believes easily, place Christianity before them and they must - believe; confirm its truths by the biblical miracles, and they will - no longer doubt, The natural deduction is, that as Christianity - makes but indifferent progress in India, the fault is with us: we - are not fortunate in presenting the doctrines and the miracles. - - "But the truth is, we are not by any means so well equipped as they - think. We have not the easy task that they imagine. To use a - military figure, we are sent against the enemy with good powder in - our guns, but only wads for bullets; that is to say, our miracles - are not effective; the Hindoos do not care for them; they have more - extraordinary ones of their own. All the details of their own - religion are proven and established by miracles; the details of ours - must be proven in the same way. When I first began my work in India - I greatly underestimated the difficulties thus put upon my task. A - correction was not long in coming. I thought as our friends think - at home--that to prepare my childlike wonder-lovers to listen with - favor to my grave message I only needed to charm the way to it with - wonders, marvels, miracles. With full confidence I told the wonders - performed by Samson, the strongest man that had ever lived--for so I - called him. - - "At first I saw lively anticipation and strong interest in the faces - of my people, but as I moved along from incident to incident of the - great story, I was distressed to see that I was steadily losing the - sympathy of my audience. I could not understand it. It was a - surprise to me, and a disappointment. Before I was through, the - fading sympathy had paled to indifference. Thence to the end the - indifference remained; I was not able to make any impression upon - it. - - "A good old Hindoo gentleman told me where my trouble lay. He said - 'We Hindoos recognize a god by the work of his hands--we accept no - other testimony. Apparently, this is also the rule with you - Christians. And we know when a man has his power from a god by the - fact that he does things which he could not do, as a man, with the - mere powers of a man. Plainly, this is the Christian's way also, of - knowing when a man is working by a god's power and not by his own. - You saw that there was a supernatural property in the hair of - Samson; for you perceived that when his hair was gone he was as - other men. It is our way, as I have said. There are many nations - in the world, and each group of nations has its own gods, and will - pay no worship to the gods of the others. Each group believes its - own gods to be strongest, and it will not exchange them except for - gods that shall be proven to be their superiors in power. Man is - but a weak creature, and needs the help of gods--he cannot do - without it. Shall he place his fate in the hands of weak gods when - there may be stronger ones to be found? That would be foolish. No, - if he hear of gods that are stronger than his own, he should not - turn a deaf ear, for it is not a light matter that is at stake. How - then shall he determine which gods are the stronger, his own or - those that preside over the concerns of other nations? By comparing - the known works of his own gods with the works of those others; - there is no other way. Now, when we make this comparison, we are - not drawn towards the gods of any other nation. Our gods are shown - by their works to be the strongest, the most powerful. The - Christians have but few gods, and they are new--new, and not strong; - as it seems to us. They will increase in number, it is true, for - this has happened with all gods, but that time is far away, many - ages and decades of ages away, for gods multiply slowly, as is meet - for beings to whom a thousand years is but a single moment. Our own - gods have been born millions of years apart. The process is slow, - the gathering of strength and power is similarly slow. In the slow - lapse of the ages the steadily accumulating power of our gods has at - last become prodigious. We have a thousand proofs of this in the - colossal character of their personal acts and the acts of ordinary - men to whom they have given supernatural qualities. To your Samson - was given supernatural power, and when he broke the withes, and slew - the thousands with the jawbone of an ass, and carried away the - gate's of the city upon his shoulders, you were amazed--and also - awed, for you recognized the divine source of his strength. But it - could not profit to place these things before your Hindoo - congregation and invite their wonder; for they would compare them - with the deed done by Hanuman, when our gods infused their divine - strength into his muscles; and they would be indifferent to them--as - you saw. In the old, old times, ages and ages gone by, when our god - Rama was warring with the demon god of Ceylon, Rama bethought him to - bridge the sea and connect Ceylon with India, so that his armies - might pass easily over; and he sent his general, Hanuman, inspired - like your own Samson with divine strength, to bring the materials - for the bridge. In two days Hanuman strode fifteen hundred miles, - to the Himalayas, and took upon his shoulder a range of those lofty - mountains two hundred miles long, and started with it toward Ceylon. - It was in the night; and, as he passed along the plain, the people - of Govardhun heard the thunder of his tread and felt the earth - rocking under it, and they ran out, and there, with their snowy - summits piled to heaven, they saw the Himalayas passing by. And as - this huge continent swept along overshadowing the earth, upon its - slopes they discerned the twinkling lights of a thousand sleeping - villages, and it was as if the constellations were filing in - procession through the sky. While they were looking, Hanuman - stumbled, and a small ridge of red sandstone twenty miles long was - jolted loose and fell. Half of its length has wasted away in the - course of the ages, but the other ten miles of it remain in the - plain by Govardhun to this day as proof of the might of the - inspiration of our gods. You must know, yourself, that Hanuman - could not have carried those mountains to Ceylon except by the - strength of the gods. You know that it was not done by his own - strength, therefore, you know that it was done by the strength of - the gods, just as you know that Samson carried the gates by the - divine strength and not by his own. I think you must concede two - things: First, That in carrying the gates of the city upon his - shoulders, Samson did not establish the superiority of his gods over - ours; secondly, That his feat is not supported by any but verbal - evidence, while Hanuman's is not only supported by verbal evidence, - but this evidence is confirmed, established, proven, by visible, - tangible evidence, which is the strongest of all testimony. We have - the sandstone ridge, and while it remains we cannot doubt, and shall - not. Have you the gates?'" - - - - -CHAPTER XIII. - -The timid man yearns for full value and asks a tenth. The bold man -strikes for double value and compromises on par. - --Pudd'nhead Wilson's New Calendar. - -One is sure to be struck by the liberal way in which Australasia spends -money upon public works--such as legislative buildings, town halls, -hospitals, asylums, parks, and botanical gardens. I should say that -where minor towns in America spend a hundred dollars on the town hall and -on public parks and gardens, the like towns in Australasia spend a -thousand. And I think that this ratio will hold good in the matter of -hospitals, also. I have seen a costly and well-equipped, and -architecturally handsome hospital in an Australian village of fifteen -hundred inhabitants. It was built by private funds furnished by the -villagers and the neighboring planters, and its running expenses were -drawn from the same sources. I suppose it would be hard to match this in -any country. This village was about to close a contract for lighting its -streets with the electric light, when I was there. That is ahead of -London. London is still obscured by gas--gas pretty widely scattered, -too, in some of the districts; so widely indeed, that except on moonlight -nights it is difficult to find the gas lamps. - -The botanical garden of Sydney covers thirty-eight acres, beautifully -laid out and rich with the spoil of all the lands and all the climes of -the world. The garden is on high ground in the middle of the town, -overlooking the great harbor, and it adjoins the spacious grounds of -Government House--fifty-six acres; and at hand also, is a recreation -ground containing eighty-two acres. In addition, there are the -zoological gardens, the race-course, and the great cricket-grounds where -the international matches are played. Therefore there is plenty of room -for reposeful lazying and lounging, and for exercise too, for such as -like that kind of work. - -There are four specialties attainable in the way of social pleasure. If -you enter your name on the Visitor's Book at Government House you will -receive an invitation to the next ball that takes place there, if nothing -can be proven against you. And it will be very pleasant; for you will -see everybody except the Governor, and add a number of acquaintances and -several friends to your list. The Governor will be in England. He -always is. The continent has four or five governors, and I do not know -how many it takes to govern the outlying archipelago; but anyway you will -not see them. When they are appointed they come out from England and get -inaugurated, and give a ball, and help pray for rain, and get aboard ship -and go back home. And so the Lieutenant-Governor has to do all the work. -I was in Australasia three months and a half, and saw only one Governor. -The others were at home. - -The Australasian Governor would not be so restless, perhaps, if he had a -war, or a veto, or something like that to call for his reserve-energies, -but he hasn't. There isn't any war, and there isn't any veto in his -hands. And so there is really little or nothing doing in his line. The -country governs itself, and prefers to do it; and is so strenuous about -it and so jealous of its independence that it grows restive if even the -Imperial Government at home proposes to help; and so the Imperial veto, -while a fact, is yet mainly a name. - -Thus the Governor's functions are much more limited than are a Governor's -functions with us. And therefore more fatiguing. He is the apparent -head of the State, he is the real head of Society. He represents -culture, refinement, elevated sentiment, polite life, religion; and by -his example he propagates these, and they spread and flourish and bear -good fruit. He creates the fashion, and leads it. His ball is the ball -of balls, and his countenance makes the horse-race thrive. - -He is usually a lord, and this is well; for his position compels him to -lead an expensive life, and an English lord is generally well equipped -for that. - -Another of Sydney's social pleasures is the visit to the Admiralty House; -which is nobly situated on high ground overlooking the water. The trim -boats of the service convey the guests thither; and there, or on board -the flag-ship, they have the duplicate of the hospitalities of Government -House. The Admiral commanding a station in British waters is a magnate -of the first degree, and he is sumptuously housed, as becomes the dignity -of his office. - -Third in the list of special pleasures is the tour of the harbor in a -fine steam pleasure-launch. Your richer friends own boats of this kind, -and they will invite you, and the joys of the trip will make a long day -seem short. - -And finally comes the shark-fishing. Sydney Harbor is populous with the -finest breeds of man-eating sharks in the world. Some people make their -living catching them; for the Government pays a cash bounty on them. The -larger the shark the larger the bounty, and some of the sharks are twenty -feet long. You not only get the bounty, but everything that is in the -shark belongs to you. Sometimes the contents are quite valuable. - -The shark is the swiftest fish that swims. The speed of the fastest -steamer afloat is poor compared to his. And he is a great gad-about, and -roams far and wide in the oceans, and visits the shores of all of them, -ultimately, in the course of his restless excursions. I have a tale to -tell now, which has not as yet been in print. In 1870 a young stranger -arrived in Sydney, and set about finding something to do; but he knew no -one, and brought no recommendations, and the result was that he got no -employment. He had aimed high, at first, but as time and his money -wasted away he grew less and less exacting, until at last he was willing -to serve in the humblest capacities if so he might get bread and shelter. -But luck was still against him; he could find no opening of any sort. -Finally his money was all gone. He walked the streets all day, thinking; -he walked them all night, thinking, thinking, and growing hungrier and -hungrier. At dawn he found himself well away from the town and drifting -aimlessly along the harbor shore. As he was passing by a nodding -shark-fisher the man looked up and said---- - -"Say, young fellow, take my line a spell, and change my luck for me." - -"How do you know I won't make it worse?" - -"Because you can't. It has been at its worst all night. If you can't -change it, no harm's done; if you do change it, it's for the better, -of course. Come." - -"All right, what will you give?" - -"I'll give you the shark, if you catch one." - -"And I will eat it, bones and all. Give me the line." - -"Here you are. I will get away, now, for awhile, so that my luck won't -spoil yours; for many and many a time I've noticed that if----there, pull -in, pull in, man, you've got a bite! I knew how it would be. Why, I -knew you for a born son of luck the minute I saw you. All right--he's -landed." - -It was an unusually large shark--"a full nineteen-footer," the fisherman -said, as he laid the creature open with his knife. - -"Now you rob him, young man, while I step to my hamper for a fresh bait. -There's generally something in them worth going for. You've changed my -luck, you see. But my goodness, I hope you haven't changed your own." - -"Oh, it wouldn't matter; don't worry about that. Get your bait. I'll -rob him." - -When the fisherman got back the young man had just finished washing his -hands in the bay, and was starting away. - -"What, you are not going?" - -"Yes. Good-bye." - -"But what about your shark?" - -"The shark? Why, what use is he to me?" - -"What use is he? I like that. Don't you know that we can go and report -him to Government, and you'll get a clean solid eighty shillings bounty? -Hard cash, you know. What do you think about it now?" - -"Oh, well, you can collect it." - -"And keep it? Is that what you mean?" - -"Yes." - -"Well, this is odd. You're one of those sort they call eccentrics, I -judge. The saying is, you mustn't judge a man by his clothes, and I'm -believing it now. Why yours are looking just ratty, don't you know; and -yet you must be rich." - -"I am." - -The young man walked slowly back to the town, deeply musing as he went. -He halted a moment in front of the best restaurant, then glanced at his -clothes and passed on, and got his breakfast at a "stand-up." There was -a good deal of it, and it cost five shillings. He tendered a sovereign, -got his change, glanced at his silver, muttered to himself, "There isn't -enough to buy clothes with," and went his way. - -At half-past nine the richest wool-broker in Sydney was sitting in his -morning-room at home, settling his breakfast with the morning paper. A -servant put his head in and said: - -"There's a sundowner at the door wants to see you, sir." - -"What do you bring that kind of a message here for? Send him about his -business." - -"He won't go, sir. I've tried." - -"He won't go? That's--why, that's unusual. He's one of two things, -then: he's a remarkable person, or he's crazy. Is he crazy?" - -"No, sir. He don't look it." - -"Then he's remarkable. What does he say he wants?" - -"He won't tell, sir; only says it's very important." - -"And won't go. Does he say he won't go?" - -"Says he'll stand there till he sees you, sir, if it's all day." - -"And yet isn't crazy. Show him up." - -The sundowner was shown in. The broker said to himself, "No, he's not -crazy; that is easy to see; so he must be the other thing." - -Then aloud, "Well, my good fellow, be quick about it; don't waste any -words; what is it you want?" - -"I want to borrow a hundred thousand pounds." - -"Scott! (It's a mistake; he is crazy . . . . No--he can't be--not -with that eye.) Why, you take my breath away. Come, who are you?" - -"Nobody that you know." - -"What is your name?" - -"Cecil Rhodes." - -"No, I don't remember hearing the name before. Now then--just for -curiosity's sake--what has sent you to me on this extraordinary errand?" - -"The intention to make a hundred thousand pounds for you and as much for -myself within the next sixty days." - -"Well, well, well. It is the most extraordinary idea that--sit down--you -interest me. And somehow you--well, you fascinate me; I think that that -is about the word. And it isn't your proposition--no, that doesn't -fascinate me; it's something else, I don't quite know what; something -that's born in you and oozes out of you, I suppose. Now then just for -curiosity's sake again, nothing more: as I understand it, it is your -desire to bor----" - -"I said intention." - -"Pardon, so you did. I thought it was an unheedful use of the word--an -unheedful valuing of its strength, you know." - -"I knew its strength." - -"Well, I must say--but look here, let me walk the floor a little, my mind -is getting into a sort of whirl, though you don't seem disturbed any. -(Plainly this young fellow isn't crazy; but as to his being remarkable ---well, really he amounts to that, and something over.) Now then, I -believe I am beyond the reach of further astonishment. Strike, and spare -not. What is your scheme?" - -"To buy the wool crop--deliverable in sixty days." - -"What, the whole of it?" - -"The whole of it." - -"No, I was not quite out of the reach of surprises, after all. Why, how -you talk! Do you know what our crop is going to foot up?" - -"Two and a half million sterling--maybe a little more." - -"Well, you've got your statistics right, any way. Now, then, do you know -what the margins would foot up, to buy it at sixty days?" - -"The hundred thousand pounds I came here to get." - -"Right, once more. Well, dear me, just to see what would happen, I wish -you had the money. And if you had it, what would you do with it?" - -"I shall make two hundred thousand pounds out of it in sixty days." - -"You mean, of course, that you might make it if----" - -"I said 'shall'." - -"Yes, by George, you did say 'shall'! You are the most definite devil I -ever saw, in the matter of language. Dear, dear, dear, look here! -Definite speech means clarity of mind. Upon my word I believe you've got -what you believe to be a rational reason, for venturing into this house, -an entire stranger, on this wild scheme of buying the wool crop of an -entire colony on speculation. Bring it out--I am prepared--acclimatized, -if I may use the word. Why would you buy the crop, and why would you -make that sum out of it? That is to say, what makes you think you----" - -"I don't think--I know." - -"Definite again. How do you know?" - -"Because France has declared war against Germany, and wool has gone up -fourteen per cent. in London and is still rising." - -"Oh, in-deed? Now then, I've got you! Such a thunderbolt as you have -just let fly ought to have made me jump out of my chair, but it didn't -stir me the least little bit, you see. And for a very simple reason: I -have read the morning paper. You can look at it if you want to. The -fastest ship in the service arrived at eleven o'clock last night, fifty -days out from London. All her news is printed here. There are no -war-clouds anywhere; and as for wool, why, it is the low-spiritedest -commodity in the English market. It is your turn to jump, now . . . . -Well, why, don't you jump? Why do you sit there in that placid fashion, -when----" - -"Because I have later news." - -"Later news? Oh, come--later news than fifty days, brought steaming hot -from London by the----" - -"My news is only ten days old." - -"Oh, Mun-chausen, hear the maniac talk! Where did you get it?" - -"Got it out of a shark." - -"Oh, oh, oh, this is too much! Front! call the police bring the gun ---raise the town! All the asylums in Christendom have broken loose in the -single person of----" - -"Sit down! And collect yourself. Where is the use in getting excited? -Am I excited? There is nothing to get excited about. When I make a -statement which I cannot prove, it will be time enough for you to begin -to offer hospitality to damaging fancies about me and my sanity." - -"Oh, a thousand, thousand pardons! I ought to be ashamed of myself, and -I am ashamed of myself for thinking that a little bit of a circumstance -like sending a shark to England to fetch back a market report----" - -"What does your middle initial stand for, sir?" - -"Andrew. What are you writing?" - -"Wait a moment. Proof about the shark--and another matter. Only ten -lines. There--now it is done. Sign it." - -"Many thanks--many. Let me see; it says--it says oh, come, this is -interesting! Why--why--look here! prove what you say here, and I'll put -up the money, and double as much, if necessary, and divide the winnings -with you, half and half. There, now--I've signed; make your promise good -if you can. Show me a copy of the London Times only ten days old." - -"Here it is--and with it these buttons and a memorandum book that -belonged to the man the shark swallowed. Swallowed him in the Thames, -without a doubt; for you will notice that the last entry in the book is -dated 'London,' and is of the same date as the Times, and says, 'Ber -confequentz der Kreigeseflarun, reife ich heute nach Deutchland ab, aur -bak ich mein leben auf dem Ultar meines Landes legen mag'----, as clean -native German as anybody can put upon paper, and means that in -consequence of the declaration of war, this loyal soul is leaving for -home to-day, to fight. And he did leave, too, but the shark had him -before the day was done, poor fellow." - -"And a pity, too. But there are times for mourning, and we will attend -to this case further on; other matters are pressing, now. I will go down -and set the machinery in motion in a quiet way and buy the crop. It will -cheer the drooping spirits of the boys, in a transitory way. Everything -is transitory in this world. Sixty days hence, when they are called to -deliver the goods, they will think they've been struck by lightning. But -there is a time for mourning, and we will attend to that case along with -the other one. Come along, I'll take you to my tailor. What did you say -your name is?" - -"Cecil Rhodes." - -"It is hard to remember. However, I think you will make it easier by and -by, if you live. There are three kinds of people--Commonplace Men, -Remarkable Men, and Lunatics. I'll classify you with the Remarkables, -and take the chances." - -The deal went through, and secured to the young stranger the first -fortune he ever pocketed. - -The people of Sydney ought to be afraid of the sharks, but for some -reason they do not seem to be. On Saturdays the young men go out in -their boats, and sometimes the water is fairly covered with the little -sails. A boat upsets now and then, by accident, a result of tumultuous -skylarking; sometimes the boys upset their boat for fun--such as it is -with sharks visibly waiting around for just such an occurrence. The -young fellows scramble aboard whole--sometimes--not always. Tragedies -have happened more than once. While I was in Sydney it was reported that -a boy fell out of a boat in the mouth of the Paramatta river and screamed -for help and a boy jumped overboard from another boat to save him from -the assembling sharks; but the sharks made swift work with the lives of -both. - -The government pays a bounty for the shark; to get the bounty the -fishermen bait the hook or the seine with agreeable mutton; the news -spreads and the sharks come from all over the Pacific Ocean to get the -free board. In time the shark culture will be one of the most successful -things in the colony. - - - - -CHAPTER XIV. - -We can secure other people's approval, if we do right and try hard; but -our own is worth a hundred of it, and no way has been found out of -securing that. - --Pudd'nhead Wilson's New Calendar. - -My health had broken down in New York in May; it had remained in a -doubtful but fairish condition during a succeeding period of 82 days; it -broke again on the Pacific. It broke again in Sydney, but not until -after I had had a good outing, and had also filled my lecture -engagements. This latest break lost me the chance of seeing Queensland. -In the circumstances, to go north toward hotter weather was not -advisable. - -So we moved south with a westward slant, 17 hours by rail to the capital -of the colony of Victoria, Melbourne--that juvenile city of sixty years, -and half a million inhabitants. On the map the distance looked small; -but that is a trouble with all divisions of distance in such a vast -country as Australia. The colony of Victoria itself looks small on the -map--looks like a county, in fact--yet it is about as large as England, -Scotland, and Wales combined. Or, to get another focus upon it, it is -just 80 times as large as the state of Rhode Island, and one-third as -large as the State of Texas. - -Outside of Melbourne, Victoria seems to be owned by a handful of -squatters, each with a Rhode Island for a sheep farm. That is the -impression which one gathers from common talk, yet the wool industry of -Victoria is by no means so great as that of New South Wales. The climate -of Victoria is favorable to other great industries--among others, -wheat-growing and the making of wine. - -We took the train at Sydney at about four in the afternoon. It was -American in one way, for we had a most rational sleeping car; also the -car was clean and fine and new--nothing about it to suggest the rolling -stock of the continent of Europe. But our baggage was weighed, and extra -weight charged for. That was continental. Continental and troublesome. -Any detail of railroading that is not troublesome cannot honorably be -described as continental. - -The tickets were round-trip ones--to Melbourne, and clear to Adelaide in -South Australia, and then all the way back to Sydney. Twelve hundred -more miles than we really expected to make; but then as the round trip -wouldn't cost much more than the single trip, it seemed well enough to -buy as many miles as one could afford, even if one was not likely to need -them. A human being has a natural desire to have more of a good thing -than he needs. - -Now comes a singular thing: the oddest thing, the strangest thing, the -most baffling and unaccountable marvel that Australasia can show. At the -frontier between New South Wales and Victoria our multitude of passengers -were routed out of their snug beds by lantern-light in the morning in the -biting-cold of a high altitude to change cars on a road that has no break -in it from Sydney to Melbourne! Think of the paralysis of intellect that -gave that idea birth; imagine the boulder it emerged from on some -petrified legislator's shoulders. - -It is a narrow-gage road to the frontier, and a broader gauge thence to -Melbourne. The two governments were the builders of the road and are the -owners of it. One or two reasons are given for this curious state of -things. One is, that it represents the jealousy existing between the -colonies--the two most important colonies of Australasia. What the other -one is, I have forgotten. But it is of no consequence. It could be but -another effort to explain the inexplicable. - -All passengers fret at the double-gauge; all shippers of freight must of -course fret at it; unnecessary expense, delay, and annoyance are imposed -upon everybody concerned, and no one is benefitted. - -Each Australian colony fences itself off from its neighbor with a -custom-house. Personally, I have no objection, but it must be a good -deal of inconvenience to the people. We have something resembling it -here and there in America, but it goes by another name. The large empire -of the Pacific coast requires a world of iron machinery, and could -manufacture it economically on the spot if the imposts on foreign iron -were removed. But they are not. Protection to Pennsylvania and Alabama -forbids it. The result to the Pacific coast is the same as if there were -several rows of custom-fences between the coast and the East. Iron -carted across the American continent at luxurious railway rates would be -valuable enough to be coined when it arrived. - -We changed cars. This was at Albury. And it was there, I think, that -the growing day and the early sun exposed the distant range called the -Blue Mountains. Accurately named. "My word!" as the Australians say, -but it was a stunning color, that blue. Deep, strong, rich, exquisite; -towering and majestic masses of blue--a softly luminous blue, a -smouldering blue, as if vaguely lit by fires within. It extinguished the -blue of the sky--made it pallid and unwholesome, whitey and washed-out. -A wonderful color--just divine. - -A resident told me that those were not mountains; he said they were -rabbit-piles. And explained that long exposure and the over-ripe -condition of the rabbits was what made them look so blue. This man may -have been right, but much reading of books of travel has made me -distrustful of gratis information furnished by unofficial residents of a -country. The facts which such people give to travelers are usually -erroneous, and often intemperately so. The rabbit-plague has indeed been -very bad in Australia, and it could account for one mountain, but not for -a mountain range, it seems to me. It is too large an order. - -We breakfasted at the station. A good breakfast, except the coffee; and -cheap. The Government establishes the prices and placards them. The -waiters were men, I think; but that is not usual in Australasia. The -usual thing is to have girls. No, not girls, young ladies--generally -duchesses. Dress? They would attract attention at any royal levee in -Europe. Even empresses and queens do not dress as they do. Not that -they could not afford it, perhaps, but they would not know how. - -All the pleasant morning we slid smoothly along over the plains, through -thin--not thick--forests of great melancholy gum trees, with trunks -rugged with curled sheets of flaking bark--erysipelas convalescents, so -to speak, shedding their dead skins. And all along were tiny cabins, -built sometimes of wood, sometimes of gray-blue corrugated iron; and -the doorsteps and fences were clogged with children--rugged little -simply-clad chaps that looked as if they had been imported from the -banks of the Mississippi without breaking bulk. - -And there were little villages, with neat stations well placarded with -showy advertisements--mainly of almost too self-righteous brands of -"sheepdip." If that is the name--and I think it is. It is a stuff like -tar, and is dabbed on to places where the shearer clips a piece out of -the sheep. It bars out the flies, and has healing properties, and a nip -to it which makes the sheep skip like the cattle on a thousand hills. It -is not good to eat. That is, it is not good to eat except when mixed -with railroad coffee. It improves railroad coffee. Without it railroad -coffee is too vague. But with it, it is quite assertive and -enthusiastic. By itself, railroad coffee is too passive; but sheep-dip -makes it wake up and get down to business. I wonder where they get -railroad coffee? - -We saw birds, but not a kangaroo, not an emu, not an ornithorhynchus, not -a lecturer, not a native. Indeed, the land seemed quite destitute of -game. But I have misused the word native. In Australia it is applied to -Australian-born whites only. I should have said that we saw no -Aboriginals--no "blackfellows." And to this day I have never seen one. -In the great museums you will find all the other curiosities, but in the -curio of chiefest interest to the stranger all of them are lacking. We -have at home an abundance of museums, and not an American Indian in them. -It is clearly an absurdity, but it never struck me before. - - - - -CHAPTER XV. - -Truth is stranger than fiction--to some people, but I am measurably -familiar with it. - --Pudd'nhead Wilson's New Calendar. - -Truth is stranger than fiction, but it is because Fiction is obliged to -stick to possibilities; Truth isn't. - --Pudd'nhead Wilson's New Calendar. - -The air was balmy and delicious, the sunshine radiant; it was a charming -excursion. In the course of it we came to a town whose odd name was -famous all over the world a quarter of a century ago--Wagga-Wagga. This -was because the Tichborne Claimant had kept a butcher-shop there. It was -out of the midst of his humble collection of sausages and tripe that he -soared up into the zenith of notoriety and hung there in the wastes of -space a time, with the telescopes of all nations leveled at him in -unappeasable curiosity--curiosity as to which of the two long-missing -persons he was: Arthur Orton, the mislaid roustabout of Wapping, or Sir -Roger Tichborne, the lost heir of a name and estates as old as English -history. We all know now, but not a dozen people knew then; and the -dozen kept the mystery to themselves and allowed the most intricate and -fascinating and marvelous real-life romance that has ever been played -upon the world's stage to unfold itself serenely, act by act, in a -British court by the long and laborious processes of judicial -development. - -When we recall the details of that great romance we marvel to see what -daring chances truth may freely take in constructing a tale, as compared -with the poor little conservative risks permitted to fiction. The -fiction-artist could achieve no success with the materials of this -splendid Tichborne romance. - -He would have to drop out the chief characters; the public would say such -people are impossible. He would have to drop out a number of the most -picturesque incidents; the public would say such things could never -happen. And yet the chief characters did exist, and the incidents did -happen. - -It cost the Tichborne estates $400,000 to unmask the Claimant and drive -him out; and even after the exposure multitudes of Englishmen still -believed in him. It cost the British Government another $400,000 to -convict him of perjury; and after the conviction the same old multitudes -still believed in him; and among these believers were many educated and -intelligent men; and some of them had personally known the real Sir -Roger. The Claimant was sentenced to 14 years' imprisonment. When he -got out of prison he went to New York and kept a whisky saloon in the -Bowery for a time, then disappeared from view. - -He always claimed to be Sir Roger Tichborne until death called for him. -This was but a few months ago--not very much short of a generation since -he left Wagga-Wagga to go and possess himself of his estates. On his -death-bed he yielded up his secret, and confessed in writing that he was -only Arthur Orton of Wapping, able seaman and butcher--that and nothing -more. But it is scarcely to be doubted that there are people whom even -his dying confession will not convince. The old habit of assimilating -incredibilities must have made strong food a necessity in their case; a -weaker article would probably disagree with them. - -I was in London when the Claimant stood his trial for perjury. I -attended one of his showy evenings in the sumptuous quarters provided for -him from the purses of his adherents and well-wishers. He was in evening -dress, and I thought him a rather fine and stately creature. There were -about twenty-five gentlemen present; educated men, men moving in good -society, none of them commonplace; some of them were men of distinction, -none of them were obscurities. They were his cordial friends and -admirers. It was "Sir Roger," always "Sir Roger," on all hands; no one -withheld the title, all turned it from the tongue with unction, and as if -it tasted good. - -For many years I had had a mystery in stock. Melbourne, and only -Melbourne, could unriddle it for me. In 1873 I arrived in London with my -wife and young child, and presently received a note from Naples signed by -a name not familiar to me. It was not Bascom, and it was not Henry; but -I will call it Henry Bascom for convenience's sake. This note, of about -six lines, was written on a strip of white paper whose end-edges were -ragged. I came to be familiar with those strips in later years. Their -size and pattern were always the same. Their contents were usually to -the same effect: would I and mine come to the writer's country-place in -England on such and such a date, by such and such a train, and stay -twelve days and depart by such and such a train at the end of the -specified time? A carriage would meet us at the station. - -These invitations were always for a long time ahead; if we were in -Europe, three months ahead; if we were in America, six to twelve months -ahead. They always named the exact date and train for the beginning and -also for the end of the visit. - -This first note invited us for a date three months in the future. It -asked us to arrive by the 4.10 p.m. train from London, August 6th. The -carriage would be waiting. The carriage would take us away seven days -later-train specified. And there were these words: "Speak to Tom -Hughes." - -I showed the note to the author of "Tom Brown at Rugby," and be said: -"Accept, and be thankful." - -He described Mr. Bascom as being a man of genius, a man of fine -attainments, a choice man in every way, a rare and beautiful character. -He said that Bascom Hall was a particularly fine example of the stately -manorial mansion of Elizabeth's days, and that it was a house worth going -a long way to see--like Knowle; that Mr. B. was of a social disposition; -liked the company of agreeable people, and always had samples of the sort -coming and going. - -We paid the visit. We paid others, in later years--the last one in 1879. -Soon after that Mr. Bascom started on a voyage around the world in a -steam yacht--a long and leisurely trip, for he was making collections, in -all lands, of birds, butterflies, and such things. - -The day that President Garfield was shot by the assassin Guiteau, we were -at a little watering place on Long Island Sound; and in the mail matter -of that day came a letter with the Melbourne post-mark on it. It was for -my wife, but I recognized Mr. Bascom's handwriting on the envelope, and -opened it. It was the usual note--as to paucity of lines--and was -written on the customary strip of paper; but there was nothing usual -about the contents. The note informed my wife that if it would be any -assuagement of her grief to know that her husband's lecture-tour in -Australia was a satisfactory venture from the beginning to the end, he, -the writer, could testify that such was the case; also, that her -husband's untimely death had been mourned by all classes, as she would -already know by the press telegrams, long before the reception of this -note; that the funeral was attended by the officials of the colonial and -city governments; and that while he, the writer, her friend and mine, had -not reached Melbourne in time to see the body, he had at least had the -sad privilege of acting as one of the pall-bearers. Signed, "Henry -Bascom." - -My first thought was, why didn't he have the coffin opened? He would -have seen that the corpse was an imposter, and he could have gone right -ahead and dried up the most of those tears, and comforted those sorrowing -governments, and sold the remains and sent me the money. - -I did nothing about the matter. I had set the law after living lecture -doubles of mine a couple of times in America, and the law had not been -able to catch them; others in my trade had tried to catch their -impostor-doubles and had failed. Then where was the use in harrying a -ghost? None--and so I did not disturb it. I had a curiosity to know -about that man's lecture-tour and last moments, but that could wait. -When I should see Mr. Bascom he would tell me all about it. But he -passed from life, and I never saw him again.. My curiosity faded away. - -However, when I found that I was going to Australia it revived. And -naturally: for if the people should say that I was a dull, poor thing -compared to what I was before I died, it would have a bad effect on -business. Well, to my surprise the Sydney journalists had never heard of -that impostor! I pressed them, but they were firm--they had never heard -of him, and didn't believe in him. - -I could not understand it; still, I thought it would all come right in -Melbourne. The government would remember; and the other mourners. At -the supper of the Institute of Journalists I should find out all about -the matter. But no--it turned out that they had never heard of it. - -So my mystery was a mystery still. It was a great disappointment. I -believed it would never be cleared up--in this life--so I dropped it out -of my mind. - -But at last! just when I was least expecting it---- - -However, this is not the place for the rest of it; I shall come to the -matter again, in a far-distant chapter. - - - - -CHAPTER XVI. - -There is a Moral sense, and there is an Immoral Sense. History shows us -that the Moral Sense enables us to perceive morality and how to avoid it, -and that the Immoral Sense enables us to perceive immorality and how to -enjoy it. - -Pudd'nhead Wilson's New Calendar. - -Melbourne spreads around over an immense area of ground. It is a stately -city architecturally as well as in magnitude. It has an elaborate system -of cable-car service; it has museums, and colleges, and schools, and -public gardens, and electricity, and gas, and libraries, and theaters, -and mining centers, and wool centers, and centers of the arts and -sciences, and boards of trade, and ships, and railroads, and a harbor, -and social clubs, and journalistic clubs, and racing clubs, and a -squatter club sumptuously housed and appointed, and as many churches and -banks as can make a living. In a word, it is equipped with everything -that goes to make the modern great city. It is the largest city of -Australasia, and fills the post with honor and credit. It has one -specialty; this must not be jumbled in with those other things. It is -the mitred Metropolitan of the Horse-Racing Cult. Its race-ground is the -Mecca of Australasia. On the great annual day of sacrifice--the 5th of -November, Guy Fawkes's Day--business is suspended over a stretch of land -and sea as wide as from New York to San Francisco, and deeper than from -the northern lakes to the Gulf of Mexico; and every man and woman, of -high degree or low, who can afford the expense, put away their other -duties and come. They begin to swarm in by ship and rail a fortnight -before the day, and they swarm thicker and thicker day after day, until -all the vehicles of transportation are taxed to their uttermost to meet -the demands of the occasion, and all hotels and lodgings are bulging -outward because of the pressure from within. They come a hundred -thousand strong, as all the best authorities say, and they pack the -spacious grounds and grandstands and make a spectacle such as is never to -be seen in Australasia elsewhere. - -It is the "Melbourne Cup" that brings this multitude together. Their -clothes have been ordered long ago, at unlimited cost, and without bounds -as to beauty and magnificence, and have been kept in concealment until -now, for unto this day are they consecrate. I am speaking of the ladies' -clothes; but one might know that. - -And so the grand-stands make a brilliant and wonderful spectacle, a -delirium of color, a vision of beauty. The champagne flows, everybody is -vivacious, excited, happy; everybody bets, and gloves and fortunes change -hands right along, all the time. Day after day the races go on, and the -fun and the excitement are kept at white heat; and when each day is done, -the people dance all night so as to be fresh for the race in the morning. -And at the end of the great week the swarms secure lodgings and -transportation for next year, then flock away to their remote homes and -count their gains and losses, and order next year's Cup-clothes, and then -lie down and sleep two weeks, and get up sorry to reflect that a whole -year must be put in somehow or other before they can be wholly happy -again. - -The Melbourne Cup is the Australasian National Day. It would be -difficult to overstate its importance. It overshadows all other holidays -and specialized days of whatever sort in that congeries of colonies. -Overshadows them? I might almost say it blots them out. Each of them -gets attention, but not everybody's; each of them evokes interest, but -not everybody's; each of them rouses enthusiasm, but not everybody's; in -each case a part of the attention, interest, and enthusiasm is a matter -of habit and custom, and another part of it is official and perfunctory. -Cup Day, and Cup Day only, commands an attention, an interest, and an -enthusiasm which are universal--and spontaneous, not perfunctory. Cup -Day is supreme it has no rival. I can call to mind no specialized annual -day, in any country, which can be named by that large name--Supreme. I -can call to mind no specialized annual day, in any country, whose -approach fires the whole land with a conflagration of conversation and -preparation and anticipation and jubilation. No day save this one; but -this one does it. - -In America we have no annual supreme day; no day whose approach makes the -whole nation glad. We have the Fourth of July, and Christmas, and -Thanksgiving. Neither of them can claim the primacy; neither of them can -arouse an enthusiasm which comes near to being universal. Eight grown -Americans out of ten dread the coming of the Fourth, with its pandemonium -and its perils, and they rejoice when it is gone--if still alive. The -approach of Christmas brings harassment and dread to many excellent -people. They have to buy a cart-load of presents, and they never know -what to buy to hit the various tastes; they put in three weeks of hard -and anxious work, and when Christmas morning comes they are so -dissatisfied with the result, and so disappointed that they want to sit -down and cry. Then they give thanks that Christmas comes but once a -year. The observance of Thanksgiving Day--as a function--has become -general of late years. The Thankfulness is not so general. This is -natural. Two-thirds of the nation have always had hard luck and a hard -time during the year, and this has a calming effect upon their -enthusiasm. - -We have a supreme day--a sweeping and tremendous and tumultuous day, a -day which commands an absolute universality of interest and excitement; -but it is not annual. It comes but once in four years; therefore it -cannot count as a rival of the Melbourne Cup. - -In Great Britain and Ireland they have two great days--Christmas and the -Queen's birthday. But they are equally popular; there is no supremacy. - -I think it must be conceded that the position of the Australasian Day is -unique, solitary, unfellowed; and likely to hold that high place a long -time. - -The next things which interest us when we travel are, first, the people; -next, the novelties; and finally the history of the places and countries -visited. Novelties are rare in cities which represent the most advanced -civilization of the modern day. When one is familiar with such cities in -the other parts of the world he is in effect familiar with the cities of -Australasia. The outside aspects will furnish little that is new. There -will be new names, but the things which they represent will sometimes be -found to be less new than their names. There may be shades of -difference, but these can easily be too fine for detection by the -incompetent eye of the passing stranger. In the larrikin he will not be -able to discover a new species, but only an old one met elsewhere, and -variously called loafer, rough, tough, bummer, or blatherskite, according -to his geographical distribution. The larrikin differs by a shade from -those others, in that he is more sociable toward the stranger than they, -more kindly disposed, more hospitable, more hearty, more friendly. At -least it seemed so to me, and I had opportunity to observe. In Sydney, -at least. In Melbourne I had to drive to and from the lecture-theater, -but in Sydney I was able to walk both ways, and did it. Every night, on -my way home at ten, or a quarter past, I found the larrikin grouped in -considerable force at several of the street corners, and he always gave -me this pleasant salutation: - -"Hello, Mark!" - -"Here's to you, old chap! - -"Say--Mark!--is he dead?"--a reference to a passage in some book of mine, -though I did not detect, at that time, that that was its source. And I -didn't detect it afterward in Melbourne, when I came on the stage for the -first time, and the same question was dropped down upon me from the dizzy -height of the gallery. It is always difficult to answer a sudden inquiry -like that, when you have come unprepared and don't know what it means. -I will remark here--if it is not an indecorum--that the welcome which an -American lecturer gets from a British colonial audience is a thing which -will move him to his deepest deeps, and veil his sight and break his -voice. And from Winnipeg to Africa, experience will teach him nothing; -he will never learn to expect it, it will catch him as a surprise each -time. The war-cloud hanging black over England and America made no -trouble for me. I was a prospective prisoner of war, but at dinners, -suppers, on the platform, and elsewhere, there was never anything to -remind me of it. This was hospitality of the right metal, and would have -been prominently lacking in some countries, in the circumstances. - -And speaking of the war-flurry, it seemed to me to bring to light the -unexpected, in a detail or two. It seemed to relegate the war-talk to -the politicians on both sides of the water; whereas whenever a -prospective war between two nations had been in the air theretofore, the -public had done most of the talking and the bitterest. The attitude of -the newspapers was new also. I speak of those of Australasia and India, -for I had access to those only. They treated the subject argumentatively -and with dignity, not with spite and anger. That was a new spirit, too, -and not learned of the French and German press, either before Sedan or -since. I heard many public speeches, and they reflected the moderation -of the journals. The outlook is that the English-speaking race will -dominate the earth a hundred years from now, if its sections do not get -to fighting each other. It would be a pity to spoil that prospect by -baffling and retarding wars when arbitration would settle their -differences so much better and also so much more definitely. - -No, as I have suggested, novelties are rare in the great capitals of -modern times. Even the wool exchange in Melbourne could not be told from -the familiar stock exchange of other countries. Wool brokers are just -like stockbrokers; they all bounce from their seats and put up their -hands and yell in unison--no stranger can tell what--and the president -calmly says "Sold to Smith & Co., threpence farthing--next!"--when -probably nothing of the kind happened; for how should he know? - -In the museums you will find acres of the most strange and fascinating -things; but all museums are fascinating, and they do so tire your eyes, -and break your back, and burn out your vitalities with their consuming -interest. You always say you will never go again, but you do go. The -palaces of the rich, in Melbourne, are much like the palaces of the rich -in America, and the life in them is the same; but there the resemblance -ends. The grounds surrounding the American palace are not often large, -and not often beautiful, but in the Melbourne case the grounds are often -ducally spacious, and the climate and the gardeners together make them as -beautiful as a dream. It is said that some of the country seats have -grounds--domains--about them which rival in charm and magnitude those -which surround the country mansion of an English lord; but I was not out -in the country; I had my hands full in town. - -And what was the origin of this majestic city and its efflorescence of -palatial town houses and country seats? Its first brick was laid and -its first house built by a passing convict. Australian history is almost -always picturesque; indeed, it is so curious and strange, that it is -itself the chiefest novelty the country has to offer, and so it pushes -the other novelties into second and third place. It does not read like -history, but like the most beautiful lies. And all of a fresh new sort, -no mouldy old stale ones. It is full of surprises, and adventures, and -incongruities, and contradictions, and incredibilities; but they are all -true, they all happened. - - - - -CHAPTER XVII. - -The English are mentioned in the Bible: Blessed are the meek, for they -shall inherit the earth. - --Pudd'nhead Wilson's New Calendar. - -When we consider the immensity of the British Empire in territory, -population, and trade, it requires a stern exercise of faith to believe -in the figures which represent Australasia's contribution to the Empire's -commercial grandeur. As compared with the landed estate of the British -Empire, the landed estate dominated by any other Power except one ---Russia--is not very impressive for size. My authorities make the British -Empire not much short of a fourth larger than the Russian Empire. -Roughly proportioned, if you will allow your entire hand to represent the -British Empire, you may then cut off the fingers a trifle above the -middle joint of the middle finger, and what is left of the hand will -represent Russia. The populations ruled by Great Britain and China are -about the same--400,000,000 each. No other Power approaches these -figures. Even Russia is left far behind. - -The population of Australasia--4,000,000--sinks into nothingness, and is -lost from sight in that British ocean of 400,000,000. Yet the statistics -indicate that it rises again and shows up very conspicuously when its -share of the Empire's commerce is the matter under consideration. The -value of England's annual exports and imports is stated at three billions -of dollars,--[New South Wales Blue Book.]--and it is claimed that more -than one-tenth of this great aggregate is represented by Australasia's -exports to England and imports from England. In addition to this, -Australasia does a trade with countries other than England, amounting to -a hundred million dollars a year, and a domestic intercolonial trade -amounting to a hundred and fifty millions. - -In round numbers the 4,000,000 buy and sell about $600,000,000 worth of -goods a year. It is claimed that about half of this represents -commodities of Australasian production. The products exported annually -by India are worth a trifle over $500,000,000. Now, here are some -faith-straining figures: - -Indian production (300,000,000 population), $500,000,000. - -Australasian production (4,000,000 population), $300,000,000. - -That is to say, the product of the individual Indian, annually (for -export some whither), is worth $1.15; that of the individual -Australasian (for export some whither), $75! Or, to put it in another -way, the Indian family of man and wife and three children sends away an -annual result worth $8.75, while the Australasian family sends away $375 -worth. - -There are trustworthy statistics furnished by Sir Richard Temple and -others, which show that the individual Indian's whole annual product, -both for export and home use, is worth in gold only $7.50; or, $37.50 -for the family-aggregate. Ciphered out on a like ratio of -multiplication, the Australasian family's aggregate production would be -nearly $1,600. Truly, nothing is so astonishing as figures, if they once -get started. - -We left Melbourne by rail for Adelaide, the capital of the vast Province -of South Australia--a seventeen-hour excursion. On the train we found -several Sydney friends; among them a Judge who was going out on circuit, -and was going to hold court at Broken Hill, where the celebrated silver -mine is. It seemed a curious road to take to get to that region. Broken -Hill is close to the western border of New South Wales, and Sydney is on -the eastern border. A fairly straight line, 700 miles long, drawn -westward from Sydney, would strike Broken Hill, just as a somewhat -shorter one drawn west from Boston would strike Buffalo. The way the -Judge was traveling would carry him over 2,000 miles by rail, he said; -southwest from Sydney down to Melbourne, then northward up to Adelaide, -then a cant back northeastward and over the border into New South Wales -once more--to Broken Hill. It was like going from Boston southwest to -Richmond, Virginia, then northwest up to Erie, Pennsylvania, then a cant -back northeast and over the border--to Buffalo, New York. - -But the explanation was simple. Years ago the fabulously rich silver -discovery at Broken Hill burst suddenly upon an unexpectant world. Its -stocks started at shillings, and went by leaps and bounds to the most -fanciful figures. It was one of those cases where the cook puts a -month's wages into shares, and comes next mouth and buys your house at -your own price, and moves into it herself; where the coachman takes a few -shares, and next month sets up a bank; and where the common sailor -invests the price of a spree, and next month buys out the steamship -company and goes into business on his own hook. In a word, it was one of -those excitements which bring multitudes of people to a common center -with a rush, and whose needs must be supplied, and at once. Adelaide was -close by, Sydney was far away. Adelaide threw a short railway across the -border before Sydney had time to arrange for a long one; it was not worth -while for Sydney to arrange at all. The whole vast trade-profit of -Broken Hill fell into Adelaide's hands, irrevocably. New South Wales -furnishes for Broken Hill and sends her Judges 2,000 miles--mainly -through alien countries--to administer it, but Adelaide takes the -dividends and makes no moan. - -We started at 4.20 in the afternoon, and moved across level until night. -In the morning we had a stretch of "scrub" country--the kind of thing -which is so useful to the Australian novelist. In the scrub the hostile -aboriginal lurks, and flits mysteriously about, slipping out from time to -time to surprise and slaughter the settler; then slipping back again, and -leaving no track that the white man can follow. In the scrub the -novelist's heroine gets lost, search fails of result; she wanders here -and there, and finally sinks down exhausted and unconscious, and the -searchers pass within a yard or two of her, not suspecting that she is -near, and by and by some rambler finds her bones and the pathetic diary -which she had scribbled with her failing hand and left behind. Nobody -can find a lost heroine in the scrub but the aboriginal "tracker," and he -will not lend himself to the scheme if it will interfere with the -novelist's plot. The scrub stretches miles and miles in all directions, -and looks like a level roof of bush-tops without a break or a crack in it ---as seamless as a blanket, to all appearance. One might as well walk -under water and hope to guess out a route and stick to it, I should -think. Yet it is claimed that the aboriginal "tracker" was able to hunt -out people lost in the scrub. Also in the "bush"; also in the desert; -and even follow them over patches of bare rocks and over alluvial ground -which had to all appearance been washed clear of footprints. - -From reading Australian books and talking with the people, I became -convinced that the aboriginal tracker's performances evince a craft, a -penetration, a luminous sagacity, and a minuteness and accuracy of -observation in the matter of detective-work not found in nearly so -remarkable a degree in any other people, white or colored. In an -official account of the blacks of Australia published by the government -of Victoria, one reads that the aboriginal not only notices the faint -marks left on the bark of a tree by the claws of a climbing opossum, but -knows in some way or other whether the marks were made to-day or -yesterday. - -And there is the case, on records where A., a settler, makes a bet with -B., that B. may lose a cow as effectually as he can, and A. will produce -an aboriginal who will find her. B. selects a cow and lets the tracker -see the cow's footprint, then be put under guard. B. then drives the cow -a few miles over a course which drifts in all directions, and frequently -doubles back upon itself; and he selects difficult ground all the time, -and once or twice even drives the cow through herds of other cows, and -mingles her tracks in the wide confusion of theirs. He finally brings -his cow home; the aboriginal is set at liberty, and at once moves around -in a great circle, examining all cow-tracks until he finds the one he is -after; then sets off and follows it throughout its erratic course, and -ultimately tracks it to the stable where B. has hidden the cow. Now -wherein does one cow-track differ from another? There must be a -difference, or the tracker could not have performed the feat; a -difference minute, shadowy, and not detectible by you or me, or by the -late Sherlock Holmes, and yet discernible by a member of a race charged -by some people with occupying the bottom place in the gradations of human -intelligence. - - - - -CHAPTER XVIII. - -It is easier to stay out than get out. - --Pudd'nhead Wilson's New Calendar. - -The train was now exploring a beautiful hill country, and went twisting -in and out through lovely little green valleys. There were several -varieties of gum trees; among them many giants. Some of them were bodied -and barked like the sycamore; some were of fantastic aspect, and reminded -one of the quaint apple trees in Japanese pictures. And there was one -peculiarly beautiful tree whose name and breed I did not know. The -foliage seemed to consist of big bunches of pine-spines, the lower half -of each bunch a rich brown or old-gold color, the upper half a most vivid -and strenuous and shouting green. The effect was altogether bewitching. -The tree was apparently rare. I should say that the first and last -samples of it seen by us were not more than half an hour apart. There -was another tree of striking aspect, a kind of pine, we were told. Its -foliage was as fine as hair, apparently, and its mass sphered itself -above the naked straight stem like an explosion of misty smoke. It was -not a sociable sort; it did not gather in groups or couples, but each -individual stood far away from its nearest neighbor. It scattered itself -in this spacious and exclusive fashion about the slopes of swelling -grassy great knolls, and stood in the full flood of the wonderful -sunshine; and as far as you could see the tree itself you could also see -the ink-black blot of its shadow on the shining green carpet at its feet. - -On some part of this railway journey we saw gorse and broom--importations -from England--and a gentleman who came into our compartment on a visit -tried to tell me which--was which; but as he didn't know, he had -difficulty. He said he was ashamed of his ignorance, but that he had -never been confronted with the question before during the fifty years and -more that he had spent in Australia, and so he had never happened to get -interested in the matter. But there was no need to be ashamed. The most -of us have his defect. We take a natural interest in novelties, but it -is against nature to take an interest in familiar things. The gorse and -the broom were a fine accent in the landscape. Here and there they burst -out in sudden conflagrations of vivid yellow against a background of -sober or sombre color, with a so startling effect as to make a body catch -his breath with the happy surprise of it. And then there was the wattle, -a native bush or tree, an inspiring cloud of sumptuous yellow bloom. It -is a favorite with the Australians, and has a fine fragrance, a quality -usually wanting in Australian blossoms. - -The gentleman who enriched me with the poverty of his formation about the -gorse and the broom told me that he came out from England a youth of -twenty and entered the Province of South Australia with thirty-six -shillings in his pocket--an adventurer without trade, profession, or -friends, but with a clearly-defined purpose in his head: he would stay -until he was worth L200, then go back home. He would allow himself five -years for the accumulation of this fortune. - -"That was more than fifty years ago," said he. "And here I am, yet." - -As he went out at the door he met a friend, and turned and introduced him -to me, and the friend and I had a talk and a smoke. I spoke of the -previous conversation and said there something very pathetic about this -half century of exile, and that I wished the L200 scheme had succeeded. - -"With him? Oh, it did. It's not so sad a case. He is modest, and he -left out some of the particulars. The lad reached South Australia just -in time to help discover the Burra-Burra copper mines. They turned out -L700,000 in the first three years. Up to now they have yielded -L120,000,000. He has had his share. Before that boy had been in the -country two years he could have gone home and bought a village; he could -go now and buy a city, I think. No, there is nothing very pathetic about -his case. He and his copper arrived at just a handy time to save South -Australia. It had got mashed pretty flat under the collapse of a land -boom a while before." There it is again; picturesque history ---Australia's specialty. In 1829 South Australia hadn't a white man in it. -In 1836 the British Parliament erected it--still a solitude--into a -Province, and gave it a governor and other governmental machinery. -Speculators took hold, now, and inaugurated a vast land scheme, and -invited immigration, encouraging it with lurid promises of sudden wealth. -It was well worked in London; and bishops, statesmen, and all ports of -people made a rush for the land company's shares. Immigrants soon began -to pour into the region of Adelaide and select town lots and farms in the -sand and the mangrove swamps by the sea. The crowds continued to come, -prices of land rose high, then higher and still higher, everybody was -prosperous and happy, the boom swelled into gigantic proportions. A -village of sheet iron huts and clapboard sheds sprang up in the sand, and -in these wigwams fashion made display; richly-dressed ladies played on -costly pianos, London swells in evening dress and patent-leather boots -were abundant, and this fine society drank champagne, and in other ways -conducted itself in this capital of humble sheds as it had been -accustomed to do in the aristocratic quarters of the metropolis of the -world. The provincial government put up expensive buildings for its own -use, and a palace with gardens for the use of its governor. The governor -had a guard, and maintained a court. Roads, wharves, and hospitals were -built. All this on credit, on paper, on wind, on inflated and fictitious -values--on the boom's moonshine, in fact. This went on handsomely during -four or five years. Then of a sudden came a smash. Bills for a huge -amount drawn the governor upon the Treasury were dishonored, the land -company's credit went up in smoke, a panic followed, values fell with a -rush, the frightened immigrants seized their grips and fled to other -lands, leaving behind them a good imitation of a solitude, where lately -had been a buzzing and populous hive of men. - -Adelaide was indeed almost empty; its population had fallen to 3,000. -During two years or more the death-trance continued. Prospect of revival -there was none; hope of it ceased. Then, as suddenly as the paralysis -had come, came the resurrection from it. Those astonishingly rich copper -mines were discovered, and the corpse got up and danced. - -The wool production began to grow; grain-raising followed--followed so -vigorously, too, that four or five years after the copper discovery, this -little colony, which had had to import its breadstuffs formerly, and pay -hard prices for them--once $50 a barrel for flour--had become an exporter -of grain. - -The prosperities continued. After many years Providence, desiring to -show especial regard for New South Wales and exhibit loving interest in -its welfare which should certify to all nations the recognition of that -colony's conspicuous righteousness and distinguished well-deserving, -conferred upon it that treasury of inconceivable riches, Broken Hill; and -South Australia went over the border and took it, giving thanks. - -Among our passengers was an American with a unique vocation. Unique is a -strong word, but I use it justifiably if I did not misconceive what the -American told me; for I understood him to say that in the world there was -not another man engaged in the business which he was following. He was -buying the kangaroo-skin crop; buying all of it, both the Australian crop -and the Tasmanian; and buying it for an American house in New York. The -prices were not high, as there was no competition, but the year's -aggregate of skins would cost him L30,000. I had had the idea that the -kangaroo was about extinct in Tasmania and well thinned out on the -continent. In America the skins are tanned and made into shoes. After -the tanning, the leather takes a new name--which I have forgotten--I only -remember that the new name does not indicate that the kangaroo furnishes -the leather. There was a German competition for a while, some years ago, -but that has ceased. The Germans failed to arrive at the secret of -tanning the skins successfully, and they withdrew from the business. Now -then, I suppose that I have seen a man whose occupation is really -entitled to bear that high epithet--unique. And I suppose that there is -not another occupation in the world that is restricted to the hands of a -sole person. I can think of no instance of it. There is more than one -Pope, there is more than one Emperor, there is even more than one living -god, walking upon the earth and worshiped in all sincerity by large -populations of men. I have seen and talked with two of these Beings -myself in India, and I have the autograph of one of them. It can come -good, by and by, I reckon, if I attach it to a "permit." - -Approaching Adelaide we dismounted from the train, as the French say, and -were driven in an open carriage over the hills and along their slopes to -the city. It was an excursion of an hour or two, and the charm of it -could not be overstated, I think. The road wound around gaps and gorges, -and offered all varieties of scenery and prospect--mountains, crags, -country homes, gardens, forests--color, color, color everywhere, and the -air fine and fresh, the skies blue, and not a shred of cloud to mar the -downpour of the brilliant sunshine. And finally the mountain gateway -opened, and the immense plain lay spread out below and stretching away -into dim distances on every hand, soft and delicate and dainty and -beautiful. On its near edge reposed the city. - -We descended and entered. There was nothing to remind one of the humble -capital, of buts and sheds of the long-vanished day of the land-boom. -No, this was a modern city, with wide streets, compactly built; with fine -homes everywhere, embowered in foliage and flowers, and with imposing -masses of public buildings nobly grouped and architecturally beautiful. - -There was prosperity, in the air; for another boom was on. Providence, -desiring to show especial regard for the neighboring colony on the west -called Western Australia--and exhibit a loving interest in its welfare -which should certify to all nations the recognition of that colony's -conspicuous righteousness and distinguished well-deserving, had recently -conferred upon it that majestic treasury of golden riches, Coolgardie; -and now South Australia had gone around the corner and taken it, giving -thanks. Everything comes to him who is patient and good, and waits. - -But South Australia deserves much, for apparently she is a hospitable -home for every alien who chooses to come; and for his religion, too. -She has a population, as per the latest census, of only 320,000-odd, and -yet her varieties of religion indicate the presence within her borders of -samples of people from pretty nearly every part of the globe you can -think of. Tabulated, these varieties of religion make a remarkable show. -One would have to go far to find its match. I copy here this -cosmopolitan curiosity, and it comes from the published census: - -Church of England,........... 89,271 -Roman Catholic,.............. 47,179 -Wesleyan,.................... 49,159 -Lutheran,.................... 23,328 -Presbyterian,................ 18,206 -Congregationalist,........... 11,882 -Bible Christian,............. 15,762 -Primitive Methodist,......... 11,654 -Baptist,..................... 17,547 -Christian Brethren,.......... 465 -Methodist New Connexion,..... 39 -Unitarian,................... 688 -Church of Christ,............ 3,367 -Society of Friends,.......... 100 -Salvation Army,.............. 4,356 -New Jerusalem Church,........ 168 -Jews,........................ 840 -Protestants (undefined),..... 6,532 -Mohammedans,................. 299 -Confucians, etc.,............ 3,884 -Other religions,............. 1,719 -Object,...................... 6,940 -Not stated,.................. 8,046 - -Total,.......................320,431 - - -The item in the above list "Other religions" includes the following as -returned: - -Agnostics, -Atheists, -Believers in Christ, -Buddhists, -Calvinists, -Christadelphians, -Christians, -Christ's Chapel, -Christian Israelites, -Christian Socialists, -Church of God, -Cosmopolitans, -Deists, -Evangelists, -Exclusive Brethren, -Free Church, -Free Methodists, -Freethinkers, -Followers of Christ, -Gospel Meetings, -Greek Church, -Infidels, -Maronites, -Memnonists, -Moravians, -Mormons, -Naturalists, -Orthodox, -Others (indefinite), -Pagans, -Pantheists, -Plymouth Brethren, -Rationalists, -Reformers, -Secularists, -Seventh-day Adventists, -Shaker, -Shintoists, -Spiritualists, -Theosophists, -Town (City) Mission, -Welsh Church, -Huguenot, -Hussite, -Zoroastrians, -Zwinglian, - - -About 64 roads to the other world. You see how healthy the religious -atmosphere is. Anything can live in it. Agnostics, Atheists, -Freethinkers, Infidels, Mormons, Pagans, Indefinites they are all there. -And all the big sects of the world can do more than merely live in it: -they can spread, flourish, prosper. All except the Spiritualists and the -Theosophists. That is the most curious feature of this curious table. -What is the matter with the specter? Why do they puff him away? He is a -welcome toy everywhere else in the world. - - - - -CHAPTER XIX. - -Pity is for the living, Envy is for the dead. - --Pudd'nhead Wilson's New Calendar. - -The successor of the sheet-iron hamlet of the mangrove marshes has that -other Australian specialty, the Botanical Gardens. We cannot have these -paradises. The best we could do would be to cover a vast acreage under -glass and apply steam heat. But it would be inadequate, the lacks would -still be so great: the confined sense, the sense of suffocation, the -atmospheric dimness, the sweaty heat--these would all be there, in place -of the Australian openness to the sky, the sunshine and the breeze. -Whatever will grow under glass with us will flourish rampantly out of -doors in Australia.--[The greatest heat in Victoria, that there is an -authoritative record of, was at Sandhurst, in January, 1862. The -thermometer then registered 117 degrees in the shade. In January, 1880, -the heat at Adelaide, South Australia, was 172 degrees in the sun.] - -When the white man came the continent was nearly as poor, in variety of -vegetation, as the desert of Sahara; now it has everything that grows on -the earth. In fact, not Australia only, but all Australasia has levied -tribute upon the flora of the rest of the world; and wherever one goes -the results appear, in gardens private and public, in the woodsy walls of -the highways, and in even the forests. If you see a curious or beautiful -tree or bush or flower, and ask about it, the people, answering, usually -name a foreign country as the place of its origin--India, Africa, Japan, -China, England, America, Java, Sumatra, New Guinea, Polynesia, and so on. - -In the Zoological Gardens of Adelaide I saw the only laughing jackass -that ever showed any disposition to be courteous to me. This one opened -his head wide and laughed like a demon; or like a maniac who was consumed -with humorous scorn over a cheap and degraded pun. It was a very human -laugh. If he had been out of sight I could have believed that the -laughter came from a man. It is an odd-looking bird, with a head and -beak that are much too large for its body. In time man will exterminate -the rest of the wild creatures of Australia, but this one will probably -survive, for man is his friend and lets him alone. Man always has a good -reason for his charities towards wild things, human or animal when he has -any. In this case the bird is spared because he kills snakes. If L. J. -he will not kill all of them. - -In that garden I also saw the wild Australian dog--the dingo. He was a -beautiful creature--shapely, graceful, a little wolfish in some of his -aspects, but with a most friendly eye and sociable disposition. The -dingo is not an importation; he was present in great force when the -whites first came to the continent. It may be that he is the oldest dog -in the universe; his origin, his descent, the place where his ancestors -first appeared, are as unknown and as untraceable as are the camel's. -He is the most precious dog in the world, for he does not bark. But in -an evil hour he got to raiding the sheep-runs to appease his hunger, and -that sealed his doom. He is hunted, now, just as if he were a wolf. -He has been sentenced to extermination, and the sentence will be carried -out. This is all right, and not objectionable. The world was made for -man--the white man. - -South Australia is confusingly named. All of the colonies have a -southern exposure except one--Queensland. Properly speaking, South -Australia is middle Australia. It extends straight up through the center -of the continent like the middle board in a center-table. It is 2,000 -miles high, from south to north, and about a third as wide. A wee little -spot down in its southeastern corner contains eight or nine-tenths of its -population; the other one or two-tenths are elsewhere--as elsewhere as -they could be in the United States with all the country between Denver -and Chicago, and Canada and the Gulf of Mexico to scatter over. There is -plenty of room. - -A telegraph line stretches straight up north through that 2,000 miles of -wilderness and desert from Adelaide to Port Darwin on the edge of the -upper ocean. South Australia built the line; and did it in 1871-2 when -her population numbered only 185,000. It was a great work; for there -were no roads, no paths; 1,300 miles of the route had been traversed but -once before by white men; provisions, wire, and poles had to be carried -over immense stretches of desert; wells had to be dug along the route to -supply the men and cattle with water. - -A cable had been previously laid from Port Darwin to Java and thence to -India, and there was telegraphic communication with England from India. -And so, if Adelaide could make connection with Port Darwin it meant -connection with the whole world. The enterprise succeeded. One could -watch the London markets daily, now; the profit to the wool-growers of -Australia was instant and enormous. - -A telegram from Melbourne to San Francisco covers approximately 20,000 -miles--the equivalent of five-sixths of the way around the globe. It has -to halt along the way a good many times and be repeated; still, but -little time is lost. These halts, and the distances between them, are -here tabulated.--[From "Round the Empire." (George R. Parkin), all but -the last two.] - - Miles. - -Melbourne-Mount Gambier,.......300 -Mount Gambier-Adelaide,........270 -Adelaide-Port Augusta,.........200 -Port Augusta-Alice Springs...1,036 -Alice Springs-Port Darwin,.....898 -Port Darwin-Banjoewangie,... 1,150 -Banjoewangie-Batavia,..........480 -Batavia-Singapore,.............553 -Singapore-Penang,..............399 -Penang-Madras,...............1,280 -Madras-Bombay,.................650 -Bombay-Aden,.................1,662 -Aden-Suez,...................1,346 -Suez-Alexandria,...............224 -Alexandria-Malta,..............828 -Malta-Gibraltar,.............1,008 -Gibraltar-Falmouth,..........1,061 -Falmouth-London,...............350 -London-New York,.............2,500 -New York-San Francisco,......3,500 - - -I was in Adelaide again, some months later, and saw the multitudes gather -in the neighboring city of Glenelg to commemorate the Reading of the -Proclamation--in 1836--which founded the Province. If I have at any time -called it a Colony, I withdraw the discourtesy. It is not a Colony, it -is a Province; and officially so. Moreover, it is the only one so named -in Australasia. There was great enthusiasm; it was the Province's -national holiday, its Fourth of July, so to speak. It is the pre-eminent -holiday; and that is saying much, in a country where they seem to have a -most un-English mania for holidays. Mainly they are workingmen's -holidays; for in South Australia the workingman is sovereign; his vote is -the desire of the politician--indeed, it is the very breath of the -politician's being; the parliament exists to deliver the will of the -workingman, and the government exists to execute it. The workingman is a -great power everywhere in Australia, but South Australia is his paradise. -He has had a hard time in this world, and has earned a paradise. I am -glad he has found it. The holidays there are frequent enough to be -bewildering to the stranger. I tried to get the hang of the system, but -was not able to do it. - -You have seen that the Province is tolerant, religious-wise. It is so -politically, also. One of the speakers at the Commemoration banquet--the -Minister of Public Works-was an American, born and reared in New England. -There is nothing narrow about the Province, politically, or in any other -way that I know of. Sixty-four religions and a Yankee cabinet minister. -No amount of horse-racing can damn this community. - -The mean temperature of the Province is 62 deg. The death-rate is 13 in -the 1,000--about half what it is in the city of New York, I should think, -and New York is a healthy city. Thirteen is the death-rate for the -average citizen of the Province, but there seems to be no death-rate for -the old people. There were people at the Commemoration banquet who could -remember Cromwell. There were six of them. These Old Settlers had all -been present at the original Reading of the Proclamation, in 1536. They -showed signs of the blightings and blastings of time, in their outward -aspect, but they were young within; young and cheerful, and ready to -talk; ready to talk, and talk all you wanted; in their turn, and out of -it. They were down for six speeches, and they made 42. The governor and -the cabinet and the mayor were down for 42 speeches, and they made 6. -They have splendid grit, the Old Settlers, splendid staying power. But -they do not hear well, and when they see the mayor going through motions -which they recognize as the introducing of a speaker, they think they are -the one, and they all get up together, and begin to respond, in the most -animated way; and the more the mayor gesticulates, and shouts "Sit down! -Sit down!" the more they take it for applause, and the more excited and -reminiscent and enthusiastic they get; and next, when they see the whole -house laughing and crying, three of them think it is about the bitter -old-time hardships they are describing, and the other three think the -laughter is caused by the jokes they have been uncorking--jokes of the -vintage of 1836--and then the way they do go on! And finally when ushers -come and plead, and beg, and gently and reverently crowd them down into -their seats, they say, "Oh, I'm not tired--I could bang along a week!" -and they sit there looking simple and childlike, and gentle, and proud of -their oratory, and wholly unconscious of what is going on at the other -end of the room. And so one of the great dignitaries gets a chance, and -begins his carefully prepared speech, impressively and with solemnity-- - - "When we, now great and prosperous and powerful, bow our heads in - reverent wonder in the contemplation of those sublimities of energy, - of wisdom, of forethought, of----" - -Up come the immortal six again, in a body, with a joyous "Hey, I've -thought of another one!" and at it they go, with might and main, hearing -not a whisper of the pandemonium that salutes them, but taking all the -visible violences for applause, as before, and hammering joyously away -till the imploring ushers pray them into their seats again. And a pity, -too; for those lovely old boys did so enjoy living their heroic youth -over, in these days of their honored antiquity; and certainly the things -they had to tell were usually worth the telling and the hearing. - -It was a stirring spectacle; stirring in more ways than one, for it was -amazingly funny, and at the same time deeply pathetic; for they had seen -so much, these time-worn veterans, end had suffered so much; and had -built so strongly and well, and laid the foundations of their -commonwealth so deep, in liberty and tolerance; and had lived to see the -structure rise to such state and dignity and hear themselves so praised -for honorable work. - -One of these old gentlemen told me some things of interest afterward; -things about the aboriginals, mainly. He thought them intelligent ---remarkably so in some directions--and he said that along with their -unpleasant qualities they had some exceedingly good ones; and he -considered it a great pity that the race had died out. He instanced -their invention of the boomerang and the "weet-weet" as evidences of -their brightness; and as another evidence of it he said he had never seen -a white man who had cleverness enough to learn to do the miracles with -those two toys that the aboriginals achieved. He said that even the -smartest whites had been obliged to confess that they could not learn the -trick of the boomerang in perfection; that it had possibilities which -they could not master. The white man could not control its motions, -could not make it obey him; but the aboriginal could. He told me some -wonderful things--some almost incredible things--which he had seen the -blacks do with the boomerang and the weet-weet. They have been confirmed -to me since by other early settlers and by trustworthy books. - -It is contended--and may be said to be conceded--that the boomerang was -known to certain savage tribes in Europe in Roman times. In support of -this, Virgil and two other Roman poets are quoted. It is also contended -that it was known to the ancient Egyptians. - -One of two things either some one with is then apparent: a boomerang -arrived in Australia in the days of antiquity before European knowledge -of the thing had been lost, or the Australian aboriginal reinvented it. -It will take some time to find out which of these two propositions is the -fact. But there is no hurry. - - - - -CHAPTER XX. - -It is by the goodness of God that in our country we have those three -unspeakably precious things: freedom of speech, freedom of conscience, -and the prudence never to practice either of them. - --Pudd'nhead Wilson's New Calendar. - -From diary: - -Mr. G. called. I had not seen him since Nauheim, Germany--several years -ago; the time that the cholera broke out at Hamburg. We talked of the -people we had known there, or had casually met; and G. said: - -"Do you remember my introducing you to an earl--the Earl of C.?" - -"Yes. That was the last time I saw you. You and he were in a carriage, -just starting--belated--for the train. I remember it." - -"I remember it too, because of a thing which happened then which I was -not looking for. He had told me a while before, about a remarkable and -interesting Californian whom he had met and who was a friend of yours, -and said that if he should ever meet you he would ask you for some -particulars about that Californian. The subject was not mentioned that -day at Nauheim, for we were hurrying away, and there was no time; but the -thing that surprised me was this: when I induced you, you said, 'I am -glad to meet your lordship gain.' The I again' was the surprise. He is -a little hard of hearing, and didn't catch that word, and I thought you -hadn't intended that he should. As we drove off I had only time to say, -'Why, what do you know about him?' and I understood you to say, 'Oh, -nothing, except that he is the quickest judge of----' Then we were gone, -and I didn't get the rest. I wondered what it was that he was such a -quick judge of. I have thought of it many times since, and still -wondered what it could be. He and I talked it over, but could not guess -it out. He thought it must be fox-hounds or horses, for he is a good -judge of those--no one is a better. But you couldn't know that, because -you didn't know him; you had mistaken him for some one else; it must be -that, he said, because he knew you had never met him before. And of -course you hadn't had you?" - -"Yes, I had." - -"Is that so? Where?" - -"At a fox-hunt, in England." - -"How curious that is. Why, he hadn't the least recollection of it. Had -you any conversation with him?" - -"Some--yes." - -"Well, it left not the least impression upon him. What did you talk -about?" - -"About the fox. I think that was all." - -"Why, that would interest him; that ought to have left an impression. -What did he talk about?" - -"The fox." - -It's very curious. I don't understand it. Did what he said leave an -impression upon you?" - -"Yes. It showed me that he was a quick judge of--however, I will tell -you all about it, then you will understand. It was a quarter of a -century ago 1873 or '74. I had an American friend in London named F., -who was fond of hunting, and his friends the Blanks invited him and me to -come out to a hunt and be their guests at their country place. In the -morning the mounts were provided, but when I saw the horses I changed my -mind and asked permission to walk. I had never seen an English hunter -before, and it seemed to me that I could hunt a fox safer on the ground. -I had always been diffident about horses, anyway, even those of the -common altitudes, and I did not feel competent to hunt on a horse that -went on stilts. So then Mrs. Blank came to my help and said I could go -with her in the dog-cart and we would drive to a place she knew of, and -there we should have a good glimpse of the hunt as it went by. - -"When we got to that place I got out and went and leaned my elbows on a -low stone wall which enclosed a turfy and beautiful great field with -heavy wood on all its sides except ours. Mrs. Blank sat in the dog-cart -fifty yards away, which was as near as she could get with the vehicle. -I was full of interest, for I had never seen a fox-hunt. I waited, -dreaming and imagining, in the deep stillness and impressive tranquility -which reigned in that retired spot. Presently, from away off in the -forest on the left, a mellow bugle-note came floating; then all of a -sudden a multitude of dogs burst out of that forest and went tearing by -and disappeared in the forest on the right; there was a pause, and then -a cloud of horsemen in black caps and crimson coats plunged out of the -left-hand forest and went flaming across the field like a prairie-fire, -a stirring sight to see. There was one man ahead of the rest, and he -came spurring straight at me. He was fiercely excited. It was fine to -see him ride; he was a master horseman. He came like, a storm till he -was within seven feet of me, where I was leaning on the wall, then he -stood his horse straight up in the air on his hind toe-nails, and shouted -like a demon: - -"'Which way'd the fox go?' - -"I didn't much like the tone, but I did not let on; for he was excited, -you know. But I was calm; so I said softly, and without acrimony: - -"'Which fox?' - -"It seemed to anger him. I don't know why; and he thundered out: - -"'WHICH fox? Why, THE fox? Which way did the FOX go?' - -"I said, with great gentleness--even argumentatively: - -"'If you could be a little more definite--a little less vague--because I -am a stranger, and there are many foxes, as you will know even better -than I, and unless I know which one it is that you desire to identify, -and----' - -"'You're certainly the damdest idiot that has escaped in a thousand -years!' and he snatched his great horse around as easily as I would -snatch a cat, and was away like a hurricane. A very excitable man. - -"I went back to Mrs. Blank, and she was excited, too--oh, all alive. She -said: - -"'He spoke to you!--didn't he?' - -"'Yes, it is what happened.' - -"'I knew it! I couldn't hear what he said, but I knew be spoke to you! Do -you know who it was? It was Lord C., and he is Master of the Buckhounds! -Tell me--what do you think of him?' - -"'Him? Well, for sizing-up a stranger, he's got the most sudden and -accurate judgment of any man I ever saw.' - -"It pleased her. I thought it would." - -G. got away from Nauheim just in time to escape being shut in by the -quarantine-bars on the frontiers; and so did we, for we left the next -day. But G. had a great deal of trouble in getting by the Italian -custom-house, and we should have fared likewise but for the -thoughtfulness of our consul-general in Frankfort. He introduced me to -the Italian consul-general, and I brought away from that consulate a -letter which made our way smooth. It was a dozen lines merely commending -me in a general way to the courtesies of servants in his Italian -Majesty's service, but it was more powerful than it looked. In addition -to a raft of ordinary baggage, we had six or eight trunks which were -filled exclusively with dutiable stuff--household goods purchased in -Frankfort for use in Florence, where we had taken a house. I was going -to ship these through by express; but at the last moment an order went -throughout Germany forbidding the moving of any parcels by train unless -the owner went with them. This was a bad outlook. We must take these -things along, and the delay sure to be caused by the examination of them -in the custom-house might lose us our train. I imagined all sorts of -terrors, and enlarged them steadily as we approached the Italian -frontier. We were six in number, clogged with all that baggage, and I -was courier for the party the most incapable one they ever employed. - -We arrived, and pressed with the crowd into the immense custom-house, and -the usual worries began; everybody crowding to the counter and begging to -have his baggage examined first, and all hands clattering and chattering -at once. It seemed to me that I could do nothing; it would be better to -give it all up and go away and leave the baggage. I couldn't speak the -language; I should never accomplish anything. Just then a tall handsome -man in a fine uniform was passing by and I knew he must be the -station-master--and that reminded me of my letter. I ran to him and put -it into his hands. He took it out of the envelope, and the moment his -eye caught the royal coat of arms printed at its top, he took off his cap -and made a beautiful bow to me, and said in English: - -"Which is your baggage? Please show it to me." - -I showed him the mountain. Nobody was disturbing it; nobody was -interested in it; all the family's attempts to get attention to it had -failed--except in the case of one of the trunks containing the dutiable -goods. It was just being opened. My officer said: - -"There, let that alone! Lock it. Now chalk it. Chalk all of the lot. -Now please come and show the hand-baggage." - -He plowed through the waiting crowd, I following, to the counter, and he -gave orders again, in his emphatic military way: - -"Chalk these. Chalk all of them." - -Then he took off his cap and made that beautiful bow again, and went his -way. By this time these attentions had attracted the wonder of that acre -of passengers, and the whisper had gone around that the royal family were -present getting their baggage chalked; and as we passed down in review on -our way to the door, I was conscious of a pervading atmosphere of envy -which gave me deep satisfaction. - -But soon there was an accident. My overcoat pockets were stuffed with -German cigars and linen packages of American smoking tobacco, and a -porter was following us around with this overcoat on his arm, and -gradually getting it upside down. Just as I, in the rear of my family, -moved by the sentinels at the door, about three hatfuls of the tobacco -tumbled out on the floor. One of the soldiers pounced upon it, gathered -it up in his arms, pointed back whence I had come, and marched me ahead -of him past that long wall of passengers again--he chattering and -exulting like a devil, they smiling in peaceful joy, and I trying to look -as if my pride was not hurt, and as if I did not mind being brought to -shame before these pleased people who had so lately envied me. But at -heart I was cruelly humbled. - -When I had been marched two-thirds of the long distance and the misery of -it was at the worst, the stately station-master stepped out from -somewhere, and the soldier left me and darted after him and overtook him; -and I could see by the soldier's excited gestures that he was betraying -to him the whole shabby business. The station-master was plainly very -angry. He came striding down toward me, and when he was come near he -began to pour out a stream of indignant Italian; then suddenly took off -his hat and made that beautiful bow and said: - -"Oh, it is you! I beg a thousands pardons! This idiot here---" He turned -to the exulting soldier and burst out with a flood of white-hot Italian -lava, and the next moment he was bowing, and the soldier and I were -moving in procession again--he in the lead and ashamed, this time, I with -my chin up. And so we marched by the crowd of fascinated passengers, and -I went forth to the train with the honors of war. Tobacco and all. - - - - -CHAPTER XXI. - -Man will do many things to get himself loved, he will do all things to -get himself envied. - --Pudd'nhead Wilson's New Calendar. - -Before I saw Australia I had never heard of the "weet-weet" at all. -I met but few men who had seen it thrown--at least I met but few who -mentioned having seen it thrown. Roughly described, it is a fat wooden -cigar with its butt-end fastened to a flexible twig. The whole thing is -only a couple of feet long, and weighs less than two ounces. This -feather--so to call it--is not thrown through the air, but is flung with -an underhanded throw and made to strike the ground a little way in front -of the thrower; then it glances and makes a long skip; glances again, -skips again, and again and again, like the flat stone which a boy sends -skating over the water. The water is smooth, and the stone has a good -chance; so a strong man may make it travel fifty or seventy-five yards; -but the weet-weet has no such good chance, for it strikes sand, grass, -and earth in its course. Yet an expert aboriginal has sent it a measured -distance of two hundred and twenty yards. It would have gone even -further but it encountered rank ferns and underwood on its passage and -they damaged its speed. Two hundred and twenty yards; and so weightless -a toy--a mouse on the end of a bit of wire, in effect; and not sailing -through the accommodating air, but encountering grass and sand and stuff -at every jump. It looks wholly impossible; but Mr. Brough Smyth saw the -feat and did the measuring, and set down the facts in his book about -aboriginal life, which he wrote by command of the Victorian Government. - -What is the secret of the feat? No one explains. It cannot be physical -strength, for that could not drive such a feather-weight any distance. -It must be art. But no one explains what the art of it is; nor how it -gets around that law of nature which says you shall not throw any -two-ounce thing 220 yards, either through the air or bumping along the -ground. Rev. J. G. Woods says: - -"The distance to which the weet-weet or kangaroo-rat can be thrown is -truly astonishing. I have seen an Australian stand at one side of -Kennington Oval and throw the kangaroo rat completely across it." (Width -of Kensington Oval not stated.) "It darts through the air with the sharp -and menacing hiss of a rifle-ball, its greatest height from the ground -being some seven or eight feet . . . . . . When properly thrown it -looks just like a living animal leaping along . . . . . . Its -movements have a wonderful resemblance to the long leaps of a -kangaroo-rat fleeing in alarm, with its long tail trailing behind it." - -The Old Settler said that he had seen distances made by the weet-weet, in -the early days, which almost convinced him that it was as extraordinary -an instrument as the boomerang. - -There must have been a large distribution of acuteness among those naked -skinny aboriginals, or they couldn't have been such unapproachable -trackers and boomerangers and weet-weeters. It must have been -race-aversion that put upon them a good deal of the low-rate intellectual -reputation which they bear and have borne this long time in the world's -estimate of them. - -They were lazy--always lazy. Perhaps that was their trouble. It is a -killing defect. Surely they could have invented and built a competent -house, but they didn't. And they could have invented and developed the -agricultural arts, but they didn't. They went naked and houseless, and -lived on fish and grubs and worms and wild fruits, and were just plain -savages, for all their smartness. - -With a country as big as the United States to live and multiply in, and -with no epidemic diseases among them till the white man came with those -and his other appliances of civilization, it is quite probable that there -was never a day in his history when he could muster 100,000 of his race -in all Australia. He diligently and deliberately kept population down by -infanticide--largely; but mainly by certain other methods. He did not -need to practise these artificialities any more after the white man came. -The white man knew ways of keeping down population which were worth -several of his. The white man knew ways of reducing a native population -80 percent. in 20 years. The native had never seen anything as fine as -that before. - -For example, there is the case of the country now called Victoria--a -country eighty times as large as Rhode Island, as I have already said. -By the best official guess there were 4,500 aboriginals in it when the -whites came along in the middle of the 'Thirties. Of these, 1,000 lived -in Gippsland, a patch of territory the size of fifteen or sixteen Rhode -Islands: they did not diminish as fast as some of the other communities; -indeed, at the end of forty years there were still 200 of them left. The -Geelong tribe diminished more satisfactorily: from 173 persons it faded -to 34 in twenty years; at the end of another twenty the tribe numbered -one person altogether. The two Melbourne tribes could muster almost 300 -when the white man came; they could muster but twenty, thirty-seven years -later, in 1875. In that year there were still odds and ends of tribes -scattered about the colony of Victoria, but I was told that natives of -full blood are very scarce now. It is said that the aboriginals continue -in some force in the huge territory called Queensland. - -The early whites were not used to savages. They could not understand the -primary law of savage life: that if a man do you a wrong, his whole tribe -is responsible--each individual of it--and you may take your change out -of any individual of it, without bothering to seek out the guilty one. -When a white killed an aboriginal, the tribe applied the ancient law, and -killed the first white they came across. To the whites this was a -monstrous thing. Extermination seemed to be the proper medicine for such -creatures as this. They did not kill all the blacks, but they promptly -killed enough of them to make their own persons safe. From the dawn of -civilization down to this day the white man has always used that very -precaution. Mrs. Campbell Praed lived in Queensland, as a child, in the -early days, and in her "Sketches of Australian life," we get informing -pictures of the early struggles of the white and the black to reform each -other. - -Speaking of pioneer days in the mighty wilderness of Queensland, Mrs. -Praed says: - - "At first the natives retreated before the whites; and, except that - they every now and then speared a beast in one of the herds, gave - little cause for uneasiness. But, as the number of squatters - increased, each one taking up miles of country and bringing two or - three men in his train, so that shepherds' huts and stockmen's camps - lay far apart, and defenseless in the midst of hostile tribes, the - Blacks' depredations became more frequent and murder was no unusual - event. - - "The loneliness of the Australian bush can hardly be painted in - words. Here extends mile after mile of primeval forest where - perhaps foot of white man has never trod--interminable vistas where - the eucalyptus trees rear their lofty trunks and spread forth their - lanky limbs, from which the red gum oozes and hangs in fantastic - pendants like crimson stalactites; ravines along the sides of which - the long-bladed grass grows rankly; level untimbered plains - alternating with undulating tracts of pasture, here and there broken - by a stony ridge, steep gully, or dried-up creek. All wild, vast - and desolate; all the same monotonous gray coloring, except where - the wattle, when in blossom, shows patches of feathery gold, or a - belt of scrub lies green, glossy, and impenetrable as Indian jungle. - - "The solitude seems intensified by the strange sounds of reptiles, - birds, and insects, and by the absence of larger creatures; of which - in the day-time, the only audible signs are the stampede of a herd - of kangaroo, or the rustle of a wallabi, or a dingo stirring the - grass as it creeps to its lair. But there are the whirring of - locusts, the demoniac chuckle of the laughing jack-ass, the - screeching of cockatoos and parrots, the hissing of the frilled - lizard, and the buzzing of innumerable insects hidden under the - dense undergrowth. And then at night, the melancholy wailing of the - curlews, the dismal howling of dingoes, the discordant croaking of - tree-frogs, might well shake the nerves of the solitary watcher." - -That is the theater for the drama. When you comprehend one or two other -details, you will perceive how well suited for trouble it was, and how -loudly it invited it. The cattlemen's stations were scattered over that -profound wilderness miles and miles apart--at each station half a dozen -persons. There was a plenty of cattle, the black natives were always -ill-nourished and hungry. The land belonged to them. The whites had not -bought it, and couldn't buy it; for the tribes had no chiefs, nobody in -authority, nobody competent to sell and convey; and the tribes themselves -had no comprehension of the idea of transferable ownership of land. The -ousted owners were despised by the white interlopers, and this opinion -was not hidden under a bushel. More promising materials for a tragedy -could not have been collated. Let Mrs. Praed speak: - - "At Nie station, one dark night, the unsuspecting hut-keeper, - having, as he believed, secured himself against assault, was lying - wrapped in his blankets sleeping profoundly. The Blacks crept - stealthily down the chimney and battered in his skull while he - slept." - -One could guess the whole drama from that little text. The curtain was -up. It would not fall until the mastership of one party or the other was -determined--and permanently: - - "There was treachery on both sides. The Blacks killed the Whites - when they found them defenseless, and the Whites slew the Blacks in - a wholesale and promiscuous fashion which offended against my - childish sense of justice. - - "They were regarded as little above the level of brutes, and in some - cases were destroyed like vermin. - - "Here is an instance. A squatter, whose station was surrounded by - Blacks, whom he suspected to be hostile and from whom he feared an - attack, parleyed with them from his house-door. He told them it was - Christmas-time--a time at which all men, black or white, feasted; - that there were flour, sugar-plums, good things in plenty in the - store, and that he would make for them such a pudding as they had - never dreamed of--a great pudding of which all might eat and be - filled. The Blacks listened and were lost. The pudding was made - and distributed. Next morning there was howling in the camp, for it - had been sweetened with sugar and arsenic!" - -The white man's spirit was right, but his method was wrong. His spirit -was the spirit which the civilized white has always exhibited toward the -savage, but the use of poison was a departure from custom. True, it was -merely a technical departure, not a real one; still, it was a departure, -and therefore a mistake, in my opinion. It was better, kinder, swifter, -and much more humane than a number of the methods which have been -sanctified by custom, but that does not justify its employment. That is, -it does not wholly justify it. Its unusual nature makes it stand out and -attract an amount of attention which it is not entitled to. It takes -hold upon morbid imaginations and they work it up into a sort of -exhibition of cruelty, and this smirches the good name of our -civilization, whereas one of the old harsher methods would have had no -such effect because usage has made those methods familiar to us and -innocent. In many countries we have chained the savage and starved him -to death; and this we do not care for, because custom has inured us to -it; yet a quick death by poison is loving-kindness to it. In many -countries we have burned the savage at the stake; and this we do not care -for, because custom has inured us to it; yet a quick death is -loving-kindness to it. In more than one country we have hunted the -savage and his little children and their mother with dogs and guns -through the woods and swamps for an afternoon's sport, and filled the -region with happy laughter over their sprawling and stumbling flight, and -their wild supplications for mercy; but this method we do not mind, -because custom has inured us to it; yet a quick death by poison is -loving-kindness to it. In many countries we have taken the savage's land -from him, and made him our slave, and lashed him every day, and broken -his pride, and made death his only friend, and overworked him till he -dropped in his tracks; and this we do not care for, because custom has -inured us to it; yet a quick death by poison is loving-kindness to it. -In the Matabeleland today--why, there we are confining ourselves to -sanctified custom, we Rhodes-Beit millionaires in South Africa and Dukes -in London; and nobody cares, because we are used to the old holy customs, -and all we ask is that no notice-inviting new ones shall be intruded upon -the attention of our comfortable consciences. Mrs. Praed says of the -poisoner, "That squatter deserves to have his name handed down to the -contempt of posterity." - -I am sorry to hear her say that. I myself blame him for one thing, and -severely, but I stop there. I blame him for, the indiscretion of -introducing a novelty which was calculated to attract attention to our -civilization. There was no occasion to do that. It was his duty, and it -is every loyal man's duty to protect that heritage in every way he can; -and the best way to do that is to attract attention elsewhere. The -squatter's judgment was bad--that is plain; but his heart was right. He -is almost the only pioneering representative of civilization in history -who has risen above the prejudices of his caste and his heredity and -tried to introduce the element of mercy into the superior race's dealings -with the savage. His name is lost, and it is a pity; for it deserves to -be handed down to posterity with homage and reverence. - -This paragraph is from a London journal: - - "To learn what France is doing to spread the blessings of - civilization in her distant dependencies we may turn with advantage - to New Caledonia. With a view to attracting free settlers to that - penal colony, M. Feillet, the Governor, forcibly expropriated the - Kanaka cultivators from the best of their plantations, with a - derisory compensation, in spite of the protests of the Council - General of the island. Such immigrants as could be induced to cross - the seas thus found themselves in possession of thousands of coffee, - cocoa, banana, and bread-fruit trees, the raising of which had cost - the wretched natives years of toil whilst the latter had a few - five-franc pieces to spend in the liquor stores of Noumea." - -You observe the combination? It is robbery, humiliation, and slow, slow -murder, through poverty and the white man's whisky. The savage's gentle -friend, the savage's noble friend, the only magnanimous and unselfish -friend the savage has ever had, was not there with the merciful swift -release of his poisoned pudding. - -There are many humorous things in the world; among them the white man's -notion that he is less savage than the other savages.--[See Chapter on -Tasmania, post.] - - - - -CHAPTER XXII. - -Nothing is so ignorant as a man's left hand, except a lady's watch. - - --Pudd'nhead Wilson's New Calendar. - -You notice that Mrs. Praed knows her art. She can place a thing before -you so that you can see it. She is not alone in that. Australia is -fertile in writers whose books are faithful mirrors of the life of the -country and of its history. The materials were surprisingly rich, both -in quality and in mass, and Marcus Clarke, Ralph Boldrewood, Cordon, -Kendall, and the others, have built out of them a brilliant and vigorous -literature, and one which must endure. Materials--there is no end to -them! Why, a literature might be made out of the aboriginal all by -himself, his character and ways are so freckled with varieties--varieties -not staled by familiarity, but new to us. You do not need to invent any -picturesquenesses; whatever you want in that line he can furnish you; and -they will not be fancies and doubtful, but realities and authentic. In -his history, as preserved by the white man's official records, he is -everything--everything that a human creature can be. He covers the -entire ground. He is a coward--there are a thousand fact to prove it. -He is brave--there are a thousand facts to prove it. He is treacherous ---oh, beyond imagination! he is faithful, loyal, true--the white man's -records supply you with a harvest of instances of it that are noble, -worshipful, and pathetically beautiful. He kills the starving stranger -who comes begging for food and shelter there is proof of it. He succors, -and feeds, and guides to safety, to-day, the lost stranger who fired on -him only yesterday--there is proof of it. He takes his reluctant bride -by force, he courts her with a club, then loves her faithfully through a -long life--it is of record. He gathers to himself another wife by the -same processes, beats and bangs her as a daily diversion, and by and by -lays down his life in defending her from some outside harm--it is of -record. He will face a hundred hostiles to rescue one of his children, -and will kill another of his children because the family is large enough -without it. His delicate stomach turns, at certain details of the white -man's food; but he likes over-ripe fish, and brazed dog, and cat, and -rat, and will eat his own uncle with relish. He is a sociable animal, -yet he turns aside and hides behind his shield when his mother-in-law -goes by. He is childishly afraid of ghosts and other trivialities that -menace his soul, but dread of physical pain is a weakness which he is not -acquainted with. He knows all the great and many of the little -constellations, and has names for them; he has a symbol-writing by means -of which he can convey messages far and wide among the tribes; he has a -correct eye for form and expression, and draws a good picture; he can -track a fugitive by delicate traces which the white man's eye cannot -discern, and by methods which the finest white intelligence cannot -master; he makes a missile which science itself cannot duplicate without -the model--if with it; a missile whose secret baffled and defeated the -searchings and theorizings of the white mathematicians for seventy years; -and by an art all his own he performs miracles with it which the white -man cannot approach untaught, nor parallel after teaching. Within -certain limits this savage's intellect is the alertest and the brightest -known to history or tradition; and yet the poor creature was never able -to invent a counting system that would reach above five, nor a vessel -that he could boil water in. He is the prize-curiosity of all the races. -To all intents and purposes he is dead--in the body; but he has features -that will live in literature. - -Mr. Philip Chauncy, an officer of the Victorian Government, contributed -to its archives a report of his personal observations of the aboriginals -which has in it some things which I wish to condense slightly and insert -here. He speaks of the quickness of their eyes and the accuracy of their -judgment of the direction of approaching missiles as being quite -extraordinary, and of the answering suppleness and accuracy of limb and -muscle in avoiding the missile as being extraordinary also. He has seen -an aboriginal stand as a target for cricket-balls thrown with great force -ten or fifteen yards, by professional bowlers, and successfully dodge -them or parry them with his shield during about half an hour. One of -those balls, properly placed, could have killed him; "Yet he depended, -with the utmost self-possession, on the quickness of his eye and his -agility." - -The shield was the customary war-shield of his race, and would not be a -protection to you or to me. It is no broader than a stovepipe, and is -about as long as a man's arm. The opposing surface is not flat, but -slopes away from the centerline like a boat's bow. The difficulty about -a cricket-ball that has been thrown with a scientific "twist" is, that it -suddenly changes it course when it is close to its target and comes -straight for the mark when apparently it was going overhead or to one -side. I should not be able to protect myself from such balls for -half-an-hour, or less. - -Mr. Chauncy once saw "a little native man" throw a cricket-ball 119 -yards. This is said to beat the English professional record by thirteen -yards. - -We have all seen the circus-man bound into the air from a spring-board -and make a somersault over eight horses standing side by side. Mr. -Chauncy saw an aboriginal do it over eleven; and was assured that he had -sometimes done it over fourteen. But what is that to this: - - "I saw the same man leap from the ground, and in going over he - dipped his head, unaided by his hands, into a hat placed in an - inverted position on the top of the head of another man sitting - upright on horseback--both man and horse being of the average size. - The native landed on the other side of the horse with the hat fairly - on his head. The prodigious height of the leap, and the precision - with which it was taken so as to enable him to dip his head into the - hat, exceeded any feat of the kind I have ever beheld." - -I should think so! On board a ship lately I saw a young Oxford athlete -run four steps and spring into the air and squirm his hips by a -side-twist over a bar that was five and one-half feet high; but he could -not have stood still and cleared a bar that was four feet high. I know -this, because I tried it myself. - -One can see now where the kangaroo learned its art. - -Sir George Grey and Mr. Eyre testify that the natives dug wells fourteen -or fifteen feet deep and two feet in diameter at the bore--dug them in -the sand--wells that were "quite circular, carried straight down, and the -work beautifully executed." - -Their tools were their hands and feet. How did they throw sand out from -such a depth? How could they stoop down and get it, with only two feet -of space to stoop in? How did they keep that sand-pipe from caving in -on them? I do not know. Still, they did manage those seeming -impossibilities. Swallowed the sand, may be. - -Mr. Chauncy speaks highly of the patience and skill and alert -intelligence of the native huntsman when he is stalking the emu, the -kangaroo, and other game: - - "As he walks through the bush his step is light, elastic, and - noiseless; every track on the earth catches his keen eye; a leaf, or - fragment of a stick turned, or a blade of grass recently bent by the - tread of one of the lower animals, instantly arrests his attention; - in fact, nothing escapes his quick and powerful sight on the ground, - in the trees, or in the distance, which may supply him with a meal - or warn him of danger. A little examination of the trunk of a tree - which may be nearly covered with the scratches of opossums ascending - and descending is sufficient to inform him whether one went up the - night before without coming down again or not." - -Fennimore Cooper lost his chance. He would have known how to value these -people. He wouldn't have traded the dullest of them for the brightest -Mohawk he ever invented. - -All savages draw outline pictures upon bark; but the resemblances are not -close, and expression is usually lacking. But the Australian -aboriginal's pictures of animals were nicely accurate in form, attitude, -carriage; and he put spirit into them, and expression. And his pictures -of white people and natives were pretty nearly as good as his pictures of -the other animals. He dressed his whites in the fashion of their day, -both the ladies and the gentlemen. As an untaught wielder of the pencil -it is not likely that he has had his equal among savage people. - -His place in art--as to drawing, not color-work--is well up, all things -considered. His art is not to be classified with savage art at all, but -on a plane two degrees above it and one degree above the lowest plane of -civilized art. To be exact, his place in art is between Botticelli and -De Maurier. That is to say, he could not draw as well as De Maurier but -better than Boticelli. In feeling, he resembles both; also in grouping -and in his preferences in the matter of subjects. His "corrobboree" of -the Australian wilds reappears in De Maurier's Belgravian ballrooms, with -clothes and the smirk of civilization added; Botticelli's "Spring" is the -"corrobboree" further idealized, but with fewer clothes and more smirk. -And well enough as to intention, but--my word! - -The aboriginal can make a fire by friction. I have tried that. - -All savages are able to stand a good deal of physical pain. The -Australian aboriginal has this quality in a well-developed degree. Do -not read the following instances if horrors are not pleasant to you. -They were recorded by the Rev. Henry N. Wolloston, of Melbourne, who had -been a surgeon before he became a clergyman: - - 1. "In the summer of 1852 I started on horseback from Albany, King - George's Sound, to visit at Cape Riche, accompanied by a native on - foot. We traveled about forty miles the first day, then camped by a - water-hole for the night. After cooking and eating our supper, I - observed the native, who had said nothing to me on the subject, - collect the hot embers of the fire together, and deliberately place - his right foot in the glowing mass for a moment, then suddenly - withdraw it, stamping on the ground and uttering a long-drawn - guttural sound of mingled pain and satisfaction. This operation he - repeated several times. On my inquiring the meaning of his strange - conduct, he only said, 'Me carpenter-make 'em' ('I am mending my - foot'), and then showed me his charred great toe, the nail of which - had been torn off by a tea-tree stump, in which it had been caught - during the journey, and the pain of which he had borne with stoical - composure until the evening, when he had an opportunity of - cauterizing the wound in the primitive manner above described." - -And he proceeded on the journey the next day, "as if nothing had -happened"--and walked thirty miles. It was a strange idea, to keep a -surgeon and then do his own surgery. - - 2. "A native about twenty-five years of age once applied to me, as - a doctor, to extract the wooden barb of a spear, which, during a - fight in the bush some four months previously, had entered his - chest, just missing the heart, and penetrated the viscera to a - considerable depth. The spear had been cut off, leaving the barb - behind, which continued to force its way by muscular action - gradually toward the back; and when I examined him I could feel a - hard substance between the ribs below the left blade-bone. I made a - deep incision, and with a pair of forceps extracted the barb, which - was made, as usual, of hard wood about four inches long and from - half an inch to an inch thick. It was very smooth, and partly - digested, so to speak, by the maceration to which it had been - exposed during its four months' journey through the body. The wound - made by the spear had long since healed, leaving only a small - cicatrix; and after the operation, which the native bore without - flinching, he appeared to suffer no pain. Indeed, judging from his - good state of health, the presence of the foreign matter did not - materially annoy him. He was perfectly well in a few days." - -But No. 3 is my favorite. Whenever I read it I seem to enjoy all that -the patient enjoyed--whatever it was: - - 3. "Once at King George's Sound a native presented himself to me - with one leg only, and requested me to supply him with a wooden leg. - He had traveled in this maimed state about ninety-six miles, for - this purpose. I examined the limb, which had been severed just - below the knee, and found that it had been charred by fire, while - about two inches of the partially calcined bone protruded through - the flesh. I at once removed this with the saw; and having made as - presentable a stump of it as I could, covered the amputated end of - the bone with a surrounding of muscle, and kept the patient a few - days under my care to allow the wound to heal. On inquiring, the - native told me that in a fight with other black-fellows a spear had - struck his leg and penetrated the bone below the knee. Finding it - was serious, he had recourse to the following crude and barbarous - operation, which it appears is not uncommon among these people in - their native state. He made a fire, and dug a hole in the earth - only sufficiently large to admit his leg, and deep enough to allow - the wounded part to be on a level with the surface of the ground. - He then surrounded the limb with the live coals or charcoal, which - was replenished until the leg was literally burnt off. The - cauterization thus applied completely checked the hemorrhage, and he - was able in a day or two to hobble down to the Sound, with the aid - of a long stout stick, although he was more than a week on the - road." - -But he was a fastidious native. He soon discarded the wooden leg made -for him by the doctor, because "it had no feeling in it." It must have -had as much as the one he burnt off, I should think. - -So much for the Aboriginals. It is difficult for me to let them alone. -They are marvelously interesting creatures. For a quarter of a century, -now, the several colonial governments have housed their remnants in -comfortable stations, and fed them well and taken good care of them in -every way. If I had found this out while I was in Australia I could have -seen some of those people--but I didn't. I would walk thirty miles to -see a stuffed one. - -Australia has a slang of its own. This is a matter of course. The vast -cattle and sheep industries, the strange aspects of the country, and the -strange native animals, brute and human, are matters which would -naturally breed a local slang. I have notes of this slang somewhere, but -at the moment I can call to mind only a few of the words and phrases. -They are expressive ones. The wide, sterile, unpeopled deserts have -created eloquent phrases like "No Man's Land" and the "Never-never -Country." Also this felicitous form: "She lives in the Never-never -Country"--that is, she is an old maid. And this one is not without -merit: "heifer-paddock"--young ladies' seminary. "Bail up" and "stick -up" equivalent of our highwayman-term to "hold up" a stage-coach or a -train. "New-chum" is the equivalent of our "tenderfoot"--new arrival. - -And then there is the immortal "My word!" "We must import it." -"M-y word!" - -"In cold print it is the equivalent of our "Ger-rreat Caesar!" but spoken -with the proper Australian unction and fervency, it is worth six of it -for grace and charm and expressiveness. Our form is rude and explosive; -it is not suited to the drawing-room or the heifer-paddock; but "M-y -word!" is, and is music to the ear, too, when the utterer knows how to -say it. I saw it in print several times on the Pacific Ocean, but it -struck me coldly, it aroused no sympathy. That was because it was the -dead corpse of the thing, the 'soul was not there--the tones were -lacking--the informing spirit--the deep feeling--the eloquence. But the -first time I heard an Australian say it, it was positively thrilling. - - - - -CHAPTER XXIII. - -Be careless in your dress if you must, but keep a tidy soul. - --Pudd'nhead Wilson's New Calendar. - -We left Adelaide in due course, and went to Horsham, in the colony of -Victoria; a good deal of a journey, if I remember rightly, but pleasant. -Horsham sits in a plain which is as level as a floor--one of those famous -dead levels which Australian books describe so often; gray, bare, sombre, -melancholy, baked, cracked, in the tedious long drouths, but a -horizonless ocean of vivid green grass the day after a rain. A country -town, peaceful, reposeful, inviting, full of snug homes, with garden -plots, and plenty of shrubbery and flowers. - -"Horsham, October 17. -At the hotel. The weather divine. Across the way, in front of the -London Bank of Australia, is a very handsome cottonwood. It is in -opulent leaf, and every leaf perfect. The full power of the on-rushing -spring is upon it, and I imagine I can see it grow. Alongside the bank -and a little way back in the garden there is a row of soaring -fountain-sprays of delicate feathery foliage quivering in the breeze, and -mottled with flashes of light that shift and play through the mass like -flash-lights through an opal--a most beautiful tree, and a striking -contrast to the cottonwood. Every leaf of the cottonwood is distinctly -defined--it is a kodak for faithful, hard, unsentimental detail; the -other an impressionist picture, delicious to look upon, full of a subtle -and exquisite charm, but all details fused in a swoon of vague and soft -loveliness." - -It turned out, upon inquiry, to be a pepper tree--an importation from -China. It has a silky sheen, soft and rich. I saw some that had long -red bunches of currant-like berries ambushed among the foliage. At a -distance, in certain lights, they give the tree a pinkish tint and a new -charm. - -There is an agricultural college eight miles from Horsham. We were -driven out to it by its chief. The conveyance was an open wagon; the -time, noonday; no wind; the sky without a cloud, the sunshine brilliant ---and the mercury at 92 deg. in the shade. In some countries an indolent -unsheltered drive of an hour and a half under such conditions would have -been a sweltering and prostrating experience; but there was nothing of -that in this case. It is a climate that is perfect. There was no sense -of heat; indeed, there was no heat; the air was fine and pure and -exhilarating; if the drive had lasted half a day I think we should not -have felt any discomfort, or grown silent or droopy or tired. Of course, -the secret of it was the exceeding dryness of the atmosphere. In that -plain 112 deg. in the shade is without doubt no harder upon a man than is -88 or 90 deg. in New York. - -The road lay through the middle of an empty space which seemed to me to -be a hundred yards wide between the fences. I was not given the width in -yards, but only in chains and perches--and furlongs, I think. I would -have given a good deal to know what the width was, but I did not pursue -the matter. I think it is best to put up with information the way you -get it; and seem satisfied with it, and surprised at it, and grateful for -it, and say, "My word!" and never let on. It was a wide space; I could -tell you how wide, in chains and perches and furlongs and things, but -that would not help you any. Those things sound well, but they are -shadowy and indefinite, like troy weight and avoirdupois; nobody knows -what they mean. When you buy a pound of a drug and the man asks you -which you want, troy or avoirdupois, it is best to say "Yes," and shift -the subject. - -They said that the wide space dates from the earliest sheep and -cattle-raising days. People had to drive their stock long distances ---immense journeys--from worn-out places to new ones where were water -and fresh pasturage; and this wide space had to be left in grass and -unfenced, or the stock would have starved to death in the transit. - -On the way we saw the usual birds--the beautiful little green parrots, -the magpie, and some others; and also the slender native bird of modest -plumage and the eternally-forgettable name--the bird that is the smartest -among birds, and can give a parrot 30 to 1 in the game and then talk him -to death. I cannot recall that bird's name. I think it begins with M. -I wish it began with G. or something that a person can remember. - -The magpie was out in great force, in the fields and on the fences. He -is a handsome large creature, with snowy white decorations, and is a -singer; he has a murmurous rich note that is lovely. He was once modest, -even diffident; but he lost all that when he found out that he was -Australia's sole musical bird. He has talent, and cuteness, and -impudence; and in his tame state he is a most satisfactory pet--never -coming when he is called, always coming when he isn't, and studying -disobedience as an accomplishment. He is not confined, but loafs all -over the house and grounds, like the laughing jackass. I think he learns -to talk, I know he learns to sing tunes, and his friends say that he -knows how to steal without learning. I was acquainted with a tame magpie -in Melbourne. He had lived in a lady's house several years, and believed -he owned it. The lady had tamed him, and in return he had tamed the -lady. He was always on deck when not wanted, always having his own way, -always tyrannizing over the dog, and always making the cat's life a slow -sorrow and a martyrdom. He knew a number of tunes and could sing them in -perfect time and tune; and would do it, too, at any time that silence was -wanted; and then encore himself and do it again; but if he was asked to -sing he would go out and take a walk. - -It was long believed that fruit trees would not grow in that baked and -waterless plain around Horsham, but the agricultural college has -dissipated that idea. Its ample nurseries were producing oranges, -apricots, lemons, almonds, peaches, cherries, 48 varieties of apples--in -fact, all manner of fruits, and in abundance. The trees did not seem to -miss the water; they were in vigorous and flourishing condition. - -Experiments are made with different soils, to see what things thrive best -in them and what climates are best for them. A man who is ignorantly -trying to produce upon his farm things not suited to its soil and its -other conditions can make a journey to the college from anywhere in -Australia, and go back with a change of scheme which will make his farm -productive and profitable. - -There were forty pupils there--a few of them farmers, relearning their -trade, the rest young men mainly from the cities--novices. It seemed a -strange thing that an agricultural college should have an attraction for -city-bred youths, but such is the fact. They are good stuff, too; they -are above the agricultural average of intelligence, and they come without -any inherited prejudices in favor of hoary ignorances made sacred by long -descent. - -The students work all day in the fields, the nurseries, and the -shearing-sheds, learning and doing all the practical work of the -business--three days in a week. On the other three they study and hear -lectures. They are taught the beginnings of such sciences as bear upon -agriculture--like chemistry, for instance. We saw the sophomore class in -sheep-shearing shear a dozen sheep. They did it by hand, not with the -machine. The sheep was seized and flung down on his side and held there; -and the students took off his coat with great celerity and adroitness. -Sometimes they clipped off a sample of the sheep, but that is customary -with shearers, and they don't mind it; they don't even mind it as much as -the sheep. They dab a splotch of sheep-dip on the place and go right -ahead. - -The coat of wool was unbelievably thick. Before the shearing the sheep -looked like the fat woman in the circus; after it he looked like a bench. -He was clipped to the skin; and smoothly and uniformly. The fleece comes -from him all in one piece and has the spread of a blanket. - -The college was flying the Australian flag--the gridiron of England -smuggled up in the northwest corner of a big red field that had the -random stars of the Southern Cross wandering around over it. - -From Horsham we went to Stawell. By rail. Still in the colony of -Victoria. Stawell is in the gold-mining country. In the bank-safe was -half a peck of surface-gold--gold dust, grain gold; rich; pure in fact, -and pleasant to sift through one's fingers; and would be pleasanter if it -would stick. And there were a couple of gold bricks, very heavy to -handle, and worth $7,500 a piece. They were from a very valuable quartz -mine; a lady owns two-thirds of it; she has an income of $75,000 a month -from it, and is able to keep house. - -The Stawell region is not productive of gold only; it has great -vineyards, and produces exceptionally fine wines. One of these -vineyards--the Great Western, owned by Mr. Irving--is regarded as a -model. Its product has reputation abroad. It yields a choice champagne -and a fine claret, and its hock took a prize in France two or three years -ago. The champagne is kept in a maze of passages under ground, cut in -the rock, to secure it an even temperature during the three-year term -required to perfect it. In those vaults I saw 120,000 bottles of -champagne. The colony of Victoria has a population of 1,000,000, and -those people are said to drink 25,000,000 bottles of champagne per year. -The dryest community on the earth. The government has lately reduced the -duty upon foreign wines. That is one of the unkindnesses of Protection. -A man invests years of work and a vast sum of money in a worthy -enterprise, upon the faith of existing laws; then the law is changed, and -the man is robbed by his own government. - -On the way back to Stawell we had a chance to see a group of boulders -called the Three Sisters--a curiosity oddly located; for it was upon high -ground, with the land sloping away from it, and no height above it from -whence the boulders could have rolled down. Relics of an early -ice-drift, perhaps. They are noble boulders. One of them has the size -and smoothness and plump sphericity of a balloon of the biggest pattern. - -The road led through a forest of great gum-trees, lean and scraggy and -sorrowful. The road was cream-white--a clayey kind of earth, apparently. -Along it toiled occasional freight wagons, drawn by long double files of -oxen. Those wagons were going a journey of two hundred miles, I was -told, and were running a successful opposition to the railway! The -railways are owned and run by the government. - -Those sad gums stood up out of the dry white clay, pictures of patience -and resignation. It is a tree that can get along without water; still it -is fond of it--ravenously so. It is a very intelligent tree and will -detect the presence of hidden water at a distance of fifty feet, and send -out slender long root-fibres to prospect it. They will find it; and will -also get at it even through a cement wall six inches thick. Once a -cement water-pipe under ground at Stawell began to gradually reduce its -output, and finally ceased altogether to deliver water. Upon examining -into the matter it was found stopped up, wadded compactly with a mass of -root-fibres, delicate and hair-like. How this stuff had gotten into the -pipe was a puzzle for some little time; finally it was found that it had -crept in through a crack that was almost invisible to the eye. A gum -tree forty feet away had tapped the pipe and was drinking the water. - - - - -CHAPTER XXIV. - -There is no such thing as "the Queen's English." The property has gone -into the hands of a joint stock company and we own the bulk of the -shares! - --Pudd'nhead Wilson's New Calendar. - -Frequently, in Australia, one has cloud-effects of an unfamiliar sort. -We had this kind of scenery, finely staged, all the way to Ballarat. -Consequently we saw more sky than country on that journey. At one time a -great stretch of the vault was densely flecked with wee ragged-edged -flakes of painfully white cloud-stuff, all of one shape and size, and -equidistant apart, with narrow cracks of adorable blue showing between. -The whole was suggestive of a hurricane of snow-flakes drifting across -the skies. By and by these flakes fused themselves together in -interminable lines, with shady faint hollows between the lines, the long -satin-surfaced rollers following each other in simulated movement, and -enchantingly counterfeiting the majestic march of a flowing sea. Later, -the sea solidified itself; then gradually broke up its mass into -innumerable lofty white pillars of about one size, and ranged these -across the firmament, in receding and fading perspective, in the -similitude of a stupendous colonnade--a mirage without a doubt flung from -the far Gates of the Hereafter. - -The approaches to Ballarat were beautiful. The features, great green -expanses of rolling pasture-land, bisected by eye contenting hedges of -commingled new-gold and old-gold gorse--and a lovely lake. One must put -in the pause, there, to fetch the reader up with a slight jolt, and keep -him from gliding by without noticing the lake. One must notice it; for a -lovely lake is not as common a thing along the railways of Australia as -are the dry places. Ninety-two in the shade again, but balmy and -comfortable, fresh and bracing. A perfect climate. - -Forty-five years ago the site now occupied by the City of Ballarat was a -sylvan solitude as quiet as Eden and as lovely. Nobody had ever heard of -it. On the 25th of August, 1851, the first great gold-strike made in -Australia was made here. The wandering prospectors who made it scraped -up two pounds and a half of gold the first day-worth $600. A few days -later the place was a hive--a town. The news of the strike spread -everywhere in a sort of instantaneous way--spread like a flash to the -very ends of the earth. A celebrity so prompt and so universal has -hardly been paralleled in history, perhaps. It was as if the name -BALLARAT had suddenly been written on the sky, where all the world could -read it at once. - -The smaller discoveries made in the colony of New South Wales three -months before had already started emigrants toward Australia; they had -been coming as a stream, but they came as a flood, now. A hundred -thousand people poured into Melbourne from England and other countries in -a single month, and flocked away to the mines. The crews of the ships -that brought them flocked with them; the clerks in the government offices -followed; so did the cooks, the maids, the coachmen, the butlers, and the -other domestic servants; so did the carpenters, the smiths, the plumbers, -the painters, the reporters, the editors, the lawyers, the clients, the -barkeepers, the bummers, the blacklegs, the thieves, the loose women, the -grocers, the butchers, the bakers, the doctors, the druggists, the -nurses; so did the police; even officials of high and hitherto envied -place threw up their positions and joined the procession. This roaring -avalanche swept out of Melbourne and left it desolate, Sunday-like, -paralyzed, everything at a stand-still, the ships lying idle at anchor, -all signs of life departed, all sounds stilled save the rasping of the -cloud-shadows as they scraped across the vacant streets. - -That grassy and leafy paradise at Ballarat was soon ripped open, and -lacerated and scarified and gutted, in the feverish search for its hidden -riches. There is nothing like surface-mining to snatch the graces and -beauties and benignities out of a paradise, and make an odious and -repulsive spectacle of it. - -What fortunes were made! Immigrants got rich while the ship unloaded and -reloaded--and went back home for good in the same cabin they had come out -in! Not all of them. Only some. I saw the others in Ballarat myself, -forty-five years later--what were left of them by time and death and the -disposition to rove. They were young and gay, then; they are patriarchal -and grave, now; and they do not get excited any more. They talk of the -Past. They live in it. Their life is a dream, a retrospection. - -Ballarat was a great region for "nuggets." No such nuggets were found in -California as Ballarat produced. In fact, the Ballarat region has -yielded the largest ones known to history. Two of them weighed about 180 -pounds each, and together were worth $90,000. They were offered to any -poor person who would shoulder them and carry them away. Gold was so -plentiful that it made people liberal like that. - -Ballarat was a swarming city of tents in the early days. Everybody was -happy, for a time, and apparently prosperous. Then came trouble. The -government swooped down with a mining tax. And in its worst form, too; -for it was not a tax upon what the miner had taken out, but upon what he -was going to take out--if he could find it. It was a license-tax license -to work his claim--and it had to be paid before he could begin digging. - -Consider the situation. No business is so uncertain as surface-mining. -Your claim may be good, and it may be worthless. It may make you well -off in a month; and then again you may have to dig and slave for half a -year, at heavy expense, only to find out at last that the gold is not -there in cost-paying quantity, and that your time and your hard work have -been thrown away. It might be wise policy to advance the miner a monthly -sum to encourage him to develop the country's riches; but to tax him -monthly in advance instead--why, such a thing was never dreamed of in -America. There, neither the claim itself nor its products, howsoever -rich or poor, were taxed. - -The Ballarat miners protested, petitioned, complained--it was of no use; -the government held its ground, and went on collecting the tax. And not -by pleasant methods, but by ways which must have been very galling to -free people. The rumblings of a coming storm began to be audible. - -By and by there was a result; and I think it may be called the finest -thing in Australasian history. It was a revolution--small in size; but -great politically; it was a strike for liberty, a struggle for a -principle, a stand against injustice and oppression. It was the Barons -and John, over again; it was Hampden and Ship-Money; it was Concord and -Lexington; small beginnings, all of them, but all of them great in -political results, all of them epoch-making. It is another instance of a -victory won by a lost battle. It adds an honorable page to history; the -people know it and are proud of it. They keep green the memory of the -men who fell at the Eureka Stockade, and Peter Lalor has his monument. - -The surface-soil of Ballarat was full of gold. This soil the miners -ripped and tore and trenched and harried and disembowled, and made it -yield up its immense treasure. Then they went down into the earth with -deep shafts, seeking the gravelly beds of ancient rivers and brooks--and -found them. They followed the courses of these streams, and gutted them, -sending the gravel up in buckets to the upper world, and washing out of -it its enormous deposits of gold. The next biggest of the two monster -nuggets mentioned above came from an old river-channel 180 feet under -ground. - -Finally the quartz lodes were attacked. That is not poor-man's mining. -Quartz-mining and milling require capital, and staying-power, and -patience. Big companies were formed, and for several decades, now, the -lodes have been successfully worked, and have yielded great wealth. -Since the gold discovery in 1853 the Ballarat mines--taking the three -kinds of mining together--have contributed to the world's pocket -something over three hundred millions of dollars, which is to say that -this nearly invisible little spot on the earth's surface has yielded -about one-fourth as much gold in forty-four years as all California has -yielded in forty-seven. The Californian aggregate, from 1848 to 1895, -inclusive, as reported by the Statistician of the United States Mint, is -$1,265,215,217. - -A citizen told me a curious thing about those mines. With all my -experience of mining I had never heard of anything of the sort before. -The main gold reef runs about north and south--of course for that is the -custom of a rich gold reef. At Ballarat its course is between walls of -slate. Now the citizen told me that throughout a stretch of twelve miles -along the reef, the reef is crossed at intervals by a straight black -streak of a carbonaceous nature--a streak in the slate; a streak no -thicker than a pencil--and that wherever it crosses the reef you will -certainly find gold at the junction. It is called the Indicator. Thirty -feet on each side of the Indicator (and down in the slate, of course) is -a still finer streak--a streak as fine as a pencil mark; and indeed, that -is its name Pencil Mark. Whenever you find the Pencil Mark you know that -thirty feet from it is the Indicator; you measure the distance, excavate, -find the Indicator, trace it straight to the reef, and sink your shaft; -your fortune is made, for certain. If that is true, it is curious. And -it is curious anyway. - -Ballarat is a town of only 40,000 population; and yet, since it is in -Australia, it has every essential of an advanced and enlightened big -city. This is pure matter of course. I must stop dwelling upon these -things. It is hard to keep from dwelling upon them, though; for it is -difficult to get away from the surprise of it. I will let the other -details go, this time, but I must allow myself to mention that this -little town has a park of 326 acres; a flower garden of 83 acres, with an -elaborate and expensive fernery in it and some costly and unusually fine -statuary; and an artificial lake covering 600 acres, equipped with a -fleet of 200 shells, small sail boats, and little steam yachts. - -At this point I strike out some other praiseful things which I was -tempted to add. I do not strike them out because they were not true or -not well said, but because I find them better said by another man--and a -man more competent to testify, too, because he belongs on the ground, and -knows. I clip them from a chatty speech delivered some years ago by Mr. -William Little, who was at that time mayor of Ballarat: - - "The language of our citizens, in this as in other parts of - Australasia, is mostly healthy Anglo-Saxon, free from Americanisms, - vulgarisms, and the conflicting dialects of our Fatherland, and is - pure enough to suit a Trench or a Latham. Our youth, aided by - climatic influence, are in point of physique and comeliness - unsurpassed in the Sunny South. Our young men are well ordered; and - our maidens, 'not stepping over the bounds of modesty,' are as fair - as Psyches, dispensing smiles as charming as November flowers." - -The closing clause has the seeming of a rather frosty compliment, but -that is apparent only, not real. November is summer-time there. - -His compliment to the local purity of the language is warranted. It is -quite free from impurities; this is acknowledged far and wide. As in the -German Empire all cultivated people claim to speak Hanovarian German, so -in Australasia all cultivated people claim to speak Ballarat English. -Even in England this cult has made considerable progress, and now that it -is favored by the two great Universities, the time is not far away when -Ballarat English will come into general use among the educated classes of -Great Britain at large. Its great merit is, that it is shorter than -ordinary English--that is, it is more compressed. At first you have some -difficulty in understanding it when it is spoken as rapidly as the orator -whom I have quoted speaks it. An illustration will show what I mean. -When he called and I handed him a chair, he bowed and said: - -"Q." - -Presently, when we were lighting our cigars, he held a match to mine and -I said: - -"Thank you," and he said: - -"Km." - -Then I saw. 'Q' is the end of the phrase "I thank you" 'Km' is the end -of the phrase "You are welcome." Mr. Little puts no emphasis upon either -of them, but delivers them so reduced that they hardly have a sound. All -Ballarat English is like that, and the effect is very soft and pleasant; -it takes all the hardness and harshness out of our tongue and gives to it -a delicate whispery and vanishing cadence which charms the ear like the -faint rustling of the forest leaves. - - - - -CHAPTER XXV. - -"Classic." A book which people praise and don't read. - --Pudd'nhead Wilson's New Calendar. - -On the rail again--bound for Bendigo. From diary: - -October 23. Got up at 6, left at 7.30; soon reached Castlemaine, one of -the rich gold-fields of the early days; waited several hours for a train; -left at 3.40 and reached Bendigo in an hour. For comrade, a Catholic -priest who was better than I was, but didn't seem to know it--a man full -of graces of the heart, the mind, and the spirit; a lovable man. He will -rise. He will be a bishop some day. Later an Archbishop. Later a -Cardinal. Finally an Archangel, I hope. And then he will recall me when -I say, "Do you remember that trip we made from Ballarat to Bendigo, when -you were nothing but Father C., and I was nothing to what I am now?" -It has actually taken nine hours to come from Ballarat to Bendigo. We -could have saved seven by walking. However, there was no hurry. - -Bendigo was another of the rich strikes of the early days. It does a -great quartz-mining business, now--that business which, more than any -other that I know of, teaches patience, and requires grit and a steady -nerve. The town is full of towering chimney-stacks, and hoisting-works, -and looks like a petroleum-city. Speaking of patience; for example, one -of the local companies went steadily on with its deep borings and -searchings without show of gold or a penny of reward for eleven years ---then struck it, and became suddenly rich. The eleven years' work had -cost $55,000, and the first gold found was a grain the size of a pin's -head. It is kept under locks and bars, as a precious thing, and is -reverently shown to the visitor, "hats off." When I saw it I had not -heard its history. - -"It is gold. Examine it--take the glass. Now how much should you say it -is worth?" - -I said: - -"I should say about two cents; or in your English dialect, four -farthings." - -"Well, it cost L11,000." - -"Oh, come!" - -"Yes, it did. Ballarat and Bendigo have produced the three monumental -nuggets of the world, and this one is the monumentalest one of the three. -The other two represent 19,000 a piece; this one a couple of thousand -more. It is small, and not much to look at, but it is entitled to (its) -name--Adam. It is the Adam-nugget of this mine, and its children run up -into the millions." - -Speaking of patience again, another of the mines was worked, under heavy -expenses, during 17 years before pay was struck, and still another one -compelled a wait of 21 years before pay was struck; then, in both -instances, the outlay was all back in a year or two, with compound -interest. - -Bendigo has turned out even more gold than Ballarat. The two together -have produced $650,000,000 worth--which is half as much as California has -produced. - -It was through Mr. Blank--not to go into particulars about his name--it -was mainly through Mr. Blank that my stay in Bendigo was made memorably -pleasant and interesting. He explained this to me himself. He told me -that it was through his influence that the city government invited me to -the town-hall to hear complimentary speeches and respond to them; that it -was through his influence that I had been taken on a long pleasure-drive -through the city and shown its notable features; that it was through his -influence that I was invited to visit the great mines; that it was -through his influence that I was taken to the hospital and allowed to see -the convalescent Chinaman who had been attacked at midnight in his lonely -hut eight weeks before by robbers, and stabbed forty-six times and -scalped besides; that it was through his influence that when I arrived -this awful spectacle of piecings and patchings and bandagings was sitting -up in his cot letting on to read one of my books; that it was through his -influence that efforts had been made to get the Catholic Archbishop of -Bendigo to invite me to dinner; that it was through his influence that -efforts had been made to get the Anglican Bishop of Bendigo to ask me to -supper; that it was through his influence that the dean of the editorial -fraternity had driven me through the woodsy outlying country and shown -me, from the summit of Lone Tree Hill, the mightiest and loveliest -expanse of forest-clad mountain and valley that I had seen in all -Australia. And when he asked me what had most impressed me in Bendigo -and I answered and said it was the taste and the public spirit which had -adorned the streets with 105 miles of shade trees, he said that it was -through his influence that it had been done. - -But I am not representing him quite correctly. He did not say it was -through his influence that all these things had happened--for that would -have been coarse; be merely conveyed that idea; conveyed it so subtly -that I only caught it fleetingly, as one catches vagrant faint breaths of -perfume when one traverses the meadows in summer; conveyed it without -offense and without any suggestion of egoism or ostentation--but conveyed -it, nevertheless. - -He was an Irishman; an educated gentleman; grave, and kindly, and -courteous; a bachelor, and about forty-five or possibly fifty years old, -apparently. He called upon me at the hotel, and it was there that we had -this talk. He made me like him, and did it without trouble. This was -partly through his winning and gentle ways, but mainly through the -amazing familiarity with my books which his conversation showed. He was -down to date with them, too; and if he had made them the study of his -life he could hardly have been better posted as to their contents than he -was. He made me better satisfied with myself than I had ever been -before. It was plain that he had a deep fondness for humor, yet he never -laughed; he never even chuckled; in fact, humor could not win to outward -expression on his face at all. No, he was always grave--tenderly, -pensively grave; but he made me laugh, all along; and this was very -trying--and very pleasant at the same time--for it was at quotations from -my own books. - -When he was going, he turned and said: - -"You don't remember me?" - -"I? Why, no. Have we met before?" - -"No, it was a matter of correspondence." - -"Correspondence?" - -"Yes, many years ago. Twelve or fifteen. Oh, longer than that. But of -course you----" A musing pause. Then he said: - -"Do you remember Corrigan Castle?" - -"N-no, I believe I don't. I don't seem to recall the name." - -He waited a moment, pondering, with the door-knob in his hand, then -started out; but turned back and said that I had once been interested in -Corrigan Castle, and asked me if I would go with him to his quarters in -the evening and take a hot Scotch and talk it over. I was a teetotaler -and liked relaxation, so I said I would. - -We drove from the lecture-hall together about half-past ten. He had a -most comfortably and tastefully furnished parlor, with good pictures on -the walls, Indian and Japanese ornaments on the mantel, and here and -there, and books everywhere-largely mine; which made me proud. The light -was brilliant, the easy chairs were deep-cushioned, the arrangements for -brewing and smoking were all there. We brewed and lit up; then he passed -a sheet of note-paper to me and said-- - -"Do you remember that?" - -"Oh, yes, indeed!" - -The paper was of a sumptuous quality. At the top was a twisted and -interlaced monogram printed from steel dies in gold and blue and red, in -the ornate English fashion of long years ago; and under it, in neat -gothic capitals was this--printed in blue: - - THE MARK TWAIN CLUB - CORRIGAN CASTLE - ............187.. - -"My!" said I, "how did you come by this?" - -"I was President of it." - -"No!--you don't mean it." - -"It is true. I was its first President. I was re-elected annually as -long as its meetings were held in my castle--Corrigan--which was five -years." - -Then he showed me an album with twenty-three photographs of me in it. -Five of them were of old dates, the others of various later crops; the -list closed with a picture taken by Falk in Sydney a month before. - -"You sent us the first five; the rest were bought." - -This was paradise! We ran late, and talked, talked, talked--subject, the -Mark Twain Club of Corrigan Castle, Ireland. - -My first knowledge of that Club dates away back; all of twenty years, I -should say. It came to me in the form of a courteous letter, written on -the note-paper which I have described, and signed "By order of the -President; C. PEMBROKE, Secretary." It conveyed the fact that the Club -had been created in my honor, and added the hope that this token of -appreciation of my work would meet with my approval. - -I answered, with thanks; and did what I could to keep my gratification -from over-exposure. - -It was then that the long correspondence began. A letter came back, by -order of the President, furnishing me the names of the members-thirty-two -in number. With it came a copy of the Constitution and By-Laws, in -pamphlet form, and artistically printed. The initiation fee and dues -were in their proper place; also, schedule of meetings--monthly--for -essays upon works of mine, followed by discussions; quarterly for -business and a supper, without essays, but with after-supper speeches -also, there was a list of the officers: President, Vice-President, -Secretary, Treasurer, etc. The letter was brief, but it was pleasant -reading, for it told me about the strong interest which the membership -took in their new venture, etc., etc. It also asked me for a photograph ---a special one. I went down and sat for it and sent it--with a letter, -of course. - -Presently came the badge of the Club, and very dainty and pretty it was; -and very artistic. It was a frog peeping out from a graceful tangle of -grass-sprays and rushes, and was done in enamels on a gold basis, and had -a gold pin back of it. After I had petted it, and played with it, and -caressed it, and enjoyed it a couple of hours, the light happened to fall -upon it at a new angle, and revealed to me a cunning new detail; with the -light just right, certain delicate shadings of the grass-blades and -rush-stems wove themselves into a monogram--mine! You can see that that -jewel was a work of art. And when you come to consider the intrinsic -value of it, you must concede that it is not every literary club that -could afford a badge like that. It was easily worth $75, in the opinion -of Messrs. Marcus and Ward of New York. They said they could not -duplicate it for that and make a profit. By this time the Club was well -under way; and from that time forth its secretary kept my off-hours well -supplied with business. He reported the Club's discussions of my books -with laborious fullness, and did his work with great spirit and ability. -As a, rule, he synopsized; but when a speech was especially brilliant, he -short-handed it and gave me the best passages from it, written out. -There were five speakers whom he particularly favored in that way: -Palmer, Forbes, Naylor, Norris, and Calder. Palmer and Forbes could -never get through a speech without attacking each other, and each in his -own way was formidably effective--Palmer in virile and eloquent abuse, -Forbes in courtly and elegant but scalding satire. I could always tell -which of them was talking without looking for his name. Naylor had a -polished style and a happy knack at felicitous metaphor; Norris's style -was wholly without ornament, but enviably compact, lucid, and strong. -But after all, Calder was the gem. He never spoke when sober, he spoke -continuously when he wasn't. And certainly they were the drunkest -speeches that a man ever uttered. They were full of good things, but so -incredibly mixed up and wandering that it made one's head swim to follow -him. They were not intended to be funny, but they were,--funny for the -very gravity which the speaker put into his flowing miracles of -incongruity. In the course of five years I came to know the styles of -the five orators as well as I knew the style of any speaker in my own -club at home. - -These reports came every month. They were written on foolscap, 600 words -to the page, and usually about twenty-five pages in a report--a good -15,000 words, I should say,--a solid week's work. The reports were -absorbingly entertaining, long as they were; but, unfortunately for me, -they did not come alone. They were always accompanied by a lot of -questions about passages and purposes in my books, which the Club wanted -answered; and additionally accompanied every quarter by the Treasurer's -report, and the Auditor's report, and the Committee's report, and the -President's review, and my opinion of these was always desired; also -suggestions for the good of the Club, if any occurred to me. - -By and by I came to dread those things; and this dread grew and grew and -grew; grew until I got to anticipating them with a cold horror. For I -was an indolent man, and not fond of letter-writing, and whenever these -things came I had to put everything by and sit down--for my own peace of -mind--and dig and dig until I got something out of my head which would -answer for a reply. I got along fairly well the first year; but for the -succeeding four years the Mark Twain Club of Corrigan Castle was my -curse, my nightmare, the grief and misery of my life. And I got so, so -sick of sitting for photographs. I sat every year for five years, trying -to satisfy that insatiable organization. Then at last I rose in revolt. -I could endure my oppressions no longer. I pulled my fortitude together -and tore off my chains, and was a free man again, and happy. From that -day I burned the secretary's fat envelopes the moment they arrived, and -by and by they ceased to come. - -Well, in the sociable frankness of that night in Bendigo I brought this -all out in full confession. Then Mr. Blank came out in the same frank -way, and with a preliminary word of gentle apology said that he was the -Mark Twain Club, and the only member it had ever had! - -Why, it was matter for anger, but I didn't feel any. He said he never -had to work for a living, and that by the time he was thirty life had -become a bore and a weariness to him. He had no interests left; they had -paled and perished, one by one, and left him desolate. He had begun to -think of suicide. Then all of a sudden he thought of that happy idea of -starting an imaginary club, and went straightway to work at it, with -enthusiasm and love. He was charmed with it; it gave him something to -do. It elaborated itself on his hands;--it became twenty times more -complex and formidable than was his first rude draft of it. Every new -addition to his original plan which cropped up in his mind gave him a -fresh interest and a new pleasure. He designed the Club badge himself, -and worked over it, altering and improving it, a number of days and -nights; then sent to London and had it made. It was the only one that -was made. It was made for me; the "rest of the Club" went without. - -He invented the thirty-two members and their names. He invented the five -favorite speakers and their five separate styles. He invented their -speeches, and reported them himself. He would have kept that Club going -until now, if I hadn't deserted, he said. He said he worked like a slave -over those reports; each of them cost him from a week to a fortnight's -work, and the work gave him pleasure and kept him alive and willing to be -alive. It was a bitter blow to him when the Club died. - -Finally, there wasn't any Corrigan Castle. He had invented that, too. - -It was wonderful--the whole thing; and altogether the most ingenious and -laborious and cheerful and painstaking practical joke I have ever heard -of. And I liked it; liked to bear him tell about it; yet I have been a -hater of practical jokes from as long back as I can remember. Finally he -said-- - -"Do you remember a note from Melbourne fourteen or fifteen years ago, -telling about your lecture tour in Australia, and your death and burial -in Melbourne?--a note from Henry Bascomb, of Bascomb Hall, Upper -Holywell Hants." - -"Yes." - -"I wrote it." - -"M-y-word!" - -"Yes, I did it. I don't know why. I just took the notion, and carried -it out without stopping to think. It was wrong. It could have done -harm. I was always sorry about it afterward. You must forgive me. I -was Mr. Bascom's guest on his yacht, on his voyage around the world. He -often spoke of you, and of the pleasant times you had had together in his -home; and the notion took me, there in Melbourne, and I imitated his -hand, and wrote the letter." - -So the mystery was cleared up, after so many, many years. - - - - -CHAPTER XXVI. - -There are people who can do all fine and heroic things but one! keep -from telling their happinesses to the unhappy. - --Pudd'nhead Wilson's New Calendar. - -After visits to Maryborough and some other Australian towns, we presently -took passage for New Zealand. If it would not look too much like showing -off, I would tell the reader where New Zealand is; for he is as I was; he -thinks he knows. And he thinks he knows where Hertzegovina is; and how -to pronounce pariah; and how to use the word unique without exposing -himself to the derision of the dictionary. But in truth, he knows none -of these things. There are but four or five people in the world who -possess this knowledge, and these make their living out of it. They -travel from place to place, visiting literary assemblages, geographical -societies, and seats of learning, and springing sudden bets that these -people do not know these things. Since all people think they know them, -they are an easy prey to these adventurers. Or rather they were an easy -prey until the law interfered, three months ago, and a New York court -decided that this kind of gambling is illegal, "because it traverses -Article IV, Section 9, of the Constitution of the United States, which -forbids betting on a sure thing." This decision was rendered by the full -Bench of the New York Supreme Court, after a test sprung upon the court -by counsel for the prosecution, which showed that none of the nine Judges -was able to answer any of the four questions. - -All people think that New Zealand is close to Australia or Asia, or -somewhere, and that you cross to it on a bridge. But that is not so. It -is not close to anything, but lies by itself, out in the water. It is -nearest to Australia, but still not near. The gap between is very wide. -It will be a surprise to the reader, as it was to me, to learn that the -distance from Australia to New Zealand is really twelve or thirteen -hundred miles, and that there is no bridge. I learned this from -Professor X., of Yale University, whom I met in the steamer on the great -lakes when I was crossing the continent to sail across the Pacific. I -asked him about New Zealand, in order to make conversation. I supposed -he would generalize a little without compromising himself, and then turn -the subject to something he was acquainted with, and my object would then -be attained; the ice would be broken, and we could go smoothly on, and -get acquainted, and have a pleasant time. But, to my surprise, he was -not only not embarrassed by my question, but seemed to welcome it, and to -take a distinct interest in it. He began to talk--fluently, confidently, -comfortably; and as he talked, my admiration grew and grew; for as the -subject developed under his hands, I saw that he not only knew where New -Zealand was, but that he was minutely familiar with every detail of its -history, politics, religions, and commerce, its fauna, flora, geology, -products, and climatic peculiarities. When he was done, I was lost in -wonder and admiration, and said to myself, he knows everything; in the -domain of human knowledge he is king. - -I wanted to see him do more miracles; and so, just for the pleasure of -hearing him answer, I asked him about Hertzegovina, and pariah, and -unique. But he began to generalize then, and show distress. I saw that -with New Zealand gone, he was a Samson shorn of his locks; he was as -other men. This was a curious and interesting mystery, and I was frank -with him, and asked him to explain it. - -He tried to avoid it at first; but then laughed and said that after all, -the matter was not worth concealment, so he would let me into the secret. -In substance, this is his story: - -"Last autumn I was at work one morning at home, when a card came up--the -card of a stranger. Under the name was printed a line which showed that -this visitor was Professor of Theological Engineering in Wellington -University, New Zealand. I was troubled--troubled, I mean, by the -shortness of the notice. College etiquette required that he be at once -invited to dinner by some member of the Faculty--invited to dine on that -day--not, put off till a subsequent day. I did not quite know what to -do. College etiquette requires, in the case of a foreign guest, that the -dinner-talk shall begin with complimentary references to his country, its -great men, its services to civilization, its seats of learning, and -things like that; and of course the host is responsible, and must either -begin this talk himself or see that it is done by some one else. I was -in great difficulty; and the more I searched my memory, the more my -trouble grew. I found that I knew nothing about New Zealand. I thought -I knew where it was, and that was all. I had an impression that it was -close to Australia, or Asia, or somewhere, and that one went over to it -on a bridge. This might turn out to be incorrect; and even if correct, -it would not furnish matter enough for the purpose at the dinner, and I -should expose my College to shame before my guest; he would see that I, a -member of the Faculty of the first University in America, was wholly -ignorant of his country, and he would go away and tell this, and laugh at -it. The thought of it made my face burn. - -"I sent for my wife and told her how I was situated, and asked for her -help, and she thought of a thing which I might have thought of myself, if -I had not been excited and worried. She said she would go and tell the -visitor that I was out but would be in in a few minutes; and she would -talk, and keep him busy while I got out the back way and hurried over and -make Professor Lawson give the dinner. For Lawson knew everything, and -could meet the guest in a creditable way and save the reputation of the -University. I ran to Lawson, but was disappointed. He did not know -anything about New Zealand. He said that, as far as his recollection -went it was close to Australia, or Asia, or somewhere, and you go over to -it on a bridge; but that was all he knew. It was too bad. Lawson was a -perfect encyclopedia of abstruse learning; but now in this hour of our -need, it turned out that he did not know any useful thing. - -"We consulted. He saw that the reputation of the University was in very -real peril, and he walked the floor in anxiety, talking, and trying to -think out some way to meet the difficulty. Presently he decided that we -must try the rest of the Faculty--some of them might know about New -Zealand. So we went to the telephone and called up the professor of -astronomy and asked him, and he said that all he knew was, that it was -close to Australia, or Asia, or somewhere, and you went over to it on---- - -"We shut him off and called up the professor of biology, and he said that -all he knew was that it was close to Aus----. - -"We shut him off, and sat down, worried and disheartened, to see if we -could think up some other scheme. We shortly hit upon one which promised -well, and this one we adopted, and set its machinery going at once. It -was this. Lawson must give the dinner. The Faculty must be notified by -telephone to prepare. We must all get to work diligently, and at the end -of eight hours and a half we must come to dinner acquainted with New -Zealand; at least well enough informed to appear without discredit before -this native. To seem properly intelligent we should have to know about -New Zealand's population, and politics, and form of government, and -commerce, and taxes, and products, and ancient history, and modern -history, and varieties of religion, and nature of the laws, and their -codification, and amount of revenue, and whence drawn, and methods of -collection, and percentage of loss, and character of climate, and--well, -a lot of things like that; we must suck the maps and cyclopedias dry. -And while we posted up in this way, the Faculty's wives must flock over, -one after the other, in a studiedly casual way, and help my wife keep the -New Zealander quiet, and not let him get out and come interfering with -our studies. The scheme worked admirably; but it stopped business, -stopped it entirely. - -"It is in the official log-book of Yale, to be read and wondered at by -future generations--the account of the Great Blank Day--the memorable -Blank Day--the day wherein the wheels of culture were stopped, a Sunday -silence prevailed all about, and the whole University stood still while -the Faculty read-up and qualified itself to sit at meat, without shame, -in the presence of the Professor of Theological Engineering from New -Zealand: - -"When we assembled at the dinner we were miserably tired and worn--but we -were posted. Yes, it is fair to claim that. In fact, erudition is a -pale name for it. New Zealand was the only subject; and it was just -beautiful to hear us ripple it out. And with such an air of -unembarrassed ease, and unostentatious familiarity with detail, and -trained and seasoned mastery of the subject-and oh, the grace and fluency -of it! - -"Well, finally somebody happened to notice that the guest was looking -dazed, and wasn't saying anything. So they stirred him up, of course. -Then that man came out with a good, honest, eloquent compliment that made -the Faculty blush. He said he was not worthy to sit in the company of -men like these; that he had been silent from admiration; that he had been -silent from another cause also--silent from shame--silent from ignorance! -'For,' said he, 'I, who have lived eighteen years in New Zealand and have -served five in a professorship, and ought to know much about that -country, perceive, now, that I know almost nothing about it. I say it -with shame, that I have learned fifty times, yes, a hundred times more -about New Zealand in these two hours at this table than I ever knew -before in all the eighteen years put together. I was silent because I -could not help myself. What I knew about taxes, and policies, and laws, -and revenue, and products, and history, and all that multitude of things, -was but general, and ordinary, and vague-unscientific, in a word--and it -would have been insanity to expose it here to the searching glare of your -amazingly accurate and all-comprehensive knowledge of those matters, -gentlemen. I beg you to let me sit silent--as becomes me. But do not -change the subject; I can at least follow you, in this one; whereas if -you change to one which shall call out the full strength of your mighty -erudition, I shall be as one lost. If you know all this about a remote -little inconsequent patch like New Zealand, ah, what wouldn't you know -about any other Subject!'" - - - - -CHAPTER XXVIL - -Man is the Only Animal that Blushes. Or needs to. - --Pudd'nhead Wilson's New Calendar. - -The universal brotherhood of man is our most precious possession, what -there is of it. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -November 1--noon. A fine day, a brilliant sun. Warm in the sun, cold -in the shade--an icy breeze blowing out of the south. A solemn long -swell rolling up northward. It comes from the South Pole, with nothing -in the way to obstruct its march and tone its energy down. I have read -somewhere that an acute observer among the early explorers--Cook? or -Tasman?--accepted this majestic swell as trustworthy circumstantial -evidence that no important land lay to the southward, and so did not -waste time on a useless quest in that direction, but changed his course -and went searching elsewhere. - -Afternoon. Passing between Tasmania (formerly Van Diemen's Land) and -neighboring islands--islands whence the poor exiled Tasmanian savages -used to gaze at their lost homeland and cry; and die of broken hearts. -How glad I am that all these native races are dead and gone, or nearly -so. The work was mercifully swift and horrible in some portions of -Australia. As far as Tasmania is concerned, the extermination was -complete: not a native is left. It was a strife of years, and decades of -years. The Whites and the Blacks hunted each other, ambushed each other, -butchered each other. The Blacks were not numerous. But they were wary, -alert, cunning, and they knew their country well. They lasted a long -time, few as they were, and inflicted much slaughter upon the Whites. - -The Government wanted to save the Blacks from ultimate extermination, if -possible. One of its schemes was to capture them and coop them up, on a -neighboring island, under guard. Bodies of Whites volunteered for the -hunt, for the pay was good--L5 for each Black captured and delivered, but -the success achieved was not very satisfactory. The Black was naked, and -his body was greased. It was hard to get a grip on him that would hold. -The Whites moved about in armed bodies, and surprised little families of -natives, and did make captures; but it was suspected that in these -surprises half a dozen natives were killed to one caught--and that was -not what the Government desired. - -Another scheme was to drive the natives into a corner of the island and -fence them in by a cordon of men placed in line across the country; but -the natives managed to slip through, constantly, and continue their -murders and arsons. - -The governor warned these unlettered savages by printed proclamation that -they must stay in the desolate region officially appointed for them! The -proclamation was a dead letter; the savages could not read it. Afterward -a picture-proclamation was issued. It was painted up on boards, and -these were nailed to trees in the forest. Herewith is a photographic -reproduction of this fashion-plate. Substantially it means: - -1. The Governor wishes the Whites and the Blacks to love each other; - -2. He loves his black subjects; - -3. Blacks who kill Whites will be hanged; - -4. Whites who kill Blacks will be hanged. - -Upon its several schemes the Government spent L30,000 and employed the -labors and ingenuities of several thousand Whites for a long time with -failure as a result. Then, at last, a quarter of a century after the -beginning of the troubles between the two races, the right man was found. -No, he found himself. This was George Augustus Robinson, called in -history "The Conciliator." He was not educated, and not conspicuous in -any way. He was a working bricklayer, in Hobart Town. But he must have -been an amazing personality; a man worth traveling far to see. It may be -his counterpart appears in history, but I do not know where to look for -it. - -He set himself this incredible task: to go out into the wilderness, the -jungle, and the mountain-retreats where the hunted and implacable savages -were hidden, and appear among them unarmed, speak the language of love -and of kindness to them, and persuade them to forsake their homes and the -wild free life that was so dear to them, and go with him and surrender to -the hated Whites and live under their watch and ward, and upon their -charity the rest of their lives! On its face it was the dream of a -madman. - -In the beginning, his moral-suasion project was sarcastically dubbed the -sugar plum speculation. If the scheme was striking, and new to the -world's experience, the situation was not less so. It was this. The -White population numbered 40,000 in 1831; the Black population numbered -three hundred. Not 300 warriors, but 300 men, women, and children. The -Whites were armed with guns, the Blacks with clubs and spears. The -Whites had fought the Blacks for a quarter of a century, and had tried -every thinkable way to capture, kill, or subdue them; and could not do -it. If white men of any race could have done it, these would have -accomplished it. But every scheme had failed, the splendid 300, the -matchless 300 were unconquered, and manifestly unconquerable. They would -not yield, they would listen to no terms, they would fight to the bitter -end. Yet they had no poet to keep up their heart, and sing the marvel of -their magnificent patriotism. - -At the end of five-and-twenty years of hard fighting, the surviving 300 -naked patriots were still defiant, still persistent, still efficacious -with their rude weapons, and the Governor and the 40,000 knew not which -way to turn, nor what to do. - -Then the Bricklayer--that wonderful man--proposed to go out into the -wilderness, with no weapon but his tongue, and no protection but his -honest eye and his humane heart; and track those embittered savages to -their lairs in the gloomy forests and among the mountain snows. -Naturally, he was considered a crank. But he was not quite that. In -fact, he was a good way short of that. He was building upon his long and -intimate knowledge of the native character. The deriders of his project -were right--from their standpoint--for they believed the natives to be -mere wild beasts; and Robinson was right, from his standpoint--for he -believed the natives to be human beings. The truth did really lie -between the two. The event proved that Robinson's judgment was soundest; -but about once a month for four years the event came near to giving the -verdict to the deriders, for about that frequently Robinson barely -escaped falling under the native spears. - -But history shows that he had a thinking head, and was not a mere wild -sentimentalist. For instance, he wanted the war parties (called) in -before he started unarmed upon his mission of peace. He wanted the best -chance of success--not a half-chance. And he was very willing to have -help; and so, high rewards were advertised, for any who would go unarmed -with him. This opportunity was declined. Robinson persuaded some tamed -natives of both sexes to go with him--a strong evidence of his persuasive -powers, for those natives well knew that their destruction would be -almost certain. As it turned out, they had to face death over and over -again. - -Robinson and his little party had a difficult undertaking upon their -hands. They could not ride off, horseback, comfortably into the woods -and call Leonidas and his 300 together for a talk and a treaty the -following day; for the wild men were not in a body; they were scattered, -immense distances apart, over regions so desolate that even the birds -could not make a living with the chances offered--scattered in groups of -twenty, a dozen, half a dozen, even in groups of three. And the mission -must go on foot. Mr. Bonwick furnishes a description of those horrible -regions, whereby it will be seen that even fugitive gangs of the hardiest -and choicest human devils the world has seen--the convicts set apart to -people the "Hell of Macquarrie Harbor Station"--were never able, but -once, to survive the horrors of a march through them, but starving and -struggling, and fainting and failing, ate each other, and died: - -"Onward, still onward, was the order of the indomitable Robinson. No one -ignorant of the western country of Tasmania can form a correct idea of -the traveling difficulties. While I was resident in Hobart Town, the -Governor, Sir John Franklin, and his lady, undertook the western journey -to Macquarrie Harbor, and suffered terribly. One man who assisted to -carry her ladyship through the swamps, gave me his bitter experience of -its miseries. Several were disabled for life. No wonder that but one -party, escaping from Macquarrie Harbor convict settlement, arrived at the -civilized region in safety. Men perished in the scrub, were lost in -snow, or were devoured by their companions. This was the territory -traversed by Mr. Robinson and his Black guides. All honor to his -intrepidity, and their wonderful fidelity! When they had, in the depth -of winter, to cross deep and rapid rivers, pass among mountains six -thousand feet high, pierce dangerous thickets, and find food in a country -forsaken even by birds, we can realize their hardships. - -"After a frightful journey by Cradle Mountain, and over the lofty plateau -of Middlesex Plains, the travelers experienced unwonted misery, and the -circumstances called forth the best qualities of the noble little band. -Mr. Robinson wrote afterwards to Mr. Secretary Burnett some details of -this passage of horrors. In that letter, of Oct 2, 1834, he states that -his Natives were very reluctant to go over the dreadful mountain passes; -that 'for seven successive days we continued traveling over one solid -body of snow;' that 'the snows were of incredible depth;' that 'the -Natives were frequently up to their middle in snow.' But still the -ill-clad, ill-fed, diseased, and way-worn men and women were sustained by -the cheerful voice of their unconquerable friend, and responded most -nobly to his call." - -Mr. Bonwick says that Robinson's friendly capture of the Big River tribe -remember, it was a whole tribe--"was by far the grandest feature of the -war, and the crowning glory of his efforts." The word "war" was not well -chosen, and is misleading. There was war still, but only the Blacks were -conducting it--the Whites were holding off until Robinson could give his -scheme a fair trial. I think that we are to understand that the friendly -capture of that tribe was by far the most important thing, the highest in -value, that happened during the whole thirty years of truceless -hostilities; that it was a decisive thing, a peaceful Waterloo, the -surrender of the native Napoleon and his dreaded forces, the happy ending -of the long strife. For "that tribe was the terror of the colony," its -chief "the Black Douglas of Bush households." - -Robinson knew that these formidable people were lurking somewhere, in -some remote corner of the hideous regions just described, and he and his -unarmed little party started on a tedious and perilous hunt for them. At -last, "there, under the shadows of the Frenchman's Cap, whose grim cone -rose five thousand feet in the uninhabited westward interior," they were -found. It was a serious moment. Robinson himself believed, for once, -that his mission, successful until now, was to end here in failure, and -that his own death-hour had struck. - -The redoubtable chief stood in menacing attitude, with his eighteen-foot -spear poised; his warriors stood massed at his back, armed for battle, -their faces eloquent with their long-cherished loathing for white men. -"They rattled their spears and shouted their war-cry." Their women were -back of them, laden with supplies of weapons, and keeping their 150 eager -dogs quiet until the chief should give the signal to fall on. - -"I think we shall soon be in the resurrection," whispered a member of -Robinson's little party. - -"I think we shall," answered Robinson; then plucked up heart and began -his persuasions--in the tribe's own dialect, which surprised and pleased -the chief. Presently there was an interruption by the chief: - -"Who are you?" - -"We are gentlemen." - -"Where are your guns?" - -"We have none." - -The warrior was astonished. - -"Where your little guns?" (pistols). - -"We have none." - -A few minutes passed--in by-play--suspense--discussion among the -tribesmen--Robinson's tamed squaws ventured to cross the line and begin -persuasions upon the wild squaws. Then the chief stepped back "to confer -with the old women--the real arbiters of savage war." Mr. Bonwick -continues: - - "As the fallen gladiator in the arena looks for the signal of life - or death from the president of the amphitheatre, so waited our - friends in anxious suspense while the conference continued. In a - few minutes, before a word was uttered, the women of the tribe threw - up their arms three times. This was the inviolable sign of peace! - Down fell the spears. Forward, with a heavy sigh of relief, and - upward glance of gratitude, came the friends of peace. The - impulsive natives rushed forth with tears and cries, as each saw in - the other's rank a loved one of the past. - - "It was a jubilee of joy. A festival followed. And, while tears - flowed at the recital of woe, a corrobory of pleasant laughter - closed the eventful day." - -In four years, without the spilling of a drop of blood, Robinson brought -them all in, willing captives, and delivered them to the white governor, -and ended the war which powder and bullets, and thousands of men to use -them, had prosecuted without result since 1804. - -Marsyas charming the wild beasts with his music--that is fable; but the -miracle wrought by Robinson is fact. It is history--and authentic; and -surely, there is nothing greater, nothing more reverence-compelling in -the history of any country, ancient or modern. - -And in memory of the greatest man Australasia ever developed or ever will -develop, there is a stately monument to George Augustus Robinson, the -Conciliator in--no, it is to another man, I forget his name. - -However, Robertson's own generation honored him, and in manifesting it -honored themselves. The Government gave him a money-reward and a -thousand acres of land; and the people held mass-meetings and praised him -and emphasized their praise with a large subscription of money. - -A good dramatic situation; but the curtain fell on another: - - "When this desperate tribe was thus captured, there was much - surprise to find that the L30,000 of a little earlier day had been - spent, and the whole population of the colony placed under arms, in - contention with an opposing force of sixteen men with wooden spears! - Yet such was the fact. The celebrated Big River tribe, that had - been raised by European fears to a host, consisted of sixteen men, - nine women, and one child. With a knowledge of the mischief done by - these few, their wonderful marches and their widespread aggressions, - their enemies cannot deny to them the attributes of courage and - military tact. A Wallace might harass a large army with a small and - determined band; but the contending parties were at least equal in - arms and civilization. The Zulus who fought us in Africa, the - Maories in New Zealand, the Arabs in the Soudan, were far better - provided with weapons, more advanced in the science of war, and - considerably more numerous, than the naked Tasmanians. Governor - Arthur rightly termed them a noble race." - -These were indeed wonderful people, the natives. They ought not to have -been wasted. They should have been crossed with the Whites. It would -have improved the Whites and done the Natives no harm. - -But the Natives were wasted, poor heroic wild creatures. They were -gathered together in little settlements on neighboring islands, and -paternally cared for by the Government, and instructed in religion, and -deprived of tobacco, because the superintendent of the Sunday-school was -not a smoker, and so considered smoking immoral. - -The Natives were not used to clothes, and houses, and regular hours, and -church, and school, and Sunday-school, and work, and the other misplaced -persecutions of civilization, and they pined for their lost home and -their wild free life. Too late they repented that they had traded that -heaven for this hell. They sat homesick on their alien crags, and day by -day gazed out through their tears over the sea with unappeasable longing -toward the hazy bulk which was the specter of what had been their -paradise; one by one their hearts broke and they died. - -In a very few years nothing but a scant remnant remained alive. A -handful lingered along into age. In 1864 the last man died, in 1876 the -last woman died, and the Spartans of Australasia were extinct. - -The Whites always mean well when they take human fish out of the ocean -and try to make them dry and warm and happy and comfortable in a chicken -coop; but the kindest-hearted white man can always be depended on to -prove himself inadequate when he deals with savages. He cannot turn the -situation around and imagine how he would like it to have a well-meaning -savage transfer him from his house and his church and his clothes and his -books and his choice food to a hideous wilderness of sand and rocks and -snow, and ice and sleet and storm and blistering sun, with no shelter, no -bed, no covering for his and his family's naked bodies, and nothing to -eat but snakes and grubs and 'offal. This would be a hell to him; and if -he had any wisdom he would know that his own civilization is a hell to -the savage--but he hasn't any, and has never had any; and for lack of it -he shut up those poor natives in the unimaginable perdition of his -civilization, committing his crime with the very best intentions, and saw -those poor creatures waste away under his tortures; and gazed at it, -vaguely troubled and sorrowful, and wondered what could be the matter -with them. One is almost betrayed into respecting those criminals, they -were so sincerely kind, and tender, and humane; and well-meaning. - -They didn't know why those exiled savages faded away, and they did their -honest best to reason it out. And one man, in a like case in New South -Wales, did reason it out and arrive at a solution: - - "It is from the wrath of God, which is revealed from heaven against - cold ungodliness and unrighteousness of men." - -That settles it. - - - - -CHAPTER XXVIII. - -Let us be thankful for the fools. But for them the rest of us could not -succeed. - --Pudd'nhead Wilson's New Calendar. - -The aphorism does really seem true: "Given the Circumstances, the Man -will appear." But the man musn't appear ahead of time, or it will spoil -everything. In Robinson's case the Moment had been approaching for a -quarter of a century--and meantime the future Conciliator was tranquilly -laying bricks in Hobart. When all other means had failed, the Moment had -arrived, and the Bricklayer put down his trowel and came forward. -Earlier he would have been jeered back to his trowel again. It reminds -me of a tale that was told me by a Kentuckian on the train when we were -crossing Montana. He said the tale was current in Louisville years ago. -He thought it had been in print, but could not remember. At any rate, in -substance it was this, as nearly as I can call it back to mind. - -A few years before the outbreak of the Civil War it began to appear that -Memphis, Tennessee, was going to be a great tobacco entrepot--the wise -could see the signs of it. At that time Memphis had a wharf boat, of -course. There was a paved sloping wharf, for the accommodation of -freight, but the steamers landed on the outside of the wharfboat, and all -loading and unloading was done across it, between steamer and shore. A -number of wharfboat clerks were needed, and part of the time, every day, -they were very busy, and part of the time tediously idle. They were -boiling over with youth and spirits, and they had to make the intervals -of idleness endurable in some way; and as a rule, they did it by -contriving practical jokes and playing them upon each other. - -The favorite butt for the jokes was Ed Jackson, because he played none -himself, and was easy game for other people's--for he always believed -whatever was told him. - -One day he told the others his scheme for his holiday. He was not going -fishing or hunting this time--no, he had thought out a better plan. Out -of his $40 a month he had saved enough for his purpose, in an economical -way, and he was going to have a look at New York. - -It was a great and surprising idea. It meant travel immense travel--in -those days it meant seeing the world; it was the equivalent of a voyage -around it in ours. At first the other youths thought his mind was -affected, but when they found that he was in earnest, the next thing to -be thought of was, what sort of opportunity this venture might afford for -a practical joke. - -The young men studied over the matter, then held a secret consultation -and made a plan. The idea was, that one of the conspirators should offer -Ed a letter of introduction to Commodore Vanderbilt, and trick him into -delivering it. It would be easy to do this. But what would Ed do when -he got back to Memphis? That was a serious matter. He was good-hearted, -and had always taken the jokes patiently; but they had been jokes which -did not humiliate him, did not bring him to shame; whereas, this would be -a cruel one in that way, and to play it was to meddle with fire; for with -all his good nature, Ed was a Southerner--and the English of that was, -that when he came back he would kill as many of the conspirators as he -could before falling himself. However, the chances must be taken--it -wouldn't do to waste such a joke as that. - -So the letter was prepared with great care and elaboration. It was -signed Alfred Fairchild, and was written in an easy and friendly spirit. -It stated that the bearer was the bosom friend of the writer's son, and -was of good parts and sterling character, and it begged the Commodore to -be kind to the young stranger for the writer's sake. It went on to say, -"You may have forgotten me, in this long stretch of time, but you will -easily call me back out of your boyhood memories when I remind you of how -we robbed old Stevenson's orchard that night; and how, while he was -chasing down the road after us, we cut across the field and doubled back -and sold his own apples to his own cook for a hat-full of doughnuts; and -the time that we----" and so forth and so on, bringing in names of -imaginary comrades, and detailing all sorts of wild and absurd and, of -course, wholly imaginary schoolboy pranks and adventures, but putting -them into lively and telling shape. - -With all gravity Ed was asked if he would like to have a letter to -Commodore Vanderbilt, the great millionaire. It was expected that the -question would astonish Ed, and it did. - -"What? Do you know that extraordinary man?" - -"No; but my father does. They were schoolboys together. And if you -like, I'll write and ask father. I know he'll be glad to give it to you -for my sake." - -Ed could not find words capable of expressing his gratitude and delight. -The three days passed, and the letter was put into his bands. He started -on his trip, still pouring out his thanks while he shook good-bye all -around. And when he was out of sight his comrades let fly their laughter -in a storm of happy satisfaction--and then quieted down, and were less -happy, less satisfied. For the old doubts as to the wisdom of this -deception began to intrude again. - -Arrived in New York, Ed found his way to Commodore Vanderbilt's business -quarters, and was ushered into a large anteroom, where a score of people -were patiently awaiting their turn for a two-minute interview with the -millionaire in his private office. A servant asked for Ed's card, and -got the letter instead. Ed was sent for a moment later, and found Mr. -Vanderbilt alone, with the letter--open--in his hand. - -"Pray sit down, Mr. --er--" - -"Jackson." - -" Ah--sit down, Mr. Jackson. By the opening sentences it seems to be a -letter from an old friend. Allow me--I will run my eye through it. He -says he says--why, who is it?" He turned the sheet and found the -signature. "Alfred Fairchild--hm--Fairchild--I don't recall the name. -But that is nothing--a thousand names have gone from me. He says--he -says-hm-hmoh, dear, but it's good! Oh, it's rare! I don't quite -remember it, but I seem to it'll all come back to me presently. He says ---he says--hm--hm-oh, but that was a game! Oh, spl-endid! How it -carries me back! It's all dim, of course it's a long time ago--and the -names--some of the names are wavery and indistinct--but sho', I know it -happened--I can feel it! and lord, how it warms my heart, and brings -back my lost youth! Well, well, well, I've got to come back into this -work-a-day world now--business presses and people are waiting--I'll keep -the rest for bed to-night, and live my youth over again. And you'll -thank Fairchild for me when you see him--I used to call him Alf, I think ---and you'll give him my gratitude for--what this letter has done for the -tired spirit of a hard-worked man; and tell him there isn't anything that -I can do for him or any friend of his that I won't do. And as for you, -my lad, you are my guest; you can't stop at any hotel in New York. Sit. -where you are a little while, till I get through with these people, then -we'll go home. I'll take care of you, my boy--make yourself easy as to -that." - -Ed stayed a week, and had an immense time--and never suspected that the -Commodore's shrewd eye was on him, and that he was daily being weighed -and measured and analyzed and tried and tested. - -Yes, he had an immense time; and never wrote home, but saved it all up to -tell when he should get back. Twice, with proper modesty and decency, he -proposed to end his visit, but the Commodore said, "No--wait; leave it to -me; I'll tell you when to go." - -In those days the Commodore was making some of those vast combinations of -his--consolidations of warring odds and ends of railroads into harmonious -systems, and concentrations of floating and rudderless commerce in -effective centers--and among other things his farseeing eye had detected -the convergence of that huge tobacco-commerce, already spoken of, toward -Memphis, and he had resolved to set his grasp upon it and make it his -own. - -The week came to an end. Then the Commodore said: - -"Now you can start home. But first we will have some more talk about -that tobacco matter. I know you now. I know your abilities as well as -you know them yourself--perhaps better. You understand that tobacco -matter; you understand that I am going to take possession of it, and you -also understand the plans which I have matured for doing it. What I want -is a man who knows my mind, and is qualified to represent me in Memphis, -and be in supreme command of that important business--and I appoint you." - -"Me!" - -"Yes. Your salary will be high--of course-for you are representing me. -Later you will earn increases of it, and will get them. You will need a -small army of assistants; choose them yourself--and carefully. Take no -man for friendship's sake; but, all things being equal, take the man you -know, take your friend, in preference to the stranger." After some -further talk under this head, the Commodore said: - -"Good-bye, my boy, and thank Alf for me, for sending you to me." - -When Ed reached Memphis he rushed down to the wharf in a fever to tell -his great news and thank the boys over and over again for thinking to -give him the letter to Mr. Vanderbilt. It happened to be one of those -idle times. Blazing hot noonday, and no sign of life on the wharf. But -as Ed threaded his way among the freight piles, he saw a white linen -figure stretched in slumber upon a pile of grain-sacks under an awning, -and said to himself, "That's one of them," and hastened his step; next, -he said, "It's Charley--it's Fairchild good"; and the next moment laid an -affectionate hand on the sleeper's shoulder. The eyes opened lazily, -took one glance, the face blanched, the form whirled itself from the -sack-pile, and in an instant Ed was alone and Fairchild was flying for -the wharf-boat like the wind! - -Ed was dazed, stupefied. Was Fairchild crazy? What could be the meaning -of this? He started slow and dreamily down toward the wharf-boat; turned -the corner of a freight-pile and came suddenly upon two of the boys. -They were lightly laughing over some pleasant matter; they heard his -step, and glanced up just as he discovered them; the laugh died abruptly; -and before Ed could speak they were off, and sailing over barrels and -bales like hunted deer. Again Ed was paralyzed. Had the boys all gone -mad? What could be the explanation of this extraordinary conduct? And -so, dreaming along, he reached the wharf-boat, and stepped aboard nothing -but silence there, and vacancy. He crossed the deck, turned the corner -to go down the outer guard, heard a fervent-- - -"O lord!" and saw a white linen form plunge overboard. - -The youth came up coughing and strangling, and cried out-- - -"Go 'way from here! You let me alone. I didn't do it, I swear I -didn't!" - -"Didn't do what?" - -"Give you the----" - -"Never mind what you didn't do--come out of that! What makes you all act -so? What have I done?" - -"You? Why you haven't done anything. But----" - -"Well, then, what have you got against me? What do you all treat me so -for?" - -"I--er--but haven't you got anything against us?" - -"Of course not. What put such a thing into your head?" - -"Honor bright--you haven't? - -"Honor bright." - -"Swear it!" - -"I don't know what in the world you mean, but I swear it, anyway." - -"And you'll shake hands with me?" - -"Goodness knows I'll be glad to! Why, I'm just starving to shake hands -with somebody!" - -The swimmer muttered, "Hang him, he smelt a rat and never delivered the -letter!--but it's all right, I'm not going to fetch up the subject." And -he crawled out and came dripping and draining to shake hands. First one -and then another of the conspirators showed up cautiously--armed to the -teeth--took in the amicable situation, then ventured warily forward and -joined the love-feast. - -And to Ed's eager inquiry as to what made them act as they had been -acting, they answered evasively, and pretended that they had put it up as -a joke, to see what he would do. It was the best explanation they could -invent at such short notice. And each said to himself, "He never -delivered that letter, and the joke is on us, if he only knew it or we -were dull enough to come out and tell." - -Then, of course, they wanted to know all about the trip; and he said-- - -"Come right up on the boiler deck and order the drinks it's my treat. -I'm going to tell you all about it. And to-night it's my treat again ---and we'll have oysters and a time!" - -When the drinks were brought and cigars lighted, Ed said: - -"Well, when, I delivered the letter to Mr. Vanderbilt----" - -"Great Scott!" - -"Gracious, how you scared me. What's the matter?" - -"Oh--er--nothing. Nothing--it was a tack in the chair-seat," said one. - -"But you all said it. However, no matter. When I delivered the -letter----" - -"Did you deliver it?" And they looked at each other as people might who -thought that maybe they were dreaming. - -Then they settled to listening; and as the story deepened and its marvels -grew, the amazement of it made them dumb, and the interest of it took -their breath. They hardly uttered a whisper during two hours, but sat -like petrifactions and drank in the immortal romance. At last the tale -was ended, and Ed said-- - -"And it's all owing to you, boys, and you'll never find me ungrateful ---bless your hearts, the best friends a fellow ever had! You'll all have -places; I want every one of you. I know you--I know you 'by the back,' -as the gamblers say. You're jokers, and all that, but you're sterling, -with the hallmark on. And Charley Fairchild, you shall be my first -assistant and right hand, because of your first-class ability, and -because you got me the letter, and for your father's sake who wrote it -for me, and to please Mr. Vanderbilt, who said it would! And here's to -that great man--drink hearty!" - -Yes, when the Moment comes, the Man appears--even if he is a thousand -miles away, and has to be discovered by a practical joke. - - - - -CHAPTER XXIX. - -When people do not respect us we are sharply offended; yet deep down in -his private heart no man much respects himself. - --Pudd'nhead Wilson's New Calendar. - -Necessarily, the human interest is the first interest in the log-book of -any country. The annals of Tasmania, in whose shadow we were sailing, -are lurid with that feature. Tasmania was a convict-dump, in old times; -this has been indicated in the account of the Conciliator, where -reference is made to vain attempts of desperate convicts to win to -permanent freedom, after escaping from Macquarrie Harbor and the "Gates -of Hell." In the early days Tasmania had a great population of convicts, -of both sexes and all ages, and a bitter hard life they had. In one spot -there was a settlement of juvenile convicts--children--who had been sent -thither from their home and their friends on the other side of the globe -to expiate their "crimes." - -In due course our ship entered the estuary called the Derwent, at whose -head stands Hobart, the capital of Tasmania. The Derwent's shores -furnish scenery of an interesting sort. The historian Laurie, whose -book, "The Story of Australasia," is just out, invoices its features with -considerable truth and intemperance: "The marvelous picturesqueness of -every point of view, combined with the clear balmy atmosphere and the -transparency of the ocean depths, must have delighted and deeply -impressed" the early explorers. "If the rock-bound coasts, sullen, -defiant, and lowering, seemed uninviting, these were occasionally broken -into charmingly alluring coves floored with golden sand, clad with -evergreen shrubbery, and adorned with every variety of indigenous wattle, -she-oak, wild flower, and fern, from the delicately graceful -'maiden-hair' to the palm-like 'old man'; while the majestic gum-tree, -clean and smooth as the mast of 'some tall admiral' pierces the clear air -to the height of 230 feet or more." - -It looked so to me. "Coasting along Tasman's Peninsula, what a shock of -pleasant wonder must have struck the early mariner on suddenly sighting -Cape Pillar, with its cluster of black-ribbed basaltic columns rising to -a height of 900 feet, the hydra head wreathed in a turban of fleecy -cloud, the base lashed by jealous waves spouting angry fountains of -foam." - -That is well enough, but I did not suppose those snags were 900 feet -high. Still they were a very fine show. They stood boldly out by -themselves, and made a fascinatingly odd spectacle. But there was -nothing about their appearance to suggest the heads of a hydra. They -looked like a row of lofty slabs with their upper ends tapered to the -shape of a carving-knife point; in fact, the early voyager, ignorant of -their great height, might have mistaken them for a rusty old rank of -piles that had sagged this way and that out of the perpendicular. - -The Peninsula is lofty, rocky, and densely clothed with scrub, or brush, -or both. It is joined to the main by a low neck. At this junction was -formerly a convict station called Port Arthur--a place hard to escape -from. Behind it was the wilderness of scrub, in which a fugitive would -soon starve; in front was the narrow neck, with a cordon of chained dogs -across it, and a line of lanterns, and a fence of living guards, armed. -We saw the place as we swept by--that is, we had a glimpse of what we -were told was the entrance to Port Arthur. The glimpse was worth -something, as a remembrancer, but that was all. - -The voyage thence up the Derwent Frith displays a grand succession of -fairy visions, in its entire length elsewhere unequaled. In gliding over -the deep blue sea studded with lovely islets luxuriant to the water's -edge, one is at a loss which scene to choose for contemplation and to -admire most. When the Huon and Bruni have been passed, there seems no -possible chance of a rival; but suddenly Mount Wellington, massive and -noble like his brother Etna, literally heaves in sight, sternly guarded -on either hand by Mounts Nelson and Rumney; presently we arrive at -Sullivan's Cove--Hobart! - -It is an attractive town. It sits on low hills that slope to the harbor ---a harbor that looks like a river, and is as smooth as one. Its still -surface is pictured with dainty reflections of boats and grassy banks and -luxuriant foliage. Back of the town rise highlands that are clothed in -woodland loveliness, and over the way is that noble mountain, Wellington, -a stately bulk, a most majestic pile. How beautiful is the whole region, -for form, and grouping, and opulence, and freshness of foliage, and -variety of color, and grace and shapeliness of the hills, the capes, the, -promontories; and then, the splendor of the sunlight, the dim rich -distances, the charm of the water-glimpses! And it was in this paradise -that the yellow-liveried convicts were landed, and the Corps-bandits -quartered, and the wanton slaughter of the kangaroo-chasing black -innocents consummated on that autumn day in May, in the brutish old time. -It was all out of keeping with the place, a sort of bringing of heaven -and hell together. - -The remembrance of this paradise reminds me that it was at Hobart that we -struck the head of the procession of Junior Englands. We were to -encounter other sections of it in New Zealand, presently, and others -later in Natal. Wherever the exiled Englishman can find in his new home -resemblances to his old one, he is touched to the marrow of his being; -the love that is in his heart inspires his imagination, and these allied -forces transfigure those resemblances into authentic duplicates of the -revered originals. It is beautiful, the feeling which works this -enchantment, and it compels one's homage; compels it, and also compels -one's assent--compels it always--even when, as happens sometimes, one -does not see the resemblances as clearly as does the exile who is -pointing them out. - -The resemblances do exist, it is quite true; and often they cunningly -approximate the originals--but after all, in the matter of certain -physical patent rights there is only one England. Now that I have -sampled the globe, I am not in doubt. There is a beauty of Switzerland, -and it is repeated in the glaciers and snowy ranges of many parts of the -earth; there is a beauty of the fiord, and it is repeated in New Zealand -and Alaska; there is a beauty of Hawaii, and it is repeated in ten -thousand islands of the Southern seas; there is a beauty of the prairie -and the plain, and it is repeated here and there in the earth; each of -these is worshipful, each is perfect in its way, yet holds no monopoly of -its beauty; but that beauty which is England is alone--it has no -duplicate. - -It is made up of very simple details--just grass, and trees, and shrubs, -and roads, and hedges, and gardens, and houses, and vines, and churches, -and castles, and here and there a ruin--and over it all a mellow -dream-haze of history. But its beauty is incomparable, and all its own. - -Hobart has a peculiarity--it is the neatest town that the sun shines on; -and I incline to believe that it is also the cleanest. However that may -be, its supremacy in neatness is not to be questioned. There cannot be -another town in the world that has no shabby exteriors; no rickety gates -and fences, no neglected houses crumbling to ruin, no crazy and unsightly -sheds, no weed-grown front-yards of the poor, no back-yards littered with -tin cans and old boots and empty bottles, no rubbish in the gutters, no -clutter on the sidewalks, no outer-borders fraying out into dirty lanes -and tin-patched huts. No, in Hobart all the aspects are tidy, and all a -comfort to the eye; the modestest cottage looks combed and brushed, and -has its vines, its flowers, its neat fence, its neat gate, its comely cat -asleep on the window ledge. - -We had a glimpse of the museum, by courtesy of the American gentleman who -is curator of it. It has samples of half-a-dozen different kinds of -marsupials--[A marsupial is a plantigrade vertebrate whose specialty is -its pocket. In some countries it is extinct, in the others it is rare. -The first American marsupials were Stephen Girard, Mr. Aston and the -opossum; the principal marsupials of the Southern Hemisphere are Mr. -Rhodes, and the kangaroo. I, myself, am the latest marsupial. Also, I -might boast that I have the largest pocket of them all. But there is -nothing in that.]--one, the "Tasmanian devil;" that is, I think he was -one of them. And there was a fish with lungs. When the water dries up -it can live in the mud. Most curious of all was a parrot that kills -sheep. On one great sheep-run this bird killed a thousand sheep in a -whole year. He doesn't want the whole sheep, but only the kidney-fat. -This restricted taste makes him an expensive bird to support. To get the -fat he drives his beak in and rips it out; the wound is mortal. This -parrot furnishes a notable example of evolution brought about by changed -conditions. When the sheep culture was introduced, it presently brought -famine to the parrot by exterminating a kind of grub which had always -thitherto been the parrot's diet. The miseries of hunger made the bird -willing to eat raw flesh, since it could get no other food, and it began -to pick remnants of meat from sheep skins hung out on the fences to dry. -It soon came to prefer sheep meat to any other food, and by and by it -came to prefer the kidney-fat to any other detail of the sheep. The -parrot's bill was not well shaped for digging out the fat, but Nature -fixed that matter; she altered the bill's shape, and now the parrot can -dig out kidney-fat better than the Chief Justice of the Supreme Court, or -anybody else, for that matter--even an Admiral. - -And there was another curiosity--quite a stunning one, I thought: -Arrow-heads and knives just like those which Primeval Man made out of -flint, and thought he had done such a wonderful thing--yes, and has been -humored and coddled in that superstition by this age of admiring -scientists until there is probably no living with him in the other world -by now. Yet here is his finest and nicest work exactly duplicated in our -day; and by people who have never heard of him or his works: by -aborigines who lived in the islands of these seas, within our time. And -they not only duplicated those works of art but did it in the brittlest -and most treacherous of substances--glass: made them out of old brandy -bottles flung out of the British camps; millions of tons of them. It is -time for Primeval Man to make a little less noise, now. He has had his -day. He is not what he used to be. We had a drive through a bloomy and -odorous fairy-land, to the Refuge for the Indigent--a spacious and -comfortable home, with hospitals, etc., for both sexes. There was a -crowd in there, of the oldest people I have ever seen. It was like being -suddenly set down in a new world--a weird world where Youth has never -been, a world sacred to Age, and bowed forms, and wrinkles. Out of the -359 persons present, 223, were ex-convicts, and could have told stirring -tales, no doubt, if they had been minded to talk; 42 of the 359 were past -80, and several were close upon 90; the average age at death there is 76 -years. As for me, I have no use for that place; it is too healthy. -Seventy is old enough--after that, there is too much risk. Youth and -gaiety might vanish, any day--and then, what is left? Death in life; -death without its privileges, death without its benefits. There were 185 -women in that Refuge, and 81 of them were ex-convicts. - -The steamer disappointed us. Instead of making a long visit at Hobart, -as usual, she made a short one. So we got but a glimpse of Tasmania, and -then moved on. - - - - -CHAPTER XXX. - -Nature makes the locust with an appetite for crops; man would have made -him with an appetite for sand. - --Pudd'nhead Wilson's New Calendar. - -We spent part of an afternoon and a night at sea, and reached Bluff, in -New Zealand, early in the morning. Bluff is at the bottom of the middle -island, and is away down south, nearly forty-seven degrees below the -equator. It lies as far south of the line as Quebec lies north of it, -and the climates of the two should be alike; but for some reason or other -it has not been so arranged. Quebec is hot in the summer and cold in the -winter, but Bluff's climate is less intense; the cold weather is not very -cold, the hot weather is not very hot; and the difference between the -hottest month and the coldest is but 17 degrees Fahrenheit. - -In New Zealand the rabbit plague began at Bluff. The man who introduced -the rabbit there was banqueted and lauded; but they would hang him, now, -if they could get him. In England the natural enemy of the rabbit is -detested and persecuted; in the Bluff region the natural enemy of the -rabbit is honored, and his person is sacred. The rabbit's natural enemy -in England is the poacher, in Bluff its natural enemy is the stoat, the -weasel, the ferret, the cat, and the mongoose. In England any person -below the Heir who is caught with a rabbit in his possession must -satisfactorily explain how it got there, or he will suffer fine and -imprisonment, together with extinction of his peerage; in Bluff, the cat -found with a rabbit in its possession does not have to explain--everybody -looks the other way; the person caught noticing would suffer fine and -imprisonment, with extinction of peerage. This is a sure way to -undermine the moral fabric of a cat. Thirty years from now there will -not be a moral cat in New Zealand. Some think there is none there now. -In England the poacher is watched, tracked, hunted--he dare not show his -face; in Bluff the cat, the weasel, the stoat, and the mongoose go up and -down, whither they will, unmolested. By a law of the legislature, posted -where all may read, it is decreed that any person found in possession of -one of these creatures (dead) must satisfactorily explain the -circumstances or pay a fine of not less than L5, nor more than L20. The -revenue from this source is not large. Persons who want to pay a hundred -dollars for a dead cat are getting rarer and rarer every day. This is -bad, for the revenue was to go to the endowment of a University. All -governments are more or less short-sighted: in England they fine the -poacher, whereas he ought to be banished to New Zealand. New Zealand -would pay his way, and give him wages. - -It was from Bluff that we ought to have cut across to the west coast and -visited the New Zealand Switzerland, a land of superb scenery, made up of -snowy grandeurs, anal mighty glaciers, and beautiful lakes; and over -there, also, are the wonderful rivals of the Norwegian and Alaskan -fiords; and for neighbor, a waterfall of 1,900 feet; but we were obliged -to postpone the trip to some later and indefinite time. - -November 6. A lovely summer morning; brilliant blue sky. A few miles -out from Invercargill, passed through vast level green expanses snowed -over with sheep. Fine to see. The green, deep and very vivid sometimes; -at other times less so, but delicate and lovely. A passenger reminds me -that I am in "the England of the Far South." - -Dunedin, same date. The town justifies Michael Davitt's praises. -The people are Scotch. They stopped here on their way from home to -heaven-thinking they had arrived. The population is stated at 40,000, by -Malcolm Ross, journalist; stated by an M. P. at 60,000. A journalist -cannot lie. - -To the residence of Dr. Hockin. He has a fine collection of books -relating to New Zealand; and his house is a museum of Maori art and -antiquities. He has pictures and prints in color of many native chiefs -of the past--some of them of note in history. There is nothing of the -savage in the faces; nothing could be finer than these men's features, -nothing more intellectual than these faces, nothing more masculine, -nothing nobler than their aspect. The aboriginals of Australia and -Tasmania looked the savage, but these chiefs looked like Roman -patricians. The tattooing in these portraits ought to suggest the -savage, of course, but it does not. The designs are so flowing and -graceful and beautiful that they are a most satisfactory decoration. It -takes but fifteen minutes to get reconciled to the tattooing, and but -fifteen more to perceive that it is just the thing. After that, the -undecorated European face is unpleasant and ignoble. - -Dr. Hockiu gave us a ghastly curiosity--a lignified caterpillar with a -plant growing out of the back of its neck--a plant with a slender stem 4 -inches high. It happened not by accident, but by design--Nature's -design. This caterpillar was in the act of loyally carrying out a law -inflicted upon him by Nature--a law purposely inflicted upon him to get -him into trouble--a law which was a trap; in pursuance of this law he -made the proper preparations for turning himself into a night-moth; that -is to say, he dug a little trench, a little grave, and then stretched -himself out in it on his stomach and partially buried himself--then -Nature was ready for him. She blew the spores of a peculiar fungus -through the air with a purpose. Some of them fell into a crease in the -back of the caterpillar's neck, and began to sprout and grow--for there -was soil there--he had not washed his neck. The roots forced themselves -down into the worm's person, and rearward along through its body, sucking -up the creature's juices for sap; the worm slowly died, and turned to -wood. And here he was now, a wooden caterpillar, with every detail of -his former physique delicately and exactly preserved and perpetuated, and -with that stem standing up out of him for his monument--monument -commemorative of his own loyalty and of Nature's unfair return for it. - -Nature is always acting like that. Mrs. X. said (of course) that the -caterpillar was not conscious and didn't suffer. She should have known -better. No caterpillar can deceive Nature. If this one couldn't suffer, -Nature would have known it and would have hunted up another caterpillar. -Not that she would have let this one go, merely because it was defective. -No. She would have waited and let him turn into a night-moth; and then -fried him in the candle. - -Nature cakes a fish's eyes over with parasites, so that it shan't be able -to avoid its enemies or find its food. She sends parasites into a -star-fish's system, which clog up its prongs and swell them and make them -so uncomfortable that the poor creature delivers itself from the prong to -ease its misery; and presently it has to part with another prong for the -sake of comfort, and finally with a third. If it re-grows the prongs, -the parasite returns and the same thing is repeated. And finally, when -the ability to reproduce prongs is lost through age, that poor old -star-fish can't get around any more, and so it dies of starvation. - -In Australia is prevalent a horrible disease due to an "unperfected -tapeworm." Unperfected--that is what they call it, I do not know why, -for it transacts business just as well as if it were finished and -frescoed and gilded, and all that. - -November 9. To the museum and public picture gallery with the president -of the Society of Artists. Some fine pictures there, lent by the S. of -A. several of them they bought, the others came to them by gift. Next, -to the gallery of the S. of A.--annual exhibition--just opened. Fine. -Think of a town like this having two such collections as this, and a -Society of Artists. It is so all over Australasia. If it were a -monarchy one might understand it. I mean an absolute monarchy, where it -isn't necessary to vote money, but take it. Then art flourishes. But -these colonies are republics--republics with a wide suffrage; voters of -both sexes, this one of New Zealand. In republics, neither the -government nor the rich private citizen is much given to propagating art. -All over Australasia pictures by famous European artists are bought for -the public galleries by the State and by societies of citizens. Living -citizens--not dead ones. They rob themselves to give, not their heirs. -This S. of A. here owns its buildings built it by subscription. - - - - -CHAPTER XXXI. - -The spirit of wrath--not the words--is the sin; and the spirit of wrath -is cursing. We begin to swear before we can talk. - --Pudd'nhead Wilson's New Calendar. - -November 11. On the road. This train-express goes twenty and one-half -miles an hour, schedule time; but it is fast enough, the outlook upon sea -and land is so interesting, and the cars so comfortable. They are not -English, and not American; they are the Swiss combination of the two. -A narrow and railed porch along the side, where a person can walk -up and down. A lavatory in each car. This is progress; this is -nineteenth-century spirit. In New Zealand, these fast expresses run twice -a week. It is well to know this if you want to be a bird and fly through -the country at a 20-mile gait; otherwise you may start on one of the five -wrong days, and then you will get a train that can't overtake its own -shadow. - -By contrast, these pleasant cars call to mind the branch-road cars at -Maryborough, Australia, and the passengers' talk about the branch-road -and the hotel. - -Somewhere on the road to Maryborough I changed for a while to a -smoking-carriage. There were two gentlemen there; both riding backward, -one at each end of the compartment. They were acquaintances of each -other. I sat down facing the one that sat at the starboard window. He -had a good face, and a friendly look, and I judged from his dress that he -was a dissenting minister. He was along toward fifty. Of his own motion -he struck a match, and shaded it with his hand for me to light my cigar. -I take the rest from my diary: - -In order to start conversation I asked him something about Maryborough. -He said, in a most pleasant--even musical voice, but with quiet and -cultured decision: - -"It's a charming town, with a hell of a hotel." - -I was astonished. It seemed so odd to hear a minister swear out loud. -He went placidly on: - -"It's the worst hotel in Australia. Well, one may go further, and say in -Australasia." - -"Bad beds?" - -"No--none at all. Just sand-bags." - -"The pillows, too?" - -"Yes, the pillows, too. Just sand. And not a good quality of sand. It -packs too hard, and has never been screened. There is too much gravel in -it. It is like sleeping on nuts." - -"Isn't there any good sand?" - -"Plenty of it. There is as good bed-sand in this region as the world can -furnish. Aerated sand--and loose; but they won't buy it. They want -something that will pack solid, and petrify." - -"How are the rooms?" - -"Eight feet square; and a sheet of iced oil-cloth to step on in the -morning when you get out of the sand-quarry." - -"As to lights?" - -"Coal-oil lamp." - -"A good one?" - -"No. It's the kind that sheds a gloom." - -"I like a lamp that burns all night." - -"This one won't. You must blow it out early." - -"That is bad. One might want it again in the night. Can't find it in -the dark." - -"There's no trouble; you can find it by the stench." - -"Wardrobe?" - -"Two nails on the door to hang seven suits of clothes on if you've got -them." - -"Bells?" - -"There aren't any." - -"What do you do when you want service?" - -"Shout. But it won't fetch anybody." - -"Suppose you want the chambermaid to empty the slopjar?" - -"There isn't any slop-jar. The hotels don't keep them. That is, outside -of Sydney and Melbourne." - -"Yes, I knew that. I was only talking. It's the oddest thing in -Australia. Another thing: I've got to get up in the dark, in the -morning, to take the 5 o'clock train. Now if the boots----" - -"There isn't any." - -"Well, the porter." - -"There isn't any." - -"But who will call me?" - -"Nobody. You'll call yourself. And you'll light yourself, too. -There'll not be a light burning in the halls or anywhere. And if you -don't carry a light, you'll break your neck." - -"But who will help me down with my baggage?" - -"Nobody. However, I will tell you what to do. In Maryborough there's an -American who has lived there half a lifetime; a fine man, and prosperous -and popular. He will be on the lookout for you; you won't have any -trouble. Sleep in peace; he will rout you out, and you will make your -train. Where is your manager?" - -"I left him at Ballarat, studying the language. And besides, he had to -go to Melbourne and get us ready for New Zealand. I've not tried to -pilot myself before, and it doesn't look easy." - -"Easy! You've selected the very most difficult piece of railroad in -Australia for your experiment. There are twelve miles of this road which -no man without good executive ability can ever hope--tell me, have you -good executive ability? first-rate executive ability?" - -"I--well, I think so, but----" - -"That settles it. The tone of----oh, you wouldn't ever make it in the -world. However, that American will point you right, and you'll go. -You've got tickets?" - -"Yes--round trip; all the way to Sydney." - -"Ah, there it is, you see! You are going in the 5 o'clock by -Castlemaine--twelve miles--instead of the 7.15 by Ballarat--in order to -save two hours of fooling along the road. Now then, don't interrupt--let -me have the floor. You're going to save the government a deal of -hauling, but that's nothing; your ticket is by Ballarat, and it isn't -good over that twelve miles, and so----" - -"But why should the government care which way I go?" - -"Goodness knows! Ask of the winds that far away with fragments strewed -the sea, as the boy that stood on the burning deck used to say. The -government chooses to do its railway business in its own way, and it -doesn't know as much about it as the French. In the beginning they tried -idiots; then they imported the French--which was going backwards, you -see; now it runs the roads itself--which is going backwards again, you -see. Why, do you know, in order to curry favor with the voters, the -government puts down a road wherever anybody wants it--anybody that owns -two sheep and a dog; and by consequence we've got, in the colony of -Victoria, 800 railway stations, and the business done at eighty of them -doesn't foot up twenty shillings a week." - -"Five dollars? Oh, come!" - -"It's true. It's the absolute truth." - -"Why, there are three or four men on wages at every station." - -"I know it. And the station-business doesn't pay for the sheep-dip to -sanctify their coffee with. It's just as I say. And accommodating? -Why, if you shake a rag the train will stop in the midst of the -wilderness to pick you up. All that kind of politics costs, you see. -And then, besides, any town that has a good many votes and wants a fine -station, gets it. Don't you overlook that Maryborough station, if you -take an interest in governmental curiosities. Why, you can put the whole -population of Maryborough into it, and give them a sofa apiece, and have -room for more. You haven't fifteen stations in America that are as big, -and you probably haven't five that are half as fine. Why, it's -perfectly elegant. And the clock! Everybody will show you the clock. -There isn't a station in Europe that's got such a clock. It doesn't -strike--and that's one mercy. It hasn't any bell; and as you'll have -cause to remember, if you keep your reason, all Australia is simply -bedamned with bells. On every quarter-hour, night and day, they jingle a -tiresome chime of half a dozen notes--all the clocks in town at once, all -the clocks in Australasia at once, and all the very same notes; first, -downward scale: mi, re, do, sol--then upward scale: sol, si, re, do--down -again: mi, re, do, sol--up again: sol, si, re, do--then the clock--say at -midnight clang--clang--clang--clang--clang-clang--clang--clang--clang ---clang----and, by that time you're--hello, what's all this excitement -about? a runaway--scared by the train; why, you think this train could -scare anything. Well, when they build eighty stations at a loss and a -lot of palace-stations and clocks like Maryborough's at another loss, the -government has got to economize somewhere hasn't it? Very well look at -the rolling stock. That's where they save the money. Why, that train -from Maryborough will consist of eighteen freight-cars and two -passenger-kennels; cheap, poor, shabby, slovenly; no drinking water, no -sanitary arrangements, every imaginable inconvenience; and slow?--oh, the -gait of cold molasses; no air-brake, no springs, and they'll jolt your -head off every time they start or stop. That's where they make their -little economies, you see. They spend tons of money to house you -palatially while you wait fifteen minutes for a train, then degrade you -to six hours' convict-transportation to get the foolish outlay back. -What a rational man really needs is discomfort while he's waiting, then -his journey in a nice train would be a grateful change. But no, that -would be common sense--and out of place in a government. And then, -besides, they save in that other little detail, you know--repudiate their -own tickets, and collect a poor little illegitimate extra shilling out of -you for that twelve miles, and----" - -"Well, in any case----" - -"Wait--there's more. Leave that American out of the account and see what -would happen. There's nobody on hand to examine your ticket when you -arrive. But the conductor will come and examine it when the train is -ready to start. It is too late to buy your extra ticket now; the train -can't wait, and won't. You must climb out." - -"But can't I pay the conductor?" - -"No, he is not authorized to receive the money, and he won't. You must -climb out. There's no other way. I tell you, the railway management is -about the only thoroughly European thing here--continentally European I -mean, not English. It's the continental business in perfection; down -fine. Oh, yes, even to the peanut-commerce of weighing baggage." - -The train slowed up at his place. As he stepped out he said: - -"Yes, you'll like Maryborough. Plenty of intelligence there. It's a -charming place--with a hell of a hotel." - -Then he was gone. I turned to the other gentleman: - -"Is your friend in the ministry?" - -"No--studying for it." - - - - -CHAPTER XXXII. - -The man with a new idea is a Crank until the idea succeeds. - --Pudd'nhead Wilson's New Calendar. - -It was Junior England all the way to Christchurch--in fact, just a -garden. And Christchurch is an English town, with an English-park annex, -and a winding English brook just like the Avon--and named the Avon; but -from a man, not from Shakespeare's river. Its grassy banks are bordered -by the stateliest and most impressive weeping willows to be found in the -world, I suppose. They continue the line of a great ancestor; they were -grown from sprouts of the willow that sheltered Napoleon's grave in St. -Helena. It is a settled old community, with all the serenities, the -graces, the conveniences, and the comforts of the ideal home-life. If it -had an established Church and social inequality it would be England over -again with hardly a lack. - -In the museum we saw many curious and interesting things; among others a -fine native house of the olden time, with all the details true to the -facts, and the showy colors right and in their proper places. All the -details: the fine mats and rugs and things; the elaborate and wonderful -wood carvings--wonderful, surely, considering who did them wonderful in -design and particularly in execution, for they were done with admirable -sharpness and exactness, and yet with no better tools than flint and jade -and shell could furnish; and the totem-posts were there, ancestor above -ancestor, with tongues protruded and hands clasped comfortably over -bellies containing other people's ancestors--grotesque and ugly devils, -every one, but lovingly carved, and ably; and the stuffed natives were -present, in their proper places, and looking as natural as life; and the -housekeeping utensils were there, too, and close at hand the carved and -finely ornamented war canoe. - -And we saw little jade gods, to hang around the neck--not everybody's, -but sacred to the necks of natives of rank. Also jade weapons, and many -kinds of jade trinkets--all made out of that excessively hard stone -without the help of any tool of iron. And some of these things had small -round holes bored through them--nobody knows how it was done; a mystery, -a lost art. I think it was said that if you want such a hole bored in a -piece of jade now, you must send it to London or Amsterdam where the -lapidaries are. - -Also we saw a complete skeleton of the giant Moa. It stood ten feet -high, and must have been a sight to look at when it was a living bird. -It was a kicker, like the ostrich; in fight it did not use its beak, but -its foot. It must have been a convincing kind of kick. If a person had -his back to the bird and did not see who it was that did it, he would -think he had been kicked by a wind-mill. - -There must have been a sufficiency of moas in the old forgotten days when -his breed walked the earth. His bones are found in vast masses, all -crammed together in huge graves. They are not in caves, but in the -ground. Nobody knows how they happened to get concentrated there. Mind, -they are bones, not fossils. This means that the moa has not been -extinct very long. Still, this is the only New Zealand creature which -has no mention in that otherwise comprehensive literature, the native -legends. This is a significant detail, and is good circumstantial -evidence that the moa has been extinct 500 years, since the Maori has -himself--by tradition--been in New Zealand since the end of the fifteenth -century. He came from an unknown land--the first Maori did--then sailed -back in his canoe and brought his tribe, and they removed the aboriginal -peoples into the sea and into the ground and took the land. That is the -tradition. That that first Maori could come, is understandable, for -anybody can come to a place when he isn't trying to; but how that -discoverer found his way back home again without a compass is his secret, -and he died with it in him. His language indicates that he came from -Polynesia. He told where he came from, but he couldn't spell well, so -one can't find the place on the map, because people who could spell -better than he could, spelt the resemblance all out of it when they made -the map. However, it is better to have a map that is spelt right than -one that has information in it. - -In New Zealand women have the right to vote for members of the -legislature, but they cannot be members themselves. The law extending -the suffrage to them event into effect in 1893. The population of -Christchurch (census of 1891) was 31,454. The first election under the -law was held in November of that year. Number of men who voted, 6,313; -number of women who voted, 5,989. These figures ought to convince us -that women are not as indifferent about politics as some people would -have us believe. In New Zealand as a whole, the estimated adult female -population was 139,915; of these 109,461 qualified and registered their -names on the rolls 78.23 per cent. of the whole. Of these, 90,290 went -to the polls and voted--85.18 per cent. Do men ever turn out better than -that--in America or elsewhere? Here is a remark to the other sex's -credit, too--I take it from the official report: - -"A feature of the election was the orderliness and sobriety of the -people. Women were in no way molested." - -At home, a standing argument against woman suffrage has always been that -women could not go to the polls without being insulted. The arguments -against woman suffrage have always taken the easy form of prophecy. The -prophets have been prophesying ever since the woman's rights movement -began in 1848--and in forty-seven years they have never scored a hit. - -Men ought to begin to feel a sort of respect for their mothers and wives -and sisters by this time. The women deserve a change of attitude like -that, for they have wrought well. In forty-seven years they have swept -an imposingly large number of unfair laws from the statute books of -America. In that brief time these serfs have set themselves free -essentially. Men could not have done so much for themselves in that time -without bloodshed--at least they never have; and that is argument that -they didn't know how. The women have accomplished a peaceful revolution, -and a very beneficent one; and yet that has not convinced the average man -that they are intelligent, and have courage and energy and perseverance -and fortitude. It takes much to convince the average man of anything; -and perhaps nothing can ever make him realize that he is the average -woman's inferior--yet in several important details the evidences seems to -show that that is what he is. Man has ruled the human race from the -beginning--but he should remember that up to the middle of the present -century it was a dull world, and ignorant and stupid; but it is not such -a dull world now, and is growing less and less dull all the time. This -is woman's opportunity--she has had none before. I wonder where man will -be in another forty-seven years? - -In the New Zealand law occurs this: "The word person wherever it occurs -throughout the Act includes woman." - -That is promotion, you see. By that enlargement of the word, the matron -with the garnered wisdom and experience of fifty years becomes at one -jump the political equal of her callow kid of twenty-one. The white -population of the colony is 626,000, the Maori population is 42,000. The -whites elect seventy members of the House of Representatives, the Maoris -four. The Maori women vote for their four members. - -November 16. After four pleasant days in Christchurch, we are to leave -at midnight to-night. Mr. Kinsey gave me an ornithorhynchus, and I am -taming it. - -Sunday, 17th. Sailed last night in the Flora, from Lyttelton. - -So we did. I remember it yet. The people who sailed in the Flora that -night may forget some other things if they live a good while, but they -will not live long, enough to forget that. The Flora is about the -equivalent of a cattle-scow; but when the Union Company find it -inconvenient to keep a contract and lucrative to break it, they smuggle -her into passenger service, and "keep the change." - -They give no notice of their projected depredation; you innocently buy -tickets for the advertised passenger boat, and when you get down to -Lyttelton at midnight, you find that they have substituted the scow. -They have plenty of good boats, but no competition--and that is the -trouble. It is too late now to make other arrangements if you have -engagements ahead. - -It is a powerful company, it has a monopoly, and everybody is afraid of -it--including the government's representative, who stands at the end of -the stage-plank to tally the passengers and see that no boat receives a -greater number than the law allows her to carry. This conveniently-blind -representative saw the scow receive a number which was far in excess of -its privilege, and winked a politic wink and said nothing. The -passengers bore with meekness the cheat which had been put upon them, and -made no complaint. - -It was like being at home in America, where abused passengers act in just -the same way. A few days before, the Union Company had discharged a -captain for getting a boat into danger, and had advertised this act as -evidence of its vigilance in looking after the safety of the passengers ---for thugging a captain costs the company nothing, but when opportunity -offered to send this dangerously overcrowded tub to sea and save a little -trouble and a tidy penny by it, it forgot to worry about the passenger's -safety. - -The first officer told me that the Flora was privileged to carry 125 -passengers. She must have had all of 200 on board. All the cabins were -full, all the cattle-stalls in the main stable were full, the spaces at -the heads of companionways were full, every inch of floor and table in -the swill-room was packed with sleeping men and remained so until the -place was required for breakfast, all the chairs and benches on the -hurricane deck were occupied, and still there were people who had to walk -about all night! - -If the Flora had gone down that night, half of the people on board would -have been wholly without means of escape. - -The owners of that boat were not technically guilty of conspiracy to -commit murder, but they were morally guilty of it. - -I had a cattle-stall in the main stable--a cavern fitted up with a long -double file of two-storied bunks, the files separated by a calico -partition--twenty men and boys on one side of it, twenty women and girls -on the other. The place was as dark as the soul of the Union Company, -and smelt like a kennel. When the vessel got out into the heavy seas and -began to pitch and wallow, the cavern prisoners became immediately -seasick, and then the peculiar results that ensued laid all my previous -experiences of the kind well away in the shade. And the wails, the -groans, the cries, the shrieks, the strange ejaculations--it was -wonderful. - -The women and children and some of the men and boys spent the night in -that place, for they were too ill to leave it; but the rest of us got up, -by and by, and finished the night on the hurricane-deck. - -That boat was the foulest I was ever in; and the smell of the breakfast -saloon when we threaded our way among the layers of steaming passengers -stretched upon its floor and its tables was incomparable for efficiency. - -A good many of us got ashore at the first way-port to seek another ship. -After a wait of three hours we got good rooms in the Mahinapua, a wee -little bridal-parlor of a boat--only 205 tons burthen; clean and -comfortable; good service; good beds; good table, and no crowding. The -seas danced her about like a duck, but she was safe and capable. - -Next morning early she went through the French Pass--a narrow gateway of -rock, between bold headlands--so narrow, in fact, that it seemed no wider -than a street. The current tore through there like a mill-race, and the -boat darted through like a telegram. The passage was made in half a -minute; then we were in a wide place where noble vast eddies swept -grandly round and round in shoal water, and I wondered what they would do -with the little boat. They did as they pleased with her. They picked -her up and flung her around like nothing and landed her gently on the -solid, smooth bottom of sand--so gently, indeed, that we barely felt her -touch it, barely felt her quiver when she came to a standstill. The -water was as clear as glass, the sand on the bottom was vividly distinct, -and the fishes seemed to be swimming about in nothing. Fishing lines -were brought out, but before we could bait the hooks the boat was off and -away again. - - - - -CHAPTER XXXIII. - -Let us be grateful to Adam our benefactor. He cut us out of the -"blessing of idleness," and won for us the "curse of labor." - --Pudd'nhead Wilson's New Calendar. - -We soon reached the town of Nelson, and spent the most of the day there, -visiting acquaintances and driving with them about the garden--the whole -region is a garden, excepting the scene of the "Maungatapu Murders," of -thirty years ago. That is a wild place--wild and lonely; an ideal place -for a murder. It is at the base of a vast, rugged, densely timbered -mountain. In the deep twilight of that forest solitude four desperate -rascals--Burgess, Sullivan, Levy, and Kelley--ambushed themselves beside -the mountain-trail to murder and rob four travelers--Kempthorne, Mathieu, -Dudley, and De Pontius, the latter a New Yorker. A harmless old laboring -man came wandering along, and as his presence was an embarrassment, they -choked him, hid him, and then resumed their watch for the four. They had -to wait a while, but eventually everything turned out as they desired. - -That dark episode is the one large event in the history of Nelson. The -fame of it traveled far. Burgess made a confession. It is a remarkable -paper. For brevity, succinctness, and concentration, it is perhaps -without its peer in the literature of murder. There are no waste words -in it; there is no obtrusion of matter not pertinent to the occasion, nor -any departure from the dispassionate tone proper to a formal business -statement--for that is what it is: a business statement of a murder, by -the chief engineer of it, or superintendent, or foreman, or whatever one -may prefer to call him. - - "We were getting impatient, when we saw four men and a pack-horse - coming. I left my cover and had a look at the men, for Levy had - told me that Mathieu was a small man and wore a large beard, and - that it was a chestnut horse. I said, 'Here they come.' They were - then a good distance away; I took the caps off my gun, and put fresh - ones on. I said, 'You keep where you are, I'll put them up, and you - give me your gun while you tie them.' It was arranged as I have - described. The men came; they arrived within about fifteen yards - when I stepped up and said, 'Stand! bail up!' That means all of - them to get together. I made them fall back on the upper side of - the road with their faces up the range, and Sullivan brought me his - gun, and then tied their hands behind them. The horse was very - quiet all the time, he did not move. When they were all tied, - Sullivan took the horse up the hill, and put him in the bush; he cut - the rope and let the swags--[A "swag" is a kit, a pack, small - baggage.]--fall on the ground, and then came to me. We then marched - the men down the incline to the creek; the water at this time barely - running. Up this creek we took the men; we went, I daresay, five or - six hundred yards up it, which took us nearly half-an-hour to - accomplish. Then we turned to the right up the range; we went, I - daresay, one hundred and fifty yards from the creek, and there we - sat down with the men. I said to Sullivan, 'Put down your gun and - search these men,' which he did. I asked them their several names; - they told me. I asked them if they were expected at Nelson. They - said, 'No.' If such their lives would have been spared. In money - we took L60 odd. I said, 'Is this all you have? You had better - tell me.' Sullivan said, 'Here is a bag of gold.' I said, 'What's on - that pack-horse? Is there any gold ?' when Kempthorne said, 'Yes, - my gold is in the portmanteau, and I trust you will not take it - all.' 'Well,' I said, 'we must take you away one at a time, because - the range is steep just here, and then we will let you go.' They - said, 'All right,' most cheerfully. We tied their feet, and took - Dudley with us; we went about sixty yards with him. This was - through a scrub. It was arranged the night previously that it would - be best to choke them, in case the report of the arms might be heard - from the road, and if they were missed they never would be found. - So we tied a handkerchief over his eyes, when Sullivan took the sash - off his waist, put it round his neck, and so strangled him. - Sullivan, after I had killed the old laboring man, found fault with - the way he was choked. He said, 'The next we do I'll show you my - way.' I said, 'I have never done such a thing before. I have shot - a man, but never choked one.' We returned to the others, when - Kempthorne said, 'What noise was that?' I said it was caused by - breaking through the scrub. This was taking too much time, so it - was agreed to shoot them. With that I said, 'We'll take you no - further, but separate you, and then loose one of you, and he can - relieve the others.' So with that, Sullivan took De Pontius to the - left of where Kempthorne was sitting. I took Mathieu to the right. - I tied a strap round his legs, and shot him with a revolver. He - yelled, I ran from him with my gun in my hand, I sighted Kempthorne, - who had risen to his feet. I presented the gun, and shot him behind - the right ear; his life's blood welled from him, and he died - instantaneously. Sullivan had shot. De Pontius in the meantime, - and then came to me. I said, 'Look to Mathieu,' indicating the spot - where he lay. He shortly returned and said, 'I had to "chiv" that - fellow, he was not dead,' a cant word, meaning that he had to stab - him. Returning to the road we passed where De Pontius lay and was - dead. Sullivan said, 'This is the digger, the others were all - storekeepers; this is the digger, let's cover him up, for should the - others be found, they'll think he done it and sloped,' meaning he - had gone. So with that we threw all the stones on him, and then - left him. This bloody work took nearly an hour and a half from the - time we stopped the men." - -Anyone who reads that confession will think that the man who wrote it was -destitute of emotions, destitute of feeling. That is partly true. As -regarded others he was plainly without feeling--utterly cold and -pitiless; but as regarded himself the case was different. While he cared -nothing for the future of the murdered men, he cared a great deal for his -own. It makes one's flesh creep to read the introduction to his -confession. The judge on the bench characterized it as "scandalously -blasphemous," and it certainly reads so, but Burgess meant no blasphemy. -He was merely a brute, and whatever he said or wrote was sure to expose -the fact. His redemption was a very real thing to him, and he was as -jubilantly happy on the gallows as ever was Christian martyr at the -stake. We dwellers in this world are strangely made, and mysteriously -circumstanced. We have to suppose that the murdered men are lost, and -that Burgess is saved; but we cannot suppress our natural regrets. - - "Written in my dungeon drear this 7th of August, in the year of - Grace, 1866. To God be ascribed all power and glory in subduing the - rebellious spirit of a most guilty wretch, who has been brought, - through the instrumentality of a faithful follower of Christ, to see - his wretched and guilty state, inasmuch as hitherto he has led an - awful and wretched life, and through the assurance of this faithful - soldier of Christ, he has been led and also believes that Christ - will yet receive and cleanse him from all his deep-dyed and bloody - sins. I lie under the imputation which says, 'Come now and let us - reason together, saith the Lord: though your sins be as scarlet, - they shall be as white as snow; though they be red like crimson, - they shall be as wool.' On this promise I rely." - -We sailed in the afternoon late, spent a few hours at New Plymouth, then -sailed again and reached Auckland the next day, November 20th, and -remained in that fine city several days. Its situation is commanding, -and the sea-view is superb. There are charming drives all about, and by -courtesy of friends we had opportunity to enjoy them. From the grassy -crater-summit of Mount Eden one's eye ranges over a grand sweep and -variety of scenery--forests clothed in luxuriant foliage, rolling green -fields, conflagrations of flowers, receding and dimming stretches of -green plain, broken by lofty and symmetrical old craters--then the blue -bays twinkling and sparkling away into the dreamy distances where the -mountains loom spiritual in their veils of haze. - -It is from Auckland that one goes to Rotorua, the region of the renowned -hot lakes and geysers--one of the chief wonders of New Zealand; but I was -not well enough to make the trip. The government has a sanitorium there, -and everything is comfortable for the tourist and the invalid. The -government's official physician is almost over-cautious in his estimates -of the efficacy of the baths, when he is talking about rheumatism, gout, -paralysis, and such things; but when he is talking about the -effectiveness of the waters in eradicating the whisky-habit, he seems to -have no reserves. The baths will cure the drinking-habit no matter how -chronic it is--and cure it so effectually that even the desire to drink -intoxicants will come no more. There should be a rush from Europe and -America to that place; and when the victims of alcoholism find out what -they can get by going there, the rush will begin. - -The Thermal-springs District of New Zealand comprises an area of upwards -of 600,000 acres, or close on 1,000 square miles. Rotorua is the -favorite place. It is the center of a rich field of lake and mountain -scenery; from Rotorua as a base the pleasure-seeker makes excursions. -The crowd of sick people is great, and growing. Rotorua is the Carlsbad -of Australasia. - -It is from Auckland that the Kauri gum is shipped. For a long time now -about 8,000 tons of it have been brought into the town per year. It is -worth about $300 per ton, unassorted; assorted, the finest grades are -worth about $1,000. It goes to America, chiefly. It is in lumps, and is -hard and smooth, and looks like amber--the light-colored like new amber, -and the dark brown like rich old amber. And it has the pleasant feel of -amber, too. Some of the light-colored samples were a tolerably fair -counterfeit of uncut South African diamonds, they were so perfectly -smooth and polished and transparent. It is manufactured into varnish; a -varnish which answers for copal varnish and is cheaper. - -The gum is dug up out of the ground; it has been there for ages. It is -the sap of the Kauri tree. Dr. Campbell of Auckland told me he sent a -cargo of it to England fifty years ago, but nothing came of the venture. -Nobody knew what to do with it; so it was sold at 15 a ton, to light -fires with. - -November 26--3 P.M., sailed. Vast and beautiful harbor. Land all about -for hours. Tangariwa, the mountain that "has the same shape from every -point of view." That is the common belief in Auckland. And so it has ---from every point of view except thirteen. Perfect summer weather. Large -school of whales in the distance. Nothing could be daintier than the -puffs of vapor they spout up, when seen against the pink glory of the -sinking sun, or against the dark mass of an island reposing in the deep -blue shadow of a storm cloud . . . . Great Barrier rock standing up -out of the sea away to the left. Sometime ago a ship hit it full speed -in a fog--20 miles out of her course--140 lives lost; the captain -committed suicide without waiting a moment. He knew that, whether he was -to blame or not, the company owning the vessel would discharge him and -make a devotion--to--passengers' safety advertisement out of it, and his -chance to make a livelihood would be permanently gone. - - - - -CHAPTER XXXIV. - -Let us not be too particular. It is better to have old second-hand -diamonds than none at all. - --Pudd'nhead Wilson's New Calendar. - -November 27. To-day we reached Gisborne, and anchored in a big bay; -there was a heavy sea on, so we remained on board. - -We were a mile from shore; a little steam-tug put out from the land; she -was an object of thrilling interest; she would climb to the summit of a -billow, reel drunkenly there a moment, dim and gray in the driving storm -of spindrift, then make a plunge like a diver and remain out of sight -until one had given her up, then up she would dart again, on a steep -slant toward the sky, shedding Niagaras of water from her forecastle--and -this she kept up, all the way out to us. She brought twenty-five -passengers in her stomach--men and women mainly a traveling dramatic -company. In sight on deck were the crew, in sou'westers, yellow -waterproof canvas suits, and boots to the thigh. The deck was never -quiet for a moment, and seldom nearer level than a ladder, and noble were -the seas which leapt aboard and went flooding aft. We rove a long line -to the yard-arm, hung a most primitive basketchair to it and swung it out -into the spacious air of heaven, and there it swayed, pendulum-fashion, -waiting for its chance--then down it shot, skillfully aimed, and was -grabbed by the two men on the forecastle. A young fellow belonging to -our crew was in the chair, to be a protection to the lady-comers. At -once a couple of ladies appeared from below, took seats in his lap, we -hoisted them into the sky, waited a moment till the roll of the ship -brought them in overhead, then we lowered suddenly away, and seized the -chair as it struck the deck. We took the twenty-five aboard, and -delivered twenty-five into the tug--among them several aged ladies, and -one blind one--and all without accident. It was a fine piece of work. - -Ours is a nice ship, roomy, comfortable, well-ordered, and satisfactory. -Now and then we step on a rat in a hotel, but we have had no rats on -shipboard lately; unless, perhaps in the Flora; we had more serious -things to think of there, and did not notice. I have noticed that it is -only in ships and hotels which still employ the odious Chinese gong, that -you find rats. The reason would seem to be, that as a rat cannot tell -the time of day by a clock, he won't stay where he cannot find out when -dinner is ready. - -November 29. The doctor tells me of several old drunkards, one -spiritless loafer, and several far-gone moral wrecks who have been -reclaimed by the Salvation Army and have remained staunch people and hard -workers these two years. Wherever one goes, these testimonials to the -Army's efficiency are forthcoming . . . . This morning we had one of -those whizzing green Ballarat flies in the room, with his stunning -buzz-saw noise--the swiftest creature in the world except the -lightning-flash. It is a stupendous force that is stored up in that -little body. If we had it in a ship in the same proportion, we could spin -from Liverpool to New York in the space of an hour--the time it takes to -eat luncheon. The New Zealand express train is called the Ballarat Fly -. . . . Bad teeth in the colonies. A citizen told me they don't have -teeth filled, but pull them out and put in false ones, and that now and -then one sees a young lady with a full set. She is fortunate. I wish I -had been born with false teeth and a false liver and false carbuncles. -I should get along better. - -December 2. Monday. Left Napier in the Ballarat Fly the one that goes -twice a week. From Napier to Hastings, twelve miles; time, fifty-five -minutes--not so far short of thirteen miles an hour . . . . A perfect -summer day; cool breeze, brilliant sky, rich vegetation. Two or three -times during the afternoon we saw wonderfully dense and beautiful -forests, tumultuously piled skyward on the broken highlands--not the -customary roof-like slant of a hillside, where the trees are all the same -height. The noblest of these trees were of the Kauri breed, we were told -the timber that is now furnishing the wood-paving for Europe, and is the -best of all wood for that purpose. Sometimes these towering upheavals of -forestry were festooned and garlanded with vine-cables, and sometimes the -masses of undergrowth were cocooned in another sort of vine of a delicate -cobwebby texture--they call it the "supplejack," I think. Tree ferns -everywhere--a stem fifteen feet high, with a graceful chalice of -fern-fronds sprouting from its top--a lovely forest ornament. And there -was a ten-foot reed with a flowing suit of what looked like yellow hair -hanging from its upper end. I do not know its name, but if there is such -a thing as a scalp-plant, this is it. A romantic gorge, with a brook -flowing in its bottom, approaching Palmerston North. - -Waitukurau. Twenty minutes for luncheon. With me sat my wife and -daughter, and my manager, Mr. Carlyle Smythe. I sat at the head of the -table, and could see the right-hand wall; the others had their backs to -it. On that wall, at a good distance away, were a couple of framed -pictures. I could not see them clearly, but from the groupings of the -figures I fancied that they represented the killing of Napoleon III's son -by the Zulus in South Africa. I broke into the conversation, which was -about poetry and cabbage and art, and said to my wife-- - -"Do you remember when the news came to Paris----" - -"Of the killing of the Prince?" - -(Those were the very words I had in my mind.) "Yes, but what Prince?" - -"Napoleon. Lulu." - -"What made you think of that?" - -"I don't know." - -There was no collusion. She had not seen the pictures, and they had not -been mentioned. She ought to have thought of some recent news that came -to Paris, for we were but seven months from there and had been living -there a couple of years when we started on this trip; but instead of that -she thought of an incident of our brief sojourn in Paris of sixteen years -before. - -Here was a clear case of mental telegraphy; of mind-transference; of my -mind telegraphing a thought into hers. How do I know? Because I -telegraphed an error. For it turned out that the pictures did not -represent the killing of Lulu at all, nor anything connected with Lulu. -She had to get the error from my head--it existed nowhere else. - - - - -CHAPTER XXXV. - -The Autocrat of Russia possesses more power than any other man in the -earth; but he cannot stop a sneeze. - --Pudd'nhead Wilson's New Calendar. - -WAUGANIUI, December 3. A pleasant trip, yesterday, per Ballarat Fly. -Four hours. I do not know the distance, but it must have been well along -toward fifty miles. The Fly could have spun it out to eight hours and -not discommoded me; for where there is comfort, and no need for hurry, -speed is of no value--at least to me; and nothing that goes on wheels can -be more comfortable, more satisfactory, than the New Zealand trains. -Outside of America there are no cars that are so rationally devised. -When you add the constant presence of charming scenery and the nearly -constant absence of dust--well, if one is not content then, he ought to -get out and walk. That would change his spirit, perhaps? I think so. -At the end of an hour you would find him waiting humbly beside the track, -and glad to be taken aboard again. - -Much horseback riding, in and around this town; many comely girls in cool -and pretty summer gowns; much Salvation Army; lots of Maoris; the faces -and bodies of some of the old ones very tastefully frescoed. Maori -Council House over the river-large, strong, carpeted from end to end with -matting, and decorated with elaborate wood carvings, artistically -executed. The Maoris were very polite. - -I was assured by a member of the House of Representatives that the native -race is not decreasing, but actually increasing slightly. It is another -evidence that they are a superior breed of savages. I do not call to -mind any savage race that built such good houses, or such strong and -ingenious and scientific fortresses, or gave so much attention to -agriculture, or had military arts and devices which so nearly approached -the white man's. These, taken together with their high abilities in -boat-building, and their tastes and capacities in the ornamental arts -modify their savagery to a semi-civilization--or at least to, -a quarter-civilization. - -It is a compliment to them that the British did not exterminate them, as -they did the Australians and the Tasmanians, but were content with -subduing them, and showed no desire to go further. And it is another -compliment to them that the British did not take the whole of their -choicest lands, but left them a considerable part, and then went further -and protected them from the rapacities of landsharks--a protection which -the New Zealand Government still extends to them. And it is still -another compliment to the Maoris that the Government allows native -representation--in both the legislature and the cabinet, and gives both -sexes the vote. And in doing these things the Government also -compliments itself; it has not been the custom of the world for -conquerors to act in this large spirit toward the conquered. - -The highest class white men Who lived among the Maoris in the earliest -time had a high opinion of them and a strong affection for them. Among -the whites of this sort was the author of "Old New Zealand;" and Dr. -Campbell of Auckland was another. Dr. Campbell was a close friend of -several chiefs, and has many pleasant things to say of their fidelity, -their magnanimity, and their generosity. Also of their quaint notions -about the white man's queer civilization, and their equally quaint -comments upon it. One of them thought the missionary had got everything -wrong end first and upside down. "Why, he wants us to stop worshiping -and supplicating the evil gods, and go to worshiping and supplicating the -Good One! There is no sense in that. A good god is not going to do us -any harm." - -The Maoris had the tabu; and had it on a Polynesian scale of -comprehensiveness and elaboration. Some of its features could have been -importations from India and Judea. Neither the Maori nor the Hindoo of -common degree could cook by a fire that a person of higher caste had -used, nor could the high Maori or high Hindoo employ fire that had served -a man of low grade; if a low-grade Maori or Hindoo drank from a vessel -belonging to a high-grade man, the vessel was defiled, and had to be -destroyed. There were other resemblances between Maori tabu and Hindoo -caste-custom. - -Yesterday a lunatic burst into my quarters and warned me that the Jesuits -were going to "cook" (poison) me in my food, or kill me on the stage at -night. He said a mysterious sign was visible upon my posters and meant -my death. He said he saved Rev. Mr. Haweis's life by warning him that -there were three men on his platform who would kill him if he took his -eyes off them for a moment during his lecture. The same men were in my -audience last night, but they saw that he was there. "Will they be there -again to-night?" He hesitated; then said no, he thought they would -rather take a rest and chance the poison. This lunatic has no delicacy. -But he was not uninteresting. He told me a lot of things. He said he -had "saved so many lecturers in twenty years, that they put him in the -asylum." I think he has less refinement than any lunatic I have met. - -December 8. A couple of curious war-monuments here at Wanganui. One is -in honor of white men "who fell in defence of law and order against -fanaticism and barbarism." Fanaticism. We Americans are English in -blood, English in speech, English in religion, English in the essentials -of our governmental system, English in the essentials of our -civilization; and so, let us hope, for the honor of the blend, for the -honor of the blood, for the honor of the race, that that word got there -through lack of heedfulness, and will not be suffered to remain. If you -carve it at Thermopylae, or where Winkelried died, or upon Bunker Hill -monument, and read it again "who fell in defence of law and order against -fanaticism" you will perceive what the word means, and how mischosen it -is. Patriotism is Patriotism. Calling it Fanaticism cannot degrade it; -nothing can degrade it. Even though it be a political mistake, and a -thousand times a political mistake, that does not affect it; it is -honorable always honorable, always noble--and privileged to hold its head -up and look the nations in the face. It is right to praise these brave -white men who fell in the Maori war--they deserve it; but the presence of -that word detracts from the dignity of their cause and their deeds, and -makes them appear to have spilt their blood in a conflict with ignoble -men, men not worthy of that costly sacrifice. But the men were worthy. -It was no shame to fight them. They fought for their homes, they fought -for their country; they bravely fought and bravely fell; and it would -take nothing from the honor of the brave Englishmen who lie under the -monument, but add to it, to say that they died in defense of English laws -and English homes against men worthy of the sacrifice--the Maori -patriots. - -The other monument cannot be rectified. Except with dynamite. It is a -mistake all through, and a strangely thoughtless one. It is a monument -erected by white men to Maoris who fell fighting with the whites and -against their own people, in the Maori war. "Sacred to the memory of the -brave men who fell on the 14th of May, 1864," etc. On one side are the -names of about twenty Maoris. It is not a fancy of mine; the monument -exists. I saw it. It is an object-lesson to the rising generation. It -invites to treachery, disloyalty, unpatriotism. Its lesson, in frank -terms is, "Desert your flag, slay your people, burn their homes, shame -your nationality--we honor such." - -December 9. Wellington. Ten hours from Wanganui by the Fly. -December 12. It is a fine city and nobly situated. A busy place, and -full of life and movement. Have spent the three days partly in walking -about, partly in enjoying social privileges, and largely in idling around -the magnificent garden at Hutt, a little distance away, around the shore. -I suppose we shall not see such another one soon. - -We are packing to-night for the return-voyage to Australia. Our stay in -New Zealand has been too brief; still, we are not unthankful for the -glimpse which we have had of it. - -The sturdy Maoris made the settlement of the country by the whites rather -difficult. Not at first--but later. At first they welcomed the whites, -and were eager to trade with them--particularly for muskets; for their -pastime was internecine war, and they greatly preferred the white man's -weapons to their own. War was their pastime--I use the word advisedly. -They often met and slaughtered each other just for a lark, and when there -was no quarrel. The author of "Old New Zealand" mentions a case where a -victorious army could have followed up its advantage and exterminated the -opposing army, but declined to do it; explaining naively that "if we did -that, there couldn't be any more fighting." In another battle one army -sent word that it was out of ammunition, and would be obliged to stop -unless the opposing army would send some. It was sent, and the fight -went on. - -In the early days things went well enough. The natives sold land without -clearly understanding the terms of exchange, and the whites bought it -without being much disturbed about the native's confusion of mind. But -by and by the Maori began to comprehend that he was being wronged; then -there was trouble, for he was not the man to swallow a wrong and go aside -and cry about it. He had the Tasmanian's spirit and endurance, and a -notable share of military science besides; and so he rose against the -oppressor, did this gallant "fanatic," and started a war that was not -brought to a definite end until more than a generation had sped. - - - - -CHAPTER XXXVI. - -There are several good protections against temptations, but the surest is -cowardice. - --Pudd'nhead Wilson's New Calendar. - -Names are not always what they seem. The common Welsh name Bzjxxllwep is -pronounced Jackson. - --Pudd'nhead Wilson's New Calendar. - -Friday, December 13. Sailed, at 3 p.m., in the 'Mararoa'. Summer seas -and a good ship-life has nothing better. - -Monday. Three days of paradise. Warm and sunny and smooth; the sea a -luminous Mediterranean blue . . . . One lolls in a long chair all day -under deck-awnings, and reads and smokes, in measureless content. One -does not read prose at such a time, but poetry. I have been reading the -poems of Mrs. Julia A. Moore, again, and I find in them the same grace -and melody that attracted me when they were first published, twenty years -ago, and have held me in happy bonds ever since. - -"The Sentimental Song Book" has long been out of print, and has been -forgotten by the world in general, but not by me. I carry it with me -always--it and Goldsmith's deathless story. - -Indeed, it has the same deep charm for me that the Vicar of Wakefield -has, and I find in it the same subtle touch--the touch that makes an -intentionally humorous episode pathetic and an intentionally pathetic one -funny. In her time Mrs. Moore was called "the Sweet Singer of Michigan," -and was best known by that name. I have read her book through twice -today, with the purpose of determining which of her pieces has most -merit, and I am persuaded that for wide grasp and sustained power, -"William Upson" may claim first place: - -WILLIAM UPSON. - -Air--"The Major's Only Son." -Come all good people far and near, -Oh, come and see what you can hear, -It's of a young man true and brave, -That is now sleeping in his grave. - -Now, William Upson was his name -If it's not that, it's all the same -He did enlist in a cruel strife, -And it caused him to lose his life. - -He was Perry Upson's eldest son, -His father loved his noble son, -This son was nineteen years of age -When first in the rebellion he engaged. - -His father said that he might go, -But his dear mother she said no, -"Oh! stay at home, dear Billy," she said, -But she could not turn his head. - -He went to Nashville, in Tennessee, -There his kind friends he could not see; -He died among strangers, so far away, -They did not know where his body lay. - -He was taken sick and lived four weeks, -And Oh! how his parents weep, -But now they must in sorrow mourn, -For Billy has gone to his heavenly home. - -Oh! if his mother could have seen her son, -For she loved him, her darling son; -If she could heard his dying prayer, -It would ease her heart till she met him there. - -How it would relieve his mother's heart -To see her son from this world depart, -And hear his noble words of love, -As he left this world for that above. - -Now it will relieve his mother's heart, -For her son is laid in our graveyard; -For now she knows that his grave is near, -She will not shed so many tears. - -Although she knows not that it was her son, -For his coffin could not be opened -It might be someone in his place, -For she could not see his noble face. - - -December, 17. Reached Sydney. - -December, 19. In the train. Fellow of 30 with four valises; a slim -creature, with teeth which made his mouth look like a neglected -churchyard. He had solidified hair--solidified with pomatum; it was all -one shell. He smoked the most extraordinary cigarettes--made of some -kind of manure, apparently. These and his hair made him smell like the -very nation. He had a low-cut vest on, which exposed a deal of frayed -and broken and unclean shirtfront. Showy studs, of imitation gold--they -had made black disks on the linen. Oversized sleeve buttons of imitation -gold, the copper base showing through. Ponderous watch-chain of -imitation gold. I judge that he couldn't tell the time by it, for he -asked Smythe what time it was, once. He wore a coat which had been gay -when it was young; 5-o'clock-tea-trousers of a light tint, and -marvelously soiled; yellow mustache with a dashing upward whirl at the -ends; foxy shoes, imitation patent leather. He was a novelty--an -imitation dude. He would have been a real one if he could have afforded -it. But he was satisfied with himself. You could see it in his -expression, and in all his attitudes and movements. He was living in a -dude dreamland where all his squalid shams were genuine, and himself a -sincerity. It disarmed criticism, it mollified spite, to see him so -enjoy his imitation languors, and arts, and airs, and his studied -daintinesses of gesture and misbegotten refinements. It was plain to me -that he was imagining himself the Prince of Wales, and was doing -everything the way he thought the Prince would do it. For bringing his -four valises aboard and stowing them in the nettings, he gave his porter -four cents, and lightly apologized for the smallness of the gratuity ---just with the condescendingest little royal air in the world. He -stretched himself out on the front seat and rested his pomatum-cake on -the middle arm, and stuck his feet out of the window, and began to pose -as the Prince and work his dreams and languors for exhibition; and he -would indolently watch the blue films curling up from his cigarette, and -inhale the stench, and look so grateful; and would flip the ash away with -the daintiest gesture, unintentionally displaying his brass ring in the -most intentional way; why, it was as good as being in Marlborough House -itself to see him do it so like. - -There was other scenery in the trip. That of the Hawksbury river, in the -National Park region, fine--extraordinarily fine, with spacious views of -stream and lake imposingly framed in woody hills; and every now and then -the noblest groupings of mountains, and the most enchanting -rearrangements of the water effects. Further along, green flats, thinly -covered with gum forests, with here and there the huts and cabins of -small farmers engaged in raising children. Still further along, arid -stretches, lifeless and melancholy. Then Newcastle, a rushing town, -capital of the rich coal regions. Approaching Scone, wide farming and -grazing levels, with pretty frequent glimpses of a troublesome plant--a -particularly devilish little prickly pear, daily damned in the orisons of -the agriculturist; imported by a lady of sentiment, and contributed -gratis to the colony. Blazing hot, all day. - -December 20. Back to Sydney. Blazing hot again. From the newspaper, -and from the map, I have made a collection of curious names of -Australasian towns, with the idea of making a poem out of them: - -Tumut -Takee -Murriwillumba -Bowral -Ballarat -Mullengudgery -Murrurundi -Wagga-Wagga -Wyalong -Murrumbidgee -Goomeroo -Wolloway -Wangary -Wanilla -Worrow -Koppio -Yankalilla -Yaranyacka -Yackamoorundie -Kaiwaka -Coomooroo -Tauranga -Geelong -Tongariro -Kaikoura -Wakatipu -Oohipara -Waitpinga -Goelwa -Munno Para -Nangkita -Myponga -Kapunda -Kooringa -Penola -Nangwarry -Kongorong -Comaum -Koolywurtie -Killanoola -Naracoorte -Muloowurtie -Binnum -Wallaroo -Wirrega -Mundoora -Hauraki -Rangiriri -Teawamute -Taranaki -Toowoomba -Goondiwindi -Jerrilderie -Whangaroa -Wollongong -Woolloomooloo -Bombola -Coolgardie -Bendigo -Coonamble -Cootamundra -Woolgoolga - -Mittagong -Jamberoo -Kondoparinga -Kuitpo -Tungkillo -Oukaparinga -Talunga -Yatala -Parawirra -Moorooroo -Whangarei -Woolundunga -Booleroo -Pernatty -Parramatta -Taroom -Narrandera -Deniliquin -Kawakawa. - - -It may be best to build the poem now, and make the weather help - - A SWELTERING DAY IN AUSTRALIA. - - (To be read soft and low, with the lights turned down.) - - The Bombola faints in the hot Bowral tree, - Where fierce Mullengudgery's smothering fires - Far from the breezes of Coolgardie - Burn ghastly and blue as the day expires; - - And Murriwillumba complaineth in song - For the garlanded bowers of Woolloomooloo, - And the Ballarat Fly and the lone Wollongong - They dream of the gardens of Jamberoo; - - The wallabi sighs for the Murrubidgee, - For the velvety sod of the Munno Parah, - Where the waters of healing from Muloowurtie - Flow dim in the gloaming by Yaranyackah; - - The Koppio sorrows for lost Wolloway, - And sigheth in secret for Murrurundi, - The Whangeroo wombat lamenteth the day - That made him an exile from Jerrilderie; - - The Teawamute Tumut from Wirrega's glade, - The Nangkita swallow, the Wallaroo swan, - They long for the peace of the Timaru shade - And thy balmy soft airs, O sweet Mittagong! - - The Kooringa buffalo pants in the sun, - The Kondoparinga lies gaping for breath, - The Kongorong Camaum to the shadow has won, - But the Goomeroo sinks in the slumber of death; - - In the weltering hell of the Moorooroo plain - The Yatala Wangary withers and dies, - And the Worrow Wanilla, demented with pain, - To the Woolgoolga woodlands despairingly flies; - - Sweet Nangwarry's desolate, Coonamble wails, - And Tungkillo Kuito in sables is drest, - For the Whangerei winds fall asleep in the sails - And the Booleroo life-breeze is dead in the west. - - Mypongo, Kapunda, O slumber no more - Yankalilla, Parawirra, be warned - There's death in the air! - Killanoola, wherefore - Shall the prayer of Penola be scorned? - - Cootamundra, and Takee, and Wakatipu, - Toowoomba, Kaikoura are lost - From Onkaparinga to far Oamaru - All burn in this hell's holocaust! - - Paramatta and Binnum are gone to their rest - In the vale of Tapanni Taroom, - Kawakawa, Deniliquin--all that was best - In the earth are but graves and a tomb! - - Narrandera mourns, Cameron answers not - When the roll of the scathless we cry - Tongariro, Goondiwindi, Woolundunga, the spot - Is mute and forlorn where ye lie. - -Those are good words for poetry. Among the best I have ever seen. -There are 81 in the list. I did not need them all, but I have knocked -down 66 of them; which is a good bag, it seems to me, for a person not in -the business. Perhaps a poet laureate could do better, but a poet -laureate gets wages, and that is different. When I write poetry I do not -get any wages; often I lose money by it. The best word in that list, and -the most musical and gurgly, is Woolloomoolloo. It is a place near -Sydney, and is a favorite pleasure-resort. It has eight O's in it. - - - - -CHAPTER XXXVII. - -To succeed in the other trades, capacity must be shown; in the law, -concealment of it will do. - --Pudd'nhead Wilson's New Calendar. - -MONDAY,--December 23, 1895. Sailed from Sydney for Ceylon in the P. & O. -steamer 'Oceana'. A Lascar crew mans this ship--the first I have seen. -White cotton petticoat and pants; barefoot; red shawl for belt; straw -cap, brimless, on head, with red scarf wound around it; complexion a rich -dark brown; short straight black hair; whiskers fine and silky; lustrous -and intensely black. Mild, good faces; willing and obedient people; -capable, too; but are said to go into hopeless panics when there is -danger. They are from Bombay and the coast thereabouts. Left some of -the trunks in Sydney, to be shipped to South Africa by a vessel -advertised to sail three months hence. The proverb says: "Separate not -yourself from your baggage." - -This 'Oceana' is a stately big ship, luxuriously appointed. She has -spacious promenade decks. Large rooms; a surpassingly comfortable ship. -The officers' library is well selected; a ship's library is not usually -that . . . . For meals, the bugle call, man-of-war fashion; a -pleasant change from the terrible gong . . . . Three big cats--very -friendly loafers; they wander all over the ship; the white one follows -the chief steward around like a dog. There is also a basket of kittens. -One of these cats goes ashore, in port, in England, Australia, and India, -to see how his various families are getting along, and is seen no more -till the ship is ready to sail. No one knows how he finds out the -sailing date, but no doubt he comes down to the dock every day and takes -a look, and when he sees baggage and passengers flocking in, recognizes -that it is time to get aboard. This is what the sailors believe. The -Chief Engineer has been in the China and India trade thirty three years, -and has had but three Christmases at home in that time . . . . -Conversational items at dinner, "Mocha! sold all over the world! It is -not true. In fact, very few foreigners except the Emperor of Russia have -ever seen a grain of it, or ever will, while they live." Another man -said: "There is no sale in Australia for Australian wine. But it goes to -France and comes back with a French label on it, and then they buy it." -I have heard that the most of the French-labeled claret in New York is -made in California. And I remember what Professor S. told me once about -Veuve Cliquot--if that was the wine, and I think it was. He was the -guest of a great wine merchant whose town was quite near that vineyard, -and this merchant asked him if very much V. C. was drunk in America. - -"Oh, yes," said S., "a great abundance of it." - -"Is it easy to be had?" - -"Oh, yes--easy as water. All first and second-class hotels have it." - -"What do you pay for it?" - -"It depends on the style of the hotel--from fifteen to twenty-five francs -a bottle." - -"Oh, fortunate country! Why, it's worth 100 francs right here on the -ground." - -"No!" - -"Yes!" - -"Do you mean that we are drinking a bogus Veuve-Cliquot over there?" - -"Yes--and there was never a bottle of the genuine in America since -Columbus's time. That wine all comes from a little bit of a patch of -ground which isn't big enough to raise many bottles; and all of it that -is produced goes every year to one person--the Emperor of Russia. He -takes the whole crop in advance, be it big or little." - -January 4, 1898. Christmas in Melbourne, New Year's Day in Adelaide, -and saw most of the friends again in both places . . . . Lying here -at anchor all day--Albany (King George's Sound), Western Australia. It -is a perfectly landlocked harbor, or roadstead--spacious to look at, but -not deep water. Desolate-looking rocks and scarred hills. Plenty of -ships arriving now, rushing to the new gold-fields. The papers are full -of wonderful tales of the sort always to be heard in connection with new -gold diggings. A sample: a youth staked out a claim and tried to sell -half for L5; no takers; he stuck to it fourteen days, starving, then -struck it rich and sold out for L10,000. . . About sunset, strong -breeze blowing, got up the anchor. We were in a small deep puddle, with -a narrow channel leading out of it, minutely buoyed, to the sea. - -I stayed on deck to see how we were going to manage it with such a big -ship and such a strong wind. On the bridge our giant captain, in -uniform; at his side a little pilot in elaborately gold-laced uniform; on -the forecastle a white mate and quartermaster or two, and a brilliant -crowd of lascars standing by for business. Our stern was pointing -straight at the head of the channel; so we must turn entirely around in -the puddle--and the wind blowing as described. It was done, and -beautifully. It was done by help of a jib. We stirred up much mud, but -did not touch the bottom. We turned right around in our tracks--a -seeming impossibility. We had several casts of quarter-less 5, and one -cast of half 4--27 feet; we were drawing 26 astern. By the time we were -entirely around and pointed, the first buoy was not more than a hundred -yards in front of us. It was a fine piece of work, and I was the only -passenger that saw it. However, the others got their dinner; the P. & O. -Company got mine . . . . More cats developed. Smythe says it is a -British law that they must be carried; and he instanced a case of a ship -not allowed to sail till she sent for a couple. The bill came, too: -"Debtor, to 2 cats, 20 shillings." . . . News comes that within this -week Siam has acknowledged herself to be, in effect, a French province. -It seems plain that all savage and semi-civilized countries are going to -be grabbed . . . . A vulture on board; bald, red, queer-shaped head, -featherless red places here and there on his body, intense great black -eyes set in featherless rims of inflamed flesh; dissipated look; a -businesslike style, a selfish, conscienceless, murderous aspect--the very -look of a professional assassin, and yet a bird which does no murder. -What was the use of getting him up in that tragic style for so innocent a -trade as his? For this one isn't the sort that wars upon the living, his -diet is offal--and the more out of date it is the better he likes it. -Nature should give him a suit of rusty black; then he would be all right, -for he would look like an undertaker and would harmonize with his -business; whereas the way he is now he is horribly out of true. - -January 5. At 9 this morning we passed Cape Leeuwin (lioness) and -ceased from our long due-west course along the southern shore of -Australia. Turning this extreme southwestern corner, we now take a long -straight slant nearly N. W., without a break, for Ceylon. As we speed -northward it will grow hotter very fast--but it isn't chilly, now. . . . -The vulture is from the public menagerie at Adelaide--a great and -interesting collection. It was there that we saw the baby tiger solemnly -spreading its mouth and trying to roar like its majestic mother. It -swaggered, scowling, back and forth on its short legs just as it had seen -her do on her long ones, and now and then snarling viciously, exposing -its teeth, with a threatening lift of its upper lip and bristling -moustache; and when it thought it was impressing the visitors, it would -spread its mouth wide and do that screechy cry which it meant for a roar, -but which did not deceive. It took itself quite seriously, and was -lovably comical. And there was a hyena--an ugly creature; as ugly as the -tiger-kitty was pretty. It repeatedly arched its back and delivered -itself of such a human cry; a startling resemblance; a cry which was just -that of a grown person badly hurt. In the dark one would assuredly go to -its assistance--and be disappointed . . . . Many friends of -Australasian Federation on board. They feel sure that the good day is -not far off, now. But there seems to be a party that would go further ---have Australasia cut loose from the British Empire and set up -housekeeping on her own hook. It seems an unwise idea. They point to -the United States, but it seems to me that the cases lack a good deal of -being alike. Australasia governs herself wholly--there is no -interference; and her commerce and manufactures are not oppressed in any -way. If our case had been the same we should not have gone out when we -did. - - -January 13. Unspeakably hot. The equator is arriving again. We are -within eight degrees of it. Ceylon present. Dear me, it is beautiful! -And most sumptuously tropical, as to character of foliage and opulence of -it. "What though the spicy breezes blow soft o'er Ceylon's isle"--an -eloquent line, an incomparable line; it says little, but conveys whole -libraries of sentiment, and Oriental charm and mystery, and tropic -deliciousness--a line that quivers and tingles with a thousand -unexpressed and inexpressible things, things that haunt one and find no -articulate voice . . . . Colombo, the capital. An Oriental town, -most manifestly; and fascinating. - -In this palatial ship the passengers dress for dinner. The ladies' -toilettes make a fine display of color, and this is in keeping with the -elegance of the vessel's furnishings and the flooding brilliancies of the -electric light. On the stormy Atlantic one never sees a man in evening -dress, except at the rarest intervals; and then there is only one, not -two; and he shows up but once on the voyage--the night before the ship -makes port--the night when they have the "concert" and do the amateur -wailings and recitations. He is the tenor, as a rule . . . . There -has been a deal of cricket-playing on board; it seems a queer game for a -ship, but they enclose the promenade deck with nettings and keep the ball -from flying overboard, and the sport goes very well, and is properly -violent and exciting . . . . We must part from this vessel here. - -January 14. Hotel Bristol. Servant Brompy. Alert, gentle, smiling, -winning young brown creature as ever was. Beautiful shining black hair -combed back like a woman's, and knotted at the back of his head ---tortoise-shell comb in it, sign that he is a Singhalese; slender, shapely -form; jacket; under it is a beltless and flowing white cotton gown--from -neck straight to heel; he and his outfit quite unmasculine. It was an -embarrassment to undress before him. - -We drove to the market, using the Japanese jinriksha--our first -acquaintanceship with it. It is a light cart, with a native to draw it. -He makes good speed for half-an-hour, but it is hard work for him; he is -too slight for it. After the half-hour there is no more pleasure for -you; your attention is all on the man, just as it would be on a tired -horse, and necessarily your sympathy is there too. There's a plenty of -these 'rickshas, and the tariff is incredibly cheap. - -I was in Cairo years ago. That was Oriental, but there was a lack. When -you are in Florida or New Orleans you are in the South--that is granted; -but you are not in the South; you are in a modified South, a tempered -South. Cairo was a tempered Orient--an Orient with an indefinite -something wanting. That feeling was not present in Ceylon. Ceylon was -Oriental in the last measure of completeness--utterly Oriental; also -utterly tropical; and indeed to one's unreasoning spiritual sense the two -things belong together. All the requisites were present. The costumes -were right; the black and brown exposures, unconscious of immodesty, were -right; the juggler was there, with his basket, his snakes, his mongoose, -and his arrangements for growing a tree from seed to foliage and ripe -fruitage before one's eyes; in sight were plants and flowers familiar to -one on books but in no other way celebrated, desirable, strange, but in -production restricted to the hot belt of the equator; and out a little -way in the country were the proper deadly snakes, and fierce beasts of -prey, and the wild elephant and the monkey. And there was that swoon in -the air which one associates with the tropics, and that smother of heat, -heavy with odors of unknown flowers, and that sudden invasion of purple -gloom fissured with lightnings,--then the tumult of crashing thunder and -the downpour and presently all sunny and smiling again; all these things -were there; the conditions were complete, nothing was lacking. And away -off in the deeps of the jungle and in the remotenesses of the mountains -were the ruined cities and mouldering temples, mysterious relics of the -pomps of a forgotten time and a vanished race--and this was as it should -be, also, for nothing is quite satisfyingly Oriental that lacks the -somber and impressive qualities of mystery and antiquity. - -The drive through the town and out to the Galle Face by the seashore, -what a dream it was of tropical splendors of bloom and blossom, and -Oriental conflagrations of costume! The walking groups of men, women, -boys, girls, babies--each individual was a flame, each group a house -afire for color. And such stunning colors, such intensely vivid colors, -such rich and exquisite minglings and fusings of rainbows and lightnings! -And all harmonious, all in perfect taste; never a discordant note; never -a color on any person swearing at another color on him or failing to -harmonize faultlessly with the colors of any group the wearer might join. -The stuffs were silk-thin, soft, delicate, clinging; and, as a rule, each -piece a solid color: a splendid green, a splendid blue, a splendid -yellow, a splendid purple, a splendid ruby, deep, and rich with -smouldering fires they swept continuously by in crowds and legions and -multitudes, glowing, flashing, burning, radiant; and every five seconds -came a burst of blinding red that made a body catch his breath, and -filled his heart with joy. And then, the unimaginable grace of those -costumes! Sometimes a woman's whole dress was but a scarf wound about -her person and her head, sometimes a man's was but a turban and a -careless rag or two--in both cases generous areas of polished dark skin -showing--but always the arrangement compelled the homage of the eye and -made the heart sing for gladness. - -I can see it to this day, that radiant panorama, that wilderness of rich -color, that incomparable dissolving-view of harmonious tints, and lithe -half-covered forms, and beautiful brown faces, and gracious and graceful -gestures and attitudes and movements, free, unstudied, barren of -stiffness and restraint, and-- - -Just then, into this dream of fairyland and paradise a grating dissonance -was injected. - -Out of a missionary school came marching, two and two, sixteen prim and -pious little Christian black girls, Europeanly clothed--dressed, to the -last detail, as they would have been dressed on a summer Sunday in an -English or American village. Those clothes--oh, they were unspeakably -ugly! Ugly, barbarous, destitute of taste, destitute of grace, repulsive -as a shroud. I looked at my womenfolk's clothes--just full-grown -duplicates of the outrages disguising those poor little abused creatures ---and was ashamed to be seen in the street with them. Then I looked at -my own clothes, and was ashamed to be seen in the street with myself. - -However, we must put up with our clothes as they are--they have their -reason for existing. They are on us to expose us--to advertise what we -wear them to conceal. They are a sign; a sign of insincerity; a sign of -suppressed vanity; a pretense that we despise gorgeous colors and the -graces of harmony and form; and we put them on to propagate that lie and -back it up. But we do not deceive our neighbor; and when we step into -Ceylon we realize that we have not even deceived ourselves. We do love -brilliant colors and graceful costumes; and at home we will turn out in a -storm to see them when the procession goes by--and envy the wearers. We -go to the theater to look at them and grieve that we can't be clothed -like that. We go to the King's ball, when we get a chance, and are glad -of a sight of the splendid uniforms and the glittering orders. When we -are granted permission to attend an imperial drawing-room we shut -ourselves up in private and parade around in the theatrical court-dress -by the hour, and admire ourselves in the glass, and are utterly happy; -and every member of every governor's staff in democratic America does the -same with his grand new uniform--and if he is not watched he will get -himself photographed in it, too. When I see the Lord Mayor's footman I -am dissatisfied with my lot. Yes, our clothes are a lie, and have been -nothing short of that these hundred years. They are insincere, they are -the ugly and appropriate outward exposure of an inward sham and a moral -decay. - -The last little brown boy I chanced to notice in the crowds and swarms of -Colombo had nothing on but a twine string around his waist, but in my -memory the frank honesty of his costume still stands out in pleasant -contrast with the odious flummery in which the little Sunday-school -dowdies were masquerading. - - - - -CHAPTER XXXVIII. - -Prosperity is the best protector of principle. - --Pudd'nhead Wilson's New Calendar. - -EVENING--11th. Sailed in the Rosetta. This is a poor old ship, and -ought to be insured and sunk. As in the 'Oceana', just so here: -everybody dresses for dinner; they make it a sort of pious duty. These -fine and formal costumes are a rather conspicuous contrast to the poverty -and shabbiness of the surroundings . . . . If you want a slice of a -lime at four o'clock tea, you must sign an order on the bar. Limes cost -14 cents a barrel. - -January 18th. We have been running up the Arabian Sea, latterly. -Closing up on Bombay now, and due to arrive this evening. - -January 20th. Bombay! A bewitching place, a bewildering place, an -enchanting place--the Arabian Nights come again? It is a vast city; -contains about a million inhabitants. Natives, they are, with a slight -sprinkling of white people--not enough to have the slightest modifying -effect upon the massed dark complexion of the public. It is winter here, -yet the weather is the divine weather of June, and the foliage is the -fresh and heavenly foliage of June. There is a rank of noble great shade -trees across the way from the hotel, and under them sit groups of -picturesque natives of both sexes; and the juggler in his turban is there -with his snakes and his magic; and all day long the cabs and the -multitudinous varieties of costumes flock by. It does not seem as if one -could ever get tired of watching this moving show, this shining and -shifting spectacle . . . . In the great bazar the pack and jam of -natives was marvelous, the sea of rich-colored turbans and draperies an -inspiring sight, and the quaint and showy Indian architecture was just -the right setting for it. Toward sunset another show; this is the drive -around the sea-shore to Malabar Point, where Lord Sandhurst, the Governor -of the Bombay Presidency, lives. Parsee palaces all along the first part -of the drive; and past them all the world is driving; the private -carriages of wealthy Englishmen and natives of rank are manned by a -driver and three footmen in stunning oriental liveries--two of these -turbaned statues standing up behind, as fine as monuments. Sometimes -even the public carriages have this superabundant crew, slightly -modified--one to drive, one to sit by and see it done, and one to stand -up behind and yell--yell when there is anybody in the way, and for -practice when there isn't. It all helps to keep up the liveliness and -augment the general sense of swiftness and energy and confusion and -pow-wow. - -In the region of Scandal Point--felicitous name--where there are handy -rocks to sit on and a noble view of the sea on the one hand, and on the -other the passing and reprising whirl and tumult of gay carriages, are -great groups of comfortably-off Parsee women--perfect flower-beds of -brilliant color, a fascinating spectacle. Tramp, tramp, tramping along -the road, in singles, couples, groups, and gangs, you have the -working-man and the working-woman--but not clothed like ours. Usually -the man is a nobly-built great athlete, with not a rag on but his -loin-handkerchief; his color a deep dark brown, his skin satin, his -rounded muscles knobbing it as if it had eggs under it. Usually the -woman is a slender and shapely creature, as erect as a lightning-rod, and -she has but one thing on--a bright-colored piece of stuff which is wound -about her head and her body down nearly half-way to her knees, and which -clings like her own skin. Her legs and feet are bare, and so are her -arms, except for her fanciful bunches of loose silver rings on her ankles -and on her arms. She has jewelry bunched on the side of her nose also, -and showy clusterings on her toes. When she undresses for bed she takes -off her jewelry, I suppose. If she took off anything more she would -catch cold. As a rule she has a large shiney brass water jar of graceful -shape on her head, and one of her naked arms curves up and the hand holds -it there. She is so straight, so erect, and she steps with such style, -and such easy grace and dignity; and her curved arm and her brazen jar -are such a help to the picture indeed, our working-women cannot begin -with her as a road-decoration. - -It is all color, bewitching color, enchanting color--everywhere all -around--all the way around the curving great opaline bay clear to -Government House, where the turbaned big native 'chuprassies' stand -grouped in state at the door in their robes of fiery red, and do most -properly and stunningly finish up the splendid show and make it -theatrically complete. I wish I were a 'chuprassy'. - -This is indeed India! the land of dreams and romance, of fabulous wealth -and fabulous poverty, of splendor and rags, of palaces and hovels, of -famine and pestilence, of genii and giants and Aladdin lamps, of tigers -and elephants, the cobra and the jungle, the country of a hundred nations -and a hundred tongues, of a thousand religions and two million gods, -cradle of the human race, birthplace of human speech, mother of history, -grandmother of legend, great-grandmother of tradition, whose yesterdays -bear date with the mouldering antiquities of the rest of the nations--the -one sole country under the sun that is endowed with an imperishable -interest for alien prince and alien peasant, for lettered and ignorant, -wise and fool, rich and poor, bond and free, the one land that all men -desire to see, and having seen once, by even a glimpse, would not give -that glimpse for the shows of all the rest of the globe combined. -Even now, after the lapse of a year, the delirium of those days in Bombay -has not left me, and I hope never will. It was all new, no detail of it -hackneyed. And India did not wait for morning, it began at the hotel ---straight away. The lobbies and halls were full of turbaned, and fez'd -and embroidered, cap'd, and barefooted, and cotton-clad dark natives, -some of them rushing about, others at rest squatting, or sitting on the -ground; some of them chattering with energy, others still and dreamy; in -the dining-room every man's own private native servant standing behind -his chair, and dressed for a part in the Arabian Nights. - -Our rooms were high up, on the front. A white man--he was a burly German ---went up with us, and brought three natives along to see to arranging -things. About fourteen others followed in procession, with the -hand-baggage; each carried an article--and only one; a bag, in some -cases, in other cases less. One strong native carried my overcoat, -another a parasol, another a box of cigars, another a novel, and the last -man in the procession had no load but a fan. It was all done with -earnestness and sincerity, there was not a smile in the procession from -the head of it to the tail of it. Each man waited patiently, tranquilly, -in no sort of hurry, till one of us found time to give him a copper, then -he bent his head reverently, touched his forehead with his fingers, and -went his way. They seemed a soft and gentle race, and there was -something both winning and touching about their demeanor. - -There was a vast glazed door which opened upon the balcony. It needed -closing, or cleaning, or something, and a native got down on his knees -and went to work at it. He seemed to be doing it well enough, but -perhaps he wasn't, for the burly German put on a look that betrayed -dissatisfaction, then without explaining what was wrong, gave the native -a brisk cuff on the jaw and then told him where the defect was. It -seemed such a shame to do that before us all. The native took it with -meekness, saying nothing, and not showing in his face or manner any -resentment. I had not seen the like of this for fifty years. It carried -me back to my boyhood, and flashed upon me the forgotten fact that this -was the usual way of explaining one's desires to a slave. I was able to -remember that the method seemed right and natural to me in those days, I -being born to it and unaware that elsewhere there were other methods; but -I was also able to remember that those unresented cuffings made me sorry -for the victim and ashamed for the punisher. My father was a refined and -kindly gentleman, very grave, rather austere, of rigid probity, a sternly -just and upright man, albeit he attended no church and never spoke of -religious matters, and had no part nor lot in the pious joys of his -Presbyterian family, nor ever seemed to suffer from this deprivation. He -laid his hand upon me in punishment only twice in his life, and then not -heavily; once for telling him a lie--which surprised me, and showed me -how unsuspicious he was, for that was not my maiden effort. He punished -me those two times only, and never any other member of the family at all; -yet every now and then he cuffed our harmless slave boy, Lewis, for -trifling little blunders and awkwardnesses. My father had passed his life -among the slaves from his cradle up, and his cuffings proceeded from the -custom of the time, not from his nature. When I was ten years old I saw -a man fling a lump of iron-ore at a slaveman in anger, for merely doing -something awkwardly--as if that were a crime. It bounded from the man's -skull, and the man fell and never spoke again. He was dead in an hour. -I knew the man had a right to kill his slave if he wanted to, and yet it -seemed a pitiful thing and somehow wrong, though why wrong I was not deep -enough to explain if I had been asked to do it. Nobody in the village -approved of that murder, but of course no one said much about it. - -It is curious--the space-annihilating power of thought. For just one -second, all that goes to make the me in me was in a Missourian village, -on the other side of the globe, vividly seeing again these forgotten -pictures of fifty years ago, and wholly unconscious of all things but -just those; and in the next second I was back in Bombay, and that -kneeling native's smitten cheek was not done tingling yet! Back to -boyhood--fifty years; back to age again, another fifty; and a flight -equal to the circumference of the globe-all in two seconds by the watch! - -Some natives--I don't remember how many--went into my bedroom, now, and -put things to rights and arranged the mosquito-bar, and I went to bed to -nurse my cough. It was about nine in the evening. What a state of -things! For three hours the yelling and shouting of natives in the hall -continued, along with the velvety patter of their swift bare feet--what a -racket it was! They were yelling orders and messages down three flights. -Why, in the matter of noise it amounted to a riot, an insurrection, a -revolution. And then there were other noises mixed up with these and at -intervals tremendously accenting them--roofs falling in, I judged, -windows smashing, persons being murdered, crows squawking, and deriding, -and cursing, canaries screeching, monkeys jabbering, macaws blaspheming, -and every now and then fiendish bursts of laughter and explosions of -dynamite. By midnight I had suffered all the different kinds of shocks -there are, and knew that I could never more be disturbed by them, either -isolated or in combination. Then came peace--stillness deep and solemn -and lasted till five. - -Then it all broke loose again. And who re-started it? The Bird of Birds -the Indian crow. I came to know him well, by and by, and be infatuated -with him. I suppose he is the hardest lot that wears feathers. Yes, and -the cheerfulest, and the best satisfied with himself. He never arrived -at what he is by any careless process, or any sudden one; he is a work of -art, and "art is long"; he is the product of immemorial ages, and of deep -calculation; one can't make a bird like that in a day. He has been -reincarnated more times than Shiva; and he has kept a sample of each -incarnation, and fused it into his constitution. In the course of his -evolutionary promotions, his sublime march toward ultimate perfection, he -has been a gambler, a low comedian, a dissolute priest, a fussy woman, a -blackguard, a scoffer, a liar, a thief, a spy, an informer, a trading -politician, a swindler, a professional hypocrite, a patriot for cash, a -reformer, a lecturer, a lawyer, a conspirator, a rebel, a royalist, a -democrat, a practicer and propagator of irreverence, a meddler, an -intruder, a busybody, an infidel, and a wallower in sin for the mere love -of it. The strange result, the incredible result, of this patient -accumulation of all damnable traits is, that be does not know what care -is, he does not know what sorrow is, he does not know what remorse is, -his life is one long thundering ecstasy of happiness, and he will go to -his death untroubled, knowing that he will soon turn up again as an -author or something, and be even more intolerably capable and comfortable -than ever he was before. - -In his straddling wide forward-step, and his springy side-wise series of -hops, and his impudent air, and his cunning way of canting his head to -one side upon occasion, he reminds one of the American blackbird. But -the sharp resemblances stop there. He is much bigger than the blackbird; -and he lacks the blackbird's trim and slender and beautiful build and -shapely beak; and of course his sober garb of gray and rusty black is a -poor and humble thing compared with the splendid lustre of the -blackbird's metallic sables and shifting and flashing bronze glories. -The blackbird is a perfect gentleman, in deportment and attire, and is -not noisy, I believe, except when holding religious services and -political conventions in a tree; but this Indian sham Quaker is just a -rowdy, and is always noisy when awake--always chaffing, scolding, -scoffing, laughing, ripping, and cursing, and carrying on about something -or other. I never saw such a bird for delivering opinions. Nothing -escapes him; he notices everything that happens, and brings out his -opinion about it, particularly if it is a matter that is none of his -business. And it is never a mild opinion, but always violent--violent -and profane--the presence of ladies does not affect him. His opinions -are not the outcome of reflection, for he never thinks about anything, -but heaves out the opinion that is on top in his mind, and which is often -an opinion about some quite different thing and does not fit the case. -But that is his way; his main idea is to get out an opinion, and if he -stopped to think he would lose chances. - -I suppose he has no enemies among men. The whites and Mohammedans never -seemed to molest him; and the Hindoos, because of their religion, never -take the life of any creature, but spare even the snakes and tigers and -fleas and rats. If I sat on one end of the balcony, the crows would -gather on the railing at the other end and talk about me; and edge -closer, little by little, till I could almost reach them; and they would -sit there, in the most unabashed way, and talk about my clothes, and my -hair, and my complexion, and probable character and vocation and -politics, and how I came to be in India, and what I had been doing, and -how many days I had got for it, and how I had happened to go unhanged -so long, and when would it probably come off, and might there be more of -my sort where I came from, and when would they be hanged,--and so on, and -so on, until I could not longer endure the embarrassment of it; then I -would shoo them away, and they would circle around in the air a little -while, laughing and deriding and mocking, and presently settle on the -rail and do it all over again. - -They were very sociable when there was anything to eat--oppressively so. -With a little encouragement they would come in and light on the table and -help me eat my breakfast; and once when I was in the other room and they -found themselves alone, they carried off everything they could lift; and -they were particular to choose things which they could make no use of -after they got them. In India their number is beyond estimate, and their -noise is in proportion. I suppose they cost the country more than the -government does; yet that is not a light matter. Still, they pay; their -company pays; it would sadden the land to take their cheerful voice out -of it. - - - - -CHAPTER XXXIX. - -By trying we can easily learn to endure adversity. Another man's, -I mean. - --Pudd'nhead Wilson's New Calendar. - -You soon find your long-ago dreams of India rising in a sort of vague and -luscious moonlight above the horizon-rim of your opaque consciousness, -and softly lighting up a thousand forgotten details which were parts of a -vision that had once been vivid to you when you were a boy, and steeped -your spirit in tales of the East. The barbaric gorgeousnesses, for -instance; and the princely titles, the sumptuous titles, the sounding -titles,--how good they taste in the mouth! The Nizam of Hyderabad; the -Maharajah of Travancore; the Nabob of Jubbelpore; the Begum of Bhopal; -the Nawab of Mysore; the Rance of Gulnare; the Ahkoond of Swat's; the Rao -of Rohilkund; the Gaikwar of Baroda. Indeed, it is a country that runs -richly to name. The great god Vishnu has 108--108 special ones--108 -peculiarly holy ones--names just for Sunday use only. I learned the -whole of Vishnu's 108 by heart once, but they wouldn't stay; I don't -remember any of them now but John W. - -And the romances connected with, those princely native houses--to this -day they are always turning up, just as in the old, old times. They were -sweating out a romance in an English court in Bombay a while before we -were there. In this case a native prince, 16 1/2 years old, who has been -enjoying his titles and dignities and estates unmolested for fourteen -years, is suddenly haled into court on the charge that he is rightfully -no prince at all, but a pauper peasant; that the real prince died when -two and one-half years old; that the death was concealed, and a peasant -child smuggled into the royal cradle, and that this present incumbent was -that smuggled substitute. This is the very material that so many -oriental tales have been made of. - -The case of that great prince, the Gaikwar of Baroda, is a reversal of -the theme. When that throne fell vacant, no heir could be found for some -time, but at last one was found in the person of a peasant child who was -making mud pies in a village street, and having an innocent good time. -But his pedigree was straight; he was the true prince, and he has reigned -ever since, with none to dispute his right. - -Lately there was another hunt for an heir to another princely house, and -one was found who was circumstanced about as the Gaikwar had been. His -fathers were traced back, in humble life, along a branch of the ancestral -tree to the point where it joined the stem fourteen generations ago, and -his heirship was thereby squarely established. The tracing was done by -means of the records of one of the great Hindoo shrines, where princes on -pilgrimage record their names and the date of their visit. This is to -keep the prince's religious account straight, and his spiritual person -safe; but the record has the added value of keeping the pedigree -authentic, too. - -When I think of Bombay now, at this distance of time, I seem to have a -kaleidoscope at my eye; and I hear the clash of the glass bits as the -splendid figures change, and fall apart, and flash into new forms, figure -after figure, and with the birth of each new form I feel my skin crinkle -and my nerve-web tingle with a new thrill of wonder and delight. These -remembered pictures float past me in a sequence of contracts; following -the same order always, and always whirling by and disappearing with the -swiftness of a dream, leaving me with the sense that the actuality was -the experience of an hour, at most, whereas it really covered days, I -think. - -The series begins with the hiring of a "bearer"--native man-servant--a -person who should be selected with some care, because as long as he is in -your employ he will be about as near to you as your clothes. - -In India your day may be said to begin with the "bearer's" knock on the -bedroom door, accompanied by a formula of, words--a formula which is -intended to mean that the bath is ready. It doesn't really seem to mean -anything at all. But that is because you are not used to "bearer" -English. You will presently understand. - -Where he gets his English is his own secret. There is nothing like it -elsewhere in the earth; or even in paradise, perhaps, but the other place -is probably full of it. You hire him as soon as you touch Indian soil; -for no matter what your sex is, you cannot do without him. He is -messenger, valet, chambermaid, table-waiter, lady's maid, courier--he is -everything. He carries a coarse linen clothes-bag and a quilt; he sleeps -on the stone floor outside your chamber door, and gets his meals you do -not know where nor when; you only know that he is not fed on the -premises, either when you are in a hotel or when you are a guest in a, -private house. His wages are large--from an Indian point of view--and he -feeds and clothes himself out of them. We had three of him in two and a -half months. The first one's rate was thirty rupees a month that is to -say, twenty-seven cents a day; the rate of the others, Rs. 40 (40 rupees) -a month. A princely sum; for the native switchman on a railway and the -native servant in a private family get only Rs. 7 per month, and the -farm-hand only 4. The two former feed and clothe themselves and their -families on their $1.90 per month; but I cannot believe that the farmhand -has to feed himself on his $1.08. I think the farm probably feeds him, -and that the whole of his wages, except a trifle for the priest, go to -the support of his family. That is, to the feeding of his family; for -they live in a mud hut, hand-made, and, doubtless, rent-free, and they -wear no clothes; at least, nothing more than a rag. And not much of a -rag at that, in the case of the males. However, these are handsome times -for the farm-hand; he was not always the child of luxury that he is now. -The Chief Commissioner of the Central Provinces, in a recent official -utterance wherein he was rebuking a native deputation for complaining of -hard times, reminded them that they could easily remember when a -farm-hand's wages were only half a rupee (former value) a month--that -is to say, less than a cent a day; nearly $2.90 a year. If such a -wage-earner had a good deal of a family--and they all have that, for God -is very good to these poor natives in some ways--he would save a profit -of fifteen cents, clean and clear, out of his year's toil; I mean a -frugal, thrifty person would, not one given to display and ostentation. -And if he owed $13.50 and took good care of his health, he could pay it -off in ninety years. Then he could hold up his head, and look his -creditors in the face again. - -Think of these facts and what they mean. India does not consist of -cities. There are no cities in India--to speak of. Its stupendous -population consists of farm-laborers. India is one vast farm--one almost -interminable stretch of fields with mud fences between. . . Think of the -above facts; and consider what an incredible aggregate of poverty they -place before you. - -The first Bearer that applied, waited below and sent up his -recommendations. That was the first morning in Bombay. We read them -over; carefully, cautiously, thoughtfully. There was not a fault to find -with them--except one; they were all from Americans. Is that a slur? -If it is, it is a deserved one. In my experience, an American's -recommendation of a servant is not usually valuable. We are too -good-natured a race; we hate to say the unpleasant thing; we shrink from -speaking the unkind truth about a poor fellow whose bread depends upon -our verdict; so we speak of his good points only, thus not scrupling to -tell a lie--a silent lie--for in not mentioning his bad ones we as good -as say he hasn't any. The only difference that I know of between a -silent lie and a spoken one is, that the silent lie is a less respectable -one than the other. And it can deceive, whereas the other can't--as a -rule. We not only tell the silent lie as to a servant's faults, but we -sin in another way: we overpraise his merits; for when it comes to -writing recommendations of servants we are a nation of gushers. And we -have not the Frenchman's excuse. In France you must give the departing -servant a good recommendation; and you must conceal his faults; you have -no choice. If you mention his faults for the protection of the next -candidate for his services, he can sue you for damages; and the court -will award them, too; and, moreover, the judge will give you a sharp -dressing-down from the bench for trying to destroy a poor man's -character, and rob him of his bread. I do not state this on my own -authority, I got it from a French physician of fame and repute--a man who -was born in Paris, and had practiced there all his life. And he said -that he spoke not merely from common knowledge, but from exasperating -personal experience. - -As I was saying, the Bearer's recommendations were all from American -tourists; and St. Peter would have admitted him to the fields of the -blest on them--I mean if he is as unfamiliar with our people and our ways -as I suppose he is. According to these recommendations, Manuel X. was -supreme in all the arts connected with his complex trade; and these -manifold arts were mentioned--and praised-in detail. His English was -spoken of in terms of warm admiration--admiration verging upon rapture. -I took pleased note of that, and hoped that some of it might be true. - -We had to have some one right away; so the family went down stairs and -took him a week on trial; then sent him up to me and departed on their -affairs. I was shut up in my quarters with a bronchial cough, and glad -to have something fresh to look at, something new to play with. Manuel -filled the bill; Manuel was very welcome. He was toward fifty years old, -tall, slender, with a slight stoop--an artificial stoop, a deferential -stoop, a stoop rigidified by long habit--with face of European mould; -short hair intensely black; gentle black eyes, timid black eyes, indeed; -complexion very dark, nearly black in fact; face smooth-shaven. He was -bareheaded and barefooted, and was never otherwise while his week with us -lasted; his clothing was European, cheap, flimsy, and showed much wear. - -He stood before me and inclined his head (and body) in the pathetic -Indian way, touching his forehead with the finger--ends of his right -hand, in salute. I said: - -"Manuel, you are evidently Indian, but you seem to have a Spanish name -when you put it all together. How is that?" - -A perplexed look gathered in his face; it was plain that he had not -understood--but he didn't let on. He spoke back placidly. - -"Name, Manuel. Yes, master." - -"I know; but how did you get the name?" - -"Oh, yes, I suppose. Think happen so. Father same name, not mother." - -I saw that I must simplify my language and spread my words apart, if I -would be understood by this English scholar. - -"Well--then--how--did--your--father--get--his name?" - -"Oh, he,"--brightening a little--"he Christian--Portygee; live in Goa; I -born Goa; mother not Portygee, mother native-high-caste Brahmin--Coolin -Brahmin; highest caste; no other so high caste. I high-caste Brahmin, -too. Christian, too, same like father; high-caste Christian Brahmin, -master--Salvation Army." - -All this haltingly, and with difficulty. Then he had an inspiration, and -began to pour out a flood of words that I could make nothing of; so I -said: - -"There--don't do that. I can't understand Hindostani." - -"Not Hindostani, master--English. Always I speaking English sometimes -when I talking every day all the time at you." - -"Very well, stick to that; that is intelligible. It is not up to my -hopes, it is not up to the promise of the recommendations, still it is -English, and I understand it. Don't elaborate it; I don't like -elaborations when they are crippled by uncertainty of touch." - -"Master?" - -"Oh, never mind; it was only a random thought; I didn't expect you to -understand it. How did you get your English; is it an acquirement, or -just a gift of God?" - -After some hesitation--piously: - -"Yes, he very good. Christian god very good, Hindoo god very good, too. -Two million Hindoo god, one Christian god--make two million and one. All -mine; two million and one god. I got a plenty. Sometime I pray all time -at those, keep it up, go all time every day; give something at shrine, -all good for me, make me better man; good for me, good for my family, dam -good." - -Then he had another inspiration, and went rambling off into fervent -confusions and incoherencies, and I had to stop him again. I thought we -had talked enough, so I told him to go to the bathroom and clean it up -and remove the slops--this to get rid of him. He went away, seeming to -understand, and got out some of my clothes and began to brush them. I -repeated my desire several times, simplifying and re-simplifying it, and -at last he got the idea. Then he went away and put a coolie at the work, -and explained that he would lose caste if he did it himself; it would be -pollution, by the law of his caste, and it would cost him a deal of fuss -and trouble to purify himself and accomplish his rehabilitation. He said -that that kind of work was strictly forbidden to persons of caste, and as -strictly restricted to the very bottom layer of Hindoo society--the -despised 'Sudra' (the toiler, the laborer). He was right; and apparently -the poor Sudra has been content with his strange lot, his insulting -distinction, for ages and ages--clear back to the beginning of things, so -to speak. Buckle says that his name--laborer--is a term of contempt; -that it is ordained by the Institutes of Menu (900 B.C.) that if a Sudra -sit on a level with his superior he shall be exiled or branded--[Without -going into particulars I will remark that as a rule they wear no clothing -that would conceal the brand.--M. T.]. . . ; if he speak -contemptuously of his superior or insult him he shall suffer death; if he -listen to the reading of the sacred books he shall have burning oil -poured in his ears; if he memorize passages from them he shall be killed; -if he marry his daughter to a Brahmin the husband shall go to hell for -defiling himself by contact with a woman so infinitely his inferior; and -that it is forbidden to a Sudra to acquire wealth. "The bulk of the -population of India," says Bucklet--[Population to-day, 300,000,000.] ---"is the Sudras--the workers, the farmers, the creators of wealth." - -Manuel was a failure, poor old fellow. His age was against him. He was -desperately slow and phenomenally forgetful. When he went three blocks -on an errand he would be gone two hours, and then forget what it was he -went for. When he packed a trunk it took him forever, and the trunk's -contents were an unimaginable chaos when he got done. He couldn't wait -satisfactorily at table--a prime defect, for if you haven't your own -servant in an Indian hotel you are likely to have a slow time of it and -go away hungry. We couldn't understand his English; he couldn't -understand ours; and when we found that he couldn't understand his own, -it seemed time for us to part. I had to discharge him; there was no help -for it. But I did it as kindly as I could, and as gently. We must part, -said I, but I hoped we should meet again in a better world. It was not -true, but it was only a little thing to say, and saved his feelings and -cost me nothing. - -But now that he was gone, and was off my mind and heart, my spirits began -to rise at once, and I was soon feeling brisk and ready to go out and -have adventures. Then his newly-hired successor flitted in, touched his -forehead, and began to fly around here, there, and everywhere, on his -velvet feet, and in five minutes he had everything in the room -"ship-shape and Bristol fashion," as the sailors say, and was standing at -the salute, waiting for orders. Dear me, what a rustler he was after the -slumbrous way of Manuel, poor old slug! All my heart, all my affection, -all my admiration, went out spontaneously to this frisky little forked -black thing, this compact and compressed incarnation of energy and force -and promptness and celerity and confidence, this smart, smily, engaging, -shiney-eyed little devil, feruled on his upper end by a gleaming -fire-coal of a fez with a red-hot tassel dangling from it. I said, -with deep satisfaction-- - -"You'll suit. What is your name?" - -He reeled it mellowly off. - -"Let me see if I can make a selection out of it--for business uses, I -mean; we will keep the rest for Sundays. Give it to me in installments." - -He did it. But there did not seem to be any short ones, except -Mousawhich suggested mouse. It was out of character; it was too soft, -too quiet, too conservative; it didn't fit his splendid style. I -considered, and said-- - -"Mousa is short enough, but I don't quite like it. It seems colorless ---inharmonious--inadequate; and I am sensitive to such things. How do you -think Satan would do?" - -"Yes, master. Satan do wair good." - -It was his way of saying "very good." - -There was a rap at the door. Satan covered the ground with a single -skip; there was a word or two of Hindostani, then he disappeared. Three -minutes later he was before me again, militarily erect, and waiting for -me to speak first. - -"What is it, Satan?" - -"God want to see you." - -"Who?" - -"God. I show him up, master?" - -"Why, this is so unusual, that--that--well, you see indeed I am so -unprepared--I don't quite know what I do mean. Dear me, can't you -explain? Don't you see that this is a most ex----" - -"Here his card, master." - -Wasn't it curious--and amazing, and tremendous, and all that? Such a -personage going around calling on such as I, and sending up his card, -like a mortal--sending it up by Satan. It was a bewildering collision of -the impossibles. But this was the land of the Arabian Nights, this was -India! and what is it that cannot happen in India? - -We had the interview. Satan was right--the Visitor was indeed a God in -the conviction of his multitudinous followers, and was worshiped by them -in sincerity and humble adoration. They are troubled by no doubts as to -his divine origin and office. They believe in him, they pray to him, -they make offerings to him, they beg of him remission of sins; to them -his person, together with everything connected with it, is sacred; from -his barber they buy the parings of his nails and set them in gold, and -wear them as precious amulets. - -I tried to seem tranquilly conversational and at rest, but I was not. -Would you have been? I was in a suppressed frenzy of excitement and -curiosity and glad wonder. I could not keep my eyes off him. I was -looking upon a god, an actual god, a recognized and accepted god; and -every detail of his person and his dress had a consuming interest for me. -And the thought went floating through my head, "He is worshiped--think of -it--he is not a recipient of the pale homage called compliment, wherewith -the highest human clay must make shift to be satisfied, but of an -infinitely richer spiritual food: adoration, worship!--men and women lay -their cares and their griefs and their broken hearts at his feet; and he -gives them his peace; and they go away healed." - -And just then the Awful Visitor said, in the simplest way--"There is a -feature of the philosophy of Huck Finn which"--and went luminously on -with the construction of a compact and nicely-discriminated literary -verdict. - -It is a land of surprises--India! I had had my ambitions--I had hoped, -and almost expected, to be read by kings and presidents and emperors--but -I had never looked so high as That. It would be false modesty to pretend -that I was not inordinately pleased. I was. I was much more pleased -than I should have been with a compliment from a man. - -He remained half an hour, and I found him a most courteous and charming -gentleman. The godship has been in his family a good while, but I do not -know how long. He is a Mohammedan deity; by earthly rank he is a prince; -not an Indian but a Persian prince. He is a direct descendant of the -Prophet's line. He is comely; also young--for a god; not forty, perhaps -not above thirty-five years old. He wears his immense honors with -tranquil brace, and with a dignity proper to his awful calling. He -speaks English with the ease and purity of a person born to it. I think -I am not overstating this. He was the only god I had ever seen, and I -was very favorably impressed. When he rose to say good-bye, the door -swung open and I caught the flash of a red fez, and heard these words, -reverently said-- - -"Satan see God out?" - -"Yes." And these mis-mated Beings passed from view Satan in the lead and -The Other following after. - - - - -CHAPTER XL. - -Few of us can stand prosperity. Another man's, I mean. - --Pudd'nhead Wilson's New Calendar. - -The next picture in my mind is Government House, on Malabar Point, with -the wide sea-view from the windows and broad balconies; abode of His -Excellency the Governor of the Bombay Presidency--a residence which is -European in everything but the native guards and servants, and is a home -and a palace of state harmoniously combined. - -That was England, the English power, the English civilization, the modern -civilization--with the quiet elegancies and quiet colors and quiet tastes -and quiet dignity that are the outcome of the modern cultivation. And -following it came a picture of the ancient civilization of India--an hour -in the mansion of a native prince: Kumar Schri Samatsinhji Bahadur of the -Palitana State. - -The young lad, his heir, was with the prince; also, the lad's sister, a -wee brown sprite, very pretty, very serious, very winning, delicately -moulded, costumed like the daintiest butterfly, a dear little fairyland -princess, gravely willing to be friendly with the strangers, but in the -beginning preferring to hold her father's hand until she could take stock -of them and determine how far they were to be trusted. She must have -been eight years old; so in the natural (Indian) order of things she -would be a bride in three or four years from now, and then this free -contact with the sun and the air and the other belongings of out-door -nature and comradeship with visiting male folk would end, and she would -shut herself up in the zenana for life, like her mother, and by inherited -habit of mind would be happy in that seclusion and not look upon it as an -irksome restraint and a weary captivity. - -The game which the prince amuses his leisure with--however, never mind -it, I should never be able to describe it intelligibly. I tried to get -an idea of it while my wife and daughter visited the princess in the -zenana, a lady of charming graces and a fluent speaker of English, but I -did not make it out. It is a complicated game, and I believe it is said -that nobody can learn to play it well--but an Indian. And I was not able -to learn how to wind a turban. It seemed a simple art and easy; but that -was a deception. It is a piece of thin, delicate stuff a foot wide or -more, and forty or fifty feet long; and the exhibitor of the art takes -one end of it in his hands, and winds it in and out intricately about his -head, twisting it as he goes, and in a minute or two the thing is -finished, and is neat and symmetrical and fits as snugly as a mould. - -We were interested in the wardrobe and the jewels, and in the silverware, -and its grace of shape and beauty and delicacy of ornamentation. The -silverware is kept locked up, except at meal-times, and none but the -chief butler and the prince have keys to the safe. I did not clearly -understand why, but it was not for the protection of the silver. It was -either to protect the prince from the contamination which his caste would -suffer if the vessels were touched by low-caste hands, or it was to -protect his highness from poison. Possibly it was both. I believe a -salaried taster has to taste everything before the prince ventures it--an -ancient and judicious custom in the East, and has thinned out the tasters -a good deal, for of course it is the cook that puts the poison in. If I -were an Indian prince I would not go to the expense of a taster, I would -eat with the cook. - -Ceremonials are always interesting; and I noted that the Indian -good-morning is a ceremonial, whereas ours doesn't amount to that. In -salutation the son reverently touches the father's forehead with a small -silver implement tipped with vermillion paste which leaves a red spot -there, and in return the son receives the father's blessing. Our good -morning is well enough for the rowdy West, perhaps, but would be too -brusque for the soft and ceremonious East. - -After being properly necklaced, according to custom, with great garlands -made of yellow flowers, and provided with betel-nut to chew, this -pleasant visit closed, and we passed thence to a scene of a different -sort: from this glow of color and this sunny life to those grim -receptacles of the Parsee dead, the Towers of Silence. There is -something stately about that name, and an impressiveness which sinks -deep; the hush of death is in it. We have the Grave, the Tomb, the -Mausoleum, God's Acre, the Cemetery; and association has made them -eloquent with solemn meaning; but we have no name that is so majestic as -that one, or lingers upon the ear with such deep and haunting pathos. - -On lofty ground, in the midst of a paradise of tropical foliage and -flowers, remote from the world and its turmoil and noise, they stood--the -Towers of Silence; and away below was spread the wide groves of cocoa -palms, then the city, mile on mile, then the ocean with its fleets of -creeping ships all steeped in a stillness as deep as the hush that -hallowed this high place of the dead. The vultures were there. They -stood close together in a great circle all around the rim of a massive -low tower--waiting; stood as motionless as sculptured ornaments, and -indeed almost deceived one into the belief that that was what they were. -Presently there was a slight stir among the score of persons present, and -all moved reverently out of the path and ceased from talking. A funeral -procession entered the great gate, marching two and two, and moved -silently by, toward the Tower. The corpse lay in a shallow shell, and -was under cover of a white cloth, but was otherwise naked. The bearers -of the body were separated by an interval of thirty feet from the -mourners. They, and also the mourners, were draped all in pure white, -and each couple of mourners was figuratively bound together by a piece of -white rope or a handkerchief--though they merely held the ends of it in -their hands. Behind the procession followed a dog, which was led in a -leash. When the mourners had reached the neighborhood of the Tower ---neither they nor any other human being but the bearers of the dead must -approach within thirty feet of it--they turned and went back to one of -the prayer-houses within the gates, to pray for the spirit of their dead. -The bearers unlocked the Tower's sole door and disappeared from view -within. In a little while they came out bringing the bier and the white -covering-cloth, and locked the door again. Then the ring of vultures -rose, flapping their wings, and swooped down into the Tower to devour the -body. Nothing was left of it but a clean-picked skeleton when they -flocked-out again a few minutes afterward. - -The principle which underlies and orders everything connected with a -Parsee funeral is Purity. By the tenets of the Zoroastrian religion, the -elements, Earth, Fire, and Water, are sacred, and must not be -contaminated by contact with a dead body. Hence corpses must not be -burned, neither must they be buried. None may touch the dead or enter -the Towers where they repose except certain men who are officially -appointed for that purpose. They receive high pay, but theirs is a -dismal life, for they must live apart from their species, because their -commerce with the dead defiles them, and any who should associate with -them would share their defilement. When they come out of the Tower the -clothes they are wearing are exchanged for others, in a building within -the grounds, and the ones which they have taken off are left behind, for -they are contaminated, and must never be used again or suffered to go -outside the grounds. These bearers come to every funeral in new -garments. So far as is known, no human being, other than an official -corpse-bearer--save one--has ever entered a Tower of Silence after its -consecration. Just a hundred years ago a European rushed in behind the -bearers and fed his brutal curiosity with a glimpse of the forbidden -mysteries of the place. This shabby savage's name is not given; his -quality is also concealed. These two details, taken in connection with -the fact that for his extraordinary offense the only punishment he got -from the East India Company's Government was a solemn official -"reprimand"--suggest the suspicion that he was a European of consequence. -The same public document which contained the reprimand gave warning that -future offenders of his sort, if in the Company's service, would be -dismissed; and if merchants, suffer revocation of license and exile to -England. - -The Towers are not tall, but are low in proportion to their -circumference, like a gasometer. If you should fill a gasometer half way -up with solid granite masonry, then drive a wide and deep well down -through the center of this mass of masonry, you would have the idea of a -Tower of Silence. On the masonry surrounding the well the bodies lie, in -shallow trenches which radiate like wheel-spokes from the well. The -trenches slant toward the well and carry into it the rainfall. -Underground drains, with charcoal filters in them, carry off this water -from the bottom of the well. - -When a skeleton has lain in the Tower exposed to the rain and the flaming -sun a month it is perfectly dry and clean. Then the same bearers that -brought it there come gloved and take it up with tongs and throw it into -the well. There it turns to dust. It is never seen again, never touched -again, in the world. Other peoples separate their dead, and preserve and -continue social distinctions in the grave--the skeletons of kings and -statesmen and generals in temples and pantheons proper to skeletons of -their degree, and the skeletons of the commonplace and the poor in places -suited to their meaner estate; but the Parsees hold that all men rank -alike in death--all are humble, all poor, all destitute. In sign of -their poverty they are sent to their grave naked, in sign of their -equality the bones of the rich, the poor, the illustrious and the obscure -are flung into the common well together. At a Parsee funeral there are -no vehicles; all concerned must walk, both rich and poor, howsoever great -the distance to be traversed may be. In the wells of the Five Towers of -Silence is mingled the dust of all the Parsee men and women and children -who have died in Bombay and its vicinity during the two centuries which -have elapsed since the Mohammedan conquerors drove the Parsees out of -Persia, and into that region of India. The earliest of the five towers -was built by the Modi family something more than 200 years ago, and it is -now reserved to the heirs of that house; none but the dead of that blood -are carried thither. - -The origin of at least one of the details of a Parsee funeral is not now -known--the presence of the dog. Before a corpse is borne from the house -of mourning it must be uncovered and exposed to the gaze of a dog; a dog -must also be led in the rear of the funeral. Mr. Nusserwanjee Byranijee, -Secretary to the Parsee Punchayet, said that these formalities had once -had a meaning and a reason for their institution, but that they were -survivals whose origin none could now account for. Custom and tradition -continue them in force, antiquity hallows them. It is thought that in -ancient times in Persia the dog was a sacred animal and could guide souls -to heaven; also that his eye had the power of purifying objects which had -been contaminated by the touch of the dead; and that hence his presence -with the funeral cortege provides an ever-applicable remedy in case of -need. - -The Parsees claim that their method of disposing of the dead is an -effective protection of the living; that it disseminates no corruption, -no impurities of any sort, no disease-germs; that no wrap, no garment -which has touched the dead is allowed to touch the living afterward; that -from the Towers of Silence nothing proceeds which can carry harm to the -outside world. These are just claims, I think. As a sanitary measure, -their system seems to be about the equivalent of cremation, and as sure. -We are drifting slowly--but hopefully--toward cremation in these days. -It could not be expected that this progress should be swift, but if it be -steady and continuous, even if slow, that will suffice. When cremation -becomes the rule we shall cease to shudder at it; we should shudder at -burial if we allowed ourselves to think what goes on in the grave. - -The dog was an impressive figure to me, representing as he did a mystery -whose key is lost. He was humble, and apparently depressed; and he let -his head droop pensively, and looked as if he might be trying to call -back to his mind what it was that he had used to symbolize ages ago when -he began his function. There was another impressive thing close at hand, -but I was not privileged to see it. That was the sacred fire--a fire -which is supposed to have been burning without interruption for more than -two centuries; and so, living by the same heat that was imparted to it so -long ago. - -The Parsees are a remarkable community. There are only about 60,000 in -Bombay, and only about half as many as that in the rest of India; but -they make up in importance what they lack in numbers. They are highly -educated, energetic, enterprising, progressive, rich, and the Jew himself -is not more lavish or catholic in his charities and benevolences. The -Parsees build and endow hospitals, for both men and animals; and they and -their womenkind keep an open purse for all great and good objects. They -are a political force, and a valued support to the government. They have -a pure and lofty religion, and they preserve it in its integrity and -order their lives by it. - -We took a final sweep of the wonderful view of plain and city and ocean, -and so ended our visit to the garden and the Towers of Silence; and the -last thing I noticed was another symbol--a voluntary symbol this one; it -was a vulture standing on the sawed-off top of a tall and slender and -branchless palm in an open space in the ground; he was perfectly -motionless, and looked like a piece of sculpture on a pillar. And he had -a mortuary look, too, which was in keeping with the place. - - - - -CHAPTER XLI. - -There is an old-time toast which is golden for its beauty. -"When you ascend the hill of prosperity may you not meet a friend." - --Pudd'nhead Wilson's New Calendar. - -The next picture that drifts across the field of my memory is one which -is connected with religious things. We were taken by friends to see a -Jain temple. It was small, and had many flags or streamers flying from -poles standing above its roof; and its little battlements supported a -great many small idols or images. Upstairs, inside, a solitary Jain was -praying or reciting aloud in the middle of the room. Our presence did -not interrupt him, nor even incommode him or modify his fervor. Ten or -twelve feet in front of him was the idol, a small figure in a sitting -posture. It had the pinkish look of a wax doll, but lacked the doll's -roundness of limb and approximation to correctness of form and justness -of proportion. Mr. Gandhi explained every thing to us. He was delegate -to the Chicago Fair Congress of Religions. It was lucidly done, in -masterly English, but in time it faded from me, and now I have nothing -left of that episode but an impression: a dim idea of a religious belief -clothed in subtle intellectual forms, lofty and clean, barren of fleshly -grossnesses; and with this another dim impression which connects that -intellectual system somehow with that crude image, that inadequate idol ---how, I do not know. Properly they do not seem to belong together. -Apparently the idol symbolized a person who had become a saint or a god -through accessions of steadily augmenting holiness acquired through a -series of reincarnations and promotions extending over many ages; and was -now at last a saint and qualified to vicariously receive worship and -transmit it to heaven's chancellery. Was that it? - -And thence we went to Mr. Premchand Roychand's bungalow, in Lovelane, -Byculla, where an Indian prince was to receive a deputation of the Jain -community who desired to congratulate him upon a high honor lately -conferred upon him by his sovereign, Victoria, Empress of India. She had -made him a knight of the order of the Star of India. It would seem that -even the grandest Indian prince is glad to add the modest title "Sir" to -his ancient native grandeurs, and is willing to do valuable service to -win it. He will remit taxes liberally, and will spend money freely upon -the betterment of the condition of his subjects, if there is a knighthood -to be gotten by it. And he will also do good work and a deal of it to -get a gun added to the salute allowed him by the British Government. -Every year the Empress distributes knighthoods and adds guns for public -services done by native princes. The salute of a small prince is three -or four guns; princes of greater consequence have salutes that run higher -and higher, gun by gun,--oh, clear away up to eleven; possibly more, but -I did not hear of any above eleven-gun princes. I was told that when a -four-gun prince gets a gun added, he is pretty troublesome for a while, -till the novelty wears off, for he likes the music, and keeps hunting up -pretexts to get himself saluted. It may be that supremely grand folk, -like the Nyzam of Hyderabad and the Gaikwar of Baroda, have more than -eleven guns, but I don't know. - -When we arrived at the bungalow, the large hall on the ground floor was -already about full, and carriages were still flowing into the grounds. -The company present made a fine show, an exhibition of human fireworks, -so to speak, in the matters of costume and comminglings of brilliant -color. The variety of form noticeable in the display of turbans was -remarkable. We were told that the explanation of this was, that this -Jain delegation was drawn from many parts of India, and that each man -wore the turban that was in vogue in his own region. This diversity of -turbans made a beautiful effect. - -I could have wished to start a rival exhibition there, of Christian hats -and clothes. I would have cleared one side of the room of its Indian -splendors and repacked the space with Christians drawn from America, -England, and the Colonies, dressed in the hats and habits of now, and of -twenty and forty and fifty years ago. It would have been a hideous -exhibition, a thoroughly devilish spectacle. Then there would have been -the added disadvantage of the white complexion. It is not an unbearably -unpleasant complexion when it keeps to itself, but when it comes into -competition with masses of brown and black the fact is betrayed that it -is endurable only because we are used to it. Nearly all black and brown -skins are beautiful, but a beautiful white skin is rare. How rare, one -may learn by walking down a street in Paris, New York, or London on a -week-day particularly an unfashionable street--and keeping count of the -satisfactory complexions encountered in the course of a mile. Where dark -complexions are massed, they make the whites look bleached-out, -unwholesome, and sometimes frankly ghastly. I could notice this as a -boy, down South in the slavery days before the war. The splendid black -satin skin of the South African Zulus of Durban seemed to me to come very -close to perfection. I can see those Zulus yet--'ricksha athletes -waiting in front of the hotel for custom; handsome and intensely black -creatures, moderately clothed in loose summer stuffs whose snowy -whiteness made the black all the blacker by contrast. Keeping that group -in my mind, I can compare those complexions with the white ones which are -streaming past this London window now: - - A lady. Complexion, new parchment. Another lady. Complexion, old - parchment. - - Another. Pink and white, very fine. - - Man. Grayish skin, with purple areas. - - Man. Unwholesome fish-belly skin. - - Girl. Sallow face, sprinkled with freckles. - - Old woman. Face whitey-gray. - - Young butcher. Face a general red flush. - - Jaundiced man--mustard yellow. - - Elderly lady. Colorless skin, with two conspicuous moles. - - Elderly man--a drinker. Boiled-cauliflower nose in a flabby face - veined with purple crinklings. - - Healthy young gentleman. Fine fresh complexion. - - Sick young man. His face a ghastly white. - -No end of people whose skins are dull and characterless modifications of -the tint which we miscall white. Some of these faces are pimply; some -exhibit other signs of diseased blood; some show scars of a tint out of a -harmony with the surrounding shades of color. The white man's complexion -makes no concealments. It can't. It seemed to have been designed as a -catch-all for everything that can damage it. Ladies have to paint it, -and powder it, and cosmetic it, and diet it with arsenic, and enamel it, -and be always enticing it, and persuading it, and pestering it, and -fussing at it, to make it beautiful; and they do not succeed. But these -efforts show what they think of the natural complexion, as distributed. -As distributed it needs these helps. The complexion which they try to -counterfeit is one which nature restricts to the few--to the very few. -To ninety-nine persons she gives a bad complexion, to the hundredth a -good one. The hundredth can keep it--how long? Ten years, perhaps. - -The advantage is with the Zulu, I think. He starts with a beautiful -complexion, and it will last him through. And as for the Indian brown ---firm, smooth, blemishless, pleasant and restful to the eye, afraid of no -color, harmonizing with all colors and adding a grace to them all--I -think there is no sort of chance for the average white complexion against -that rich and perfect tint. - -To return to the bungalow. The most gorgeous costume present were worn -by some children. They seemed to blaze, so bright were the colors, and -so brilliant the jewels strum over the rich materials. These children -were professional nautch-dancers, and looked like girls, but they were -boys, They got up by ones and twos and fours, and danced and sang to an -accompaniment of weird music. Their posturings and gesturings were -elaborate and graceful, but their voices were stringently raspy and -unpleasant, and there was a good deal of monotony about the tune. - -By and by there was a burst of shouts and cheers outside and the prince -with his train entered in fine dramatic style. He was a stately man, he -was ideally costumed, and fairly festooned with ropes of gems; some of -the ropes were of pearls, some were of uncut great emeralds--emeralds -renowned in Bombay for their quality and value. Their size was -marvelous, and enticing to the eye, those rocks. A boy--a princeling ---was with the prince, and he also was a radiant exhibition. - -The ceremonies were not tedious. The prince strode to his throne with -the port and majesty--and the sternness--of a Julius Caesar coming to -receive and receipt for a back-country kingdom and have it over and get -out, and no fooling. There was a throne for the young prince, too, and -the two sat there, side by side, with their officers grouped at either -hand and most accurately and creditably reproducing the pictures which -one sees in the books--pictures which people in the prince's line of -business have been furnishing ever since Solomon received the Queen of -Sheba and showed her his things. The chief of the Jain delegation read -his paper of congratulations, then pushed it into a beautifully engraved -silver cylinder, which was delivered with ceremony into the prince's -hands and at once delivered by him without ceremony into the hands of an -officer. I will copy the address here. It is interesting, as showing -what an Indian prince's subject may have opportunity to thank him for in -these days of modern English rule, as contrasted with what his ancestor -would have given them opportunity to thank him for a century and a half -ago--the days of freedom unhampered by English interference. A century -and a half ago an address of thanks could have been put into small space. -It would have thanked the prince-- - - 1. For not slaughtering too many of his people upon mere caprice; - - 2. For not stripping them bare by sudden and arbitrary tax levies, - and bringing famine upon them; - - 3. For not upon empty pretext destroying the rich and seizing their - property; - - 4. For not killing, blinding, imprisoning, or banishing the - relatives of the royal house to protect the throne from possible - plots; - - 5. For not betraying the subject secretly, for a bribe, into the - hands of bands of professional Thugs, to be murdered and robbed in - the prince's back lot. - -Those were rather common princely industries in the old times, but they -and some others of a harsh sort ceased long ago under English rule. -Better industries have taken their place, as this Address from the Jain -community will show: - - "Your Highness,--We the undersigned members of the Jain community of - Bombay have the pleasure to approach your Highness with the - expression of our heartfelt congratulations on the recent conference - on your Highness of the Knighthood of the Most Exalted Order of the - Star of India. Ten years ago we had the pleasure and privilege of - welcoming your Highness to this city under circumstances which have - made a memorable epoch in the history of your State, for had it not - been for a generous and reasonable spirit that your Highness - displayed in the negotiations between the Palitana Durbar and the - Jain community, the conciliatory spirit that animated our people - could not have borne fruit. That was the first step in your - Highness's administration, and it fitly elicited the praise of the - Jain community, and of the Bombay Government. A decade of your - Highness's administration, combined with the abilities, training, - and acquirements that your Highness brought to bear upon it, has - justly earned for your Highness the unique and honourable - distinction--the Knighthood of the Most Exalted Order of the Star of - India, which we understand your Highness is the first to enjoy among - Chiefs of your, Highness's rank and standing. And we assure your - Highness that for this mark of honour that has been conferred on you - by Her Most Gracious Majesty, the Queen-Empress, we feel no less - proud than your Highness. Establishment of commercial factories, - schools, hospitals, etc., by your Highness in your State has marked - your Highness's career during these ten years, and we trust that - your Highness will be spared to rule over your people with wisdom - and foresight, and foster the many reforms that your Highness has - been pleased to introduce in your State. We again offer your - Highness our warmest felicitations for the honour that has been - conferred on you. We beg to remain your Highness's obedient - servants." - -Factories, schools, hospitals, reforms. The prince propagates that kind -of things in the modern times, and gets knighthood and guns for it. - -After the address the prince responded with snap and brevity; spoke a -moment with half a dozen guests in English, and with an official or two -in a native tongue; then the garlands were distributed as usual, and the -function ended. - - - - -CHAPTER XLII. - -Each person is born to one possession which outvalues all his others--his -last breath. - --Pudd'nhead Wilson's New Calendar. - -Toward midnight, that night, there was another function. This was a -Hindoo wedding--no, I think it was a betrothal ceremony. Always before, -we had driven through streets that were multitudinous and tumultuous with -picturesque native life, but now there was nothing of that. We seemed to -move through a city of the dead. There was hardly a suggestion of life -in those still and vacant streets. Even the crows were silent. But -everywhere on the ground lay sleeping natives-hundreds and hundreds. -They lay stretched at full length and tightly wrapped in blankets, beads -and all. Their attitude and their rigidity counterfeited death. The -plague was not in Bombay then, but it is devastating the city now. The -shops are deserted, now, half of the people have fled, and of the -remainder the smitten perish by shoals every day. No doubt the city -looks now in the daytime as it looked then at night. When we had pierced -deep into the native quarter and were threading its narrow dim lanes, we -had to go carefully, for men were stretched asleep all about and there -was hardly room to drive between them. And every now and then a swarm of -rats would scamper across past the horses' feet in the vague light--the -forbears of the rats that are carrying the plague from house to house in -Bombay now. The shops were but sheds, little booths open to the street; -and the goods had been removed, and on the counters families were -sleeping, usually with an oil lamp present. Recurrent dead watches, it -looked like. - -But at last we turned a corner and saw a great glare of light ahead. It -was the home of the bride, wrapped in a perfect conflagration of -illuminations,--mainly gas-work designs, gotten up specially for the -occasion. Within was abundance of brilliancy--flames, costumes, colors, -decorations, mirrors--it was another Aladdin show. - -The bride was a trim and comely little thing of twelve years, dressed as -we would dress a boy, though more expensively than we should do it, of -course. She moved about very much at her ease, and stopped and talked -with the guests and allowed her wedding jewelry to be examined. It was -very fine. Particularly a rope of great diamonds, a lovely thing to look -at and handle. It had a great emerald hanging to it. - -The bridegroom was not present. He was having betrothal festivities of -his own at his father's house. As I understood it, he and the bride were -to entertain company every night and nearly all night for a week or more, -then get married, if alive. Both of the children were a little elderly, -as brides and grooms go, in India--twelve; they ought to have been -married a year or two sooner; still to a, stranger twelve seems quite -young enough. - -A while after midnight a couple of celebrated and high-priced -nautch-girls appeared in the gorgeous place, and danced and sang. With -them were men who played upon strange instruments which made uncanny -noises of a sort to make one's flesh creep. One of these instruments was -a pipe, and to its music the girls went through a performance which -represented snake charming. It seemed a doubtful sort of music to charm -anything with, but a native gentleman assured me that snakes like it and -will come out of their holes and listen to it with every evidence of -refreshment And gratitude. He said that at an entertainment in his -grounds once, the pipe brought out half a dozen snakes, and the music had -to be stopped before they would be persuaded to go. Nobody wanted their -company, for they were bold, familiar, and dangerous; but no one would -kill them, of course, for it is sinful for a Hindoo to kill any kind of a -creature. - -We withdrew from the festivities at two in the morning. Another picture, -then--but it has lodged itself in my memory rather as a stage-scene than -as a reality. It is of a porch and short flight of steps crowded with -dark faces and ghostly-white draperies flooded with the strong glare from -the dazzling concentration of illuminations; and midway of the steps one -conspicuous figure for accent--a turbaned giant, with a name according to -his size: Rao Bahadur Baskirao Balinkanje Pitale, Vakeel to his Highness -the Gaikwar of Baroda. Without him the picture would not have been -complete; and if his name had been merely Smith, he wouldn't have -answered. Close at hand on house-fronts on both sides of the narrow -street were illuminations of a kind commonly employed by the natives ---scores of glass tumblers (containing tapers) fastened a few in inches -apart all over great latticed frames, forming starry constellations which -showed out vividly against their black back grounds. As we drew away -into the distance down the dim lanes the illuminations gathered together -into a single mass, and glowed out of the enveloping darkness like a sun. - -Then again the deep silence, the skurrying rats, the dim forms stretched -every-where on the ground; and on either hand those open booths -counterfeiting sepulchres, with counterfeit corpses sleeping motionless -in the flicker of the counterfeit death lamps. And now, a year later, -when I read the cablegrams I seem to be reading of what I myself partly -saw--saw before it happened--in a prophetic dream, as it were. One -cablegram says, "Business in the native town is about suspended. Except -the wailing and the tramp of the funerals. There is but little life or -movement. The closed shops exceed in number those that remain open." -Another says that 325,000 of the people have fled the city and are -carrying the plague to the country. Three days later comes the news, -"The population is reduced by half." The refugees have carried the -disease to Karachi; "220 cases, 214 deaths." A day or two later, "52 -fresh cases, all of which proved fatal." - -The plague carries with it a terror which no other disease can excite; -for of all diseases known to men it is the deadliest--by far the -deadliest. "Fifty-two fresh cases--all fatal." It is the Black Death -alone that slays like that. We can all imagine, after a fashion, the -desolation of a plague-stricken city, and the stupor of stillness broken -at intervals by distant bursts of wailing, marking the passing of -funerals, here and there and yonder, but I suppose it is not possible for -us to realize to ourselves the nightmare of dread and fear that possesses -the living who are present in such a place and cannot get away. That -half million fled from Bombay in a wild panic suggests to us something of -what they were feeling, but perhaps not even they could realize what the -half million were feeling whom they left stranded behind to face the -stalking horror without chance of escape. Kinglake was in Cairo many -years ago during an epidemic of the Black Death, and he has imagined the -terrors that creep into a man's heart at such a time and follow him until -they themselves breed the fatal sign in the armpit, and then the delirium -with confused images, and home-dreams, and reeling billiard-tables, and -then the sudden blank of death: - - "To the contagionist, filled as he is with the dread of final - causes, having no faith in destiny, nor in the fixed will of God, - and with none of the devil-may-care indifference which might stand - him instead of creeds--to such one, every rag that shivers in the - breeze of a plague-stricken city has this sort of sublimity. If by - any terrible ordinance he be forced to venture forth, be sees death - dangling from every sleeve; and, as he creeps forward, he poises his - shuddering limbs between the imminent jacket that is stabbing at his - right elbow and the murderous pelisse that threatens to mow him - clean down as it sweeps along on his left. But most of all he - dreads that which most of all he should love--the touch of a woman's - dress; for mothers and wives, hurrying forth on kindly errands from - the bedsides of the dying, go slouching along through the streets - more willfully and less courteously than the men. For a while it - may be that the caution of the poor Levantine may enable him to - avoid contact, but sooner or later, perhaps, the dreaded chance - arrives; that bundle of linen, with the dark tearful eyes at the top - of it, that labors along with the voluptuous clumsiness of Grisi - --she has touched the poor Levantine with the hem of her sleeve! From - that dread moment his peace is gone; his mind for ever hanging upon - the fatal touch invites the blow which he fears; he watches for the - symptoms of plague so carefully, that sooner or later they come in - truth. The parched mouth is a sign--his mouth is parched; the - throbbing brain--his brain does throb; the rapid pulse--he touches - his own wrist (for he dares not ask counsel of any man lest he be - deserted), he touches his wrist, and feels how his frighted blood - goes galloping out of his heart. There is nothing but the fatal - swelling that is wanting to make his sad conviction complete; - immediately, he has an odd feel under the arm--no pain, but a little - straining of the skin; he would to God it were his fancy that were - strong enough to give him that sensation; this is the worst of all. - It now seems to him that he could be happy and contented with his - parched mouth, and his throbbing brain, and his rapid pulse, if only - he could know that there were no swelling under the left arm; but - dares he try?--in a moment of calmness and deliberation he dares - not; but when for a while he has writhed under the torture of - suspense, a sudden strength of will drives him to seek and know his - fate; he touches the gland, and finds the skin sane and sound but - under the cuticle there lies a small lump like a pistol-bullet, that - moves as he pushes it. Oh! but is this for all certainty, is this - the sentence of death? Feel the gland of the other arm. There is - not the same lump exactly, yet something a little like it. Have not - some people glands naturally enlarged?--would to heaven he were one! - So he does for himself the work of the plague, and when the Angel of - Death thus courted does indeed and in truth come, he has only to - finish that which has been so well begun; he passes his fiery hand - over the brain of the victim, and lets him rave for a season, but - all chance-wise, of people and things once dear, or of people and - things indifferent. Once more the poor fellow is back at his home - in fair Provence, and sees the sundial that stood in his childhood's - garden--sees his mother, and the long-since forgotten face of that - little dear sister--(he sees her, he says, on a Sunday morning, for - all the church bells are ringing); he looks up and down through the - universe, and owns it well piled with bales upon bales of cotton, - and cotton eternal--so much so that he feels--he knows--he swears he - could make that winning hazard, if the billiard-table would not - slant upwards, and if the cue were a cue worth playing with; but it - is not--it's a cue that won't move--his own arm won't move--in - short, there's the devil to pay in the brain of the poor Levantine; - and perhaps, the next night but one he becomes the 'life and the - soul' of some squalling jackal family, who fish him out by the foot - from his shallow and sandy grave." - - - - -CHAPTER XLIII. - -Hunger is the handmaid of genius - --Pudd'nhead Wilson's New Calendar. - -One day during our stay in Bombay there was a criminal trial of a most -interesting sort, a terribly realistic chapter out of the "Arabian -Nights," a strange mixture of simplicities and pieties and murderous -practicalities, which brought back the forgotten days of Thuggee and made -them live again; in fact, even made them believable. It was a case where -a young girl had been assassinated for the sake of her trifling -ornaments, things not worth a laborer's day's wages in America. This -thing could have been done in many other countries, but hardly with the -cold business-like depravity, absence of fear, absence of caution, -destitution of the sense of horror, repentance, remorse, exhibited in -this case. Elsewhere the murderer would have done his crime secretly, by -night, and without witnesses; his fears would have allowed him no peace -while the dead body was in his neighborhood; he would not have rested -until he had gotten it safe out of the way and hidden as effectually as -he could hide it. But this Indian murderer does his deed in the full -light of day, cares nothing for the society of witnesses, is in no way -incommoded by the presence of the corpse, takes his own time about -disposing of it, and the whole party are so indifferent, so phlegmatic, -that they take their regular sleep as if nothing was happening and no -halters hanging over them; and these five bland people close the episode -with a religious service. The thing reads like a Meadows-Taylor Thug-tale -of half a century ago, as may be seen by the official report of the -trial: - - "At the Mazagon Police Court yesterday, Superintendent Nolan again - charged Tookaram Suntoo Savat Baya, woman, her daughter Krishni, and - Gopal Yithoo Bhanayker, before Mr. Phiroze Hoshang Dastur, Fourth - Presidency Magistrate, under sections 302 and 109 of the Code, with - having on the night of the 30th of December last murdered a Hindoo - girl named Cassi, aged 12, by strangulation, in the room of a chawl - at Jakaria Bunder, on the Sewriroad, and also with aiding and - abetting each other in the commission of the offense. - - "Mr. F. A. Little, Public Prosecutor, conducted the case on behalf - of the Crown, the accused being undefended. - - "Mr. Little applied under the provisions of the Criminal Procedure - Code to tender pardon to one of the accused, Krishni, woman, aged - 22, on her undertaking to make a true and full statement of facts - under which the deceased girl Cassi was murdered. - - "The Magistrate having granted the Public Prosecutor's application, - the accused Krishni went into the witness-box, and, on being - examined by Mr. Little, made the following confession:--I am a - mill-hand employed at the Jubilee Mill. I recollect the day - (Tuesday); on which the body of the deceased Cassi was found. - Previous to that I attended the mill for half a day, and then - returned home at 3 in the afternoon, when I saw five persons in the - house, viz.: the first accused Tookaram, who is my paramour, my - mother, the second accused Baya, the accused Gopal, and two guests - named Ramji Daji and Annaji Gungaram. Tookaram rented the room of - the chawl situated at Jakaria Bunder-road from its owner, - Girdharilal Radhakishan, and in that room I, my paramour, Tookaram, - and his younger brother, Yesso Mahadhoo, live. Since his arrival in - Bombay from his native country Yesso came and lived with us. When I - returned from the mill on the afternoon of that day, I saw the two - guests seated on a cot in the veranda, and a few minutes after the - accused Gopal came and took his seat by their side, while I and my - mother were seated inside the room. Tookaram, who had gone out to - fetch some 'pan' and betelnuts, on his return home had brought the - two guests with him. After returning home he gave them 'pan - supari'. While they were eating it my mother came out of the room - and inquired of one of the guests, Ramji, what had happened to his - foot, when he replied that he had tried many remedies, but they had - done him no good. My mother then took some rice in her hand and - prophesied that the disease which Ramji was suffering from would not - be cured until he returned to his native country. In the meantime - the deceased Casi came from the direction of an out-house, and stood - in front on the threshold of our room with a 'lota' in her hand. - Tookaram then told his two guests to leave the room, and they then - went up the steps towards the quarry. After the guests had gone - away, Tookaram seized the deceased, who had come into the room, and - he afterwards put a waistband around her, and tied her to a post - which supports a loft. After doing this, he pressed the girl's - throat, and, having tied her mouth with the 'dhotur' (now shown in - Court), fastened it to the post. Having killed the girl, Tookaram - removed her gold head ornament and a gold 'putlee', and also took - charge of her 'lota'. Besides these two ornaments Cassi had on her - person ear-studs a nose-ring, some silver toe-rings, two necklaces, - a pair of silver anklets and bracelets. Tookaram afterwards tried - to remove the silver amulets, the ear-studs, and the nose-ring; but - he failed in his attempt. While he was doing so, I, my mother, and - Gopal were present. After removing the two gold ornaments, he - handed them over to Gopal, who was at the time standing near me. - When he killed Cassi, Tookaram threatened to strangle me also if I - informed any one of this. Gopal and myself were then standing at - the door of our room, and we both were threatened by Tookaram. My - mother, Baya, had seized the legs of the deceased at the time she - was killed, and whilst she was being tied to the post. Cassi then - made a noise. Tookaram and my mother took part in killing the girl. - After the murder her body was wrapped up in a mattress and kept on - the loft over the door of our room. When Cassi was strangled, the - door of the room was fastened from the inside by Tookaram. This - deed was committed shortly after my return home from work in the - mill. Tookaram put the body of the deceased in the mattress, and, - after it was left on the loft, he went to have his head shaved by a - barber named Sambhoo Raghoo, who lives only one door away from me. - My mother and myself then remained in the possession of the - information. I was slapped and threatened by my paramour, Tookaram, - and that was the only reason why I did not inform any one at that - time. When I told Tookaram that I would give information of the - occurrence, he slapped me. The accused Gopal was asked by Tookaram - to go back to his room, and he did so, taking away with him the two - gold ornaments and the 'lota'. Yesso Mahadhoo, a brother-in-law of - Tookaram, came to the house and asked Taokaram why he was washing, - the water-pipe being just opposite. Tookaram replied that he was - washing his dhotur, as a fowl had polluted it. About 6 o'clock of - the evening of that day my mother gave me three pice and asked me to - buy a cocoanut, and I gave the money to Yessoo, who went and fetched - a cocoanut and some betel leaves. When Yessoo and others were in - the room I was bathing, and, after I finished my bath, my mother - took the cocoanut and the betel leaves from Yessoo, and we five went - to the sea. The party consisted of Tookaram, my mother, Yessoo, - Tookaram's younger brother, and myself. On reaching the seashore, - my mother made the offering to the sea, and prayed to be pardoned - for what we had done. Before we went to the sea, some one came to - inquire after the girl Cassi. The police and other people came to - make these inquiries both before and after we left the house for the - seashore. The police questioned my mother about the girl, and she - replied that Cassi had come to her door, but had left. The next day - the police questioned Tookaram, and he, too, gave a similar reply. - This was said the same night when the search was made for the girl. - After the offering was made to the sea, we partook of the cocoanut - and returned home, when my mother gave me some food; but Tookaram - did not partake of any food that night. After dinner I and my - mother slept inside the room, and Tookaram slept on a cot near his - brother-in-law, Yessoo Mahadhoo, just outside the door. That was - not the usual place where Tookaram slept. He usually slept inside - the room. The body of the deceased remained on the loft when I went - to sleep. The room in which we slept was locked, and I heard that - my paramour, Tookaram, was restless outside. About 3 o'clock the - following morning Tookaram knocked at the door, when both myself and - my mother opened it. He then told me to go to the steps leading to - the quarry, and see if any one was about. Those steps lead to a - stable, through which we go to the quarry at the back of the - compound. When I got to the steps I saw no one there. Tookaram - asked me if any one was there, and I replied that I could see no one - about. He then took the body of the deceased from the loft, and - having wrapped it up in his saree, asked me to accompany him to the - steps of the quarry, and I did so. The 'saree' now produced here - was the same. Besides the 'saree', there was also a 'cholee' on the - body. He then carried the body in his arms, and went up the steps, - through the stable, and then to the right hand towards a Sahib's - bungalow, where Tookaram placed the body near a wall. All the time - I and my mother were with him. When the body was taken down, Yessoo - was lying on the cot. After depositing the body under the wall, we - all returned home, and soon after 5 a.m. the police again came and - took Tookaram away. About an hour after they returned and took me - and my mother away. We were questioned about it, when I made a - statement. Two hours later I was taken to the room, and I pointed - out this waistband, the 'dhotur', the mattress, and the wooden post - to Superintendent Nolan and Inspectors Roberts and Rashanali, in the - presence of my mother and Tookaram. Tookaram killed the girl Cassi - for her ornaments, which he wanted for the girl to whom he was - shortly going to be married. The body was found in the same place - where it was deposited by Tookaram." - -The criminal side of the native has always been picturesque, always -readable. The Thuggee and one or two other particularly outrageous -features of it have been suppressed by the English, but there is enough -of it left to keep it darkly interesting. One finds evidence of these -survivals in the newspapers. Macaulay has a light-throwing passage upon -this matter in his great historical sketch of Warren Hastings, where he -is describing some effects which followed the temporary paralysis of -Hastings' powerful government brought about by Sir Philip Francis and his -party: - - "The natives considered Hastings as a fallen man; and they acted - after their kind. Some of our readers may have seen, in India, a - cloud of crows pecking a sick vulture to death--no bad type of what - happens in that country as often as fortune deserts one who has been - great and dreaded. In an instant all the sycophants, who had lately - been ready to lie for him, to forge for him, to pander for him, to - poison for him, hasten to purchase the favor of his victorious - enemies by accusing him. An Indian government has only to let it be - understood that it wishes a particular man to be ruined, and in - twenty-four hours it will be furnished with grave charges, supported - by depositions so full and circumstantial that any person - unaccustomed to Asiatic mendacity would regard them as decisive. It - is well if the signature of the destined victim is not counterfeited - at the foot of some illegal compact, and if some treasonable paper - is not slipped into a hiding-place in his house." - -That was nearly a century and a quarter ago. An article in one of the -chief journals of India (the Pioneer) shows that in some respects the -native of to-day is just what his ancestor was then. Here are niceties -of so subtle and delicate a sort that they lift their breed of rascality -to a place among the fine arts, and almost entitle it to respect: - - "The records of the Indian courts might certainly be relied upon to - prove that swindlers as a class in the East come very close to, if - they do not surpass, in brilliancy of execution and originality of - design the most expert of their fraternity in Europe and America. - India in especial is the home of forgery. There are some particular - districts which are noted as marts for the finest specimens of the - forger's handiwork. The business is carried on by firms who possess - stores of stamped papers to suit every emergency. They habitually - lay in a store of fresh stamped papers every year, and some of the - older and more thriving houses can supply documents for the past - forty years, bearing the proper water-mark and possessing the - genuine appearance of age. Other districts have earned notoriety - for skilled perjury, a pre-eminence that excites a respectful - admiration when one thinks of the universal prevalence of the art, - and persons desirous of succeeding in false suits are ready to pay - handsomely to avail themselves of the services of these local - experts as witnesses." - -Various instances illustrative of the methods of these swindlers are -given. They exhibit deep cunning and total depravity on the part of the -swindler and his pals, and more obtuseness on the part of the victim than -one would expect to find in a country where suspicion of your neighbor -must surely be one of the earliest things learned. The favorite subject -is the young fool who has just come into a fortune and is trying to see -how poor a use he can put it to. I will quote one example: - - "Sometimes another form of confidence trick is adopted, which is - invariably successful. The particular pigeon is spotted, and, his - acquaintance having been made, he is encouraged in every form of - vice. When the friendship is thoroughly established, the swindler - remarks to the young man that he has a brother who has asked him to - lend him Rs.10,000. The swindler says he has the money and would - lend it; but, as the borrower is his brother, he cannot charge - interest. So he proposes that he should hand the dupe the money, - and the latter should lend it to the swindler's brother, exacting a - heavy pre-payment of interest which, it is pointed out, they may - equally enjoy in dissipation. The dupe sees no objection, and on - the appointed day receives Rs.7,000 from the swindler, which he - hands over to the confederate. The latter is profuse in his thanks, - and executes a promissory note for Rs.10,000, payable to bearer. - The swindler allows the scheme to remain quiescent for a time, and - then suggests that, as the money has not been repaid and as it would - be unpleasant to sue his brother, it would be better to sell the - note in the bazaar. The dupe hands the note over, for the money he - advanced was not his, and, on being informed that it would be - necessary to have his signature on the back so as to render the - security negotiable, he signs without any hesitation. The swindler - passes it on to confederates, and the latter employ a respectable - firm of solicitors to ask the dupe if his signature is genuine. He - admits it at once, and his fate is sealed. A suit is filed by a - confederate against the dupe, two accomplices being made - co-defendants. They admit their Signatures as indorsers, and the - one swears he bought the note for value from the dupe. The latter - has no defense, for no court would believe the apparently idle - explanation of the manner in which he came to endorse the note." - -There is only one India! It is the only country that has a monopoly of -grand and imposing specialties. When another country has a remarkable -thing, it cannot have it all to itself--some other country has a -duplicate. But India--that is different. Its marvels are its own; the -patents cannot be infringed; imitations are not possible. And think of -the size of them, the majesty of them, the weird and outlandish character -of the most of them! - -There is the Plague, the Black Death: India invented it; India is the -cradle of that mighty birth. - -The Car of Juggernaut was India's invention. - -So was the Suttee; and within the time of men still living eight hundred -widows willingly, and, in fact, rejoicingly, burned themselves to death -on the bodies of their dead husbands in a single year. Eight hundred -would do it this year if the British government would let them. - -Famine is India's specialty. Elsewhere famines are inconsequential -incidents--in India they are devastating cataclysms; in one case they -annihilate hundreds; in the other, millions. - -India had 2,000,000 gods, and worships them all. In religion all other -countries are paupers; India is the only millionaire. - -With her everything is on a giant scale--even her poverty; no other -country can show anything to compare with it. And she has been used to -wealth on so vast a scale that she has to shorten to single words the -expressions describing great sums. She describes 100,000 with one word ---a 'lahk'; she describes ten millions with one word--a 'crore'. - -In the bowels of the granite mountains she has patiently carved out -dozens of vast temples, and made them glorious with sculptured colonnades -and stately groups of statuary, and has adorned the eternal walls with -noble paintings. She has built fortresses of such magnitude that the -show-strongholds of the rest of the world are but modest little things by -comparison; palaces that are wonders for rarity of materials, delicacy -and beauty of workmanship, and for cost; and one tomb which men go around -the globe to see. It takes eighty nations, speaking eighty languages, to -people her, and they number three hundred millions. - -On top of all this she is the mother and home of that wonder of wonders -caste--and of that mystery of mysteries, the satanic brotherhood of the -Thugs. - -India had the start of the whole world in the beginning of things. She -had the first civilization; she had the first accumulation of material -wealth; she was populous with deep thinkers and subtle intellects; she -had mines, and woods, and a fruitful soil. It would seem as if she -should have kept the lead, and should be to-day not the meek dependent of -an alien master, but mistress of the world, and delivering law and -command to every tribe and nation in it. But, in truth, there was never -any possibility of such supremacy for her. If there had been but one -India and one language--but there were eighty of them! Where there are -eighty nations and several hundred governments, fighting and quarreling -must be the common business of life; unity of purpose and policy are -impossible; out of such elements supremacy in the world cannot come. -Even caste itself could have had the defeating effect of a multiplicity -of tongues, no doubt; for it separates a people into layers, and layers, -and still other layers, that have no community of feeling with each -other; and in such a condition of things as that, patriotism can have no -healthy growth. - -It was the division of the country into so many States and nations that -made Thuggee possible and prosperous. It is difficult to realize the -situation. But perhaps one may approximate it by imagining the States of -our Union peopled by separate nations, speaking separate languages, with -guards and custom-houses strung along all frontiers, plenty of -interruptions for travelers and traders, interpreters able to handle all -the languages very rare or non-existent, and a few wars always going on -here and there and yonder as a further embarrassment to commerce and -excursioning. It would make intercommunication in a measure ungeneral. -India had eighty languages, and more custom-houses than cats. No clever -man with the instinct of a highway robber could fail to notice what a -chance for business was here offered. India was full of clever men with -the highwayman instinct, and so, quite naturally, the brotherhood of the -Thugs came into being to meet the long-felt want. - -How long ago that was nobody knows-centuries, it is supposed. One of the -chiefest wonders connected with it was the success with which it kept its -secret. The English trader did business in India two hundred years and -more before he ever heard of it; and yet it was assassinating its -thousands all around him every year, the whole time. - - - - -CHAPTER XLIV. - -The old saw says, "Let a sleeping dog lie." Right.... Still, when there -is much at stake it is better to get a newspaper to do it. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -January 28. I learned of an official Thug-book the other day. I was -not aware before that there was such a thing. I am allowed the temporary -use of it. We are making preparations for travel. Mainly the -preparations are purchases of bedding. This is to be used in sleeping -berths in the trains; in private houses sometimes; and in nine-tenths of -the hotels. It is not realizable; and yet it is true. It is a survival; -an apparently unnecessary thing which in some strange way has outlived -the conditions which once made it necessary. It comes down from a time -when the railway and the hotel did not exist; when the occasional white -traveler went horseback or by bullock-cart, and stopped over night in the -small dak-bungalow provided at easy distances by the government--a -shelter, merely, and nothing more. He had to carry bedding along, or do -without. The dwellings of the English residents are spacious and -comfortable and commodiously furnished, and surely it must be an odd -sight to see half a dozen guests come filing into such a place and -dumping blankets and pillows here and there and everywhere. But custom -makes incongruous things congruous. - -One buys the bedding, with waterproof hold-all for it at almost any shop ---there is no difficulty about it. - -January 30. What a spectacle the railway station was, at train-time! It -was a very large station, yet when we arrived it seemed as if the whole -world was present--half of it inside, the other half outside, and both -halves, bearing mountainous head-loads of bedding and other freight, -trying simultaneously to pass each other, in opposing floods, in one -narrow door. These opposing floods were patient, gentle, long-suffering -natives, with whites scattered among them at rare intervals; and wherever -a white man's native servant appeared, that native seemed to have put -aside his natural gentleness for the time and invested himself with the -white man's privilege of making a way for himself by promptly shoving all -intervening black things out of it. In these exhibitions of authority -Satan was scandalous. He was probably a Thug in one of his former -incarnations. - -Inside the great station, tides upon tides of rainbow-costumed natives -swept along, this way and that, in massed and bewildering confusion, -eager, anxious, belated, distressed; and washed up to the long trains and -flowed into them with their packs and bundles, and disappeared, followed -at once by the next wash, the next wave. And here and there, in the -midst of this hurly-burly, and seemingly undisturbed by it, sat great -groups of natives on the bare stone floor,--young, slender brown women, -old, gray wrinkled women, little soft brown babies, old men, young men, -boys; all poor people, but all the females among them, both big and -little, bejeweled with cheap and showy nose-rings, toe-rings, leglets, -and armlets, these things constituting all their wealth, no doubt. These -silent crowds sat there with their humble bundles and baskets and small -household gear about them, and patiently waited--for what? A train that -was to start at some time or other during the day or night! They hadn't -timed themselves well, but that was no matter--the thing had been so -ordered from on high, therefore why worry? There was plenty of time, -hours and hours of it, and the thing that was to happen would happen ---there was no hurrying it. - -The natives traveled third class, and at marvelously cheap rates. They -were packed and crammed into cars that held each about fifty; and it was -said that often a Brahmin of the highest caste was thus brought into -personal touch, and consequent defilement, with persons of the lowest -castes--no doubt a very shocking thing if a body could understand it and -properly appreciate it. Yes, a Brahmin who didn't own a rupee and -couldn't borrow one, might have to touch elbows with a rich hereditary -lord of inferior caste, inheritor of an ancient title a couple of yards -long, and he would just have to stand it; for if either of the two was -allowed to go in the cars where the sacred white people were, it probably -wouldn't be the august poor Brahmin. There was an immense string of -those third-class cars, for the natives travel by hordes; and a weary -hard night of it the occupants would have, no doubt. - -When we reached our car, Satan and Barney had already arrived there with -their train of porters carrying bedding and parasols and cigar boxes, and -were at work. We named him Barney for short; we couldn't use his real -name, there wasn't time. - -It was a car that promised comfort; indeed, luxury. Yet the cost of it ---well, economy could no further go; even in France; not even in Italy. It -was built of the plainest and cheapest partially-smoothed boards, with a -coating of dull paint on them, and there was nowhere a thought of -decoration. The floor was bare, but would not long remain so when the -dust should begin to fly. Across one end of the compartment ran a -netting for the accommodation of hand-baggage; at the other end was a -door which would shut, upon compulsion, but wouldn't stay shut; it opened -into a narrow little closet which had a wash-bowl in one end of it, and a -place to put a towel, in case you had one with you--and you would be sure -to have towels, because you buy them with the bedding, knowing that the -railway doesn't furnish them. On each side of the car, and running fore -and aft, was a broad leather-covered sofa to sit on in the day and sleep -on at night. Over each sofa hung, by straps, a wide, flat, -leather-covered shelf--to sleep on. In the daytime you can hitch it up -against the wall, out of the way--and then you have a big unencumbered -and most comfortable room to spread out in. No car in any country is -quite its equal for comfort (and privacy) I think. For usually there are -but two persons in it; and even when there are four there is but little -sense of impaired privacy. Our own cars at home can surpass the railway -world in all details but that one: they have no cosiness; there are too -many people together. - -At the foot of each sofa was a side-door, for entrance and exit. -Along the whole length of the sofa on each side of the car ran a row of -large single-plate windows, of a blue tint-blue to soften the bitter -glare of the sun and protect one's eyes from torture. These could be let -down out of the way when one wanted the breeze. In the roof were two oil -lamps which gave a light strong enough to read by; each had a green-cloth -attachment by which it could be covered when the light should be no -longer needed. - -While we talked outside with friends, Barney and Satan placed the -hand-baggage, books, fruits, and soda-bottles in the racks, and the -hold-alls and heavy baggage in the closet, hung the overcoats and -sun-helmets and towels on the hooks, hoisted the two bed-shelves up out -of the way, then shouldered their bedding and retired to the third class. - -Now then, you see what a handsome, spacious, light, airy, homelike place -it was, wherein to walk up and down, or sit and write, or stretch out and -read and smoke. A central door in the forward end of the compartment -opened into a similar compartment. It was occupied by my wife and -daughter. About nine in the evening, while we halted a while at a -station, Barney and Satan came and undid the clumsy big hold-alls, and -spread the bedding on the sofas in both compartments--mattresses, sheets, -gay coverlets, pillows, all complete; there are no chambermaids in India ---apparently it was an office that was never heard of. Then they -closed the communicating door, nimbly tidied up our place, put the -night-clothing on the beds and the slippers under them, then returned -to their own quarters. - -January 31. It was novel and pleasant, and I stayed awake as long as I -could, to enjoy it, and to read about those strange people the Thugs. In -my sleep they remained with me, and tried to strangle me. The leader of -the gang was that giant Hindoo who was such a picture in the strong light -when we were leaving those Hindoo betrothal festivities at two o'clock in -the morning--Rao Bahadur Baskirao Balinkanje Pitale, Vakeel to the -Gaikwar of Baroda. It was he that brought me the invitation from his -master to go to Baroda and lecture to that prince--and now he was -misbehaving in my dreams. But all things can happen in dreams. It is -indeed as the Sweet Singer of Michigan says--irrelevantly, of course, for -the one and unfailing great quality which distinguishes her poetry from -Shakespeare's and makes it precious to us is its stern and simple -irrelevancy: - - My heart was gay and happy, - This was ever in my mind, - There is better times a coming, - And I hope some day to find - Myself capable of composing, - It was my heart's delight - To compose on a sentimental subject - If it came in my mind just right. - ---["The Sentimental Song Book," p. 49; theme, "The Author's Early Life," -19th stanza.] - - -Barroda. Arrived at 7 this morning. The dawn was just beginning to -show. It was forlorn to have to turn out in a strange place at such a -time, and the blinking lights in the station made it seem night still. -But the gentlemen who had come to receive us were there with their -servants, and they make quick work; there was no lost time. We were soon -outside and moving swiftly through the soft gray light, and presently -were comfortably housed--with more servants to help than we were used to, -and with rather embarassingly important officials to direct them. But it -was custom; they spoke Ballarat English, their bearing was charming and -hospitable, and so all went well. - -Breakfast was a satisfaction. Across the lawns was visible in the -distance through the open window an Indian well, with two oxen tramping -leisurely up and down long inclines, drawing water; and out of the -stillness came the suffering screech of the machinery--not quite musical, -and yet soothingly melancholy and dreamy and reposeful--a wail of lost -spirits, one might imagine. And commemorative and reminiscent, perhaps; -for of course the Thugs used to throw people down that well when they -were done with them. - -After breakfast the day began, a sufficiently busy one. We were driven -by winding roads through a vast park, with noble forests of great trees, -and with tangles and jungles of lovely growths of a humbler sort; and at -one place three large gray apes came out and pranced across the road--a -good deal of a surprise and an unpleasant one, for such creatures belong -in the menagerie, and they look artificial and out of place in a -wilderness. - -We came to the city, by and by, and drove all through it. Intensely -Indian, it was, and crumbly, and mouldering, and immemorially old, to all -appearance. And the houses--oh, indescribably quaint and curious they -were, with their fronts an elaborate lace-work of intricate and beautiful -wood-carving, and now and then further adorned with rude pictures of -elephants and princes and gods done in shouting colors; and all the -ground floors along these cramped and narrow lanes occupied as shops ---shops unbelievably small and impossibly packed with merchantable rubbish, -and with nine-tenths-naked natives squatting at their work of hammering, -pounding, brazing, soldering, sewing, designing, cooking, measuring out -grain, grinding it, repairing idols--and then the swarm of ragged and -noisy humanity under the horses' feet and everywhere, and the pervading -reek and fume and smell! It was all wonderful and delightful. - -Imagine a file of elephants marching through such a crevice of a street -and scraping the paint off both sides of it with their hides. How big -they must look, and how little they must make the houses look; and when -the elephants are in their glittering court costume, what a contrast they -must make with the humble and sordid surroundings. And when a mad -elephant goes raging through, belting right and left with his trunk, how -do these swarms of people get out of the way? I suppose it is a thing -which happens now and then in the mad season (for elephants have a mad -season). - -I wonder how old the town is. There are patches of building--massive -structures, monuments, apparently--that are so battered and worn, and -seemingly so tired and so burdened with the weight of age, and so dulled -and stupefied with trying to remember things they forgot before history -began, that they give one the feeling that they must have been a part of -original Creation. This is indeed one of the oldest of the princedoms of -India, and has always been celebrated for its barbaric pomps and -splendors, and for the wealth of its princes. - - - - -CHAPTER XLV. - -It takes your enemy and your friend, working together, to hurt you to the -heart; the one to slander you and the other to get the news to you. - --Pudd'nhead Wilson's New Calendar. - -Out of the town again; a long drive through open country, by winding -roads among secluded villages nestling in the inviting shade of tropic -vegetation, a Sabbath stillness everywhere, sometimes a pervading sense -of solitude, but always barefoot natives gliding by like spirits, without -sound of footfall, and others in the distance dissolving away and -vanishing like the creatures of dreams. Now and then a string of stately -camels passed by--always interesting things to look at--and they were -velvet-shod by nature, and made no noise. Indeed, there were no noises -of any sort in this paradise. Yes, once there was one, for a moment: a -file of native convicts passed along in charge of an officer, and we -caught the soft clink of their chains. In a retired spot, resting -himself under a tree, was a holy person--a naked black fakeer, thin and -skinny, and whitey-gray all over with ashes. - -By and by to the elephant stables, and I took a ride; but it was by -request--I did not ask for it, and didn't want it; but I took it, because -otherwise they would have thought I was afraid, which I was. The -elephant kneels down, by command--one end of him at a time--and you climb -the ladder and get into the howdah, and then he gets up, one end at a -time, just as a ship gets up over a wave; and after that, as he strides -monstrously about, his motion is much like a ship's motion. The mahout -bores into the back of his head with a great iron prod and you wonder at -his temerity and at the elephant's patience, and you think that perhaps -the patience will not last; but it does, and nothing happens. The mahout -talks to the elephant in a low voice all the time, and the elephant seems -to understand it all and to be pleased with it; and he obeys every order -in the most contented and docile way. Among these twenty-five elephants -were two which were larger than any I had ever seen before, and if I had -thought I could learn to not be afraid, I would have taken one of them -while the police were not looking. - -In the howdah-house there were many howdahs that were made of silver, one -of gold, and one of old ivory, and equipped with cushions and canopies of -rich and costly stuffs. The wardrobe of the elephants was there, too; -vast velvet covers stiff and heavy with gold embroidery; and bells of -silver and gold; and ropes of these metals for fastening the things on -harness, so to speak; and monster hoops of massive gold for the elephant -to wear on his ankles when he is out in procession on business of state. - -But we did not see the treasury of crown jewels, and that was a -disappointment, for in mass and richness it ranks only second in India. -By mistake we were taken to see the new palace instead, and we used up -the last remnant of our spare time there. It was a pity, too; for the -new palace is mixed modern American-European, and has not a merit except -costliness. It is wholly foreign to India, and impudent and out of -place. The architect has escaped. This comes of overdoing the -suppression of the Thugs; they had their merits. The old palace is -oriental and charming, and in consonance with the country. The old -palace would still be great if there were nothing of it but the spacious -and lofty hall where the durbars are held. It is not a good place to -lecture in, on account of the echoes, but it is a good place to hold -durbars in and regulate the affairs of a kingdom, and that is what it is -for. If I had it I would have a durbar every day, instead of once or -twice a year. - -The prince is an educated gentleman. His culture is European. He has -been in Europe five times. People say that this is costly amusement for -him, since in crossing the sea he must sometimes be obliged to drink -water from vessels that are more or less public, and thus damage his -caste. To get it purified again he must make pilgrimage to some renowned -Hindoo temples and contribute a fortune or two to them. His people are -like the other Hindoos, profoundly religious; and they could not be -content with a master who was impure. - -We failed to see the jewels, but we saw the gold cannon and the silver -one--they seemed to be six-pounders. They were not designed for -business, but for salutes upon rare and particularly important state -occasions. An ancestor of the present Gaikwar had the silver one made, -and a subsequent ancestor had the gold one made, in order to outdo him. - -This sort of artillery is in keeping with the traditions of Baroda, which -was of old famous for style and show. It used to entertain visiting -rajahs and viceroys with tiger-fights, elephant-fights, illuminations, -and elephant-processions of the most glittering and gorgeous character. - -It makes the circus a pale, poor thing. - -In the train, during a part of the return journey from Baroda, we had the -company of a gentleman who had with him a remarkable looking dog. I had -not seen one of its kind before, as far as I could remember; though of -course I might have seen one and not noticed it, for I am not acquainted -with dogs, but only with cats. This dog's coat was smooth and shiny and -black, and I think it had tan trimmings around the edges of the dog, and -perhaps underneath. It was a long, low dog, with very short, strange -legs--legs that curved inboard, something like parentheses wrong way (. -Indeed, it was made on the plan of a bench for length and lowness. It -seemed to be satisfied, but I thought the plan poor, and structurally -weak, on account of the distance between the forward supports and those -abaft. With age the dog's back was likely to sag; and it seemed to me -that it would have been a stronger and more practicable dog if it had had -some more legs. It had not begun to sag yet, but the shape of the legs -showed that the undue weight imposed upon them was beginning to tell. -It had a long nose, and floppy ears that hung down, and a resigned -expression of countenance. I did not like to ask what kind of a dog it -was, or how it came to be deformed, for it was plain that the gentleman -was very fond of it, and naturally he could be sensitive about it. From -delicacy I thought it best not to seem to notice it too much. No doubt a -man with a dog like that feels just as a person does who has a child that -is out of true. The gentleman was not merely fond of the dog, he was -also proud of it--just the same again, as a mother feels about her -child when it is an idiot. I could see that he was proud of it, -not-withstanding it was such a long dog and looked so resigned and pious. -It had been all over the world with him, and had been pilgriming like -that for years and years. It had traveled 50,000 miles by sea and rail, -and had ridden in front of him on his horse 8,000. It had a silver medal -from the Geographical Society of Great Britain for its travels, and I saw -it. It had won prizes in dog shows, both in India and in England--I saw -them. He said its pedigree was on record in the Kennel Club, and that it -was a well-known dog. He said a great many people in London could -recognize it the moment they saw it. I did not say anything, but I did -not think it anything strange; I should know that dog again, myself, yet -I am not careful about noticing dogs. He said that when he walked along -in London, people often stopped and looked at the dog. Of course I did -not say anything, for I did not want to hurt his feelings, but I could -have explained to him that if you take a great long low dog like that and -waddle it along the street anywhere in the world and not charge anything, -people will stop and look. He was gratified because the dog took prizes. -But that was nothing; if I were built like that I could take prizes -myself. I wished I knew what kind of a dog it was, and what it was for, -but I could not very well ask, for that would show that I did not know. -Not that I want a dog like that, but only to know the secret of its -birth. - -I think he was going to hunt elephants with it, because I know, from -remarks dropped by him, that he has hunted large game in India and -Africa, and likes it. But I think that if he tries to hunt elephants -with it, he is going to be disappointed. - -I do not believe that it is suited for elephants. It lacks energy, it -lacks force of character, it lacks bitterness. These things all show in -the meekness and resignation of its expression. It would not attack an -elephant, I am sure of it. It might not run if it saw one coming, but it -looked to me like a dog that would sit down and pray. - -I wish he had told me what breed it was, if there are others; but I shall -know the dog next time, and then if I can bring myself to it I will put -delicacy aside and ask. If I seem strangely interested in dogs, I have a -reason for it; for a dog saved me from an embarrassing position once, and -that has made me grateful to these animals; and if by study I could learn -to tell some of the kinds from the others, I should be greatly pleased. -I only know one kind apart, yet, and that is the kind that saved me that -time. I always know that kind when I meet it, and if it is hungry or -lost I take care of it. The matter happened in this way - -It was years and years ago. I had received a note from Mr. Augustin Daly -of the Fifth Avenue Theatre, asking me to call the next time I should be -in New York. I was writing plays, in those days, and he was admiring -them and trying to get me a chance to get them played in Siberia. I took -the first train--the early one--the one that leaves Hartford at 8.29 in -the morning. At New Haven I bought a paper, and found it filled with -glaring display-lines about a "bench-show" there. I had often heard of -bench-shows, but had never felt any interest in them, because I supposed -they were lectures that were not well attended. It turned out, now, that -it was not that, but a dog-show. There was a double-leaded column about -the king-feature of this one, which was called a Saint Bernard, and was -worth $10,000, and was known to be the largest and finest of his species -in the world. I read all this with interest, because out of my -school-boy readings I dimly remembered how the priests and pilgrims of -St. Bernard used to go out in the storms and dig these dogs out of the -snowdrifts when lost and exhausted, and give them brandy and save their -lives, and drag them to the monastery and restore them with gruel. - -Also, there was a picture of this prize-dog in the paper, a noble great -creature with a benignant countenance, standing by a table. He was -placed in that way so that one could get a right idea of his great -dimensions. You could see that he was just a shade higher than the -table--indeed, a huge fellow for a dog. Then there was a description -which event into the details. It gave his enormous weight--150 1/2 -pounds, and his length 4 feet 2 inches, from stem to stern-post; and his -height--3 feet 1 inch, to the top of his back. The pictures and the -figures so impressed me, that I could see the beautiful colossus before -me, and I kept on thinking about him for the next two hours; then I -reached New York, and he dropped out of my mind. - -In the swirl and tumult of the hotel lobby I ran across Mr. Daly's -comedian, the late James Lewis, of beloved memory, and I casually -mentioned that I was going to call upon Mr. Daly in the evening at 8. -He looked surprised, and said he reckoned not. For answer I handed him -Mr. Daly's note. Its substance was: "Come to my private den, over the -theater, where we cannot be interrupted. And come by the back way, not -the front. No. 642 Sixth Avenue is a cigar shop; pass through it and you -are in a paved court, with high buildings all around; enter the second -door on the left, and come up stairs." - -"Is this all?" - -"Yes," I said. - -"Well, you'll never get in" - -"Why?" - -"Because you won't. Or if you do you can draw on me for a hundred -dollars; for you will be the first man that has accomplished it in -twenty-five years. I can't think what Mr. Daly can have been absorbed -in. He has forgotten a most important detail, and he will feel -humiliated in the morning when he finds that you tried to get in and -couldn't." - -"Why, what is the trouble?" - -"I'll tell you. You see----" - -At that point we were swept apart by the crowd, somebody detained me with -a moment's talk, and we did not get together again. But it did not -matter; I believed he was joking, anyway. - -At eight in the evening I passed through the cigar shop and into the -court and knocked at the second door. - -"Come in!" - -I entered. It was a small room, carpetless, dusty, with a naked deal -table, and two cheap wooden chairs for furniture. A giant Irishman was -standing there, with shirt collar and vest unbuttoned, and no coat on. I -put my hat on the table, and was about to say something, when the -Irishman took the innings himself. And not with marked courtesy of tone: - -"Well, sor, what will you have?" - -I was a little disconcerted, and my easy confidence suffered a shrinkage. -The man stood as motionless as Gibraltar, and kept his unblinking eye -upon me. It was very embarrassing, very humiliating. I stammered at a -false start or two; then---- - -"I have just run down from----" - -"Av ye plaze, ye'll not smoke here, ye understand." - -I laid my cigar on the window-ledge; chased my flighty thoughts a moment, -then said in a placating manner: - -"I--I have come to see Mr. Daly." - -"Oh, ye have, have ye?" - -"Yes" - -"Well, ye'll not see him." - -"But he asked me to come." - -"Oh, he did, did he?" - -"Yes, he sent me this note, and----" - -"Lemme see it." - -For a moment I fancied there would be a change in the atmosphere, now; -but this idea was premature. The big man was examining the note -searchingly under the gas-jet. A glance showed me that he had it upside -down--disheartening evidence that he could not read. - -"Is ut his own handwrite?" - -"Yes--he wrote it himself." - -"He did, did he?" - -"Yes." - -"H'm. Well, then, why ud he write it like that?" - -"How do you mean?" - -"I mane, why wudn't he put his naime to ut?" - -"His name is to it. That's not it--you are looking at my name." - -I thought that that was a home shot, but he did not betray that he had -been hit. He said: - -"It's not an aisy one to spell; how do you pronounce ut?" - -"Mark Twain." - -"H'm. H'm. Mike Train. H'm. I don't remember ut. What is it ye want -to see him about?" - -"It isn't I that want to see him, he wants to see me." - -"Oh, he does, does he?" - -"Yes." - -"What does he want to see ye about?" - -"I don't know." - -"Ye don't know! And ye confess it, becod! Well, I can tell ye wan -thing--ye'll not see him. Are ye in the business?" - -"What business?" - -"The show business." - -A fatal question. I recognized that I was defeated. If I answered no, -he would cut the matter short and wave me to the door without the grace -of a word--I saw it in his uncompromising eye; if I said I was a -lecturer, he would despise me, and dismiss me with opprobrious words; if -I said I was a dramatist, he would throw me out of the window. I saw -that my case was hopeless, so I chose the course which seemed least -humiliating: I would pocket my shame and glide out without answering. -The silence was growing lengthy. - -"I'll ask ye again. Are ye in the show business yerself?" - -"Yes!" - -I said it with splendid confidence; for in that moment the very twin of -that grand New Haven dog loafed into the room, and I saw that Irishman's -eye light eloquently with pride and affection. - -"Ye are? And what is it?" - -"I've got a bench-show in New Haven." - -The weather did change then. - -"You don't say, sir! And that's your show, sir! Oh, it's a grand show, -it's a wonderful show, sir, and a proud man I am to see your honor this -day. And ye'll be an expert, sir, and ye'll know all about dogs--more -than ever they know theirselves, I'll take me oath to ut." - -I said, with modesty: - -"I believe I have some reputation that way. In fact, my business -requires it." - -"Ye have some reputation, your honor! Bedad I believe you! There's not -a jintleman in the worrld that can lay over ye in the judgmint of a dog, -sir. Now I'll vinture that your honor'll know that dog's dimensions -there better than he knows them his own self, and just by the casting of -your educated eye upon him. Would you mind giving a guess, if ye'll be -so good?" - -I knew that upon my answer would depend my fate. If I made this dog -bigger than the prize-dog, it would be bad diplomacy, and suspicious; if -I fell too far short of the prizedog, that would be equally damaging. -The dog was standing by the table, and I believed I knew the difference -between him and the one whose picture I had seen in the newspaper to a -shade. I spoke promptly up and said: - -"It's no trouble to guess this noble creature's figures height, three -feet; length, four feet and three-quarters of an inch; weight, a hundred -and forty-eight and a quarter." - -The man snatched his hat from its peg and danced on it with joy, -shouting: - -"Ye've hardly missed it the hair's breadth, hardly the shade of a shade, -your honor! Oh, it's the miraculous eye ye've got, for the judgmint of a -dog!" - -And still pouring out his admiration of my capacities, he snatched off -his vest and scoured off one of the wooden chairs with it, and scrubbed -it and polished it, and said: - -"There, sit down, your honor, I'm ashamed of meself that I forgot ye were -standing all this time; and do put on your hat, ye mustn't take cold, -it's a drafty place; and here is your cigar, sir, a getting cold, I'll -give ye a light. There. The place is all yours, sir, and if ye'll just -put your feet on the table and make yourself at home, I'll stir around -and get a candle and light ye up the ould crazy stairs and see that ye -don't come to anny harm, for be this time Mr. Daly'll be that impatient -to see your honor that he'll be taking the roof off." - -He conducted me cautiously and tenderly up the stairs, lighting the way -and protecting me with friendly warnings, then pushed the door open and -bowed me in and went his way, mumbling hearty things about my wonderful -eye for points of a dog. Mr. Daly was writing and had his back to me. -He glanced over his shoulder presently, then jumped up and said-- - -"Oh, dear me, I forgot all about giving instructions. I was just writing -you to beg a thousand pardons. But how is it you are here? How did you -get by that Irishman? You are the first man that's done it in five and -twenty years. You didn't bribe him, I know that; there's not money -enough in New York to do it. And you didn't persuade him; he is all ice -and iron: there isn't a soft place nor a warm one in him anywhere. That -is your secret? Look here; you owe me a hundred dollars for -unintentionally giving you a chance to perform a miracle--for it is a -miracle that you've done." - -"That is all right," I said, "collect it of Jimmy Lewis." - -That good dog not only did me that good turn in the time of my need, but -he won for me the envious reputation among all the theatrical people from -the Atlantic to the Pacific of being the only man in history who had ever -run the blockade of Augustin Daly's back door. - - - - -CHAPTER XLVI. - -If the desire to kill and the opportunity to kill came always together, -who would escape hanging. - --Pudd'nhead Wilson's New Calendar. - -On the Train. Fifty years ago, when I was a boy in the then remote and -sparsely peopled Mississippi valley, vague tales and rumors of a -mysterious body of professional murderers came wandering in from a -country which was constructively as far from us as the constellations -blinking in space--India; vague tales and rumors of a sect called Thugs, -who waylaid travelers in lonely places and killed them for the -contentment of a god whom they worshiped; tales which everybody liked to -listen to and nobody believed, except with reservations. It was -considered that the stories had gathered bulk on their travels. The -matter died down and a lull followed. Then Eugene Sue's "Wandering Jew" -appeared, and made great talk for a while. One character in it was a -chief of Thugs--"Feringhea"--a mysterious and terrible Indian who was as -slippery and sly as a serpent, and as deadly; and he stirred up the Thug -interest once more. But it did not last. It presently died again this -time to stay dead. - -At first glance it seems strange that this should have happened; but -really it was not strange--on the contrary,. it was natural; I mean on -our side of the water. For the source whence the Thug tales mainly came -was a Government Report, and without doubt was not republished in -America; it was probably never even seen there. Government Reports have -no general circulation. They are distributed to the few, and are not -always read by those few. I heard of this Report for the first time a -day or two ago, and borrowed it. It is full of fascinations; and it -turns those dim, dark fairy tales of my boyhood days into realities. - -The Report was made in 1889 by Major Sleeman, of the Indian Service, and -was printed in Calcutta in 1840. It is a clumsy, great, fat, poor sample -of the printer's art, but good enough for a government printing-office in -that old day and in that remote region, perhaps. To Major Sleeman was -given the general superintendence of the giant task of ridding India of -Thuggee, and he and his seventeen assistants accomplished it. It was the -Augean Stables over again. Captain Vallancey, writing in a Madras -journal in those old times, makes this remark: - - "The day that sees this far-spread evil eradicated from India and - known only in name, will greatly tend to immortalize British rule in - the East." - -He did not overestimate the magnitude and difficulty of the work, nor the -immensity of the credit which would justly be due to British rule in case -it was accomplished. - -Thuggee became known to the British authorities in India about 1810, but -its wide prevalence was not suspected; it was not regarded as a serious -matter, and no systematic measures were taken for its suppression until -about 1830. About that time Major Sleeman captured Eugene Sue's -Thug-chief, "Feringhea," and got him to turn King's evidence. The -revelations were so stupefying that Sleeman was not able to believe them. -Sleeman thought he knew every criminal within his jurisdiction, and that -the worst of them were merely thieves; but Feringhea told him that he was -in reality living in the midst of a swarm of professional murderers; that -they had been all about him for many years, and that they buried their -dead close by. These seemed insane tales; but Feringhea said come and -see--and he took him to a grave and dug up a hundred bodies, and told him -all the circumstances of the killings, and named the Thugs who had done -the work. It was a staggering business. Sleeman captured some of these -Thugs and proceeded to examine them separately, and with proper -precautions against collusion; for he would not believe any Indian's -unsupported word. The evidence gathered proved the truth of what -Feringhea had said, and also revealed the fact that gangs of Thugs were -plying their trade all over India. The astonished government now took -hold of Thuggee, and for ten years made systematic and relentless war -upon it, and finally destroyed it. Gang after gang was captured, tried, -and punished. The Thugs were harried and hunted from one end of India to -the other. The government got all their secrets out of them; and also -got the names of the members of the bands, and recorded them in a book, -together with their birthplaces and places of residence. - -The Thugs were worshipers of Bhowanee; and to this god they sacrificed -anybody that came handy; but they kept the dead man's things themselves, -for the god cared for nothing but the corpse. Men were initiated into -the sect with solemn ceremonies. Then they were taught how to strangle a -person with the sacred choke-cloth, but were not allowed to perform -officially with it until after long practice. No half-educated strangler -could choke a man to death quickly enough to keep him from uttering a -sound--a muffled scream, gurgle, gasp, moan, or something of the sort; -but the expert's work was instantaneous: the cloth was whipped around the -victim's neck, there was a sudden twist, and the head fell silently -forward, the eyes starting from the sockets; and all was over. The Thug -carefully guarded against resistance. It was usual to to get the victims -to sit down, for that was the handiest position for business. - -If the Thug had planned India itself it could not have been more -conveniently arranged for the needs of his occupation. - -There were no public conveyances. There were no conveyances for hire. -The traveler went on foot or in a bullock cart or on a horse which he -bought for the purpose. As soon as he was out of his own little State or -principality he was among strangers; nobody knew him, nobody took note of -him, and from that time his movements could no longer be traced. He did -not stop in towns or villages, but camped outside of them and sent his -servants in to buy provisions. There were no habitations between -villages. Whenever he was between villages he was an easy prey, -particularly as he usually traveled by night, to avoid the heat. He was -always being overtaken by strangers who offered him the protection of -their company, or asked for the protection of his--and these strangers -were often Thugs, as he presently found out to his cost. The -landholders, the native police, the petty princes, the village officials, -the customs officers were in many cases protectors and harborers of the -Thugs, and betrayed travelers to them for a share of the spoil. At first -this condition of things made it next to impossible for the government to -catch the marauders; they were spirited away by these watchful friends. -All through a vast continent, thus infested, helpless people of every -caste and kind moved along the paths and trails in couples and groups -silently by night, carrying the commerce of the country--treasure, -jewels, money, and petty batches of silks, spices, and all manner of -wares. It was a paradise for the Thug. - -When the autumn opened, the Thugs began to gather together by -pre-concert. Other people had to have interpreters at every turn, but -not the Thugs; they could talk together, no matter how far apart they -were born, for they had a language of their own, and they had secret -signs by which they knew each other for Thugs; and they were always -friends. Even their diversities of religion and caste were sunk in -devotion to their calling, and the Moslem and the high-caste and -low-caste Hindoo were staunch and affectionate brothers in Thuggery. - -When a gang had been assembled, they had religious worship, and waited -for an omen. They had definite notions about the omens. The cries of -certain animals were good omens, the cries of certain other creatures -were bad omens. A bad omen would stop proceedings and send the men home. - -The sword and the strangling-cloth were sacred emblems. The Thugs -worshiped the sword at home before going out to the assembling-place; the -strangling-cloth was worshiped at the place of assembly. The chiefs of -most of the bands performed the religious ceremonies themselves; but the -Kaets delegated them to certain official stranglers (Chaurs). The rites -of the Kaets were so holy that no one but the Chaur was allowed to touch -the vessels and other things used in them. - -Thug methods exhibit a curious mixture of caution and the absence of it; -cold business calculation and sudden, unreflecting impulse; but there -were two details which were constant, and not subject to caprice: patient -persistence in following up the prey, and pitilessness when the time came -to act. - -Caution was exhibited in the strength of the bands. They never felt -comfortable and confident unless their strength exceeded that of any -party of travelers they were likely to meet by four or fivefold. Yet it -was never their purpose to attack openly, but only when the victims were -off their guard. When they got hold of a party of travelers they often -moved along in their company several days, using all manner of arts to -win their friendship and get their confidence. At last, when this was -accomplished to their satisfaction, the real business began. A few Thugs -were privately detached and sent forward in the dark to select a good -killing-place and dig the graves. When the rest reached the spot a halt -was called, for a rest or a smoke. The travelers were invited to sit. -By signs, the chief appointed certain Thugs to sit down in front of the -travelers as if to wait upon them, others to sit down beside them and -engage them in conversation, and certain expert stranglers to stand -behind the travelers and be ready when the signal was given. The signal -was usually some commonplace remark, like "Bring the tobacco." Sometimes -a considerable wait ensued after all the actors were in their places--the -chief was biding his time, in order to make everything sure. Meantime, -the talk droned on, dim figures moved about in the dull light, peace and -tranquility reigned, the travelers resigned themselves to the pleasant -reposefulness and comfort of the situation, unconscious of the -death-angels standing motionless at their backs. The time was ripe, now, -and the signal came: "Bring the tobacco." There was a mute swift -movement, all in the same instant the men at each victim's sides seized -his hands, the man in front seized his feet, and pulled, the man at his -back whipped the cloth around his neck and gave it a twist the head sunk -forward, the tragedy was over. The bodies were stripped and covered up -in the graves, the spoil packed for transportation, then the Thugs gave -pious thanks to Bhowanee, and departed on further holy service. - -The Report shows that the travelers moved in exceedingly small groups ---twos, threes, fours, as a rule; a party with a dozen in it was rare. The -Thugs themselves seem to have been the only people who moved in force. -They went about in gangs of 10, 15, 25, 40, 60, 100, 150, 200, 250, and -one gang of 310 is mentioned. Considering their numbers, their catch was -not extraordinary--particularly when you consider that they were not in -the least fastidious, but took anybody they could get, whether rich or -poor, and sometimes even killed children. Now and then they killed -women, but it was considered sinful to do it, and unlucky. The "season" -was six or eight months long. One season the half dozen Bundelkand and -Gwalior gangs aggregated 712 men, and they murdered 210 people. One -season the Malwa and Kandeish gangs aggregated 702 men, and they murdered -232. One season the Kandeish and Berar gangs aggregated 963 men, and -they murdered 385 people. - -Here is the tally-sheet of a gang of sixty Thugs for a whole season--gang -under two noted chiefs, "Chotee and Sheik Nungoo from Gwalior": - - "Left Poora, in Jhansee, and on arrival at Sarora murdered a - traveler. - - "On nearly reaching Bhopal, met 3 Brahmins, and murdered them. - - "Cross the Nerbudda; at a village called Hutteea, murdered a Hindoo. - - "Went through Aurungabad to Walagow; there met a Havildar of the - barber caste and 5 sepoys (native soldiers); in the evening came to - Jokur, and in the morning killed them near the place where the - treasure-bearers were killed the year before. - - "Between Jokur and Dholeea met a sepoy of the shepherd caste; killed - him in the jungle. - - "Passed through Dholeea and lodged in a village; two miles beyond, - on the road to Indore, met a Byragee (beggar-holy mendicant); - murdered him at the Thapa. - - "In the morning, beyond the Thapa, fell in with 3 Marwarie - travelers; murdered them. - - "Near a village on the banks of the Taptee met 4 travelers and - killed them. - - "Between Choupra and Dhoreea met a Marwarie; murdered him. - - "At Dhoreea met 3 Marwaries; took them two miles and murdered them. - - "Two miles further on, overtaken by three treasure-bearers; took - them two miles and murdered them in the jungle. - - "Came on to Khurgore Bateesa in Indore, divided spoil, and - dispersed. - - "A total of 27 men murdered on one expedition." - -Chotee (to save his neck) was informer, and furnished these facts. -Several things are noticeable about his resume. 1. Business brevity; -2, absence of emotion; 3, smallness of the parties encountered by the 60; -4, variety in character and quality of the game captured; 5, Hindoo and -Mohammedan chiefs in business together for Bhowanee; 6, the sacred caste -of the Brahmins not respected by either; 7, nor yet the character of that -mendicant, that Byragee. - -A beggar is a holy creature, and some of the gangs spared him on that -account, no matter how slack business might be; but other gangs -slaughtered not only him, but even that sacredest of sacred creatures, -the fakeer--that repulsive skin-and-bone thing that goes around naked and -mats his bushy hair with dust and dirt, and so beflours his lean body -with ashes that he looks like a specter. Sometimes a fakeer trusted a -shade too far in the protection of his sacredness. In the middle of a -tally-sheet of Feringhea's, who had been out with forty Thugs, I find a -case of the kind. After the killing of thirty-nine men and one woman, -the fakeer appears on the scene: - - "Approaching Doregow, met 3 pundits; also a fakeer, mounted on a - pony; he was plastered over with sugar to collect flies, and was - covered with them. Drove off the fakeer, and killed the other - three. - - "Leaving Doregow, the fakeer joined again, and went on in company to - Raojana; met 6 Khutries on their way from Bombay to Nagpore. Drove - off the fakeer with stones, and killed the 6 men in camp, and buried - them in the grove. - - "Next day the fakeer joined again; made him leave at Mana. Beyond - there, fell in with two Kahars and a sepoy, and came on towards the - place selected for the murder. When near it, the fakeer came again. - Losing all patience with him, gave Mithoo, one of the gang, 5 rupees - ($2.50) to murder him, and take the sin upon himself. All four were - strangled, including the fakeer. Surprised to find among the - fakeer's effects 30 pounds of coral, 350 strings of small pearls, 15 - strings of large pearls, and a gilt necklace." - -It it curious, the little effect that time has upon a really interesting -circumstance. This one, so old, so long ago gone down into oblivion, -reads with the same freshness and charm that attach to the news in the -morning paper; one's spirits go up, then down, then up again, following -the chances which the fakeer is running; now you hope, now you despair, -now you hope again; and at last everything comes out right, and you feel -a great wave of personal satisfaction go weltering through you, and -without thinking, you put out your hand to pat Mithoo on the back, when ---puff! the whole thing has vanished away, there is nothing there; Mithoo -and all the crowd have been dust and ashes and forgotten, oh, so many, -many, many lagging years! And then comes a sense of injury: you don't -know whether Mithoo got the swag, along with the sin, or had to divide up -the swag and keep all the sin himself. There is no literary art about a -government report. It stops a story right in the most interesting place. - -These reports of Thug expeditions run along interminably in one -monotonous tune: "Met a sepoy--killed him; met 5 pundits--killed them; -met 4 Rajpoots and a woman--killed them"--and so on, till the statistics -get to be pretty dry. But this small trip of Feringhea's Forty had some -little variety about it. Once they came across a man hiding in a grave ---a thief; he had stolen 1,100 rupees from Dhunroj Seith of Parowtee. -They strangled him and took the money. They had no patience with thieves. -They killed two treasure-bearers, and got 4,000 rupees. They came across -two bullocks "laden with copper pice," and killed the four drivers and -took the money. There must have been half a ton of it. I think it takes -a double handful of pice to make an anna, and 16 annas to make a rupee; -and even in those days the rupee was worth only half a dollar. Coming -back over their tracks from Baroda, they had another picturesque stroke -of luck: "'The Lohars of Oodeypore' put a traveler in their charge for -safety." Dear, dear, across this abyssmal gulf of time we still see -Feringhea's lips uncover his teeth, and through the dim haze we catch the -incandescent glimmer of his smile. He accepted that trust, good man; and -so we know what went with the traveler. - -Even Rajahs had no terrors for Feringhea; he came across an -elephant-driver belonging to the Rajah of Oodeypore and promptly -strangled him. - -"A total of 100 men and 5 women murdered on this expedition." - -Among the reports of expeditions we find mention of victims of almost -every quality and estate. - -Also a prince's cook; and even the water-carrier of that sublime lord of -lords and king of kings, the Governor-General of India! How broad they -were in their tastes! They also murdered actors--poor wandering -barnstormers. There are two instances recorded; the first one by a gang -of Thugs under a chief who soils a great name borne by a better man ---Kipling's deathless "Gungadin": - - "After murdering 4 sepoys, going on toward Indore, met 4 strolling - players, and persuaded them to come with us, on the pretense that we - would see their performance at the next stage. Murdered them at a - temple near Bhopal." - -Second instance: - - "At Deohuttee, joined by comedians. Murdered them eastward of that - place." - -But this gang was a particularly bad crew. On that expedition they -murdered a fakeer and twelve beggars. And yet Bhowanee protected them; -for once when they were strangling a man in a wood when a crowd was going -by close at hand and the noose slipped and the man screamed, Bhowanee -made a camel burst out at the same moment with a roar that drowned the -scream; and before the man could repeat it the breath was choked out of -his body. - -The cow is so sacred in India that to kill her keeper is an awful -sacrilege, and even the Thugs recognized this; yet now and then the lust -for blood was too strong, and so they did kill a few cow-keepers. In one -of these instances the witness who killed the cowherd said, "In Thuggee -this is strictly forbidden, and is an act from which no good can come. I -was ill of a fever for ten days afterward. I do believe that evil will -follow the murder of a man with a cow. If there be no cow it does not -signify." Another Thug said he held the cowherd's feet while this -witness did the strangling. He felt no concern, "because the bad fortune -of such a deed is upon the strangler and not upon the assistants; even if -there should be a hundred of them." - -There were thousands of Thugs roving over India constantly, during many -generations. They made Thug gee a hereditary vocation and taught it to -their sons and to their son's sons. Boys were in full membership as -early as 16 years of age; veterans were still at work at 70. What was -the fascination, what was the impulse? Apparently, it was partly piety, -largely gain, and there is reason to suspect that the sport afforded was -the chiefest fascination of all. Meadows Taylor makes a Thug in one of -his books claim that the pleasure of killing men was the white man's -beast-hunting instinct enlarged, refined, ennobled. I will quote the -passage: - - - - -CHAPTER XLVII. - -Simple rules for saving money: To save half, when you are fired by an -eager impulse to contribute to a charity, wait, and count forty. To save -three-quarters, count sixty. To save it all, count sixty-five. - --Pudd'nhead Wilson's New Calendar. - -The Thug said: - -"How many of you English are passionately devoted to sporting! Your days -and months are passed in its excitement. A tiger, a panther, a buffalo -or a hog rouses your utmost energies for its destruction--you even risk -your lives in its pursuit. How much higher game is a Thug's!" - -That must really be the secret of the rise and development of Thuggee. -The joy of killing! the joy of seeing killing done--these are traits of -the human race at large. We white people are merely modified Thugs; -Thugs fretting under the restraints of a not very thick skin of -civilization; Thugs who long ago enjoyed the slaughter of the Roman -arena, and later the burning of doubtful Christians by authentic -Christians in the public squares, and who now, with the Thugs of Spain -and Nimes, flock to enjoy the blood and misery of the bullring. We have -no tourists of either sex or any religion who are able to resist the -delights of the bull-ring when opportunity offers; and we are gentle -Thugs in the hunting-season, and love to chase a tame rabbit and kill it. -Still, we have made some progress-microscopic, and in truth scarcely -worth mentioning, and certainly nothing to be proud of--still, it is -progress: we no longer take pleasure in slaughtering or burning helpless -men. We have reached a little altitude where we may look down upon the -Indian Thugs with a complacent shudder; and we may even hope for a day, -many centuries hence, when our posterity will look down upon us in the -same way. - -There are many indications that the Thug often hunted men for the mere -sport of it; that the fright and pain of the quarry were no more to him -than are the fright and pain of the rabbit or the stag to us; and that he -was no more ashamed of beguiling his game with deceits and abusing its -trust than are we when we have imitated a wild animal's call and shot it -when it honored us with its confidence and came to see what we wanted: - - "Madara, son of Nihal, and I, Ramzam, set out from Kotdee in the - cold weather and followed the high road for about twenty days in - search of travelers, until we came to Selempore, where we met a very - old man going to the east. We won his confidence in this manner: he - carried a load which was too heavy for his old age; I said to him, - 'You are an old man, I will aid you in carrying your load, as you - are from my part of the country.' He said, 'Very well, take me with - you.' So we took him with us to Selempore, where we slept that - night. We woke him next morning before dawn and set out, and at the - distance of three miles we seated him to rest while it was still - very dark. Madara was ready behind him, and strangled him. He - never spoke a word. He was about 60 or 70 years of age." - -Another gang fell in with a couple of barbers and persuaded them to come -along in their company by promising them the job of shaving the whole -crew--30 Thugs. At the place appointed for the murder 15 got shaved, and -actually paid the barbers for their work. Then killed them and took back -the money. - -A gang of forty-two Thugs came across two Brahmins and a shopkeeper on -the road, beguiled them into a grove and got up a concert for their -entertainment. While these poor fellows were listening to the music the -stranglers were standing behind them; and at the proper moment for -dramatic effect they applied the noose. - -The most devoted fisherman must have a bite at least as often as once -a week or his passion will cool and he will put up his tackle. The -tiger-sportsman must find a tiger at least once a fortnight or he will get -tired and quit. The elephant-hunter's enthusiasm will waste away little -by little, and his zeal will perish at last if he plod around a month -without finding a member of that noble family to assassinate. - -But when the lust in the hunter's heart is for the noblest of all -quarries, man, how different is the case! and how watery and poor is the -zeal and how childish the endurance of those other hunters by comparison. -Then, neither hunger, nor thirst, nor fatigue, nor deferred hope, nor -monotonous disappointment, nor leaden-footed lapse of time can conquer -the hunter's patience or weaken the joy of his quest or cool the splendid -rage of his desire. Of all the hunting-passions that burn in the breast -of man, there is none that can lift him superior to discouragements like -these but the one--the royal sport, the supreme sport, whose quarry is -his brother. By comparison, tiger-hunting is a colorless poor thing, for -all it has been so bragged about. - -Why, the Thug was content to tramp patiently along, afoot, in the wasting -heat of India, week after week, at an average of nine or ten miles a day, -if he might but hope to find game some time or other and refresh his -longing soul with blood. Here is an instance: - - "I (Ramzam) and Hyder set out, for the purpose of strangling - travelers, from Guddapore, and proceeded via the Fort of Julalabad, - Newulgunge, Bangermow, on the banks of the Ganges (upwards of 100 - miles), from whence we returned by another route. Still no - travelers! till we reached Bowaneegunge, where we fell in with a - traveler, a boatman; we inveigled him and about two miles east of - there Hyder strangled him as he stood--for he was troubled and - afraid, and would not sit. We then made a long journey (about 130 - miles) and reached Hussunpore Bundwa, where at the tank we fell in - with a traveler--he slept there that night; next morning we followed - him and tried to win his confidence; at the distance of two miles we - endeavored to induce him to sit down--but he would not, having - become aware of us. I attempted to strangle him as he walked along, - but did not succeed; both of us then fell upon him, he made a great - outcry, 'They are murdering me!' at length we strangled him and - flung his body into a well. After this we returned to our homes, - having been out a month and traveled about 260 miles. A total of - two men murdered on the expedition." - -And here is another case-related by the terrible Futty Khan, a man with a -tremendous record, to be re-mentioned by and by: - - "I, with three others, traveled for about 45 days a distance of - about 200 miles in search of victims along the highway to Bundwa and - returned by Davodpore (another 200 miles) during which journey we - had only one murder, which happened in this manner. Four miles to - the east of Noubustaghat we fell in with a traveler, an old man. I, - with Koshal and Hyder, inveigled him and accompanied him that day - within 3 miles of Rampoor, where, after dark, in a lonely place, we - got him to sit down and rest; and while I kept him in talk, seated - before him, Hyder behind strangled him: he made no resistance. - Koshal stabbed him under the arms and in the throat, and we flung - the body into a running stream. We got about 4 or 5 rupees each ($2 - or $2.50). We then proceeded homewards. A total of one man - murdered on this expedition." - -There. They tramped 400 miles, were gone about three months, and -harvested two dollars and a half apiece. But the mere pleasure of the -hunt was sufficient. That was pay enough. They did no grumbling. - -Every now and then in this big book one comes across that pathetic -remark: "we tried to get him to sit down but he would not." It tells the -whole story. Some accident had awakened the suspicion in him that these -smooth friends who had been petting and coddling him and making him feel -so safe and so fortunate after his forlorn and lonely wanderings were the -dreaded Thugs; and now their ghastly invitation to "sit and rest" had -confirmed its truth. He knew there was no help for him, and that he was -looking his last upon earthly things, but "he would not sit." No, not -that--it was too awful to think of! - -There are a number of instances which indicate that when a man had once -tasted the regal joys of man-hunting he could not be content with the -dull monotony of a crimeless life after ward. Example, from a Thug's -testimony: - - "We passed through to Kurnaul, where we found a former Thug named - Junooa, an old comrade of ours, who had turned religious mendicant - and become a disciple and holy. He came to us in the serai and - weeping with joy returned to his old trade." - -Neither wealth nor honors nor dignities could satisfy a reformed Thug for -long. He would throw them all away, someday, and go back to the lurid -pleasures of hunting men, and being hunted himself by the British. - -Ramzam was taken into a great native grandee's service and given -authority over five villages. "My authority extended over these people -to summons them to my presence, to make them stand or sit. I dressed -well, rode my pony, and had two sepoys, a scribe and a village guard to -attend me. During three years I used to pay each village a monthly -visit, and no one suspected that I was a Thug! The chief man used to -wait on me to transact business, and as I passed along, old and young -made their salaam to me." - -And yet during that very three years he got leave of absence "to attend a -wedding," and instead went off on a Thugging lark with six other Thugs -and hunted the highway for fifteen days!--with satisfactory results. - -Afterwards he held a great office under a Rajah. There he had ten miles -of country under his command and a military guard of fifteen men, with -authority to call out 2,000 more upon occasion. But the British got on -his track, and they crowded him so that he had to give himself up. See -what a figure he was when he was gotten up for style and had all his -things on: "I was fully armed--a sword, shield, pistols, a matchlock -musket and a flint gun, for I was fond of being thus arrayed, and when so -armed feared not though forty men stood before me." - -He gave himself up and proudly proclaimed himself a Thug. Then by -request he agreed to betray his friend and pal, Buhram, a Thug with the -most tremendous record in India. "I went to the house where Buhram slept -(often has he led our gangs!) I woke him, he knew me well, and came -outside to me. It was a cold night, so under pretence of warming myself, -but in reality to have light for his seizure by the guards, I lighted -some straw and made a blaze. We were warming our hands. The guards drew -around us. I said to them, 'This is Buhram,' and he was seized just as a -cat seizes a mouse. Then Buhram said, 'I am a Thug! my father was a -Thug, my grandfather was a Thug, and I have thugged with many!'" - -So spoke the mighty hunter, the mightiest of the mighty, the Gordon -Cumming of his day. Not much regret noticeable in it.--["Having planted -a bullet in the shoulder-bone of an elephant, and caused the agonized -creature to lean for support against a tree, I proceeded to brew some -coffee. Having refreshed myself, taking observations of the elephant's -spasms and writhings between the sips, I resolved to make experiments on -vulnerable points, and, approaching very near, I fired several bullets at -different parts of his enormous skull. He only acknowledged the shots by -a salaam-like movement of his trunk, with the point of which he gently -touched the wounds with a striking and peculiar action. Surprised and -shocked to find that I was only prolonging the suffering of the noble -beast, which bore its trials with such dignified composure, I resolved to -finish the proceeding with all possible despatch, and accordingly opened -fire upon him from the left side. Aiming at the shoulder, I fired six -shots with the two-grooved rifle, which must have eventually proved -mortal, after which I fired six shots at the same part with the Dutch -six-founder. Large tears now trickled down from his eyes, which he -slowly shut and opened, his colossal frame shivered convulsively, and -falling on his side he expired."--Gordon Cumming.] - -So many many times this Official Report leaves one's curiosity -unsatisfied. For instance, here is a little paragraph out of the record -of a certain band of 193 Thugs, which has that defect: - - "Fell in with Lall Sing Subahdar and his family, consisting of nine - persons. Traveled with them two days, and the third put them all to - death except the two children, little boys of one and a half years - old." - -There it stops. What did they do with those poor little fellows? What -was their subsequent history? Did they purpose training them up as -Thugs? How could they take care of such little creatures on a march -which stretched over several months? No one seems to have cared to ask -any questions about the babies. But I do wish I knew. - -One would be apt to imagine that the Thugs were utterly callous, utterly -destitute of human feelings, heartless toward their own families as well -as toward other people's; but this was not so. Like all other Indians, -they had a passionate love for their kin. A shrewd British officer who -knew the Indian character, took that characteristic into account in -laying his plans for the capture of Eugene Sue's famous Feringhea. He -found out Feringhea's hiding-place, and sent a guard by night to seize -him, but the squad was awkward and he got away. However, they got the -rest of the family--the mother, wife, child, and brother--and brought -them to the officer, at Jubbulpore; the officer did not fret, but bided -his time: "I knew Feringhea would not go far while links so dear to him -were in my hands." He was right. Feringhea knew all the danger he was -running by staying in the neighborhood, still he could not tear himself -away. The officer found that he divided his time between five villages -where be had relatives and friends who could get news for him from his -family in Jubbulpore jail; and that he never slept two consecutive nights -in the same village. The officer traced out his several haunts, then -pounced upon all the five villages on the one night and at the same hour, -and got his man. - -Another example of family affection. A little while previously to the -capture of Feringhea's family, the British officer had captured -Feringhea's foster-brother, leader of a gang of ten, and had tried the -eleven and condemned them to be hanged. Feringhea's captured family -arrived at the jail the day before the execution was to take place. The -foster-brother, Jhurhoo, entreated to be allowed to see the aged mother -and the others. The prayer was granted, and this is what took place--it -is the British officer who speaks: - - "In the morning, just before going to the scaffold, the interview - took place before me. He fell at the old woman's feet and begged - that she would relieve him from the obligations of the milk with - which she had nourished him from infancy, as he was about to die - before he could fulfill any of them. She placed her hands on his - head, and he knelt, and she said she forgave him all, and bid him - die like a man." - -If a capable artist should make a picture of it, it would be full of -dignity and solemnity and pathos; and it could touch you. You would -imagine it to be anything but what it was. There is reverence there, and -tenderness, and gratefulness, and compassion, and resignation, and -fortitude, and self-respect--and no sense of disgrace, no thought of -dishonor. Everything is there that goes to make a noble parting, and -give it a moving grace and beauty and dignity. And yet one of these -people is a Thug and the other a mother of Thugs! The incongruities of -our human nature seem to reach their limit here. - -I wish to make note of one curious thing while I think of it. One of the -very commonest remarks to be found in this bewildering array of Thug -confessions is this: - -"Strangled him and threw him an a well!" In one case they threw sixteen -into a well--and they had thrown others in the same well before. It -makes a body thirsty to read about it. - -And there is another very curious thing. The bands of Thugs had private -graveyards. They did not like to kill and bury at random, here and there -and everywhere. They preferred to wait, and toll the victims along, and -get to one of their regular burying-places ('bheels') if they could. In -the little kingdom of Oude, which was about half as big as Ireland and -about as big as the State of Maine, they had two hundred and seventy-four -'bheels'. They were scattered along fourteen hundred miles of road, at -an average of only five miles apart, and the British government traced -out and located each and every one of them and set them down on the map. - -The Oude bands seldom went out of their own country, but they did a -thriving business within its borders. So did outside bands who came in -and helped. Some of the Thug leaders of Oude were noted for their -successful careers. Each of four of them confessed to above 300 murders; -another to nearly 400; our friend Ramzam to 604--he is the one who got -leave of absence to attend a wedding and went thugging instead; and he is -also the one who betrayed Buhram to the British. - -But the biggest records of all were the murder-lists of Futty Khan and -Buhram. Futty Khan's number is smaller than Ramzam's, but he is placed -at the head because his average is the best in Oude-Thug history per year -of service. His slaughter was 508 men in twenty years, and he was still -a young man when the British stopped his industry. Buhram's list was 931 -murders, but it took him forty years. His average was one man and nearly -all of another man per month for forty years, but Futty Khan's average -was two men and a little of another man per month during his twenty years -of usefulness. - -There is one very striking thing which I wish to call attention to. You -have surmised from the listed callings followed by the victims of the -Thugs that nobody could travel the Indian roads unprotected and live to -get through; that the Thugs respected no quality, no vocation, no -religion, nobody; that they killed every unarmed man that came in their -way. That is wholly true--with one reservation. In all the long file of -Thug confessions an English traveler is mentioned but once--and this is -what the Thug says of the circumstance: - - "He was on his way from Mhow to Bombay. We studiously avoided him. - He proceeded next morning with a number of travelers who had sought - his protection, and they took the road to Baroda." - -We do not know who he was; he flits across the page of this rusty old -book and disappears in the obscurity beyond; but he is an impressive -figure, moving through that valley of death serene and unafraid, clothed -in the might of the English name. - -We have now followed the big official book through, and we understand -what Thuggee was, what a bloody terror it was, what a desolating scourge -it was. In 1830 the English found this cancerous organization imbedded -in the vitals of the empire, doing its devastating work in secrecy, and -assisted, protected, sheltered, and hidden by innumerable confederates ---big and little native chiefs, customs officers, village officials, and -native police, all ready to lie for it, and the mass of the people, -through fear, persistently pretending to know nothing about its doings; -and this condition of things had existed for generations, and was -formidable with the sanctions of age and old custom. If ever there was -an unpromising task, if ever there was a hopeless task in the world, -surely it was offered here--the task of conquering Thuggee. But that -little handful of English officials in India set their sturdy and -confident grip upon it, and ripped it out, root and branch! How modest -do Captain Vallancey's words sound now, when we read them again, knowing -what we know: - - "The day that sees this far-spread evil completely eradicated from - India, and known only in name, will greatly tend to immortalize - British rule in the East." - -It would be hard to word a claim more modestly than that for this most -noble work. - - - - -CHAPTER XLVIII. - -Grief can take care of itself; but to get the full value of a joy you -must have somebody to divide it with. - --Pudd'nhead Wilson's New Calendar. - -We left Bombay for Allahabad by a night train. It is the custom of the -country to avoid day travel when it can conveniently be done. But there -is one trouble: while you can seemingly "secure" the two lower berths by -making early application, there is no ticket as witness of it, and no -other producible evidence in case your proprietorship shall chance to be -challenged. The word "engaged" appears on the window, but it doesn't -state who the compartment is engaged, for. If your Satan and your Barney -arrive before somebody else's servants, and spread the bedding on the two -sofas and then stand guard till you come, all will be well; but if they -step aside on an errand, they may find the beds promoted to the two -shelves, and somebody else's demons standing guard over their master's -beds, which in the meantime have been spread upon your sofas. - -You do not pay anything extra for your sleeping place; that is where the -trouble lies. If you buy a fare-ticket and fail to use it, there is room -thus made available for someone else; but if the place were secured to -you it would remain vacant, and yet your ticket would secure you another -place when you were presently ready to travel. - -However, no explanation of such a system can make it seem quite rational -to a person who has been used to a more rational system. If our people -had the arranging of it, we should charge extra for securing the place, -and then the road would suffer no loss if the purchaser did not occupy -it. - -The present system encourages good manners--and also discourages them. -If a young girl has a lower berth and an elderly lady comes in, it is -usual for the girl to offer her place to this late comer; and it is usual -for the late comer to thank her courteously and take it. But the thing -happens differently sometimes. When we were ready to leave Bombay my -daughter's satchels were holding possession of her berth--a lower one. -At the last moment, a middle-aged American lady swarmed into the -compartment, followed by native porters laden with her baggage. She was -growling and snarling and scolding, and trying to make herself -phenomenally disagreeable; and succeeding. Without a word, she hoisted -the satchels into the hanging shelf, and took possession of that lower -berth. - -On one of our trips Mr. Smythe and I got out at a station to walk up and -down, and when we came back Smythe's bed was in the hanging shelf and an -English cavalry officer was in bed on the sofa which he had lately been -occupying. It was mean to be glad about it, but it is the way we are -made; I could not have been gladder if it had been my enemy that had -suffered this misfortune. We all like to see people in trouble, if it -doesn't cost us anything. I was so happy over Mr. Smythe's chagrin that -I couldn't go to sleep for thinking of it and enjoying it. I knew he -supposed the officer had committed the robbery himself, whereas without a -doubt the officer's servant had done it without his knowledge. Mr. -Smythe kept this incident warm in his heart, and longed for a chance to -get even with somebody for it. Sometime afterward the opportunity came, -in Calcutta. We were leaving on a 24-hour journey to Darjeeling. Mr. -Barclay, the general superintendent, has made special provision for our -accommodation, Mr. Smythe said; so there was no need to hurry about -getting to the train; consequently, we were a little late. - -When we arrived, the usual immense turmoil and confusion of a great -Indian station were in full blast. It was an immoderately long train, -for all the natives of India were going by it somewhither, and the native -officials were being pestered to frenzy by belated and anxious people. -They didn't know where our car was, and couldn't remember having received -any orders about it. It was a deep disappointment; moreover, it looked -as if our half of our party would be left behind altogether. Then Satan -came running and said he had found a compartment with one shelf and one -sofa unoccupied, and had made our beds and had stowed our baggage. We -rushed to the place, and just as the train was ready to pull out and the -porters were slamming the doors to, all down the line, an officer of the -Indian Civil Service, a good friend of ours, put his head in and said:-- - -"I have been hunting for you everywhere. What are you doing here? Don't -you know----" - -The train started before he could finish. Mr. Smythe's opportunity was -come. His bedding, on the shelf, at once changed places with the -bedding--a stranger's--that was occupying the sofa that was opposite to -mine. About ten o'clock we stopped somewhere, and a large Englishman of -official military bearing stepped in. We pretended to be asleep. The -lamps were covered, but there was light enough for us to note his look of -surprise. He stood there, grand and fine, peering down at Smythe, and -wondering in silence at the situation. After a bit be said:-- - -"Well!" And that was all. - -But that was enough. It was easy to understand. It meant: "This is -extraordinary. This is high-handed. I haven't had an experience like -this before." - -He sat down on his baggage, and for twenty minutes we watched him through -our eyelashes, rocking and swaying there to the motion of the train. -Then we came to a station, and he got up and went out, muttering: "I must -find a lower berth, or wait over." His servant came presently and carried -away his things. - -Mr. Smythe's sore place was healed, his hunger for revenge was satisfied. -But he couldn't sleep, and neither could I; for this was a venerable old. -car, and nothing about it was taut. The closet door slammed all night, -and defied every fastening we could invent. We got up very much jaded, -at dawn, and stepped out at a way station; and, while we were taking a -cup of coffee, that Englishman ranged up alongside, and somebody said to -him: - -"So you didn't stop off, after all?" - -"No. The guard found a place for me that had been, engaged and not -occupied. I had a whole saloon car all to myself--oh, quite palatial! -I never had such luck in my life." - -That was our car, you see. We moved into it, straight off, the family -and all. But I asked the English gentleman to remain, and he did. A -pleasant man, an infantry colonel; and doesn't know, yet, that Smythe -robbed him of his berth, but thinks it was done by Smythe's servant -without Smythe's knowledge. He was assisted in gathering this -impression. - -The Indian trains are manned by natives exclusively. The Indian stations -except very large and important ones--are manned entirely by natives, and -so are the posts and telegraphs. The rank and file of the police are -natives. All these people are pleasant and accommodating. One day I -left an express train to lounge about in that perennially ravishing show, -the ebb and flow and whirl of gaudy natives, that is always surging up -and down the spacious platform of a great Indian station; and I lost -myself in the ecstasy of it, and when I turned, the train was moving -swiftly away. I was going to sit down and wait for another train, as I -would have done at home; I had no thought of any other course. But a -native official, who had a green flag in his hand, saw me, and said -politely: - -"Don't you belong in the train, sir?" - -"Yes." I said. - -He waved his flag, and the train came back! And he put me aboard with as -much ceremony as if I had been the General Superintendent. They are -kindly people, the natives. The face and the bearing that indicate a -surly spirit and a bad heart seemed to me to be so rare among Indians--so -nearly non-existent, in fact--that I sometimes wondered if Thuggee wasn't -a dream, and not a reality. The bad hearts are there, but I believe that -they are in a small, poor minority. One thing is sure: They are much the -most interesting people in the world--and the nearest to being -incomprehensible. At any rate, the hardest to account for. Their -character and their history, their customs and their religion, confront -you with riddles at every turn-riddles which are a trifle more perplexing -after they are explained than they were before. You can get the facts of -a custom--like caste, and Suttee, and Thuggee, and so on--and with the -facts a theory which tries to explain, but never quite does it to your -satisfaction. You can never quite understand how so strange a thing -could have been born, nor why. - -For instance--the Suttee. This is the explanation of it: - -A woman who throws away her life when her husband dies is instantly -joined to him again, and is forever afterward happy with him in heaven; -her family will build a little monument to her, or a temple, and will -hold her in honor, and, indeed, worship her memory always; they will -themselves be held in honor by the public; the woman's self-sacrifice has -conferred a noble and lasting distinction upon her posterity. And, -besides, see what she has escaped: If she had elected to live, she would -be a disgraced person; she could not remarry; her family would despise -her and disown her; she would be a friendless outcast, and miserable all -her days. - -Very well, you say, but the explanation is not complete yet. How did -people come to drift into such a strange custom? What was the origin of -the idea? "Well, nobody knows; it was probably a revelation sent down by -the gods." One more thing: Why was such a cruel death chosen--why -wouldn't a gentle one have answered? "Nobody knows; maybe that was a -revelation, too." - -No--you can never understand it. It all seems impossible. You resolve -to believe that a widow never burnt herself willingly, but went to her -death because she was afraid to defy public opinion. But you are not -able to keep that position. History drives you from it. Major Sleeman -has a convincing case in one of his books. In his government on the -Nerbudda he made a brave attempt on the 28th of March, 1828, to put down -Suttee on his own hook and without warrant from the Supreme Government of -India. He could not foresee that the Government would put it down itself -eight months later. The only backing he had was a bold nature and a -compassionate heart. He issued his proclamation abolishing the Suttee in -his district. On the morning of Tuesday--note the day of the week--the -24th of the following November, Ummed Singh Upadhya, head of the most -respectable and most extensive Brahmin family in the district, died, and -presently came a deputation of his sons and grandsons to beg that his old -widow might be allowed to burn herself upon his pyre. Sleeman threatened -to enforce his order, and punish severely any man who assisted; and he -placed a police guard to see that no one did so. From the early morning -the old widow of sixty-five had been sitting on the bank of the sacred -river by her dead, waiting through the long hours for the permission; and -at last the refusal came instead. In one little sentence Sleeman gives -you a pathetic picture of this lonely old gray figure: all day and all -night "she remained sitting by the edge of the water without eating or -drinking." The next morning the body of the husband was burned to ashes -in a pit eight feet square and three or four feet deep, in the view of -several thousand spectators. Then the widow waded out to a bare rock in -the river, and everybody went away but her sons and other relations. All -day she sat there on her rock in the blazing sun without food or drink, -and with no clothing but a sheet over her shoulders. - -The relatives remained with her and all tried to persuade her to desist -from her purpose, for they deeply loved her. She steadily refused. Then -a part of the family went to Sleeman's house, ten miles away, and tried -again to get him to let her burn herself. He refused, hoping to save her -yet. - -All that day she scorched in her sheet on the rock, and all that night -she kept her vigil there in the bitter cold. Thursday morning, in the -sight of her relatives, she went through a ceremonial which said more to -them than any words could have done; she put on the dhaja (a coarse red -turban) and broke her bracelets in pieces. By these acts she became a -dead person in the eye of the law, and excluded from her caste forever. -By the iron rule of ancient custom, if she should now choose to live she -could never return to her family. Sleeman was in deep trouble. If she -starved herself to death her family would be disgraced; and, moreover, -starving would be a more lingering misery than the death by fire. He -went back in the evening thoroughly worried. The old woman remained on -her rock, and there in the morning he found her with her dhaja still on -her head. "She talked very collectedly, telling me that she had -determined to mix her ashes with those of her departed husband, and -should patiently wait my permission to do so, assured that God would -enable her to sustain life till that was given, though she dared not eat -or drink. Looking at the sun, then rising before her over a long and -beautiful reach of the river, she said calmly, 'My soul has been for five -days with my husband's near that sun; nothing but my earthly frame is -left; and this, I know, you will in time suffer to be mixed with his -ashes in yonder pit, because it is not in your nature or usage wantonly -to prolong the miseries of a poor old woman.'" - -He assured her that it was his desire and duty to save her, and to urge -her to live, and to keep her family from the disgrace of being thought -her murderers. But she said she "was not afraid of their being thought -so; that they had all, like good children, done everything in their power -to induce her to live, and to abide with them; and if I should consent I -know they would love and honor me, but my duties to them have now ended. -I commit them all to your care, and I go to attend my husband, Ummed -Singh Upadhya, with whose ashes on the funeral pile mine have been -already three times mixed." - -She believed that she and he had been upon the earth three several times -as wife and husband, and that she had burned herself to death three times -upon his pyre. That is why she said that strange thing. Since she had -broken her bracelets and put on the red turban she regarded herself as a -corpse; otherwise she would not have allowed herself to do her husband -the irreverence of pronouncing his name. "This was the first time in her -long life that she had ever uttered her husband's name, for in India no -woman, high or low, ever pronounces the name of her husband." - -Major Sleeman still tried to shake her purpose. He promised to build her -a fine house among the temples of her ancestors upon the bank of the -river and make handsome provision for her out of rent-free lands if she -would consent to live; and if she wouldn't he would allow no stone or -brick to ever mark the place where she died. But she only smiled and -said, "My pulse has long ceased to beat, my spirit has departed; I shall -suffer nothing in the burning; and if you wish proof, order some fire and -you shall see this arm consumed without giving me any pain." - -Sleeman was now satisfied that he could not alter her purpose. He sent -for all the chief members of the family and said he would suffer her to -burn herself if they would enter into a written engagement to abandon the -suttee in their family thenceforth. They agreed; the papers were drawn -out and signed, and at noon, Saturday, word was sent to the poor old -woman. She seemed greatly pleased. The ceremonies of bathing were gone -through with, and by three o'clock she was ready and the fire was briskly -burning in the pit. She had now gone without food or drink during more -than four days and a half. She came ashore from her rock, first wetting -her sheet in the waters of the sacred river, for without that safeguard -any shadow which might fall upon her would convey impurity to her; then -she walked to the pit, leaning upon one of her sons and a nephew--the -distance was a hundred and fifty yards. - -"I had sentries placed all around, and no other person was allowed to -approach within five paces. She came on with a calm and cheerful -countenance, stopped once, and casting her eyes upwards, said, 'Why have -they kept me five days from thee, my husband?' On coming to the sentries -her supporters stopped and remained standing; she moved on, and walked -once around the pit, paused a moment, and while muttering a prayer, threw -some flowers into the fire. She then walked up deliberately and steadily -to the brink, stepped into the centre of the flame, sat down, and leaning -back in the midst as if reposing upon a couch, was consumed without -uttering a shriek or betraying one sign of agony." - -It is fine and beautiful. It compels one's reverence and respect--no, -has it freely, and without compulsion. We see how the custom, once -started, could continue, for the soul of it is that stupendous power, -Faith; faith brought to the pitch of effectiveness by the cumulative -force of example and long use and custom; but we cannot understand how -the first widows came to take to it. That is a perplexing detail. - -Sleeman says that it was usual to play music at the suttee, but that the -white man's notion that this was to drown the screams of the martyr is -not correct; that it had a quite different purpose. It was believed that -the martyr died prophecying; that the prophecies sometimes foretold -disaster, and it was considered a kindness to those upon whom it was to -fall to drown the voice and keep them in ignorance of the misfortune that -was to come. - - - - -CHAPTER XLIX. - -He had had much experience of physicians, and said "the only way to keep -your health is to eat what you don't want, drink what; you don't like, -and do what you'd druther not." - --Pudd'nhead Wilson's New Calendar. - -It was a long journey--two nights, one day, and part of another day, from -Bombay eastward to Allahabad; but it was always interesting, and it was -not fatiguing. At first the, night travel promised to be fatiguing, but -that was on account of pyjamas. This foolish night-dress consists of -jacket and drawers. Sometimes they are made of silk, sometimes of a -raspy, scratchy, slazy woolen material with a sandpaper surface. The -drawers are loose elephant-legged and elephant-waisted things, and -instead of buttoning around the body there is a drawstring to produce the -required shrinkage. The jacket is roomy, and one buttons it in front. -Pyjamas are hot on a hot night and cold on a cold night--defects which a -nightshirt is free from. I tried the pyjamas in order to be in the -fashion; but I was obliged to give them up, I couldn't stand them. There -was no sufficient change from day-gear to night-gear. I missed the -refreshing and luxurious sense, induced by the night-gown, of being -undressed, emancipated, set free from restraints and trammels. In place -of that, I had the worried, confined, oppressed, suffocated sense of -being abed with my clothes on. All through the warm half of the night -the coarse surfaces irritated my skin and made it feel baked and -feverish, and the dreams which came in the fitful flurries of slumber -were such as distress the sleep of the damned, or ought to; and all -through the cold other half of the night I could get no time for sleep -because I had to employ it all in stealing blankets. But blankets are of -no value at such a time; the higher they are piled the more effectively -they cork the cold in and keep it from getting out. The result is that -your legs are ice, and you know how you will feel by and by when you are -buried. In a sane interval I discarded the pyjamas, and led a rational -and comfortable life thenceforth. - -Out in the country in India, the day begins early. One sees a plain, -perfectly flat, dust-colored and brick-yardy, stretching limitlessly away -on every side in the dim gray light, striped everywhere with hard-beaten -narrow paths, the vast flatness broken at wide intervals by bunches of -spectral trees that mark where villages are; and along all the paths are -slender women and the black forms of lanky naked men moving, to their -work, the women with brass water-jars on their heads, the men carrying -hoes. The man is not entirely naked; always there is a bit of white rag, -a loin-cloth; it amounts to a bandage, and is a white accent on his black -person, like the silver band around the middle of a pipe-stem. Sometimes -he also wears a fluffy and voluminous white turban, and this adds a -second accent. He then answers properly to Miss Gordon Cumming's -flash-light picture of him--as a person who is dressed in "a turban -and a pocket handkerchief." - -All day long one has this monotony of dust-colored dead levels and -scattering bunches of trees and mud villages. You soon realize that -India is not beautiful; still there is an enchantment about it that is -beguiling, and which does not pall. You cannot tell just what it is that -makes the spell, perhaps, but you feel it and confess it, nevertheless. -Of course, at bottom, you know in a vague way that it is history; it is -that that affects you, a haunting sense of the myriads of human lives -that have blossomed, and withered, and perished here, repeating and -repeating and repeating, century after century, and age after age, the -barren and meaningless process; it is this sense that gives to this -forlorn, uncomely land power to speak to the spirit and make friends with -it; to, speak to it with a voice bitter with satire, but eloquent with -melancholy. The deserts of Australia and the ice-barrens of Greenland -have no speech, for they have no venerable history; with nothing to tell -of man and his vanities, his fleeting glories and his miseries, they have -nothing wherewith to spiritualize their ugliness and veil it with a -charm. - -There is nothing pretty about an Indian village--a mud one--and I do not -remember that we saw any but mud ones on that long flight to Allahabad. -It is a little bunch of dirt-colored mud hovels jammed together within a -mud wall. As a rule, the rains had beaten down parts of some of the -houses, and this gave the village the aspect of a mouldering and hoary -ruin. I believe the cattle and the vermin live inside the wall; for I -saw cattle coming out and cattle going in; and whenever I saw a villager, -he was scratching. This last is only circumstantial evidence, but I -think it has value. The village has a battered little temple or two, big -enough to hold an idol, and with custom enough to fat-up a priest and -keep him comfortable. Where there are Mohammedans there are generally a -few sorry tombs outside the village that have a decayed and neglected -look. The villages interested me because of things which Major Sleeman -says about them in his books--particularly what he says about the -division of labor in them. He says that the whole face of India is -parceled out into estates of villages; that nine-tenths of the vast -population of the land consist of cultivators of the soil; that it is -these cultivators who inhabit the villages; that there are certain -"established" village servants--mechanics and others who are apparently -paid a wage by the village at large, and whose callings remain in certain -families and are handed down from father to son, like an estate. He -gives a list of these established servants: Priest, blacksmith, -carpenter, accountant, washerman, basketmaker, potter, watchman, barber, -shoemaker, brazier, confectioner, weaver, dyer, etc. In his day witches -abounded, and it was not thought good business wisdom for a man to marry -his daughter into a family that hadn't a witch in it, for she would need -a witch on the premises to protect her children from the evil spells -which would certainly be cast upon them by the witches connected with the -neighboring families. - -The office of midwife was hereditary in the family of the basket-maker. -It belonged to his wife. She might not be competent, but the office was -hers, anyway. Her pay was not high--25 cents for a boy, and half as much -for a girl. The girl was not desired, because she would be a disastrous -expense by and by. As soon as she should be old enough to begin to wear -clothes for propriety's sake, it would be a disgrace to the family if she -were not married; and to marry her meant financial ruin; for by custom -the father must spend upon feasting and wedding-display everything he had -and all he could borrow--in fact, reduce himself to a condition of -poverty which he might never more recover from. - -It was the dread of this prospective ruin which made the killing of -girl-babies so prevalent in India in the old days before England laid the -iron hand of her prohibitions upon the piteous slaughter. One may judge -of how prevalent the custom was, by one of Sleeman's casual electrical -remarks, when he speaks of children at play in villages--where -girl-voices were never heard! - -The wedding-display folly is still in full force in India, and by -consequence the destruction of girl-babies is still furtively practiced; -but not largely, because of the vigilance of the government and the -sternness of the penalties it levies. - -In some parts of India the village keeps in its pay three other servants: -an astrologer to tell the villager when he may plant his crop, or make a -journey, or marry a wife, or strangle a child, or borrow a dog, or climb -a tree, or catch a rat, or swindle a neighbor, without offending the -alert and solicitous heavens; and what his dream means, if he has had one -and was not bright enough to interpret it himself by the details of his -dinner; the two other established servants were the tiger-persuader and -the hailstorm discourager. The one kept away the tigers if he could, and -collected the wages anyway, and the other kept off the hailstorms, or -explained why he failed. He charged the same for explaining a failure -that he did for scoring a success. A man is an idiot who can't earn a -living in India. - -Major Sleeman reveals the fact that the trade union and the boycott are -antiquities in India. India seems to have originated everything. The -"sweeper" belongs to the bottom caste; he is the lowest of the low--all -other castes despise him and scorn his office. But that does not trouble -him. His caste is a caste, and that is sufficient for him, and so he is -proud of it, not ashamed. Sleeman says: - - "It is perhaps not known to many of my countrymen, even in India, - that in every town and city in the country the right of sweeping the - houses and streets is a monopoly, and is supported entirely by the - pride of castes among the scavengers, who are all of the lowest - class. The right of sweeping within a certain range is recognized - by the caste to belong to a certain member; and if any other member - presumes to sweep within that range, he is excommunicated--no other - member will smoke out of his pipe or drink out of his jug; and he - can get restored to caste only by a feast to the whole body of - sweepers. If any housekeeper within a particular circle happens to - offend the sweeper of that range, none of his filth will be removed - till he pacifies him, because no other sweeper will dare to touch - it; and the people of a town are often more tyrannized over by these - people than by any other." - -A footnote by Major Sleeman's editor, Mr. Vincent Arthur Smith, says that -in our day this tyranny of the sweepers' guild is one of the many -difficulties which bar the progress of Indian sanitary reform. Think of -this: - - "The sweepers cannot be readily coerced, because no Hindoo or - Mussulman would do their work to save his life, nor will he pollute - himself by beating the refractory scavenger." - -They certainly do seem to have the whip-hand; it would be difficult to -imagine a more impregnable position. "The vested rights described in the -text are so fully recognized in practice that they are frequently the -subject of sale or mortgage." - -Just like a milk-route; or like a London crossing-sweepership. It is -said that the London crossing-sweeper's right to his crossing is -recognized by the rest of the guild; that they protect him in its -possession; that certain choice crossings are valuable property, and are -saleable at high figures. I have noticed that the man who sweeps in -front of the Army and Navy Stores has a wealthy South African -aristocratic style about him; and when he is off his guard, he has -exactly that look on his face which you always see in the face of a man -who has is saving up his daughter to marry her to a duke. - -It appears from Sleeman that in India the occupation of elephant-driver -is confined to Mohammedans. I wonder why that is. The water-carrier -('bheestie') is a Mohammedan, but it is said that the reason of that is, -that the Hindoo's religion does not allow him to touch the skin of dead -kine, and that is what the water-sack is made of; it would defile him. -And it doesn't allow him to eat meat; the animal that furnished the meat -was murdered, and to take any creature's life is a sin. It is a good and -gentle religion, but inconvenient. - -A great Indian river, at low water, suggests the familiar anatomical -picture of a skinned human body, the intricate mesh of interwoven muscles -and tendons to stand for water-channels, and the archipelagoes of fat and -flesh inclosed by them to stand for the sandbars. Somewhere on this -journey we passed such a river, and on a later journey we saw in the -Sutlej the duplicate of that river. Curious rivers they are; low shores -a dizzy distance apart, with nothing between but an enormous acreage of -sand-flats with sluggish little veins of water dribbling around amongst -them; Saharas of sand, smallpox-pitted with footprints punctured in belts -as straight as the equator clear from the one shore to the other (barring -the channel-interruptions)--a dry-shod ferry, you see. Long railway -bridges are required for this sort of rivers, and India has them. You -approach Allahabad by a very long one. It was now carrying us across the -bed of the Jumna, a bed which did not seem to have been slept in for one -while or more. It wasn't all river-bed--most of it was overflow ground. - -Allahabad means "City of God." I get this from the books. From a printed -curiosity--a letter written by one of those brave and confident Hindoo -strugglers with the English tongue, called a "babu"--I got a more -compressed translation: "Godville." It is perfectly correct, but that is -the most that can be said for it. - -We arrived in the forenoon, and short-handed; for Satan got left behind -somewhere that morning, and did not overtake us until after nightfall. -It seemed very peaceful without him. The world seemed asleep and -dreaming. - -I did not see the native town, I think. I do not remember why; for an -incident connects it with the Great Mutiny, and that is enough to make -any place interesting. But I saw the English part of the city. It is a -town of wide avenues and noble distances, and is comely and alluring, and -full of suggestions of comfort and leisure, and of the serenity which a -good conscience buttressed by a sufficient bank account gives. The -bungalows (dwellings) stand well back in the seclusion and privacy of -large enclosed compounds (private grounds, as we should say) and in the -shade and shelter of trees. Even the photographer and the prosperous -merchant ply their industries in the elegant reserve of big compounds, -and the citizens drive in thereupon their business occasions. And not in -cabs--no; in the Indian cities cabs are for the drifting stranger; all -the white citizens have private carriages; and each carriage has a flock -of white-turbaned black footmen and drivers all over it. The vicinity of -a lecture-hall looks like a snowstorm,--and makes the lecturer feel like -an opera. India has many names, and they are correctly descriptive. It -is the Land of Contradictions, the Land of Subtlety and Superstition, the -Land of Wealth and Poverty, the Land of Splendor and Desolation, the Land -of Plague and Famine, the Land of the Thug and the Poisoner, and of the -Meek and the Patient, the Land of the Suttee, the Land of the -Unreinstatable Widow, the Land where All Life is Holy, the Land of -Cremation, the Land where the Vulture is a Grave and a Monument, the Land -of the Multitudinous Gods; and if signs go for anything, it is the Land -of the Private Carriage. - -In Bombay the forewoman of a millinery shop came to the hotel in her -private carriage to take the measure for a gown--not for me, but for -another. She had come out to India to make a temporary stay, but was -extending it indefinitely; indeed, she was purposing to end her days -there. In London, she said, her work had been hard, her hours long; for -economy's sake she had had to live in shabby rooms and far away from the -shop, watch the pennies, deny herself many of the common comforts of -life, restrict herself in effect to its bare necessities, eschew cabs, -travel third-class by underground train to and from her work, swallowing -coal-smoke and cinders all the way, and sometimes troubled with the -society of men and women who were less desirable than the smoke and the -cinders. But in Bombay, on almost any kind of wages, she could live in -comfort, and keep her carriage, and have six servants in place of the -woman-of-all-work she had had in her English home. Later, in Calcutta, I -found that the Standard Oil clerks had small one-horse vehicles, and did -no walking; and I was told that the clerks of the other large concerns -there had the like equipment. But to return to Allahabad. - -I was up at dawn, the next morning. In India the tourist's servant does -not sleep in a room in the hotel, but rolls himself up head and ears in -his blanket and stretches himself on the veranda, across the front of his -master's door, and spends the night there. I don't believe anybody's -servant occupies a room. Apparently, the bungalow servants sleep on the -veranda; it is roomy, and goes all around the house. I speak of -menservants; I saw none of the other sex. I think there are none, except -child-nurses. I was up at dawn, and walked around the veranda, past the -rows of sleepers. In front of one door a Hindoo servant was squatting, -waiting for his master to call him. He had polished the yellow shoes and -placed them by the door, and now he had nothing to do but wait. It was -freezing cold, but there he was, as motionless as a sculptured image, and -as patient. It troubled me. I wanted to say to him, "Don't crouch there -like that and freeze; nobody requires it of you; stir around and get -warm." But I hadn't the words. I thought of saying 'jeldy jow', but I -couldn't remember what it meant, so I didn't say it. I knew another -phrase, but it wouldn't come to my mind. I moved on, purposing to -dismiss him from my thoughts, but his bare legs and bare feet kept him -there. They kept drawing me back from the sunny side to a point whence I -could see him. At the end of an hour he had not changed his attitude in -the least degree. It was a curious and impressive exhibition of meekness -and patience, or fortitude or indifference, I did not know which. But it -worried me, and it was spoiling my morning. In fact, it spoiled two -hours of it quite thoroughly. I quitted this vicinity, then, and left -him to punish himself as much as he might want to. But up to that time -the man had not changed his attitude a hair. He will always remain with -me, I suppose; his figure never grows vague in my memory. Whenever I -read of Indian resignation, Indian patience under wrongs, hardships, and -misfortunes, he comes before me. He becomes a personification, and -stands for India in trouble. And for untold ages India in trouble has -been pursued with the very remark which I was going to utter but didn't, -because its meaning had slipped me: "Jeddy jow!" ("Come, shove along!") - -Why, it was the very thing. - -In the early brightness we made a long drive out to the Fort. Part of -the way was beautiful. It led under stately trees and through groups of -native houses and by the usual village well, where the picturesque gangs -are always flocking to and fro and laughing and chattering; and this time -brawny men were deluging their bronze bodies with the limpid water, and -making a refreshing and enticing show of it; enticing, for the sun was -already transacting business, firing India up for the day. There was -plenty of this early bathing going on, for it was getting toward -breakfast time, and with an unpurified body the Hindoo must not eat. - -Then we struck into the hot plain, and found the roads crowded with -pilgrims of both sexes, for one of the great religious fairs of India was -being held, just beyond the Fort, at the junction of the sacred rivers, -the Ganges and the Jumna. Three sacred rivers, I should have said, for -there is a subterranean one. Nobody has seen it, but that doesn't -signify. The fact that it is there is enough. These pilgrims had come -from all over India; some of them had been months on the way, plodding -patiently along in the heat and dust, worn, poor, hungry, but supported -and sustained by an unwavering faith and belief; they were supremely -happy and content, now; their full and sufficient reward was at hand; -they were going to be cleansed from every vestige of sin and corruption -by these holy waters which make utterly pure whatsoever thing they touch, -even the dead and rotten. It is wonderful, the power of a faith like -that, that can make multitudes upon multitudes of the old and weak and -the young and frail enter without hesitation or complaint upon such -incredible journeys and endure the resultant miseries without repining. -It is done in love, or it is done in fear; I do not know which it is. -No matter what the impulse is, the act born of it is beyond imagination -marvelous to our kind of people, the cold whites. There are choice great -natures among us that could exhibit the equivalent of this prodigious -self-sacrifice, but the rest of us know that we should not be equal to -anything approaching it. Still, we all talk self-sacrifice, and this -makes me hope that we are large enough to honor it in the Hindoo. - -Two millions of natives arrive at this fair every year. How many start, -and die on the road, from age and fatigue and disease and scanty -nourishment, and how many die on the return, from the same causes, no one -knows; but the tale is great, one may say enormous. Every twelfth year -is held to be a year of peculiar grace; a greatly augmented volume of -pilgrims results then. The twelfth year has held this distinction since -the remotest times, it is said. It is said also that there is to be but -one more twelfth year--for the Ganges. After that, that holiest of all -sacred rivers will cease to be holy, and will be abandoned by the pilgrim -for many centuries; how many, the wise men have not stated. At the end -of that interval it will become holy again. Meantime, the data will be -arranged by those people who have charge of all such matters, the great -chief Brahmins. It will be like shutting down a mint. At a first glance -it looks most unbrahminically uncommercial, but I am not disturbed, being -soothed and tranquilized by their reputation. "Brer fox he lay low," as -Uncle Remus says; and at the judicious time he will spring something on -the Indian public which will show that he was not financially asleep when -he took the Ganges out of the market. - -Great numbers of the natives along the roads were bringing away holy -water from the rivers. They would carry it far and wide in India and -sell it. Tavernier, the French traveler (17th century), notes that -Ganges water is often given at weddings, "each guest receiving a cup or -two, according to the liberality of the host; sometimes 2,000 or 3,000 -rupees' worth of it is consumed at a wedding." - -The Fort is a huge old structure, and has had a large experience in -religions. In its great court stands a monolith which was placed there -more than 2,000 years ago to preach (Budhism) by its pious inscription; -the Fort was built three centuries ago by a Mohammedan Emperor--a -resanctification of the place in the interest of that religion. There is -a Hindoo temple, too, with subterranean ramifications stocked with -shrines and idols; and now the Fort belongs to the English, it contains a -Christian Church. Insured in all the companies. - -From the lofty ramparts one has a fine view of the sacred rivers. They -join at that point--the pale blue Jumna, apparently clean and clear, and -the muddy Ganges, dull yellow and not clean. On a long curved spit -between the rivers, towns of tents were visible, with a multitude of -fluttering pennons, and a mighty swarm of pilgrims. It was a troublesome -place to get down to, and not a quiet place when you arrived; but it was -interesting. There was a world of activity and turmoil and noise, partly -religious, partly commercial; for the Mohammedans were there to curse and -sell, and the Hindoos to buy and pray. It is a fair as well as a -religious festival. Crowds were bathing, praying, and drinking the -purifying waters, and many sick pilgrims had come long journeys in -palanquins to be healed of their maladies by a bath; or if that might not -be, then to die on the blessed banks and so make sure of heaven. There -were fakeers in plenty, with their bodies dusted over with ashes and -their long hair caked together with cow-dung; for the cow is holy and so -is the rest of it; so holy that the good Hindoo peasant frescoes the -walls of his hut with this refuse, and also constructs ornamental figures -out of it for the gracing of his dirt floor. There were seated families, -fearfully and wonderfully painted, who by attitude and grouping -represented the families of certain great gods. There was a holy man who -sat naked by the day and by the week on a cluster of iron spikes, and did -not seem to mind it; and another holy man, who stood all day holding his -withered arms motionless aloft, and was said to have been doing it for -years. All of these performers have a cloth on the ground beside them -for the reception of contributions, and even the poorest of the people -give a trifle and hope that the sacrifice will be blessed to him. At -last came a procession of naked holy people marching by and chanting, and -I wrenched myself away. - - - - -CHAPTER L. - -The man who is ostentatious of his modesty is twin to the statue that -wears a fig-leaf. - --Pudd'nhead Wilson's New Calendar. - -The journey to Benares was all in daylight, and occupied but a few hours. -It was admirably dusty. The dust settled upon you in a thick ashy layer -and turned you into a fakeer, with nothing lacking to the role but the -cow manure and the sense of holiness. There was a change of cars about -mid-afternoon at Moghul-serai--if that was the name--and a wait of two -hours there for the Benares train. We could have found a carriage and -driven to the sacred city, but we should have lost the wait. In other -countries a long wait at a station is a dull thing and tedious, but one -has no right to have that feeling in India. You have the monster crowd -of bejeweled natives, the stir, the bustle, the confusion, the shifting -splendors of the costumes--dear me, the delight of it, the charm of it -are beyond speech. The two-hour wait was over too soon. Among other -satisfying things to look at was a minor native prince from the backwoods -somewhere, with his guard of honor, a ragged but wonderfully gaudy gang -of fifty dark barbarians armed with rusty flint-lock muskets. The -general show came so near to exhausting variety that one would have said -that no addition to it could be conspicuous, but when this Falstaff and -his motleys marched through it one saw that that seeming impossibility -had happened. - -We got away by and by, and soon reached the outer edge of Benares; then -there was another wait; but, as usual, with something to look at. This -was a cluster of little canvas-boxes--palanquins. A canvas-box is not much -of a sight--when empty; but when there is a lady in it, it is an object -of interest. These boxes were grouped apart, in the full blaze of the -terrible sun during the three-quarters of an hour that we tarried there. -They contained zenana ladies. They had to sit up; there was not room -enough to stretch out. They probably did not mind it. They are used to -the close captivity of the dwellings all their lives; when they go a -journey they are carried to the train in these boxes; in the train they -have to be secluded from inspection. Many people pity them, and I always -did it myself and never charged anything; but it is doubtful if this -compassion is valued. While we were in India some good-hearted Europeans -in one of the cities proposed to restrict a large park to the use of -zenana ladies, so that they could go there and in assured privacy go -about unveiled and enjoy the sunshine and air as they had never enjoyed -them before. The good intentions back of the proposition were -recognized, and sincere thanks returned for it, but the proposition -itself met with a prompt declination at the hands of those who were -authorized to speak for the zenana ladies. Apparently, the idea was -shocking to the ladies--indeed, it was quite manifestly shocking. Was -that proposition the equivalent of inviting European ladies to assemble -scantily and scandalously clothed in the seclusion of a private park? It -seemed to be about that. - -Without doubt modesty is nothing less than a holy feeling; and without -doubt the person whose rule of modesty has been transgressed feels the -same sort of wound that he would feel if something made holy to him by -his religion had suffered a desecration. I say "rule of modesty" because -there are about a million rules in the world, and this makes a million -standards to be looked out for. Major Sleeman mentions the case of some -high-caste veiled ladies who were profoundly scandalized when some -English young ladies passed by with faces bare to the world; so -scandalized that they spoke out with strong indignation and wondered that -people could be so shameless as to expose their persons like that. And -yet "the legs of the objectors were naked to mid-thigh." Both parties -were clean-minded and irreproachably modest, while abiding by their -separate rules, but they couldn't have traded rules for a change without -suffering considerable discomfort. All human rules are more or less -idiotic, I suppose. It is best so, no doubt. The way it is now, the -asylums can hold the sane people, but if we tried to shut up the insane -we should run out of building materials. - -You have a long drive through the outskirts of Benares before you get to -the hotel. And all the aspects are melancholy. It is a vision of dusty -sterility, decaying temples, crumbling tombs, broken mud walls, shabby -huts. The whole region seems to ache with age and penury. It must take -ten thousand years of want to produce such an aspect. We were still -outside of the great native city when we reached the hotel. It was a -quiet and homelike house, inviting, and manifestly comfortable. But we -liked its annex better, and went thither. It was a mile away, perhaps, -and stood in the midst of a large compound, and was built bungalow -fashion, everything on the ground floor, and a veranda all around. They -have doors in India, but I don't know why. They don't fasten, and they -stand open, as a rule, with a curtain hanging in the doorspace to keep -out the glare of the sun. Still, there is plenty of privacy, for no -white person will come in without notice, of course. The native men -servants will, but they don't seem to count. They glide in, barefoot and -noiseless, and are in the midst before one knows it. At first this is a -shock, and sometimes it is an embarrassment; but one has to get used to -it, and does. - -There was one tree in the compound, and a monkey lived in it. At first I -was strongly interested in the tree, for I was told that it was the -renowned peepul--the tree in whose shadow you cannot tell a lie. This -one failed to stand the test, and I went away from it disappointed. -There was a softly creaking well close by, and a couple of oxen drew -water from it by the hour, superintended by two natives dressed in the -usual "turban and pocket-handkerchief." The tree and the well were the -only scenery, and so the compound was a soothing and lonesome and -satisfying place; and very restful after so many activities. There was -nobody in our bungalow but ourselves; the other guests were in the next -one, where the table d'hote was furnished. A body could not be more -pleasantly situated. Each room had the customary bath attached--a room -ten or twelve feet square, with a roomy stone-paved pit in it and -abundance of water. One could not easily improve upon this arrangement, -except by furnishing it with cold water and excluding the hot, in -deference to the fervency of the climate; but that is forbidden. It -would damage the bather's health. The stranger is warned against taking -cold baths in India, but even the most intelligent strangers are fools, -and they do not obey, and so they presently get laid up. I was the most -intelligent fool that passed through, that year. But I am still more -intelligent now. Now that it is too late. - -I wonder if the 'dorian', if that is the name of it, is another -superstition, like the peepul tree. There was a great abundance and -variety of tropical fruits, but the dorian was never in evidence. It was -never the season for the dorian. It was always going to arrive from -Burma sometime or other, but it never did. By all accounts it was a most -strange fruit, and incomparably delicious to the taste, but not to the -smell. Its rind was said to exude a stench of so atrocious a nature that -when a dorian was in the room even the presence of a polecat was a -refreshment. We found many who had eaten the dorian, and they all spoke -of it with a sort of rapture. They said that if you could hold your nose -until the fruit was in your mouth a sacred joy would suffuse you from -head to foot that would make you oblivious to the smell of the rind, but -that if your grip slipped and you caught the smell of the rind before the -fruit was in your mouth, you would faint. There is a fortune in that -rind. Some day somebody will import it into Europe and sell it for -cheese. - -Benares was not a disappointment. It justified its reputation as a -curiosity. It is on high ground, and overhangs a grand curve of the -Ganges. It is a vast mass of building, compactly crusting a hill, and is -cloven in all directions by an intricate confusion of cracks which stand -for streets. Tall, slim minarets and beflagged temple-spires rise out of -it and give it picturesqueness, viewed from the river. The city is as -busy as an ant-hill, and the hurly-burly of human life swarming along the -web of narrow streets reminds one of the ants. The sacred cow swarms -along, too, and goes whither she pleases, and takes toll of the -grain-shops, and is very much in the way, and is a good deal of a -nuisance, since she must not be molested. - -Benares is older than history, older than tradition, older even than -legend, and looks twice as old as all of them put together. From a -Hindoo statement quoted in Rev. Mr. Parker's compact and lucid Guide to -Benares, I find that the site of the town was the beginning-place of the -Creation. It was merely an upright "lingam," at first, no larger than a -stove-pipe, and stood in the midst of a shoreless ocean. This was the -work of the God Vishnu. Later he spread the lingam out till its surface -was ten miles across. Still it was not large enough for the business; -therefore he presently built the globe around it. Benares is thus the -center of the earth. This is considered an advantage. - -It has had a tumultuous history, both materially and spiritually. It -started Brahminically, many ages ago; then by and by Buddha came in -recent times 2,500 years ago, and after that it was Buddhist during many -centuries--twelve, perhaps--but the Brahmins got the upper hand again, -then, and have held it ever since. It is unspeakably sacred in Hindoo -eyes, and is as unsanitary as it is sacred, and smells like the rind of -the dorian. It is the headquarters of the Brahmin faith, and one-eighth -of the population are priests of that church. But it is not an -overstock, for they have all India as a prey. All India flocks thither -on pilgrimage, and pours its savings into the pockets of the priests in a -generous stream, which never fails. A priest with a good stand on the -shore of the Ganges is much better off than the sweeper of the best -crossing in London. A good stand is worth a world of money. The holy -proprietor of it sits under his grand spectacular umbrella and blesses -people all his life, and collects his commission, and grows fat and rich; -and the stand passes from father to son, down and down and down through -the ages, and remains a permanent and lucrative estate in the family. As -Mr. Parker suggests, it can become a subject of dispute, at one time or -another, and then the matter will be settled, not by prayer and fasting -and consultations with Vishnu, but by the intervention of a much more -puissant power--an English court. In Bombay I was told by an American -missionary that in India there are 640 Protestant missionaries at work. -At first it seemed an immense force, but of course that was a thoughtless -idea. One missionary to 500,000 natives--no, that is not a force; it is -the reverse of it; 640 marching against an intrenched camp of -300,000,000--the odds are too great. A force of 640 in Benares alone -would have its hands over-full with 8,000 Brahmin priests for adversary. -Missionaries need to be well equipped with hope and confidence, and this -equipment they seem to have always had in all parts of the world. Mr. -Parker has it. It enables him to get a favorable outlook out of -statistics which might add up differently with other mathematicians. For -instance: - -"During the past few years competent observers declare that the number of -pilgrims to Benares has increased." - -And then he adds up this fact and gets this conclusion: - -"But the revival, if so it may be called, has in it the marks of death. -It is a spasmodic struggle before dissolution." - -In this world we have seen the Roman Catholic power dying, upon these -same terms, for many centuries. Many a time we have gotten all ready for -the funeral and found it postponed again, on account of the weather or -something. Taught by experience, we ought not to put on our things for -this Brahminical one till we see the procession move. Apparently one of -the most uncertain things in the world is the funeral of a religion. - -I should have been glad to acquire some sort of idea of Hindoo theology, -but the difficulties were too great, the matter was too intricate. Even -the mere A, B, C of it is baffling. - -There is a trinity--Brahma, Shiva, and Vishnu--independent powers, -apparently, though one cannot feel quite sure of that, because in one of -the temples there is an image where an attempt has been made to -concentrate the three in one person. The three have other names and -plenty of them, and this makes confusion in one's mind. The three have -wives and the wives have several names, and this increases the confusion. -There are children, the children have many names, and thus the confusion -goes on and on. It is not worth while to try to get any grip upon the -cloud of minor gods, there are too many of them. - -It is even a justifiable economy to leave Brahma, the chiefest god of -all, out of your studies, for he seems to cut no great figure in India. -The vast bulk of the national worship is lavished upon Shiva and Vishnu -and their families. Shiva's symbol--the "lingam" with which Vishnu began -the Creation--is worshiped by everybody, apparently. It is the commonest -object in Benares. It is on view everywhere, it is garlanded with -flowers, offerings are made to it, it suffers no neglect. Commonly it is -an upright stone, shaped like a thimble-sometimes like an elongated -thimble. This priapus-worship, then, is older than history. Mr. Parker -says that the lingams in Benares "outnumber the inhabitants." - -In Benares there are many Mohammedan mosques. There are Hindoo temples -without number--these quaintly shaped and elaborately sculptured little -stone jugs crowd all the lanes. The Ganges itself and every individual -drop of water in it are temples. Religion, then, is the business of -Benares, just as gold-production is the business of Johannesburg. Other -industries count for nothing as compared with the vast and all-absorbing -rush and drive and boom of the town's specialty. Benares is the -sacredest of sacred cities. The moment you step across the -sharply-defined line which separates it from the rest of the globe, you -stand upon ineffably and unspeakably holy ground. Mr. Parker says: "It -is impossible to convey any adequate idea of the intense feelings of -veneration and affection with which the pious Hindoo regards 'Holy Kashi' -(Benares)." And then he gives you this vivid and moving picture: - - "Let a Hindoo regiment be marched through the district, and as soon - as they cross the line and enter the limits of the holy place they - rend the air with cries of 'Kashi ji ki jai--jai--jai! (Holy - Kashi! Hail to thee! Hail! Hail! Hail)'. The weary pilgrim - scarcely able to stand, with age and weakness, blinded by the dust - and heat, and almost dead with fatigue, crawls out of the oven-like - railway carriage and as soon as his feet touch the ground he lifts - up his withered hands and utters the same pious exclamation. Let a - European in some distant city in casual talk in the bazar mention - the fact that he has lived at Benares, and at once voices will be - raised to call down blessings on his head, for a dweller in Benares - is of all men most blessed." - -It makes our own religious enthusiasm seem pale and cold. Inasmuch as -the life of religion is in the heart, not the head, Mr. Parker's touching -picture seems to promise a sort of indefinite postponement of that -funeral. - - - - -CHAPTER LI. - -Let me make the superstitions of a nation and I care not who makes its -laws or its songs either. - --Pudd'nhead Wilson's New Calendar. - -Yes, the city of Benares is in effect just a big church, a religious -hive, whose every cell is a temple, a shrine or a mosque, and whose every -conceivable earthly and heavenly good is procurable under one roof, so to -speak--a sort of Army and Navy Stores, theologically stocked. - -I will make out a little itinerary for the pilgrim; then you will see how -handy the system is, how convenient, how comprehensive. If you go to -Benares with a serious desire to spiritually benefit yourself, you will -find it valuable. I got some of the facts from conversations with the -Rev. Mr. Parker and the others from his Guide to Benares; they are -therefore trustworthy. - -1. Purification. At sunrise you must go down to the Ganges and bathe, -pray, and drink some of the water. This is for your general -purification. - -2. Protection against Hunger. Next, you must fortify yourself against -the sorrowful earthly ill just named. This you will do by worshiping for -a moment in the Cow Temple. By the door of it you will find an image of -Ganesh, son of Shiva; it has the head of an elephant on a human body; its -face and hands are of silver. You will worship it a little, and pass on, -into a covered veranda, where you will find devotees reciting from the -sacred books, with the help of instructors. In this place are groups of -rude and dismal idols. You may contribute something for their support; -then pass into the temple, a grim and stenchy place, for it is populous -with sacred cows and with beggars. You will give something to the -beggars, and "reverently kiss the tails" of such cows as pass along, for -these cows are peculiarly holy, and this act of worship will secure you -from hunger for the day. - -3. "The Poor Man's Friend." You will next worship this god. He is at -the bottom of a stone cistern in the temple of Dalbhyeswar, under the -shade of a noble peepul tree on the bluff overlooking the Ganges, so you -must go back to the river. The Poor Man's Friend is the god of material -prosperity in general, and the god of the rain in particular. You will -secure material prosperity, or both, by worshiping him. He is Shiva, -under a new alias, and he abides in the bottom of that cistern, in the -form of a stone lingam. You pour Ganges water over him, and in return -for this homage you get the promised benefits. If there is any delay -about the rain, you must pour water in until the cistern is full; the -rain will then be sure to come. - -4. Fever. At the Kedar Ghat you will find a long flight of stone steps -leading down to the river. Half way down is a tank filled with sewage. -Drink as much of it as you want. It is for fever. - -5. Smallpox. Go straight from there to the central Ghat. At its -upstream end you will find a small whitewashed building, which is a -temple sacred to Sitala, goddess of smallpox. Her under-study is there ---a rude human figure behind a brass screen. You will worship this for -reasons to be furnished presently. - -6. The Well of Fate. For certain reasons you will next go and do homage -at this well. You will find it in the Dandpan Temple, in the city. The -sunlight falls into it from a square hole in the masonry above. You will -approach it with awe, for your life is now at stake. You will bend over -and look. If the fates are propitious, you will see your face pictured -in the water far down in the well. If matters have been otherwise -ordered, a sudden cloud will mask the sun and you will see nothing. This -means that you have not six months to live. If you are already at the -point of death, your circumstances are now serious. There is no time to -lose. Let this world go, arrange for the next one. Handily situated, at -your very elbow, is opportunity for this. You turn and worship the image -of Maha Kal, the Great Fate, and happiness in the life to come is -secured. If there is breath in your body yet, you should now make an -effort to get a further lease of the present life. You have a chance. -There is a chance for everything in this admirably stocked and -wonderfully systemized Spiritual and Temporal Army and Navy Store. You -must get yourself carried to the - -7. Well of Long Life. This is within the precincts of the mouldering and -venerable Briddhkal Temple, which is one of the oldest in Benares. You -pass in by a stone image of the monkey god, Hanuman, and there, among the -ruined courtyards, you will find a shallow pool of stagnant sewage. It -smells like the best limburger cheese, and is filthy with the washings of -rotting lepers, but that is nothing, bathe in it; bathe in it gratefully -and worshipfully, for this is the Fountain of Youth; these are the Waters -of Long Life. Your gray hairs will disappear, and with them your -wrinkles and your rheumatism, the burdens of care and the weariness of -age, and you will come out young, fresh, elastic, and full of eagerness -for the new race of life. Now will come flooding upon you the manifold -desires that haunt the dear dreams of the morning of life. You will go -whither you will find - -8. Fulfillment of Desire. To wit, to the Kameshwar Temple, sacred to -Shiva as the Lord of Desires. Arrange for yours there. And if you like -to look at idols among the pack and jam of temples, there you will find -enough to stock a museum. You will begin to commit sins now with a -fresh, new vivacity; therefore, it will be well to go frequently to a -place where you can get - -9. Temporary Cleansing from Sin. To wit, to the Well of the Earring. -You must approach this with the profoundest reverence, for it is -unutterably sacred. It is, indeed, the most sacred place in Benares, the -very Holy of Holies, in the estimation of the people. It is a railed -tank, with stone stairways leading down to the water. The water is not -clean. Of course it could not be, for people are always bathing in it. -As long as you choose to stand and look, you will see the files of -sinners descending and ascending--descending soiled with sin, ascending -purged from it. "The liar, the thief, the murderer, and the adulterer -may here wash and be clean," says the Rev. Mr. Parker, in his book. Very -well. I know Mr. Parker, and I believe it; but if anybody else had said -it, I should consider him a person who had better go down in the tank and -take another wash. The god Vishnu dug this tank. He had nothing to dig -with but his "discus." I do not know what a discus is, but I know it is a -poor thing to dig tanks with, because, by the time this one was finished, -it was full of sweat--Vishnu's sweat. He constructed the site that -Benares stands on, and afterward built the globe around it, and thought -nothing of it, yet sweated like that over a little thing like this tank. -One of these statements is doubtful. I do not know which one it is, but -I think it difficult not to believe that a god who could build a world -around Benares would not be intelligent enough to build it around the -tank too, and not have to dig it. Youth, long life, temporary -purification from sin, salvation through propitiation of the Great Fate ---these are all good. But you must do something more. You must - -10. Make Salvation Sure. There are several ways. To get drowned in -the Ganges is one, but that is not pleasant. To die within the limits of -Benares is another; but that is a risky one, because you might be out of -town when your time came. The best one of all is the Pilgrimage Around -the City. You must walk; also, you must go barefoot. The tramp is -forty-four miles, for the road winds out into the country a piece, and -you will be marching five or six days. But you will have plenty of -company. You will move with throngs and hosts of happy pilgrims whose -radiant costumes will make the spectacle beautiful and whose glad songs -and holy pans of triumph will banish your fatigues and cheer your spirit; -and at intervals there will be temples where you may sleep and be -refreshed with food. The pilgrimage completed, you have purchased -salvation, and paid for it. But you may not get it unless you - -11. Get Your Redemption Recorded. You can get this done at the Sakhi -Binayak Temple, and it is best to do it, for otherwise you might not be -able to prove that you had made the pilgrimage in case the matter should -some day come to be disputed. That temple is in a lane back of the Cow -Temple. Over the door is a red image of Ganesh of the elephant head, son -and heir of Shiva, and Prince of Wales to the Theological Monarchy, so to -speak. Within is a god whose office it is to record your pilgrimage and -be responsible for you. You will not see him, but you will see a Brahmin -who will attend to the matter and take the money. If he should forget to -collect the money, you can remind him. He knows that your salvation is -now secure, but of course you would like to know it yourself. You have -nothing to do but go and pray, and pay at the - -12. Well of the Knowledge of Salvation. It is close to the Golden -Temple. There you will see, sculptured out of a single piece of black -marble, a bull which is much larger than any living bull you have ever -seen, and yet is not a good likeness after all. And there also you will -see a very uncommon thing--an image of Shiva. You have seen his lingam -fifty thousand times already, but this is Shiva himself, and said to be a -good likeness. It has three eyes. He is the only god in the firm that -has three. "The well is covered by a fine canopy of stone supported by -forty pillars," and around it you will find what you have already seen at -almost every shrine you have visited in Benares, a mob of devout and -eager pilgrims. The sacred water is being ladled out to them; with it -comes to them the knowledge, clear, thrilling, absolute, that they are -saved; and you can see by their faces that there is one happiness in this -world which is supreme, and to which no other joy is comparable. You -receive your water, you make your deposit, and now what more would you -have? Gold, diamonds, power, fame? All in a single moment these things -have withered to dirt, dust, ashes. The world has nothing to give you -now. For you it is bankrupt. - -I do not claim that the pilgrims do their acts of worship in the order -and sequence above charted out in this Itinerary of mine, but I think -logic suggests that they ought to do so. Instead of a helter-skelter -worship, we then have a definite starting-place, and a march which -carries the pilgrim steadily forward by reasoned and logical progression -to a definite goal. Thus, his Ganges bath in the early morning gives him -an appetite; he kisses the cow-tails, and that removes it. It is now -business hours, and longings for material prosperity rise in his mind, -and be goes and pours water over Shiva's symbol; this insures the -prosperity, but also brings on a rain, which gives him a fever. Then he -drinks the sewage at the Kedar Ghat to cure the fever; it cures the fever -but gives him the smallpox. He wishes to know how it is going to turn -out; he goes to the Dandpan Temple and looks down the well. A clouded -sun shows him that death is near. Logically his best course for the -present, since he cannot tell at what moment he may die, is to secure a -happy hereafter; this he does, through the agency of the Great Fate. He -is safe, now, for heaven; his next move will naturally be to keep out of -it as long as he can. Therefore he goes to the Briddhkal Temple and -secures Youth and long life by bathing in a puddle of leper-pus which -would kill a microbe. Logically, Youth has re-equipped him for sin and -with the disposition to commit it; he will naturally go to the fane which -is consecrated to the Fulfillment of Desires, and make arrangements. -Logically, he will now go to the Well of the Earring from time to time to -unload and freshen up for further banned enjoyments. But first and last -and all the time he is human, and therefore in his reflective intervals -he will always be speculating in "futures." He will make the Great -Pilgrimage around the city and so make his salvation absolutely sure; he -will also have record made of it, so that it may remain absolutely sure -and not be forgotten or repudiated in the confusion of the Final -Settlement. Logically, also, he will wish to have satisfying and -tranquilizing personal knowledge that that salvation is secure; therefore -he goes to the Well of the Knowledge of Salvation, adds that completing -detail, and then goes about his affairs serene and content; serene and -content, for he is now royally endowed with an advantage which no -religion in this world could give him but his own; for henceforth he may -commit as many million sins as he wants to and nothing can come of it. - -Thus the system, properly and logically ordered, is neat, compact, -clearly defined, and covers the whole ground. I desire to recommend it -to such as find the other systems too difficult, exacting, and irksome -for the uses of this fretful brief life of ours. - -However, let me not deceive any one. My Itinerary lacks a detail. I -must put it in. The truth is, that after the pilgrim has faithfully -followed the requirements of the Itinerary through to the end and has -secured his salvation and also the personal knowledge of that fact, there -is still an accident possible to him which can annul the whole thing. If -he should ever cross to the other side of the Ganges and get caught out -and die there he would at once come to life again in the form of an ass. -Think of that, after all this trouble and expense. You see how -capricious and uncertain salvation is there. The Hindoo has a childish -and unreasoning aversion to being turned into an ass. It is hard to tell -why. One could properly expect an ass to have an aversion to being -turned into a Hindoo. One could understand that he could lose dignity by -it; also self-respect, and nine-tenths of his intelligence. But the -Hindoo changed into an ass wouldn't lose anything, unless you count his -religion. And he would gain much--release from his slavery to two -million gods and twenty million priests, fakeers, holy mendicants, and -other sacred bacilli; he would escape the Hindoo hell; he would also -escape the Hindoo heaven. These are advantages which the Hindoo ought to -consider; then he would go over and die on the other side. - -Benares is a religious Vesuvius. In its bowels the theological forces -have been heaving and tossing, rumbling, thundering and quaking, boiling, -and weltering and flaming and smoking for ages. But a little group of -missionaries have taken post at its base, and they have hopes. There are -the Baptist Missionary Society, the Church Missionary Society, the London -Missionary Society, the Wesleyan Missionary Society, and the Zenana Bible -and Medical Mission. They have schools, and the principal work seems to -be among the children. And no doubt that part of the work prospers best, -for grown people everywhere are always likely to cling to the religion -they were brought up in. - - - - -CHAPTER LII. - -Wrinkles should merely indicate where smiles have been. - --Pudd'nhead Wilson's New Calendar. - -In one of those Benares temples we saw a devotee working for salvation in -a curious way. He had a huge wad of clay beside him and was making it up -into little wee gods no bigger than carpet tacks. He stuck a grain of -rice into each--to represent the lingam, I think. He turned them out -nimbly, for he had had long practice and had acquired great facility. -Every day he made 2,000 gods, then threw them into the holy Ganges. This -act of homage brought him the profound homage of the pious--also their -coppers. He had a sure living here, and was earning a high place in the -hereafter. - -The Ganges front is the supreme show-place of Benares. Its tall bluffs -are solidly caked from water to summit, along a stretch of three miles, -with a splendid jumble of massive and picturesque masonry, a bewildering -and beautiful confusion of stone platforms, temples, stair-flights, rich -and stately palaces--nowhere a break, nowhere a glimpse of the bluff -itself; all the long face of it is compactly walled from sight by this -crammed perspective of platforms, soaring stairways, sculptured temples, -majestic palaces, softening away into the distances; and there is -movement, motion, human life everywhere, and brilliantly costumed ---streaming in rainbows up and down the lofty stairways, and massed in -metaphorical flower-gardens on the miles of great platforms at the -river's edge. - -All this masonry, all this architecture represents piety. The palaces -were built by native princes whose homes, as a rule, are far from -Benares, but who go there from time to time to refresh their souls with -the sight and touch of the Ganges, the river of their idolatry. The -stairways are records of acts of piety; the crowd of costly little -temples are tokens of money spent by rich men for present credit and hope -of future reward. Apparently, the rich Christian who spends large sums -upon his religion is conspicuous with us, by his rarity, but the rich -Hindoo who doesn't spend large sums upon his religion is seemingly -non-existent. With us the poor spend money on their religion, but they -keep back some to live on. Apparently, in India, the poor bankrupt -themselves daily for their religion. The rich Hindoo can afford his -pious outlays; he gets much glory for his spendings, yet keeps back a -sufficiency of his income for temporal purposes; but the poor Hindoo is -entitled to compassion, for his spendings keep him poor, yet get him no -glory. - -We made the usual trip up and down the river, seated in chairs under an -awning on the deck of the usual commodious hand-propelled ark; made it -two or three times, and could have made it with increasing interest and -enjoyment many times more; for, of course, the palaces and temples would -grow more and more beautiful every time one saw them, for that happens -with all such things; also, I think one would not get tired of the -bathers, nor their costumes, nor of their ingenuities in getting out of -them and into them again without exposing too much bronze, nor of their -devotional gesticulations and absorbed bead-tellings. - -But I should get tired of seeing them wash their mouths with that -dreadful water and drink it. In fact, I did get tired of it, and very -early, too. At one place where we halted for a while, the foul gush from -a sewer was making the water turbid and murky all around, and there was a -random corpse slopping around in it that had floated down from up -country. Ten steps below that place stood a crowd of men, women, and -comely young maidens waist deep in the water-and they were scooping it up -in their hands and drinking it. Faith can certainly do wonders, and this -is an instance of it. Those people were not drinking that fearful stuff -to assuage thirst, but in order to purify their souls and the interior of -their bodies. According to their creed, the Ganges water makes -everything pure that it touches--instantly and utterly pure. The sewer -water was not an offence to them, the corpse did not revolt them; the -sacred water had touched both, and both were now snow-pure, and could -defile no one. The memory of that sight will always stay by me; but not -by request. - -A word further concerning the nasty but all-purifying Ganges water. When -we went to Agra, by and by, we happened there just in time to be in at -the birth of a marvel--a memorable scientific discovery--the discovery -that in certain ways the foul and derided Ganges water is the most -puissant purifier in the world! This curious fact, as I have said, had -just been added to the treasury of modern science. It had long been -noted as a strange thing that while Benares is often afflicted with the -cholera she does not spread it beyond her borders. This could not be -accounted for. Mr. Henkin, the scientist in the employ of the government -of Agra, concluded to examine the water. He went to Benares and made his -tests. He got water at the mouths of the sewers where they empty into -the river at the bathing ghats; a cubic centimetre of it contained -millions of germs; at the end of six hours they were all dead. He caught -a floating corpse, towed it to the shore, and from beside it he dipped up -water that was swarming with cholera germs; at the end of six hours they -were all dead. He added swarm after swarm of cholera germs to this -water; within the six hours they always died, to the last sample. -Repeatedly, he took pure well water which was bare of animal life, and -put into it a few cholera germs; they always began to propagate at once, -and always within six hours they swarmed--and were numberable by millions -upon millions. - -For ages and ages the Hindoos have had absolute faith that the water of -the Ganges was absolutely pure, could not be defiled by any contact -whatsoever, and infallibly made pure and clean whatsoever thing touched -it. They still believe it, and that is why they bathe in it and drink -it, caring nothing for its seeming filthiness and the floating corpses. -The Hindoos have been laughed at, these many generations, but the -laughter will need to modify itself a little from now on. How did -they find out the water's secret in those ancient ages? Had they -germ-scientists then? We do not know. We only know that they had a -civilization long before we emerged from savagery. But to return to -where I was before; I was about to speak of the burning-ghat. - -They do not burn fakeers--those revered mendicants. They are so holy -that they can get to their place without that sacrament, provided they be -consigned to the consecrating river. We saw one carried to mid-stream -and thrown overboard. He was sandwiched between two great slabs of -stone. - -We lay off the cremation-ghat half an hour and saw nine corpses burned. -I should not wish to see any more of it, unless I might select the -parties. The mourners follow the bier through the town and down to the -ghat; then the bier-bearers deliver the body to some low-caste natives ---Doms--and the mourners turn about and go back home. I heard no crying -and saw no tears, there was no ceremony of parting. Apparently, these -expressions of grief and affection are reserved for the privacy of the -home. The dead women came draped in red, the men in white. They are -laid in the water at the river's edge while the pyre is being prepared. - -The first subject was a man. When the Doms unswathed him to wash him, he -proved to be a sturdily built, well-nourished and handsome old gentleman, -with not a sign about him to suggest that he had ever been ill. Dry wood -was brought and built up into a loose pile; the corpse was laid upon it -and covered over with fuel. Then a naked holy man who was sitting on -high ground a little distance away began to talk and shout with great -energy, and he kept up this noise right along. It may have been the -funeral sermon, and probably was. I forgot to say that one of the -mourners remained behind when the others went away. This was the dead -man's son, a boy of ten or twelve, brown and handsome, grave and -self-possessed, and clothed in flowing white. He was there to burn his -father. He was given a torch, and while he slowly walked seven times -around the pyre the naked black man on the high ground poured out his -sermon more clamorously than ever. The seventh circuit completed, the -boy applied the torch at his father's head, then at his feet; the flames -sprang briskly up with a sharp crackling noise, and the lad went away. -Hindoos do not want daughters, because their weddings make such a ruinous -expense; but they want sons, so that at death they may have honorable -exit from the world; and there is no honor equal to the honor of having -one's pyre lighted by one's son. The father who dies sonless is in a -grievous situation indeed, and is pitied. Life being uncertain, the -Hindoo marries while he is still a boy, in the hope that he will have a -son ready when the day of his need shall come. But if he have no son, he -will adopt one. This answers every purpose. - -Meantime the corpse is burning, also several others. It is a dismal -business. The stokers did not sit down in idleness, but moved briskly -about, punching up the fires with long poles, and now and then adding -fuel. Sometimes they hoisted the half of a skeleton into the air, then -slammed it down and beat it with the pole, breaking it up so that it -would burn better. They hoisted skulls up in the same way and banged and -battered them. The sight was hard to bear; it would have been harder if -the mourners had stayed to witness it. I had but a moderate desire to -see a cremation, so it was soon satisfied. For sanitary reasons it would -be well if cremation were universal; but this form is revolting, and not -to be recommended. - -The fire used is sacred, of course--for there is money in it. Ordinary -fire is forbidden; there is no money in it. I was told that this sacred -fire is all furnished by one person, and that he has a monopoly of it and -charges a good price for it. Sometimes a rich mourner pays a thousand -rupees for it. To get to paradise from India is an expensive thing. -Every detail connected with the matter costs something, and helps to -fatten a priest. I suppose it is quite safe to conclude that that -fire-bug is in holy orders. - -Close to the cremation-ground stand a few time-worn stones which are -remembrances of the suttee. Each has a rough carving upon it, -representing a man and a woman standing or walking hand in hand, and -marks the spot where a widow went to her death by fire in the days when -the suttee flourished. Mr. Parker said that widows would burn themselves -now if the government would allow it. The family that can point to one -of these little memorials and say: "She who burned herself there was an -ancestress of ours," is envied. - -It is a curious people. With them, all life seems to be sacred except -human life. Even the life of vermin is sacred, and must not be taken. -The good Jain wipes off a seat before using it, lest he cause the death -of-some valueless insect by sitting down on it. It grieves him to have -to drink water, because the provisions in his stomach may not agree with -the microbes. Yet India invented Thuggery and the Suttee. India is a -hard country to understand. We went to the temple of the Thug goddess, -Bhowanee, or Kali, or Durga. She has these names and others. She is the -only god to whom living sacrifices are made. Goats are sacrificed to -her. Monkeys would be cheaper. There are plenty of them about the -place. Being sacred, they make themselves very free, and scramble around -wherever they please. The temple and its porch are beautifully carved, -but this is not the case with the idol. Bhowanee is not pleasant to look -at. She has a silver face, and a projecting swollen tongue painted a -deep red. She wears a necklace of skulls. - -In fact, none of the idols in Benares are handsome or attractive. And -what a swarm of them there is! The town is a vast museum of idols--and -all of them crude, misshapen, and ugly. They flock through one's dreams -at night, a wild mob of nightmares. When you get tired of them in the -temples and take a trip on the river, you find idol giants, flashily -painted, stretched out side by side on the shore. And apparently -wherever there is room for one more lingam, a lingam is there. If Vishnu -had foreseen what his town was going to be, he would have called it -Idolville or Lingamburg. - -The most conspicuous feature of Benares is the pair of slender white -minarets which tower like masts from the great Mosque of Aurangzeb. They -seem to be always in sight, from everywhere, those airy, graceful, -inspiring things. But masts is not the right word, for masts have a -perceptible taper, while these minarets have not. They are 142 feet -high, and only 8 1/2 feet in diameter at the base, and 7 1/2 at the -summit--scarcely any taper at all. These are the proportions of a -candle; and fair and fairylike candles these are. Will be, anyway, some -day, when the Christians inherit them and top them with the electric -light. There is a great view from up there--a wonderful view. A large -gray monkey was part of it, and damaged it. A monkey has no judgment. -This one was skipping about the upper great heights of the mosque ---skipping across empty yawning intervals which were almost too wide for -him, and which he only just barely cleared, each time, by the skin of his -teeth. He got me so nervous that I couldn't look at the view. I -couldn't look at anything but him. Every time he went sailing over one -of those abysses my breath stood still, and when he grabbed for the perch -he was going for, I grabbed too, in sympathy. And he was perfectly -indifferent, perfectly unconcerned, and I did all the panting myself. -He came within an ace of losing his life a dozen times, and I was so -troubled about him that I would have shot him if I had had anything to do -it with. But I strongly recommend the view. There is more monkey than -view, and there is always going to be more monkey while that idiot -survives, but what view you get is superb. All Benares, the river, and -the region round about are spread before you. Take a gun, and look at -the view. - -The next thing I saw was more reposeful. It was a new kind of art. It -was a picture painted on water. It was done by a native. He sprinkled -fine dust of various colors on the still surface of a basin of water, and -out of these sprinklings a dainty and pretty picture gradually grew, a -picture which a breath could destroy. Somehow it was impressive, after -so much browsing among massive and battered and decaying fanes that rest -upon ruins, and those ruins upon still other ruins, and those upon still -others again. It was a sermon, an allegory, a symbol of Instability. -Those creations in stone were only a kind of water pictures, after all. - -A prominent episode in the Indian career of Warren Hastings had Benares -for its theater. Wherever that extraordinary man set his foot, he left -his mark. He came to Benares in 1781 to collect a fine of L500,000 which -he had levied upon its Rajah, Cheit Singly on behalf of the East India -Company. Hastings was a long way from home and help. There were, -probably, not a dozen Englishmen within reach; the Rajah was in his fort -with his myriads around him. But no matter. From his little camp in a -neighboring garden, Hastings sent a party to arrest the sovereign. He -sent on this daring mission a couple of hundred native soldiers sepoys ---under command of three young English lieutenants. The Rajah submitted -without a word. The incident lights up the Indian situation -electrically, and gives one a vivid sense of the strides which the -English had made and the mastership they had acquired in the land since -the date of Clive's great victory. In a quarter of a century, from being -nobodies, and feared by none, they were become confessed lords and -masters, feared by all, sovereigns included, and served by all, -sovereigns included. It makes the fairy tales sound true. The English -had not been afraid to enlist native soldiers to fight against their own -people and keep them obedient. And now Hastings was not afraid to come -away out to this remote place with a handful of such soldiers and send -them to arrest a native sovereign. - -The lieutenants imprisoned the Rajah in his own fort. It was beautiful, -the pluckiness of it, the impudence of it. The arrest enraged the -Rajah's people, and all Benares came storming about the place and -threatening vengeance. And yet, but for an accident, nothing important -would have resulted, perhaps. The mob found out a most strange thing, an -almost incredible thing--that this handful of soldiers had come on this -hardy errand with empty guns and no ammunition. This has been attributed -to thoughtlessness, but it could hardly have been that, for in such large -emergencies as this, intelligent people do think. It must have been -indifference, an over-confidence born of the proved submissiveness of the -native character, when confronted by even one or two stern Britons in -their war paint. But, however that may be, it was a fatal discovery that -the mob had made. They were full of courage, now, and they broke into -the fort and massacred the helpless soldiers and their officers. -Hastings escaped from Benares by night and got safely away, leaving the -principality in a state of wild insurrection; but he was back again -within the month, and quieted it down in his prompt and virile way, and -took the Rajah's throne away from him and gave it to another man. He was -a capable kind of person was Warren Hastings. This was the only time he -was ever out of ammunition. Some of his acts have left stains upon his -name which can never be washed away, but he saved to England the Indian -Empire, and that was the best service that was ever done to the Indians -themselves, those wretched heirs of a hundred centuries of pitiless -oppression and abuse. - - - - -CHAPTER LIII. - -True irreverence is disrespect for another man's god. - --Pudd'nhead Wilson's New Calendar. - -It was in Benares that I saw another living god. That makes two. -I believe I have seen most of the greater and lesser wonders of the -world, but I do not remember that any of them interested me so -overwhelmingly as did that pair of gods. - -When I try to account for this effect I find no difficulty about it. -I find that, as a rule, when a thing is a wonder to us it is not because -of what we see in it, but because of what others have seen in it. We get -almost all our wonders at second hand. We are eager to see any -celebrated thing--and we never fail of our reward; just the deep -privilege of gazing upon an object which has stirred the enthusiasm or -evoked the reverence or affection or admiration of multitudes of our race -is a thing which we value; we are profoundly glad that we have seen it, -we are permanently enriched from having seen it, we would not part with -the memory of that experience for a great price. And yet that very -spectacle may be the Taj. You cannot keep your enthusiasms down, you -cannot keep your emotions within bounds when that soaring bubble of -marble breaks upon your view. But these are not your enthusiasms and -emotions--they are the accumulated emotions and enthusiasms of a thousand -fervid writers, who have been slowly and steadily storing them up in your -heart day by day and year by year all your life; and now they burst out -in a flood and overwhelm you; and you could not be a whit happier if they -were your very own. By and by you sober down, and then you perceive that -you have been drunk on the smell of somebody else's cork. For ever and -ever the memory of my distant first glimpse of the Taj will compensate me -for creeping around the globe to have that great privilege. - -But the Taj--with all your inflation of delusive emotions, acquired at -second-hand from people to whom in the majority of cases they were also -delusions acquired at second-hand--a thing which you fortunately did not -think of or it might have made you doubtful of what you imagined were -your own what is the Taj as a marvel, a spectacle and an uplifting and -overpowering wonder, compared with a living, breathing, speaking -personage whom several millions of human beings devoutly and sincerely -and unquestioningly believe to be a God, and humbly and gratefully -worship as a God? - -He was sixty years old when I saw him. He is called Sri 108 Swami -Bhaskarananda Saraswati. That is one form of it. I think that that is -what you would call him in speaking to him--because it is short. But you -would use more of his name in addressing a letter to him; courtesy would -require this. Even then you would not have to use all of it, but only -this much: - -Sri 108 Matparamahansrzpairivrajakacharyaswamibhaskaranandasaraswati. - -You do not put "Esq." after it, for that is not necessary. The word -which opens the volley is itself a title of honor "Sri." The "108" -stands for the rest of his names, I believe. Vishnu has 108 names which -he does not use in business, and no doubt it is a custom of gods and a -privilege sacred to their order to keep 108 extra ones in stock. Just -the restricted name set down above is a handsome property, without the -108. By my count it has 58 letters in it. This removes the long German -words from competition; they are permanently out of the race. - -Sri 108 S. B. Saraswati has attained to what among the Hindoos is called -the "state of perfection." It is a state which other Hindoos reach by -being born again and again, and over and over again into this world, -through one re-incarnation after another--a tiresome long job covering -centuries and decades of centuries, and one that is full of risks, too, -like the accident of dying on the wrong side of the Ganges some time or -other and waking up in the form of an ass, with a fresh start necessary -and the numerous trips to be made all over again. But in reaching -perfection, Sri 108 S. B. S. has escaped all that. He is no longer a -part or a feature of this world; his substance has changed, all -earthiness has departed out of it; he is utterly holy, utterly pure; -nothing can desecrate this holiness or stain this purity; he is no longer -of the earth, its concerns are matters foreign to him, its pains and -griefs and troubles cannot reach him. When he dies, Nirvana is his; he -will be absorbed into the substance of the Supreme Deity and be at peace -forever. - -The Hindoo Scriptures point out how this state is to be reached, but it -is only once in a thousand years, perhaps, that candidate accomplishes -it. This one has traversed the course required, stage by stage, from the -beginning to the end, and now has nothing left to do but wait for the -call which shall release him from a world in which he has now no part nor -lot. First, he passed through the student stage, and became learned in -the holy books. Next he became citizen, householder, husband, and -father. That was the required second stage. Then--like John Bunyan's -Christian he bade perpetual good-bye to his family, as required, and went -wandering away. He went far into the desert and served a term as hermit. -Next, he became a beggar, "in accordance with the rites laid down in the -Scriptures," and wandered about India eating the bread of mendicancy. A -quarter of a century ago he reached the stage of purity. This needs no -garment; its symbol is nudity; he discarded the waist-cloth which he had -previously worn. He could resume it now if he chose, for neither that -nor any other contact can defile him; but he does not choose. - -There are several other stages, I believe, but I do not remember what -they are. But he has been through them. Throughout the long course he -was perfecting himself in holy learning, and writing commentaries upon -the sacred books. He was also meditating upon Brahma, and he does that -now. - -White marble relief-portraits of him are sold all about India. He lives -in a good house in a noble great garden in Benares, all meet and proper -to his stupendous rank. Necessarily he does not go abroad in the -streets. Deities would never be able to move about handily in any -country. If one whom we recognized and adored as a god should go abroad -in our streets, and the day it was to happen were known, all traffic -would be blocked and business would come to a standstill. - -This god is comfortably housed, and yet modestly, all things considered, -for if he wanted to live in a palace he would only need to speak and his -worshipers would gladly build it. Sometimes he sees devotees for a -moment, and comforts them and blesses them, and they kiss his feet and go -away happy. Rank is nothing to him, he being a god. To him all men are -alike. He sees whom he pleases and denies himself to whom he pleases. -Sometimes he sees a prince and denies himself to a pauper; at other times -he receives the pauper and turns the prince away. However, he does not -receive many of either class. He has to husband his time for his -meditations. I think he would receive Rev. Mr. Parker at any time. I -think he is sorry for Mr. Parker, and I think Mr. Parker is sorry for -him; and no doubt this compassion is good for both of them. - -When we arrived we had to stand around in the garden a little while and -wait, and the outlook was not good, for he had been turning away -Maharajas that day and receiving only the riff-raff, and we belonged in -between, somewhere. But presently, a servant came out saying it was all -right, he was coming. - -And sure enough, he came, and I saw him--that object of the worship of -millions. It was a strange sensation, and thrilling. I wish I could -feel it stream through my veins again. And yet, to me he was not a god, -he was only a Taj. The thrill was not my thrill, but had come to me -secondhand from those invisible millions of believers. By a hand-shake -with their god I had ground-circuited their wire and got their monster -battery's whole charge. - -He was tall and slender, indeed emaciated. He had a clean cut and -conspicuously intellectual face, and a deep and kindly eye. He looked -many years older than he really was, but much study and meditation and -fasting and prayer, with the arid life he had led as hermit and beggar, -could account for that. He is wholly nude when he receives natives, of -whatever rank they may be, but he had white cloth around his loins now, a -concession to Mr. Parker's Europe prejudices, no doubt. - -As soon as I had sobered down a little we got along very well together, -and I found him a most pleasant and friendly deity. He had heard a deal -about Chicago, and showed a quite remarkable interest in it, for a god. -It all came of the World's Fair and the Congress of Religions. If India -knows about nothing else American, she knows about those, and will keep -them in mind one while. - -He proposed an exchange of autographs, a delicate attention which made me -believe in him, but I had been having my doubts before. He wrote his in -his book, and I have a reverent regard for that book, though the words -run from right to left, and so I can't read it. It was a mistake to -print in that way. It contains his voluminous comments on the Hindoo -holy writings, and if I could make them out I would try for perfection -myself. I gave him a copy of Huckleberry Finn. I thought it might rest -him up a little to mix it in along with his meditations on Brahma, for he -looked tired, and I knew that if it didn't do him any good it wouldn't do -him any harm. - -He has a scholar meditating under him--Mina Bahadur Rana--but we did not -see him. He wears clothes and is very imperfect. He has written a -little pamphlet about his master, and I have that. It contains a -wood-cut of the master and himself seated on a rug in the garden. The -portrait of the master is very good indeed. The posture is exactly that -which Brahma himself affects, and it requires long arms and limber legs, -and can be accumulated only by gods and the india-rubber man. There is a -life-size marble relief of Shri 108, S.B.S. in the garden. It -represents him in this same posture. - -Dear me! It is a strange world. Particularly the Indian division of it. -This pupil, Mina Bahadur Rana, is not a commonplace person, but a man of -distinguished capacities and attainments, and, apparently, he had a fine -worldly career in front of him. He was serving the Nepal Government in a -high capacity at the Court of the Viceroy of India, twenty years ago. He -was an able man, educated, a thinker, a man of property. But the longing -to devote himself to a religious life came upon him, and he resigned his -place, turned his back upon the vanities and comforts of the world, and -went away into the solitudes to live in a hut and study the sacred -writings and meditate upon virtue and holiness and seek to attain them. -This sort of religion resembles ours. Christ recommended the rich to -give away all their property and follow Him in poverty, not in worldly -comfort. American and English millionaires do it every day, and thus -verify and confirm to the world the tremendous forces that lie in -religion. Yet many people scoff at them for this loyalty to duty, and -many will scoff at Mina Bahadur Rana and call him a crank. Like many -Christians of great character and intellect, he has made the study of his -Scriptures and the writing of books of commentaries upon them the loving -labor of his life. Like them, he has believed that his was not an idle -and foolish waste of his life, but a most worthy and honorable employment -of it. Yet, there are many people who will see in those others, men -worthy of homage and deep reverence, but in him merely a crank. But I -shall not. He has my reverence. And I don't offer it as a common thing -and poor, but as an unusual thing and of value. The ordinary reverence, -the reverence defined and explained by the dictionary costs nothing. -Reverence for one's own sacred things--parents, religion, flag, laws, and -respect for one's own beliefs--these are feelings which we cannot even -help. They come natural to us; they are involuntary, like breathing. -There is no personal merit in breathing. But the reverence which is -difficult, and which has personal merit in it, is the respect which you -pay, without compulsion, to the political or religious attitude of a man -whose beliefs are not yours. You can't revere his gods or his politics, -and no one expects you to do that, but you could respect his belief in -them if you tried hard enough; and you could respect him, too, if you -tried hard enough. But it is very, very difficult; it is next to -impossible, and so we hardly ever try. If the man doesn't believe as we -do, we say he is a crank, and that settles it. I mean it does nowadays, -because now we can't burn him. - -We are always canting about people's "irreverence," always charging this -offense upon somebody or other, and thereby intimating that we are better -than that person and do not commit that offense ourselves. Whenever we -do this we are in a lying attitude, and our speech is cant; for none of -us are reverent--in a meritorious way; deep down in our hearts we are all -irreverent. There is probably not a single exception to this rule in the -earth. There is probably not one person whose reverence rises higher -than respect for his own sacred things; and therefore, it is not a thing -to boast about and be proud of, since the most degraded savage has that ---and, like the best of us, has nothing higher. To speak plainly, we -despise all reverences and all objects of reverence which are outside the -pale of our own list of sacred things. And yet, with strange -inconsistency, we are shocked when other people despise and defile the -things which are holy to us. Suppose we should meet with a paragraph -like the following, in the newspapers: - -"Yesterday a visiting party of the British nobility had a picnic at Mount -Vernon, and in the tomb of Washington they ate their luncheon, sang -popular songs, played games, and danced waltzes and polkas." - -Should we be shocked? Should we feel outraged? Should we be amazed? -Should we call the performance a desecration? Yes, that would all -happen. We should denounce those people in round terms, and call them -hard names. - -And suppose we found this paragraph in the newspapers: - -"Yesterday a visiting party of American pork-millionaires had a picnic in -Westminster Abbey, and in that sacred place they ate their luncheon, sang -popular songs, played games, and danced waltzes and polkas." - -Would the English be shocked? Would they feel outraged? Would they be -amazed? Would they call the performance a desecration? That would all -happen. The pork-millionaires would be denounced in round terms; they -would be called hard names. - -In the tomb at Mount Vernon lie the ashes of America's most honored son; -in the Abbey, the ashes of England's greatest dead; the tomb of tombs, -the costliest in the earth, the wonder of the world, the Taj, was built -by a great Emperor to honor the memory of a perfect wife and perfect -mother, one in whom there was no spot or blemish, whose love was his stay -and support, whose life was the light of the world to him; in it her -ashes lie, and to the Mohammedan millions of India it is a holy place; to -them it is what Mount Vernon is to Americans, it is what the Abbey is to -the English. - -Major Sleeman wrote forty or fifty years ago (the italics are mine): - - "I would here enter my humble protest against the quadrille and - lunch parties which are sometimes given to European ladies and - gentlemen of the station at this imperial tomb; drinking and dancing - are no doubt very good things in their season, but they are sadly - out of place in a sepulchre." - -Were there any Americans among those lunch parties? If they were -invited, there were. - -If my imagined lunch-parties in Westminster and the tomb of Washington -should take place, the incident would cause a vast outbreak of bitter -eloquence about Barbarism and Irreverence; and it would come from two -sets of people who would go next day and dance in the Taj if they had a -chance. - -As we took our leave of the Benares god and started away we noticed a -group of natives waiting respectfully just within the gate--a Rajah from -somewhere in India, and some people of lesser consequence. The god -beckoned them to come, and as we passed out the Rajah was kneeling and -reverently kissing his sacred feet. - -If Barnum--but Barnum's ambitions are at rest. This god will remain in -the holy peace and seclusion of his garden, undisturbed. Barnum could -not have gotten him, anyway. Still, he would have found a substitute -that would answer. - - - - -CHAPTER LIV. - -Do not undervalue the headache. While it is at its sharpest it seems a -bad investment; but when relief begins, the unexpired remainder is worth -$4 a minute. - --Pudd'nhead Wilson's New Calendar. - -A comfortable railway journey of seventeen and a half hours brought us to -the capital of India, which is likewise the capital of Bengal--Calcutta. -Like Bombay, it has a population of nearly a million natives and a small -gathering of white people. It is a huge city and fine, and is called the -City of Palaces. It is rich in historical memories; rich in British -achievement--military, political, commercial; rich in the results of the -miracles done by that brace of mighty magicians, Clive and Hastings. And -has a cloud kissing monument to one Ochterlony. - -It is a fluted candlestick 250 feet high. This lingam is the only large -monument in Calcutta, I believe. It is a fine ornament, and will keep -Ochterlony in mind. - -Wherever you are, in Calcutta, and for miles around, you can see it; and -always when you see it you think of Ochterlony. And so there is not an -hour in the day that you do not think of Ochterlony and wonder who he -was. It is good that Clive cannot come back, for he would think it was -for Plassey; and then that great spirit would be wounded when the -revelation came that it was not. Clive would find out that it was for -Ochterlony; and he would think Ochterlony was a battle. And he would -think it was a great one, too, and he would say, "With three thousand I -whipped sixty thousand and founded the Empire--and there is no monument; -this other soldier must have whipped a billion with a dozen and saved the -world." - -But he would be mistaken. Ochterlony was a man, not a battle. And he -did good and honorable service, too; as good and honorable service as has -been done in India by seventy-five or a hundred other Englishmen of -courage, rectitude, and distinguished capacity. For India has been a -fertile breeding-ground of such men, and remains so; great men, both in -war and in the civil service, and as modest as great. But they have no -monuments, and were not expecting any. Ochterlony could not have been -expecting one, and it is not at all likely that he desired one--certainly -not until Clive and Hastings should be supplied. Every day Clive and -Hastings lean on the battlements of heaven and look down and wonder which -of the two the monument is for; and they fret and worry because they -cannot find out, and so the peace of heaven is spoiled for them and lost. -But not for Ochterlony. Ochterlony is not troubled. He doesn't suspect -that it is his monument. Heaven is sweet and peaceful to him. There is -a sort of unfairness about it all. - -Indeed, if monuments were always given in India for high achievements, -duty straitly performed, and smirchless records, the landscape would be -monotonous with them. The handful of English in India govern the Indian -myriads with apparent ease, and without noticeable friction, through -tact, training, and distinguished administrative ability, reinforced by -just and liberal laws--and by keeping their word to the native whenever -they give it. - -England is far from India and knows little about the eminent services -performed by her servants there, for it is the newspaper correspondent -who makes fame, and he is not sent to India but to the continent, to -report the doings of the princelets and the dukelets, and where they are -visiting and whom they are marrying. Often a British official spends -thirty or forty years in India, climbing from grade to grade by services -which would make him celebrated anywhere else, and finishes as a -vice-sovereign, governing a great realm and millions of subjects; then he -goes home to England substantially unknown and unheard of, and settles -down in some modest corner, and is as one extinguished. Ten years later -there is a twenty-line obituary in the London papers, and the reader is -paralyzed by the splendors of a career which he is not sure that he had -ever heard of before. But meanwhile he has learned all about the -continental princelets and dukelets. - -The average man is profoundly ignorant of countries that lie remote from -his own. When they are mentioned in his presence one or two facts and -maybe a couple of names rise like torches in his mind, lighting up an -inch or two of it and leaving the rest all dark. The mention of Egypt -suggests some Biblical facts and the Pyramids-nothing more. The mention -of South Africa suggests Kimberly and the diamonds and there an end. -Formerly the mention, to a Hindoo, of America suggested a name--George -Washington--with that his familiarity with our country was exhausted. -Latterly his familiarity with it has doubled in bulk; so that when -America is mentioned now, two torches flare up in the dark caverns of his -mind and he says, "Ah, the country of the great man Washington; and of -the Holy City--Chicago." For he knows about the Congress of Religion, and -this has enabled him to get an erroneous impression of Chicago. - -When India is mentioned to the citizen of a far country it suggests -Clive, Hastings, the Mutiny, Kipling, and a number of other great events; -and the mention of Calcutta infallibly brings up the Black Hole. And so, -when that citizen finds himself in the capital of India he goes first of -all to see the Black Hole of Calcutta--and is disappointed. - -The Black Hole was not preserved; it is gone, long, long ago. It is -strange. Just as it stood, it was itself a monument; a ready-made one. -It was finished, it was complete, its materials were strong and lasting, -it needed no furbishing up, no repairs; it merely needed to be let alone. -It was the first brick, the Foundation Stone, upon which was reared a -mighty Empire--the Indian Empire of Great Britain. It was the ghastly -episode of the Black Hole that maddened the British and brought Clive, -that young military marvel, raging up from Madras; it was the seed from -which sprung Plassey; and it was that extraordinary battle, whose like -had not been seen in the earth since Agincourt, that laid deep and strong -the foundations of England's colossal Indian sovereignty. - -And yet within the time of men who still live, the Black Hole was torn -down and thrown away as carelessly as if its bricks were common clay, not -ingots of historic gold. There is no accounting for human beings. - -The supposed site of the Black Hole is marked by an engraved plate. I -saw that; and better that than nothing. The Black Hole was a prison--a -cell is nearer the right word--eighteen feet square, the dimensions of an -ordinary bedchamber; and into this place the victorious Nabob of Bengal -packed 146 of his English prisoners. There was hardly standing room for -them; scarcely a breath of air was to be got; the time was night, the -weather sweltering hot. Before the dawn came, the captives were all dead -but twenty-three. Mr. Holwell's long account of the awful episode was -familiar to the world a hundred years ago, but one seldom sees in print -even an extract from it in our day. Among the striking things in it is -this. Mr. Holwell, perishing with thirst, kept himself alive by sucking -the perspiration from his sleeves. It gives one a vivid idea of the -situation. He presently found that while he was busy drawing life from -one of his sleeves a young English gentleman was stealing supplies from -the other one. Holwell was an unselfish man, a man of the most generous -impulses; he lived and died famous for these fine and rare qualities; yet -when he found out what was happening to that unwatched sleeve, he took -the precaution to suck that one dry first. The miseries of the Black -Hole were able to change even a nature like his. But that young -gentleman was one of the twenty-three survivors, and he said it was the -stolen perspiration that saved his life. From the middle of Mr. -Holwell's narrative I will make a brief excerpt: - - "Then a general prayer to Heaven, to hasten the approach of the - flames to the right and left of us, and put a period to our misery. - But these failing, they whose strength and spirits were quite - exhausted laid themselves down and expired quietly upon their - fellows: others who had yet some strength and vigor left made a last - effort at the windows, and several succeeded by leaping and - scrambling over the backs and heads of those in the first rank, and - got hold of the bars, from which there was no removing them. Many - to the right and left sunk with the violent pressure, and were soon - suffocated; for now a steam arose from the living and the dead, - which affected us in all its circumstances as if we were forcibly - held with our heads over a bowl full of strong volatile spirit of - hartshorn, until suffocated; nor could the effluvia of the one be - distinguished from the other, and frequently, when I was forced by - the load upon my head and shoulders to hold my face down, I was - obliged, near as I was to the window, instantly to raise it again to - avoid suffocation. I need not, my dear friend, ask your - commiseration, when I tell you, that in this plight, from half an - hour past eleven till near two in the morning, I sustained the - weight of a heavy man, with his knees in my back, and the pressure - of his whole body on my head. A Dutch surgeon who had taken his - seat upon my left shoulder, and a Topaz (a black Christian soldier) - bearing on my right; all which nothing could have enabled me to - support but the props and pressure equally sustaining me all around. - The two latter I frequently dislodged by shifting my hold on the - bars and driving my knuckles into their ribs; but my friend above - stuck fast, held immovable by two bars. - - "I exerted anew my strength and fortitude; but the repeated trials - and efforts I made to dislodge the insufferable incumbrances upon me - at last quite exhausted me; and towards two o'clock, finding I must - quit the window or sink where I was, I resolved on the former, - having bore, truly for the sake of others, infinitely more for life - than the best of it is worth. In the rank close behind me was an - officer of one of the ships, whose name was Cary, and who had - behaved with much bravery during the siege (his wife, a fine woman, - though country born, would not quit him, but accompanied him into - the prison, and was one who survived). This poor wretch had been - long raving for water and air; I told him I was determined to give - up life, and recommended his gaining my station. On my quitting it - he made a fruitless attempt to get my place; but the Dutch surgeon, - who sat on my shoulder, supplanted him. Poor Cary expressed his - thankfulness, and said he would give up life too; but it was with - the utmost labor we forced our way from the window (several in the - inner ranks appearing to me dead standing, unable to fall by the - throng and equal pressure around). He laid himself down to die; and - his death, I believe, was very sudden; for he was a short, full, - sanguine man. His strength was great; and, I imagine, had he not - retired with me, I should never have been able to force my way. I - was at this time sensible of no pain, and little uneasiness; I can - give you no better idea of my situation than by repeating my simile - of the bowl of spirit of hartshorn. I found a stupor coming on - apace, and laid myself down by that gallant old man, the Rev. Mr. - Jervas Bellamy, who laid dead with his son, the lieutenant, hand in - hand, near the southernmost wall of the prison. When I had lain - there some little time, I still had reflection enough to suffer some - uneasiness in the thought that I should be trampled upon, when dead, - as I myself had done to others. With some difficulty I raised - myself, and gained the platform a second time, where I presently - lost all sensation; the last trace of sensibility that I have been - able to recollect after my laying down, was my sash being uneasy - about my waist, which I untied, and threw from me. Of what passed - in this interval, to the time of my resurrection from this hole of - horrors, I can give you no account." - -There was plenty to see in Calcutta, but there was not plenty of time for -it. I saw the fort that Clive built; and the place where Warren Hastings -and the author of the Junius Letters fought their duel; and the great -botanical gardens; and the fashionable afternoon turnout in the Maidan; -and a grand review of the garrison in a great plain at sunrise; and a -military tournament in which great bodies of native soldiery exhibited -the perfection of their drill at all arms, a spectacular and beautiful -show occupying several nights and closing with the mimic storming of a -native fort which was as good as the reality for thrilling and accurate -detail, and better than the reality for security and comfort; we had a -pleasure excursion on the 'Hoogly' by courtesy of friends, and devoted -the rest of the time to social life and the Indian museum. One should -spend a month in the museum, an enchanted palace of Indian antiquities. -Indeed, a person might spend half a year among the beautiful and -wonderful things without exhausting their interest. - -It was winter. We were of Kipling's "hosts of tourists who travel up and -down India in the cold weather showing how things ought to be managed." -It is a common expression there, "the cold weather," and the people think -there is such a thing. It is because they have lived there half a -lifetime, and their perceptions have become blunted. When a person is -accustomed to 138 in the shade, his ideas about cold weather are not -valuable. I had read, in the histories, that the June marches made -between Lucknow and Cawnpore by the British forces in the time of the -Mutiny were made weather--138 in the shade and had taken it for -historical embroidery. I had read it again in Serjeant-Major -Forbes-Mitchell's account of his military experiences in the Mutiny ---at least I thought I had--and in Calcutta I asked him if it was true, -and he said it was. An officer of high rank who had been in the thick of -the Mutiny said the same. As long as those men were talking about what -they knew, they were trustworthy, and I believed them; but when they said -it was now "cold weather," I saw that they had traveled outside of their -sphere of knowledge and were floundering. I believe that in India "cold -weather" is merely a conventional phrase and has come into use through -the necessity of having some way to distinguish between weather which -will melt a brass door-knob and weather which will only make it mushy. -It was observable that brass ones were in use while I was in Calcutta, -showing that it was not yet time to change to porcelain; I was told the -change to porcelain was not usually made until May. But this cold -weather was too warm for us; so we started to Darjeeling, in the -Himalayas--a twenty-four hour journey. - - - - -CHAPTER LV. - -There are 869 different forms of lying, but only one of them has been -squarely forbidden. Thou shalt not bear false witness against thy -neighbor. - --Pudd'nhead Wilson's New Calendar. - - -FROM DIARY: - -February 14. We left at 4:30 P.M. Until dark we moved through rich -vegetation, then changed to a boat and crossed the Ganges. - -February 15. Up with the sun. A brilliant morning, and frosty. A -double suit of flannels is found necessary. The plain is perfectly -level, and seems to stretch away and away and away, dimming and -softening, to the uttermost bounds of nowhere. What a soaring, -strenuous, gushing fountain spray of delicate greenery a bunch of bamboo -is! As far as the eye can reach, these grand vegetable geysers grace the -view, their spoutings refined to steam by distance. And there are fields -of bananas, with the sunshine glancing from the varnished surface of -their drooping vast leaves. And there are frequent groves of palm; and -an effective accent is given to the landscape by isolated individuals of -this picturesque family, towering, clean-stemmed, their plumes broken and -hanging ragged, Nature's imitation of an umbrella that has been out to -see what a cyclone is like and is trying not to look disappointed. And -everywhere through the soft morning vistas we glimpse the villages, the -countless villages, the myriad villages, thatched, built of clean new -matting, snuggling among grouped palms and sheaves of bamboo; villages, -villages, no end of villages, not three hundred yards apart, and dozens -and dozens of them in sight all the time; a mighty City, hundreds of -miles long, hundreds of miles broad, made all of villages, the biggest -city in the earth, and as populous as a European kingdom. I have seen no -such city as this before. And there is a continuously repeated and -replenished multitude of naked men in view on both sides and ahead. We -fly through it mile after mile, but still it is always there, on both -sides and ahead--brown-bodied, naked men and boys, plowing in the fields. -But not woman. In these two hours I have not seen a woman or a girl -working in the fields. - - "From Greenland's icy mountains, - From India's coral strand, - Where Afric's sunny fountains - Roll down their golden sand. - From many an ancient river, - From many a palmy plain, - They call us to deliver - Their land from error's chain." - -Those are beautiful verses, and they have remained in my memory all my -life. But if the closing lines are true, let us hope that when we come -to answer the call and deliver the land from its errors, we shall secrete -from it some of our high-civilization ways, and at the same time borrow -some of its pagan ways to enrich our high system with. We have a right -to do this. If we lift those people up, we have a right to lift -ourselves up nine or ten grades or so, at their expense. A few years ago -I spent several weeks at Tolz, in Bavaria. It is a Roman Catholic -region, and not even Benares is more deeply or pervasively or -intelligently devout. In my diary of those days I find this: - - "We took a long drive yesterday around about the lovely country - roads. But it was a drive whose pleasure was damaged in a couple of - ways: by the dreadful shrines and by the shameful spectacle of gray - and venerable old grandmothers toiling in the fields. The shrines - were frequent along the roads--figures of the Saviour nailed to the - cross and streaming with blood from the wounds of the nails and the - thorns. - - "When missionaries go from here do they find fault with the pagan - idols? I saw many women seventy and even eighty years old mowing - and binding in the fields, and pitchforking the loads into the - wagons." - -I was in Austria later, and in Munich. In Munich I saw gray old women -pushing trucks up hill and down, long distances, trucks laden with -barrels of beer, incredible loads. In my Austrian diary I find this: - - "In the fields I often see a woman and a cow harnessed to the plow, - and a man driving. - - "In the public street of Marienbad to-day, I saw an old, bent, - gray-headed woman, in harness with a dog, drawing a laden sled over - bare dirt roads and bare pavements; and at his ease walked the - driver, smoking his pipe, a hale fellow not thirty years old." - -Five or six years ago I bought an open boat, made a kind of a canvas -wagon-roof over the stern of it to shelter me from sun and rain; hired a -courier and a boatman, and made a twelve-day floating voyage down the -Rhone from Lake Bourget to Marseilles. In my diary of that trip I find -this entry. I was far down the Rhone then: - - "Passing St. Etienne, 2:15 P.M. On a distant ridge inland, a tall - openwork structure commandingly situated, with a statue of the - Virgin standing on it. A devout country. All down this river, - wherever there is a crag there is a statue of the Virgin on it. I - believe I have seen a hundred of them. And yet, in many respects, - the peasantry seem to be mere pagans, and destitute of any - considerable degree of civilization. - - " . . . . We reached a not very promising looking village about - 4 o'clock, and I concluded to tie up for the day; munching fruit and - fogging the hood with pipe-smoke had grown monotonous; I could not - have the hood furled, because the floods of rain fell unceasingly. - The tavern was on the river bank, as is the custom. It was dull - there, and melancholy--nothing to do but look out of the window into - the drenching rain, and shiver; one could do that, for it was bleak - and cold and windy, and country France furnishes no fire. Winter - overcoats did not help me much; they had to be supplemented with - rugs. The raindrops were so large and struck the river with such - force that they knocked up the water like pebble-splashes. - - "With the exception of a very occasional woodenshod peasant, nobody - was abroad in this bitter weather--I mean nobody of our sex. But - all weathers are alike to the women in these continental countries. - To them and the other animals, life is serious; nothing interrupts - their slavery. Three of them were washing clothes in the river - under the window when I arrived, and they continued at it as long as - there was light to work by. One was apparently thirty; another--the - mother!--above fifty; the third--grandmother!--so old and worn and - gray she could have passed for eighty; I took her to be that old. - They had no waterproofs nor rubbers, of course; over their shoulders - they wore gunnysacks--simply conductors for rivers of water; some of - the volume reached the ground; the rest soaked in on the way. - - "At last a vigorous fellow of thirty-five arrived, dry and - comfortable, smoking his pipe under his big umbrella in an open - donkey-cart-husband, son, and grandson of those women! He stood up - in the cart, sheltering himself, and began to superintend, issuing - his orders in a masterly tone of command, and showing temper when - they were not obeyed swiftly enough. - - "Without complaint or murmur the drowned women patiently carried out - the orders, lifting the immense baskets of soggy, wrung-out clothing - into the cart and stowing them to the man's satisfaction. There - were six of the great baskets, and a man of mere ordinary strength - could not have lifted any one of them. The cart being full now, the - Frenchman descended, still sheltered by his umbrella, entered the - tavern, and the women went drooping homeward, trudging in the wake - of the cart, and soon were blended with the deluge and lost to - sight. - - "When I went down into the public room, the Frenchman had his bottle - of wine and plate of food on a bare table black with grease, and was - "chomping" like a horse. He had the little religious paper which is - in everybody's hands on the Rhone borders, and was enlightening - himself with the histories of French saints who used to flee to the - desert in the Middle Ages to escape the contamination of woman. For - two hundred years France has been sending missionaries to other - savage lands. To spare to the needy from poverty like hers is fine - and true generosity." - -But to get back to India--where, as my favorite poem says-- - - "Every prospect pleases, - And only man is vile." - -It is because Bavaria and Austria and France have not introduced their -civilization to him yet. But Bavaria and Austria and France are on their -way. They are coming. They will rescue him; they will refine the -vileness out of him. - -Some time during the forenoon, approaching the mountains, we changed from -the regular train to one composed of little canvas-sheltered cars that -skimmed along within a foot of the ground and seemed to be going fifty -miles an hour when they were really making about twenty. Each car had -seating capacity for half-a-dozen persons; and when the curtains were up -one was substantially out of doors, and could see everywhere, and get all -the breeze, and be luxuriously comfortable. It was not a pleasure -excursion in name only, but in fact. - -After a while the stopped at a little wooden coop of a station just -within the curtain of the sombre jungle, a place with a deep and dense -forest of great trees and scrub and vines all about it. The royal Bengal -tiger is in great force there, and is very bold and unconventional. From -this lonely little station a message once went to the railway manager in -Calcutta: "Tiger eating station-master on front porch; telegraph -instructions." - -It was there that I had my first tiger hunt. I killed thirteen. We were -presently away again, and the train began to climb the mountains. In one -place seven wild elephants crossed the track, but two of them got away -before I could overtake them. The railway journey up the mountain is -forty miles, and it takes eight hours to make it. It is so wild and -interesting and exciting and enchanting that it ought to take a week. As -for the vegetation, it is a museum. The jungle seemed to contain samples -of every rare and curious tree and bush that we had ever seen or heard -of. It is from that museum, I think, that the globe must have been -supplied with the trees and vines and shrubs that it holds precious. - -The road is infinitely and charmingly crooked. It goes winding in and -out under lofty cliffs that are smothered in vines and foliage, and -around the edges of bottomless chasms; and all the way one glides by -files of picturesque natives, some carrying burdens up, others going down -from their work in the tea-gardens; and once there was a gaudy wedding -procession, all bright tinsel and color, and a bride, comely and girlish, -who peeped out from the curtains of her palanquin, exposing her face with -that pure delight which the young and happy take in sin for sin's own -sake. - -By and by we were well up in the region of the clouds, and from that -breezy height we looked down and afar over a wonderful picture--the -Plains of India, stretching to the horizon, soft and fair, level as a -floor, shimmering with heat, mottled with cloud-shadows, and cloven with -shining rivers. Immediately below us, and receding down, down, down, -toward the valley, was a shaven confusion of hilltops, with ribbony roads -and paths squirming and snaking cream-yellow all over them and about -them, every curve and twist sharply distinct. - -At an elevation of 6,000 feet we entered a thick cloud, and it shut out -the world and kept it shut out. We climbed 1,000 feet higher, then began -to descend, and presently got down to Darjeeling, which is 6,000 feet -above the level of the Plains. - -We had passed many a mountain village on the way up, and seen some new -kinds of natives, among them many samples of the fighting Ghurkas. They -are not large men, but they are strong and resolute. There are no better -soldiers among Britain's native troops. And we had passed shoals of -their women climbing the forty miles of steep road from the valley to -their mountain homes, with tall baskets on their backs hitched to their -foreheads by a band, and containing a freightage weighing--I will not say -how many hundreds of pounds, for the sum is unbelievable. These were -young women, and they strode smartly along under these astonishing -burdens with the air of people out for a holiday. I was told that a -woman will carry a piano on her back all the way up the mountain; and -that more than once a woman had done it. If these were old women I -should regard the Ghurkas as no more civilized than the Europeans. -At the railway station at Darjeeling you find plenty of cab-substitutes ---open coffins, in which you sit, and are then borne on men's shoulders up -the steep roads into the town. - -Up there we found a fairly comfortable hotel, the property of an -indiscriminate and incoherent landlord, who looks after nothing, but -leaves everything to his army of Indian servants. No, he does look after -the bill--to be just to him--and the tourist cannot do better than follow -his example. I was told by a resident that the summit of Kinchinjunga is -often hidden in the clouds, and that sometimes a tourist has waited -twenty-two days and then been obliged to go away without a sight of it. -And yet went not disappointed; for when he got his hotel bill he -recognized that he was now seeing the highest thing in the Himalayas. -But this is probably a lie. - -After lecturing I went to the Club that night, and that was a comfortable -place. It is loftily situated, and looks out over a vast spread of -scenery; from it you can see where the boundaries of three countries come -together, some thirty miles away; Thibet is one of them, Nepaul another, -and I think Herzegovina was the other. Apparently, in every town and -city in India the gentlemen of the British civil and military service -have a club; sometimes it is a palatial one, always it is pleasant and -homelike. The hotels are not always as good as they might be, and the -stranger who has access to the Club is grateful for his privilege and -knows how to value it. - -Next day was Sunday. Friends came in the gray dawn with horses, and my -party rode away to a distant point where Kinchinjunga and Mount Everest -show up best, but I stayed at home for a private view; for it was very -old, and I was not acquainted with the horses, any way. I got a pipe and -a few blankets and sat for two hours at the window, and saw the sun drive -away the veiling gray and touch up the snow-peaks one after another with -pale pink splashes and delicate washes of gold, and finally flood the -whole mighty convulsion of snow-mountains with a deluge of rich -splendors. - -Kinchinjunga's peak was but fitfully visible, but in the between times it -was vividly clear against the sky--away up there in the blue dome more -than 28,000 feet above sea level--the loftiest land I had ever seen, by -12,000 feet or more. It was 45 miles away. Mount Everest is a thousand -feet higher, but it was not a part of that sea of mountains piled up -there before me, so I did not see it; but I did not care, because I think -that mountains that are as high as that are disagreeable. - -I changed from the back to the front of the house and spent the rest of -the morning there, watching the swarthy strange tribes flock by from -their far homes in the Himalayas. All ages and both sexes were -represented, and the breeds were quite new to me, though the costumes of -the Thibetans made them look a good deal like Chinamen. The prayer-wheel -was a frequent feature. It brought me near to these people, and made -them seem kinfolk of mine. Through our preacher we do much of our -praying by proxy. We do not whirl him around a stick, as they do, but -that is merely a detail. The swarm swung briskly by, hour after hour, a -strange and striking pageant. It was wasted there, and it seemed a pity. -It should have been sent streaming through the cities of Europe or -America, to refresh eyes weary of the pale monotonies of the -circus-pageant. These people were bound for the bazar, with things to -sell. We went down there, later, and saw that novel congress of the wild -peoples, and plowed here and there through it, and concluded that it -would be worth coming from Calcutta to see, even if there were no -Kinchinjunga and Everest. - - - - -CHAPTER LVI. - -There are two times in a man's life when he should not speculate: when he -can't afford it, and when he can. - --Pudd'nhead Wilson's New Calendar. - -On Monday and Tuesday at sunrise we again had fair-to-middling views of -the stupendous mountains; then, being well cooled off and refreshed, we -were ready to chance the weather of the lower world once more. - -We traveled up hill by the regular train five miles to the summit, then -changed to a little canvas-canopied hand-car for the 35-mile descent. It -was the size of a sleigh, it had six seats and was so low that it seemed -to rest on the ground. It had no engine or other propelling power, and -needed none to help it fly down those steep inclines. It only needed a -strong brake, to modify its flight, and it had that. There was a story -of a disastrous trip made down the mountain once in this little car by -the Lieutenant-Governor of Bengal, when the car jumped the track and -threw its passengers over a precipice. It was not true, but the story -had value for me, for it made me nervous, and nervousness wakes a person -up and makes him alive and alert, and heightens the thrill of a new and -doubtful experience. The car could really jump the track, of course; a -pebble on the track, placed there by either accident or malice, at a -sharp curve where one might strike it before the eye could discover it, -could derail the car and fling it down into India; and the fact that the -lieutenant-governor had escaped was no proof that I would have the same -luck. And standing there, looking down upon the Indian Empire from the -airy altitude of 7,000 feet, it seemed unpleasantly far, dangerously far, -to be flung from a handcar. - -But after all, there was but small danger-for me. What there was, was -for Mr. Pugh, inspector of a division of the Indian police, in whose -company and protection we had come from Calcutta. He had seen long -service as an artillery officer, was less nervous than I was, and so he -was to go ahead of us in a pilot hand-car, with a Ghurka and another -native; and the plan was that when we should see his car jump over a -precipice we must put on our break [sp.] and send for another pilot. -It was a good arrangement. Also Mr. Barnard, chief engineer of the -mountain-division of the road, was to take personal charge of our car, -and he had been down the mountain in it many a time. - -Everything looked safe. Indeed, there was but one questionable detail -left: the regular train was to follow us as soon as we should start, and -it might run over us. Privately, I thought it would. - -The road fell sharply down in front of us and went corkscrewing in and -out around the crags and precipices, down, down, forever down, suggesting -nothing so exactly or so uncomfortably as a croaked toboggan slide with -no end to it. Mr. Pugh waved his flag and started, like an arrow from a -bow, and before I could get out of the car we were gone too. I had -previously had but one sensation like the shock of that departure, and -that was the gaspy shock that took my breath away the first time that I -was discharged from the summit of a toboggan slide. But in both -instances the sensation was pleasurable--intensely so; it was a sudden -and immense exaltation, a mixed ecstasy of deadly fright and unimaginable -joy. I believe that this combination makes the perfection of human -delight. - -The pilot car's flight down the mountain suggested the swoop of a swallow -that is skimming the ground, so swiftly and smoothly and gracefully it -swept down the long straight reaches and soared in and out of the bends -and around the corners. We raced after it, and seemed to flash by the -capes and crags with the speed of light; and now and then we almost -overtook it--and had hopes; but it was only playing with us; when we got -near, it released its brake, make a spring around a corner, and the next -time it spun into view, a few seconds later, it looked as small as a -wheelbarrow, it was so far away. We played with the train in the same -way. We often got out to gather flowers or sit on a precipice and look -at the scenery, then presently we would hear a dull and growing roar, and -the long coils of the train would come into sight behind and above us; -but we did not need to start till the locomotive was close down upon us ---then we soon left it far behind. It had to stop at every station, -therefore it was not an embarrassment to us. Our brake was a good piece -of machinery; it could bring the car to a standstill on a slope as steep -as a house-roof. - -The scenery was grand and varied and beautiful, and there was no hurry; -we could always stop and examine it. There was abundance of time. We -did not need to hamper the train; if it wanted the road, we could switch -off and let it go by, then overtake it and pass it later. We stopped at -one place to see the Gladstone Cliff, a great crag which the ages and the -weather have sculptured into a recognizable portrait of the venerable -statesman. Mr. Gladstone is a stockholder in the road, and Nature began -this portrait ten thousand years ago, with the idea of having the -compliment ready in time for the event. - -We saw a banyan tree which sent down supporting stems from branches which -were sixty feet above the ground. That is, I suppose it was a banyan; -its bark resembled that of the great banyan in the botanical gardens at -Calcutta, that spider-legged thing with its wilderness of vegetable -columns. And there were frequent glimpses of a totally leafless tree -upon whose innumerable twigs and branches a cloud of crimson butterflies -had lighted--apparently. In fact these brilliant red butterflies were -flowers, but the illusion was good. Afterward in South Africa, I saw -another splendid effect made by red flowers. This flower was probably -called the torch-plant--should have been so named, anyway. It had a -slender stem several feet high, and from its top stood up a single tongue -of flame, an intensely red flower of the size and shape of a small -corn-cob. The stems stood three or four feet apart all over a great -hill-slope that was a mile long, and make one think of what the Place -de la Concorde would be if its myriad lights were red instead of white -and yellow. - -A few miles down the mountain we stopped half an hour to see a Thibetan -dramatic performance. It was in the open air on the hillside. The -audience was composed of Thibetans, Ghurkas, and other unusual people. -The costumes of the actors were in the last degree outlandish, and the -performance was in keeping with the clothes. To an accompaniment of -barbarous noises the actors stepped out one after another and began to -spin around with immense swiftness and vigor and violence, chanting the -while, and soon the whole troupe would be spinning and chanting and -raising the dust. They were performing an ancient and celebrated -historical play, and a Chinaman explained it to me in pidjin English as -it went along. The play was obscure enough without the explanation; with -the explanation added, it was (opake). As a drama this ancient -historical work of art was defective, I thought, but as a wild and -barbarous spectacle the representation was beyond criticism. -Far down the mountain we got out to look at a piece of remarkable -loop-engineering--a spiral where the road curves upon itself with such -abruptness that when the regular train came down and entered the loop, we -stood over it and saw the locomotive disappear under our bridge, then in -a few moments appear again, chasing its own tail; and we saw it gain on -it, overtake it, draw ahead past the rear cars, and run a race with that -end of the train. It was like a snake swallowing itself. - -Half-way down the mountain we stopped about an hour at Mr. Barnard's -house for refreshments, and while we were sitting on the veranda looking -at the distant panorama of hills through a gap in the forest, we came -very near seeing a leopard kill a calf.--[It killed it the day before.] ---It is a wild place and lovely. From the woods all about came the songs -of birds,--among them the contributions of a couple of birds which I was -not then acquainted with: the brain-fever bird and the coppersmith. The -song of the brain-fever demon starts on a low but steadily rising key, -and is a spiral twist which augments in intensity and severity with each -added spiral, growing sharper and sharper, and more and more painful, -more and more agonizing, more and more maddening, intolerable, -unendurable, as it bores deeper and deeper and deeper into the listener's -brain, until at last the brain fever comes as a relief and the man dies. -I am bringing some of these birds home to America. They will be a great -curiosity there, and it is believed that in our climate they will -multiply like rabbits. - -The coppersmith bird's note at a certain distance away has the ring of a -sledge on granite; at a certain other distance the hammering has a more -metallic ring, and you might think that the bird was mending a copper -kettle; at another distance it has a more woodeny thump, but it is a -thump that is full of energy, and sounds just like starting a bung. So -he is a hard bird to name with a single name; he is a stone-breaker, -coppersmith, and bung-starter, and even then he is not completely named, -for when he is close by you find that there is a soft, deep, melodious -quality in his thump, and for that no satisfying name occurs to you. You -will not mind his other notes, but when he camps near enough for you to -hear that one, you presently find that his measured and monotonous -repetition of it is beginning to disturb you; next it will weary you, -soon it will distress you, and before long each thump will hurt your -head; if this goes on, you will lose your mind with the pain and misery -of it, and go crazy. I am bringing some of these birds home to America. -There is nothing like them there. They will be a great surprise, and it -is said that in a climate like ours they will surpass expectation for -fecundity. - -I am bringing some nightingales, too, and some cue-owls. I got them in -Italy. The song of the nightingale is the deadliest known to -ornithology. That demoniacal shriek can kill at thirty yards. The note -of the cue-owl is infinitely soft and sweet--soft and sweet as the -whisper of a flute. But penetrating--oh, beyond belief; it can bore -through boiler-iron. It is a lingering note, and comes in triplets, on -the one unchanging key: hoo-o-o, hoo-o-o, hoo-o-o; then a silence of -fifteen seconds, then the triplet again; and so on, all night. At first -it is divine; then less so; then trying; then distressing; then -excruciating; then agonizing, and at the end of two hours the listener is -a maniac. - -And so, presently we took to the hand-car and went flying down the -mountain again; flying and stopping, flying and stopping, till at last we -were in the plain once more and stowed for Calcutta in the regular train. -That was the most enjoyable day I have spent in the earth. For rousing, -tingling, rapturous pleasure there is no holiday trip that approaches the -bird-flight down the Himalayas in a hand-car. It has no fault, no -blemish, no lack, except that there are only thirty-five miles of it -instead of five hundred. - - - - -CHAPTER LVII. - -She was not quite what you would call refined. She was not quite what -you would call unrefined. She was the kind of person that keeps a -parrot. - --Pudd'nhead Wilson's New Calendar. - -So far as I am able to judge, nothing has been left undone, either by man -or Nature, to make India the most extraordinary country that the sun -visits on his round. Nothing seems to have been forgotten, nothing over -looked. Always, when you think you have come to the end of her -tremendous specialties and have finished banging tags upon her as the -Land of the Thug, the Land of the Plague, the Land of Famine, the Land of -Giant Illusions, the Land of Stupendous Mountains, and so forth, another -specialty crops up and another tag is required. I have been overlooking -the fact that India is by an unapproachable supremacy--the Land of -Murderous Wild Creatures. Perhaps it will be simplest to throw away the -tags and generalize her with one all-comprehensive name, as the Land of -Wonders. - -For many years the British Indian Government has been trying to destroy -the murderous wild creatures, and has spent a great deal of money in the -effort. The annual official returns show that the undertaking is a -difficult one. - -These returns exhibit a curious annual uniformity in results; the sort of -uniformity which you find in the annual output of suicides in the world's -capitals, and the proportions of deaths by this, that, and the other -disease. You can always come close to foretelling how many suicides will -occur in Paris, London, and New York, next year, and also how many deaths -will result from cancer, consumption, dog-bite, falling out of the -window, getting run over by cabs, etc., if you know the statistics of -those matters for the present year. In the same way, with one year's -Indian statistics before you, you can guess closely at how many people -were killed in that Empire by tigers during the previous year, and the -year before that, and the year before that, and at how many were killed -in each of those years by bears, how many by wolves, and how many by -snakes; and you can also guess closely at how many people are going to be -killed each year for the coming five years by each of those agencies. -You can also guess closely at how many of each agency the government is -going to kill each year for the next five years. - -I have before me statistics covering a period of six consecutive years. -By these, I know that in India the tiger kills something over 800 persons -every year, and that the government responds by killing about double as -many tigers every year. In four of the six years referred to, the tiger -got 800 odd; in one of the remaining two years he got only 700, but in -the other remaining year he made his average good by scoring 917. He is -always sure of his average. Anyone who bets that the tiger will kill -2,400 people in India in any three consecutive years has invested his -money in a certainty; anyone who bets that he will kill 2,600 in any -three consecutive years, is absolutely sure to lose. - -As strikingly uniform as are the statistics of suicide, they are not any -more so than are those of the tiger's annual output of slaughtered human -beings in India. The government's work is quite uniform, too; it about -doubles the tiger's average. In six years the tiger killed 5,000 -persons, minus 50; in the same six years 10,000 tigers were killed, minus -400. - -The wolf kills nearly as many people as the tiger--700 a year to the -tiger's 800 odd--but while he is doing it, more than 5,000 of his tribe -fall. - -The leopard kills an average of 230 people per year, but loses 3,300 of -his own mess while he is doing it. - -The bear kills 100 people per year at a cost of 1,250 of his own tribe. - -The tiger, as the figures show, makes a very handsome fight against man. -But it is nothing to the elephant's fight. The king of beasts, the lord -of the jungle, loses four of his mess per year, but he kills forty--five -persons to make up for it. - -But when it comes to killing cattle, the lord of the jungle is not -interested. He kills but 100 in six years--horses of hunters, no doubt ---but in the same six the tiger kills more than 84,000, the leopard -100,000, the bear 4,000, the wolf 70,000, the hyena more than 13,000, -other wild beasts 27,000, and the snakes 19,000, a grand total of more -than 300,000; an average of 50,000 head per year. - -In response, the government kills, in the six years, a total of 3,201,232 -wild beasts and snakes. Ten for one. - -It will be perceived that the snakes are not much interested in cattle; -they kill only 3,000 odd per year. The snakes are much more interested -in man. India swarms with deadly snakes. At the head of the list is the -cobra, the deadliest known to the world, a snake whose bite kills where -the rattlesnake's bite merely entertains. - -In India, the annual man-killings by snakes are as uniform, as regular, -and as forecastable as are the tiger-average and the suicide-average. -Anyone who bets that in India, in any three consecutive years the snakes -will kill 49,500 persons, will win his bet; and anyone who bets that in -India in any three consecutive years, the snakes will kill 53,500 -persons, will lose his bet. In India the snakes kill 17,000 people a -year; they hardly ever fall short of it; they as seldom exceed it. An -insurance actuary could take the Indian census tables and the -government's snake tables and tell you within sixpence how much it would -be worth to insure a man against death by snake-bite there. If I had a -dollar for every person killed per year in India, I would rather have it -than any other property, as it is the only property in the world not -subject to shrinkage. - -I should like to have a royalty on the government-end of the snake -business, too, and am in London now trying to get it; but when I get it -it is not going to be as regular an income as the other will be if I get -that; I have applied for it. The snakes transact their end of the -business in a more orderly and systematic way than the government -transacts its end of it, because the snakes have had a long experience -and know all about the traffic. You can make sure that the government -will never kill fewer than 110,000 snakes in a year, and that it will -newer quite reach 300,000 too much room for oscillation; good speculative -stock, to bear or bull, and buy and sell long and short, and all that -kind of thing, but not eligible for investment like the other. The man -that speculates in the government's snake crop wants to go carefully. I -would not advise a man to buy a single crop at all--I mean a crop of -futures for the possible wobble is something quite extraordinary. If he -can buy six future crops in a bunch, seller to deliver 1,500,000 -altogether, that is another matter. I do not know what snakes are worth -now, but I know what they would be worth then, for the statistics show -that the seller could not come within 427,000 of carrying out his -contract. However, I think that a person who speculates in snakes is a -fool, anyway. He always regrets it afterwards. - -To finish the statistics. In six years the wild beasts kill 20,000 -persons, and the snakes kill 103,000. In the same six the government -kills 1,073,546 snakes. Plenty left. - -There are narrow escapes in India. In the very jungle where I killed -sixteen tigers and all those elephants, a cobra bit me but it got well; -everyone was surprised. This could not happen twice in ten years, -perhaps. Usually death would result in fifteen minutes. - -We struck out westward or northwestward from Calcutta on an itinerary of -a zig-zag sort, which would in the course of time carry us across India -to its northwestern corner and the border of Afghanistan. The first part -of the trip carried us through a great region which was an endless -garden--miles and miles of the beautiful flower from whose juices comes -the opium, and at Muzaffurpore we were in the midst of the indigo -culture; thence by a branch road to the Ganges at a point near Dinapore, -and by a train which would have missed the connection by a week but for -the thoughtfulness of some British officers who were along, and who knew -the ways of trains that are run by natives without white supervision. -This train stopped at every village; for no purpose connected with -business, apparently. We put out nothing, we took nothing aboard. The -train bands stepped ashore and gossiped with friends a quarter of an -hour, then pulled out and repeated this at the succeeding villages. We -had thirty-five miles to go and six hours to do it in, but it was plain -that we were not going to make it. It was then that the English officers -said it was now necessary to turn this gravel train into an express. So -they gave the engine-driver a rupee and told him to fly. It was a simple -remedy. After that we made ninety miles an hour. We crossed the Ganges -just at dawn, made our connection, and went to Benares, where we stayed -twenty-four hours and inspected that strange and fascinating piety-hive -again; then left for Lucknow, a city which is perhaps the most -conspicuous of the many monuments of British fortitude and valor that are -scattered about the earth. - -The heat was pitiless, the flat plains were destitute of grass, and baked -dry by the sun they were the color of pale dust, which was flying in -clouds. But it was much hotter than this when the relieving forces -marched to Lucknow in the time of the Mutiny. Those were the days of 138 -deg. in the shade. - - - - -CHAPTER, LVIII. - -Make it a point to do something every day that you don't want to do. -This is the golden rule for acquiring the habit of doing your duty -without pain. - --Pudd'nhead Wilson's New Calendar. - -It seems to be settled, now, that among the many causes from which the -Great Mutiny sprang, the main one was the annexation of the kingdom of -Oudh by the East India Company--characterized by Sir Henry Lawrence as -"the most unrighteous act that was ever committed." In the spring of -1857, a mutinous spirit was observable in many of the native garrisons, -and it grew day by day and spread wider and wider. The younger military -men saw something very serious in it, and would have liked to take hold -of it vigorously and stamp it out promptly; but they were not in -authority. Old-men were in the high places of the army--men who should -have been retired long before, because of their great age--and they -regarded the matter as a thing of no consequence. They loved their -native soldiers, and would not believe that anything could move them to -revolt. Everywhere these obstinate veterans listened serenely to the -rumbling of the volcanoes under them, and said it was nothing. - -And so the propagators of mutiny had everything their own way. They -moved from camp to camp undisturbed, and painted to the native soldier -the wrongs his people were suffering at the hands of the English, and -made his heart burn for revenge. They were able to point to two facts of -formidable value as backers of their persuasions: In Clive's day, native -armies were incoherent mobs, and without effective arms; therefore, they -were weak against Clive's organized handful of well-armed men, but the -thing was the other way, now. The British forces were native; they had -been trained by the British, organized by the British, armed by the -British, all the power was in their hands--they were a club made by -British hands to beat out British brains with. There was nothing to -oppose their mass, nothing but a few weak battalions of British soldiers -scattered about India, a force not worth speaking of. This argument, -taken alone, might not have succeeded, for the bravest and best Indian -troops had a wholesome dread of the white soldier, whether he was weak or -strong; but the agitators backed it with their second and best point -prophecy--a prophecy a hundred years old. The Indian is open to prophecy -at all times; argument may fail to convince him, but not prophecy. There -was a prophecy that a hundred years from the year of that battle of -Clive's which founded the British Indian Empire, the British power would -be overthrown and swept away by the natives. - -The Mutiny broke out at Meerut on the 10th of May, 1857, and fired a -train of tremendous historical explosions. Nana Sahib's massacre of the -surrendered garrison of Cawnpore occurred in June, and the long siege of -Lucknow began. The military history of England is old and great, but I -think it must be granted that the crushing of the Mutiny is the greatest -chapter in it. The British were caught asleep and unprepared. They were -a few thousands, swallowed up in an ocean of hostile populations. It -would take months to inform England and get help, but they did not falter -or stop to count the odds, but with English resolution and English -devotion they took up their task, and went stubbornly on with it, through -good fortune and bad, and fought the most unpromising fight that one may -read of in fiction or out of it, and won it thoroughly. - -The Mutiny broke out so suddenly, and spread with such rapidity that -there was but little time for occupants of weak outlying stations to -escape to places of safety. Attempts were made, of course, but they were -attended by hardships as bitter as death in the few cases which were -successful; for the heat ranged between 120 and 138 in the shade; the way -led through hostile peoples, and food and water were hardly to be had. -For ladies and children accustomed to ease and comfort and plenty, such a -journey must have been a cruel experience. Sir G. O. Trevelyan quotes -an example: - - "This is what befell Mrs. M----, the wife of the surgeon at a - certain station on the southern confines of the insurrection. 'I - heard,' she says, 'a number of shots fired, and, looking out, I saw - my husband driving furiously from the mess-house, waving his whip. - I ran to him, and, seeing a bearer with my child in his arms, I - caught her up, and got into the buggy. At the mess-house we found - all the officers assembled, together with sixty sepoys, who had - remained faithful. We went off in one large party, amidst a general - conflagration of our late homes. We reached the caravanserai at - Chattapore the next morning, and thence started for Callinger. At - this point our sepoy escort deserted us. We were fired upon by - match-lockmen, and one officer was shot dead. We heard, likewise, - that the people had risen at Callinger, so we returned and walked - back ten miles that day. M---- and I carried the child alternately. - Presently Mrs. Smalley died of sunstroke. We had no food amongst - us. An officer kindly lent us a horse. We were very faint. The - Major died, and was buried; also the Sergeant-major and some women. - The bandsmen left us on the nineteenth of June. We were fired at - again by match-lockmen, and changed direction for Allahabad. Our - party consisted of nine gentlemen, two children, the sergeant and - his wife. On the morning of the twentieth, Captain Scott took - Lottie on to his horse. I was riding behind my husband, and she was - so crushed between us. She was two years old on the first of the - month. We were both weak through want of food and the effect of the - sun. Lottie and I had no head covering. M---- had a sepoy's cap I - found on the ground. Soon after sunrise we were followed by - villagers armed with clubs and spears. One of them struck Captain - Scott's horse on the leg. He galloped off with Lottie, and my poor - husband never saw his child again. We rode on several miles, - keeping away from villages, and then crossed the river. Our thirst - was extreme. M---- had dreadful cramps, so that I had to hold him - on the horse. I was very uneasy about him. The day before I saw - the drummer's wife eating chupatties, and asked her to give a piece - to the child, which she did. I now saw water in a ravine. The - descent was steep, and our only drinkingvessel was M----'s cap. Our - horse got water, and I bathed my neck. I had no stockings, and my - feet were torn and blistered. Two peasants came in sight, and we - were frightened and rode off. The sergeant held our horse, and - M---- put me up and mounted. I think he must have got suddenly faint, - for I fell and he over me, on the road, when the horse started off. - Some time before he said, and Barber, too, that he could not live - many hours. I felt he was dying before we came to the ravine. He - told me his wishes about his children and myself, and took leave. - My brain seemed burnt up. No tears came. As soon as we fell, the - sergeant let go the horse, and it went off; so that escape was cut - off. We sat down on the ground waiting for death. Poor fellow! he - was very weak; his thirst was frightful, and I went to get him - water. Some villagers came, and took my rupees and watch. I took - off my wedding-ring, and twisted it in my hair, and replaced the - guard. I tore off the skirt of my dress to bring water in, but was - no use, for when I returned my beloved's eyes were fixed, and, - though I called and tried to restore him, and poured water into his - mouth, it only rattled in his throat. He never spoke to me again. - I held him in my arms till he sank gradually down. I felt frantic, - but could not cry. I was alone. I bound his head and face in my - dress, for there was no earth to buy him. The pain in my hands and - feet was dreadful. I went down to the ravine, and sat in the water - on a stone, hoping to get off at night and look for Lottie. When I - came back from the water, I saw that they had not taken her little - watch, chain, and seals, so I tied them under my petticoat. In an - hour, about thirty villagers came, they dragged me out of the - ravine, and took off my jacket, and found the little chain. They - then dragged me to a village, mocking me all the way, and disputing - as to whom I was to belong to. The whole population came to look at - me. I asked for a bedstead, and lay down outside the door of a hut. - They had a dozen of cows, and yet refused me milk. When night came, - and the village was quiet, some old woman brought me a leafful of - rice. I was too parched to eat, and they gave me water. The - morning after a neighboring Rajah sent a palanquin and a horseman to - fetch me, who told me that a little child and three Sahibs had come - to his master's house. And so the poor mother found her lost one, - 'greatly blistered,' poor little creature. It is not for Europeans - in India to pray that their flight be not in the winter." - -In the first days of June the aged general, Sir Hugh Wheeler commanding -the forces at Cawnpore, was deserted by his native troops; then he moved -out of the fort and into an exposed patch of open flat ground and built a -four-foot mud wall around it. He had with him a few hundred white -soldiers and officers, and apparently more women and children than -soldiers. He was short of provisions, short of arms, short of -ammunition, short of military wisdom, short of everything but courage and -devotion to duty. The defense of that open lot through twenty-one days -and nights of hunger, thirst, Indian heat, and a never-ceasing storm of -bullets, bombs, and cannon-balls--a defense conducted, not by the aged -and infirm general, but by a young officer named Moore--is one of the -most heroic episodes in history. When at last the Nana found it -impossible to conquer these starving men and women with powder and ball, -he resorted to treachery, and that succeeded. He agreed to supply them -with food and send them to Allahabad in boats. Their mud wall and their -barracks were in ruins, their provisions were at the point of exhaustion, -they had done all that the brave could do, they had conquered an -honorable compromise,--their forces had been fearfully reduced by -casualties and by disease, they were not able to continue the contest -longer. They came forth helpless but suspecting no treachery, the Nana's -host closed around them, and at a signal from a trumpet the massacre -began. About two hundred women and children were spared--for the -present--but all the men except three or four were killed. Among the -incidents of the massacre quoted by Sir G. O. Trevelyan, is this: - - "When, after the lapse of some twenty minutes, the dead began to - outnumber the living;--when the fire slackened, as the marks grew - few and far between; then the troopers who had been drawn up to the - right of the temple plunged into the river, sabre between teeth, and - pistol in hand. Thereupon two half-caste Christian women, the wives - of musicians in the band of the Fifty-sixth, witnessed a scene which - should not be related at second-hand. 'In the boat where I was to - have gone,' says Mrs. Bradshaw, confirmed throughout by Mrs. Betts, - 'was the school-mistress and twenty-two misses. General Wheeler - came last in a palkee. They carried him into the water near the - boat. I stood close by. He said, 'Carry me a little further - towards the boat.' But a trooper said, 'No, get out here.' As the - General got out of the palkee, head-foremost, the trooper gave him a - cut with his sword into the neck, and he fell into the water. My - son was killed near him. I saw it; alas! alas! Some were stabbed - with bayonets; others cut down. Little infants were torn in pieces. - We saw it; we did; and tell you only what we saw. Other children - were stabbed and thrown into the river. The schoolgirls were burnt - to death. I saw their clothes and hair catch fire. In the water, a - few paces off, by the next boat, we saw the youngest daughter of - Colonel Williams. A sepoy was going to kill her with his bayonet. - She said, 'My father was always kind to sepoys.' He turned away, - and just then a villager struck her on the head with a club, and she - fell into the water. These people likewise saw good Mr. Moncrieff, - the clergyman, take a book from his pocket that he never had leisure - to open, and heard him commence a prayer for mercy which he was not - permitted to conclude. Another deponent observed an European making - for a drain like a scared water-rat, when some boatmen, armed with - cudgels, cut off his retreat, and beat him down dead into the mud." - -The women and children who had been reserved from the massacre were -imprisoned during a fortnight in a small building, one story high--a -cramped place, a slightly modified Black Hole of Calcutta. They were -waiting in suspense; there was none who could foretaste their fate. -Meantime the news of the massacre had traveled far and an army of -rescuers with Havelock at its head was on its way--at least an army which -hoped to be rescuers. It was crossing the country by forced marches, and -strewing its way with its own dead men struck down by cholera, and by a -heat which reached 135 deg. It was in a vengeful fury, and it stopped -for nothing neither heat, nor fatigue, nor disease, nor human opposition. -It tore its impetuous way through hostile forces, winning victory after -victory, but still striding on and on, not halting to count results. And -at last, after this extraordinary march, it arrived before the walls of -Cawnpore, met the Nana's massed strength, delivered a crushing defeat, -and entered. - -But too late--only a few hours too late. For at the last moment the Nana -had decided upon the massacre of the captive women and children, and had -commissioned three Mohammedans and two Hindoos to do the work. Sir G. -O. Trevelyan says: - - "Thereupon the five men entered. It was the short gloaming of - Hindostan--the hour when ladies take their evening drive. She who - had accosted the officer was standing in the doorway. With her were - the native doctor and two Hindoo menials. That much of the business - might be seen from the veranda, but all else was concealed amidst - the interior gloom. Shrieks and scuffing acquainted those without - that the journeymen were earning their hire. Survur Khan soon - emerged with his sword broken off at the hilt. He procured another - from the Nana's house, and a few minutes after appeared again on the - same errand. The third blade was of better temper; or perhaps the - thick of the work was already over. By the time darkness had closed - in, the men came forth and locked up the house for the night. Then - the screams ceased, but the groans lasted till morning. - - "The sun rose as usual. When he had been up nearly three hours the - five repaired to the scene of their labors over night. They were - attended by a few sweepers, who proceeded to transfer the contents - of the house to a dry well situated behind some trees which grew - hard by. 'The bodies,' says one who was present throughout, 'were - dragged out, most of them by the hair of the head. Those who had - clothing worth taking were stripped. Some of the women were alive. - I cannot say how many; but three could speak. They prayed for the - sake of God that an end might be put to their sufferings. I - remarked one very stout woman, a half-caste, who was severely - wounded in both arms, who entreated to be killed. She and two or - three others were placed against the bank of the cut by which - bullocks go down in drawing water. The dead were first thrown in. - Yes: there was a great crowd looking on; they were standing along - the walls of the compound. They were principally city people and - villagers. Yes: there were also sepoys. Three boys were alive. - They were fair children. The eldest, I think, must have been six or - seven, and the youngest five years. They were running around the - well (where else could they go to?), and there was none to save - them. No one said a word or tried to save them.' - - "At length the smallest of them made an infantile attempt to get - away. The little thing had been frightened past bearing by the - murder of one of the surviving ladies. He thus attracted the - observation of a native who flung him and his companions down the - well." - -The soldiers had made a march of eighteen days, almost without rest, to -save the women and the children, and now they were too late--all were -dead and the assassin had flown. What happened then, Trevelyan hesitated -to put into words. "Of what took place, the less said is the better." - -Then he continues: - - "But there was a spectacle to witness which might excuse much. - Those who, straight from the contested field, wandered sobbing - through the rooms of the ladies' house, saw what it were well could - the outraged earth have straightway hidden. The inner apartment was - ankle-deep in blood. The plaster was scored with sword-cuts; not - high up as where men have fought, but low down, and about the - corners, as if a creature had crouched to avoid the blow. Strips of - dresses, vainly tied around the handles of the doors, signified the - contrivance to which feminine despair had resorted as a means of - keeping out the murderers. Broken combs were there, and the frills - of children's trousers, and torn cuffs and pinafores, and little - round hats, and one or two shoes with burst latchets, and one or two - daguerreotype cases with cracked glasses. An officer picked up a - few curls, preserved in a bit of cardboard, and marked 'Ned's hair, - with love'; but around were strewn locks, some near a yard in - length, dissevered, not as a keepsake, by quite other scissors." - -The battle of Waterloo was fought on the 18th of June, 1815. I do not -state this fact as a reminder to the reader, but as news to him. For a -forgotten fact is news when it comes again. Writers of books have the -fashion of whizzing by vast and renowned historical events with the -remark, "The details of this tremendous episode are too familiar to the -reader to need repeating here." They know that that is not true. It is -a low kind of flattery. They know that the reader has forgotten every -detail of it, and that nothing of the tremendous event is left in his -mind but a vague and formless luminous smudge. Aside from the desire to -flatter the reader, they have another reason for making the remark-two -reasons, indeed. They do not remember the details themselves, and do not -want the trouble of hunting them up and copying them out; also, they are -afraid that if they search them out and print them they will be scoffed -at by the book-reviewers for retelling those worn old things which are -familiar to everybody. They should not mind the reviewer's jeer; he -doesn't remember any of the worn old things until the book which he is -reviewing has retold them to him. - -I have made the quoted remark myself, at one time and another, but I was -not doing it to flatter the reader; I was merely doing it to save work. -If I had known the details without brushing up, I would have put them in; -but I didn't, and I did not want the labor of posting myself; so I said, -"The details of this tremendous episode are too familiar to the reader to -need repeating here." I do not like that kind of a lie; still, it does -save work. - -I am not trying to get out of repeating the details of the Siege of -Lucknow in fear of the reviewer; I am not leaving them out in fear that -they would not interest the reader; I am leaving them out partly to save -work; mainly for lack of room. It is a pity, too; for there is not a -dull place anywhere in the great story. - -Ten days before the outbreak (May 10th) of the Mutiny, all was serene at -Lucknow, the huge capital of Oudh, the kingdom which had recently been -seized by the India Company. There was a great garrison, composed of -about 7,000 native troops and between 700 and 800 whites. These white -soldiers and their families were probably the only people of their race -there; at their elbow was that swarming population of warlike natives, a -race of born soldiers, brave, daring, and fond of fighting. On high -ground just outside the city stood the palace of that great personage, -the Resident, the representative of British power and authority. It -stood in the midst of spacious grounds, with its due complement of -outbuildings, and the grounds were enclosed by a wall--a wall not for -defense, but for privacy. The mutinous spirit was in the air, but the -whites were not afraid, and did not feel much troubled. - -Then came the outbreak at Meerut, then the capture of Delhi by the -mutineers; in June came the three-weeks leaguer of Sir Hugh Wheeler in -his open lot at Cawnpore--40 miles distant from Lucknow--then the -treacherous massacre of that gallant little garrison; and now the great -revolt was in full flower, and the comfortable condition of things at -Lucknow was instantly changed. - -There was an outbreak there, and Sir Henry Lawrence marched out of the -Residency on the 30th of June to put it down, but was defeated with heavy -loss, and had difficulty in getting back again. That night the memorable -siege of the Residency--called the siege of Lucknow--began. Sir Henry -was killed three days later, and Brigadier Inglis succeeded him in -command. - -Outside of the Residency fence was an immense host of hostile and -confident native besiegers; inside it were 480 loyal native soldiers, 730 -white ones, and 500 women and children. - -In those days the English garrisons always managed to hamper themselves -sufficiently with women and children. - -The natives established themselves in houses close at hand and began to -rain bullets and cannon-balls into the Residency; and this they kept up, -night and day, during four months and a half, the little garrison -industriously replying all the time. The women and children soon became -so used to the roar of the guns that it ceased to disturb their sleep. -The children imitated siege and defense in their play. The women--with -any pretext, or with none--would sally out into the storm-swept grounds. -The defense was kept up week after week, with stubborn fortitude, in the -midst of death, which came in many forms--by bullet, small-pox, cholera, -and by various diseases induced by unpalatable and insufficient food, by -the long hours of wearying and exhausting overwork in the daily and -nightly battle in the oppressive Indian heat, and by the broken rest -caused by the intolerable pest of mosquitoes, flies, mice, rats, and -fleas. - -Six weeks after the beginning of the siege more than one-half of the -original force of white soldiers was dead, and close upon three-fifths of -the original native force. - -But the fighting went on just the same. The enemy mined, the English -counter-mined, and, turn about, they blew up each other's posts. The -Residency grounds were honey-combed with the enemy's tunnels. Deadly -courtesies were constantly exchanged--sorties by the English in the -night; rushes by the enemy in the night--rushes whose purpose was to -breach the walls or scale them; rushes which cost heavily, and always -failed. - -The ladies got used to all the horrors of war--the shrieks of mutilated -men, the sight of blood and death. Lady Inglis makes this mention in her -diary: - - "Mrs. Bruere's nurse was carried past our door to-day, wounded in - the eye. To extract the bullet it was found necessary to take out - the eye--a fearful operation. Her mistress held her while it was - performed." - -The first relieving force failed to relieve. It was under Havelock and -Outram; and arrived when the siege had been going on for three months. -It fought its desperate way to Lucknow, then fought its way through the -city against odds of a hundred to one, and entered the Residency; but -there was not enough left of it, then, to do any good. It lost more men -in its last fight than it found in the Residency when it got in. It -became captive itself. - -The fighting and starving and dying by bullets and disease went steadily -on. Both sides fought with energy and industry. Captain Birch puts this -striking incident in evidence. He is speaking of the third month of the -siege: - - "As an instance of the heavy firing brought to bear on our position - this month may be mentioned the cutting down of the upper story of a - brick building simply by musketry firring. This building was in a - most exposed position. All the shots which just missed the top of - the rampart cut into the dead wall pretty much in a straight line, - and at length cut right through and brought the upper story tumbling - down. The upper structure on the top of the brigade-mess also fell - in. The Residency house was a wreck. Captain Anderson's post had - long ago been knocked down, and Innes' post also fell in. These two - were riddled with round shot. As many as 200 were picked up by - Colonel Masters." - -The exhausted garrison fought doggedly on all through the next month -October. Then, November 2d, news came Sir Colin Campbell's relieving -force would soon be on its way from Cawnpore. - -On the 12th the boom of his guns was heard. - -On the 13th the sounds came nearer--he was slowly, but steadily, cutting -his way through, storming one stronghold after another. - -On the 14th he captured the Martiniere College, and ran up the British -flag there. It was seen from the Residency. - -Next he took the Dilkoosha. - -On the 17th he took the former mess-house of the 32d regiment--a -fortified building, and very strong. "A most exciting, anxious day," -writes Lady Inglis in her diary. "About 4 P.M., two strange officers -walked through our yard, leading their horses"--and by that sign she knew -that communication was established between the forces, that the relief -was real, this time, and that the long siege of Lucknow was ended. - -The last eight or ten miles of Sir Colin Campbell's march was through -seas of, blood. The weapon mainly used was the bayonet, the fighting was -desperate. The way was mile-stoned with detached strong buildings of -stone, fortified, and heavily garrisoned, and these had to be taken by -assault. Neither side asked for quarter, and neither gave it. At the -Secundrabagh, where nearly two thousand of the enemy occupied a great -stone house in a garden, the work of slaughter was continued until every -man was killed. That is a sample of the character of that devastating -march. - -There were but few trees in the plain at that time, and from the -Residency the progress of the march, step by step, victory by victory, -could be noted; the ascending clouds of battle-smoke marked the way to -the eye, and the thunder of the guns marked it to the ear. - -Sir Colin Campbell had not come to Lucknow to hold it, but to save the -occupants of the Residency, and bring them away. Four or five days after -his arrival the secret evacuation by the troops took place, in the middle -of a dark night, by the principal gate, (the Bailie Guard). The two -hundred women and two hundred and fifty children had been previously -removed. Captain Birch says: - - "And now commenced a movement of the most perfect arrangement and - successful generalship--the withdrawal of the whole of the various - forces, a combined movement requiring the greatest care and skill. - First, the garrison in immediate contact with the enemy at the - furthest extremity of the Residency position was marched out. Every - other garrison in turn fell in behind it, and so passed out through - the Bailie Guard gate, till the whole of our position was evacuated. - Then Havelock's force was similarly withdrawn, post by post, - marching in rear of our garrison. After them in turn came the - forces of the Commander-in-Chief, which joined on in the rear of - Havelock's force. Regiment by regiment was withdrawn with--the - utmost order and regularity. The whole operation resembled the - movement of a telescope. Stern silence was kept, and the enemy took - no alarm." - -Lady Inglis, referring to her husband and to General Sir James Outram, -sets down the closing detail of this impressive midnight retreat, in -darkness and by stealth, of this shadowy host through the gate which it -had defended so long and so well: - - "At twelve precisely they marched out, John and Sir James Outram - remaining till all had passed, and then they took off their hats to - the Bailie Guard, the scene of as noble a defense as I think history - will ever have to relate." - - - - -CHAPTER LIX. - -Don't part with your illusions. When they are gone you may still exist -but you have ceased to live. - --Pudd'nhead Wilson's New Calendar. - -Often, the surest way to convey misinformation is to tell the strict -truth. - --Pudd'nhead Wilson's New Calendar. - -We were driven over Sir Colin Campbell's route by a British officer, and -when I arrived at the Residency I was so familiar with the road that I -could have led a retreat over it myself; but the compass in my head has -been out of order from my birth, and so, as soon as I was within the -battered Bailie Guard and turned about to review the march and imagine -the relieving forces storming their way along it, everything was upside -down and wrong end first in a moment, and I was never able to get -straightened out again. And now, when I look at the battle-plan, the -confusion remains. In me the east was born west, the battle-plans which -have the east on the right-hand side are of no use to me. - -The Residency ruins are draped with flowering vines, and are impressive -and beautiful. They and the grounds are sacred now, and will suffer no -neglect nor be profaned by any sordid or commercial use while the British -remain masters of India. Within the grounds are buried the dead who gave -up their lives there in the long siege. - -After a fashion, I was able to imagine the fiery storm that raged night -and day over the place during so many months, and after a fashion I could -imagine the men moving through it, but I could not satisfactorily place -the 200 women, and I could do nothing at all with the 250 children. I -knew by Lady Inglis' diary that the children carried on their small -affairs very much as if blood and carnage and the crash and thunder of a -siege were natural and proper features of nursery life, and I tried to -realize it; but when her little Johnny came rushing, all excitement, -through the din and smoke, shouting, "Oh, mamma, the white hen has laid -an egg!" I saw that I could not do it. Johnny's place was under the -bed. I could imagine him there, because I could imagine myself there; -and I think I should not have been interested in a hen that was laying an -egg; my interest would have been with the parties that were laying the -bombshells. I sat at dinner with one of those children in the Club's -Indian palace, and I knew that all through the siege he was perfecting -his teething and learning to talk; and while to me he was the most -impressive object in Lucknow after the Residency ruins, I was not able to -imagine what his life had been during that tempestuous infancy of his, -nor what sort of a curious surprise it must have been to him to be -marched suddenly out into a strange dumb world where there wasn't any -noise, and nothing going on. He was only forty-one when I saw him, a -strangely youthful link to connect the present with so ancient an episode -as the Great Mutiny. - -By and by we saw Cawnpore, and the open lot which was the scene of -Moore's memorable defense, and the spot on the shore of the Ganges where -the massacre of the betrayed garrison occurred, and the small Indian -temple whence the bugle-signal notified the assassins to fall on. This -latter was a lonely spot, and silent. The sluggish river drifted by, -almost currentless. It was dead low water, narrow channels with vast -sandbars between, all the way across the wide bed; and the only living -thing in sight was that grotesque and solemn bald-headed bird, the -Adjutant, standing on his six-foot stilts, solitary on a distant bar, -with his head sunk between his shoulders, thinking; thinking of his -prize, I suppose--the dead Hindoo that lay awash at his feet, and whether -to eat him alone or invite friends. He and his prey were a proper accent -to that mournful place. They were in keeping with it, they emphasized -its loneliness and its solemnity. - -And we saw the scene of the slaughter of the helpless women and children, -and also the costly memorial that is built over the well which contains -their remains. The Black Hole of Calcutta is gone, but a more reverent -age is come, and whatever remembrancer still exists of the moving and -heroic sufferings and achievements of the garrisons of Lucknow and -Cawnpore will be guarded and preserved. - -In Agra and its neighborhood, and afterwards at Delhi, we saw forts, -mosques, and tombs, which were built in the great days of the Mohammedan -emperors, and which are marvels of cost, magnitude, and richness of -materials and ornamentation, creations of surpassing grandeur, wonders -which do indeed make the like things in the rest of the world seem tame -and inconsequential by comparison. I am not purposing to describe them. -By good fortune I had not read too much about them, and therefore was -able to get a natural and rational focus upon them, with the result that -they thrilled, blessed, and exalted me. But if I had previously -overheated my imagination by drinking too much pestilential literary hot -Scotch, I should have suffered disappointment and sorrow. - -I mean to speak of only one of these many world-renowned buildings, the -Taj Mahal, the most celebrated construction in the earth. I had read a -great deal too much about it. I saw it in the daytime, I saw it in the -moonlight, I saw it near at hand, I saw it from a distance; and I knew -all the time, that of its kind it was the wonder of the world, with no -competitor now and no possible future competitor; and yet, it was not my -Taj. My Taj had been built by excitable literary people; it was solidly -lodged in my head, and I could not blast it out. - -I wish to place before the reader some of the usual descriptions of the -Taj, and ask him to take note of the impressions left in his mind. These -descriptions do really state the truth--as nearly as the limitations of -language will allow. But language is a treacherous thing, a most unsure -vehicle, and it can seldom arrange descriptive words in such a way that -they will not inflate the facts--by help of the reader's imagination, -which is always ready to take a hand, and work for nothing, and do the -bulk of it at that. - -I will begin with a few sentences from the excellent little local -guide-book of Mr. Satya Chandra Mukerji. I take them from here and there -in his description: - - "The inlaid work of the Taj and the flowers and petals that are to - be found on all sides on the surface of the marble evince a most - delicate touch." - -That is true. - - "The inlaid work, the marble, the flowers, the buds, the leaves, the - petals, and the lotus stems are almost without a rival in the whole - of the civilized world." - - "The work of inlaying with stones and gems is found in the highest - perfection in the Taj." - -Gems, inlaid flowers, buds, and leaves to be found on all sides. What do -you see before you? Is the fairy structure growing? Is it becoming a -jewel casket? - - "The whole of the Taj produces a wonderful effect that is equally - sublime and beautiful." - -Then Sir William Wilson Hunter: - - "The Taj Mahal with its beautiful domes, 'a dream of marble,' rises - on the river bank." - - "The materials are white marble and red sandstone." - - "The complexity of its design and the delicate intricacy of the - workmanship baffle description." - -Sir William continues. I will italicize some of his words: - - "The mausoleum stands on a raised marble platform at each of whose - corners rises a tall and slender minaret of graceful proportions and - of exquisite beauty. Beyond the platform stretch the two wings, one - of which is itself a mosque of great architectural merit. In the - center of the whole design the mausoleum occupies a square of 186 - feet, with the angles deeply truncated so also form an unequal - octagon. The main feature in this central pile is the great dome, - which swells upward to nearly two-thirds of a sphere and tapers at - its extremity into a pointed spire crowned by a crescent. Beneath - it an enclosure of marble trellis-work surrounds the tomb of the - princess and of her husband, the Emperor. Each corner of the - mausoleum is covered by a similar though much smaller dome erected - on a pediment pierced with graceful Saracenic arches. Light is - admitted into the interior through a double screen of pierced - marble, which tempers the glare of an Indian sky while its whiteness - prevents the mellow effect from degenerating into gloom. The - internal decorations consist of inlaid work in precious stones, such - as agate, jasper, etc., with which every squandril or salient point - in the architecture is richly fretted. Brown and violet marble is - also freely employed in wreaths, scrolls, and lintels to relieve the - monotony of white wall. In regard to color and design, the interior - of the Taj may rank first in the world for purely decorative - workmanship; while the perfect symmetry of its exterior, once seen - can never be forgotten, nor the aerial grace of its domes, rising - like marble bubbles into the clear sky. The Taj represents the most - highly elaborated stage of ornamentation reached by the - Indo-Mohammedan builders, the stage in which the architect ends and - the jeweler begins. In its magnificent gateway the diagonal - ornamentation at the corners, which satisfied the designers of the - gateways of Itimad-ud-doulah and Sikandra mausoleums is superseded - by fine marble cables, in bold twists, strong and handsome. The - triangular insertions of white marble and large flowers have in like - manner given place to fine inlaid work. Firm perpendicular lines in - black marble with well proportioned panels of the same material are - effectively used in the interior of the gateway. On its top the - Hindu brackets and monolithic architraves of Sikandra are replaced - by Moorish carped arches, usually single blocks of red sandstone, in - the Kiosks and pavilions which adorn the roof. From the pillared - pavilions a magnificent view is obtained of the Taj gardens below, - with the noble Jumna river at their farther end, and the city and - fort of Agra in the distance. From this beautiful and splendid - gateway one passes up a straight alley shaded by evergreen trees - cooled by a broad shallow piece of water running along the middle of - the path to the Taj itself. The Taj is entirely of marble and gems. - The red sandstone of the other Mohammedan buildings has entirely - disappeared, or rather the red sandstone which used to form the - thickness of the walls, is in the Taj itself overlaid completely - with white marble, and the white marble is itself inlaid with - precious stones arranged in lovely patterns of flowers. A feeling - of purity impresses itself on the eye and the mind from the absence - of the coarser material which forms so invariable a material in Agra - architecture. The lower wall and panels are covered with tulips, - oleanders, and fullblown lilies, in flat carving on the white - marble; and although the inlaid work of flowers done in gems is very - brilliant when looked at closely, there is on the whole but little - color, and the all-prevailing sentiment is one of whiteness, - silence, and calm. The whiteness is broken only by the fine color - of the inlaid gems, by lines in black marble, and by delicately - written inscriptions, also in black, from the Koran. Under the dome - of the vast mausoleum a high and beautiful screen of open tracery in - white marble rises around the two tombs, or rather cenotaphs of the - emperor and his princess; and in this marvel of marble the carving - has advanced from the old geometrical patterns to a trellis-work of - flowers and foliage, handled with great freedom and spirit. The two - cenotaphs in the center of the exquisite enclosure have no carving - except the plain Kalamdan or oblong pen-box on the tomb of Emperor - Shah Jehan. But both cenotaphs are inlaid with flowers made of - costly gems, and with the ever graceful oleander scroll." - -Bayard Taylor, after describing the details of the Taj, goes on to say: - - "On both sides the palm, the banyan, and the feathery bamboo mingle - their foliage; the song of birds meets your ears, and the odor of - roses and lemon flowers sweetens the air. Down such a vista and - over such a foreground rises the Taj. There is no mystery, no sense - of partial failure about the Taj. A thing of perfect beauty and of - absolute finish in every detail, it might pass for the work of genii - who knew naught of the weaknesses and ills with which mankind are - beset." - -All of these details are true. But, taken together, they state a -falsehood--to you. You cannot add them up correctly. Those writers know -the values of their words and phrases, but to you the words and phrases -convey other and uncertain values. To those writers their phrases have -values which I think I am now acquainted with; and for the help of the -reader I will here repeat certain of those words and phrases, and follow -them with numerals which shall represent those values--then we shall see -the difference between a writer's ciphering and a mistaken reader's-- - -Precious stones, such as agate, jasper, etc.--5. - -With which every salient point is richly fretted--5. - -First in the world for purely decorative workmanship--9. - -The Taj represents the stage where the architect ends and the jeweler -begins--5. - -The Taj is entirely of marble and gems--7. - -Inlaid with precious stones in lovely patterns of flowers--5. - -The inlaid work of flowers done in gems is very brilliant -(followed by a most important modification which the reader is sure to -read too carelessly)--2. - -The vast mausoleum--5. - -This marvel of marble--5. - -The exquisite enclosure--5. - -Inlaid with flowers made of costly gems--5. - -A thing of perfect beauty and absolute finish--5. - - -Those details are correct; the figures which I have placed after them -represent quite fairly their individual, values. Then why, as a whole, -do they convey a false impression to the reader? It is because the -reader--beguiled by, his heated imagination--masses them in the wrong -way. The writer would mass the first three figures in the following way, -and they would speak the truth - -Total--19 - -But the reader masses them thus--and then they tell a lie--559. - -The writer would add all of his twelve numerals together, and then the -sum would express the whole truth about the Taj, and the truth only--63. - -But the reader--always helped by his imagination--would put the figures -in a row one after the other, and get this sum, which would tell him a -noble big lie: - -559575255555. - -You must put in the commas yourself; I have to go on with my work. - -The reader will always be sure to put the figures together in that wrong -way, and then as surely before him will stand, sparkling in the sun, a -gem-crusted Taj tall as the Matterhorn. - -I had to visit Niagara fifteen times before I succeeded in getting my -imaginary Falls gauged to the actuality and could begin to sanely and -wholesomely wonder at them for what they were, not what I had expected -them to be. When I first approached them it was with my face lifted -toward the sky, for I thought I was going to see an Atlantic ocean -pouring down thence over cloud-vexed Himalayan heights, a sea-green wall -of water sixty miles front and six miles high, and so, when the toy -reality came suddenly into view--that beruiled little wet apron hanging -out to dry--the shock was too much for me, and I fell with a dull thud. - -Yet slowly, surely, steadily, in the course of my fifteen visits, the -proportions adjusted themselves to the facts, and I came at last to -realize that a waterfall a hundred and sixty-five feet high and a quarter -of a mile wide was an impressive thing. It was not a dipperful to my -vanished great vision, but it would answer. - -I know that I ought to do with the Taj as I was obliged to do with -Niagara--see it fifteen times, and let my mind gradually get rid of the -Taj built in it by its describers, by help of my imagination, and -substitute for it the Taj of fact. It would be noble and fine, then, and -a marvel; not the marvel which it replaced, but still a marvel, and fine -enough. I am a careless reader, I suppose--an impressionist reader; an -impressionist reader of what is not an impressionist picture; a reader -who overlooks the informing details or masses their sum improperly, and -gets only a large splashy, general effect--an effect which is not -correct, and which is not warranted by the particulars placed before me -particulars which I did not examine, and whose meanings I did not -cautiously and carefully estimate. It is an effect which is some -thirty-five or forty times finer than the reality, and is therefore a -great deal better and more valuable than the reality; and so, I ought -never to hunt up the reality, but stay miles away from it, and thus -preserve undamaged my own private mighty Niagara tumbling out of the -vault of heaven, and my own ineffable Taj, built of tinted mists upon -jeweled arches of rainbows supported by colonnades of moonlight. It is a -mistake for a person with an unregulated imagination to go and look at an -illustrious world's wonder. - -I suppose that many, many years ago I gathered the idea that the Taj's -place in the achievements of man was exactly the place of the ice-storm -in the achievements of Nature; that the Taj represented man's supremest -possibility in the creation of grace and beauty and exquisiteness and -splendor, just as the ice-storm represents Nature's supremest possibility -in the combination of those same qualities. I do not know how long ago -that idea was bred in me, but I know that I cannot remember back to a -time when the thought of either of these symbols of gracious and -unapproachable perfection did not at once suggest the other. If I -thought of the ice-storm, the Taj rose before me divinely beautiful; if I -thought of the Taj, with its encrustings and inlayings of jewels, the -vision of the ice-storm rose. And so, to me, all these years, the Taj -has had no rival among the temples and palaces of men, none that even -remotely approached it it was man's architectural ice-storm. - -Here in London the other night I was talking with some Scotch and English -friends, and I mentioned the ice-storm, using it as a figure--a figure -which failed, for none of them had heard of the ice-storm. One -gentleman, who was very familiar with American literature, said he had -never seen it mentioned in any book. That is strange. And I, myself, -was not able to say that I had seen it mentioned in a book; and yet the -autumn foliage, with all other American scenery, has received full and -competent attention. - -The oversight is strange, for in America the ice-storm is an event. And -it is not an event which one is careless about. When it comes, the news -flies from room to room in the house, there are bangings on the doors, -and shoutings, "The ice-storm! the ice-storm!" and even the laziest -sleepers throw off the covers and join the rush for the windows. The -ice-storm occurs in midwinter, and usually its enchantments are wrought -in the silence and the darkness of the night. A fine drizzling rain -falls hour after hour upon the naked twigs and branches of the trees, and -as it falls it freezes. In time the trunk and every branch and twig are -incased in hard pure ice; so that the tree looks like a skeleton tree -made all of glass--glass that is crystal-clear. All along the underside -of every branch and twig is a comb of little icicles--the frozen drip. -Sometimes these pendants do not quite amount to icicles, but are round -beads--frozen tears. - -The weather clears, toward dawn, and leaves a brisk pure atmosphere and a -sky without a shred of cloud in it--and everything is still, there is not -a breath of wind. The dawn breaks and spreads, the news of the storm -goes about the house, and the little and the big, in wraps and blankets, -flock to the window and press together there, and gaze intently out upon -the great white ghost in the grounds, and nobody says a word, nobody -stirs. All are waiting; they know what is coming, and they are waiting -waiting for the miracle. The minutes drift on and on and on, with not a -sound but the ticking of the clock; at last the sun fires a sudden sheaf -of rays into the ghostly tree and turns it into a white splendor of -glittering diamonds. Everybody catches his breath, and feels a swelling -in his throat and a moisture in his eyes-but waits again; for he knows -what is coming; there is more yet. The sun climbs higher, and still -higher, flooding the tree from its loftiest spread of branches to its -lowest, turning it to a glory of white fire; then in a moment, without -warning, comes the great miracle, the supreme miracle, the miracle -without its fellow in the earth; a gust of wind sets every branch and -twig to swaying, and in an instant turns the whole white tree into a -spouting and spraying explosion of flashing gems of every conceivable -color; and there it stands and sways this way and that, flash! flash! -flash! a dancing and glancing world of rubies, emeralds, diamonds, -sapphires, the most radiant spectacle, the most blinding spectacle, the -divinest, the most exquisite, the most intoxicating vision of fire and -color and intolerable and unimaginable splendor that ever any eye has -rested upon in this world, or will ever rest upon outside of the gates of -heaven. - -By, all my senses, all my faculties, I know that the icestorm is Nature's -supremest achievement in the domain of the superb and the beautiful; and -by my reason, at least, I know that the Taj is man's ice-storm. - -In the ice-storm every one of the myriad ice-beads pendant from twig and -branch is an individual gem, and changes color with every motion caused -by the wind; each tree carries a million, and a forest-front exhibits the -splendors of the single tree multiplied by a thousand. - -It occurs to me now that I have never seen the ice-storm put upon canvas, -and have not heard that any painter has tried to do it. I wonder why -that is. Is it that paint cannot counterfeit the intense blaze of a -sun-flooded jewel? There should be, and must be, a reason, and a good one, -why the most enchanting sight that Nature has created has been neglected -by the brush. - -Often, the surest way to convey misinformation is to tell the strict -truth. The describers of the Taj have used the word gem in its strictest -sense--its scientific sense. In that sense it is a mild word, and -promises but little to the eye-nothing bright, nothing brilliant, nothing -sparkling, nothing splendid in the way of color. It accurately describes -the sober and unobtrusive gem-work of the Taj; that is, to the very -highly-educated one person in a thousand; but it most falsely describes -it to the 999. But the 999 are the people who ought to be especially -taken care of, and to them it does not mean quiet-colored designs wrought -in carnelians, or agates, or such things; they know the word in its wide -and ordinary sense only, and so to them it means diamonds and rubies and -opals and their kindred, and the moment their eyes fall upon it in print -they see a vision of glorious colors clothed in fire. - -These describers are writing for the "general," and so, in order to make -sure of being understood, they ought to use words in their ordinary -sense, or else explain. The word fountain means one thing in Syria, -where there is but a handful of people; it means quite another thing in -North America, where there are 75,000,000. If I were describing some -Syrian scenery, and should exclaim, "Within the narrow space of a quarter -of a mile square I saw, in the glory of the flooding moonlight, two -hundred noble fountains--imagine the spectacle!" the North American would -have a vision of clustering columns of water soaring aloft, bending over -in graceful arches, bursting in beaded spray and raining white fire in -the moonlight-and he would be deceived. But the Syrian would not be -deceived; he would merely see two hundred fresh-water springs--two -hundred drowsing puddles, as level and unpretentious and unexcited as so -many door-mats, and even with the help of the moonlight he would not lose -his grip in the presence of the exhibition. My word "fountain" would be -correct; it would speak the strict truth; and it would convey the strict -truth to the handful of Syrians, and the strictest misinformation to the -North American millions. With their gems--and gems--and more gems--and -gems again--and still other gems--the describers of the Taj are within -their legal but not their moral rights; they are dealing in the strictest -scientific truth; and in doing it they succeed to admiration in telling -"what ain't so." - - - - -CHAPTER LX. - -SATAN (impatiently) to NEW-COMER. The trouble with you Chicago people -is, that you think you are the best people down here; whereas you are -merely the most numerous. - --Pudd'nhead Wilson's New Calendar. - -We wandered contentedly around here and there in India; to Lahore, among -other places, where the Lieutenant-Governor lent me an elephant. This -hospitality stands out in my experiences in a stately isolation. It was -a fine elephant, affable, gentlemanly, educated, and I was not afraid of -it. I even rode it with confidence through the crowded lanes of the -native city, where it scared all the horses out of their senses, and -where children were always just escaping its feet. It took the middle of -the road in a fine independent way, and left it to the world to get out -of the way or take the consequences. I am used to being afraid of -collisions when I ride or drive, but when one is on top of an elephant -that feeling is absent. I could have ridden in comfort through a -regiment of runaway teams. I could easily learn to prefer an elephant to -any other vehicle, partly because of that immunity from collisions, and -partly because of the fine view one has from up there, and partly because -of the dignity one feels in that high place, and partly because one can -look in at the windows and see what is going on privately among the -family. The Lahore horses were used to elephants, but they were -rapturously afraid of them just the same. It seemed curious. Perhaps -the better they know the elephant the more they respect him in that -peculiar way. In our own case--we are not afraid of dynamite till we get -acquainted with it. - -We drifted as far as Rawal Pindi, away up on the Afghan frontier--I think -it was the Afghan frontier, but it may have been Hertzegovina--it was -around there somewhere--and down again to Delhi, to see the ancient -architectural wonders there and in Old Delhi and not describe them, and -also to see the scene of the illustrious assault, in the Mutiny days, -when the British carried Delhi by storm, one of the marvels of history -for impudent daring and immortal valor. - -We had a refreshing rest, there in Delhi, in a great old mansion which -possessed historical interest. It was built by a rich Englishman who had -become orientalized--so much so that he had a zenana. But he was a -broadminded man, and remained so. To please his harem he built a mosque; -to please himself he built an English church. That kind of a man will -arrive, somewhere. In the Mutiny days the mansion was the British -general's headquarters. It stands in a great garden--oriental fashion ---and about it are many noble trees. The trees harbor monkeys; and they -are monkeys of a watchful and enterprising sort, and not much troubled -with fear. They invade the house whenever they get a chance, and carry -off everything they don't want. One morning the master of the house was -in his bath, and the window was open. Near it stood a pot of yellow -paint and a brush. Some monkeys appeared in the window; to scare them -away, the gentleman threw his sponge at them. They did not scare at all; -they jumped into the room and threw yellow paint all over him from the -brush, and drove him out; then they painted the walls and the floor and -the tank and the windows and the furniture yellow, and were in the -dressing-room painting that when help arrived and routed them. - -Two of these creatures came into my room in the early morning, through a -window whose shutters I had left open, and when I woke one of them was -before the glass brushing his hair, and the other one had my note-book, -and was reading a page of humorous notes and crying. I did not mind the -one with the hair-brush, but the conduct of the other one hurt me; it -hurts me yet. I threw something at him, and that was wrong, for my host -had told me that the monkeys were best left alone. They threw everything -at me that they could lift, and then went into the bathroom to get some -more things, and I shut the door on them. - -At Jeypore, in Rajputana, we made a considerable stay. We were not in -the native city, but several miles from it, in the small European -official suburb. There were but few Europeans--only fourteen but they -were all kind and hospitable, and it amounted to being at home. In -Jeypore we found again what we had found all about India--that while the -Indian servant is in his way a very real treasure, he will sometimes bear -watching, and the Englishman watches him. If he sends him on an errand, -he wants more than the man's word for it that he did the errand. When -fruit and vegetables were sent to us, a "chit" came with them--a receipt -for us to sign; otherwise the things might not arrive. If a gentleman -sent up his carriage, the chit stated "from" such-and-such an hour "to" -such-and-such an hour--which made it unhandy for the coachman and his two -or three subordinates to put us off with a part of the allotted time and -devote the rest of it to a lark of their own. - -We were pleasantly situated in a small two-storied inn, in an empty large -compound which was surrounded by a mud wall as high as a man's head. The -inn was kept by nine Hindoo brothers, its owners. They lived, with their -families, in a one-storied building within the compound, but off to one -side, and there was always a long pile of their little comely brown -children loosely stacked in its veranda, and a detachment of the parents -wedged among them, smoking the hookah or the howdah, or whatever they -call it. By the veranda stood a palm, and a monkey lived in it, and led -a lonesome life, and always looked sad and weary, and the crows bothered -him a good deal. - -The inn cow poked about the compound and emphasized the secluded and -country air of the place, and there was a dog of no particular breed, who -was always present in the compound, and always asleep, always stretched -out baking in the sun and adding to the deep tranquility and -reposefulness of the place, when the crows were away on business. -White-draperied servants were coming and going all the time, but they -seemed only spirits, for their feet were bare and made no sound. Down -the lane a piece lived an elephant in the shade of a noble tree, and -rocked and rocked, and reached about with his trunk, begging of his brown -mistress or fumbling the children playing at his feet. And there were -camels about, but they go on velvet feet, and were proper to the silence -and serenity of the surroundings. - -The Satan mentioned at the head of this chapter was not our Satan, but -the other one. Our Satan was lost to us. In these later days he had -passed out of our life--lamented by me, and sincerely. I was missing -him; I am missing him yet, after all these months. He was an astonishing -creature to fly around and do things. He didn't always do them quite -right, but he did them, and did them suddenly. There was no time wasted. -You would say: - -"Pack the trunks and bags, Satan." - -"Wair good" (very good). - -Then there would be a brief sound of thrashing and slashing and humming -and buzzing, and a spectacle as of a whirlwind spinning gowns and jackets -and coats and boots and things through the air, and then with bow and -touch-- - -"Awready, master." - -It was wonderful. It made one dizzy. He crumpled dresses a good deal, -and he had no particular plan about the work--at first--except to put -each article into the trunk it didn't belong in. But he soon reformed, -in this matter. Not entirely; for, to the last, he would cram into the -satchel sacred to literature any odds and ends of rubbish that he -couldn't find a handy place for elsewhere. When threatened with death -for this, it did not trouble him; he only looked pleasant, saluted with -soldierly grace, said "Wair good," and did it again next day. - -He was always busy; kept the rooms tidied up, the boots polished, the -clothes brushed, the wash-basin full of clean water, my dress clothes -laid out and ready for the lecture-hall an hour ahead of time; and he -dressed me from head to heel in spite of my determination to do it -myself, according to my lifelong custom. - -He was a born boss, and loved to command, and to jaw and dispute with -inferiors and harry them and bullyrag them. He was fine at the railway -station--yes, he was at his finest there. He would shoulder and plunge -and paw his violent way through the packed multitude of natives with -nineteen coolies at his tail, each bearing a trifle of luggage--one a -trunk, another a parasol, another a shawl, another a fan, and so on; one -article to each, and the longer the procession, the better he was suited ---and he was sure to make for some engaged sleeper and begin to hurl the -owner's things out of it, swearing that it was ours and that there had -been a mistake. Arrived at our own sleeper, he would undo the -bedding-bundles and make the beds and put everything to rights and -shipshape in two minutes; then put his head out at, a window and have a -restful good time abusing his gang of coolies and disputing their bill -until we arrived and made him pay them and stop his noise. - -Speaking of noise, he certainly was the noisest little devil in India ---and that is saying much, very much, indeed. I loved him for his noise, -but the family detested him for it. They could not abide it; they could -not get reconciled to it. It humiliated them. As a rule, when we got -within six hundred yards of one of those big railway stations, a mighty -racket of screaming and shrieking and shouting and storming would break -upon us, and I would be happy to myself, and the family would say, with -shame: - -"There--that's Satan. Why do you keep him?" - -And, sure enough, there in the whirling midst of fifteen hundred -wondering people we would find that little scrap of a creature -gesticulating like a spider with the colic, his black eyes snapping, his -fez-tassel dancing, his jaws pouring out floods of billingsgate upon his -gang of beseeching and astonished coolies. - -I loved him; I couldn't help it; but the family--why, they could hardly -speak of him with patience. To this day I regret his loss, and wish I -had him back; but they--it is different with them. He was a native, and -came from Surat. Twenty degrees of latitude lay between his birthplace -and Manuel's, and fifteen hundred between their ways and characters and -dispositions. I only liked Manuel, but I loved Satan. This latter's -real name was intensely Indian. I could not quite get the hang of it, -but it sounded like Bunder Rao Ram Chunder Clam Chowder. It was too long -for handy use, anyway; so I reduced it. - -When he had been with us two or three weeks, he began to make mistakes -which I had difficulty in patching up for him. Approaching Benares one -day, he got out of the train to see if he could get up a misunderstanding -with somebody, for it had been a weary, long journey and he wanted to -freshen up. He found what he was after, but kept up his pow-wow a shade -too long and got left. So there we were in a strange city and no -chambermaid. It was awkward for us, and we told him he must not do so -any more. He saluted and said in his dear, pleasant way, "Wair good." -Then at Lucknow he got drunk. I said it was a fever, and got the -family's compassion, and solicitude aroused; so they gave him a -teaspoonful of liquid quinine and it set his vitals on fire. He made -several grimaces which gave me a better idea of the Lisbon earthquake -than any I have ever got of it from paintings and descriptions. His -drunk was still portentously solid next morning, but I could have pulled -him through with the family if he would only have taken another spoonful -of that remedy; but no, although he was stupefied, his memory still had -flickerings of life; so he smiled a divinely dull smile and said, -fumblingly saluting: - -"Scoose me, mem Saheb, scoose me, Missy Saheb; Satan not prefer it, -please." - -Then some instinct revealed to them that he was drunk. They gave him -prompt notice that next time this happened he must go. He got out a -maudlin and most gentle "Wair good," and saluted indefinitely. - -Only one short week later he fell again. And oh, sorrow! not in a hotel -this time, but in an English gentleman's private house. And in Agra, of -all places. So he had to go. When I told him, he said patiently, "Wair -good," and made his parting salute, and went out from us to return no -more forever. Dear me! I would rather have lost a hundred angels than -that one poor lovely devil. What style he used to put on, in a swell -hotel or in a private house--snow-white muslin from his chin to his bare -feet, a crimson sash embroidered with gold thread around his waist, and -on his head a great sea-green turban like to the turban of the Grand -Turk. - -He was not a liar; but he will become one if he keeps on. He told me -once that he used to crack cocoanuts with his teeth when he was a boy; -and when I asked how he got them into his mouth, he said he was upward of -six feet high at that time, and had an unusual mouth. And when I -followed him up and asked him what had become of that other foot, he said -a house fell on him and he was never able to get his stature back again. -Swervings like these from the strict line of fact often beguile a -truthful man on and on until he eventually becomes a liar. - -His successor was a Mohammedan, Sahadat Mohammed Khan; very dark, very -tall, very grave. He went always in flowing masses of white, from the -top of his big turban down to his bare feet. His voice was low. He -glided about in a noiseless way, and looked like a ghost. He was -competent and satisfactory. But where he was, it seemed always Sunday. -It was not so in Satan's time. - -Jeypore is intensely Indian, but it has two or three features which -indicate the presence of European science and European interest in the -weal of the common public, such as the liberal water-supply furnished by -great works built at the State's expense; good sanitation, resulting in a -degree of healthfulness unusually high for India; a noble pleasure -garden, with privileged days for women; schools for the instruction of -native youth in advanced art, both ornamental and utilitarian; and a new -and beautiful palace stocked with a museum of extraordinary interest and -value. Without the Maharaja's sympathy and purse these beneficences -could not have been created; but he is a man of wide views and large -generosities, and all such matters find hospitality with him. - -We drove often to the city from the hotel Kaiser-i-Hind, a journey which -was always full of interest, both night and day, for that country road -was never quiet, never empty, but was always India in motion, always a -streaming flood of brown people clothed in smouchings from the rainbow, a -tossing and moiling flood, happy, noisy, a charming and satisfying -confusion of strange human and strange animal life and equally strange -and outlandish vehicles. - -And the city itself is a curiosity. Any Indian city is that, but this -one is not like any other that we saw. It is shut up in a lofty turreted -wall; the main body of it is divided into six parts by perfectly straight -streets that are more than a hundred feet wide; the blocks of houses -exhibit a long frontage of the most taking architectural quaintnesses, -the straight lines being broken everywhere by pretty little balconies, -pillared and highly ornamented, and other cunning and cozy and inviting -perches and projections, and many of the fronts are curiously pictured by -the brush, and the whole of them have the soft rich tint of strawberry -ice-cream. One cannot look down the far stretch of the chief street and -persuade himself that these are real houses, and that it is all out of -doors--the impression that it is an unreality, a picture, a scene in a -theater, is the only one that will take hold. - -Then there came a great day when this illusion was more pronounced than -ever. A rich Hindoo had been spending a fortune upon the manufacture of -a crowd of idols and accompanying paraphernalia whose purpose was to -illustrate scenes in the life of his especial god or saint, and this fine -show was to be brought through the town in processional state at ten in -the morning. As we passed through the great public pleasure garden on -our way to the city we found it crowded with natives. That was one -sight. Then there was another. In the midst of the spacious lawns -stands the palace which contains the museum--a beautiful construction of -stone which shows arched colonnades, one above another, and receding, -terrace-fashion, toward the sky. Every one of these terraces, all the -way to the top one, was packed and jammed with natives. One must try to -imagine those solid masses of splendid color, one above another, up and -up, against the blue sky, and the Indian sun turning them all to beds of -fire and flame. - -Later, when we reached the city, and glanced down the chief avenue, -smouldering in its crushed-strawberry tint, those splendid effects were -repeated; for every balcony, and every fanciful bird-cage of a snuggery -countersunk in the house-fronts, and all the long lines of roofs were -crowded with people, and each crowd was an explosion of brilliant color. - -Then the wide street itself, away down and down and down into the -distance, was alive with gorgeously-clothed people not still, but moving, -swaying, drifting, eddying, a delirious display of all colors and all -shades of color, delicate, lovely, pale, soft, strong, stunning, vivid, -brilliant, a sort of storm of sweetpea blossoms passing on the wings of a -hurricane; and presently, through this storm of color, came swaying and -swinging the majestic elephants, clothed in their Sunday best of -gaudinesses, and the long procession of fanciful trucks freighted with -their groups of curious and costly images, and then the long rearguard of -stately camels, with their picturesque riders. - -For color, and picturesqueness, and novelty, and outlandishness, and -sustained interest and fascination, it was the most satisfying show I had -ever seen, and I suppose I shall not have the privilege of looking upon -its like again. - - - - -CHAPTER LXI. - -In the first place God made idiots. This was for practice. Then He made -School Boards. - --Pudd'nhead Wilson's New Calendar. - -Suppose we applied no more ingenuity to the instruction of deaf and dumb -and blind children than we sometimes apply in our American public schools -to the instruction of children who are in possession of all their -faculties? The result would be that the deaf and dumb and blind would -acquire nothing. They would live and die as ignorant as bricks and -stones. The methods used in the asylums are rational. The teacher -exactly measures the child's capacity, to begin with; and from thence -onwards the tasks imposed are nicely gauged to the gradual development of -that capacity, the tasks keep pace with the steps of the child's -progress, they don't jump miles and leagues ahead of it by irrational -caprice and land in vacancy--according to the average public-school plan. -In the public school, apparently, they teach the child to spell cat, then -ask it to calculate an eclipse; when it can read words of two syllables, -they require it to explain the circulation of the blood; when it reaches -the head of the infant class they bully it with conundrums that cover the -domain of universal knowledge. This sounds extravagant--and is; yet it -goes no great way beyond the facts. - -I received a curious letter one day, from the Punjab (you must pronounce -it Punjawb). The handwriting was excellent, and the wording was English ---English, and yet not exactly English. The style was easy and smooth -and flowing, yet there was something subtly foreign about it--A something -tropically ornate and sentimental and rhetorical. It turned out to be -the work of a Hindoo youth, the holder of a humble clerical billet in a -railway office. He had been educated in one of the numerous colleges of -India. Upon inquiry I was told that the country was full of young -fellows of his like. They had been educated away up to the snow-summits -of learning--and the market for all this elaborate cultivation was -minutely out of proportion to the vastness of the product. This market -consisted of some thousands of small clerical posts under the government ---the supply of material for it was multitudinous. If this youth with the -flowing style and the blossoming English was occupying a small railway -clerkship, it meant that there were hundreds and hundreds as capable as -he, or he would be in a high place; and it certainly meant that there -were thousands whose education and capacity had fallen a little short, -and that they would have to go without places. Apparently, then, the -colleges of India were doing what our high schools have long been doing ---richly over-supplying the market for highly-educated service; and thereby -doing a damage to the scholar, and through him to the country. - -At home I once made a speech deploring the injuries inflicted by the high -school in making handicrafts distasteful to boys who would have been -willing to make a living at trades and agriculture if they had but had -the good luck to stop with the common school. But I made no converts. -Not one, in a community overrun with educated idlers who were above -following their fathers' mechanical trades, yet could find no market for -their book-knowledge. The same rail that brought me the letter from the -Punjab, brought also a little book published by Messrs. Thacker, Spink & -Co., of Calcutta, which interested me, for both its preface and its -contents treated of this matter of over-education. In the preface occurs -this paragraph from the Calcutta Review. For "Government office" read -"drygoods clerkship" and it will fit more than one region of America: - - "The education that we give makes the boys a little less clownish in - their manners, and more intelligent when spoken to by strangers. On - the other hand, it has made them less contented with their lot in - life, and less willing to work with their hands. The form which - discontent takes in this country is not of a healthy kind; for, the - Natives of India consider that the only occupation worthy of an - educated man is that of a writership in some office, and especially - in a Government office. The village schoolboy goes back to the plow - with the greatest reluctance; and the town schoolboy carries the - same discontent and inefficiency into his father's workshop. - Sometimes these ex-students positively refuse at first to work; and - more than once parents have openly expressed their regret that they - ever allowed their sons to be inveigled to school." - -The little book which I am quoting from is called "Indo-Anglian -Literature," and is well stocked with "baboo" English--clerkly English, -hooky English, acquired in the schools. Some of it is very funny, ---almost as funny, perhaps, as what you and I produce when we try to write -in a language not our own; but much of it is surprisingly correct and -free. If I were going to quote good English--but I am not. India is -well stocked with natives who speak it and write it as well as the best -of us. I merely wish to show some of the quaint imperfect attempts at -the use of our tongue. There are many letters in the book; poverty -imploring help--bread, money, kindness, office generally an office, a -clerkship, some way to get food and a rag out of the applicant's -unmarketable education; and food not for himself alone, but sometimes for -a dozen helpless relations in addition to his own family; for those -people are astonishingly unselfish, and admirably faithful to their ties -of kinship. Among us I think there is nothing approaching it. Strange -as some of these wailing and supplicating letters are, humble and even -groveling as some of them are, and quaintly funny and confused as a -goodly number of them are, there is still a pathos about them, as a rule, -that checks the rising laugh and reproaches it. In the following letter -"father" is not to be read literally. In Ceylon a little native -beggar-girl embarrassed me by calling me father, although I knew she was -mistaken. I was so new that I did not know that she was merely following -the custom of the dependent and the supplicant. - - "SIR, - - "I pray please to give me some action (work) for I am very poor boy - I have no one to help me even so father for it so it seemed in thy - good sight, you give the Telegraph Office, and another work what is - your wish I am very poor boy, this understand what is your wish you - my father I am your son this understand what is your wish. - - "Your Sirvent, P. C. B." - -Through ages of debasing oppression suffered by these people at the hands -of their native rulers, they come legitimately by the attitude and -language of fawning and flattery, and one must remember this in -mitigation when passing judgment upon the native character. It is common -in these letters to find the petitioner furtively trying to get at the -white man's soft religious side; even this poor boy baits his hook with a -macerated Bible-text in the hope that it may catch something if all else -fail. - -Here is an application for the post of instructor in English to some -children: - - "My Dear Sir or Gentleman, that your Petitioner has much - qualification in the Language of English to instruct the young boys; - I was given to understand that your of suitable children has to - acquire the knowledge of English language." - -As a sample of the flowery Eastern style, I will take a sentence or two -from along letter written by a young native to the Lieutenant-Governor of -Bengal--an application for employment: - - "HONORED AND MUCH RESPECTED SIR, - - "I hope your honor will condescend to hear the tale of this poor - creature. I shall overflow with gratitude at this mark of your - royal condescension. The bird-like happiness has flown away from my - nest-like heart and has not hitherto returned from the period whence - the rose of my father's life suffered the autumnal breath of death, - in plain English he passed through the gates of Grave, and from that - hour the phantom of delight has never danced before me." - -It is all school-English, book-English, you see; and good enough, too, -all things considered. If the native boy had but that one study he would -shine, he would dazzle, no doubt. But that is not the case. He is -situated as are our public-school children--loaded down with an -over-freightage of other studies; and frequently they are as far beyond -the actual point of progress reached by him and suited to the stage of -development attained, as could be imagined by the insanest fancy. -Apparently--like our public-school boy--he must work, work, work, in -school and out, and play but little. Apparently--like our public-school -boy--his "education" consists in learning things, not the meaning of -them; he is fed upon the husks, not the corn. From several essays -written by native schoolboys in answer to the question of how they spend -their day, I select one--the one which goes most into detail: - - "66. At the break of day I rises from my own bed and finish my - daily duty, then I employ myself till 8 o'clock, after which I - employ myself to bathe, then take for my body some sweet meat, and - just at 9 1/2 I came to school to attend my class duty, then at - 2 1/2 P. M. I return from school and engage myself to do my natural - duty, then, I engage for a quarter to take my tithn, then I study - till 5 P. M., after which I began to play anything which comes in - my head. After 8 1/2, half pass to eight we are began to sleep, - before sleeping I told a constable just 11 o' he came and rose us - from half pass eleven we began to read still morning." - -It is not perfectly clear, now that I come to cipher upon it. He gets up -at about 5 in the morning, or along there somewhere, and goes to bed -about fifteen or sixteen hours afterward--that much of it seems straight; -but why he should rise again three hours later and resume his studies -till morning is puzzling. - -I think it is because he is studying history. History requires a world -of time and bitter hard work when your "education" is no further advanced -than the cat's; when you are merely stuffing yourself with a mixed-up -mess of empty names and random incidents and elusive dates, which no one -teaches you how to interpret, and which, uninterpreted, pay you not a -farthing's value for your waste of time. Yes, I think he had to get up -at halfpast 11 P.M. in order to be sure to be perfect with his history -lesson by noon. With results as follows--from a Calcutta school -examination: - -"Q. Who was Cardinal Wolsey? -"Cardinal Wolsey was an Editor of a paper named North Briton. No. 45 of -his publication he charged the King of uttering a lie from the throne. -He was arrested and cast into prison; and after releasing went to France. - -"3. As Bishop of York but died in disentry in a church on his way to be -blockheaded. - -"8. Cardinal Wolsey was the son of Edward IV, after his father's death -he himself ascended the throne at the age of (10) ten only, but when he -surpassed or when he was fallen in his twenty years of age at that time -he wished to make a journey in his countries under him, but he was -opposed by his mother to do journey, and according to his mother's -example he remained in the home, and then became King. After many times -obstacles and many confusion he become King and afterwards his brother." - -There is probably not a word of truth in that. - -"Q. What is the meaning of 'Ich Dien'? - -"10. An honor conferred on the first or eldest sons of English -Sovereigns. It is nothing more than some feathers. - -"11. Ich Dien was the word which was written on the feathers of the -blind King who came to fight, being interlaced with the bridles of the -horse. - -"13. Ich Dien is a title given to Henry VII by the Pope of Rome, when he -forwarded the Reformation of Cardinal Wolsy to Rome, and for this reason -he was called Commander of the faith." - -A dozen or so of this kind of insane answers are quoted in the book from -that examination. Each answer is sweeping proof, all by itself, that the -person uttering it was pushed ahead of where he belonged when he was put -into history; proof that he had been put to the task of acquiring history -before he had had a single lesson in the art of acquiring it, which is -the equivalent of dumping a pupil into geometry before he has learned the -progressive steps which lead up to it and make its acquirement possible. -Those Calcutta novices had no business with history. There was no excuse -for examining them in it, no excuse for exposing them and their teachers. -They were totally empty; there was nothing to "examine." - -Helen Keller has been dumb, stone deaf, and stone blind, ever since she -was a little baby a year-and-a-half old; and now at sixteen years of age -this miraculous creature, this wonder of all the ages, passes the Harvard -University examination in Latin, German, French history, belles lettres, -and such things, and does it brilliantly, too, not in a commonplace -fashion. She doesn't know merely things, she is splendidly familiar with -the meanings of them. When she writes an essay on a Shakespearean -character, her English is fine and strong, her grasp of the subject is -the grasp of one who knows, and her page is electric with light. Has -Miss Sullivan taught her by the methods of India and the American public -school? No, oh, no; for then she would be deafer and dumber and blinder -than she was before. It is a pity that we can't educate all the children -in the asylums. - -To continue the Calcutta exposure: - -"What is the meaning of a Sheriff?" - -"25. Sheriff is a post opened in the time of John. The duty of Sheriff -here in Calcutta, to look out and catch those carriages which is rashly -driven out by the coachman; but it is a high post in England. - -"26. Sheriff was the English bill of common prayer. - -"27. The man with whom the accusative persons are placed is called -Sheriff. - -"28. Sheriff--Latin term for 'shrub,' we called broom, worn by the first -earl of Enjue, as an emblem of humility when they went to the pilgrimage, -and from this their hairs took their crest and surname. - -"29. Sheriff is a kind of titlous sect of people, as Barons, Nobles, -etc. - -"30. Sheriff; a tittle given on those persons who were respective and -pious in England." - -The students were examined in the following bulky matters: Geometry, the -Solar Spectrum, the Habeas Corpus Act, the British Parliament, and in -Metaphysics they were asked to trace the progress of skepticism from -Descartes to Hume. It is within bounds to say that some of the results -were astonishing. Without doubt, there were students present who -justified their teacher's wisdom in introducing them to these studies; -but the fact is also evident that others had been pushed into these -studies to waste their time over them when they could have been -profitably employed in hunting smaller game. Under the head of Geometry, -one of the answers is this: - -"49. The whole BD = the whole CA, and so-so-so-so-so-so-so." - -To me this is cloudy, but I was never well up in geometry. That was the -only effort made among the five students who appeared for examination in -geometry; the other four wailed and surrendered without a fight. They -are piteous wails, too, wails of despair; and one of them is an eloquent -reproach; it comes from a poor fellow who has been laden beyond his -strength by a stupid teacher, and is eloquent in spite of the poverty of -its English. The poor chap finds himself required to explain riddles -which even Sir Isaac Newton was not able to understand: - -"50. Oh my dear father examiner you my father and you kindly give a -number of pass you my great father. - -"51. I am a poor boy and have no means to support my mother and two -brothers who are suffering much for want of food. I get four rupees -monthly from charity fund of this place, from which I send two rupees for -their support, and keep two for my own support. Father, if I relate the -unlucky circumstance under which we are placed, then, I think, you will -not be able to suppress the tender tear. - -"52. Sir which Sir Isaac Newton and other experienced mathematicians -cannot understand I being third of Entrance Class can understand these -which is too impossible to imagine. And my examiner also has put very -tiresome and very heavy propositions to prove." - -We must remember that these pupils had to do their thinking in one -language, and express themselves in another and alien one. It was a -heavy handicap. I have by me "English as She is Taught"--a collection of -American examinations made in the public schools of Brooklyn by one of -the teachers, Miss Caroline B. Le Row. An extract or two from its pages -will show that when the American pupil is using but one language, and -that one his own, his performance is no whit better than his Indian -brother's: - -"ON HISTORY. - -"Christopher Columbus was called the father of his Country. Queen -Isabella of Spain sold her watch and chain and other millinery so that -Columbus could discover America. - -"The Indian wars were very desecrating to the country. - -"The Indians pursued their warfare by hiding in the bushes and then -scalping them. - -"Captain John Smith has been styled the father of his country. His life -was saved by his daughter Pochahantas. - -"The Puritans found an insane asylum in the wilds of America. - -"The Stamp Act was to make everybody stamp all materials so they should -be null and void. - -"Washington died in Spain almost broken-hearted. His remains were taken -to the cathedral in Havana. - -"Gorilla warfare was where men rode on gorillas." - - -In Brooklyn, as in India, they examine a pupil, and when they find out he -doesn't know anything, they put him into literature, or geometry, or -astronomy, or government, or something like that, so that he can properly -display the assification of the whole system-- - -"ON LITERATURE. - -"'Bracebridge Hall' was written by Henry Irving. - -"Edgar A. Poe was a very curdling writer. - -"Beowulf wrote the Scriptures. - -"Ben Johnson survived Shakespeare in some respects. - -"In the 'Canterbury Tale' it gives account of King Alfred on his way to -the shrine of Thomas Bucket. - -"Chaucer was the father of English pottery. - -"Chaucer was succeeded by H. Wads. Longfellow." - - -We will finish with a couple of samples of "literature," one from -America, the other from India. The first is a Brooklyn public-school -boy's attempt to turn a few verses of the "Lady of the Lake" into prose. -You will have to concede that he did it: - -"The man who rode on the horse performed the whip and an instrument made -of steel alone with strong ardor not diminishing, for, being tired from -the time passed with hard labor overworked with anger and ignorant with -weariness, while every breath for labor lie drew with cries full of -sorrow, the young deer made imperfect who worked hard filtered in sight." - - -The following paragraph is from a little book which is famous in India ---the biography of a distinguished Hindoo judge, Onoocool Chunder -Mookerjee; it was written by his nephew, and is unintentionally funny-in -fact, exceedingly so. I offer here the closing scene. If you would like -to sample the rest of the book, it can be had by applying to the -publishers, Messrs. Thacker, Spink & Co., Calcutta - - "And having said these words he hermetically sealed his lips not to - open them again. All the well-known doctors of Calcutta that could - be procured for a man of his position and wealth were brought, - --Doctors Payne, Fayrer, and Nilmadhub Mookerjee and others; they did - what they could do, with their puissance and knack of medical - knowledge, but it proved after all as if to milk the ram! His wife - and children had not the mournful consolation to hear his last - words; he remained sotto voce for a few hours, and then was taken - from us at 6.12 P.m. according to the caprice of God which passeth - understanding." - - - - -CHAPTER LXII. - -There are no people who are quite so vulgar as the over-refined ones. - --Pudd'nhead Wilson's New Calendar. - -We sailed from Calcutta toward the end of March; stopped a day at Madras; -two or three days in Ceylon; then sailed westward on a long flight for -Mauritius. From my diary: - -April 7. We are far abroad upon the smooth waters of the Indian Ocean, -now; it is shady and pleasant and peaceful under the vast spread of the -awnings, and life is perfect again--ideal. - -The difference between a river and the sea is, that the river looks -fluid, the sea solid--usually looks as if you could step out and walk on -it. - -The captain has this peculiarity--he cannot tell the truth in a plausible -way. In this he is the very opposite of the austere Scot who sits midway -of the table; he cannot tell a lie in an unplausible way. When the -captain finishes a statement the passengers glance at each other -privately, as who should say, "Do you believe that?" When the Scot -finishes one, the look says, "How strange and interesting." The whole -secret is in the manner and method of the two men. The captain is a -little shy and diffident, and he states the simplest fact as if he were a -little afraid of it, while the Scot delivers himself of the most -abandoned lie with such an air of stern veracity that one is forced to -believe it although one knows it isn't so. For instance, the Scot told -about a pet flying-fish he once owned, that lived in a little fountain in -his conservatory, and supported itself by catching birds and frogs and -rats in the neighboring fields. It was plain that no one at the table -doubted this statement. - -By and by, in the course of some talk about custom-house annoyances, the -captain brought out the following simple everyday incident, but through -his infirmity of style managed to tell it in such a way that it got no -credence. He said: - - "I went ashore at Naples one voyage when I was in that trade, and - stood around helping my passengers, for I could speak a little - Italian. Two or three times, at intervals, the officer asked me if - I had anything dutiable about me, and seemed more and more put out - and disappointed every time I told him no. Finally a passenger whom - I had helped through asked me to come out and take something. I - thanked him, but excused myself, saying I had taken a whisky just - before I came ashore. - - "It was a fatal admission. The officer at once made me pay sixpence - import-duty on the whisky-just from ship to shore, you see; and he - fined me L5 for not declaring the goods, another L5 for falsely - denying that I had anything dutiable about me, also L5 for - concealing the goods, and L50 for smuggling, which is the maximum - penalty for unlawfully bringing in goods under the value of - sevenpence ha'penny. Altogether, sixty-five pounds sixpence for a - little thing like that." - -The Scot is always believed, yet he never tells anything but lies; -whereas the captain is never believed, although he never tells a lie, so -far as I can judge. If he should say his uncle was a male person, he -would probably say it in such a way that nobody would believe it; at the -same time the Scot could claim that he had a female uncle and not stir a -doubt in anybody's mind. My own luck has been curious all my literary -life; I never could tell a lie that anybody would doubt, nor a truth that -anybody would believe. - -Lots of pets on board--birds and things. In these far countries the -white people do seem to run remarkably to pets. Our host in Cawnpore had -a fine collection of birds--the finest we saw in a private house in -India. And in Colombo, Dr. Murray's great compound and commodious -bungalow were well populated with domesticated company from the woods: -frisky little squirrels; a Ceylon mina walking sociably about the house; -a small green parrot that whistled a single urgent note of call without -motion of its beak; also chuckled; a monkey in a cage on the back -veranda, and some more out in the trees; also a number of beautiful -macaws in the trees; and various and sundry birds and animals of breeds -not known to me. But no cat. Yet a cat would have liked that place. - -April 9. Tea-planting is the great business in Ceylon, now. A passenger -says it often pays 40 per cent. on the investment. Says there is a boom. - -April 10. The sea is a Mediterranean blue; and I believe that that is -about the divinest color known to nature. - -It is strange and fine--Nature's lavish generosities to her creatures. -At least to all of them except man. For those that fly she has provided -a home that is nobly spacious--a home which is forty miles deep and -envelops the whole globe, and has not an obstruction in it. For those -that swim she has provided a more than imperial domain--a domain which is -miles deep and covers four-fifths of the globe. But as for man, she has -cut him off with the mere odds and ends of the creation. She has given -him the thin skin, the meagre skin which is stretched over the remaining -one-fifth--the naked bones stick up through it in most places. On the -one-half of this domain he can raise snow, ice, sand, rocks, and nothing -else. So the valuable part of his inheritance really consists of but a -single fifth of the family estate; and out of it he has to grub hard to -get enough to keep him alive and provide kings and soldiers and powder to -extend the blessings of civilization with. Yet man, in his simplicity -and complacency and inability to cipher, thinks Nature regards him as the -important member of the family--in fact, her favorite. Surely, it must -occur to even his dull head, sometimes, that she has a curious way of -showing it. - -Afternoon. The captain has been telling how, in one of his Arctic -voyages, it was so cold that the mate's shadow froze fast to the deck and -had to be ripped loose by main strength. And even then he got only about -two-thirds of it back. Nobody said anything, and the captain went away. -I think he is becoming disheartened . . . . Also, to be fair, there -is another word of praise due to this ship's library: it contains no copy -of the Vicar of Wakefield, that strange menagerie of complacent -hypocrites and idiots, of theatrical cheap-john heroes and heroines, who -are always showing off, of bad people who are not interesting, and good -people who are fatiguing. A singular book. Not a sincere line in it, -and not a character that invites respect; a book which is one long -waste-pipe discharge of goody-goody puerilities and dreary moralities; a -book which is full of pathos which revolts, and humor which grieves the -heart. There are few things in literature that are more piteous, more -pathetic, than the celebrated "humorous" incident of Moses and the -spectacles. Jane Austen's books, too, are absent from this library. Just -that one omission alone would make a fairly good library out of a library -that hadn't a book in it. - -Customs in tropic seas. At 5 in the morning they pipe to wash down the -decks, and at once the ladies who are sleeping there turn out and they -and their beds go below. Then one after another the men come up from the -bath in their pyjamas, and walk the decks an hour or two with bare legs -and bare feet. Coffee and fruit served. The ship cat and her kitten now -appear and get about their toilets; next the barber comes and flays us on -the breezy deck. Breakfast at 9.30, and the day begins. I do not know -how a day could be more reposeful: no motion; a level blue sea; nothing -in sight from horizon to horizon; the speed of the ship furnishes a -cooling breeze; there is no mail to read and answer; no newspapers to -excite you; no telegrams to fret you or fright you--the world is far, far -away; it has ceased to exist for you--seemed a fading dream, along in the -first days; has dissolved to an unreality now; it is gone from your mind -with all its businesses and ambitions, its prosperities and disasters, -its exultations and despairs, its joys and griefs and cares and worries. -They are no concern of yours any more; they have gone out of your life; -they are a storm which has passed and left a deep calm behind. The -people group themselves about the decks in their snowy white linen, and -read, smoke, sew, play cards, talk, nap, and so on. In other ships the -passengers are always ciphering about when they are going to arrive; out -in these seas it is rare, very rare, to hear that subject broached. In -other ships there is always an eager rush to the bulletin board at noon -to find out what the "run" has been; in these seas the bulletin seems to -attract no interest; I have seen no one visit it; in thirteen days I have -visited it only once. Then I happened to notice the figures of the day's -run. On that day there happened to be talk, at dinner, about the speed -of modern ships. I was the only passenger present who knew this ship's -gait. Necessarily, the Atlantic custom of betting on the ship's run is -not a custom here--nobody ever mentions it. - -I myself am wholly indifferent as to when we are going to "get in"; if -any one else feels interested in the matter he has not indicated it in my -hearing. If I had my way we should never get in at all. This sort of -sea life is charged with an indestructible charm. There is no weariness, -no fatigue, no worry, no responsibility, no work, no depression of -spirits. There is nothing like this serenity, this comfort, this peace, -this deep contentment, to be found anywhere on land. If I had my way I -would sail on for ever and never go to live on the solid ground again. - -One of Kipling's ballads has delivered the aspect and sentiment of this -bewitching sea correctly: - - "The Injian Ocean sets an' smiles - So sof', so bright, so bloomin' blue; - There aren't a wave for miles an' miles - Excep' the jiggle from the screw." - -April 14. It turns out that the astronomical apprentice worked off a -section of the Milky Way on me for the Magellan Clouds. A man of more -experience in the business showed one of them to me last night. It was -small and faint and delicate, and looked like the ghost of a bunch of -white smoke left floating in the sky by an exploded bombshell. - -Wednesday, April 15. Mauritius. Arrived and anchored off Port Louis -2 A. M. Rugged clusters of crags and peaks, green to their summits; from -their bases to the sea a green plain with just tilt enough to it to make -the water drain off. I believe it is in 56 E. and 22 S.--a hot tropical -country. The green plain has an inviting look; has scattering dwellings -nestling among the greenery. Scene of the sentimental adventure of Paul -and Virginia. - -Island under French control--which means a community which depends upon -quarantines, not sanitation, for its health. - -Thursday, April 16. Went ashore in the forenoon at Port Louis, a little -town, but with the largest variety of nationalities and complexions we -have encountered yet. French, English, Chinese, Arabs, Africans with -wool, blacks with straight hair, East Indians, half-whites, quadroons ---and great varieties in costumes and colors. - -Took the train for Curepipe at 1.30--two hours' run, gradually uphill. -What a contrast, this frantic luxuriance of vegetation, with the arid -plains of India; these architecturally picturesque crags and knobs and -miniature mountains, with the monotony of the Indian dead-levels. - -A native pointed out a handsome swarthy man of grave and dignified -bearing, and said in an awed tone, "That is so-and-so; has held office of -one sort or another under this government for 37 years--he is known all -over this whole island and in the other countries of the world perhaps ---who knows? One thing is certain; you can speak his name anywhere in this -whole island, and you will find not one grown person that has not heard -it. It is a wonderful thing to be so celebrated; yet look at him; it -makes no change in him; he does not even seem to know it." - -Curepipe (means Pincushion or Pegtown, probably). Sixteen miles (two -hours) by rail from Port Louis. At each end of every roof and on the -apex of every dormer window a wooden peg two feet high stands up; in some -cases its top is blunt, in others the peg is sharp and looks like a -toothpick. The passion for this humble ornament is universal. - -Apparently, there has been only one prominent event in the history of -Mauritius, and that one didn't happen. I refer to the romantic sojourn -of Paul and Virginia here. It was that story that made Mauritius known -to the world, made the name familiar to everybody, the geographical -position of it to nobody. - -A clergyman was asked to guess what was in a box on a table. It was a -vellum fan painted with the shipwreck, and was "one of Virginia's wedding -gifts." - -April 18. This is the only country in the world where the stranger is -not asked "How do you like this place?" This is indeed a large -distinction. Here the citizen does the talking about the country -himself; the stranger is not asked to help. You get all sorts of -information. From one citizen you gather the idea that Mauritius was -made first, and then heaven; and that heaven was copied after Mauritius. -Another one tells you that this is an exaggeration; that the two chief -villages, Port Louis and Curepipe, fall short of heavenly perfection; -that nobody lives in Port Louis except upon compulsion, and that Curepipe -is the wettest and rainiest place in the world. An English citizen said: - - "In the early part of this century Mauritius was used by the French - as a basis from which to operate against England's Indian - merchantmen; so England captured the island and also the neighbor, - Bourbon, to stop that annoyance. England gave Bourbon back; the - government in London did not want any more possessions in the West - Indies. If the government had had a better quality of geography in - stock it would not have wasted Bourbon in that foolish way. A big - war will temporarily shut up the Suez Canal some day and the English - ships will have to go to India around the Cape of Good Hope again; - then England will have to have Bourbon and will take it. - - "Mauritius was a crown colony until 20 years ago, with a governor - appointed by the Crown and assisted by a Council appointed by - himself; but Pope Hennessey came out as Governor then, and he worked - hard to get a part of the council made elective, and succeeded. So - now the whole council is French, and in all ordinary matters of - legislation they vote together and in the French interest, not the - English. The English population is very slender; it has not votes - enough to elect a legislator. Half a dozen rich French families - elect the legislature. Pope Hennessey was an Irishman, a Catholic, - a Home Ruler, M.P., a hater of England and the English, a very - troublesome person and a serious incumbrance at Westminster; so it - was decided to send him out to govern unhealthy countries, in hope - that something would happen to him. But nothing did. The first - experiment was not merely a failure, it was more than a failure. He - proved to be more of a disease himself than any he was sent to - encounter. The next experiment was here. The dark scheme failed - again. It was an off-season and there was nothing but measles here - at the time. Pope Hennessey's health was not affected. He worked - with the French and for the French and against the English, and he - made the English very tired and the French very happy, and lived to - have the joy of seeing the flag he served publicly hissed. His - memory is held in worshipful reverence and affection by the French. - - "It is a land of extraordinary quarantines. They quarantine a ship - for anything or for nothing; quarantine her for 20 and even 30 days. - They once quarantined a ship because her captain had had the - smallpox when he was a boy. That and because he was English. - - "The population is very small; small to insignificance. The - majority is East Indian; then mongrels; then negroes (descendants of - the slaves of the French times); then French; then English. There - was an American, but he is dead or mislaid. The mongrels are the - result of all kinds of mixtures; black and white, mulatto and white, - quadroon and white, octoroon and white. And so there is every shade - of complexion; ebony, old mahogany, horsechestnut, sorrel, - molasses-candy, clouded amber, clear amber, old-ivory white, - new-ivory white, fish-belly white--this latter the leprous complexion - frequent with the Anglo-Saxon long resident in tropical climates. - - "You wouldn't expect a person to be proud of being a Mauritian, now - would you? But it is so. The most of them have never been out of - the island, and haven't read much or studied much, and they think - the world consists of three principal countries--Judaea, France, and - Mauritius; so they are very proud of belonging to one of the three - grand divisions of the globe. They think that Russia and Germany - are in England, and that England does not amount to much. They have - heard vaguely about the United States and the equator, but they - think both of them are monarchies. They think Mount Peter Botte is - the highest mountain in the world, and if you show one of them a - picture of Milan Cathedral he will swell up with satisfaction and - say that the idea of that jungle of spires was stolen from the - forest of peg-tops and toothpicks that makes the roofs of Curepipe - look so fine and prickly. - - "There is not much trade in books. The newspapers educate and - entertain the people. Mainly the latter. They have two pages of - large-print reading-matter-one of them English, the other French. - The English page is a translation of the French one. The typography - is super-extra primitive--in this quality it has not its equal - anywhere. There is no proof-reader now; he is dead. - - "Where do they get matter to fill up a page in this little island - lost in the wastes of the Indian Ocean? Oh, Madagascar. They - discuss Madagascar and France. That is the bulk. Then they chock - up the rest with advice to the Government. Also, slurs upon the - English administration. The papers are all owned and edited by - creoles--French. - - "The language of the country is French. Everybody speaks it--has - to. You have to know French particularly mongrel French, the patois - spoken by Tom, Dick, and Harry of the multiform complexions--or you - can't get along. - -"This was a flourishing country in former days, for it made then and -still makes the best sugar in the world; but first the Suez Canal severed -it from the world and left it out in the cold and next the beetroot sugar -helped by bounties, captured the European markets. Sugar is the life of -Mauritius, and it is losing its grip. Its downward course was checked by -the depreciation of the rupee--for the planter pays wages in rupees but -sells his crop for gold--and the insurrection in Cuba and paralyzation of -the sugar industry there have given our prices here a life-saving lift; -but the outlook has nothing permanently favorable about it. It takes a -year to mature the canes--on the high ground three and six months longer ---and there is always a chance that the annual cyclone will rip the -profit out of the crop. In recent times a cyclone took the whole crop, -as you may say; and the island never saw a finer one. Some of the -noblest sugar estates in the island are in deep difficulties. A dozen of -them are investments of English capital; and the companies that own them -are at work now, trying to settle up and get out with a saving of half -the money they put in. You know, in these days, when a country begins to -introduce the tea culture, it means that its own specialty has gone back -on it. Look at Bengal; look at Ceylon. Well, they've begun to introduce -the tea culture, here. - -"Many copies of Paul and Virginia are sold every year in Mauritius. No -other book is so popular here except the Bible. By many it is supposed -to be a part of the Bible. All the missionaries work up their French on -it when they come here to pervert the Catholic mongrel. It is the -greatest story that was ever written about Mauritius, and the only one." - - - - -CHAPTER LXIII. - -The principal difference between a cat and a lie is that the cat has only -nine lives. - --Pudd'nhead Wilson's New Calendar. - -April 20.--The cyclone of 1892 killed and crippled hundreds of people; -it was accompanied by a deluge of rain, which drowned Port Louis and -produced a water famine. Quite true; for it burst the reservoir and the -water-pipes; and for a time after the flood had disappeared there was -much distress from want of water. - -This is the only place in the world where no breed of matches can stand -the damp. Only one match in 16 will light. - -The roads are hard and smooth; some of the compounds are spacious, some -of the bungalows commodious, and the roadways are walled by tall bamboo -hedges, trim and green and beautiful; and there are azalea hedges, too, -both the white and the red; I never saw that before. - -As to healthiness: I translate from to-day's (April 20) Merchants' and -Planters' Gazette, from the article of a regular contributor, "Carminge," -concerning the death of the nephew of a prominent citizen: - - "Sad and lugubrious existence, this which we lead in Mauritius; I - believe there is no other country in the world where one dies more - easily than among us. The least indisposition becomes a mortal - malady; a simple headache develops into meningitis; a cold into - pneumonia, and presently, when we are least expecting it, death is a - guest in our home." - -This daily paper has a meteorological report which tells you what the -weather was day before yesterday. - -One is clever pestered by a beggar or a peddler in this town, so far as I -can see. This is pleasantly different from India. - -April 22. To such as believe that the quaint product called French -civilization would be an improvement upon the civilization of New Guinea -and the like, the snatching of Madagascar and the laying on of French -civilization there will be fully justified. But why did the English -allow the French to have Madagascar? Did she respect a theft of a couple -of centuries ago? Dear me, robbery by European nations of each other's -territories has never been a sin, is not a sin to-day. To the several -cabinets the several political establishments of the world are -clotheslines; and a large part of the official duty of these cabinets is -to keep an eye on each other's wash and grab what they can of it as -opportunity offers. All the territorial possessions of all the political -establishments in the earth--including America, of course--consist of -pilferings from other people's wash. No tribe, howsoever insignificant, -and no nation, howsoever mighty, occupies a foot of land that was not -stolen. When the English, the French, and the Spaniards reached America, -the Indian tribes had been raiding each other's territorial clothes-lines -for ages, and every acre of ground in the continent had been stolen and -re-stolen 500 times. The English, the French, and the Spaniards went to -work and stole it all over again; and when that was satisfactorily -accomplished they went diligently to work and stole it from each other. -In Europe and Asia and Africa every acre of ground has been stolen -several millions of times. A crime persevered in a thousand centuries -ceases to be a crime, and becomes a virtue. This is the law of custom, -and custom supersedes all other forms of law. Christian governments are -as frank to-day, as open and above-board, in discussing projects for -raiding each other's clothes-lines as ever they were before the Golden -Rule came smiling into this inhospitable world and couldn't get a night's -lodging anywhere. In 150 years England has beneficently retired garment -after garment from the Indian lines, until there is hardly a rag of the -original wash left dangling anywhere. In 800 years an obscure -tribe of Muscovite savages has risen to the dazzling position of -Land-Robber-in-Chief; she found a quarter of the world hanging out to dry -on a hundred parallels of latitude, and she scooped in the whole wash. -She keeps a sharp eye on a multitude of little lines that stretch along -the northern boundaries of India, and every now and then she snatches a -hip-rag or a pair of pyjamas. It is England's prospective property, and -Russia knows it; but Russia cares nothing for that. In fact, in our day -land-robbery, claim-jumping, is become a European governmental frenzy. -Some have been hard at it in the borders of China, in Burma, in Siam, and -the islands of the sea; and all have been at it in Africa. Africa has -been as coolly divided up and portioned out among the gang as if they had -bought it and paid for it. And now straightway they are beginning the -old game again --to steal each other's grabbings. Germany found a vast -slice of Central Africa with the English flag and the English missionary -and the English trader scattered all over it, but with certain -formalities neglected--no signs up, "Keep off the grass," -"Trespassers-forbidden," etc.--and she stepped in with a cold calm smile -and put up the signs herself, and swept those English pioneers promptly -out of the country. - -There is a tremendous point there. It can be put into the form of a -maxim: Get your formalities right--never mind about the moralities. - -It was an impudent thing; but England had to put up with it. Now, in the -case of Madagascar, the formalities had originally been observed, but by -neglect they had fallen into desuetude ages ago. England should have -snatched Madagascar from the French clothes-line. Without an effort she -could have saved those harmless natives from the calamity of French -civilization, and she did not do it. Now it is too late. - -The signs of the times show plainly enough what is going to happen. All -the savage lands in the world are going to be brought under subjection to -the Christian governments of Europe. I am not sorry, but glad. This -coming fate might have been a calamity to those savage peoples two -hundred years ago; but now it will in some cases be a benefaction. The -sooner the seizure is consummated, the better for the savages. - -The dreary and dragging ages of bloodshed and disorder and oppression -will give place to peace and order and the reign of law. When one -considers what India was under her Hindoo and Mohammedan rulers, and what -she is now; when he remembers the miseries of her millions then and the -protections and humanities which they enjoy now, he must concede that the -most fortunate thing that has ever befallen that empire was the -establishment of British supremacy there. The savage lands of the world -are to pass to alien possession, their peoples to the mercies of alien -rulers. Let us hope and believe that they will all benefit by the -change. - -April 23. "The first year they gather shells; the second year they -gather shells and drink; the third year they do not gather shells." (Said -of immigrants to Mauritius.) - -Population 375,000. 120 sugar factories. - -Population 1851, 185,000. The increase is due mainly to the introduction -of Indian coolies. They now apparently form the great majority of the -population. They are admirable breeders; their homes are always hazy -with children. Great savers of money. A British officer told me that in -India he paid his servant 10 rupees a month, and he had 11 cousins, -uncles, parents, etc., dependent upon him, and he supported them on his -wages. These thrifty coolies are said to be acquiring land a trifle at a -time, and cultivating it; and may own the island by and by. - -The Indian women do very hard labor [for wages of (1/2 rupee) for twelve -hours' work.] They carry mats of sugar on their heads (70 pounds) all -day lading ships, for half a rupee, and work at gardening all day for -less. - -The camaron is a fresh water creature like a cray-fish. It is regarded -here as the world's chiefest delicacy--and certainly it is good. Guards -patrol the streams to prevent poaching it. A fine of Rs.200 or 300 -(they say) for poaching. Bait is thrown in the water; the camaron goes -for it; the fisher drops his loop in and works it around and about the -camaron he has selected, till he gets it over its tail; then there's a -jerk or something to certify the camaron that it is his turn now; he -suddenly backs away, which moves the loop still further up his person and -draws it taut, and his days are ended. - -Another dish, called palmiste, is like raw turnip-shavings and tastes -like green almonds; is very delicate and good. Costs the life of a palm -tree 12 to 20 years old--for it is the pith. - -Another dish--looks like greens or a tangle of fine seaweed--is a -preparation of the deadly nightshade. Good enough. - -The monkeys live in the dense forests on the flanks of the toy mountains, -and they flock down nights and raid the sugar-fields. Also on other -estates they come down and destroy a sort of bean-crop--just for fun, -apparently--tear off the pods and throw them down. - -The cyclone of 1892 tore down two great blocks of stone buildings in the -center of Port Louis--the chief architectural feature-and left the -uncomely and apparently frail blocks standing. Everywhere in its track -it annihilated houses, tore off roofs, destroyed trees and crops. The -men were in the towns, the women and children at home in the country -getting crippled, killed, frightened to insanity; and the rain deluging -them, the wind howling, the thunder crashing, the lightning glaring. -This for an hour or so. Then a lull and sunshine; many ventured out of -safe shelter; then suddenly here it came again from the opposite point -and renewed and completed the devastation. It is said the Chinese fed -the sufferers for days on free rice. - -Whole streets in Port Louis were laid flat--wrecked. During a minute and -a half the wind blew 123 miles an hour; no official record made after -that, when it may have reached 150. It cut down an obelisk. It carried -an American ship into the woods after breaking the chains of two anchors. -They now use four-two forward, two astern. Common report says it killed -1,200 in Port Louis alone, in half an hour. Then came the lull of the -central calm--people did not know the barometer was still going down ---then suddenly all perdition broke loose again while people were rushing -around seeking friends and rescuing the wounded. The noise was -comparable to nothing; there is nothing resembling it but thunder and -cannon, and these are feeble in comparison. - -What there is of Mauritius is beautiful. You have undulating wide -expanses of sugar-cane--a fine, fresh green and very pleasant to the eye; -and everywhere else you have a ragged luxuriance of tropic vegetation of -vivid greens of varying shades, a wild tangle of underbrush, with -graceful tall palms lifting their crippled plumes high above it; and you -have stretches of shady dense forest with limpid streams frolicking -through them, continually glimpsed and lost and glimpsed again in the -pleasantest hide-and-seek fashion; and you have some tiny mountains, -some quaint and picturesque groups of toy peaks, and a dainty little -vest-pocket Matterhorn; and here and there and now and then a strip of -sea with a white ruffle of surf breaks into the view. - -That is Mauritius; and pretty enough. The details are few, the massed -result is charming, but not imposing; not riotous, not exciting; it is a -Sunday landscape. Perspective, and the enchantments wrought by distance, -are wanting. There are no distances; there is no perspective, so to -speak. Fifteen miles as the crow flies is the usual limit of vision. -Mauritius is a garden and a park combined. It affects one's emotions as -parks and gardens affect them. The surfaces of one's spiritual deeps are -pleasantly played upon, the deeps themselves are not reached, not -stirred. Spaciousness, remote altitudes, the sense of mystery which -haunts apparently inaccessible mountain domes and summits reposing in the -sky--these are the things which exalt the spirit and move it to see -visions and dream dreams. - -The Sandwich Islands remain my ideal of the perfect thing in the matter -of tropical islands. I would add another story to Mauna Loa's 16,000 -feet if I could, and make it particularly bold and steep and craggy and -forbidding and snowy; and I would make the volcano spout its lava-floods -out of its summit instead of its sides; but aside from these -non-essentials I have no corrections to suggest. I hope these will be -attended to; I do not wish to have to speak of it again. - - - - -CHAPTER LXIV. - -When your watch gets out of order you have choice of two things to do: -throw it in the fire or take it to the watch-tinker. The former is the -quickest. - --Pudd'nhead Wilson's New Calendar. - -The Arundel Castle is the finest boat I have seen in these seas. She is -thoroughly modern, and that statement covers a great deal of ground. She -has the usual defect, the common defect, the universal defect, the defect -that has never been missing from any ship that ever sailed--she has -imperfect beds. Many ships have good beds, but no ship has very good -ones. In the matter of beds all ships have been badly edited, ignorantly -edited, from the beginning. The selection of the beds is given to some -hearty, strong-backed, self-made man, when it ought to be given to a -frail woman accustomed from girlhood to backaches and insomnia. Nothing -is so rare, on either side of the ocean, as a perfect bed; nothing is so -difficult to make. Some of the hotels on both sides provide it, but no -ship ever does or ever did. In Noah's Ark the beds were simply -scandalous. Noah set the fashion, and it will endure in one degree of -modification or another till the next flood. - -8 A.M. Passing Isle de Bourbon. Broken-up sky-line of volcanic -mountains in the middle. Surely it would not cost much to repair them, -and it seems inexcusable neglect to leave them as they are. - -It seems stupid to send tired men to Europe to rest. It is no proper -rest for the mind to clatter from town to town in the dust and cinders, -and examine galleries and architecture, and be always meeting people and -lunching and teaing and dining, and receiving worrying cables and -letters. And a sea voyage on the Atlantic is of no use--voyage too -short, sea too rough. The peaceful Indian and Pacific Oceans and the -long stretches of time are the healing thing. - -May 2, AM. A fair, great ship in sight, almost the first we have seen in -these weeks of lonely voyaging. We are now in the Mozambique Channel, -between Madagascar and South Africa, sailing straight west for Delagoa -Bay. - -Last night, the burly chief engineer, middle-aged, was standing telling a -spirited seafaring tale, and had reached the most exciting place, where a -man overboard was washing swiftly astern on the great seas, and uplifting -despairing cries, everybody racing aft in a frenzy of excitement and -fading hope, when the band, which had been silent a moment, began -impressively its closing piece, the English national anthem. As simply -as if he was unconscious of what he was doing, he stopped his story, -uncovered, laid his laced cap against his breast, and slightly bent his -grizzled head. The few bars finished, he put on his cap and took up his -tale again, as naturally as if that interjection of music had been a part -of it. There was something touching and fine about it, and it was moving -to reflect that he was one of a myriad, scattered over every part of the -globe, who by turn was doing as he was doing every hour of the -twenty-four--those awake doing it while the others slept--those -impressive bars forever floating up out of the various climes, never -silent and never lacking reverent listeners. - -All that I remember about Madagascar is that Thackeray's little Billie -went up to the top of the mast and there knelt him upon his knee, saying, -"I see - - "Jerusalem and Madagascar, - And North and South Amerikee." - -May 3. Sunday. Fifteen or twenty Africanders who will end their voyage -to-day and strike for their several homes from Delagoa Bay to-morrow, sat -up singing on the afterdeck in the moonlight till 3 A.M. Good fun and -wholesome. And the songs were clean songs, and some of them were -hallowed by tender associations. Finally, in a pause, a man asked, "Have -you heard about the fellow that kept a diary crossing the Atlantic?" -It was a discord, a wet blanket. The men were not in the mood for -humorous dirt. The songs had carried them to their homes, and in spirit -they sat by those far hearthstones, and saw faces and heard voices other -than those that were about them. And so this disposition to drag in an -old indecent anecdote got no welcome; nobody answered. The poor man -hadn't wit enough to see that he had blundered, but asked his question -again. Again there was no response. It was embarrassing for him. In -his confusion he chose the wrong course, did the wrong thing--began the -anecdote. Began it in a deep and hostile stillness, where had been such -life and stir and warm comradeship before. He delivered himself of the -brief details of the diary's first day, and did it with some confidence -and a fair degree of eagerness. It fell flat. There was an awkward -pause. The two rows of men sat like statues. There was no movement, no -sound. He had to go on; there was no other way, at least none that an -animal of his calibre could think of. At the close of each day's diary, -the same dismal silence followed. When at last he finished his tale and -sprung the indelicate surprise which is wont to fetch a crash of -laughter, not a ripple of sound resulted. It was as if the tale had been -told to dead men. After what seemed a long, long time, somebody sighed, -somebody else stirred in his seat; presently, the men dropped into a low -murmur of confidential talk, each with his neighbor, and the incident was -closed. There were indications that that man was fond of his anecdote; -that it was his pet, his standby, his shot that never missed, his -reputation-maker. But he will never tell it again. No doubt he will -think of it sometimes, for that cannot well be helped; and then he will -see a picture, and always the same picture--the double rank of dead men; -the vacant deck stretching away in dimming perspective beyond them, the -wide desert of smooth sea all abroad; the rim of the moon spying from -behind a rag of black cloud; the remote top of the mizzenmast shearing a -zigzag path through the fields of stars in the deeps of space; and this -soft picture will remind him of the time that he sat in the midst of it -and told his poor little tale and felt so lonesome when he got through. - -Fifty Indians and Chinamen asleep in a big tent in the waist of the ship -forward; they lie side by side with no space between; the former wrapped -up, head and all, as in the Indian streets, the Chinamen uncovered; the -lamp and things for opium smoking in the center. - -A passenger said it was ten 2-ton truck loads of dynamite that lately -exploded at Johannesburg. Hundreds killed; he doesn't know how many; -limbs picked up for miles around. Glass shattered, and roofs swept away -or collapsed 200 yards off; fragment of iron flung three and a half -miles. - -It occurred at 3 p.m.; at 6, L65,000 had been subscribed. When this -passenger left, L35,000 had been voted by city and state governments and -L100,000 by citizens and business corporations. When news of the -disaster was telephoned to the Exchange L35,000 were subscribed in the -first five minutes. Subscribing was still going on when he left; the -papers had ceased the names, only the amounts--too many names; not enough -room. L100,000 subscribed by companies and citizens; if this is true, it -must be what they call in Australia "a record"--the biggest instance of a -spontaneous outpour for charity in history, considering the size of the -population it was drawn from, $8 or $10 for each white resident, babies -at the breast included. - -Monday, May 4. Steaming slowly in the stupendous Delagoa Bay, its dim -arms stretching far away and disappearing on both sides. It could -furnish plenty of room for all the ships in the world, but it is shoal. -The lead has given us 3 1/2 fathoms several times and we are drawing -that, lacking 6 inches. - -A bold headland--precipitous wall, 150 feet high, very strong, red color, -stretching a mile or so. A man said it was Portuguese blood--battle -fought here with the natives last year. I think this doubtful. Pretty -cluster of houses on the tableland above the red-and rolling stretches of -grass and groups of trees, like England. - -The Portuguese have the railroad (one passenger train a day) to the -border--70 miles--then the Netherlands Company have it. Thousands of -tons of freight on the shore--no cover. This is Portuguese allover ---indolence, piousness, poverty, impotence. - -Crews of small boats and tugs, all jet black woolly heads and very -muscular. - -Winter. The South African winter is just beginning now, but nobody but -an expert can tell it from summer. However, I am tired of summer; we -have had it unbroken for eleven months. We spent the afternoon on shore, -Delagoa Bay. A small town--no sights. No carriages. Three 'rickshas, -but we couldn't get them--apparently private. These Portuguese are a -rich brown, like some of the Indians. Some of the blacks have the long -horse beads and very long chins of the negroes of the picture books; but -most of them are exactly like the negroes of our Southern States round -faces, flat noses, good-natured, and easy laughers. - -Flocks of black women passed along, carrying outrageously heavy bags of -freight on their heads. The quiver of their leg as the foot was planted -and the strain exhibited by their bodies showed what a tax upon their -strength the load was. They were stevedores and doing full stevedores -work. They were very erect when unladden--from carrying heavy loads on -their heads--just like the Indian women. It gives them a proud fine -carriage. - -Sometimes one saw a woman carrying on her head a laden and top-heavy -basket the shape of an inverted pyramid-its top the size of a soup-plate, -its base the diameter of a teacup. It required nice balancing--and got -it. - -No bright colors; yet there were a good many Hindoos. - -The Second Class Passenger came over as usual at "lights out" (11) and we -lounged along the spacious vague solitudes of the deck and smoked the -peaceful pipe and talked. He told me an incident in Mr. Barnum's life -which was evidently characteristic of that great showman in several ways: - -This was Barnum's purchase of Shakespeare's birthplace, a quarter of a -century ago. The Second Class Passenger was in Jamrach's employ at the -time and knew Barnum well. He said the thing began in this way. One -morning Barnum and Jamrach were in Jamrach's little private snuggery back -of the wilderness of caged monkeys and snakes and other commonplaces of -Jamrach's stock in trade, refreshing themselves after an arduous stroke -of business, Jamrach with something orthodox, Barnum with something -heterodox--for Barnum was a teetotaler. The stroke of business was in -the elephant line. Jamrach had contracted to deliver to Barnum in New -York 18 elephants for $360,000 in time for the next season's opening. -Then it occurred to Mr. Barnum that he needed a "card" He suggested -Jumbo. Jamrach said he would have to think of something else--Jumbo -couldn't be had; the Zoo wouldn't part with that elephant. Barnum said -he was willing to pay a fortune for Jumbo if he could get him. Jamrach -said it was no use to think about it; that Jumbo was as popular as the -Prince of Wales and the Zoo wouldn't dare to sell him; all England would -be outraged at the idea; Jumbo was an English institution; he was part of -the national glory; one might as well think of buying the Nelson -monument. Barnum spoke up with vivacity and said: - -"It's a first-rate idea. I'll buy the Monument." - -Jamrach was speechless for a second. Then he said, like one ashamed -"You caught me. I was napping. For a moment I thought you were in -earnest." - -Barnum said pleasantly-- - -"I was in earnest. I know they won't sell it, but no matter, I will not -throw away a good idea for all that. All I want is a big advertisement. -I will keep the thing in mind, and if nothing better turns up I will -offer to buy it. That will answer every purpose. It will furnish me a -couple of columns of gratis advertising in every English and American -paper for a couple of months, and give my show the biggest boom a show -ever had in this world." - -Jamrach started to deliver a burst of admiration, but was interrupted by -Barnum, who said: - -"Here is a state of things! England ought to blush." - -His eye had fallen upon something in the newspaper. He read it through -to himself, then read it aloud. It said that the house that Shakespeare -was born in at Stratford-on-Avon was falling gradually to ruin through -neglect; that the room where the poet first saw the light was now serving -as a butcher's shop; that all appeals to England to contribute money (the -requisite sum stated) to buy and repair the house and place it in the -care of salaried and trustworthy keepers had fallen resultless. Then -Barnum said: - -"There's my chance. Let Jumbo and the Monument alone for the present ---they'll keep. I'll buy Shakespeare's house. I'll set it up in my -Museum in New York and put a glass case around it and make a sacred thing -of it; and you'll see all America flock there to worship; yes, and -pilgrims from the whole earth; and I'll make them take their hats off, -too. In America we know how to value anything that Shakespeare's touch -has made holy. You'll see." - -In conclusion the S. C. P. said: - -"That is the way the thing came about. Barnum did buy Shakespeare's -house. He paid the price asked, and received the properly attested -documents of sale. Then there was an explosion, I can tell you. England -rose! That, the birthplace of the master-genius of all the ages and all -the climes--that priceless possession of Britain--to be carted out of the -country like so much old lumber and set up for sixpenny desecration in a -Yankee show-shop--the idea was not to be tolerated for a moment. England -rose in her indignation; and Barnum was glad to relinquish his prize and -offer apologies. However, he stood out for a compromise; he claimed a -concession--England must let him have Jumbo. And England consented, but -not cheerfully." - -It shows how, by help of time, a story can grow--even after Barnum has -had the first innings in the telling of it. Mr. Barnum told me the story -himself, years ago. He said that the permission to buy Jumbo was not a -concession; the purchase was made and the animal delivered before the -public knew anything about it. Also, that the securing of Jumbo was all -the advertisement he needed. It produced many columns of newspaper talk, -free of cost, and he was satisfied. He said that if he had failed to get -Jumbo he would have caused his notion of buying the Nelson Monument to be -treacherously smuggled into print by some trusty friend, and after he had -gotten a few hundred pages of gratuitous advertising out of it, he would -have come out with a blundering, obtuse, but warm-hearted letter of -apology, and in a postscript to it would have naively proposed to let the -Monument go, and take Stonehenge in place of it at the same price. - -It was his opinion that such a letter, written with well-simulated -asinine innocence and gush would have gotten his ignorance and stupidity -an amount of newspaper abuse worth six fortunes to him, and not -purchasable for twice the money. - -I knew Mr. Barnum well, and I placed every confidence in the account -which he gave me of the Shakespeare birthplace episode. He said he found -the house neglected and going-to decay, and he inquired into the matter -and was told that many times earnest efforts had been made to raise money -for its proper repair and preservation, but without success. He then -proposed to buy it. The proposition was entertained, and a price named ---$50,000, I think; but whatever it was, Barnum paid the money down, -without remark, and the papers were drawn up and executed. He said that -it had been his purpose to set up the house in his Museum, keep it in -repair, protect it from name-scribblers and other desecrators, and leave -it by bequest to the safe and perpetual guardianship of the Smithsonian -Institute at Washington. - -But as soon as it was found that Shakespeare's house had passed into -foreign hands and was going to be carried across the ocean, England was -stirred as no appeal from the custodians of the relic had ever stirred -England before, and protests came flowing in--and money, too, to stop the -outrage. Offers of repurchase were made--offers of double the money that -Mr. Barnum had paid for the house. He handed the house back, but took -only the sum which it had cost him--but on the condition that an -endowment sufficient for the future safeguarding and maintenance of the -sacred relic should be raised. This condition was fulfilled. - -That was Barnum's account of the episode; and to the end of his days he -claimed with pride and satisfaction that not England, but America ---represented by him--saved the birthplace of Shakespeare from destruction. - -At 3 P.M., May 6th, the ship slowed down, off the land, and thoughtfully -and cautiously picked her way into the snug harbor of Durban, South -Africa. - - - - -CHAPTER LXV. - -In statesmanship get the formalities right, never mind about the -moralities. - --Pudd'nhead Wilson's New Calendar. - -FROM DIARY: - -Royal Hotel. Comfortable, good table, good service of natives and -Madrasis. Curious jumble of modern and ancient city and village, -primitiveness and the other thing. Electric bells, but they don't ring. -Asked why they didn't, the watchman in the office said he thought they -must be out of order; he thought so because some of them rang, but most -of them didn't. Wouldn't it be a good idea to put them in order? He -hesitated--like one who isn't quite sure--then conceded the point. - -May 7. A bang on the door at 6. Did I want my boots cleaned? Fifteen -minutes later another bang. Did we want coffee? Fifteen later, bang -again, my wife's bath ready; 15 later, my bath ready. Two other bangs; -I forget what they were about. Then lots of shouting back and forth, -among the servants just as in an Indian hotel. - -Evening. At 4 P.M. it was unpleasantly warm. Half-hour after sunset -one needed a spring overcoat; by 8 a winter one. - -Durban is a neat and clean town. One notices that without having his -attention called to it. - -Rickshaws drawn by splendidly built black Zulus, so overflowing with -strength, seemingly, that it is a pleasure, not a pain, to see them -snatch a rickshaw along. They smile and laugh and show their teeth--a -good-natured lot. Not allowed to drink; 2s per hour for one person; 3s -for two; 3d for a course--one person. - -The chameleon in the hotel court. He is fat and indolent and -contemplative; but is business-like and capable when a fly comes about ---reaches out a tongue like a teaspoon and takes him in. He gums his -tongue first. He is always pious, in his looks. And pious and thankful -both, when Providence or one of us sends him a fly. He has a froggy -head, and a back like a new grave--for shape; and hands like a bird's -toes that have been frostbitten. But his eyes are his exhibition -feature. A couple of skinny cones project from the sides of his head, -with a wee shiny bead of an eye set in the apex of each; and these cones -turn bodily like pivot-guns and point every-which-way, and they are -independent of each other; each has its own exclusive machinery. When I -am behind him and C. in front of him, he whirls one eye rearwards and the -other forwards--which gives him a most Congressional expression (one eye -on the constituency and one on the swag); and then if something happens -above and below him he shoots out one eye upward like a telescope and the -other downward--and this changes his expression, but does not improve it. - -Natives must not be out after the curfew bell without a pass. In Natal -there are ten blacks to one white. - -Sturdy plump creatures are the women. They comb their wool up to a peak -and keep it in position by stiffening it with brown-red clay--half of -this tower colored, denotes engagement; the whole of it colored denotes -marriage. - -None but heathen Zulus on the police; Christian ones not allowed. - -May 9. A drive yesterday with friends over the Berea. Very fine roads -and lofty, overlooking the whole town, the harbor, and the sea-beautiful -views. Residences all along, set in the midst of green lawns with shrubs -and generally one or two intensely red outbursts of poinsettia--the -flaming splotch of blinding red a stunning contrast with the world of -surrounding green. The cactus tree--candelabrum-like; and one twisted -like gray writhing serpents. The "flat-crown" (should be flat-roof) ---half a dozen naked branches full of elbows, slant upward like artificial -supports, and fling a roof of delicate foliage out in a horizontal -platform as flat as a floor; and you look up through this thin floor as -through a green cobweb or veil. The branches are japanesich. All about -you is a bewildering variety of unfamiliar and beautiful trees; one sort -wonderfully dense foliage and very dark green--so dark that you notice it -at once, notwithstanding there are so many orange trees. The -"flamboyant"--not in flower, now, but when in flower lives up to its -name, we are told. Another tree with a lovely upright tassel scattered -among its rich greenery, red and glowing as a firecoal. Here and there a -gum-tree; half a dozen lofty Norfolk Island pines lifting their fronded -arms skyward. Groups of tall bamboo. - -Saw one bird. Not many birds here, and they have no music--and the -flowers not much smell, they grow so fast. - -Everything neat and trim and clean like the town. The loveliest trees -and the greatest variety I have ever seen anywhere, except approaching -Darjeeling. Have not heard anyone call Natal the garden of South Africa, -but that is what it probably is. - -It was when Bishop of Natal that Colenso raised such a storm in the -religious world. The concerns of religion are a vital matter here yet. -A vigilant eye is kept upon Sunday. Museums and other dangerous resorts -are not allowed to be open. You may sail on the Bay, but it is wicked to -play cricket. For a while a Sunday concert was tolerated, upon condition -that it must be admission free and the money taken by collection. But -the collection was alarmingly large and that stopped the matter. They -are particular about babies. A clergyman would not bury a child -according to the sacred rites because it had not been baptized. The -Hindoo is more liberal. He burns no child under three, holding that it -does not need purifying. - -The King of the Zulus, a fine fellow of 30, was banished six years ago -for a term of seven years. He is occupying Napoleon's old stand--St. -Helena. The people are a little nervous about having him come back, and -they may well be, for Zulu kings have been terrible people sometimes ---like Tchaka, Dingaan, and Cetewayo. - -There is a large Trappist monastery two hours from Durban, over the -country roads, and in company with Mr. Milligan and Mr. Hunter, general -manager of the Natal government railways, who knew the heads of it, we -went out to see it. - -There it all was, just as one reads about it in books and cannot believe -that it is so--I mean the rough, hard work, the impossible hours, the -scanty food, the coarse raiment, the Maryborough beds, the tabu of human -speech, of social intercourse, of relaxation, of amusement, of -entertainment, of the presence of woman in the men's establishment. -There it all was. It was not a dream, it was not a lie. And yet with -the fact before one's face it was still incredible. It is such a -sweeping suppression of human instincts, such an extinction of the man as -an individual. - -La Trappe must have known the human race well. The scheme which he -invented hunts out everything that a man wants and values--and withholds -it from him. Apparently there is no detail that can help make life worth -living that has not been carefully ascertained and placed out of the -Trappist's reach. La Trappe must have known that there were men who -would enjoy this kind of misery, but how did he find it out? - -If he had consulted you or me he would have been told that his scheme -lacked too many attractions; that it was impossible; that it could never -be floated. But there in the monastery was proof that he knew the human -race better than it knew itself. He set his foot upon every desire that -a man has--yet he floated his project, and it has prospered for two -hundred years, and will go on prospering forever, no doubt. - -Man likes personal distinction--there in the monastery it is obliterated. -He likes delicious food--there he gets beans and bread and tea, and not -enough of it. He likes to lie softly--there he lies on a sand mattress, -and has a pillow and a blanket, but no sheet. When he is dining, in a -great company of friends, he likes to laugh and chat--there a monk reads -a holy book aloud during meals, and nobody speaks or laughs. When a man -has a hundred friends about him, evenings, be likes to have a good time -and run late--there he and the rest go silently to bed at 8; and in the -dark, too; there is but a loose brown robe to discard, there are no -night-clothes to put on, a light is not needed. Man likes to lie abed -late there he gets up once or twice in the night to perform some -religious office, and gets up finally for the day at two in the morning. -Man likes light work or none at all--there he labors all day in the -field, or in the blacksmith shop or the other shops devoted to the -mechanical trades, such as shoemaking, saddlery, carpentry, and so on. -Man likes the society of girls and women--there he never has it. He -likes to have his children about him, and pet them and play with them ---there he has none. He likes billiards--there is no table there. He -likes outdoor sports and indoor dramatic and musical and social -entertainments--there are none there. He likes to bet on things--I was -told that betting is forbidden there. When a man's temper is up he likes -to pour it out upon somebody there this is not allowed. A man likes -animals--pets; there are none there. He likes to smoke--there he cannot -do it. He likes to read the news--no papers or magazines come there. A -man likes to know how his parents and brothers and sisters are getting -along when he is away, and if they miss him--there he cannot know. A man -likes a pretty house, and pretty furniture, and pretty things, and pretty -colors--there he has nothing but naked aridity and sombre colors. A man -likes--name it yourself: whatever it is, it is absent from that place. - -From what I could learn, all that a man gets for this is merely the -saving of his soul. - -It all seems strange, incredible, impossible. But La Trappe knew the -race. He knew the powerful attraction of unattractiveness; he knew that -no life could be imagined, howsoever comfortless and forbidding, but -somebody would want to try it. - -This parent establishment of Germans began its work fifteen years ago, -strangers, poor, and unencouraged; it owns 15,000 acres of land now, and -raises grain and fruit, and makes wines, and manufactures all manner of -things, and has native apprentices in its shops, and sends them forth -able to read and write, and also well equipped to earn their living by -their trades. And this young establishment has set up eleven branches in -South Africa, and in them they are christianizing and educating and -teaching wage-yielding mechanical trades to 1,200 boys and girls. -Protestant Missionary work is coldly regarded by the commercial white -colonist all over the heathen world, as a rule, and its product is -nicknamed "rice-Christians" (occupationless incapables who join the -church for revenue only), but I think it would be difficult to pick a -flaw in the work of these Catholic monks, and I believe that the -disposition to attempt it has not shown itself. - -Tuesday, May 12. Transvaal politics in a confused condition. First the -sentencing of the Johannesburg Reformers startled England by its -severity; on the top of this came Kruger's exposure of the cipher -correspondence, which showed that the invasion of the Transvaal, with the -design of seizing that country and adding it to the British Empire, was -planned by Cecil Rhodes and Beit--which made a revulsion in English -feeling, and brought out a storm against Rhodes and the Chartered Company -for degrading British honor. For a good while I couldn't seem to get at -a clear comprehension of it, it was so tangled. But at last by patient -study I have managed it, I believe. As I understand it, the Uitlanders -and other Dutchmen were dissatisfied because the English would not allow -them to take any part in the government except to pay taxes. Next, as I -understand it, Dr. Kruger and Dr. Jameson, not having been able to make -the medical business pay, made a raid into Matabeleland with the -intention of capturing the capital, Johannesburg, and holding the women -and children to ransom until the Uitlanders and the other Boers should -grant to them and the Chartered Company the political rights which had -been withheld from them. They would have succeeded in this great scheme, -as I understand it, but for the interference of Cecil Rhodes and Mr. -Beit, and other Chiefs of the Matabele, who persuaded their countrymen to -revolt and throw off their allegiance to Germany. This, in turn, as I -understand it, provoked the King of Abyssinia to destroy the Italian army -and fall back upon Johannesburg; this at the instigation of Rhodes, to -bull the stock market. - - - - -CHAPTER LXVI. - -Every one is a moon, and has a dark side which he never shows to anybody. - --Pudd'nhead Wilson's New Calendar. - -When I scribbled in my note-book a year ago the paragraph which ends the -preceding chapter, it was meant to indicate, in an extravagant form, two -things: the conflicting nature of the information conveyed by the citizen -to the stranger concerning South African politics, and the resulting -confusion created in the stranger's mind thereby. - -But it does not seem so very extravagant now. Nothing could in that -disturbed and excited time make South African politics clear or quite -rational to the citizen of the country because his personal interest and -his political prejudices were in his way; and nothing could make those -politics clear or rational to the stranger, the sources of his -information being such as they were. - -I was in South Africa some little time. When I arrived there the -political pot was boiling fiercely. Four months previously, Jameson had -plunged over the Transvaal border with about 600 armed horsemen at his -back, to go to the "relief of the women and children" of Johannesburg; on -the fourth day of his march the Boers had defeated him in battle, and -carried him and his men to Pretoria, the capital, as prisoners; the Boer -government had turned Jameson and his officers over to the British -government for trial, and shipped them to England; next, it had arrested -64 important citizens of Johannesburg as raid-conspirators, condemned -their four leaders to death, then commuted the sentences, and now the 64 -were waiting, in jail, for further results. Before midsummer they were -all out excepting two, who refused to sign the petitions for release; 58 -had been fined $10,000 each and enlarged, and the four leaders had gotten -off with fines of $125,000 each with permanent exile added, in one case. - -Those were wonderfully interesting days for a stranger, and I was glad. -to be in the thick of the excitement. Everybody was talking, and I -expected to understand the whole of one side of it in a very little -while. - -I was disappointed. There were singularities, perplexities, -unaccountabilities about it which I was not able to master. I had no -personal access to Boers--their side was a secret to me, aside from what -I was able to gather of it from published statements. My sympathies were -soon with the Reformers in the Pretoria jail, with their friends, and -with their cause. By diligent inquiry in Johannesburg I found out ---apparently--all the details of their side of the quarrel except one--what -they expected to accomplish by an armed rising. - -Nobody seemed to know. - -The reason why the Reformers were discontented and wanted some changes -made, seemed quite clear. In Johannesburg it was claimed that the -Uitlanders (strangers, foreigners) paid thirteen-fifteenths of the -Transvaal taxes, yet got little or nothing for it. Their city had no -charter; it had no municipal government; it could levy no taxes for -drainage, water-supply, paving, cleaning, sanitation, policing. There -was a police force, but it was composed of Boers, it was furnished by the -State Government, and the city had no control over it. Mining was very -costly; the government enormously increased the cost by putting -burdensome taxes upon the mines, the output, the machinery, the -buildings; by burdensome imposts upon incoming materials; by burdensome -railway-freight-charges. Hardest of all to bear, the government reserved -to itself a monopoly in that essential thing, dynamite, and burdened it -with an extravagant price. The detested Hollander from over the water -held all the public offices. The government was rank with corruption. -The Uitlander had no vote, and must live in the State ten or twelve years -before he could get one. He was not represented in the Raad -(legislature) that oppressed him and fleeced him. Religion was not free. -There were no schools where the teaching was in English, yet the great -majority of the white population of the State knew no tongue but that. -The State would not pass a liquor law; but allowed a great trade in cheap -vile brandy among the blacks, with the result that 25 per cent. of the -50,000 blacks employed in the mines were usually drunk and incapable of -working. - -There--it was plain enough that the reasons for wanting some changes made -were abundant and reasonable, if this statement of the existing -grievances was correct. - -What the Uitlanders wanted was reform--under the existing Republic. - -What they proposed to do was to secure these reforms by, prayer, -petition, and persuasion. - -They did petition. Also, they issued a Manifesto, whose very first note -is a bugle-blast of loyalty: "We want the establishment of this Republic -as a true Republic." - -Could anything be clearer than the Uitlander's statement of the -grievances and oppressions under which they were suffering? Could -anything be more legal and citizen-like and law-respecting than their -attitude as expressed by their Manifesto? No. Those things were -perfectly clear, perfectly comprehensible. - -But at this point the puzzles and riddles and confusions begin to flock -in. You have arrived at a place which you cannot quite understand. - -For you find that as a preparation for this loyal, lawful, and in every -way unexceptionable attempt to persuade the government to right their -grievances, the Uitlanders had smuggled a Maxim gun or two and 1,500 -muskets into the town, concealed in oil tanks and coal cars, and had -begun to form and drill military companies composed of clerks, merchants, -and citizens generally. - -What was their idea? Did they suppose that the Boers would attack them -for petitioning, for redress? That could not be. - -Did they suppose that the Boers would attack them even for issuing a -Manifesto demanding relief under the existing government? - -Yes, they apparently believed so, because the air was full of talk of -forcing the government to grant redress if it were not granted -peacefully. - -The Reformers were men of high intelligence. If they were in earnest, -they were taking extraordinary risks. They had enormously valuable -properties to defend; their town was full of women and children; their -mines and compounds were packed with thousands upon thousands of sturdy -blacks. If the Boers attacked, the mines would close, the blacks would -swarm out and get drunk; riot and conflagration and the Boers together -might lose the Reformers more in a day, in money, blood, and suffering, -than the desired political relief could compensate in ten years if they -won the fight and secured the reforms. - -It is May, 1897, now; a year has gone by, and the confusions of that day -have been to a considerable degree cleared away. Mr. Cecil Rhodes, Dr. -Jameson, and others responsible for the Raid, have testified before the -Parliamentary Committee of Inquiry in London, and so have Mr. Lionel -Phillips and other Johannesburg Reformers, monthly-nurses of the -Revolution which was born dead. These testimonies have thrown light. -Three books have added much to this light: - -"South Africa As It Is," by Mr. Statham, an able writer partial to the -Boers; "The Story of an African Crisis," by Mr. Garrett, a brilliant -writer partial to Rhodes; and "A Woman's Part in a Revolution," by Mrs. -John Hays Hammond, a vigorous and vivid diarist, partial to the -Reformers. By liquifying the evidence of the prejudiced books and of the -prejudiced parliamentary witnesses and stirring the whole together and -pouring it into my own (prejudiced) moulds, I have got at the truth of -that puzzling South African situation, which is this: - -1. The capitalists and other chief men of Johannesburg were fretting -under various political and financial burdens imposed by the State (the -South African Republic, sometimes called "the Transvaal") and desired to -procure by peaceful means a modification of the laws. - -2. Mr. Cecil Rhodes, Premier of the British Cape Colony, millionaire, -creator and managing director of the territorially-immense and -financially unproductive South Africa Company; projector of vast schemes -for the unification and consolidation of all the South African States, -one imposing commonwealth or empire under the shadow and general -protection of the British flag, thought he saw an opportunity to make -profitable use of the Uitlander discontent above mentioned--make the -Johannesburg cat help pull out one of his consolidation chestnuts for -him. With this view he set himself the task of warming the lawful and -legitimate petitions and supplications of the Uitlanders into seditious -talk, and their frettings into threatenings--the final outcome to be -revolt and armed rebellion. If he could bring about a bloody collision -between those people and the Boer government, Great Britain would have to -interfere; her interference would be resisted by the Boers; she would -chastise them and add the Transvaal to her South African possessions. It -was not a foolish idea, but a rational and practical one. - -After a couple of years of judicious plotting, Mr. Rhodes had his reward; -the revolutionary kettle was briskly boiling in Johannesburg, and the -Uitlander leaders were backing their appeals to the government--now -hardened into demands--by threats of force and bloodshed. By the middle -of December, 1895, the explosion seemed imminent. Mr. Rhodes was -diligently helping, from his distant post in Cape Town. He was helping -to procure arms for Johannesburg; he was also arranging to have Jameson -break over the border and come to Johannesburg with 600 mounted men at -his back. Jameson--as per instructions from Rhodes, perhaps--wanted a -letter from the Reformers requesting him to come to their aid. It was a -good idea. It would throw a considerable share of the responsibility of -his invasion upon the Reformers. He got the letter--that famous one -urging him to fly to the rescue of the women and children. He got it two -months before he flew. The Reformers seem to have thought it over and -concluded that they had not done wisely; for the next day after giving -Jameson the implicating document they wanted to withdraw it and leave the -women and children in danger; but they were told that it was too late. -The original had gone to Mr. Rhodes at the Cape. Jameson had kept a -copy, though. - -From that time until the 29th of December, a good deal of the Reformers' -time was taken up with energetic efforts to keep Jameson from coming to -their assistance. Jameson's invasion had been set for the 26th. The -Reformers were not ready. The town was not united. Some wanted a fight, -some wanted peace; some wanted a new government, some wanted the existing -one reformed; apparently very few wanted the revolution to take place in -the interest and under the ultimate shelter of the Imperial flag ---British; yet a report began to spread that Mr. Rhodes's embarrassing -assistance had for its end this latter object. - -Jameson was away up on the frontier tugging at his leash, fretting to -burst over the border. By hard work the Reformers got his starting-date -postponed a little, and wanted to get it postponed eleven days. -Apparently, Rhodes's agents were seconding their efforts--in fact wearing -out the telegraph wires trying to hold him back. Rhodes was himself the -only man who could have effectively postponed Jameson, but that would -have been a disadvantage to his scheme; indeed, it could spoil his whole -two years' work. - -Jameson endured postponement three days, then resolved to wait no longer. -Without any orders--excepting Mr. Rhodes's significant silence--he cut -the telegraph wires on the 29th, and made his plunge that night, to go to -the rescue of the women and children, by urgent request of a letter now -nine days old--as per date,--a couple of months old, in fact. He read -the letter to his men, and it affected them. It did not affect all of -them alike. Some saw in it a piece of piracy of doubtful wisdom, and -were sorry to find that they had been assembled to violate friendly -territory instead of to raid native kraals, as they had supposed. - -Jameson would have to ride 150 miles. He knew that there were suspicions -abroad in the Transvaal concerning him, but he expected to get through to -Johannesburg before they should become general and obstructive. But a -telegraph wire had been overlooked and not cut. It spread the news of -his invasion far and wide, and a few hours after his start the Boer -farmers were riding hard from every direction to intercept him. - -As soon as it was known in Johannesburg that he was on his way to rescue -the women and children, the grateful people put the women and children in -a train and rushed them for Australia. In fact, the approach of -Johannesburg's saviour created panic and consternation; there, and a -multitude of males of peaceable disposition swept to the trains like a -sand-storm. The early ones fared best; they secured seats--by sitting in -them--eight hours before the first train was timed to leave. - -Mr. Rhodes lost no time. He cabled the renowned Johannesburg letter of -invitation to the London press--the gray-headedest piece of ancient -history that ever went over a cable. - -The new poet laureate lost no time. He came out with a rousing poem -lauding Jameson's prompt and splendid heroism in flying to the rescue of -the women and children; for the poet could not know that he did not fly -until two months after the invitation. He was deceived by the false date -of the letter, which was December 20th. - -Jameson was intercepted by the Boers on New Year's Day, and on the next -day he surrendered. He had carried his copy of the letter along, and if -his instructions required him--in case of emergency--to see that it fell -into the hands of the Boers, he loyally carried them out. Mrs. Hammond -gives him a sharp rap for his supposed carelessness, and emphasizes her -feeling about it with burning italics: "It was picked up on the -battle-field in a leathern pouch, supposed to be Dr. Jameson's saddle-bag. -Why, in the name of all that is discreet and honorable, didn't he eat it!" - -She requires too much. He was not in the service of the Reformers ---excepting ostensibly; he was in the service of Mr. Rhodes. It was the -only plain English document, undarkened by ciphers and mysteries, and -responsibly signed and authenticated, which squarely implicated the -Reformers in the raid, and it was not to Mr. Rhodes's interest that it -should be eaten. Besides, that letter was not the original, it was only -a copy. Mr. Rhodes had the original--and didn't eat it. He cabled it to -the London press. It had already been read in England and America and -all over Europe before, Jameson dropped it on the battlefield. If the -subordinate's knuckles deserved a rap, the principal's deserved as many -as a couple of them. - -That letter is a juicily dramatic incident and is entitled to all its -celebrity, because of the odd and variegated effects which it produced. -All within the space of a single week it had made Jameson an illustrious -hero in England, a pirate in Pretoria, and an ass without discretion or -honor in Johannesburg; also it had produced a poet-laureatic explosion of -colored fireworks which filled the world's sky with giddy splendors, and, -the knowledge that Jameson was coming with it to rescue the women and -children emptied Johannesburg of that detail of the population. For an -old letter, this was much. For a letter two months old, it did marvels; -if it had been a year old it would have done miracles. - - - - -CHAPTER LXVII. - -First catch your Boer, then kick him. - --Pudd'nhead Wilson's New Calendar. - -Those latter days were days of bitter worry and trouble for the harassed -Reformers. - -From Mrs. Hammond we learn that on the 31st (the day after Johannesburg -heard of the invasion), "The Reform Committee repudiates Dr. Jameson's -inroad." - -It also publishes its intention to adhere to the Manifesto. - -It also earnestly desires that the inhabitants shall refrain from overt -acts against the Boer government. - -It also "distributes arms" at the Court House, and furnishes horses "to -the newly-enrolled volunteers." - -It also brings a Transvaal flag into the committee-room, and the entire -body swear allegiance to it "with uncovered heads and upraised arms." - -Also "one thousand Lee-Metford rifles have been given out"--to rebels. - -Also, in a speech, Reformer Lionel Phillips informs the public that the -Reform Committee Delegation has "been received with courtesy by the -Government Commission," and "been assured that their proposals shall be -earnestly considered." That "while the Reform Committee regretted -Jameson's precipitate action, they would stand by him." - -Also the populace are in a state of "wild enthusiasm," and "46 can -scarcely be restrained; they want to go out to meet Jameson and bring him -in with triumphal outcry." - -Also the British High Commissioner has issued a damnifying proclamation -against Jameson and all British abettors of his game. It arrives January -1st. - -It is a difficult position for the Reformers, and full of hindrances and -perplexities. Their duty is hard, but plain: - -1. They have to repudiate the inroad, and stand by the inroader. - -2. They have to swear allegiance to the Boer government, and distribute -cavalry horses to the rebels. - -3. They have to forbid overt acts against the Boer government, and -distribute arms to its enemies. - -4. They have to avoid collision with the British government, but still -stand by Jameson and their new oath of allegiance to the Boer government, -taken, uncovered, in presence of its flag. - -They did such of these things as they could; they tried to do them all; -in fact, did do them all, but only in turn, not simultaneously. In the -nature of things they could not be made to simultane. - -In preparing for armed revolution and in talking revolution, were the -Reformers "bluffing," or were they in earnest? If they were in earnest, -they were taking great risks--as has been already pointed out. A -gentleman of high position told me in Johannesburg that he had in his -possession a printed document proclaiming a new government and naming its -president--one of the Reform leaders. He said that this proclamation had -been ready for issue, but was suppressed when the raid collapsed. -Perhaps I misunderstood him. Indeed, I must have misunderstood him, for -I have not seen mention of this large incident in print anywhere. - -Besides, I hope I am mistaken; for, if I am, then there is argument that -the Reformers were privately not serious, but were only trying to scare -the Boer government into granting the desired reforms. - -The Boer government was scared, and it had a right to be. For if Mr. -Rhodes's plan was to provoke a collision that would compel the -interference of England, that was a serious matter. If it could be shown -that that was also the Reformers' plan and purpose, it would prove that -they had marked out a feasible project, at any rate, although it was one -which could hardly fail to cost them ruinously before England should -arrive. But it seems clear that they had no such plan nor desire. If, -when the worst should come to the worst, they meant to overthrow the -government, they also meant to inherit the assets themselves, no doubt. - -This scheme could hardly have succeeded. With an army of Boers at their -gates and 50,000 riotous blacks in their midst, the odds against success -would have been too heavy--even if the whole town had been armed. With -only 2,500 rifles in the place, they stood really no chance. - -To me, the military problems of the situation are of more interest than -the political ones, because by disposition I have always been especially -fond of war. No, I mean fond of discussing war; and fond of giving -military advice. If I had been with Jameson the morning after he -started, I should have advised him to turn back. That was Monday; it was -then that he received his first warning from a Boer source not to violate -the friendly soil of the Transvaal. It showed that his invasion was -known. If I had been with him on Tuesday morning and afternoon, when he -received further warnings, I should have repeated my advice. If I had -been with him the next morning--New Year's--when he received notice that -"a few hundred" Boers were waiting for him a few miles ahead, I should -not have advised, but commanded him to go back. And if I had been with -him two or three hours later--a thing not conceivable to me--I should -have retired him by force; for at that time he learned that the few -hundred had now grown to 800; and that meant that the growing would go on -growing. - -For,--by authority of Mr. Garrett, one knows that Jameson's 600 were only -530 at most, when you count out his native drivers, etc.; and that the -530 consisted largely of "green" youths, "raw young fellows," not trained -and war-worn British soldiers; and I would have told. Jameson that those -lads would not be able to shoot effectively from horseback in the scamper -and racket of battle, and that there would not be anything for them to -shoot at, anyway, but rocks; for the Boers would be behind the rocks, not -out in the open. I would have told him that 300 Boer sharpshooters -behind rocks would be an overmatch for his 500 raw young fellows on -horseback. - -If pluck were the only thing essential to battle-winning, the English -would lose no battles. But discretion, as well as pluck, is required -when one fights Boers and Red Indians. In South Africa the Briton has -always insisted upon standing bravely up, unsheltered, before the hidden -Boer, and taking the results: Jameson's men would follow the custom. -Jameson would not have listened to me--he would have been intent upon -repeating history, according to precedent. Americans are not acquainted -with the British-Boer war of 1881; but its history is interesting, and -could have been instructive to Jameson if he had been receptive. I will -cull some details of it from trustworthy sources mainly from "Russell's -Natal." Mr. Russell is not a Boer, but a Briton. He is inspector of -schools, and his history is a text-book whose purpose is the instruction -of the Natal English youth. - -After the seizure of the Transvaal and the suppression of the Boer -government by England in 1877, the Boers fretted for three years, and -made several appeals to England for a restoration of their liberties, -but without result. Then they gathered themselves together in a great -mass-meeting at Krugersdorp, talked their troubles over, and resolved to -fight for their deliverance from the British yoke. (Krugersdorp--the -place where the Boers interrupted the Jameson raid.) The little handful -of farmers rose against the strongest empire in the world. They -proclaimed martial law and the re-establishment of their Republic. They -organized their forces and sent them forward to intercept the British -battalions. This, although Sir Garnet Wolseley had but lately made -proclamation that "so long as the sun shone in the heavens," the -Transvaal would be and remain English territory. And also in spite of -the fact that the commander of the 94th regiment--already on the march to -suppress this rebellion--had been heard to say that "the Boers would turn -tail at the first beat of the big drum."--["South Africa As It Is," -by F. Reginald Statham, page 82. London: T. Fisher Unwin, 1897.] - -Four days after the flag-raising, the Boer force which had been sent -forward to forbid the invasion of the English troops met them at -Bronkhorst Spruit--246 men of the 94th regiment, in command of a colonel, -the big drum beating, the band playing--and the first battle was fought. -It lasted ten minutes. Result: - - British loss, more than 150 officers and men, out of the 246. - Surrender of the remnant. - - Boer loss--if any--not stated. - -They are fine marksmen, the Boers. From the cradle up, they live on -horseback and hunt wild animals with the rifle. They have a passion for -liberty and the Bible, and care for nothing else. - -"General Sir George Colley, Lieutenant-Governor and Commander-in-Chief in -Natal, felt it his duty to proceed at once to the relief of the loyalists -and soldiers beleaguered in the different towns of the Transvaal." He -moved out with 1,000 men and some artillery. He found the Boers encamped -in a strong and sheltered position on high ground at Laing's Nek--every -Boer behind a rock. Early in the morning of the 28th January, 1881, he -moved to the attack "with the 58th regiment, commanded by Colonel Deane, -a mounted squadron of 70 men, the 60th Rifles, the Naval Brigade with -three rocket tubes, and the Artillery with six guns." He shelled the -Boers for twenty minutes, then the assault was delivered, the 58th -marching up the slope in solid column. The battle was soon finished, -with this result, according to Russell-- - - British loss in killed and wounded, 174. - - Boer loss, "trifling." - -Colonel Deane was killed, and apparently every officer above the grade of -lieutenant was killed or wounded, for the 58th retreated to its camp in -command of a lieutenant. ("Africa as It Is.") - -That ended the second battle. - -On the 7th of February General Colley discovered that the Boers were -flanking his position. The next morning he left his camp at Mount -Pleasant and marched out and crossed the Ingogo river with 270 men, -started up the Ingogo heights, and there fought a battle which lasted -from noon till nightfall. He then retreated, leaving his wounded with -his military chaplain, and in recrossing the now swollen river lost some -of his men by drowning. That was the third Boer victory. Result, -according to Mr. Russell-- - - British loss 150 out of 270 engaged. - - Boer loss, 8 killed, 9 wounded--17. - -There was a season of quiet, now, but at the end of about three weeks Sir -George Colley conceived the idea of climbing, with an infantry and -artillery force, the steep and rugged mountain of Amajuba in the night--a -bitter hard task, but he accomplished it. On the way he left about 200 -men to guard a strategic point, and took about 400 up the mountain with -him. When the sun rose in the morning, there was an unpleasant surprise -for the Boers; yonder were the English troops visible on top of the -mountain two or three miles away, and now their own position was at the -mercy of the English artillery. The Boer chief resolved to retreat--up -that mountain. He asked for volunteers, and got them. - -The storming party crossed the swale and began to creep up the steeps, -"and from behind rocks and bushes they shot at the soldiers on the -skyline as if they were stalking deer," says Mr. Russell. There was -"continuous musketry fire, steady and fatal on the one side, wild and -ineffectual on the other." The Boers reached the top, and began to put in -their ruinous work. Presently the British "broke and fled for their -lives down the rugged steep." The Boers had won the battle. Result in -killed and wounded, including among the killed the British General: - - British loss, 226, out of 400 engaged. - - Boer loss, 1 killed, 5 wounded. - -That ended the war. England listened to reason, and recognized the Boer -Republic--a government which has never been in any really awful danger -since, until Jameson started after it with his 500 "raw young fellows." -To recapitulate: - -The Boer farmers and British soldiers fought 4 battles, and the Boers won -them all. Result of the 4, in killed and wounded: - - British loss, 700 men. - - Boer loss, so far as known, 23 men. - -It is interesting, now, to note how loyally Jameson and his several -trained British military officers tried to make their battles conform to -precedent. Mr. Garrett's account of the Raid is much the best one I have -met with, and my impressions of the Raid are drawn from that. - -When Jameson learned that near Krugersdorp he would find 800 Boers -waiting to dispute his passage, he was not in the least disturbed. He -was feeling as he had felt two or three days before, when he had opened -his campaign with a historic remark to the same purport as the one with -which the commander of the 94th had opened the Boer-British war of -fourteen years before. That Commander's remark was, that the Boers -"would turn tail at the first beat of the big drum." Jameson's was, that -with his "raw young fellows" he could kick the (persons) of the Boers -"all round the Transvaal." He was keeping close to historic precedent. - -Jameson arrived in the presence of the Boers. They--according to -precedent--were not visible. It was a country of ridges, depressions, -rocks, ditches, moraines of mining-tailings--not even as favorable for -cavalry work as Laing's Nek had been in the former disastrous days. -Jameson shot at the ridges and rocks with his artillery, just as General -Colley had done at the Nek; and did them no damage and persuaded no Boer -to show himself. Then about a hundred of his men formed up to charge the -ridge-according to the 58th's precedent at the Nek; but as they dashed -forward they opened out in a long line, which was a considerable -improvement on the 58th's tactics; when they had gotten to within 200 -yards of the ridge the concealed Boers opened out on them and emptied 20 -saddles. The unwounded dismounted and fired at the rocks over the backs -of their horses; but the return-fire was too hot, and they mounted again, -"and galloped back or crawled away into a clump of reeds for cover, where -they were shortly afterward taken prisoners as they lay among the reeds. -Some thirty prisoners were so taken, and during the night which followed -the Boers carried away another thirty killed and wounded--the wounded to -Krugersdorp hospital." Sixty per cent. of the assaulted force disposed -of--according to Mr. Garrett's estimate. - -It was according to Amajuba precedent, where the British loss was 226 out -of about 400 engaged. - -Also, in Jameson's camp, that night, "there lay about 30 wounded or -otherwise disabled" men. Also during the night "some 30 or 40 young -fellows got separated from the command and straggled through into -Johannesburg." Altogether a possible 150 men gone, out of his 530. His -lads had fought valorously, but had not been able to get near enough to a -Boer to kick him around the Transvaal. - -At dawn the next morning the column of something short of 400 whites -resumed its march. Jameson's grit was stubbornly good; indeed, it was -always that. He still had hopes. There was a long and tedious -zigzagging march through broken ground, with constant harassment from the -Boers; and at last the column "walked into a sort of trap," and the Boers -"closed in upon it." "Men and horses dropped on all sides. In the -column the feeling grew that unless it could burst through the Boer lines -at this point it was done for. The Maxims were fired until they grew too -hot, and, water failing for the cool jacket, five of them jammed and went -out of action. The 7-pounder was fired until only half an hour's -ammunition was left to fire with. One last rush was made, and failed, -and then the Staats Artillery came up on the left flank, and the game was -up." - -Jameson hoisted a white flag and surrendered. - -There is a story, which may not be true, about an ignorant Boer farmer -there who thought that this white flag was the national flag of England. -He had been at Bronkhorst, and Laing's Nek, and Ingogo and Amajuba, and -supposed that the English did not run up their flag excepting at the end -of a fight. - -The following is (as I understand it) Mr. Garrett's estimate of Jameson's -total loss in killed and wounded for the two days: - -"When they gave in they were minus some 20 per cent. of combatants. -There were 76 casualties. There were 30 men hurt or sick in the wagons. -There were 27 killed on the spot or mortally wounded." - -Total, 133, out of the original 530. It is just 25 per cent.--[However, -I judge that the total was really 150; for the number of wounded carried -to Krugersdorp hospital was 53; not 30, as Mr. Garrett reports it. The -lady whose guest I was in Krugerdorp gave me the figures. She was head -nurse from the beginning of hostilities (Jan. 1) until the professional -nurses arrived, Jan. 8th. Of the 53, "Three or four were Boers"; I quote -her words.]--This is a large improvement upon the precedents established -at Bronkhorst, Laing's Nek, Ingogo, and Amajuba, and seems to indicate -that Boer marksmanship is not so good now as it was in those days. But -there is one detail in which the Raid-episode exactly repeats history. -By surrender at Bronkhorst, the whole British force disappeared from the -theater of war; this was the case with Jameson's force. - -In the Boer loss, also, historical precedent is followed with sufficient -fidelity. In the 4 battles named above, the Boer loss, so far as known, -was an average of 6 men per battle, to the British average loss of 175. -In Jameson's battles, as per Boer official report, the Boer loss in -killed was 4. Two of these were killed by the Boers themselves, by -accident, the other by Jameson's army--one of them intentionally, the -other by a pathetic mischance. "A young Boer named Jacobz was moving -forward to give a drink to one of the wounded troopers (Jameson's) after -the first charge, when another wounded man, mistaking his intention; shot -him." There were three or four wounded Boers in the Krugersdorp -hospital, and apparently no others have been reported. Mr. Garrett, "on -a balance of probabilities, fully accepts the official version, and -thanks Heaven the killed was not larger." - -As a military man, I wish to point out what seems to me to be military -errors in the conduct of the campaign which we have just been -considering. I have seen active service in the field, and it was in the -actualities of war that I acquired my training and my right to speak. -I served two weeks in the beginning of our Civil War, and during all that -tune commanded a battery of infantry composed of twelve men. General -Grant knew the history of my campaign, for I told it him. I also told -him the principle upon which I had conducted it; which was, to tire the -enemy. I tired out and disqualified many battalions, yet never had a -casualty myself nor lost a man. General Grant was not given to paying -compliments, yet he said frankly that if I had conducted the whole war -much bloodshed would have been spared, and that what the army might have -lost through the inspiriting results of collision in the field would have -been amply made up by the liberalizing influences of travel. Further -endorsement does not seem to me to be necessary. - -Let us now examine history, and see what it teaches. In the 4 battles -fought in 1881 and the two fought by Jameson, the British loss in killed, -wounded, and prisoners, was substantially 1,300 men; the Boer loss, as -far as is ascertainable, eras about 30 men. These figures show that -there was a defect somewhere. It was not in the absence of courage. I -think it lay in the absence of discretion. The Briton should have done -one thing or the other: discarded British methods and fought the Boer -with Boer methods, or augmented his own force until--using British -methods--it should be large enough to equalize results with the Boer. - -To retain the British method requires certain things, determinable by -arithmetic. If, for argument's sake, we allow that the aggregate of -1,716 British soldiers engaged in the 4 early battles was opposed by the -same aggregate of Boers, we have this result: the British loss of 700 and -the Boer loss of 23 argues that in order to equalize results in future -battles you must make the British force thirty times as strong as the -Boer force. Mr. Garrett shows that the Boer force immediately opposed to -Jameson was 2,000, and that there were 6,000 more on hand by the evening -of the second day. Arithmetic shows that in order to make himself the -equal of the 8,000 Boers, Jameson should have had 240,000 men, whereas he -merely had 530 boys. From a military point of view, backed by the facts -of history, I conceive that Jameson's military judgment was at fault. - -Another thing.--Jameson was encumbered by artillery, ammunition, and -rifles. The facts of the battle show that he should have had none of -those things along. They were heavy, they were in his way, they impeded -his march. There was nothing to shoot at but rocks--he knew quite well -that there would be nothing to shoot at but rocks--and he knew that -artillery and rifles have no effect upon rocks. He was badly overloaded -with unessentials. He had 8 Maxims--a Maxim is a kind of Gatling, I -believe, and shoots about 500 bullets per minute; he had one -12 1/2-pounder cannon and two 7-pounders; also, 145,000 rounds of -ammunition. He worked the Maxims so hard upon the rocks that five of them -became disabled--five of the Maxims, not the rocks. It is believed that -upwards of 100,000 rounds of ammunition of the various kinds were fired -during the 21 hours that the battles lasted. One man killed. He must -have been much mutilated. It was a pity to bring those futile Maxims -along. Jameson should have furnished himself with a battery of Pudd'nhead -Wilson maxims instead, They are much more deadly than those others, and -they are easily carried, because they have no weight. - -Mr. Garrett--not very carefully concealing a smile--excuses the presence -of the Maxims by saying that they were of very substantial use because -their sputtering disordered the aim of the Boers, and in that way saved -lives. - -Three cannon, eight Maxims, and five hundred rifles yielded a result -which emphasized a fact which had already been established--that the -British system of standing out in the open to fight Boers who are behind -rocks is not wise, not excusable, and ought to be abandoned for something -more efficacious. For the purpose of war is to kill, not merely to waste -ammunition. - -If I could get the management of one of those campaigns, I would know -what to do, for I have studied the Boer. He values the Bible above every -other thing. The most delicious edible in South Africa is "biltong." -You will have seen it mentioned in Olive Schreiner's books. It is what -our plainsmen call "jerked beef." It is the Boer's main standby. He has -a passion for it, and he is right. - -If I had the command of the campaign I would go with rifles only, no -cumbersome Maxims and cannon to spoil good rocks with. I would move -surreptitiously by night to a point about a quarter of a mile from the -Boer camp, and there I would build up a pyramid of biltong and Bibles -fifty feet high, and then conceal my men all about. In the morning the -Boers would send out spies, and then the rest would come with a rush. -I would surround them, and they would have to fight my men on equal -terms, in the open. There wouldn't be any Amajuba results. - ---[Just as I am finishing this book an unfortunate dispute has sprung up -between Dr. Jameson and his officers, on the one hand, and Colonel Rhodes -on the other, concerning the wording of a note which Colonel Rhodes sent -from Johannesburg by a cyclist to Jameson just before hostilities began -on the memorable New Year's Day. Some of the fragments of this note were -found on the battlefield after the fight, and these have been pieced -together; the dispute is as to what words the lacking fragments -contained. Jameson says the note promised him a reinforcement of 300 men -from Johannesburg. Colonel Rhodes denies this, and says he merely -promised to send out "some" men "to meet you."] - -[It seems a pity that these friends should fall out over so little a -thing. If the 300 had been sent, what good would it have done? In 21 -hours of industrious fighting, Jameson's 530 men, with 8 Maxims, 3 -cannon, and 145,000 rounds of ammunition, killed an aggregate of 1. -Boer. These statistics show that a reinforcement of 300 Johannesburgers, -armed merely with muskets, would have killed, at the outside, only a -little over a half of another Boer. This would not have saved the day. -It would not even have seriously affected the general result. The -figures show clearly, and with mathematical violence, that the only way -to save Jameson, or even give him a fair and equal chance with the enemy, -was for Johannesburg to send him 240 Maxims, 90 cannon, 600 carloads of -ammunition, and 240,000 men. Johannesburg was not in a position to do -this. Johannesburg has been called very hard names for not reinforcing -Jameson. But in every instance this has been done by two classes of -persons--people who do not read history, and people, like Jameson, who do -not understand what it means, after they have read it.] - - - - -CHAPTER LXVIII. - -None of us can have as many virtues as the fountain-pen, or half its -cussedness; but we can try. - --Pudd'nhead Wilson's New Calendar. - -The Duke of Fife has borne testimony that Mr. Rhodes deceived him. That -is also what Mr. Rhodes did with the Reformers. He got them into -trouble, and then stayed out himself. A judicious man. He has always -been that. As to this there was a moment of doubt, once. It was when he -was out on his last pirating expedition in the Matabele country. The -cable shouted out that he had gone unarmed, to visit a party of hostile -chiefs. It was true, too; and this dare-devil thing came near fetching -another indiscretion out of the poet laureate. It would have been too -bad, for when the facts were all in, it turned out that there was a lady -along, too, and she also was unarmed. - -In the opinion of many people Mr. Rhodes is South Africa; others think he -is only a large part of it. These latter consider that South Africa -consists of Table Mountain, the diamond mines, the Johannesburg gold -fields, and Cecil Rhodes. The gold fields are wonderful in every way. -In seven or eight years they built up, in a desert, a city of a hundred -thousand inhabitants, counting white and black together; and not the -ordinary mining city of wooden shanties, but a city made out of lasting -material. Nowhere in the world is there such a concentration of rich -mines as at Johannesburg. Mr. Bonamici, my manager there, gave me a -small gold brick with some statistics engraved upon it which record the -output of gold from the early days to July, 1895, and exhibit the strides -which have been made in the development of the industry; in 1888 the -output was $4,162,440; the output of the next five and a half years was -(total: $17,585,894); for the single year ending with June, 1895, it was -$45,553,700. - -The capital which has developed the mines came from England, the mining -engineers from America. This is the case with the diamond mines also. -South Africa seems to be the heaven of the American scientific mining -engineer. He gets the choicest places, and keeps them. His salary is -not based upon what he would get in America, but apparently upon what a -whole family of him would get there. - -The successful mines pay great dividends, yet the rock is not rich, from -a Californian point of view. Rock which yields ten or twelve dollars a -ton is considered plenty rich enough. It is troubled with base metals to -such a degree that twenty years ago it would have been only about half as -valuable as it is now; for at that time there was no paying way of -getting anything out of such rock but the coarser-grained "free" gold; but -the new cyanide process has changed all that, and the gold fields of the -world now deliver up fifty million dollars' worth of gold per year which -would have gone into the tailing-pile under the former conditions. - -The cyanide process was new to me, and full of interest; and among the -costly and elaborate mining machinery there were fine things which were -new to me, but I was already familiar with the rest of the details of the -gold-mining industry. I had been a gold miner myself, in my day, and -knew substantially everything that those people knew about it, except how -to make money at it. But I learned a good deal about the Boers there, -and that was a fresh subject. What I heard there was afterwards repeated -to me in other parts of South Africa. Summed up--according to the -information thus gained--this is the Boer: - -He is deeply religious, profoundly ignorant, dull, obstinate, bigoted, -uncleanly in his habits, hospitable, honest in his dealings with the -whites, a hard master to his black servant, lazy, a good shot, good -horseman, addicted to the chase, a lover of political independence, a -good husband and father, not fond of herding together in towns, but -liking the seclusion and remoteness and solitude and empty vastness and -silence of the veldt; a man of a mighty appetite, and not delicate about -what he appeases it with--well-satisfied with pork and Indian corn and -biltong, requiring only that the quantity shall not be stinted; willing -to ride a long journey to take a hand in a rude all-night dance -interspersed with vigorous feeding and boisterous jollity, but ready to -ride twice as far for a prayer-meeting; proud of his Dutch and Huguenot -origin and its religious and military history; proud of his race's -achievements in South Africa, its bold plunges into hostile and uncharted -deserts in search of free solitudes unvexed by the pestering and detested -English, also its victories over the natives and the British; proudest of -all, of the direct and effusive personal interest which the Deity has -always taken in its affairs. He cannot read, he cannot write; he has one -or two newspapers, but he is, apparently, not aware of it; until latterly -he had no schools, and taught his children nothing, news is a term which -has no meaning to him, and the thing itself he cares nothing about. He -hates to be taxed and resents it. He has stood stock still in South -Africa for two centuries and a half, and would like to stand still till -the end of time, for he has no sympathy with Uitlander notions of -progress. He is hungry to be rich, for he is human; but his preference -has been for riches in cattle, not in fine clothes and fine houses and -gold and diamonds. The gold and the diamonds have brought the godless -stranger within his gates, also contamination and broken repose, and he -wishes that they had never been discovered. - -I think that the bulk of those details can be found in Olive Schreiner's -books, and she would not be accused of sketching the Boer's portrait with -an unfair hand. - -Now what would you expect from that unpromising material? What ought you -to expect from it? Laws inimical to religious liberty? Yes. Laws -denying, representation and suffrage to the intruder? Yes. Laws -unfriendly to educational institutions? Yes. Laws obstructive of gold -production? Yes. Discouragement of railway expansion? Yes. Laws heavily -taxing the intruder and overlooking the Boer? Yes. - -The Uitlander seems to have expected something very different from all -that. I do not know why. Nothing different from it was rationally to be -expected. A round man cannot be expected to fit a square hole right -away. He must have time to modify his shape. The modification had begun -in a detail or two, before the Raid, and was making some progress. It -has made further progress since. There are wise men in the Boer -government, and that accounts for the modification; the modification of -the Boer mass has probably not begun yet. If the heads of the Boer -government had not been wise men they would have hanged Jameson, and thus -turned a very commonplace pirate into a holy martyr. But even their -wisdom has its limits, and they will hang Mr. Rhodes if they ever catch -him. That will round him and complete him and make him a saint. He has -already been called by all other titles that symbolize human grandeur, -and he ought to rise to this one, the grandest of all. It will be a -dizzy jump from where he is now, but that is nothing, it will land him in -good company and be a pleasant change for him. - -Some of the things demanded by the Johannesburgers' Manifesto have been -conceded since the days of the Raid, and the others will follow in time, -no doubt. It was most fortunate for the miners of Johannesburg that the -taxes which distressed them so much were levied by the Boer government, -instead of by their friend Rhodes and his Chartered Company of -highwaymen, for these latter take half of whatever their mining victims -find, they do not stop at a mere percentage. If the Johannesburg miners -were under their jurisdiction they would be in the poorhouse in twelve -months. - -I have been under the impression all along that I had an unpleasant -paragraph about the Boers somewhere in my notebook, and also a pleasant -one. I have found them now. The unpleasant one is dated at an interior -village, and says-- - -"Mr. Z. called. He is an English Afrikander; is an old resident, and has -a Boer wife. He speaks the language, and his professional business is -with the Boers exclusively. He told me that the ancient Boer families in -the great region of which this village is the commercial center are -falling victims to their inherited indolence and dullness in the -materialistic latter-day race and struggle, and are dropping one by one -into the grip of the usurer--getting hopelessly in debt--and are losing -their high place and retiring to second and lower. The Boer's farm does -not go to another Boer when he loses it, but to a foreigner. Some have -fallen so low that they sell their daughters to the blacks." - -Under date of another South African town I find the note which is -creditable to the Boers: - -"Dr. X. told me that in the Kafir war 1,500 Kafirs took refuge in a great -cave in the mountains about 90 miles north of Johannesburg, and the Boers -blocked up the entrance and smoked them to death. Dr. X. has been in -there and seen the great array of bleached skeletons--one a woman with -the skeleton of a child hugged to her breast." - -The great bulk of the savages must go. The white man wants their lands, -and all must go excepting such percentage of them as he will need to do -his work for him upon terms to be determined by himself. Since history -has removed the element of guesswork from this matter and made it -certainty, the humanest way of diminishing the black population should be -adopted, not the old cruel ways of the past. Mr. Rhodes and his gang -have been following the old ways.--They are chartered to rob and slay, -and they lawfully do it, but not in a compassionate and Christian spirit. -They rob the Mashonas and the Matabeles of a portion of their territories -in the hallowed old style of "purchase!" for a song, and then they force -a quarrel and take the rest by the strong hand. They rob the natives of -their cattle under the pretext that all the cattle in the country -belonged to the king whom they have tricked and assassinated. They issue -"regulations" requiring the incensed and harassed natives to work for the -white settlers, and neglect their own affairs to do it. This is slavery, -and is several times worse than was the American slavery which used to -pain England so much; for when this Rhodesian slave is sick, -super-annuated, or otherwise disabled, he must support himself -or starve--his master is under no obligation to support him. - -The reduction of the population by Rhodesian methods to the desired limit -is a return to the old-time slow-misery and lingering-death system of a -discredited time and a crude "civilization." We humanely reduce an -overplus of dogs by swift chloroform; the Boer humanely reduced an -overplus of blacks by swift suffocation; the nameless but right-hearted -Australian pioneer humanely reduced his overplus of aboriginal neighbors -by a sweetened swift death concealed in a poisoned pudding. All these -are admirable, and worthy of praise; you and I would rather suffer either -of these deaths thirty times over in thirty successive days than linger -out one of the Rhodesian twenty-year deaths, with its daily burden of -insult, humiliation, and forced labor for a man whose entire race the -victim hates. Rhodesia is a happy name for that land of piracy and -pillage, and puts the right stain upon it. - -Several long journeys--gave us experience of the Cape Colony railways; -easy-riding, fine cars; all the conveniences; thorough cleanliness; -comfortable beds furnished for the night trains. It was in the first -days of June, and winter; the daytime was pleasant, the nighttime nice -and cold. Spinning along all day in the cars it was ecstasy to breathe -the bracing air and gaze out over the vast brown solitudes of the velvet -plains, soft and lovely near by, still softer and lovelier further away, -softest and loveliest of all in the remote distances, where dim -island-hills seemed afloat, as in a sea--a sea made of dream-stuff and -flushed with colors faint and rich; and dear me, the depth of the sky, -and the beauty of the strange new cloud-forms, and the glory of the -sunshine, the lavishness, the wastefulness of it! The vigor and -freshness and inspiration of the air and the sunwell, it was all -just as Olive Schreiner had made it in her books. - -To me the veldt, in its sober winter garb, was surpassingly beautiful. -There were unlevel stretches where it was rolling and swelling, and -rising and subsiding, and sweeping superbly on and on, and still on and -on like an ocean, toward the faraway horizon, its pale brown deepening by -delicately graduated shades to rich orange, and finally to purple and -crimson where it washed against the wooded hills and naked red crags at -the base of the sky. - -Everywhere, from Cape Town to Kimberley and from Kimberley to Port -Elizabeth and East London, the towns were well populated with tamed -blacks; tamed and Christianized too, I suppose, for they wore the dowdy -clothes of our Christian civilization. But for that, many of them would -have been remarkably handsome. These fiendish clothes, together with the -proper lounging gait, good-natured face, happy air, and easy laugh, made -them precise counterparts of our American blacks; often where all the -other aspects were strikingly and harmoniously and thrillingly African, a -flock of these natives would intrude, looking wholly out of place, and -spoil it all, making the thing a grating discord, half African and half -American. - -One Sunday in King William's Town a score of colored women came mincing -across the great barren square dressed--oh, in the last perfection of -fashion, and newness, and expensiveness, and showy mixture of unrelated -colors,--all just as I had seen it so often at home; and in their faces -and their gait was that languishing, aristocratic, divine delight in -their finery which was so familiar to me, and had always been such a -satisfaction to my eye and my heart. I seemed among old, old friends; -friends of fifty years, and I stopped and cordially greeted them. They -broke into a good-fellowship laugh, flashing their white teeth upon me, -and all answered at once. I did not understand a word they said. I was -astonished; I was not dreaming that they would answer in anything but -American. - -The voices, too, of the African women, were familiar to me sweet and -musical, just like those of the slave women of my early days. I followed -a couple of them all over the Orange Free State--no, over its capital ---Bloemfontein, to hear their liquid voices and the happy ripple of their -laughter. Their language was a large improvement upon American. Also -upon the Zulu. It had no Zulu clicks in it; and it seemed to have no -angles or corners, no roughness, no vile s's or other hissing sounds, but -was very, very mellow and rounded and flowing. - -In moving about the country in the trains, I had opportunity to see a -good many Boers of the veldt. One day at a village station a hundred of -them got out of the third-class cars to feed. - -Their clothes were very interesting. For ugliness of shapes, and for -miracles of ugly colors inharmoniously associated, they were a record. -The effect was nearly as exciting and interesting as that produced by the -brilliant and beautiful clothes and perfect taste always on view at the -Indian railway stations. One man had corduroy trousers of a faded -chewing gum tint. And they were new--showing that this tint did not come -by calamity, but was intentional; the very ugliest color I have ever -seen. A gaunt, shackly country lout six feet high, in battered gray -slouched hat with wide brim, and old resin-colored breeches, had on a -hideous brand-new woolen coat which was imitation tiger skin wavy broad -stripes of dazzling yellow and deep brown. I thought he ought to be -hanged, and asked the station-master if it could be arranged. He said -no; and not only that, but said it rudely; said it with a quite -unnecessary show of feeling. Then he muttered something about my being a -jackass, and walked away and pointed me out to people, and did everything -he could to turn public sentiment against me. It is what one gets for -trying to do good. - -In the train that day a passenger told me some more about Boer life out -in the lonely veldt. He said the Boer gets up early and sets his -"niggers" at their tasks (pasturing the cattle, and watching them); eats, -smokes, drowses, sleeps; toward evening superintends the milking, etc.; -eats, smokes, drowses; goes to bed at early candlelight in the fragrant -clothes he (and she) have worn all day and every week-day for years. I -remember that last detail, in Olive Schreiner's "Story of an African -Farm." And the passenger told me that the Boers were justly noted for -their hospitality. He told me a story about it. He said that his grace -the Bishop of a certain See was once making a business-progress through -the tavernless veldt, and one night he stopped with a Boer; after supper -was shown to bed; he undressed, weary and worn out, and was soon sound -asleep; in the night he woke up feeling crowded and suffocated, and found -the old Boer and his fat wife in bed with him, one on each side, with all -their clothes on, and snoring. He had to stay there and stand it--awake -and suffering--until toward dawn, when sleep again fell upon him for an -hour. Then he woke again. The Boer was gone, but the wife was still at -his side. - -Those Reformers detested that Boer prison; they were not used to cramped -quarters and tedious hours, and weary idleness, and early to bed, and -limited movement, and arbitrary and irritating rules, and the absence of -the luxuries which wealth comforts the day and the night with. The -confinement told upon their bodies and their spirits; still, they were -superior men, and they made the best that was to be made of the -circumstances. Their wives smuggled delicacies to them, which helped to -smooth the way down for the prison fare. - -In the train Mr. B. told me that the Boer jail-guards treated the black -prisoners--even political ones--mercilessly. An African chief and his -following had been kept there nine months without trial, and during all -that time they had been without shelter from rain and sun. He said that -one day the guards put a big black in the stocks for dashing his soup on -the ground; they stretched his legs painfully wide apart, and set him -with his back down hill; he could not endure it, and put back his hands -upon the slope for a support. The guard ordered him to withdraw the -support and kicked him in the back. "Then," said Mr. B., "'the powerful -black wrenched the stocks asunder and went for the guard; a Reform -prisoner pulled him off, and thrashed the guard himself." - - - - -CHAPTER LXIX. - -The very ink with which all history is written is merely fluid prejudice. - --Pudd'nhead Wilsons's New Calendar. - -There isn't a Parallel of Latitude but thinks it would have been the -Equator if it had had its rights. - --Pudd'nhead Wilson's New Calendar. - -Next to Mr. Rhodes, to me the most interesting convulsion of nature in -South Africa was the diamond-crater. The Rand gold fields are a -stupendous marvel, and they make all other gold fields small, but I was -not a stranger to gold-mining; the veldt was a noble thing to see, but it -was only another and lovelier variety of our Great Plains; the natives -were very far from being uninteresting, but they were not new; and as for -the towns, I could find my way without a guide through the most of them -because I had learned the streets, under other names, in towns just like -them in other lands; but the diamond mine was a wholly fresh thing, a -splendid and absorbing novelty. Very few people in the world have seen -the diamond in its home. It has but three or four homes in the world, -whereas gold has a million. It is worth while to journey around the -globe to see anything which can truthfully be called a novelty, and the -diamond mine is the greatest and most select and restricted novelty which -the globe has in stock. - -The Kimberley diamond deposits were discovered about 1869, I think. When -everything is taken into consideration, the wonder is that they were not -discovered five thousand years ago and made familiar to the African world -for the rest of time. For this reason the first diamonds were found on -the surface of the ground. They were smooth and limpid, and in the -sunlight they vomited fire. They were the very things which an African -savage of any era would value above every other thing in the world -excepting a glass bead. For two or three centuries we have been buying -his lands, his cattle, his neighbor, and any other thing he had for sale, -for glass beads and so it is strange that he was indifferent to the -diamonds--for he must have pickets them up many and many a time. It -would not occur to him to try to sell them to whites, of course, since -the whites already had plenty of glass beads, and more fashionably -shaped, too, than these; but one would think that the poorer sort of -black, who could not afford real glass, would have been humbly content to -decorate himself with the imitation, and that presently the white trader -would notice the things, and dimly suspect, and carry some of them home, -and find out what they were, and at once empty a multitude of -fortune-hunters into Africa. There are many strange things in human -history; one of the strangest is that the sparkling diamonds laid there -so long without exciting any one's interest. - -The revelation came at last by accident. In a Boer's hut out in the wide -solitude of the plains, a traveling stranger noticed a child playing with -a bright object, and was told it was a piece of glass which had been -found in the veldt. The stranger bought it for a trifle and carried it -away; and being without honor, made another stranger believe it was a -diamond, and so got $125 out of him for it, and was as pleased with -himself as if he had done a righteous thing. In Paris the wronged -stranger sold it to a pawnshop for $10,000, who sold it to a countess for -$90,000, who sold it to a brewer for $800;000, who traded it to a king -for a dukedom and a pedigree, and the king "put it up the spout." ---[handwritten note: "From the Greek meaning 'pawned it.'" M.T.]--I know -these particulars to be correct. - -The news flew around, and the South African diamond-boom began. The -original traveler--the dishonest one--now remembered that he had once -seen a Boer teamster chocking his wagon-wheel on a steep grade with a -diamond as large as a football, and he laid aside his occupations and -started out to hunt for it, but not with the intention of cheating -anybody out of $125 with it, for he had reformed. - -We now come to matters more didactic. Diamonds are not imbedded in rock -ledges fifty miles long, like the Johannesburg gold, but are distributed -through the rubbish of a filled-up well, so to speak. The well is rich, -its walls are sharply defined; outside of the walls are no diamonds. The -well is a crater, and a large one. Before it had been meddled with, its -surface was even with the level plain, and there was no sign to suggest -that it was there. The pasturage covering the surface of the Kimberley -crater was sufficient for the support of a cow, and the pasturage -underneath was sufficient for the support of a kingdom; but the cow did -not know it, and lost her chance. - -The Kimberley crater is roomy enough to admit the Roman Coliseum; the -bottom of the crater has not been reached, and no one can tell how far -down in the bowels of the earth it goes. Originally, it was a -perpendicular hole packed solidly full of blue rock or cement, and -scattered through that blue mass, like raisins in a pudding, were the -diamonds. As deep down in the earth as the blue stuff extends, so deep -will the diamonds be found. - -There are three or four other celebrated craters near by a circle three -miles in diameter would enclose them all. They are owned by the De Beers -Company, a consolidation of diamond properties arranged by Mr. Rhodes -twelve or fourteen years ago. The De Beers owns other craters; they are -under the grass, but the De Beers knows where they are, and will open -them some day, if the market should require it. - -Originally, the diamond deposits were the property of the Orange Free -State; but a judicious "rectification" of the boundary line shifted them -over into the British territory of Cape Colony. A high official of the -Free State told me that the sum of $4,00,000 was handed to his -commonwealth as a compromise, or indemnity, or something of the sort, and -that he thought his commonwealth did wisely to take the money and keep -out of a dispute, since the power was all on the one side and the -weakness all on the other. The De Beers Company dig out $400,000 worth -of diamonds per week, now. The Cape got the territory, but no profit; -for Mr. Rhodes and the Rothschilds and the other De Beers people own the -mines, and they pay no taxes. - -In our day the mines are worked upon scientific principles, under the -guidance of the ablest mining-engineering talent procurable in America. -There are elaborate works for reducing the blue rock and passing it -through one process after another until every diamond it contains has -been hunted down and secured. I watched the "concentrators" at work big -tanks containing mud and water and invisible diamonds--and was told that -each could stir and churn and properly treat 300 car-loads of mud per day -1,600 pounds to the car-load--and reduce it to 3 car-loads of slush. I -saw the 3 carloads of slush taken to the "pulsators" and there reduced to -quarter of a load of nice clean dark-colored sand. Then I followed it to -the sorting tables and saw the men deftly and swiftly spread it out and -brush it about and seize the diamonds as they showed up. I assisted, and -once I found a diamond half as large as an almond. It is an exciting -kind of fishing, and you feel a fine thrill of pleasure every time you -detect the glow of one of those limpid pebbles through the veil of dark -sand. I would like to spend my Saturday holidays in that charming sport -every now and then. Of course there are disappointments. Sometimes you -find a diamond which is not a diamond; it is only a quartz crystal or -some such worthless thing. The expert can generally distinguish it from -the precious stone which it is counterfeiting; but if he is in doubt he -lays it on a flatiron and hits it with a sledgehammer. If it is a -diamond it holds its own; if it is anything else, it is reduced to -powder. I liked that experiment very much, and did not tire of -repetitions of it. It was full of enjoyable apprehensions, unmarred by -any personal sense of risk. The De Beers concern treats 8;000 carloads ---about 6,000 tons--of blue rock per day, and the result is three pounds of -diamonds. Value, uncut, $50,000 to $70,000. After cutting, they will -weigh considerably less than a pound, but will be worth four or five -times as much as they were before. - -All the plain around that region is spread over, a foot deep, with blue -rock, placed there by the Company, and looks like a plowed field. -Exposure for a length of time make the rock easier to work than it is -when it comes out of the mine. If mining should cease now, the supply of -rock spread over those fields would furnish the usual 8,000 car-loads per -day to the separating works during three years. The fields are fenced -and watched; and at night they are under the constant inspection of lofty -electric searchlight. They contain fifty or sixty million dollars' -worth' of diamonds, and there is an abundance of enterprising thieves -around. - -In the dirt of the Kimberley streets there is much hidden wealth. Some -time ago the people were granted the privilege of a free wash-up. There -was a general rush, the work was done with thoroughness, and a good -harvest of diamonds was gathered. - -The deep mining is done by natives. There are many hundreds of them. -They live in quarters built around the inside of a great compound. They -are a jolly and good-natured lot, and accommodating. They performed a -war-dance for us, which was the wildest exhibition I have ever seen. -They are not allowed outside of the compound during their term of service -three months, I think it, is, as a rule. They go down the shaft, stand -their watch, come up again, are searched, and go to bed or to their -amusements in the compound; and this routine they repeat, day in and day -out. - -It is thought that they do not now steal many diamonds successfully. -They used to swallow them, and find other ways of concealing them, but -the white man found ways of beating their various games. One man cut his -leg and shoved a diamond into the wound, but even that project did not -succeed. When they find a fine large diamond they are more likely to -report it than to steal it, for in the former case they get a reward, and -in the latter they are quite apt to merely get into trouble. Some years -ago, in a mine not owned by the De Beers, a black found what has been -claimed to be the largest diamond known to the world's history; and, as a -reward he was released from service and given a blanket, a horse, and -five hundred dollars. It made him a Vanderbilt. He could buy four -wives, and have money left. Four wives are an ample support for a -native. With four wives he is wholly independent, and need never do a -stroke of work again. - -That great diamond weighs 97l carats. Some say it is as big as a piece -of alum, others say it is as large as a bite of rock candy, but the best -authorities agree that it is almost exactly the size of a chunk of ice. -But those details are not important; and in my opinion not trustworthy. -It has a flaw in it, otherwise it would be of incredible value. As it -is, it is held to be worth $2,000,000. After cutting it ought to be -worth from $5,000,000 to $8,000,000, therefore persons desiring to save -money should buy it now. It is owned by a syndicate, and apparently -there is no satisfactory market for it. It is earning nothing; it is -eating its head off. Up to this time it has made nobody rich but the -native who found it. - -He found it in a mine which was being worked by contract. That is to -say, a company had bought the privilege of taking from the mine 5,000,000 -carloads of blue-rock, for a sum down and a royalty. Their speculation -had not paid; but on the very day that their privilege ran out that -native found the $2,000,000-diamond and handed it over to them. Even the -diamond culture is not without its romantic episodes. - -The Koh-i-Noor is a large diamond, and valuable; but it cannot compete in -these matters with three which--according to legend--are among the crown -trinkets of Portugal and Russia. One of these is held to be worth -$20,000,000; another, $25,000,000, and the third something over -$28,000,000. - -Those are truly wonderful diamonds, whether they exist or not; and yet -they are of but little importance by comparison with the one wherewith -the Boer wagoner chocked his wheel on that steep grade as heretofore -referred to. In Kimberley I had some conversation with the man who saw -the Boer do that--an incident which had occurred twenty-seven or -twenty-eight years before I had my talk with him. He assured me that -that diamond's value could have been over a billion dollars, but not -under it. I believed him, because he had devoted twenty-seven years to -hunting for it, and was, in a position to know. - -A fitting and interesting finish to an examination of the tedious and -laborious and costly processes whereby the diamonds are gotten out of the -deeps of the earth and freed from the base stuffs which imprison them is -the visit to the De Beers offices in the town of Kimberley, where the -result of each day's mining is brought every day, and, weighed, assorted, -valued, and deposited in safes against shipping-day. An unknown and -unaccredited person cannot, get into that place; and it seemed apparent -from the generous supply of warning and protective and prohibitory signs -that were posted all about, that not even the known and accredited can -steal diamonds there without inconvenience. - -We saw the day's output--shining little nests of diamonds, distributed a -foot apart, along a counter, each nest reposing upon a sheet of white -paper. That day's catch was about $70,000 worth. In the course of a -year half a ton of diamonds pass under the scales there and sleep on that -counter; the resulting money is $18,000,000 or $20,000,000. Profit, -about $12,000,000. - -Young girls were doing the sorting--a nice, clean, dainty, and probably -distressing employment. Every day ducal incomes sift and sparkle through -the fingers of those young girls; yet they go to bed at night as poor as -they were when they got up in the morning. The same thing next day, and -all the days. - -They are beautiful things, those diamonds, in their native state. They -are of various shapes; they have flat surfaces, rounded borders, and -never a sharp edge. They are of all colors and shades of color, from -dewdrop white to actual black; and their smooth and rounded surfaces and -contours, variety of color, and transparent limpidity make them look like -piles of assorted candies. A very light straw color is their commonest -tint. It seemed to me that these uncut gems must be more beautiful than -any cut ones could be; but when a collection of cut ones was brought out, -I saw my mistake. Nothing is so beautiful as a rose diamond with the -light playing through it, except that uncostly thing which is just like -it--wavy sea-water with the sunlight playing through it and striking a -white-sand bottom. - -Before the middle of July we reached Cape Town, and the end of our -African journeyings. And well satisfied; for, towering above us was -Table Mountain--a reminder that we had now seen each and all of the great -features of South Africa except Mr. Cecil Rhodes. I realize that that is -a large exception. I know quite well that whether Mr. Rhodes is the -lofty and worshipful patriot and statesman that multitudes believe him to -be, or Satan come again, as the rest of the world account him, he is -still the most imposing figure in the British empire outside of England. -When he stands on the Cape of Good Hope, his shadow falls to the Zambesi. -He is the only colonial in the British dominions whose goings and comings -are chronicled and discussed under all the globe's meridians, and whose -speeches, unclipped, are cabled from the ends of the earth; and he is the -only unroyal outsider whose arrival in London can compete for attention -with an eclipse. - -That he is an extraordinary man, and not an accident of fortune, not even -his dearest South African enemies were willing to deny, so far as I heard -them testify. The whole South African world seemed to stand in a kind of -shuddering awe of him, friend and enemy alike. It was as if he were -deputy-God on the one side, deputy-Satan on the other, proprietor of the -people, able to make them or ruin them by his breath, worshiped by many, -hated by many, but blasphemed by none among the judicious, and even by -the indiscreet in guarded whispers only. - -What is the secret of his formidable supremacy? One says it is his -prodigious wealth--a wealth whose drippings in salaries and in other ways -support multitudes and make them his interested and loyal vassals; -another says it is his personal magnetism and his persuasive tongue, and -that these hypnotize and make happy slaves of all that drift within the -circle of their influence; another says it is his majestic ideas, his -vast schemes for the territorial aggrandizement of England, his patriotic -and unselfish ambition to spread her beneficent protection and her just -rule over the pagan wastes of Africa and make luminous the African -darkness with the glory of her name; and another says he wants the earth -and wants it for his own, and that the belief that he will get it and let -his friends in on the ground floor is the secret that rivets so many eyes -upon him and keeps him in the zenith where the view is unobstructed. - -One may take his choice. They are all the same price. One fact is sure: -he keeps his prominence and a vast following, no matter what he does. He -"deceives" the Duke of Fife--it is the Duke's word--but that does not -destroy the Duke's loyalty to him. He tricks the Reformers into immense -trouble with his Raid, but the most of them believe he meant well. He -weeps over the harshly--taxed Johannesburgers and makes them his friends; -at the same time he taxes his Charter-settlers 50 per cent., and so wins -their affection and their confidence that they are squelched with despair -at every rumor that the Charter is to be annulled. He raids and robs and -slays and enslaves the Matabele and gets worlds of Charter-Christian -applause for it. He has beguiled England into buying Charter waste paper -for Bank of England notes, ton for ton, and the ravished still burn -incense to him as the Eventual God of Plenty. He has done everything he -could think of to pull himself down to the ground; he has done more than -enough to pull sixteen common-run great men down; yet there he stands, to -this day, upon his dizzy summit under the dome of the sky, an apparent -permanency, the marvel of the time, the mystery of the age, an Archangel -with wings to half the world, Satan with a tail to the other half. - -I admire him, I frankly confess it; and when his time comes I shall buy a -piece of the rope for a keepsake. - - - - -CONCLUSION. - -I have traveled more than anyone else, and I have noticed that even the -angels speak English with an accent. - --Pudd'nhead Wilson's New Calendar. - -I saw Table Rock, anyway--a majestic pile. It is 3,000 feet high. It is -also 17,000 feet high. These figures may be relied upon. I got them in -Cape Town from the two best-informed citizens, men who had made Table -Rock the study of their lives. And I saw Table Bay, so named for its -levelness. I saw the Castle--built by the Dutch East India Company three -hundred years ago--where the Commanding General lives; I saw St. Simon's -Bay, where the Admiral lives. I saw the Government, also the Parliament, -where they quarreled in two languages when I was there, and agreed in -none. I saw the club. I saw and explored the beautiful sea-girt drives -that wind about the mountains and through the paradise where the villas -are: Also I saw some of the fine old Dutch mansions, pleasant homes of -the early times, pleasant homes to-day, and enjoyed the privilege of -their hospitalities. - -And just before I sailed I saw in one of them a quaint old picture which -was a link in a curious romance--a picture of a pale, intellectual young -man in a pink coat with a high black collar. It was a portrait of Dr. -James Barry, a military surgeon who came out to the Cape fifty years ago -with his regiment. He was a wild young fellow, and was guilty of various -kinds of misbehavior. He was several times reported to headquarters in -England, and it was in each case expected that orders would come out to -deal with him promptly and severely, but for some mysterious reason no -orders of any kind ever came back--nothing came but just an impressive -silence. This made him an imposing and uncanny wonder to the town. - -Next, he was promoted-away up. He was made Medical Superintendent -General, and transferred to India. Presently he was back at the Cape -again and at his escapades once more. There were plenty of pretty girls, -but none of them caught him, none of them could get hold of his heart; -evidently he was not a marrying man. And that was another marvel, -another puzzle, and made no end of perplexed talk. Once he was called in -the night, an obstetric service, to do what he could for a woman who was -believed to be dying. He was prompt and scientific, and saved both -mother and child. There are other instances of record which testify to -his mastership of his profession; and many which testify to his love of -it and his devotion to it. Among other adventures of his was a duel of a -desperate sort, fought with swords, at the Castle. He killed his man. - -The child heretofore mentioned as having been saved by Dr. Barry so long -ago, was named for him, and still lives in Cape Town. He had Dr. -Barry's portrait painted, and gave it to the gentleman in whose old Dutch -house I saw it--the quaint figure in pink coat and high black collar. - -The story seems to be arriving nowhere. But that is because I have not -finished. Dr. Barry died in Cape Town 30 years ago. It was then -discovered that he was a woman. - -The legend goes that enquiries--soon silenced--developed the fact that -she was a daughter of a great English house, and that that was why her -Cape wildnesses brought no punishment and got no notice when reported to -the government at home. Her name was an alias. She had disgraced -herself with her people; so she chose to change her name and her sex and -take a new start in the world. - -We sailed on the 15th of July in the Norman, a beautiful ship, perfectly -appointed. The voyage to England occupied a short fortnight, without a -stop except at Madeira. A good and restful voyage for tired people, and -there were several of us. I seemed to have been lecturing a thousand -years, though it was only a twelvemonth, and a considerable number of the -others were Reformers who were fagged out with their five months of -seclusion in the Pretoria prison. - -Our trip around the earth ended at the Southampton pier, where we -embarked thirteen months before. It seemed a fine and large thing to -have accomplished--the circumnavigation of this great globe in that -little time, and I was privately proud of it. For a moment. -Then came one of those vanity-snubbing astronomical reports from the -Observatory-people, whereby it appeared that another great body of light -had lately flamed up in the remotenesses of space which was traveling at -a gait which would enable it to do all that I had done in a minute and a -half. Human pride is not worth while; there is always something lying in -wait to take the wind out of it. - - - - - -End of the Project Gutenberg EBook of Following the Equator, Complete -by Mark Twain (Samuel Clemens) - -*** END OF THIS PROJECT GUTENBERG EBOOK FOLLOWING THE EQUATOR, COMPLETE *** - -***** This file should be named 2895.txt or 2895.zip ***** -This and all associated files of various formats will be found in: - http://www.gutenberg.net/2/8/9/2895/ - -Produced by David Widger - -Updated editions will replace the previous one--the old editions -will be renamed. - -Creating the works from public domain print editions means that no -one owns a United States copyright in these works, so the Foundation -(and you!) can copy and distribute it in the United States without -permission and without paying copyright royalties. Special rules, -set forth in the General Terms of Use part of this license, apply to -copying and distributing Project Gutenberg-tm electronic works to -protect the PROJECT GUTENBERG-tm concept and trademark. Project -Gutenberg is a registered trademark, and may not be used if you -charge for the eBooks, unless you receive specific permission. If you -do not charge anything for copies of this eBook, complying with the -rules is very easy. You may use this eBook for nearly any purpose -such as creation of derivative works, reports, performances and -research. They may be modified and printed and given away--you may do -practically ANYTHING with public domain eBooks. Redistribution is -subject to the trademark license, especially commercial -redistribution. - - - -*** START: FULL LICENSE *** - -THE FULL PROJECT GUTENBERG LICENSE -PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK - -To protect the Project Gutenberg-tm mission of promoting the free -distribution of electronic works, by using or distributing this work -(or any other work associated in any way with the phrase "Project -Gutenberg"), you agree to comply with all the terms of the Full Project -Gutenberg-tm License (available with this file or online at -http://gutenberg.net/license). - - -Section 1. General Terms of Use and Redistributing Project Gutenberg-tm -electronic works - -1.A. By reading or using any part of this Project Gutenberg-tm -electronic work, you indicate that you have read, understand, agree to -and accept all the terms of this license and intellectual property -(trademark/copyright) agreement. If you do not agree to abide by all -the terms of this agreement, you must cease using and return or destroy -all copies of Project Gutenberg-tm electronic works in your possession. -If you paid a fee for obtaining a copy of or access to a Project -Gutenberg-tm electronic work and you do not agree to be bound by the -terms of this agreement, you may obtain a refund from the person or -entity to whom you paid the fee as set forth in paragraph 1.E.8. - -1.B. "Project Gutenberg" is a registered trademark. It may only be -used on or associated in any way with an electronic work by people who -agree to be bound by the terms of this agreement. There are a few -things that you can do with most Project Gutenberg-tm electronic works -even without complying with the full terms of this agreement. See -paragraph 1.C below. There are a lot of things you can do with Project -Gutenberg-tm electronic works if you follow the terms of this agreement -and help preserve free future access to Project Gutenberg-tm electronic -works. See paragraph 1.E below. - -1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" -or PGLAF), owns a compilation copyright in the collection of Project -Gutenberg-tm electronic works. Nearly all the individual works in the -collection are in the public domain in the United States. If an -individual work is in the public domain in the United States and you are -located in the United States, we do not claim a right to prevent you from -copying, distributing, performing, displaying or creating derivative -works based on the work as long as all references to Project Gutenberg -are removed. Of course, we hope that you will support the Project -Gutenberg-tm mission of promoting free access to electronic works by -freely sharing Project Gutenberg-tm works in compliance with the terms of -this agreement for keeping the Project Gutenberg-tm name associated with -the work. You can easily comply with the terms of this agreement by -keeping this work in the same format with its attached full Project -Gutenberg-tm License when you share it without charge with others. - -1.D. The copyright laws of the place where you are located also govern -what you can do with this work. Copyright laws in most countries are in -a constant state of change. If you are outside the United States, check -the laws of your country in addition to the terms of this agreement -before downloading, copying, displaying, performing, distributing or -creating derivative works based on this work or any other Project -Gutenberg-tm work. The Foundation makes no representations concerning -the copyright status of any work in any country outside the United -States. - -1.E. Unless you have removed all references to Project Gutenberg: - -1.E.1. The following sentence, with active links to, or other immediate -access to, the full Project Gutenberg-tm License must appear prominently -whenever any copy of a Project Gutenberg-tm work (any work on which the -phrase "Project Gutenberg" appears, or with which the phrase "Project -Gutenberg" is associated) is accessed, displayed, performed, viewed, -copied or distributed: - -This eBook is for the use of anyone anywhere at no cost and with -almost no restrictions whatsoever. You may copy it, give it away or -re-use it under the terms of the Project Gutenberg License included -with this eBook or online at www.gutenberg.net - -1.E.2. If an individual Project Gutenberg-tm electronic work is derived -from the public domain (does not contain a notice indicating that it is -posted with permission of the copyright holder), the work can be copied -and distributed to anyone in the United States without paying any fees -or charges. If you are redistributing or providing access to a work -with the phrase "Project Gutenberg" associated with or appearing on the -work, you must comply either with the requirements of paragraphs 1.E.1 -through 1.E.7 or obtain permission for the use of the work and the -Project Gutenberg-tm trademark as set forth in paragraphs 1.E.8 or -1.E.9. - -1.E.3. If an individual Project Gutenberg-tm electronic work is posted -with the permission of the copyright holder, your use and distribution -must comply with both paragraphs 1.E.1 through 1.E.7 and any additional -terms imposed by the copyright holder. Additional terms will be linked -to the Project Gutenberg-tm License for all works posted with the -permission of the copyright holder found at the beginning of this work. - -1.E.4. Do not unlink or detach or remove the full Project Gutenberg-tm -License terms from this work, or any files containing a part of this -work or any other work associated with Project Gutenberg-tm. - -1.E.5. Do not copy, display, perform, distribute or redistribute this -electronic work, or any part of this electronic work, without -prominently displaying the sentence set forth in paragraph 1.E.1 with -active links or immediate access to the full terms of the Project -Gutenberg-tm License. - -1.E.6. You may convert to and distribute this work in any binary, -compressed, marked up, nonproprietary or proprietary form, including any -word processing or hypertext form. However, if you provide access to or -distribute copies of a Project Gutenberg-tm work in a format other than -"Plain Vanilla ASCII" or other format used in the official version -posted on the official Project Gutenberg-tm web site (www.gutenberg.net), -you must, at no additional cost, fee or expense to the user, provide a -copy, a means of exporting a copy, or a means of obtaining a copy upon -request, of the work in its original "Plain Vanilla ASCII" or other -form. Any alternate format must include the full Project Gutenberg-tm -License as specified in paragraph 1.E.1. - -1.E.7. Do not charge a fee for access to, viewing, displaying, -performing, copying or distributing any Project Gutenberg-tm works -unless you comply with paragraph 1.E.8 or 1.E.9. - -1.E.8. You may charge a reasonable fee for copies of or providing -access to or distributing Project Gutenberg-tm electronic works provided -that - -- You pay a royalty fee of 20% of the gross profits you derive from - the use of Project Gutenberg-tm works calculated using the method - you already use to calculate your applicable taxes. The fee is - owed to the owner of the Project Gutenberg-tm trademark, but he - has agreed to donate royalties under this paragraph to the - Project Gutenberg Literary Archive Foundation. Royalty payments - must be paid within 60 days following each date on which you - prepare (or are legally required to prepare) your periodic tax - returns. Royalty payments should be clearly marked as such and - sent to the Project Gutenberg Literary Archive Foundation at the - address specified in Section 4, "Information about donations to - the Project Gutenberg Literary Archive Foundation." - -- You provide a full refund of any money paid by a user who notifies - you in writing (or by e-mail) within 30 days of receipt that s/he - does not agree to the terms of the full Project Gutenberg-tm - License. You must require such a user to return or - destroy all copies of the works possessed in a physical medium - and discontinue all use of and all access to other copies of - Project Gutenberg-tm works. - -- You provide, in accordance with paragraph 1.F.3, a full refund of any - money paid for a work or a replacement copy, if a defect in the - electronic work is discovered and reported to you within 90 days - of receipt of the work. - -- You comply with all other terms of this agreement for free - distribution of Project Gutenberg-tm works. - -1.E.9. If you wish to charge a fee or distribute a Project Gutenberg-tm -electronic work or group of works on different terms than are set -forth in this agreement, you must obtain permission in writing from -both the Project Gutenberg Literary Archive Foundation and Michael -Hart, the owner of the Project Gutenberg-tm trademark. Contact the -Foundation as set forth in Section 3 below. - -1.F. - -1.F.1. Project Gutenberg volunteers and employees expend considerable -effort to identify, do copyright research on, transcribe and proofread -public domain works in creating the Project Gutenberg-tm -collection. Despite these efforts, Project Gutenberg-tm electronic -works, and the medium on which they may be stored, may contain -"Defects," such as, but not limited to, incomplete, inaccurate or -corrupt data, transcription errors, a copyright or other intellectual -property infringement, a defective or damaged disk or other medium, a -computer virus, or computer codes that damage or cannot be read by -your equipment. - -1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the "Right -of Replacement or Refund" described in paragraph 1.F.3, the Project -Gutenberg Literary Archive Foundation, the owner of the Project -Gutenberg-tm trademark, and any other party distributing a Project -Gutenberg-tm electronic work under this agreement, disclaim all -liability to you for damages, costs and expenses, including legal -fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT -LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE -PROVIDED IN PARAGRAPH F3. YOU AGREE THAT THE FOUNDATION, THE -TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE -LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR -INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH -DAMAGE. - -1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a -defect in this electronic work within 90 days of receiving it, you can -receive a refund of the money (if any) you paid for it by sending a -written explanation to the person you received the work from. If you -received the work on a physical medium, you must return the medium with -your written explanation. The person or entity that provided you with -the defective work may elect to provide a replacement copy in lieu of a -refund. If you received the work electronically, the person or entity -providing it to you may choose to give you a second opportunity to -receive the work electronically in lieu of a refund. If the second copy -is also defective, you may demand a refund in writing without further -opportunities to fix the problem. - -1.F.4. Except for the limited right of replacement or refund set forth -in paragraph 1.F.3, this work is provided to you 'AS-IS' WITH NO OTHER -WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO -WARRANTIES OF MERCHANTIBILITY OR FITNESS FOR ANY PURPOSE. - -1.F.5. Some states do not allow disclaimers of certain implied -warranties or the exclusion or limitation of certain types of damages. -If any disclaimer or limitation set forth in this agreement violates the -law of the state applicable to this agreement, the agreement shall be -interpreted to make the maximum disclaimer or limitation permitted by -the applicable state law. The invalidity or unenforceability of any -provision of this agreement shall not void the remaining provisions. - -1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the -trademark owner, any agent or employee of the Foundation, anyone -providing copies of Project Gutenberg-tm electronic works in accordance -with this agreement, and any volunteers associated with the production, -promotion and distribution of Project Gutenberg-tm electronic works, -harmless from all liability, costs and expenses, including legal fees, -that arise directly or indirectly from any of the following which you do -or cause to occur: (a) distribution of this or any Project Gutenberg-tm -work, (b) alteration, modification, or additions or deletions to any -Project Gutenberg-tm work, and (c) any Defect you cause. - - -Section 2. Information about the Mission of Project Gutenberg-tm - -Project Gutenberg-tm is synonymous with the free distribution of -electronic works in formats readable by the widest variety of computers -including obsolete, old, middle-aged and new computers. It exists -because of the efforts of hundreds of volunteers and donations from -people in all walks of life. - -Volunteers and financial support to provide volunteers with the -assistance they need, is critical to reaching Project Gutenberg-tm's -goals and ensuring that the Project Gutenberg-tm collection will -remain freely available for generations to come. In 2001, the Project -Gutenberg Literary Archive Foundation was created to provide a secure -and permanent future for Project Gutenberg-tm and future generations. -To learn more about the Project Gutenberg Literary Archive Foundation -and how your efforts and donations can help, see Sections 3 and 4 -and the Foundation web page at http://www.pglaf.org. - - -Section 3. Information about the Project Gutenberg Literary Archive -Foundation - -The Project Gutenberg Literary Archive Foundation is a non profit -501(c)(3) educational corporation organized under the laws of the -state of Mississippi and granted tax exempt status by the Internal -Revenue Service. The Foundation's EIN or federal tax identification -number is 64-6221541. Its 501(c)(3) letter is posted at -http://pglaf.org/fundraising. Contributions to the Project Gutenberg -Literary Archive Foundation are tax deductible to the full extent -permitted by U.S. federal laws and your state's laws. - -The Foundation's principal office is located at 4557 Melan Dr. S. -Fairbanks, AK, 99712., but its volunteers and employees are scattered -throughout numerous locations. Its business office is located at -809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887, email -business@pglaf.org. Email contact links and up to date contact -information can be found at the Foundation's web site and official -page at http://pglaf.org - -For additional contact information: - Dr. Gregory B. Newby - Chief Executive and Director - gbnewby@pglaf.org - - -Section 4. Information about Donations to the Project Gutenberg -Literary Archive Foundation - -Project Gutenberg-tm depends upon and cannot survive without wide -spread public support and donations to carry out its mission of -increasing the number of public domain and licensed works that can be -freely distributed in machine readable form accessible by the widest -array of equipment including outdated equipment. Many small donations -($1 to $5,000) are particularly important to maintaining tax exempt -status with the IRS. - -The Foundation is committed to complying with the laws regulating -charities and charitable donations in all 50 states of the United -States. Compliance requirements are not uniform and it takes a -considerable effort, much paperwork and many fees to meet and keep up -with these requirements. We do not solicit donations in locations -where we have not received written confirmation of compliance. To -SEND DONATIONS or determine the status of compliance for any -particular state visit http://pglaf.org - -While we cannot and do not solicit contributions from states where we -have not met the solicitation requirements, we know of no prohibition -against accepting unsolicited donations from donors in such states who -approach us with offers to donate. - -International donations are gratefully accepted, but we cannot make -any statements concerning tax treatment of donations received from -outside the United States. U.S. laws alone swamp our small staff. - -Please check the Project Gutenberg Web pages for current donation -methods and addresses. Donations are accepted in a number of other -ways including including checks, online payments and credit card -donations. To donate, please visit: http://pglaf.org/donate - - -Section 5. General Information About Project Gutenberg-tm electronic -works. - -Professor Michael S. Hart is the originator of the Project Gutenberg-tm -concept of a library of electronic works that could be freely shared -with anyone. For thirty years, he produced and distributed Project -Gutenberg-tm eBooks with only a loose network of volunteer support. - - -Project Gutenberg-tm eBooks are often created from several printed -editions, all of which are confirmed as Public Domain in the U.S. -unless a copyright notice is included. Thus, we do not necessarily -keep eBooks in compliance with any particular paper edition. - - -Most people start at our Web site which has the main PG search facility: - - http://www.gutenberg.net - -This Web site includes information about Project Gutenberg-tm, -including how to make donations to the Project Gutenberg Literary -Archive Foundation, how to help produce our new eBooks, and how to -subscribe to our email newsletter to hear about new eBooks. diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_01/Ex_01.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_02/Ex_02.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde deleted file mode 100755 index bd49f80c9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/Ex_03.pde +++ /dev/null @@ -1,17 +0,0 @@ -// Requires the OverRect and OverCircle classes -OverRect r = new OverRect(9, 30, 36); -OverCircle c = new OverCircle(72, 48, 40); - -void setup() { - size(100, 100); - noStroke(); - smooth(); -} - -void draw() { - background(204); - r.update(mouseX, mouseY); - r.display(); - c.update(mouseX, mouseY); - c.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverCircle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_03/OverRect.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde deleted file mode 100755 index b033ad3e9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/Ex_04.pde +++ /dev/null @@ -1,11 +0,0 @@ -void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - if (gray < 250) { - gray++; - } - } else { - if (gray > 0.0) { - gray--; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde deleted file mode 100755 index d5370e0f7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverCircle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverCircle { - int x, y; // The x- and y-coordinates - int diameter; // Diameter of the circle - int gray; // Gray value - - OverCircle(int xp, int yp, int d) { - x = xp; - y = yp; - diameter = d; - gray = 0; - } - - void update(int mx, int my) { - if (dist(mx, my, x, y) < diameter / 2) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - ellipse(x, y, diameter, diameter); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde deleted file mode 100755 index b90c455ed..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_04/OverRect.pde +++ /dev/null @@ -1,25 +0,0 @@ -class OverRect { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) of the rectangle - int gray; // Gray value - - OverRect(int xp, int yp, int s) { - x = xp; - y = yp; - size = s; - gray = 0; - } - - void update(int mx, int my) { - if ((mx > x) && (mx < x + size) && (my > y) && (my < y + size)) { - gray = 255; - } else { - gray = 0; - } - } - - void display() { - fill(gray); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_05/Ex_05.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Button.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde deleted file mode 100755 index e9b58b505..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_06/Ex_06.pde +++ /dev/null @@ -1,24 +0,0 @@ -Button button; - -void setup() { - size(100, 100); -// Inputs: x, y, size, -// base color, over color, press color - button = new Button(25, 25, 50, - color(204), color(255), color(0)); -} - -void draw() { - background(204); - stroke(255); - button.update(); - button.display(); -} - -void mousePressed() { - button.press(); -} - -void mouseReleased() { - button.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde deleted file mode 100755 index d5c5b63ce..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Button.pde +++ /dev/null @@ -1,53 +0,0 @@ -class Button { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - color overGray; // Value when mouse is over the button - color pressGray; // Value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean pressed = false; // True when the mouse is over and pressed - - Button(int xp, int yp, int s, color b, color o, color p) { - x = xp; - y = yp; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update() { - if ((mouseX >= x) && (mouseX <= x + size) && - (mouseY >= y) && (mouseY <= y + size)) { - over = true; - } else { - over = false; - } - } - - boolean press() { - if (over == true) { - pressed = true; - return true; - } else { - return false; - } - } - - void release() { - pressed = false; // Set to false when the mouse is released - } - - void display() { - if (pressed == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde deleted file mode 100755 index c7d0c4371..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_07/Ex_07.pde +++ /dev/null @@ -1,55 +0,0 @@ -// Requires the Button class -Button button1, button2, button3; -int mode = 1; - -void setup() { - size(100, 100); - smooth(); - color gray = color(204); - color white = color(255); - color black = color(0); - button1 = new Button(10, 80, 10, gray, white, black); - button2 = new Button(25, 80, 10, gray, white, black); - button3 = new Button(40, 80, 10, gray, white, black); -} - -void draw() { - background(204); - manageButtons(); - noStroke(); - fill(0); - if (mode == 1) { - ellipse(0, 40, 60, 60); - } else if (mode == 2) { - ellipse(50, 40, 60, 60); - } else if (mode == 3) { - ellipse(100, 40, 60, 60); - } -} - -void manageButtons() { - button1.update(); - button2.update(); - button3.update(); - button1.display(); - button2.display(); - button3.display(); -} - -void mousePressed() { - if (button1.press() == true) { - mode = 1; - } - if (button2.press() == true) { - mode = 2; - } - if (button3.press() == true) { - mode = 3; - } -} - -void mouseReleased() { - button1.release(); - button2.release(); - button3.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_08/Ex_08.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Check.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde deleted file mode 100755 index 54b9f1d44..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_09/Ex_09.pde +++ /dev/null @@ -1,16 +0,0 @@ -Check check; - -void setup() { - size(100, 100); -// Inputs: x, y, size, fill color - check = new Check(25, 25, 50, color(0)); -} - -void draw() { - background(204); - check.display(); -} - -void mousePressed() { - check.press(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde deleted file mode 100755 index d0d2217b8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Check.pde +++ /dev/null @@ -1,31 +0,0 @@ -class Check { - int x, y; // The x- and y-coordinates - int size; // Dimension (width and height) - color baseGray; // Default gray value - boolean checked = false; // True when the check box is selected - - Check(int xp, int yp, int s, color b) { - x = xp; - y = yp; - size = s; - baseGray = b; - } - - // Updates the boolean variable checked - void press(float mx, float my) { - if ((mx >= x) && (mx <= x + size) && (my >= y) && (my <= y + size)) { - checked = !checked; // Toggle the check box on and off - } - } - - // Draws the box and an X inside if the checked variable is true - void display() { - stroke(255); - fill(baseGray); - rect(x, y, size, size); - if (checked == true) { - line(x, y, x + size, y + size); - line(x + size, y, x, y + size); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde deleted file mode 100755 index 6b20c3db2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_10/Ex_10.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Requires the Check class -int numChecks = 25; -Check[] checks = new Check[numChecks]; - - -void setup() { - size(100, 100); - int x = 14; - int y = 14; - for (int i = 0; i < numChecks; i++) { - checks[i] = new Check(x, y, 12, color(0)); - x += 15; - if (x > 80) { - x = 14; - y += 15; - } - } -} - -void draw() { - background(0); - for (int i = 0; i < numChecks; i++) { - checks[i].display(); - } -} - -void mousePressed() { - for (int i = 0; i < numChecks; i++) { - checks[i].press(mouseX, mouseY); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_11/Ex_11.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde deleted file mode 100755 index d39a30d50..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Ex_12.pde +++ /dev/null @@ -1,23 +0,0 @@ -Radio[] buttons = new Radio[2]; - -void setup() { - size(100, 100); - smooth(); -// Inputs: x, y, size, base color, fill color, -// id number, array of others - buttons[0] = new Radio(33, 50, 30, color(255), color(0), - 0, buttons); - buttons[1] = new Radio(66, 50, 30, color(255), color(0), - 1, buttons); -} - -void draw() { - background(204); - buttons[0].display(); - buttons[1].display(); -} - -void mousePressed() { - buttons[0].press(mouseX, mouseY); - buttons[1].press(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_12/Radio.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde deleted file mode 100755 index 64151526c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Ex_13.pde +++ /dev/null @@ -1,25 +0,0 @@ -int numButtons = 7; -Radio[] buttons = new Radio[numButtons]; - -void setup() { - size(100, 100); - smooth(); - for (int i = 0; i < buttons.length; i++) { - int x = i * 12 + 14; - buttons[i] = new Radio(x, 50, 10, color(255), color(0), - i, buttons); - } -} - -void draw() { - background(204); - for (int i = 0; i < buttons.length; i++) { - buttons[i].display(); - } -} - -void mousePressed() { - for (int i = 0; i < buttons.length; i++) { - buttons[i].press(mouseX, mouseY); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde deleted file mode 100755 index 7c37a79e8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_13/Radio.pde +++ /dev/null @@ -1,46 +0,0 @@ -class Radio { - int x, y; // The x- and y-coordinates of the rect - int size, dotSize; // Dimension of circle, inner circle - color baseGray, dotGray; // Circle gray value, inner gray value - boolean checked = false; // True when the button is selected - int me; // ID number for this Radio object - Radio[] others; // Array of all other Radio objects - - Radio(int xp, int yp, int s, color b, color d, int m, Radio[] o) { - x = xp; - y = yp; - size = s; - dotSize = size - size / 3; - ; - baseGray = b; - dotGray = d; - others = o; - me = m; - } - - // Updates the boolean value press, returns true or false - boolean press(float mx, float my) { - if (dist(x, y, mx, my) < size / 2) { - checked = true; - for (int i = 0; i < others.length; i++) { - if (i != me) { - others[i].checked = false; - } - } - return true; - } else { - return false; - } - } - - // Draws the element to the display window - void display() { - noStroke(); - fill(baseGray); - ellipse(x, y, size, size); - if (checked == true) { - fill(dotGray); - ellipse(x, y, dotSize, dotSize); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_14/Ex_14.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde deleted file mode 100755 index 506f8003e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Ex_15.pde +++ /dev/null @@ -1,36 +0,0 @@ -Scrollbar bar1, bar2; -PFont font; - -void setup() { - size(100, 100); - noStroke(); -// Inputs: x, y, width, height, minVal, maxVal - bar1 = new Scrollbar(10, 35, 80, 10, 0.0, 100.0); - bar2 = new Scrollbar(10, 55, 80, 10, 0.0, 1.0); - font = loadFont("Courier-30.vlw"); - textFont(font); - textAlign(CENTER); -} - -void draw() { - background(204); - fill(0); - int pos1 = int(bar1.getPos()); - text(nf(pos1, 2), 50, 30); - float pos2 = bar2.getPos(); - text(nf(pos2, 1, 2), 50, 90); - bar1.update(mouseX, mouseY); - bar2.update(mouseX, mouseY); - bar1.display(); - bar2.display(); -} - -void mousePressed() { - bar1.press(mouseX, mouseY); - bar2.press(mouseX, mouseY); -} - -void mouseReleased() { - bar1.release(); - bar2.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/Scrollbar.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw deleted file mode 100755 index 8c0fb84a6..000000000 Binary files a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_15/data/Courier-30.vlw and /dev/null differ diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde deleted file mode 100755 index b1d14bc6a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Ex_16.pde +++ /dev/null @@ -1,27 +0,0 @@ -// Requires Scrollbar Class -Scrollbar bar; -PImage img; - -void setup() { - size(100, 100); - noStroke(); -// Inputs: x, y, width, height, minVal, maxVal - bar = new Scrollbar(10, 45, 80, 10, -200.0, 0.0); - img = loadImage("landscape.jpg"); -} - -void draw() { - background(204); - int x = int(bar.getPos()); - image(img, x, 0); - bar.update(mouseX, mouseY); - bar.display(); -} - -void mousePressed() { - bar.press(mouseX, mouseY); -} - -void mouseReleased() { - bar.release(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde b/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde deleted file mode 100755 index e2b87d7e5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/47 Input 7/Ex_16/Scrollbar.pde +++ /dev/null @@ -1,75 +0,0 @@ -class Scrollbar { - int x, y; // The x- and y-coordinates - float sw, sh; // Width and height of scrollbar - float pos; // Position of thumb - float posMin, posMax; // Max and min values of thumb - boolean rollover; // True when the mouse is over - boolean locked; // True when its the active scrollbar - float minVal, maxVal; // Min and max values for the thumb - Scrollbar(int xp, int yp, int w, int h, float miv, float mav) { - x = xp; - y = yp; - sw = w; - sh = h; - minVal = miv; - maxVal = mav; - pos = x + sw / 2 - sh / 2; - posMin = x; - posMax = x + sw - sh; - } - - // Updates the over boolean and the position of the thumb - void update(int mx, int my) { - if (over(mx, my) == true) { - rollover = true; - } else { - rollover = false; - } - if (locked == true) { - pos = constrain(mx - sh / 2, posMin, posMax); - } - } - - // Locks the thumb so the mouse can move off and still update - void press(int mx, int my) { - if (rollover == true) { - locked = true; - } else { - locked = false; - } - } - - // Resets the scrollbar to neutral - void release() { - locked = false; - } - - // Returns true if the cursor is over the scrollbar - boolean over(int mx, int my) { - if ((mx > x) && (mx < x + sw) && (my > y) && (my < y + sh)) { - return true; - } else { - return false; - } - } - - // Draws the scrollbar to the screen - void display() { - fill(255); - rect(x, y, sw, sh); - if ((rollover == true) || (locked == true)) { - fill(0); - } else { - fill(102); - } - rect(pos, y, sh, sh); - } - - // Returns the current value of the thumb - float getPos() { - float scalar = sw / (sw - sh); - float ratio = (pos - x) * scalar; - float offset = minVal + (ratio / sw * (maxVal - minVal)); - return offset; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde deleted file mode 100755 index 7aa9ca990..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_01/Ex_01.pde +++ /dev/null @@ -1,37 +0,0 @@ -Spot sp1, sp2; - -void setup() { - size(100, 100); - smooth(); - noLoop(); -// Run the constructore without parameters - sp1 = new Spot(); -// Run the constructor with three parameters - sp2 = new Spot(66, 50, 20); -} - -void draw() { - sp1.display(); - sp2.display(); -} - -class Spot { - float x, y, radius; -// First version of the Spot constructor, -// the fields are assigned default values - Spot() { - x = 33; - y = 50; - radius = 8; - } -// Second version of the Spot constructor, -// the fields are assigned with parameters - Spot(float xpos, float ypos, float r) { - x = xpos; - y = ypos; - radius = r; - } - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Egg.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde deleted file mode 100755 index b4ebd4ce0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ex_02.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Requires Egg and Ring classes (codes 43-08 and 43-11) -class EggRing { - Egg ovoid; - Ring circle = new Ring(); - - EggRing(int x, int y, float t, float sp) { - ovoid = new Egg(x, y, t, sp); - circle.start(x, y - sp / 2); - } - - void transmit() { - ovoid.wobble(); - ovoid.display(); - circle.grow(); - circle.display(); - if (circle.on == false) { - circle.on = true; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_02/Ring.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde deleted file mode 100755 index dac8bfe21..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Egg.pde +++ /dev/null @@ -1,36 +0,0 @@ -class Egg { - float x, y; // X-coordinate, y-coordinate - float tilt; // Left and right angle offset - float angle; // Used to define the tilt - float scalar; // Height of the egg - - // Constructor - Egg(int xpos, int ypos, float t, float s) { - x = xpos; - y = ypos; - tilt = t; - scalar = s / 100.0; - } - - void wobble() { - tilt = cos(angle) / 8; - angle += 0.1; - } - - void display() { - noStroke(); - fill(255); - pushMatrix(); - translate(x, y); - rotate(tilt); - scale(scalar); - beginShape(); - vertex(0, -100); - bezierVertex(25, -100, 40, -65, 40, -40); - bezierVertex(40, -15, 25, 0, 0, 0); - bezierVertex(-25, 0, -40, -15, -40, -40); - bezierVertex(-40, -65, -25, -100, 0, -100); - endShape(); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde deleted file mode 100755 index b4ebd4ce0..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/EggRing.pde +++ /dev/null @@ -1,20 +0,0 @@ -// Requires Egg and Ring classes (codes 43-08 and 43-11) -class EggRing { - Egg ovoid; - Ring circle = new Ring(); - - EggRing(int x, int y, float t, float sp) { - ovoid = new Egg(x, y, t, sp); - circle.start(x, y - sp / 2); - } - - void transmit() { - ovoid.wobble(); - ovoid.display(); - circle.grow(); - circle.display(); - if (circle.on == false) { - circle.on = true; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde deleted file mode 100755 index 77fc3e022..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ex_03.pde +++ /dev/null @@ -1,14 +0,0 @@ -EggRing er1, er2; - -void setup() { - size(100, 100); - smooth(); - er1 = new EggRing(33, 66, 0.1, 33); - er2 = new EggRing(66, 90, 0.05, 66); -} - -void draw() { - background(0); - er1.transmit(); - er2.transmit(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde deleted file mode 100755 index 47a8b20bc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_03/Ring.pde +++ /dev/null @@ -1,30 +0,0 @@ -class Ring { - float x, y; // X-coordinate, y-coordinate - float diameter; // Diameter of the ring - boolean on = false; // Turns the display on and off - - void start(float xpos, float ypos) { - x = xpos; - y = ypos; - on = true; - diameter = 1; - } - - void grow() { - if (on == true) { - diameter += 0.5; - if (diameter > 400) { - on = false; - } - } - } - - void display() { - if (on == true) { - noFill(); - strokeWeight(4); - stroke(15, 153); - ellipse(x, y, diameter, diameter); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_04/Ex_04.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde deleted file mode 100755 index a2c2a6f40..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Ex_05.pde +++ /dev/null @@ -1,16 +0,0 @@ -class SpinArm extends Spin { - SpinArm(float x, float y, float s) { - super(x, y, s); - } - - void display() { - strokeWeight(1); - stroke(0); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - line(0, 0, 100, 0); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_05/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde deleted file mode 100755 index 4055a3f6e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Ex_06.pde +++ /dev/null @@ -1,19 +0,0 @@ -class SpinSpots extends Spin { - float dim; - - SpinSpots(float x, float y, float s, float d) { - super(x, y, s); - dim = d; - } - - void display() { - noStroke(); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - ellipse(-dim / 2, 0, dim, dim); - ellipse(dim / 2, 0, dim, dim); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_06/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde deleted file mode 100755 index fc32e6e34..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Ex_07.pde +++ /dev/null @@ -1,17 +0,0 @@ -SpinSpots spots; -SpinArm arm; - -void setup() { - size(100, 100); - smooth(); - arm = new SpinArm(width / 2, height / 2, 0.01); - spots = new SpinSpots(width / 2, height / 2, -0.02, 33.0); -} - -void draw() { - background(204); - arm.update(); - arm.display(); - spots.update(); - spots.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde deleted file mode 100755 index d30394fad..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/Spin.pde +++ /dev/null @@ -1,15 +0,0 @@ -class Spin { - float x, y, speed; - float angle = 0.0; - - Spin(float xpos, float ypos, float s) { - x = xpos; - y = ypos; - speed = s; - } - - void update() { - angle += speed; - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde deleted file mode 100755 index a2c2a6f40..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinArm.pde +++ /dev/null @@ -1,16 +0,0 @@ -class SpinArm extends Spin { - SpinArm(float x, float y, float s) { - super(x, y, s); - } - - void display() { - strokeWeight(1); - stroke(0); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - line(0, 0, 100, 0); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde deleted file mode 100755 index 4055a3f6e..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_07/SpinSpots.pde +++ /dev/null @@ -1,19 +0,0 @@ -class SpinSpots extends Spin { - float dim; - - SpinSpots(float x, float y, float s, float d) { - super(x, y, s); - dim = d; - } - - void display() { - noStroke(); - pushMatrix(); - translate(x, y); - angle += speed; - rotate(angle); - ellipse(-dim / 2, 0, dim, dim); - ellipse(dim / 2, 0, dim, dim); - popMatrix(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_08/Ex_08.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/DragButton.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde deleted file mode 100755 index 92a7791b2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_09/Ex_09.pde +++ /dev/null @@ -1,28 +0,0 @@ -DragButton icon; - -void setup() { - size(100, 100); - smooth(); - color gray = color(204); - color white = color(255); - color black = color(0); - icon = new DragButton(21, 42, 50, gray, white, black); -} - -void draw() { - background(204); - icon.update(mouseX, mouseY); - icon.display(); -} - -void mousePressed() { - icon.press(mouseX, mouseY); -} - -void mouseReleased() { - icon.release(); -} - -void mouseDragged() { - icon.drag(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde deleted file mode 100755 index c798487eb..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Button.pde +++ /dev/null @@ -1,59 +0,0 @@ -class Button { - int x, y; // x-coordinate, y-coordinate of the rectangle - int size; // Dimension (width and height) of the rectangle - color baseGray; // Default gray value - color overGray; // Gray value when mouse is over the button - color pressGray; // Gray value when mouse is over and pressed - boolean over = false; // True when the mouse is over - boolean press = false; // True when the mouse is over and pressed - - Button(int xpos, int ypos, int s, color b, color o, color p) { - x = xpos; - y = ypos; - size = s; - baseGray = b; - overGray = o; - pressGray = p; - } - - // Updates the over field every frame - void update(int mx, int my) { - if ((mx >= x) && (mx <= x+size) && - (my >= y) && (my <= y+size)) { - over = true; - } - else { - over = false; - } - } - - // Updates the press boolean when mouse is pressed - boolean press() { - if (over == true) { - press = true; - return true; - } - else { - return false; - } - } - - // Sets the press boolean to false when mouse is released - void release() { - press = false; - } - - // Draws the button - void display() { - if (press == true) { - fill(pressGray); - } else if (over == true) { - fill(overGray); - } else { - fill(baseGray); - } - stroke(255); - rect(x, y, size, size); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde deleted file mode 100755 index 99e26e5e3..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/DragButton.pde +++ /dev/null @@ -1,20 +0,0 @@ -class DragButton extends Button { - int xoff, yoff; - - DragButton(int x, int y, int s, color bv, color ov, color pv) { - super(x, y, s, bv, ov, pv); - } - - void press(int mx, int my) { - super.press(); - xoff = mx - x; - yoff = my - y; - } - - void drag(int mx, int my) { - if (press == true) { - x = mx - xoff; - y = my - yoff; - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde deleted file mode 100755 index 9e9e016f2..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/48 Structure 5/Ex_10/Ex_10.pde +++ /dev/null @@ -1,22 +0,0 @@ -class DragImage extends DragButton { - PImage img; - - DragImage(int x, int y, int d, String s) { - super(x, y, d, color(204), color(255), color(0)); - img = loadImage(s); - } - - // Override the display() from Button - void display() { - if (press == true) { - stroke(pressGray); - } else if (over == true) { - stroke(overGray); - } else { - stroke(baseGray); - } - noFill(); - rect(x - 1, y - 1, size + 1, size + 1); - image(img, x, y, size, size); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde deleted file mode 100755 index 5667cefe1..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_01/Ex_01.pde +++ /dev/null @@ -1,57 +0,0 @@ -int[] rules = { 0, 0, 0, 1, 1, 1, 1, 0 }; -int gen = 1; // Generation -color on = color(255); -color off = color(0); - -void setup() { - size(101, 101); - frameRate(8); // Slow down to 8 frames each second - background(0); - set(width / 2, 0, on); // Set the top, middle pixel to white -} - -void draw() { -// For each pixel, determine new state by examining current -// state and neighbor states and ignore edges that have only -// one neighbor - for (int i = 1; i < width - 1; i++) { - int left = get(i - 1, gen - 1); // Left neighbor - int me = get(i, gen - 1); // Current pixel - int right = get(i + 1, gen - 1); // Right neighbor - if (rules(left, me, right) == 1) { - set(i, gen, on); - } - } - gen++; // Increment the generation by 1 - if (gen > height - 1) { // If reached the bottom of the screen, - noLoop(); // stop the program - } -} -// Implement the rules -int rules(color a, color b, color c) { - if ((a == on) && (b == on) && (c == on)) { - return rules[0]; - } - if ((a == on) && (b == on) && (c == off)) { - return rules[1]; - } - if ((a == on) && (b == off) && (c == on)) { - return rules[2]; - } - if ((a == on) && (b == off) && (c == off)) { - return rules[3]; - } - if ((a == off) && (b == on) && (c == on)) { - return rules[4]; - } - if ((a == off) && (b == on) && (c == off)) { - return rules[5]; - } - if ((a == off) && (b == off) && (c == on)) { - return rules[6]; - } - if ((a == off) && (b == off) && (c == off)) { - return rules[7]; - } - return 0; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde deleted file mode 100755 index a28a8ab16..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_02/Ex_02.pde +++ /dev/null @@ -1,52 +0,0 @@ -int[][] grid, futureGrid; - -void setup() { - size(540, 100); - frameRate(8); - grid = new int[width][height]; - futureGrid = new int[width][height]; - float density = 0.3 * width * height; - for (int i = 0; i < density; i++) { - grid[int(random(width))][int(random(height))] = 1; - } - background(0); -} - -void draw() { - for (int x = 1; x < width - 1; x++) { - for (int y = 1; y < height - 1; y++) { - // Check the number of neighbors (adjacent cells) - int nb = neighbors(x, y); - if ((grid[x][y] == 1) && (nb < 2)) { - futureGrid[x][y] = 0; // Isolation death - set(x, y, color(0)); - } else if ((grid[x][y] == 1) && (nb > 3)) { - futureGrid[x][y] = 0; // Overpopulation death - set(x, y, color(0)); - } else if ((grid[x][y] == 0) && (nb == 3)) { - futureGrid[x][y] = 1; // Birth - set(x, y, color(255)); - } else { - futureGrid[x][y] = grid[x][y]; // Survive - } - } - } - - // Swap current and future grids - int[][] temp = grid; - grid = futureGrid; - futureGrid = temp; -} - -// Count the number of adjacent cells 'on' -int neighbors(int x, int y) { - return grid[x][y-1] + // North - grid[x+1][y-1] + // Northeast - grid[x+1][y] + // East - grid[x+1][y+1] + // Souteast - grid[x][y+1] + // South - grid[x-1][y+1] + // Southwest - grid[x-1][y] + // West - grid[x-1][y-1]; // Northwest -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde deleted file mode 100755 index 21a16dfa9..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_03/Ex_03.pde +++ /dev/null @@ -1,14 +0,0 @@ -int neighbors(int x, int y) { - int north = (y + height - 1) % height; - int south = (y + 1) % height; - int east = (x + 1) % width; - int west = (x + width - 1) % width; - return grid[x][north] + // North - grid[east][north] + // Northeast - grid[east][y] + // East - grid[east][south] + // Southeast - grid[x][south] + // South - grid[west][south] + // Southwest - grid[west][y] + // West - grid[west][north]; // Northwest -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde deleted file mode 100755 index 4df0e09af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_04/Ex_04.pde +++ /dev/null @@ -1,57 +0,0 @@ -int SOUTH = 0; // Direction numbers with names -int EAST = 1; // so that the code self-documents -int NORTH = 2; -int WEST = 3; -int direction = NORTH; // Current direction of the ant -int x, y; // Ant's current position -color ON = color(255); // Color for an 'on' pixel -color OFF = color(0); // Color for an 'off' pixel - -void setup() { - size(100, 100); - x = width / 2; - y = height / 2; - background(0); -} - -void draw() { - if (direction == SOUTH) { - y++; - if (y == height) { - y = 0; - } - } else if (direction == EAST) { - x++; - if (x == width) { - x = 0; - } - } else if (direction == NORTH) { - if (y == 0) { - y = height - 1; - } else { - y--; - } - } else if (direction == WEST) { - if (x == 0) { - x = width - 1; - } else { - x--; - } - } - if (get(x, y) == ON) { - set(x, y, OFF); - if (direction == SOUTH) { - direction = WEST; - } else { - direction--; - } - } - else { - set(x, y, ON); - if (direction == WEST) { - direction = SOUTH; - } else { - direction++; // Rotate direction - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde deleted file mode 100755 index 6c60c0f1f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/49 Simulate 1/Ex_05/Ex_05.pde +++ /dev/null @@ -1,49 +0,0 @@ -int[][] angles = { { 0, 1 }, { 1, 1 }, { 1, 0 }, { 1,-1 }, - { 0,-1 }, {-1,-1 }, {-1, 0 }, {-1, 1 } }; -int numAngles = angles.length; -int x, y, nx, ny; -int dir = 0; -color black = color(0); -color white = color(255); - -void setup() { - size(100, 100); - background(255); - x = width / 2; - nx = x; - y = height / 2; - ny = y; - float woodDensity = width * height * 0.5; - for (int i = 0; i < woodDensity; i++) { - int rx = int(random(width)); - int ry = int(random(height)); - set(rx, ry, black); - } -} - -void draw() { - int rand = int(abs(random(-1, 2))); - dir = (dir + rand + numAngles) % numAngles; - nx = (nx + angles[dir][0] + width) % width; - ny = (ny + angles[dir][1] + height) % height; - if ((get(x, y) == black) && (get(nx, ny) == white)) { -// Move the chip one space - set(x, y, white); - set(nx, ny, black); - x = nx; - y = ny; - } - else if ((get(x, y) == black) && (get(nx, ny) == black)) { -// Move in the opposite direction - dir = (dir + (numAngles / 2)) % numAngles; - x = (x + angles[dir][0] + width) % width; - y = (y + angles[dir][1] + height) % height; - } - else { -// Not carrying - x = nx; - y = ny; - } - nx = x; // Save the current position - ny = y; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde deleted file mode 100755 index d3f581d2d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_01/Ex_01.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Gradually increases the velocity -float y = 50.0; -float radius = 15.0; -float velocity = 0.0; -float acceleration = 0.01; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 10); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity += acceleration; // Increase the velocity - y += velocity; // Update the position - if (y > height + radius) { // If over the bottom edge, - y = -radius; // move to the top - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde deleted file mode 100755 index 6c326eb9b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_02/Ex_02.pde +++ /dev/null @@ -1,23 +0,0 @@ -float y = 50.0; -float radius = 15.0; -float velocity = 9.0; -float acceleration = -0.05; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity += acceleration; - y += velocity; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde deleted file mode 100755 index 287236d89..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_03/Ex_03.pde +++ /dev/null @@ -1,23 +0,0 @@ -float y = 50.0; -float radius = 15.0; -float velocity = 8.0; -float friction = 0.98; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - ellipse(33, y, radius, radius); - velocity *= friction; - y += velocity; - if (y > height + radius) { - y = -radius; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde deleted file mode 100755 index 5440ca2ac..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_04/Ex_04.pde +++ /dev/null @@ -1,27 +0,0 @@ -float x = 33; -float y = 5; -float velocity = 0.0; -float radius = 15.0; -float friction = 0.99; -float acceleration = 0.3; - -void setup() { - size(100, 100); - smooth(); - noStroke(); - ellipseMode(RADIUS); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - velocity += acceleration; - velocity *= friction; - y += velocity; - if (y > (height - radius)) { - y = height - radius; - velocity = -velocity; - } - ellipse(x, y, radius, radius); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_05/Ex_05.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde deleted file mode 100755 index c3334f86c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Ex_06.pde +++ /dev/null @@ -1,16 +0,0 @@ -Particle p; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - p = new Particle(0, height, 2.2, -4.2, 20.0); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - p.update(); - p.display(); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_06/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde deleted file mode 100755 index c70a324af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Ex_07.pde +++ /dev/null @@ -1,19 +0,0 @@ -class GenParticle extends Particle { - float originX, originY; - - GenParticle(int xIn, int yIn, float vxIn, float vyIn, float r, float ox, float oy) { - super(xIn, yIn, vxIn, vyIn, r); - originX = ox; - originY = oy; - } - - void regenerate() { - if ((x > width + radius) || (x < -radius) || - (y > height + radius) || (y < -radius)) { - x = originX; - y = originY; - vx = random(-1.0, 1.0); - vy = random(-4.0, -2.0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_07/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde deleted file mode 100755 index b9185c07f..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Ex_08.pde +++ /dev/null @@ -1,27 +0,0 @@ -int numParticles = 200; -GenParticle[] p = new GenParticle[numParticles]; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-1, 1); - float velY = -i; -// Inputs: x, y, x-velocity, y-velocity, -// radius, origin x, origin y - p[i] = new GenParticle(width / 2, height / 2, velX, velY, - 5.0, width / 2, height / 2); - } -} - -void draw() { - fill(0, 36); - rect(0, 0, width, height); - fill(255, 60); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].regenerate(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde deleted file mode 100755 index c70a324af..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/GenParticle.pde +++ /dev/null @@ -1,19 +0,0 @@ -class GenParticle extends Particle { - float originX, originY; - - GenParticle(int xIn, int yIn, float vxIn, float vyIn, float r, float ox, float oy) { - super(xIn, yIn, vxIn, vyIn, r); - originX = ox; - originY = oy; - } - - void regenerate() { - if ((x > width + radius) || (x < -radius) || - (y > height + radius) || (y < -radius)) { - x = originX; - y = originY; - vx = random(-1.0, 1.0); - vy = random(-4.0, -2.0); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_08/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde deleted file mode 100755 index aa4766598..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Ex_09.pde +++ /dev/null @@ -1,24 +0,0 @@ -class LimitedParticle extends Particle { - float friction = 0.99; - LimitedParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - vy *= friction; - vx *= friction; - super.update(); - limit(); - } - - void limit() { - if (y > height - radius) { - vy = -vy; - y = constrain(y, -height * height, height - radius); - } - if ((x < radius) || (x > width - radius)) { - vx = -vx; - x = constrain(x, radius, width - radius); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_09/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde deleted file mode 100755 index 635f8798b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Ex_10.pde +++ /dev/null @@ -1,26 +0,0 @@ -int num = 80; -LimitedParticle[] p = new LimitedParticle[num]; -float radius = 1.2; - -void setup() { - size(100, 100); - noStroke(); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(-2, 2); - float velY = -i; -// Inputs: x, y, x-velocity, y-velocity, radius - p[i] = new LimitedParticle(width / 2, height / 2, - velX, velY, 2.2); - } -} - -void draw() { - fill(0, 24); - rect(0, 0, width, height); - fill(255); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde deleted file mode 100755 index aa4766598..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/LimitedParticle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class LimitedParticle extends Particle { - float friction = 0.99; - LimitedParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - vy *= friction; - vx *= friction; - super.update(); - limit(); - } - - void limit() { - if (y > height - radius) { - vy = -vy; - y = constrain(y, -height * height, height - radius); - } - if ((x < radius) || (x > width - radius)) { - vx = -vx; - x = constrain(x, radius, width - radius); - } - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_10/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde deleted file mode 100755 index dd5b4aa66..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Ex_11.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(255); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0 / shaftLength); - line(0, 0, 1, 0); - line(1, 0, 0.7, -0.3); - line(1, 0, 0.7, 0.3); - popMatrix(); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde deleted file mode 100755 index 246c2050c..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_11/Particle.pde +++ /dev/null @@ -1,24 +0,0 @@ -class Particle { - float x, y; // The x- and y-coordinates - float vx, vy; // The x- and y-velocities - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xpos, int ypos, float velx, float vely, float r) { - x = xpos; - y = ypos; - vx = velx; - vy = vely; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde deleted file mode 100755 index dd5b4aa66..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/ArrowParticle.pde +++ /dev/null @@ -1,26 +0,0 @@ -class ArrowParticle extends Particle { - float angle = 0.0; - float shaftLength = 20.0; - ArrowParticle(int ix, int iy, float ivx, float ivy, float ir) { - super(ix, iy, ivx, ivy, ir); - } - - void update() { - super.update(); - angle = atan2(vy, vx); - } - - void display() { - stroke(255); - pushMatrix(); - translate(x, y); - rotate(angle); - scale(shaftLength); - strokeWeight(1.0 / shaftLength); - line(0, 0, 1, 0); - line(1, 0, 0.7, -0.3); - line(1, 0, 0.7, 0.3); - popMatrix(); - } -} - diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde deleted file mode 100755 index 98ce49b9b..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Ex_12.pde +++ /dev/null @@ -1,22 +0,0 @@ -int num = 320; -ArrowParticle[] p = new ArrowParticle[num]; -float radius = 1.2; - -void setup() { - size(600, 100); - smooth(); - for (int i = 0; i < p.length; i++) { - float velX = random(1, 8); - float velY = random(-5, -1); -// Parameters: x, y, x-velocity, y-velocity, radius - p[i] = new ArrowParticle(0, height / 2, velX, velY, 1.2); - } -} - -void draw() { - background(0); - for (int i = 0; i < p.length; i++) { - p[i].update(); - p[i].display(); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde deleted file mode 100755 index 98c2333b5..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_12/Particle.pde +++ /dev/null @@ -1,25 +0,0 @@ -class Particle { - - float x, y; // X-coordinate, y-coordinate - float vx, vy; // X velocity, y velocity - float radius; // Particle radius - float gravity = 0.1; - - Particle(int xIn, int yIn, float vxIn, float vyIn, float r) { - x = xIn; - y = yIn; - vx = vxIn; - vy = vyIn; - radius = r; - } - - void update() { - vy = vy + gravity; - y += vy; - x += vx; - } - - void display() { - ellipse(x, y, radius*2, radius*2); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde deleted file mode 100755 index ef4157adc..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_13/Ex_13.pde +++ /dev/null @@ -1,21 +0,0 @@ -float stiffness = 0.1; -float damping = 0.9; -float velocity = 0.0; -float targetY; -float y; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - float force = stiffness * (targetY - y); // f = -kx - velocity = damping * (velocity + force); - y += velocity; - rect(10, y, width - 20, 12); - targetY = mouseY; -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde deleted file mode 100755 index 9fc62279a..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_14/Ex_14.pde +++ /dev/null @@ -1,28 +0,0 @@ -float y1, y2; -float velocity1, velocity2; -float mass1 = 1.0; -float mass2 = 6.0; -float stiffness = 0.1; -float damping = 0.9; - -void setup() { - size(100, 100); - noStroke(); -} - -void draw() { - fill(0, 12); - rect(0, 0, width, height); - fill(255); - float targetY = mouseY; - float forceA = stiffness * (targetY - y1); - float accelerationY1 = forceA / mass1; - velocity1 = damping * (velocity1 + accelerationY1); - y1 += velocity1; - rect(10, y1, 40, 15); - float forceB = stiffness * (targetY - y2); - float accelerationY2 = forceB / mass2; - velocity2 = damping * (velocity2 + accelerationY2); - y2 += velocity2; - rect(50, y2, 40, 15); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_15/Ex_15.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde deleted file mode 100755 index 1070dfca6..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Ex_16.pde +++ /dev/null @@ -1,20 +0,0 @@ -Spring2D s1, s2; -float gravity = 5.0; -float mass = 2.0; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity - s1 = new Spring2D(0.0, width / 2, mass, gravity); - s2 = new Spring2D(0.0, width / 2, mass, gravity); -} - -void draw() { - background(204); - s1.update(mouseX, mouseY); - s1.display(mouseX, mouseY); - s2.update(s1.x, s1.y); - s2.display(s1.x, s1.y); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_16/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde deleted file mode 100755 index 209c51df7..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Ex_17.pde +++ /dev/null @@ -1,23 +0,0 @@ -int numSprings = 30; -Spring2D[] s = new Spring2D[numSprings]; -float gravity = 5.0; -float mass = 3.0; - -void setup() { - size(100, 900); - smooth(); - fill(0); - for (int i = 0; i < numSprings; i++) { - s[i] = new Spring2D(width / 2, i*(height / numSprings), mass, gravity); - } -} - -void draw() { - background(204); - s[0].update(mouseX, mouseY); - s[0].display(mouseX, mouseY); - for (int i = 1; i < numSprings; i++) { - s[i].update(s[i-1].x, s[i-1].y); - s[i].display(s[i-1].x, s[i-1].y); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_17/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Ex_18.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_18/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde deleted file mode 100755 index 68e4d5804..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Ex_19.pde +++ /dev/null @@ -1,16 +0,0 @@ -FixedSpring s; -float gravity = 0.5; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity, length - s = new FixedSpring(0.0, 50.0, 1.0, gravity, 40.0); -} - -void draw() { - background(204); - s.update(mouseX, mouseY); - s.display(mouseX, mouseY); -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/FixedSpring.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_19/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde deleted file mode 100755 index 78221bea8..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Ex_20.pde +++ /dev/null @@ -1,23 +0,0 @@ -FixedSpring s1, s2; -float gravity = 1.2; - -void setup() { - size(100, 100); - smooth(); - fill(0); -// Inputs: x, y, mass, gravity, length - s1 = new FixedSpring(45, 33, 1.5, gravity, 40.0); - s2 = new FixedSpring(55, 66, 1.5, gravity, 40.0); -} - -void draw() { - background(204); - s1.update(s2.x, s2.y); - s2.update(s1.x, s1.y); - s1.display(s2.x, s2.y); - s2.display(s1.x, s1.y); - if (mousePressed == true) { - s1.x = mouseX; - s1.y = mouseY; - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde deleted file mode 100755 index dbb55d438..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/FixedSpring.pde +++ /dev/null @@ -1,24 +0,0 @@ -class FixedSpring extends Spring2D { - float springLength; - - FixedSpring(float xpos, float ypos, float m, float g, float s) { - super(xpos, ypos, m, g); - springLength = s; - } - - void update(float newX, float newY) { - // Calculate the target position - float dx = x - newX; - float dy = y - newY; - float angle = atan2(dy, dx); - float targetX = newX + cos(angle) * springLength; - float targetY = newY + sin(angle) * springLength; - - // Activate update method from Spring2D - super.update(targetX, targetY); - - // Constrain to display window - x = constrain(x, radius, width - radius); - y = constrain(y, radius, height - radius); - } -} diff --git a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde b/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde deleted file mode 100755 index bc548351d..000000000 --- a/java/examples/Books/Processing Handbook/Units 43-51/50 Simulate 2/Ex_20/Spring2D.pde +++ /dev/null @@ -1,35 +0,0 @@ -class Spring2D { - float vx, vy; // The x- and y-axis velocities - float x, y; // The x- and y-coordinates - float gravity; - float mass; - float radius = 10; - float stiffness = 0.2; - float damping = 0.7; - - Spring2D(float xpos, float ypos, float m, float g) { - x = xpos; - y = ypos; - mass = m; - gravity = g; - } - - void update(float targetX, float targetY) { - float forceX = (targetX - x) * stiffness; - float ax = forceX / mass; - vx = damping * (vx + ax); - x += vx; - float forceY = (targetY - y) * stiffness; - forceY += gravity; - float ay = forceY / mass; - vy = damping * (vy + ay); - y += vy; - } - - void display(float nx, float ny) { - noStroke(); - ellipse(x, y, radius*2, radius*2); - stroke(255); - line(x, y, nx, ny); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt b/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt deleted file mode 100644 index a7ffe39dc..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -For this chapter, the a sketch that implements every step described in the -book is included. This is because the figures and steps used to develop the -code don't really line up (there are more steps than figures). Each sketch -has a name like step15_framerate, which should be self-explanatory when used -with the book. (I do not recommend using this ugly style of naming for your - own sketches, it's done this way simply because the step/figure numbering -is relevant and needs to be included). - -All examples have been tested but if you find errors of any kind (typos, -unused variables, profanities in the comments, the usual), please contact -me through http://benfry.com/writing and I'll be happy to fix the code. - -The code in this file is (c) 2008 Ben Fry. Rights to use of the code can be -found in the preface of "Visualizing Data". diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde deleted file mode 100644 index f9bba8447..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step00_show_map/step00_show_map.pde +++ /dev/null @@ -1,11 +0,0 @@ -PImage mapImage; - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); -} - -void draw() { - background(255); - image(mapImage, 0, 0); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde deleted file mode 100644 index 670a62559..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step01_fig1_red_dots/step01_fig1_red_dots.pde +++ /dev/null @@ -1,30 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - // Make a data table from a file that contains - // the coordinates of each state. - locationTable = new Table("locations.tsv"); - // The row count will be used a lot, store it locally. - rowCount = locationTable.getRowCount(); -} - -void draw() { - background(255); - image(mapImage, 0, 0); - - // Drawing attributes for the ellipses - smooth(); - fill(192, 0, 0); - noStroke(); - - // Loop through the rows of the locations file and draw the points - for (int row = 0; row < rowCount; row++) { - float x = locationTable.getFloat(row, 1); // column 1 - float y = locationTable.getFloat(row, 2); // column 2 - ellipse(x, y, 9, 9); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde deleted file mode 100644 index 1b1a11278..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/Table.pde +++ /dev/null @@ -1,142 +0,0 @@ -class Table { - String[][] data; - int rowCount; - - - Table() { - data = new String[10][10]; - } - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - // Write this table as a TSV file - void write(PrintWriter writer) { - for (int i = 0; i < rowCount; i++) { - for (int j = 0; j < data[i].length; j++) { - if (j != 0) { - writer.print(TAB); - } - if (data[i][j] != null) { - writer.print(data[i][j]); - } - } - writer.println(); - } - writer.flush(); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde deleted file mode 100644 index 720a9cd5e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step02_fig2_varying_sizes/step02_fig2_varying_sizes.pde +++ /dev/null @@ -1,57 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - smooth(); - fill(192, 0, 0); - noStroke(); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -// Map the size of the ellipse to the data value -void drawData(float x, float y, String abbrev) { - // Get data value for state - float value = dataTable.getFloat(abbrev, 1); - // Re-map the value to a number between 2 and 40 - float mapped = map(value, dataMin, dataMax, 2, 40); - // Draw an ellipse for this item - ellipse(x, y, mapped, mapped); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde deleted file mode 100644 index dc1514b78..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step03_fig3_red_to_blue/step03_fig3_red_to_blue.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#FF4422, #4422CC, percent); // red to blue - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde deleted file mode 100644 index 9d5c73bb2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step04_fig4_blue_green/step04_fig4_blue_green.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - smooth(); - noStroke(); -} - - -void draw() { - background(255); - tint(255, 160); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#296F34, #61E2F0, percent); - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde deleted file mode 100644 index e17f45a94..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step05_fig5_blue_green_hsb/step05_fig5_blue_green_hsb.pde +++ /dev/null @@ -1,54 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float percent = norm(value, dataMin, dataMax); - color between = lerpColor(#296F34, #61E2F0, percent, HSB); - fill(between); - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde deleted file mode 100644 index 5351ea43d..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step06_fig6_two_sided_range/step06_fig6_two_sided_range.pde +++ /dev/null @@ -1,59 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float diameter = 0; - if (value >= 0) { - diameter = map(value, 0, dataMax, 3, 30); - fill(#333366); // blue - } else { - diameter = map(value, 0, dataMin, 3, 30); - fill(#ec5166); // red - } - ellipse(x, y, diameter, diameter); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde deleted file mode 100644 index dc803f3bc..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step07_fig7_two_sided_alpha/step07_fig7_two_sided_alpha.pde +++ /dev/null @@ -1,58 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - if (value >= 0) { - float a = map(value, 0, dataMax, 0, 255); - fill(#333366, a); - } else { - float a = map(value, 0, dataMin, 0, 255); - fill(#EC5166, a); - } - ellipse(x, y, 15, 15); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde deleted file mode 100644 index 4c757da66..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step08_rollovers/step08_rollovers.pde +++ /dev/null @@ -1,70 +0,0 @@ -PImage mapImage; -Table locationTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - rowCount = locationTable.getRowCount(); - - // Read the data table - dataTable = new Table("random.tsv"); - - // Find the minimum and maximum values - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - if (dist(x, y, mouseX, mouseY) < radius+2) { - fill(0); - textAlign(CENTER); - // Show the data value and the state abbreviation in parentheses - text(value + " (" + abbrev + ")", x, y-radius-4); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde deleted file mode 100644 index 21fb6ba0e..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/Table.pde +++ /dev/null @@ -1,82 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde deleted file mode 100644 index 274ef8080..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step09_rollovers_full_names/step09_rollovers_full_names.pde +++ /dev/null @@ -1,70 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - if (dist(x, y, mouseX, mouseY) < radius+2) { - fill(0); - textAlign(CENTER); - String name = nameTable.getString(abbrev, 1); - text(name + " " + value, x, y-radius-4); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde deleted file mode 100644 index db7d65627..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step10_single_rollover/step10_single_rollover.pde +++ /dev/null @@ -1,94 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = MAX_FLOAT; -float dataMax = MIN_FLOAT; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - for (int row = 0; row < rowCount; row++) { - float value = dataTable.getFloat(row, 1); - if (value > dataMax) { - dataMax = value; - } - if (value < dataMin) { - dataMin = value; - } - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - - -// Global variables set in drawData() and read in draw() -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - // Use the built-in width and height variables to set the - // closest distance high so it will be replaced immediately - closestDist = width*height; - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - // Use global variables set in drawData() - // to draw text related to closest circle. - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - // Because the following check is done each time a new - // circle is drawn, we end up with the values of the - // circle closest to the mouse. - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + value; - closestTextX = x; - closestTextY = y-radius-4; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde deleted file mode 100644 index 246ae2ad8..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step11_randomize_on_keypress/step11_randomize_on_keypress.pde +++ /dev/null @@ -1,90 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + value; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(-10, 10); - dataTable.setFloat(row, 1, newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde deleted file mode 100644 index bc355b4c1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step12_randomize_with_nfp/step12_randomize_with_nfp.pde +++ /dev/null @@ -1,90 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + nfp(value, 0, 2); - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(-10, 10); - dataTable.setFloat(row, 1, newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi deleted file mode 100755 index 48e28fe77..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/random.cgi +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/perl - -# An array of the 50 state abbreviations -@states = ('AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'FL', 'GA', - 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', - 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', - 'NM', 'NY', 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', - 'SD', 'TN', 'TX', 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY'); - -# A CGI script must identify the type of data it's sending, -# this line specifies that plain text data will follow. -print "Content-type: text/plain\n\n"; - -# Loop through each of the state abbreviations in the array -foreach $state (@states) { - - # Pick a random number between -10 and 10. (rand() returns a - # number between 0 and 1, multiply that by 20 and subtract 10) - $r = (rand() * 20) - 10; - - # Print the state name, followed by a tab, - # then the random value, followed by a new line. - print "$state\t$r\n"; -} \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde deleted file mode 100644 index 9b6089691..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step13_randomize_from_cgi/step13_randomize_from_cgi.pde +++ /dev/null @@ -1,85 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - updateTable(); - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - image(mapImage, 0, 0); - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - float value = dataTable.getFloat(abbrev, 1); - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - closestText = name + " " + nfp(value, 0, 2); - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - dataTable = new Table("http://benfry.com/writing/map/random.cgi"); -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde deleted file mode 100644 index f79a1ac0a..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step14_integrators/step14_integrators.pde +++ /dev/null @@ -1,106 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde deleted file mode 100644 index 407e5f469..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step15_framerate/step15_framerate.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde deleted file mode 100644 index 3dd017233..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step16_lethargic/step16_lethargic.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue, 0.5, 0.01); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - //frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde deleted file mode 100644 index 8542c15e7..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/Table.pde +++ /dev/null @@ -1,120 +0,0 @@ -class Table { - int rowCount; - String[][] data; - - - Table(String filename) { - String[] rows = loadStrings(filename); - data = new String[rows.length][]; - - for (int i = 0; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - // copy to the table array - data[rowCount] = pieces; - rowCount++; - - // this could be done in one fell swoop via: - //data[rowCount++] = split(rows[i], TAB); - } - // resize the 'data' array as necessary - data = (String[][]) subset(data, 0, rowCount); - } - - - int getRowCount() { - return rowCount; - } - - - // find a row by its name, returns -1 if no row found - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (data[i][0].equals(name)) { - return i; - } - } - println("No row named '" + name + "' was found"); - return -1; - } - - - String getRowName(int row) { - return getString(row, 0); - } - - - String getString(int rowIndex, int column) { - return data[rowIndex][column]; - } - - - String getString(String rowName, int column) { - return getString(getRowIndex(rowName), column); - } - - - int getInt(String rowName, int column) { - return parseInt(getString(rowName, column)); - } - - - int getInt(int rowIndex, int column) { - return parseInt(getString(rowIndex, column)); - } - - - float getFloat(String rowName, int column) { - return parseFloat(getString(rowName, column)); - } - - - float getFloat(int rowIndex, int column) { - return parseFloat(getString(rowIndex, column)); - } - - - void setRowName(int row, String what) { - data[row][0] = what; - } - - - void setString(int rowIndex, int column, String what) { - data[rowIndex][column] = what; - } - - - void setString(String rowName, int column, String what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = what; - } - - - void setInt(int rowIndex, int column, int what) { - data[rowIndex][column] = str(what); - } - - - void setInt(String rowName, int column, int what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } - - - void setFloat(int rowIndex, int column, float what) { - data[rowIndex][column] = str(what); - } - - - void setFloat(String rowName, int column, float what) { - int rowIndex = getRowIndex(rowName); - data[rowIndex][column] = str(what); - } -} diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw deleted file mode 100644 index 14e5bcb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/Univers-Bold-12.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv deleted file mode 100644 index ec3406df2..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/locations.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 439 270 -AK 94 325 -AZ 148 241 -AR 368 247 -CA 56 176 -CO 220 183 -CT 576 120 -DE 556 166 -FL 510 331 -GA 478 267 -HI 232 380 -ID 143 101 -IL 405 168 -IN 437 165 -IA 357 147 -KS 302 194 -KY 453 203 -LA 371 302 -ME 595 59 -MD 538 162 -MA 581 108 -MI 446 120 -MN 339 86 -MS 406 274 -MO 365 197 -MT 194 61 -NE 286 151 -NV 102 157 -NH 580 89 -NJ 561 143 -NM 208 245 -NY 541 107 -NC 519 221 -ND 283 65 -OH 472 160 -OK 309 239 -OR 74 86 -PA 523 144 -RI 589 117 -SC 506 251 -SD 286 109 -TN 441 229 -TX 291 299 -UT 154 171 -VT 567 86 -VA 529 189 -WA 92 38 -WV 496 178 -WI 392 103 -WY 207 125 diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv deleted file mode 100644 index f61e18f80..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/names.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL Alabama -AK Alaska -AZ Arizona -AR Arkansas -CA California -CO Colorado -CT Connecticut -DE Delaware -FL Florida -GA Georgia -HI Hawaii -ID Idaho -IL Illinois -IN Indiana -IA Iowa -KS Kansas -KY Kentucky -LA Louisiana -ME Maine -MD Maryland -MA Massachusetts -MI Michigan -MN Minnesota -MS Mississippi -MO Missouri -MT Montana -NE Nebraska -NV Nevada -NH New Hampshire -NJ New Jersey -NM New Mexico -NY New York -NC North Carolina -ND North Dakota -OH Ohio -OK Oklahoma -OR Oregon -PA Pennsylvania -RI Rhode Island -SC South Carolina -SD South Dakota -TN Tennessee -TX Texas -UT Utah -VT Vermont -VA Virginia -WA Washington -WV West Virginia -WI Wisconsin -WY Wyoming \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv deleted file mode 100644 index 58d799d27..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/data/random.tsv +++ /dev/null @@ -1,50 +0,0 @@ -AL 0.1 -AK -5.3 -AZ 3 -AR 7 -CA 11 -CO 1.5 -CT -6.7 -DE -4 -FL 9 -GA 2 -HI -3.3 -ID 6.6 -IL 7.2 -IN 7.1 -IA 6.9 -KS 6 -KY 1.8 -LA 7.5 -ME -4 -MD 0.1 -MA -6 -MI 1.7 -MN -2 -MS -4.4 -MO -2 -MT 1.0 -NE 1.2 -NV 1.6 -NH 0.5 -NJ 0.2 -NM 8.8 -NY 1.4 -NC 9.7 -ND 5.4 -OH 3.2 -OK 6 -OR -4 -PA -7 -RI -2 -SC 1 -SD 6 -TN 5 -TX -3.4 -UT 2.3 -VT 4.8 -VA 3 -WA 2.2 -WV 5.4 -WI 3.1 -WY -6 \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde b/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde deleted file mode 100644 index 431e41281..000000000 --- a/java/examples/Books/Visualizing Data/ch03-usmap/step17_bouncy/step17_bouncy.pde +++ /dev/null @@ -1,107 +0,0 @@ -PImage mapImage; -Table locationTable; -Table nameTable; -int rowCount; - -Table dataTable; -float dataMin = -10; -float dataMax = 10; - -Integrator[] interpolators; - - -void setup() { - size(640, 400); - mapImage = loadImage("map.png"); - locationTable = new Table("locations.tsv"); - nameTable = new Table("names.tsv"); - rowCount = locationTable.getRowCount(); - - dataTable = new Table("random.tsv"); - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = dataTable.getFloat(row, 1); - interpolators[row] = new Integrator(initialValue, 0.9, 0.1); - } - - PFont font = loadFont("Univers-Bold-12.vlw"); - textFont(font); - - smooth(); - noStroke(); - //frameRate(30); -} - -float closestDist; -String closestText; -float closestTextX; -float closestTextY; - - -void draw() { - background(255); - image(mapImage, 0, 0); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - closestDist = width*height; // abritrarily high - - for (int row = 0; row < rowCount; row++) { - String abbrev = dataTable.getRowName(row); - float x = locationTable.getFloat(abbrev, 1); - float y = locationTable.getFloat(abbrev, 2); - drawData(x, y, abbrev); - } - - if (closestDist != width*height) { - fill(0); - textAlign(CENTER); - text(closestText, closestTextX, closestTextY); - } -} - - -void drawData(float x, float y, String abbrev) { - // Figure out what row this is - int row = dataTable.getRowIndex(abbrev); - // Get the current value - float value = interpolators[row].value; - - float radius = 0; - if (value >= 0) { - radius = map(value, 0, dataMax, 1.5, 15); - fill(#333366); // blue - } else { - radius = map(value, 0, dataMin, 1.5, 15); - fill(#ec5166); // red - } - ellipseMode(RADIUS); - ellipse(x, y, radius, radius); - - float d = dist(x, y, mouseX, mouseY); - if ((d < radius + 2) && (d < closestDist)) { - closestDist = d; - String name = nameTable.getString(abbrev, 1); - String val = nfp(interpolators[row].target, 0, 2); - closestText = name + " " + val; - closestTextX = x; - closestTextY = y-radius-4; - } -} - - -void keyPressed() { - if (key == ' ') { - updateTable(); - } -} - - -void updateTable() { - for (int row = 0; row < rowCount; row++) { - float newValue = random(dataMin, dataMax); - interpolators[row].target(newValue); - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde deleted file mode 100644 index 69c41d5a9..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_01_just_points/figure_01_just_points.pde +++ /dev/null @@ -1,60 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int yearMin, yearMax; -int[] years; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - strokeWeight(5); - // Draw the data for the first column - stroke(#5679C1); - drawDataPoints(0); -} - - -// Draw the data as a series of points -void drawDataPoints(int col) { - int rowCount = data.getRowCount(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde deleted file mode 100644 index bd1024aca..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_02_plot_title/figure_02_plot_title.pde +++ /dev/null @@ -1,74 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int currentColumn = 0; -int columnCount; - -int yearMin, yearMax; -int[] years; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - fill(0); - textSize(20); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -// Draw the data as a series of points -void drawDataPoints(int col) { - int rowCount = data.getRowCount(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde deleted file mode 100755 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde deleted file mode 100755 index ead08a5b0..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_03_labels/figure_03_labels.pde +++ /dev/null @@ -1,115 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawYearLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 5); - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde deleted file mode 100755 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde deleted file mode 100755 index bf50fbc3f..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_04_grid/figure_04_grid.pde +++ /dev/null @@ -1,247 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - //println(data.getTableMin()); - dataMin = 0; //data.getTableMin(); - dataMax = data.getTableMax(); - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - drawTitle(); - drawYearLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void drawDataHighlight(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - if (dist(mouseX, mouseY, x, y) < 3) { - strokeWeight(10); - point(x, y); - fill(0); - textSize(10); - textAlign(CENTER); - text(nf(value, 0, 2) + " (" + years[row] + ")", x, y-8); - textAlign(LEFT); - } - } - } -} - - -void drawDataCurve(int col) { - //stroke(0); - //noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - //float x = map(row, 0, rowCount-1, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - //ellipse(x, y, 5, 5); // only change for ellipses - curveVertex(x, y); - // double the curve points for the start and stop - if ((row == 0) || (row == rowCount-1)) { - curveVertex(x, y); - } - } - } - endShape(); -} - - -void drawDataArea(int col) { - float leftEdge = width; - float rightEdge = 0; - - noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - if (x < leftEdge) { - leftEdge = x; - } - if (x > rightEdge) { - rightEdge = x; - } - - vertex(x, y); - } - } - // draw the lower-right and lower-left corners - vertex(rightEdge, plotY2); - vertex(leftEdge, plotY2); - endShape(CLOSE); -} - - -void drawDataEllipses(int col) { - ellipseMode(CENTER); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - //float x = map(row, 0, rowCount-1, plotX1, plotX2); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - ellipse(x, y, 5, 5); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} - - - /* - // print the min and max - println(dataMin + " " + dataMax); - */ - - /* - // print column names - for (int i = 0; i < data.getColumnCount(); i++) { - println(data.getColumnName(i)); - } - */ - - /* - // print row names - for (int i = 0; i < data.getRowCount(); i++) { - println(data.getRowName(i)); - } - */ - - /* - // print a row of data - int row = 4; - for (int i = 0; i < data.getColumnCount(); i++) { - print(data.getFloat(row, i) + "\t"); - } - println(); - */ diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde deleted file mode 100644 index e955fb852..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_05_ylabels_and_ticks/figure_05_ylabels_and_ticks.pde +++ /dev/null @@ -1,150 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 50; - plotX2 = width - plotX1; - plotY1 = 60; - plotY2 = height - plotY1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - // Draw the title of the current plot - drawTitle(); - - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde deleted file mode 100644 index 2d1b4f48b..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_06_finalish/figure_06_finalish.pde +++ /dev/null @@ -1,166 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; -int volumeIntervalMinor = 5; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - // Use \n (enter/linefeed) to break the text into separate lines - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER, TOP); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawVolumeLabels() { - fill(0); - textSize(10); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - if (v == dataMin) { - textAlign(RIGHT); // Align by the bottom - } else if (v == dataMax) { - textAlign(RIGHT, TOP); // Align by the top - } else { - textAlign(RIGHT, CENTER); // Center vertically - } - text(floor(v), plotX1 - 10, y); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - // Commented out, too distracting visually - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde deleted file mode 100644 index e3ea37cba..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07a_shape_noFill/figure_07a_shape_noFill.pde +++ /dev/null @@ -1,9 +0,0 @@ -smooth(); - -noFill(); -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde deleted file mode 100644 index d3a244d54..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07b_shape_fill/figure_07b_shape_fill.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); - -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde deleted file mode 100644 index 61a440ae5..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_07c_shape_close/figure_07c_shape_close.pde +++ /dev/null @@ -1,8 +0,0 @@ -smooth(); - -beginShape(); -vertex(10, 10); -vertex(90, 30); -vertex(40, 90); -vertex(50, 40); -endShape(CLOSE); diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde deleted file mode 100644 index 59032aeda..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_08_draw_data_line/figure_08_draw_data_line.pde +++ /dev/null @@ -1,167 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - noFill(); - drawDataLine(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde deleted file mode 100644 index 6f864a64d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_09_draw_data_mixed/figure_09_draw_data_mixed.pde +++ /dev/null @@ -1,181 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - strokeWeight(5); - drawDataPoints(currentColumn); - noFill(); - strokeWeight(0.5); - drawDataLine(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde deleted file mode 100644 index f4c78788d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_10_rollovers/figure_10_rollovers.pde +++ /dev/null @@ -1,200 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - stroke(#5679C1); - noFill(); - strokeWeight(2); - drawDataLine(currentColumn); - drawDataHighlight(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataPoints(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - point(x, y); - } - } -} - - -void drawDataLine(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - endShape(); -} - - -void drawDataHighlight(int col) { - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - if (dist(mouseX, mouseY, x, y) < 3) { - strokeWeight(10); - point(x, y); - fill(0); - textSize(10); - textAlign(CENTER); - text(nf(value, 0, 2) + " (" + years[row] + ")", x, y-8); - textAlign(LEFT); - } - } - } -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde deleted file mode 100644 index 37cafb864..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_11_curve/figure_11_curve.pde +++ /dev/null @@ -1,174 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - // draw the data using a long curve - noFill(); - stroke(32, 128, 192); - // balance the weight of the lines with the closeness of the data points - strokeWeight(2); - drawDataCurve(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataCurve(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - - curveVertex(x, y); - // double the curve points for the start and stop - if ((row == 0) || (row == rowCount-1)) { - curveVertex(x, y); - } - } - } - endShape(); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde deleted file mode 100644 index 213b74e8b..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_12_area/figure_12_area.pde +++ /dev/null @@ -1,169 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitle(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - noStroke(); - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde deleted file mode 100644 index 3eba9d586..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_13_reversed/figure_13_reversed.pde +++ /dev/null @@ -1,166 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - float plotW = plotX2 - plotX1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(255); - - drawTitle(); - drawAxisLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); - - drawYearLabels(); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(255); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde deleted file mode 100644 index c7a44b9ff..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_14_bar_chart/figure_14_bar_chart.pde +++ /dev/null @@ -1,183 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - float plotW = plotX2 - plotX1; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(255); - - drawTitle(); - drawAxisLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataBars(currentColumn); - - drawYearLabels(); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(255); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - //line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -float barWidth = 4; // Add this line above setup() - -void drawDataBars(int col) { - noStroke(); - rectMode(CORNERS); - - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - rect(x-barWidth/2, y, x+barWidth/2, plotY2); - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde deleted file mode 100644 index 963eb668e..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/figure_15_tabs/figure_15_tabs.pde +++ /dev/null @@ -1,228 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - //println(data.getTableMin()); - dataMin = 0; //data.getTableMin(); - //dataMax = data.getTableMax(); - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - //println(dataMax); - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -float[] tabLeft, tabRight; // Add above setup() -float tabTop, tabBottom; -float tabPad = 10; - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // On first use of this method, allocate space for an array - // to store the values for the left and right edges of the tabs - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - } - - float runningX = plotX1; - tabTop = plotY1 - textAscent() - 15; - tabBottom = plotY1; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = textWidth(title); - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - // If the current tab, set its background white, otherwise use pale gray - fill(col == currentColumn ? 255 : 224); - rect(tabLeft[col], tabTop, tabRight[col], tabBottom); - - // If the current tab, use black for the text, otherwise use dark gray - fill(col == currentColumn ? 0 : 64); - text(title, runningX + tabPad, plotY1 - 10); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt deleted file mode 100644 index df3021132..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/readme.txt +++ /dev/null @@ -1,16 +0,0 @@ -For this chapter, the sketch used to create each figure is included, -because the figures and steps used to develop the code line up pretty -well. Each sketch has a name like figure_03_labels, which should be -self-explanatory. (I do not recommend using this ugly style of naming -for your own sketches, it's done this way simply because the figure -numbering is relevant and needs to be included). The last two sketches -are called step_16 and step_17 because there was no figure 16 or 17 -associated with them. - -All examples have been tested but if you find errors of any kind -(typos, unused variables, profanities in the comments, the usual), -please contact me through http://benfry.com/writing and I'll be happy -to fix the code. - -The code in this file is (c) 2008 Ben Fry. Rights to use of the code -can be found in the preface of "Visualizing Data". diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde deleted file mode 100644 index 20b435843..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_16_tabs_images/step_16_tabs_images.pde +++ /dev/null @@ -1,237 +0,0 @@ -// The images used in this example are identical to the text-only tabs used in the -// previous step. Some might say that's rather unimaginative. Others might see it -// as an opportunity to produce nicer tab images to replace them. - -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - // Corners of the plotted time series - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitle() { - fill(0); - textSize(20); - textAlign(LEFT); - String title = data.getColumnName(currentColumn); - text(title, plotX1, plotY1 - 10); -} - - -float[] tabLeft, tabRight; // Add above setup() -float tabTop, tabBottom; -float tabPad = 0; // No padding necessary when using images -PImage[] tabImageNormal; -PImage[] tabImageHighlight; - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // Allocate the tab position array, and load the tab images. - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - - tabImageNormal = new PImage[columnCount]; - tabImageHighlight = new PImage[columnCount]; - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabImageNormal[col] = loadImage(title + "-unselected.png"); - tabImageHighlight[col] = loadImage(title + "-selected.png"); - } - } - - float runningX = plotX1; - tabBottom = plotY1; - // Size based on the height of the tabs by checking the - // height of the first (all images are the same height) - tabTop = plotY1 - tabImageNormal[0].height; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = tabImageNormal[col].width; - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - PImage tabImage = (col == currentColumn) ? - tabImageHighlight[col] : tabImageNormal[col]; - image(tabImage, tabLeft[col], tabTop); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -int volumeIntervalMinor = 5; // Add this above setup() - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = data.getFloat(row, col); - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - // Draw the lower-right and lower-left corners - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} - - -void keyPressed() { - if (key == '[') { - currentColumn--; - if (currentColumn < 0) { - currentColumn = columnCount - 1; - } - } else if (key == ']') { - currentColumn++; - if (currentColumn == columnCount) { - currentColumn = 0; - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde deleted file mode 100644 index 5e735a001..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/FloatTable.pde +++ /dev/null @@ -1,223 +0,0 @@ -// first line of the file should be the column headers -// first column should be the row titles -// all other values are expected to be floats -// getFloat(0, 0) returns the first data value in the upper lefthand corner -// files should be saved as "text, tab-delimited" -// empty rows are ignored -// extra whitespace is ignored - - -class FloatTable { - int rowCount; - int columnCount; - float[][] data; - String[] rowNames; - String[] columnNames; - - - FloatTable(String filename) { - String[] rows = loadStrings(filename); - - String[] columns = split(rows[0], TAB); - columnNames = subset(columns, 1); // upper-left corner ignored - scrubQuotes(columnNames); - columnCount = columnNames.length; - - rowNames = new String[rows.length-1]; - data = new float[rows.length-1][]; - - // start reading at row 1, because the first row was only the column headers - for (int i = 1; i < rows.length; i++) { - if (trim(rows[i]).length() == 0) { - continue; // skip empty rows - } - if (rows[i].startsWith("#")) { - continue; // skip comment lines - } - - // split the row on the tabs - String[] pieces = split(rows[i], TAB); - scrubQuotes(pieces); - - // copy row title - rowNames[rowCount] = pieces[0]; - // copy data into the table starting at pieces[1] - data[rowCount] = parseFloat(subset(pieces, 1)); - - // increment the number of valid rows found so far - rowCount++; - } - // resize the 'data' array as necessary - data = (float[][]) subset(data, 0, rowCount); - } - - - void scrubQuotes(String[] array) { - for (int i = 0; i < array.length; i++) { - if (array[i].length() > 2) { - // remove quotes at start and end, if present - if (array[i].startsWith("\"") && array[i].endsWith("\"")) { - array[i] = array[i].substring(1, array[i].length() - 1); - } - } - // make double quotes into single quotes - array[i] = array[i].replaceAll("\"\"", "\""); - } - } - - - int getRowCount() { - return rowCount; - } - - - String getRowName(int rowIndex) { - return rowNames[rowIndex]; - } - - - String[] getRowNames() { - return rowNames; - } - - - // Find a row by its name, returns -1 if no row found. - // This will return the index of the first row with this name. - // A more efficient version of this function would put row names - // into a Hashtable (or HashMap) that would map to an integer for the row. - int getRowIndex(String name) { - for (int i = 0; i < rowCount; i++) { - if (rowNames[i].equals(name)) { - return i; - } - } - //println("No row named '" + name + "' was found"); - return -1; - } - - - // technically, this only returns the number of columns - // in the very first row (which will be most accurate) - int getColumnCount() { - return columnCount; - } - - - String getColumnName(int colIndex) { - return columnNames[colIndex]; - } - - - String[] getColumnNames() { - return columnNames; - } - - - float getFloat(int rowIndex, int col) { - // Remove the 'training wheels' section for greater efficiency - // It's included here to provide more useful error messages - - // begin training wheels - if ((rowIndex < 0) || (rowIndex >= data.length)) { - throw new RuntimeException("There is no row " + rowIndex); - } - if ((col < 0) || (col >= data[rowIndex].length)) { - throw new RuntimeException("Row " + rowIndex + " does not have a column " + col); - } - // end training wheels - - return data[rowIndex][col]; - } - - - boolean isValid(int row, int col) { - if (row < 0) return false; - if (row >= rowCount) return false; - //if (col >= columnCount) return false; - if (col >= data[row].length) return false; - if (col < 0) return false; - return !Float.isNaN(data[row][col]); - } - - - float getColumnMin(int col) { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getColumnMax(int col) { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMin(int row) { - float m = Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getRowMax(int row) { - float m = -Float.MAX_VALUE; - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - return m; - } - - - float getTableMin() { - float m = Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] < m) { - m = data[row][col]; - } - } - } - } - return m; - } - - - float getTableMax() { - float m = -Float.MAX_VALUE; - for (int row = 0; row < rowCount; row++) { - for (int col = 0; col < columnCount; col++) { - if (isValid(row, col)) { - if (data[row][col] > m) { - m = data[row][col]; - } - } - } - } - return m; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde deleted file mode 100644 index fd4edb3b1..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/Integrator.pde +++ /dev/null @@ -1,60 +0,0 @@ -class Integrator { - - final float DAMPING = 0.5f; - final float ATTRACTION = 0.2f; - - float value; - float vel; - float accel; - float force; - float mass = 1; - - float damping = DAMPING; - float attraction = ATTRACTION; - boolean targeting; - float target; - - - Integrator() { } - - - Integrator(float value) { - this.value = value; - } - - - Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - void set(float v) { - value = v; - } - - - void update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - } - - - void target(float t) { - targeting = true; - target = t; - } - - - void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv deleted file mode 100644 index 06ca8a89d..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/data/milk-tea-coffee.tsv +++ /dev/null @@ -1,96 +0,0 @@ -Year Milk Tea Coffee -1910 32.2 9.6 21.7 -1911 31.3 10.2 19.7 -1912 34.4 9.6 25.5 -1913 33.1 8.5 21.2 -1914 31.1 8.9 21.8 -1915 29 9.6 25 -1916 28 9.6 27.1 -1917 29.7 11.3 28.6 -1918 34 11.3 23.7 -1919 30.4 5.8 27.9 -1920 34 7.7 27.6 -1921 33.2 6.5 28.4 -1922 33.5 8 27.8 -1923 32.5 8.5 29.9 -1924 32.7 7.5 28.9 -1925 33.6 8.1 25 -1926 33.5 7.6 29.3 -1927 33.2 6.9 28.7 -1928 33.2 6.9 28.2 -1929 33.4 6.8 28.7 -1930 33.2 6.4 29.5 -1931 33.2 6.5 30.7 -1932 33.8 7.1 29.4 -1933 33.7 7.2 30.1 -1934 32.5 5.5 29.1 -1935 33 6 31.7 -1936 33.3 6 32.4 -1937 33.5 6.4 31.4 -1938 33.5 6.3 35.2 -1939 34 6.6 35.2 -1940 34 6.2 36.6 -1941 34.4 7.3 38 -1942 37 5.2 36.2 -1943 41 5.7 33.1 -1944 43.6 5.1 41.8 -1945 44.7 5.2 44.4 -1946 42.1 5.2 46.4 -1947 39.9 5.4 40.8 -1948 38.1 5.4 43.5 -1949 37.5 5.7 45.1 -1950 37.2 5.7 38.6 -1951 37.5 6.1 39.5 -1952 37.6 5.9 38 -1953 37 6.2 37.3 -1954 36.2 6.4 30.5 -1955 36.2 6 32 -1956 36.3 5.9 31.6 -1957 35.9 5.5 30.6 -1958 35.2 5.5 30.4 -1959 34.4 5.5 30.9 -1960 33.9 5.6 30.7 -1961 33 5.8 31 -1962 32.9 6 31 -1963 33 6.2 30.8 -1964 33 6.3 30.5 -1965 32.9 6.4 29.4 -1966 33 6.5 28.9 -1967 31.4 6.6 29 -1968 31.3 6.8 29.1 -1969 31.1 6.8 27.6 -1970 31.3 6.8 27.4 -1971 31.3 7.2 25.7 -1972 31 7.3 26.8 -1973 30.5 7.4 25.8 -1974 29.5 7.5 24.2 -1975 29.5 7.5 23.3 -1976 29.3 7.7 23.7 -1977 29 7.5 17.2 -1978 28.6 7.2 19.9 -1979 28.2 6.9 21.7 -1980 27.6 7.3 19.2 -1981 27.1 7.2 18.7 -1982 26.4 6.9 18.3 -1983 26.3 7 18.5 -1984 26.4 7.1 18.9 -1985 26.7 7.1 19.3 -1986 26.5 7.1 19.4 -1987 26.1 6.9 18.8 -1988 26.1 7 18.2 -1989 26 6.9 18.8 -1990 25.7 6.9 19.4 -1991 25.5 7.4 19.5 -1992 25.1 8 18.9 -1993 24.4 8.3 17.2 -1994 24.3 8.1 15.6 -1995 23.9 7.9 15.3 -1996 23.8 7.6 16.8 -1997 23.4 7.2 17.9 -1998 23 8.3 18.3 -1999 22.9 8.2 19.3 -2000 22.5 7.8 20 -2001 22 8.2 18.5 -2002 21.9 7.8 18.1 -2003 21.6 7.5 18.5 -2004 21.2 7.3 18.8 diff --git a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde b/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde deleted file mode 100644 index 777308ca6..000000000 --- a/java/examples/Books/Visualizing Data/ch04-milkteacoffee/step_17_interpolate/step_17_interpolate.pde +++ /dev/null @@ -1,216 +0,0 @@ -FloatTable data; -float dataMin, dataMax; - -float plotX1, plotY1; -float plotX2, plotY2; -float labelX, labelY; - -int rowCount; -int columnCount; -int currentColumn = 0; - -int yearMin, yearMax; -int[] years; - -int yearInterval = 10; -int volumeInterval = 10; -int volumeIntervalMinor = 5; - -float[] tabLeft, tabRight; -float tabTop, tabBottom; -float tabPad = 10; - -Integrator[] interpolators; - -PFont plotFont; - - -void setup() { - size(720, 405); - - data = new FloatTable("milk-tea-coffee.tsv"); - rowCount = data.getRowCount(); - columnCount = data.getColumnCount(); - - years = int(data.getRowNames()); - yearMin = years[0]; - yearMax = years[years.length - 1]; - - dataMin = 0; - dataMax = ceil(data.getTableMax() / volumeInterval) * volumeInterval; - - interpolators = new Integrator[rowCount]; - for (int row = 0; row < rowCount; row++) { - float initialValue = data.getFloat(row, 0); - interpolators[row] = new Integrator(initialValue); - interpolators[row].attraction = 0.1; // Set lower than the default - } - - plotX1 = 120; - plotX2 = width - 80; - labelX = 50; - plotY1 = 60; - plotY2 = height - 70; - labelY = height - 25; - - plotFont = createFont("SansSerif", 20); - textFont(plotFont); - - smooth(); -} - - -void draw() { - background(224); - - // Show the plot area as a white box - fill(255); - rectMode(CORNERS); - noStroke(); - rect(plotX1, plotY1, plotX2, plotY2); - - drawTitleTabs(); - drawAxisLabels(); - - for (int row = 0; row < rowCount; row++) { - interpolators[row].update(); - } - - drawYearLabels(); - drawVolumeLabels(); - - noStroke(); - fill(#5679C1); - drawDataArea(currentColumn); -} - - -void drawTitleTabs() { - rectMode(CORNERS); - noStroke(); - textSize(20); - textAlign(LEFT); - - // On first use of this method, allocate space for an array - // to store the values for the left and right edges of the tabs - if (tabLeft == null) { - tabLeft = new float[columnCount]; - tabRight = new float[columnCount]; - } - - float runningX = plotX1; - tabTop = plotY1 - textAscent() - 15; - tabBottom = plotY1; - - for (int col = 0; col < columnCount; col++) { - String title = data.getColumnName(col); - tabLeft[col] = runningX; - float titleWidth = textWidth(title); - tabRight[col] = tabLeft[col] + tabPad + titleWidth + tabPad; - - // If the current tab, set its background white, otherwise use pale gray - fill(col == currentColumn ? 255 : 224); - rect(tabLeft[col], tabTop, tabRight[col], tabBottom); - - // If the current tab, use black for the text, otherwise use dark gray - fill(col == currentColumn ? 0 : 64); - text(title, runningX + tabPad, plotY1 - 10); - - runningX = tabRight[col]; - } -} - - -void mousePressed() { - if (mouseY > tabTop && mouseY < tabBottom) { - for (int col = 0; col < columnCount; col++) { - if (mouseX > tabLeft[col] && mouseX < tabRight[col]) { - setCurrent(col); - } - } - } -} - - -void setCurrent(int col) { - currentColumn = col; - - for (int row = 0; row < rowCount; row++) { - interpolators[row].target(data.getFloat(row, col)); - } -} - - -void drawAxisLabels() { - fill(0); - textSize(13); - textLeading(15); - - textAlign(CENTER, CENTER); - text("Gallons\nconsumed\nper capita", labelX, (plotY1+plotY2)/2); - textAlign(CENTER); - text("Year", (plotX1+plotX2)/2, labelY); -} - - -void drawYearLabels() { - fill(0); - textSize(10); - textAlign(CENTER); - - // Use thin, gray lines to draw the grid - stroke(224); - strokeWeight(1); - - for (int row = 0; row < rowCount; row++) { - if (years[row] % yearInterval == 0) { - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - text(years[row], x, plotY2 + textAscent() + 10); - line(x, plotY1, x, plotY2); - } - } -} - - -void drawVolumeLabels() { - fill(0); - textSize(10); - textAlign(RIGHT); - - stroke(128); - strokeWeight(1); - - for (float v = dataMin; v <= dataMax; v += volumeIntervalMinor) { - if (v % volumeIntervalMinor == 0) { // If a tick mark - float y = map(v, dataMin, dataMax, plotY2, plotY1); - if (v % volumeInterval == 0) { // If a major tick mark - float textOffset = textAscent()/2; // Center vertically - if (v == dataMin) { - textOffset = 0; // Align by the bottom - } else if (v == dataMax) { - textOffset = textAscent(); // Align by the top - } - text(floor(v), plotX1 - 10, y + textOffset); - line(plotX1 - 4, y, plotX1, y); // Draw major tick - } else { - //line(plotX1 - 2, y, plotX1, y); // Draw minor tick - } - } - } -} - - -void drawDataArea(int col) { - beginShape(); - for (int row = 0; row < rowCount; row++) { - if (data.isValid(row, col)) { - float value = interpolators[row].value; - float x = map(years[row], yearMin, yearMax, plotX1, plotX2); - float y = map(value, dataMin, dataMax, plotY2, plotY1); - vertex(x, y); - } - } - vertex(plotX2, plotY2); - vertex(plotX1, plotY2); - endShape(CLOSE); -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java deleted file mode 100644 index 728d0913a..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/Integrator.java +++ /dev/null @@ -1,79 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class Integrator { - - static final float DAMPING = 0.5f; // formerly 0.9f - static final float ATTRACTION = 0.2f; // formerly 0.1f - - public float value = 0; - public float vel = 0; - public float accel = 0; - public float force = 0; - public float mass = 1; - - public float damping; - public float attraction; - public boolean targeting; - public float target; - - public float prev = Float.MAX_VALUE; - public float epsilon = 0.0001f; - - - public Integrator() { - this(0, DAMPING, ATTRACTION); - } - - - public Integrator(float value) { - this(value, DAMPING, ATTRACTION); - } - - - public Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - public void set(float v) { - value = v; - } - - - /** - * Update for next time step. - * Returns true if actually updated, false if no longer changing. - */ - public boolean update() { - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; - value += vel; - - force = 0; - - if (Math.abs(value - prev) < epsilon) { - value = target; - return false; - } - prev = value; - return true; - } - - - public void target(float t) { - targeting = true; - target = t; - } - - - public void noTarget() { - targeting = false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java deleted file mode 100644 index 20beeaaa5..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/RankedList.java +++ /dev/null @@ -1,121 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -import processing.core.PApplet; - - -public class RankedList { - // Number of elements in the list - protected int count; - // Array of values for the list - protected float[] value; - // Minimum and maximum values in the list - protected float minValue, maxValue; - // How this value is represented visually - protected String[] title; - // Rank for each item (0 is highest) - protected int[] rank; - // Ordering used while sorting by rank - protected int[] order; - // True if the element 0 is the lowest value, and count-1 the largest. - // (This has no bearing on what is considered the minValue and maxValue.) - protected boolean ascending; - - - RankedList(int count, boolean ascending) { - this.count = count; - this.ascending = ascending; - - value = new float[count]; - title = new String[count]; - rank = new int[count]; - } - - - public int getCount() { - return count; - } - - - public float getValue(int index) { - return value[index]; - } - - - public float getMinValue() { - return minValue; - } - - - public float getMaxValue() { - return maxValue; - } - - - public String getTitle(int index) { - return title[index]; - } - - - public int getRank(int index) { - return rank[index]; - } - - - // Sort the data and calculate min/max values - void update() { - // Set up an initial order to be sorted - order = new int[count]; - for (int i = 0; i < count; i++) { - order[i] = i; - } - sort(0, count-1); - - // Assign rankings based on the order after sorting - for (int i = 0; i < count; i++) { - rank[order[i]] = i; - } - - // Calculate minimum and maximum values - minValue = PApplet.min(value); - maxValue = PApplet.max(value); - } - - - void sort(int left, int right) { - int pivotIndex = (left+right)/2; - swap(pivotIndex, right); - int k = partition(left-1, right); - swap(k, right); - if ((k-left) > 1) sort(left, k-1); - if ((right-k) > 1) sort(k+1, right); - } - - - int partition(int left, int right) { - int pivot = right; - do { - while (compare(++left, pivot) < 0) ; - while ((right != 0) && (compare(--right, pivot) > 0)) ; - swap(left, right); - } while (left < right); - swap(left, right); - return left; - } - - - float compare(int a, int b) { - if (ascending) { - return value[order[a]] - value[order[b]]; - } else { - return value[order[b]] - value[order[a]]; - } - } - - - void swap(int a, int b) { - int temp = order[a]; - order[a] = order[b]; - order[b] = temp; - } -} diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv deleted file mode 100644 index 88df60d59..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/salaries.tsv +++ /dev/null @@ -1,30 +0,0 @@ -nyy 189639045 -bos 143026214 -nym 115231663 -ana 109251333 -cws 108671833 -la 108454524 -sea 106460833 -chc 99670332 -det 95180369 -bal 93554808 -stl 90286823 -sf 90219056 -phi 89428213 -hou 87759000 -atl 87290833 -tor 81942800 -oak 79366940 -min 71439500 -mil 70986500 -cin 68904980 -tex 68318675 -kc 67116500 -cle 61673267 -sd 58110567 -col 54424000 -ari 52067546 -pit 38537833 -was 37347500 -fla 30507000 -tb 24123500 diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif deleted file mode 100644 index ff68d49f1..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ana.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif deleted file mode 100644 index 4e328e797..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/ari.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif deleted file mode 100644 index f7731725f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/atl.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif deleted file mode 100644 index d7ca7d91d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bal.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif deleted file mode 100644 index 30691a634..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/bos.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif deleted file mode 100644 index 7235caaac..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/chc.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif deleted file mode 100644 index 648af180c..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cin.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif deleted file mode 100644 index 50c0fd72d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cle.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif deleted file mode 100644 index acfad7c96..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/col.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif deleted file mode 100644 index 1694536a8..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/cws.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif deleted file mode 100644 index bf2ca0cdf..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/det.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif deleted file mode 100644 index 157094e0c..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/fla.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif deleted file mode 100644 index 98afe6d29..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/hou.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif deleted file mode 100644 index 47a380c68..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/kc.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif deleted file mode 100644 index 0aa0696c2..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/la.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif deleted file mode 100644 index 06e0ce204..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/mil.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif deleted file mode 100644 index 6c27ea0c9..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/min.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif deleted file mode 100644 index 1fffcd8f3..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nym.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif deleted file mode 100644 index acfb715a0..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/nyy.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif deleted file mode 100644 index fd049c2de..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/oak.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif deleted file mode 100644 index abed04f58..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/phi.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif deleted file mode 100644 index 0d452b5e8..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/pit.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif deleted file mode 100644 index 8208d636f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sd.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif deleted file mode 100644 index 043a5fb48..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sea.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif deleted file mode 100644 index 57de12c9d..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/sf.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif deleted file mode 100644 index 0af78037f..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/stl.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif deleted file mode 100644 index 28083656b..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tb.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif deleted file mode 100644 index ac03b3751..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tex.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif deleted file mode 100644 index 0c61e7396..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/tor.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif deleted file mode 100644 index b015bc11a..000000000 Binary files a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/small/was.gif and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv deleted file mode 100644 index 5600af189..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/data/teams.tsv +++ /dev/null @@ -1,30 +0,0 @@ -nyy NY Yankees -bos Boston -nym New York Mets -ana LA Angels -cws Chi White Sox -la LA Dodgers -sea Seattle -chc Chi Cubs -det Detroit -bal Baltimore -stl St. Louis -sf San Francisco -phi Philadelphia -hou Houston -atl Atlanta -tor Toronto -oak Oakland -min Minnesota -mil Milwaukee -cin Cincinnati -tex Texas -kc Kansas City -cle Cleveland -sd San Diego -col Colorado -ari Arizona -pit Pittsburgh -was Washington -fla Florida -tb Tampa Bay \ No newline at end of file diff --git a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde b/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde deleted file mode 100644 index 9ded6d556..000000000 --- a/java/examples/Books/Visualizing Data/ch05-salaryper/step_08b_web/step_08b_web.pde +++ /dev/null @@ -1,475 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ -import java.util.Date; -import java.util.regex.*; -import java.text.*; - -int teamCount = 30; -String[] teamNames; -String[] teamCodes; -HashMap teamIndices; - -static final int ROW_HEIGHT = 23; -static final float HALF_ROW_HEIGHT = ROW_HEIGHT / 2.0f; - -static final int SIDE_PADDING = 30; -static final int TOP_PADDING = 40; - -SalaryList salaries; -StandingsList standings; - -StandingsList[] season; -Integrator[] standingsPosition; - -PImage[] logos; -float logoWidth; -float logoHeight; - -PFont font; - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -String firstDateStamp = "20070401"; -String lastDateStamp = "20070930"; -String todayDateStamp; - -static final long MILLIS_PER_DAY = 24 * 60 * 60 * 1000; - -// The number of days in the entire season. -int dateCount; -// The current date being shown. -int dateIndex; -// Don't show the first 10 days, they're too erratic. -int minDateIndex = 10; -// The last day of the season, or yesterday, if the season is ongoing. -// This is the maximum date that can be viewed. -int maxDateIndex; - -// This format makes "20070704" from the date July 4, 2007. -DateFormat stampFormat = new SimpleDateFormat("yyyyMMdd"); -// This format makes "4 July 2007" from the same. -DateFormat prettyFormat = new SimpleDateFormat("d MMMM yyyy"); - -// All dates for the season formatted with stampFormat. -String[] dateStamp; -// All dates in the season formatted with prettyFormat. -String[] datePretty; - -void setupDates() { - try { - Date firstDate = stampFormat.parse(firstDateStamp); - long firstDateMillis = firstDate.getTime(); - Date lastDate = stampFormat.parse(lastDateStamp); - long lastDateMillis = lastDate.getTime(); - - // Calculate number of days by dividing the total milliseconds - // between the first and last dates by the number of milliseconds per day - dateCount = (int) - ((lastDateMillis - firstDateMillis) / MILLIS_PER_DAY) + 1; - maxDateIndex = dateCount; - dateStamp = new String[dateCount]; - datePretty = new String[dateCount]; - - todayDateStamp = year() + nf(month(), 2) + nf(day(), 2); - // Another option to do this, but more code - //Date today = new Date(); - //String todayDateStamp = stampFormat.format(today); - - for (int i = 0; i < dateCount; i++) { - Date date = new Date(firstDateMillis + MILLIS_PER_DAY*i); - datePretty[i] = prettyFormat.format(date); - dateStamp[i] = stampFormat.format(date); - // If this value for 'date' is equal to today, then set the previous - // day as the maximum viewable date, because it means the season is - // still ongoing. The previous day is used because unless it is late - // in the evening, the updated numbers for the day will be unavailable - // or incomplete. - if (dateStamp[i].equals(todayDateStamp)) { - maxDateIndex = i-1; - } - } - } catch (ParseException e) { - die("Problem while setting up dates", e); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -public void setup() { - size(480, 750); - - setupTeams(); - setupDates(); - setupSalaries(); - // Load the standings after the salaries, because salary - // will be used as the tie-breaker when sorting. - setupStandings(); - setupRanking(); - setupLogos(); - - font = createFont("Georgia", 12); - textFont(font); - - frameRate(15); - // Use today as the current day - setDate(maxDateIndex); -} - - -void setupTeams() { - String[] lines = loadStrings("teams.tsv"); - - teamCount = lines.length; - teamCodes = new String[teamCount]; - teamNames = new String[teamCount]; - teamIndices = new HashMap(); - - for (int i = 0; i < teamCount; i++) { - String[] pieces = split(lines[i], TAB); - teamCodes[i] = pieces[0]; - teamNames[i] = pieces[1]; - teamIndices.put(teamCodes[i], new Integer(i)); - } -} - - -int teamIndex(String teamCode) { - Integer index = (Integer) teamIndices.get(teamCode); - return index.intValue(); -} - - -void setupSalaries() { - String[] lines = loadStrings("salaries.tsv"); - salaries = new SalaryList(lines); -} - - -/* -void setupStandings() { - season = new StandingsList[maxDateIndex + 1]; - for (int i = minDateIndex; i <= maxDateIndex; i++) { - String[] lines = acquireStandings(dateStamp[i]); - season[i] = new StandingsList(lines); - } -} -*/ - - -void setupStandings() { - String[] lines = loadStrings("http://benfry.com/writing/salaryper/mlb.cgi"); - int dataCount = lines.length / teamCount; - int expectedCount = (maxDateIndex - minDateIndex) + 1; - if (dataCount < expectedCount) { - println("Found " + dataCount + " entries in the data file, " + - "but was expecting " + expectedCount + " entries."); - maxDateIndex = minDateIndex + dataCount - 1; - } - season = new StandingsList[maxDateIndex + 1]; - for (int i = 0; i < dataCount; i++) { - String[] portion = subset(lines, i*teamCount, teamCount); - season[i+minDateIndex] = new StandingsList(portion); - } -} - - -void setupRanking() { - standingsPosition = new Integrator[teamCount]; - for (int i = 0; i < teamCodes.length; i++) { - standingsPosition[i] = new Integrator(i); - } -} - - -void setupLogos() { - logos = new PImage[teamCount]; - for (int i = 0; i < teamCount; i++) { - logos[i] = loadImage("small/" + teamCodes[i] + ".gif"); - } - logoWidth = logos[0].width / 2.0f; - logoHeight = logos[0].height / 2.0f; -} - - -public void draw() { - background(255); - smooth(); - - drawDateSelector(); - - translate(SIDE_PADDING, TOP_PADDING); - - boolean updated = false; - for (int i = 0; i < teamCount; i++) { - if (standingsPosition[i].update()) { - updated = true; - } - } - if (!updated) { - noLoop(); - } - - for (int i = 0; i < teamCount; i++) { - //float standingsY = standings.getRank(i)*ROW_HEIGHT + HALF_ROW_HEIGHT; - float standingsY = standingsPosition[i].value * ROW_HEIGHT + HALF_ROW_HEIGHT; - - image(logos[i], 0, standingsY - logoHeight/2, logoWidth, logoHeight); - - textAlign(LEFT, CENTER); - text(teamNames[i], 28, standingsY); - - textAlign(RIGHT, CENTER); - fill(128); - text(standings.getTitle(i), 150, standingsY); - - float weight = map(salaries.getValue(i), - salaries.getMinValue(), salaries.getMaxValue(), - 0.25f, 6); - strokeWeight(weight); - - float salaryY = salaries.getRank(i)*ROW_HEIGHT + HALF_ROW_HEIGHT; - if (salaryY >= standingsY) { - stroke(33, 85, 156); // Blue for positive (or equal) difference. - } else { - stroke(206, 0, 82); // Red for wasting money. - } - - line(160, standingsY, 325, salaryY); - - fill(128); - textAlign(LEFT, CENTER); - text(salaries.getTitle(i), 335, salaryY); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -int dateSelectorX; -int dateSelectorY = 30; - -// Draw a series of lines for selecting the date -void drawDateSelector() { - dateSelectorX = (width - dateCount*2) / 2; - - strokeWeight(1); - for (int i = 0; i < dateCount; i++) { - int x = dateSelectorX + i*2; - - // If this is the currently selected date, draw it differently - if (i == dateIndex) { - stroke(0); - line(x, 0, x, 13); - textAlign(CENTER, TOP); - text(datePretty[dateIndex], x, 15); - - } else { - // If this is a viewable date, make the line darker - if ((i >= minDateIndex) && (i <= maxDateIndex)) { - stroke(128); // Viewable date - } else { - stroke(204); // Not a viewable date - } - line(x, 0, x, 7); - } - } -} - - -void setDate(int index) { - dateIndex = index; - standings = season[dateIndex]; - - for (int i = 0; i < teamCount; i++) { - standingsPosition[i].target(standings.getRank(i)); - } - // Re-enable the animation loop - loop(); -} - - -void mousePressed() { - handleMouse(); -} - -void mouseDragged() { - handleMouse(); -} - -void handleMouse() { - if (mouseY < dateSelectorY) { - int date = (mouseX - dateSelectorX) / 2; - setDate(constrain(date, minDateIndex, maxDateIndex)); - } -} - - -void keyPressed() { - if (key == CODED) { - if (keyCode == LEFT) { - int newDate = max(dateIndex - 1, minDateIndex); - setDate(newDate); - - } else if (keyCode == RIGHT) { - int newDate = min(dateIndex + 1, maxDateIndex); - setDate(newDate); - } - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -/* -String[] acquireStandings(String stamp) { - int year = int(stamp.substring(0, 4)); - int month = int(stamp.substring(4, 6)); - int day = int(stamp.substring(6, 8)); - return acquireStandings(year, month, day); -} - - -String[] acquireStandings(int year, int month, int day) { - String filename = year + nf(month, 2) + nf(day, 2) + ".tsv"; - String path = dataPath(filename); - File file = new File(path); - if (!file.exists()) { - println("Downloading standings file " + filename); - PrintWriter writer = createWriter(path); - - String base = "http://mlb.mlb.com/components/game" + - "/year_" + year + "/month_" + nf(month, 2) + "/day_" + nf(day, 2) + "/"; - - // American League (AL) - parseWinLoss(base + "standings_rs_ale.js", writer); - parseWinLoss(base + "standings_rs_alc.js", writer); - parseWinLoss(base + "standings_rs_alw.js", writer); - - // National League (NL) - parseWinLoss(base + "standings_rs_nle.js", writer); - parseWinLoss(base + "standings_rs_nlc.js", writer); - parseWinLoss(base + "standings_rs_nlw.js", writer); - - writer.flush(); - writer.close(); - } - return loadStrings(filename); -} - - -void parseWinLoss(String filename, PrintWriter writer) { - String[] lines = loadStrings(filename); - Pattern p = Pattern.compile("\\s+([\\w\\d]+):\\s'(.*)',?"); - - String teamCode = ""; - int wins = 0; - int losses = 0; - - for (int i = 0; i < lines.length; i++) { - Matcher m = p.matcher(lines[i]); - - if (m.matches()) { - String attr = m.group(1); - String value = m.group(2); - - if (attr.equals("code")) { - teamCode = value; - } else if (attr.equals("w")) { - wins = parseInt(value); - } else if (attr.equals("l")) { - losses = parseInt(value); - } - - } else { - if (lines[i].startsWith("}")) { - // this is the end of a group, write these values - //println(team + " " + wins + "-" + losses); - //set(teamIndex(teamCode), wins, losses); - writer.println(teamCode + TAB + wins + TAB + losses); - } - } - } -} -*/ - - -//. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -class SalaryList extends RankedList { - - SalaryList(String[] lines) { - super(teamCount, false); - - for (int i = 0; i < teamCount; i++) { - String pieces[] = split(lines[i], TAB); - - // First column is the team 2-3 digit team code. - int index = teamIndex(pieces[0]); - - // Second column is the salary as a number. - value[index] = parseInt(pieces[1]); - - // Make the title in the format $NN,NNN,NNN - int salary = (int) value[index]; - title[index] = "$" + nfc(salary); - } - update(); - } -} - - -// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - -class StandingsList extends RankedList { - - StandingsList(String[] lines) { - super(teamCount, false); - - for (int i = 0; i < teamCount; i++) { - String[] pieces = split(lines[i], TAB); - int index = teamIndex(pieces[0]); - int wins = parseInt(pieces[1]); - int losses = parseInt(pieces[2]); - - value[index] = (float) wins / (float) (wins+losses); - title[index] = wins + "\u2013" + losses; - } - update(); - } - - float compare(int a, int b) { - // First compare based on the record of both teams - float amt = super.compare(a, b); - // If the record is not identical, return the difference - if (amt != 0) return amt; - - // If records are equal, use salary as tie-breaker. - // In this case, a and b are switched, because a higher - // salary is a negative thing, unlike the values above. - return salaries.compare(a, b); - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java deleted file mode 100644 index a41da0bb8..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/ColorIntegrator.java +++ /dev/null @@ -1,51 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class ColorIntegrator extends Integrator { - - float r0, g0, b0, a0; - float rs, gs, bs, as; - - int colorValue; - - - public ColorIntegrator(int color0, int color1) { - int a1 = (color0 >> 24) & 0xff; - int r1 = (color0 >> 16) & 0xff; - int g1 = (color0 >> 8) & 0xff; - int b1 = (color0 ) & 0xff; - - int a2 = (color1 >> 24) & 0xff; - int r2 = (color1 >> 16) & 0xff; - int g2 = (color1 >> 8) & 0xff; - int b2 = (color1 ) & 0xff; - - r0 = (float)r1 / 255.0f; - g0 = (float)g1 / 255.0f; - b0 = (float)b1 / 255.0f; - a0 = (float)a1 / 255.0f; - - rs = (r2 - r1) / 255.0f; - gs = (g2 - g1) / 255.0f; - bs = (b2 - b1) / 255.0f; - as = (a2 - a1) / 255.0f; - } - - - public boolean update() { - boolean updated = super.update(); - if (updated) { - colorValue = - (((int) ((a0 + as*value) * 255f) << 24) | - ((int) ((r0 + rs*value) * 255f) << 16) | - ((int) ((g0 + gs*value) * 255f) << 8) | - ((int) ((b0 + bs*value) * 255f))); - } - return updated; - } - - - public int get() { - return colorValue; - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java deleted file mode 100644 index 7aaa26cc8..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Integrator.java +++ /dev/null @@ -1,181 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class Integrator { - - static final float DAMPING = 0.5f; // formerly 0.9f - static final float ATTRACTION = 0.2f; // formerly 0.1f - - float value = 0; - float vel = 0; - float accel = 0; - float force = 0; - float mass = 1; - - float damping; // = DAMPING; - float attraction; // = ATTRACTION; - - boolean targeting; // = false; - float target; // = 0; - - - public Integrator() { - this.value = 0; - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public Integrator(float value) { - this.value = value; - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public Integrator(float value, float damping, float attraction) { - this.value = value; - this.damping = damping; - this.attraction = attraction; - } - - - public void set(float v) { - value = v; - //targeting = false ? - } - - - public boolean update() { // default dtime = 1.0 - if (targeting) { - force += attraction * (target - value); - } - - accel = force / mass; - vel = (vel + accel) * damping; /* e.g. 0.90 */ - value += vel; - - force = 0; // implicit reset - - return (vel > 0.0001f); - } - - - public void target(float t) { - targeting = true; - target = t; - } - - - public void noTarget() { - targeting = false; - } -} - - - /* - public void attraction(float targetValue, float a) { - force += attraction * (targetValue - value); - } - - public void attract(float target, float a) { - attraction(target, a); - update(); - } - - public void setDecay(float d) { - kDecay = d; - } - - public void decay() { - force -= kDecay * value; - } - - public void decay(float d) { - force -= d * value; - } - - public void setImpulse(float i) { - kImpulse = i; - } - - public void impulse() { - //printf("kimpulse is %f\n", kImpulse); - force += kImpulse; - //decay(-kImpulse); // lazy - } - - public void impulse(float i) { - force += i; - //decay(-i); // lazy - } - - public void setDamping(float d) { - kDamping = d; - } - - public void noise(float amount) { - force += (float) ((Math.random() * 2) - 1) * amount; - } - - public void add(float v) { - value += v; - } - - public void add(Integrator integrator) { - value += integrator.value; - } - */ - - - -/* - -void Integrator1f::updateRK() { // default dtime = 1.0 -#define H 0.001 - float f1 = force; - float f2 = force + H*f1/2; - float f3 = force + H*f2/2; - float f4 = force + H*f3; - velocity = velocity + (H/6)*(f1 + 2*f2 + 2*f3 + f4); -} - - eval(x) is the force - i think x should be time, so x is normally 1.0. - if dtime were incorporated, that would probably work - >> need correct function for force and dtime - - double f1 = fn.evalX(x); - double f2 = fn.evalX(x + h*f1/2); - double f3 = fn.evalX(x + h*f2/2); - double f4 = fn.evalX(x + h*f3); - - out = x + (h/6)*(f1 + 2*f2 + 2*f3 + f4); -*/ - -/* - - public void step(double t, double x, double y, - Function fn, double h, double out[]) { - double f1 = fn.evalX(t, x, y); - double g1 = fn.evalY(t, x, y); - - double f2 = fn.evalX(t + h/2, x + h*f1/2, y + h*g1/2); - double g2 = fn.evalY(t + h/2, x + h*f1/2, y + h*g1/2); - - double f3 = fn.evalX(t + h/2, x + h*f2/2, y + h*g2/2); - double g3 = fn.evalY(t + h/2, x + h*f2/2, y + h*g2/2); - - double f4 = fn.evalX(t + h, x + h*f3, y + h*g3); - double g4 = fn.evalY(t + h, x + h*f3, y + h*g3); - - out[0] = x + (h/6)*(f1 + 2*f2 + 2*f3 + f4); - out[1] = y + (h/6)*(g1 + 2*g2 + 2*g3 + g4); - } -*/ - -//void Integrator1f::update(float dtime) { -//velocity += force * dtime; -// value += velocity*dtime + 0.5f*force*dtime*dtime; -//force = 0; -//} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde deleted file mode 100644 index 81a806aea..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Place.pde +++ /dev/null @@ -1,131 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Place { - int code; - String name; - float x; - float y; - - int partial[]; - int matchDepth; - - - public Place(int code, String name, float lon, float lat) { - this.code = code; - this.name = name; - this.x = lon; - this.y = lat; - - partial = new int[6]; - partial[5] = code; - partial[4] = partial[5] / 10; - partial[3] = partial[4] / 10; - partial[2] = partial[3] / 10; - partial[1] = partial[2] / 10; - } - - - void check() { - // default to zero levels of depth that match - matchDepth = 0; - - if (typedCount != 0) { - // Start from the greatest depth, and work backwards to see how many - // items match. Want to figure out the maximum match, so better to - // begin from the end. - // The multiple levels of matching are important because more than one - // depth level might be fading at a time. - for (int j = typedCount; j > 0; --j) { - if (typedPartials[j] == partial[j]) { - matchDepth = j; - break; // since starting at end, can stop now - } - } - } - - //if (partial[typedCount] == partialCode) { - if (matchDepth == typedCount) { - foundCount++; - if (typedCount == 5) { - chosen = this; - } - - if (x < boundsX1) boundsX1 = x; - if (y < boundsY1) boundsY1 = y; - if (x > boundsX2) boundsX2 = x; - if (y > boundsY2) boundsY2 = y; - } - } - - void draw() { - float xx = TX(x); - float yy = TY(y); - - if ((xx < 0) || (yy < 0) || (xx >= width) || (yy >= height)) return; - - if ((zoomDepth.value < 2.8f) || !zoomEnabled) { // show simple dots - //pixels[((int) yy) * width + ((int) xx)] = faders[matchDepth].cvalue; - set((int)xx, (int)yy, faders[matchDepth].colorValue); - - } else { // show slightly more complicated dots - noStroke(); - - fill(faders[matchDepth].colorValue); - //rect(TX(nlon), TY(nlat), depther.value-1, depther.value-1); - - if (matchDepth == typedCount) { - if (typedCount == 4) { // on the fourth digit, show nums for the 5th - text(code % 10, TX(x), TY(y)); - } else { // show a larger box for selections - rect(xx, yy, zoomDepth.value, zoomDepth.value); - } - } else { // show a slightly smaller box for unselected - rect(xx, yy, zoomDepth.value-1, zoomDepth.value-1); - } - } - } - - - void drawChosen() { - noStroke(); - fill(faders[matchDepth].colorValue); - // the chosen point has to be a little larger when zooming - int size = zoomEnabled ? 6 : 4; - rect(TX(x), TY(y), size, size); - - // calculate position to draw the text, slightly offset from the main point - float textX = TX(x); - float textY = TY(y) - size - 4; - - // don't go off the top.. (e.g. 59544) - if (textY < 20) { - textY = TY(y) + 20; - } - - // don't run off the bottom.. (e.g. 33242) - if (textY > height - 5) { - textY = TY(y) - 20; - } - - String location = name + " " + nf(code, 5); - - if (zoomEnabled) { - textAlign(CENTER); - text(location, textX, textY); - - } else { - float wide = textWidth(location); - - if (textX > width/3) { - textX -= wide + 8; - } else { - textX += 8; - } - - textAlign(LEFT); - fill(highlightColor); - text(location, textX, textY); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde deleted file mode 100644 index ac5396896..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/Slurper.pde +++ /dev/null @@ -1,31 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Slurper implements Runnable { - - Slurper() { - Thread thread = new Thread(this); - thread.start(); - } - - public void run() { - try { - InputStream input = openStream("zips.gz"); - BufferedReader reader = createReader(input); - - // first get the info line - String line = reader.readLine(); - parseInfo(line); - - places = new Place[totalCount]; - - // parse each of the rest of the lines - while ((line = reader.readLine()) != null) { - places[placeCount] = parsePlace(line); - placeCount++; - } - } catch (IOException e) { - e.printStackTrace(); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw deleted file mode 100644 index c42b3f0d9..000000000 Binary files a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/data/ScalaSans-Regular-14.vlw and /dev/null differ diff --git a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde b/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde deleted file mode 100644 index b8ac21cae..000000000 --- a/java/examples/Books/Visualizing Data/ch06-zipdecode/round_09c_focus_handling/round_09c_focus_handling.pde +++ /dev/null @@ -1,393 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ - -color backgroundColor = #333333; // dark background color -color dormantColor = #999966; // initial color of the map -color highlightColor = #CBCBCB; // color for selected points -color unhighlightColor = #66664C; // color for points that are not selected -color waitingColor = #CBCBCB; // "please type a zip code" message -color badColor = #FFFF66; // text color when nothing found - -ColorIntegrator faders[]; - -// border of where the map should be drawn on screen -float mapX1, mapY1; -float mapX2, mapY2; - -// column numbers in the data file -static final int CODE = 0; -static final int X = 1; -static final int Y = 2; -static final int NAME = 3; - -int totalCount; // total number of places -Place[] places; -int placeCount; // number of places loaded - -// min/max boundary of all points -float minX, maxX; -float minY, maxY; - -// typing and selection -PFont font; -String typedString = ""; -char typedChars[] = new char[5]; -int typedCount; -int typedPartials[] = new int[6]; - -float messageX, messageY; - -int foundCount; -Place chosen; - -// smart updates -int notUpdatedCount = 0; - -// zoom -boolean zoomEnabled = false; -Integrator zoomDepth = new Integrator(); - -Integrator zoomX1; -Integrator zoomY1; -Integrator zoomX2; -Integrator zoomY2; - -float targetX1[] = new float[6]; -float targetY1[] = new float[6]; -float targetX2[] = new float[6]; -float targetY2[] = new float[6]; - -// boundary of currently valid points at this typedCount -float boundsX1, boundsY1; -float boundsX2, boundsY2; - - -public void setup() { - size(720, 453); - - mapX1 = 30; - mapX2 = width - mapX1; - mapY1 = 20; - mapY2 = height - mapY1; - - font = loadFont("ScalaSans-Regular-14.vlw"); - textFont(font); - - messageX = 40; - messageY = height - 40; - - faders = new ColorIntegrator[6]; - - // When nothing is typed, all points are shown with a color called - // "dormant," which is brighter than when not highlighted, but - // not as bright as the highlight color for a selection. - faders[0] = new ColorIntegrator(unhighlightColor, dormantColor); - faders[0].attraction = 0.5f; - faders[0].target(1); - - for (int i = 1; i < 6; i++) { - faders[i] = new ColorIntegrator(unhighlightColor, highlightColor); - faders[i].attraction = 0.5; - faders[i].target(1); - } - - readData(); - - zoomX1 = new Integrator(minX); - zoomY1 = new Integrator(minY); - zoomX2 = new Integrator(maxX); - zoomY2 = new Integrator(maxY); - - targetX1[0] = minX; - targetX2[0] = maxX; - targetY1[0] = minY; - targetY2[0] = maxY; - - rectMode(CENTER); - ellipseMode(CENTER); - frameRate(15); -} - - - -void readData() { - new Slurper(); -} - - -void parseInfo(String line) { - String infoString = line.substring(2); // remove the # - String[] infoPieces = split(infoString, ','); - totalCount = int(infoPieces[0]); - minX = float(infoPieces[1]); - maxX = float(infoPieces[2]); - minY = float(infoPieces[3]); - maxY = float(infoPieces[4]); -} - - -Place parsePlace(String line) { - String pieces[] = split(line, TAB); - - int zip = int(pieces[CODE]); - float x = float(pieces[X]); - float y = float(pieces[Y]); - String name = pieces[NAME]; - - return new Place(zip, name, x, y); -} - - -// change message from 'click inside the window' -public void focusGained() { - redraw(); -} - -// change message to 'click inside the window' -public void focusLost() { - redraw(); -} - -// this method is empty in p5 -public void mouseEntered() { - requestFocus(); -} - - -public void draw() { - background(backgroundColor); - - updateAnimation(); - - for (int i = 0; i < placeCount; i++) { - places[i].draw(); - } - - if (typedCount == 0) { - fill(waitingColor); - textAlign(LEFT); - String message = "zipdecode by ben fry"; - // if all places are loaded - if (placeCount == totalCount) { - if (focused) { - message = "type the digits of a zip code"; - } else { - message = "click the map image to begin"; - } - } - text(message, messageX, messageY); - - } else { - if (foundCount > 0) { - if (!zoomEnabled && (typedCount == 4)) { - // re-draw the chosen ones, because they're often occluded - // by the non-selected points - for (int i = 0; i < placeCount; i++) { - if (places[i].matchDepth == typedCount) { - places[i].draw(); - } - } - } - - if (chosen != null) { - chosen.drawChosen(); - } - - fill(highlightColor); - textAlign(LEFT); - text(typedString, messageX, messageY); - - } else { - fill(badColor); - text(typedString, messageX, messageY); - } - } - - // draw "zoom" text toggle - textAlign(RIGHT); - fill(zoomEnabled ? highlightColor : unhighlightColor); - text("zoom", width - 40, height - 40); - textAlign(LEFT); -} - - -void updateAnimation() { - boolean updated = false; - - for (int i = 0; i < 6; i++) { - updated |= faders[i].update(); - } - - if (foundCount > 0) { - zoomDepth.target(typedCount); - } else { - zoomDepth.target(typedCount-1); - } - updated |= zoomDepth.update(); - - updated |= zoomX1.update(); - updated |= zoomY1.update(); - updated |= zoomX2.update(); - updated |= zoomY2.update(); - - // if the data is loaded, can optionally call noLoop() to save cpu - if (placeCount == totalCount) { // if fully loaded - if (!updated) { - notUpdatedCount++; - // after 20 frames of no updates, shut off the loop - if (notUpdatedCount > 20) { - noLoop(); - notUpdatedCount = 0; - } - } else { - notUpdatedCount = 0; - } - } -} - - -float TX(float x) { - if (zoomEnabled) { - return map(x, zoomX1.value, zoomX2.value, mapX1, mapX2); - - } else { - return map(x, minX, maxX, mapX1, mapX2); - } -} - - -float TY(float y) { - if (zoomEnabled) { - return map(y, zoomY1.value, zoomY2.value, mapY2, mapY1); - - } else { - return map(y, minY, maxY, mapY2, mapY1); - } -} - - -void mousePressed() { - if ((mouseX > width-100) && (mouseY > height - 50)) { - zoomEnabled = !zoomEnabled; - redraw(); - } -} - - -void keyPressed() { - if ((key == BACKSPACE) || (key == DELETE)) { - if (typedCount > 0) { - typedCount--; - } - updateTyped(); - - } else if ((key >= '0') && (key <= '9')) { - if (typedCount != 5) { // only 5 digits - if (foundCount > 0) { // don't allow to keep typing bad - typedChars[typedCount++] = key; - } - } - } - updateTyped(); -} - - -void updateTyped() { - typedString = new String(typedChars, 0, typedCount); - - // Un-highlight areas already typed past - for (int i = 0; i < typedCount; i++) faders[i].target(0); - // Highlight potential dots not yet selected by keys - for (int i = typedCount; i < 6; i++) faders[i].target(1); - - typedPartials[typedCount] = int(typedString); - for (int j = typedCount-1; j > 0; --j) { - typedPartials[j] = typedPartials[j + 1] / 10; - } - - foundCount = 0; - chosen = null; - - boundsX1 = maxX; - boundsY1 = maxY; - boundsX2 = minX; - boundsY2 = minY; - - for (int i = 0; i < placeCount; i++) { - // update boundaries of selection - // and identify whether a particular place is chosen - places[i].check(); - } - calcZoom(); - - loop(); // re-enable updates -} - - -void calcZoom() { - if (foundCount != 0) { - // given a set of min/max coords, expand in one direction so that the - // selected area includes the range with the proper aspect ratio - - float spanX = (boundsX2 - boundsX1); - float spanY = (boundsY2 - boundsY1); - - float midX = (boundsX1 + boundsX2) / 2; - float midY = (boundsY1 + boundsY2) / 2; - - if ((spanX != 0) && (spanY != 0)) { - float screenAspect = width / float(height); - float spanAspect = spanX / spanY; - - if (spanAspect > screenAspect) { - spanY = (spanX / width) * height; // wide - - } else { - spanX = (spanY / height) * width; // tall - } - } else { // if span is zero - // use the span from one level previous - spanX = targetX2[typedCount-1] - targetX1[typedCount-1]; - spanY = targetY2[typedCount-1] - targetY1[typedCount-1]; - } - targetX1[typedCount] = midX - spanX/2; - targetX2[typedCount] = midX + spanX/2; - targetY1[typedCount] = midY - spanY/2; - targetY2[typedCount] = midY + spanY/2; - - } else if (typedCount != 0) { - // nothing found at this level, so set the zoom identical to the previous - targetX1[typedCount] = targetX1[typedCount-1]; - targetY1[typedCount] = targetY1[typedCount-1]; - targetX2[typedCount] = targetX2[typedCount-1]; - targetY2[typedCount] = targetY2[typedCount-1]; - } - - zoomX1.target(targetX1[typedCount]); - zoomY1.target(targetY1[typedCount]); - zoomX2.target(targetX2[typedCount]); - zoomY2.target(targetY2[typedCount]); - - if (!zoomEnabled) { - zoomX1.set(zoomX1.target); - zoomY1.set(zoomY1.target); - zoomX2.set(zoomX2.target); - zoomY2.set(zoomY2.target); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde deleted file mode 100644 index cb42dd954..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordItem.pde +++ /dev/null @@ -1,23 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class WordItem extends SimpleMapItem { - String word; - - WordItem(String word) { - this.word = word; - } - - void draw() { - fill(255); - rect(x, y, w, h); - - fill(0); - if (w > textWidth(word) + 6) { - if (h > textAscent() + 6) { - textAlign(CENTER, CENTER); - text(word, x + w/2, y + h/2); - } - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde deleted file mode 100644 index 157dd51d7..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/WordMap.pde +++ /dev/null @@ -1,24 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class WordMap extends SimpleMapModel { - HashMap words; - - WordMap() { - words = new HashMap(); - } - - void addWord(String word) { - WordItem item = (WordItem) words.get(word); - if (item == null) { - item = new WordItem(word); - words.put(word, item); - } - item.incrementSize(); - } - - void finishAdd() { - items = new WordItem[words.size()]; - words.values().toArray(items); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt deleted file mode 100644 index d65650116..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/data/equator.txt +++ /dev/null @@ -1,194700 +0,0 @@ -produced -by -david -widger -following -the -equator -a -journey -around -the -world -by -mark -twain -samuel -l -clemens -hartford -connecticut -this -book -is -affectionately -inscribed -to -my -young -friend -harry -rogers -with -recognition -of -what -he -is -and -apprehension -of -what -he -may -become -unless -he -form -himself -a -little -more -closely -upon -the -model -of -the -author -the -pudd'nhead -maxims -these -wisdoms -are -for -the -luring -of -youth -toward -high -moral -altitudes -the -author -did -not -gather -them -from -practice -but -from -observation -to -be -good -is -noble -but -to -show -others -how -to -be -good -is -nobler -and -no -trouble -contents -chapter -i -the -party -across -america -to -vancouver -on -board -the -warrimo -steamer -chairs -the -captain -going -home -under -a -cloud -a -gritty -purser -the -brightest -passenger -remedy -for -bad -habits -the -doctor -and -the -lumbago -a -moral -pauper -limited -smoking -remittance -men -chapter -ii -change -of -costume -fish -snake -and -boomerang -stories -tests -of -memory -a -brahmin -expert -general -grant's -memory -a -delicately -improper -tale -chapter -iii -honolulu -reminiscences -of -the -sandwich -islands -king -liholiho -and -his -royal -equipment -the -tabu -the -population -of -the -island -a -kanaka -diver -cholera -at -honolulu -honolulu -past -and -present -the -leper -colony -chapter -iv -leaving -honolulu -flying -fish -approaching -the -equator -why -the -ship -went -slow -the -front -yard -of -the -ship -crossing -the -equator -horse -billiards -or -shovel -board -the -waterbury -watch -washing -decks -ship -painters -the -great -meridian -the -loss -of -a -day -a -babe -without -a -birthday -chapter -v -a -lesson -in -pronunciation -reverence -for -robert -burns -the -southern -cross -troublesome -constellations -victoria -for -a -name -islands -on -the -map -alofa -and -fortuna -recruiting -for -the -queensland -plantations -captain -warren's -notebook -recruiting -not -thoroughly -popular -chapter -vi -missionaries -obstruct -business -the -sugar -planter -and -the -kanaka -the -planter's -view -civilizing -the -kanaka -the -missionary's -view -the -result -repentant -kanakas -wrinkles -the -death -rate -in -queensland -chapter -vii -the -fiji -islands -suva -the -ship -from -duluth -going -ashore -midwinter -in -fiji -seeing -the -governor -why -fiji -was -ceded -to -england -old -time -fijians -convicts -among -the -fijians -a -case -where -marriage -was -a -failure -immortality -with -limitations -chapter -viii -a -wilderness -of -islands -two -men -without -a -country -a -naturalist -from -new -zealand -the -fauna -of -australasia -animals -insects -and -birds -the -ornithorhynchus -poetry -and -plagiarism -chapter -ix -close -to -australia -porpoises -at -night -entrance -to -sydney -harbor -the -loss -of -the -duncan -dunbar -the -harbor -the -city -of -sydney -spring -time -in -australia -the -climate -information -for -travelers -the -size -of -australia -a -dust -storm -and -hot -wind -chapter -x -the -discovery -of -australia -transportation -of -convicts -discipline -english -laws -ancient -and -modern -flogging -prisoners -to -death -arrival -of -settlers -new -south -wales -corps -rum -currency -intemperance -everywhere -$100 -000 -for -one -gallon -of -rum -development -of -the -country -immense -resources -chapter -xi -hospitality -of -english -speaking -people -writers -and -their -gratitude -mr -gane -and -the -panegyrics -population -of -sydney -an -english -city -with -american -trimming -squatters -palaces -and -sheep -kingdoms -wool -and -mutton -australians -and -americans -costermonger -pronunciation -england -is -home -table -talk -english -and -colonial -audiences -124 -chapter -xii -mr -x -a -missionary -why -christianity -makes -slow -progress -in -india -a -large -dream -hindoo -miracles -and -legends -sampson -and -hanuman -the -sandstone -ridge -where -are -the -gates -chapter -xiii -public -works -in -australasia -botanical -garden -of -sydney -four -special -socialties -the -government -house -a -governor -and -his -functions -the -admiralty -house -the -tour -of -the -harbor -shark -fishing -cecil -rhodes' -shark -and -his -first -fortune -free -board -for -sharks -chapter -xiv -bad -health -to -melbourne -by -rail -maps -defective -the -colony -of -victoria -a -round -trip -ticket -from -sydney -change -cars -from -wide -to -narrow -gauge -a -peculiarity -at -albury -customs -fences -my -word -the -blue -mountains -rabbit -piles -government -r -r -restaurants -duchesses -for -waiters -sheep -dip -railroad -coffee -things -seen -and -not -seen -chapter -xv -wagga -wagga -the -tichborne -claimant -a -stock -mystery -the -plan -of -the -romance -the -realization -the -henry -bascom -mystery -bascom -hall -the -author's -death -and -funeral -chapter -xvi -melbourne -and -its -attractions -the -melbourne -cup -races -cup -day -great -crowds -clothes -regardless -of -cost -the -australian -larrikin -is -he -dead -australian -hospitality -melbourne -wool -brokers -the -museums -the -palaces -the -origin -of -melbourne -chapter -xvii -the -british -empire -its -exports -and -imports -the -trade -of -australia -to -adelaide -broken -hill -silver -mine -a -roundabout -road -the -scrub -and -its -possibilities -for -the -novelist -the -aboriginal -tracker -a -test -case -how -does -one -cow -track -differ -from -another -chapter -xviii -gum -trees -unsociable -trees -gorse -and -broom -a -universal -defect -an -adventurer -wanted -l200 -got -l20 -000 -000 -a -vast -land -scheme -the -smash -up -the -corpse -got -up -and -danced -a -unique -business -by -one -man -buying -the -kangaroo -skin -the -approach -to -adelaide -everything -comes -to -him -who -waits -a -healthy -religious -sphere -what -is -the -matter -with -the -specter -chapter -xix -the -botanical -gardens -contributions -from -all -countries -the -zoological -gardens -of -adelaide -the -laughing -jackass -the -dingo -a -misnamed -province -telegraphing -from -melbourne -to -san -francisco -a -mania -for -holidays -the -temperature -the -death -rate -celebration -of -the -reading -of -the -proclamation -of -1836 -some -old -settlers -at -the -commemoration -their -staying -powers -the -intelligence -of -the -aboriginal -the -antiquity -of -the -boomerang -chapter -xx -a -caller -a -talk -about -old -times -the -fox -hunt -an -accurate -judgment -of -an -idiot -how -we -passed -the -custom -officers -in -italy -chapter -xxi -the -weet -weet -keeping -down -the -population -victoria -killing -the -aboriginals -pioneer -days -in -queensland -material -for -a -drama -the -bush -pudding -with -arsenic -revenge -a -right -spirit -but -a -wrong -method -death -of -donga -billy -chapter -xxii -continued -description -of -aboriginals -manly -qualities -dodging -balls -feats -of -spring -jumping -where -the -kangaroo -learned -its -art -'well -digging -endurance -surgery -artistic -abilities -fennimore -cooper's -last -chance -australian -slang -chapter -xxiii -to -horsham -colony -of -victoria -description -of -horsham -at -the -hotel -pepper -tree -the -agricultural -college -forty -pupils -high -temperature -width -of -road -in -chains -perches -etc -the -bird -with -a -forgettable -name -the -magpie -and -the -lady -fruit -trees -soils -sheep -shearing -to -stawell -gold -mining -country -$75 -000 -per -month -income -and -able -to -keep -house -fine -grapes -and -wine -the -dryest -community -on -earth -the -three -sisters -gum -trees -and -water -chapter -xxiv -road -to -ballarat -the -city -great -gold -strike -1851 -rush -for -australia -great -nuggets -taxation -revolt -and -victory -peter -lalor -and -the -eureka -stockade -pencil -mark -fine -statuary -at -ballarat -population -ballarat -english -chapter -xxv -bound -for -bendigo -the -priest -at -castlemaine -time -saved -by -walking -description -of -bendigo -a -valuable -nugget -perseverence -and -success -mr -blank -and -his -influence -conveyance -of -an -idea -i -had -to -like -the -irishman -corrigan -castle -and -the -mark -twain -club -my -bascom -mystery -solved -chapter -xxvi -where -new -zealand -is -but -few -know -things -people -think -they -know -the -yale -professor -and -his -visitor -from -n -z -chapter -xxvii -the -south -pole -swell -tasmania -extermination -of -the -natives -the -picture -proclamation -the -conciliator -the -formidable -sixteen -chapter -xxviii -when -the -moment -comes -the -man -appears -why -ed -jackson -called -on -commodore -vanderbilt -their -interview -welcome -to -the -child -of -his -friend -a -big -time -but -under -inspection -sent -on -important -business -a -visit -to -the -boys -on -the -boat -chapter -xxix -tasmania -early -days -description -of -the -town -of -hobart -an -englishman's -love -of -home -surroundings -neatest -city -on -earth -the -museum -a -parrot -with -an -acquired -taste -glass -arrow -beads -refuge -for -the -indigent -too -healthy -chapter -xxx -arrival -at -bluff -n -z -where -the -rabbit -plague -began -the -natural -enemy -of -the -rabbit -dunedin -a -lovely -town -visit -to -dr -hockin -his -museum -a -liquified -caterpillar -the -unperfected -tape -worm -the -public -museum -and -picture -chapter -xxxi -the -express -train -a -hell -of -a -hotel -at -maryborough -clocks -and -bells -railroad -service -chapter -xxxii -description -of -the -town -of -christ -church -a -fine -museum -jade -stone -trinkets -the -great -man -the -first -maori -in -new -zealand -women -voters -person -in -new -zealand -law -includes -woman -taming -an -ornithorhynchus -a -voyage -in -the -'flora' -from -lyttelton -cattle -stalls -for -everybody -a -wonderful -time -chapter -xxxiii -the -town -of -nelson -the -mongatapu -murders -the -great -event -of -the -town -burgess' -confession -summit -of -mount -eden -rotorua -and -the -hot -lakes -and -geysers -thermal -springs -district -kauri -gum -tangariwa -mountains -chapter -xxxiv -the -bay -of -gisborne -taking -in -passengers -by -the -yard -arm -the -green -ballarat -fly -false -teeth -from -napier -to -hastings -by -the -ballarat -fly -train -kauri -trees -a -case -of -mental -telegraphy -chapter -xxxv -fifty -miles -in -four -hours -comfortable -cars -town -of -wauganui -plenty -of -maoris -on -the -increase -compliments -to -the -maoris -the -missionary -ways -all -wrong -the -tabu -among -the -maoris -a -mysterious -sign -curious -war -monuments -wellington -chapter -xxxvi -the -poems -of -mrs -moore -the -sad -fate -of -william -upson -a -fellow -traveler -imitating -the -prince -of -wales -a -would -be -dude -arrival -at -sydney -curious -town -names -with -poem -chapter -xxxvii -from -sydney -for -ceylon -a -lascar -crew -a -fine -ship -three -cats -and -a -basket -of -kittens -dinner -conversations -veuve -cliquot -wine -at -anchor -in -king -george's -sound -albany -harbor -more -cats -a -vulture -on -board -nearing -the -equator -again -dressing -for -dinner -ceylon -hotel -bristol -servant -brampy -a -feminine -man -japanese -jinriksha -or -cart -scenes -in -ceylon -a -missionary -school -insincerity -of -clothes -chapter -xxxviii -steamer -rosettes -to -bombay -limes -14 -cents -a -barrel -bombay -a -bewitching -city -descriptions -of -people -and -dress -woman -as -a -road -decoration -india -the -land -of -dreams -and -romance -fourteen -porters -to -carry -baggage -correcting -a -servant -killing -a -slave -arranging -a -bedroom -three -hours' -work -and -a -terrible -racket -the -bird -of -birds -the -indian -crow -chapter -xxxix -god -vishnu -108 -names -change -of -titles -or -hunting -for -an -heir -bombay -as -a -kaleidoscope -the -native's -man -servant -servants' -recommendations -how -manuel -got -his -name -and -his -english -satan -a -visit -from -god -chapter -xl -the -government -house -at -malabar -point -mansion -of -kumar -shri -samatsin -hji -bahadur -the -indian -princess -a -difficult -game -wardrobe -and -jewels -ceremonials -decorations -when -leaving -the -towers -of -silence -a -funeral -chapter -xli -jain -temple -mr -roychand's -bungalow -a -decorated -six -gun -prince -human -fireworks -european -dress -past -and -present -complexions -advantages -with -the -zulu -festivities -at -the -bungalow -nautch -dancers -entrance -of -the -prince -address -to -the -prince -chapter -xlii -a -hindoo -betrothal -midnight -sleepers -on -the -ground -home -of -the -bride -of -twelve -years -dressed -as -a -boy -illumination -nautch -girls -imitating -snakes -later -illuminated -porch -filled -with -sleepers -the -plague -chapter -xliii -murder -trial -in -bombay -confidence -swindlers -some -specialities -of -india -the -plague -juggernaut -suttee -etc -everything -on -gigantic -scale -india -first -in -everything -80 -states -more -custom -houses -than -cats -rich -ground -for -thug -society -chapter -xliv -thug -book -supplies -for -traveling -bedding -and -other -freight -scene -at -railway -station -making -way -for -white -man -waiting -passengers -high -and -low -caste -touch -in -the -cars -our -car -beds -made -up -dreaming -of -thugs -baroda -meet -friends -indian -well -the -old -town -narrow -streets -a -mad -elephant -chapter -xlv -elephant -riding -howdahs -the -new -palace -the -prince's -excursion -gold -and -silver -artillery -a -vice -royal -visit -remarkable -dog -the -bench -show -augustin -daly's -back -door -fakeer -chapter -xlvi -the -thugs -government -efforts -to -exterminate -them -choking -a -victim -a -fakeer -spared -thief -strangled -chapter -xlvii -thugs -continued -record -of -murders -a -joy -of -hunting -and -killing -men -gordon -gumming -killing -an -elephant -family -affection -among -thugs -burial -places -chapter -xlviii -starting -for -allahabad -lower -berths -in -sleepers -elderly -ladies -have -preference -of -berths -an -american -lady -takes -one -anyhow -how -smythe -lost -his -berth -how -he -got -even -the -suttee -chapter -xlix -pyjamas -day -scene -in -india -clothed -in -a -turban -and -a -pocket -handkerchief -land -parceled -out -established -village -servants -witches -in -families -hereditary -midwifery -destruction -of -girl -babies -wedding -display -tiger -persuader -hailstorm -discourages -the -tyranny -of -the -sweeper -elephant -driver -water -carrier -curious -rivers -arrival -at -allahabad -english -quarter -lecture -hall -like -a -snowstorm -private -carriages -a -milliner -early -morning -the -squatting -servant -a -religious -fair -chapter -l -on -the -road -to -benares -dust -and -waiting -the -bejeweled -crowd -a -native -prince -and -his -guard -zenana -lady -the -extremes -of -fashion -the -hotel -at -benares -an -annex -a -mile -away -doors -in -india -the -peepul -tree -warning -against -cold -baths -a -strange -fruit -description -of -benares -the -beginning -of -creation -pilgrims -to -benares -a -priest -with -a -good -business -stand -protestant -missionary -the -trinity -brahma -shiva -and -vishnu -religion -the -business -at -benares -chapter -li -benares -a -religious -temple -a -guide -for -pilgrims -to -save -time -in -securing -salvation -chapter -lii -a -curious -way -to -secure -salvation -the -banks -of -the -ganges -architecture -represents -piety -a -trip -on -the -river -bathers -and -their -costumes -drinking -the -water -a -scientific -test -of -the -nasty -purifier -hindoo -faith -in -the -ganges -a -cremation -remembrances -of -the -suttee -all -life -sacred -except -human -life -the -goddess -bhowanee -and -the -sacrificers -sacred -monkeys -ugly -idols -everywhere -two -white -minarets -a -great -view -with -a -monkey -in -it -a -picture -on -the -water -chapter -liii -still -in -benares -another -living -god -why -things -are -wonderful -sri -108 -utterly -perfect -how -he -came -so -our -visit -to -sri -a -friendly -deity -exchanging -autographs -and -books -sri's -pupil -an -interesting -man -reverence -and -irreverence -dancing -in -a -sepulchre -chapter -liv -rail -to -calcutta -population -the -city -of -palaces -a -fluted -candle -stick -ochterlony -newspaper -correspondence -average -knowledge -of -countries -a -wrong -idea -of -chicago -calcutta -and -the -black -hole -description -of -the -horrors -those -who -lived -the -botanical -gardens -the -afternoon -turnout -grand -review -military -tournament -excursion -on -the -hoogly -the -museum -what -winter -means -calcutta -chapter -lv -on -the -road -again -flannels -in -order -across -country -from -greenland's -icy -mountain -swapping -civilization -no -field -women -in -india -how -it -is -in -other -countries -canvas -covered -cars -the -tiger -country -my -first -hunt -some -elephants -get -away -the -plains -of -india -the -ghurkas -women -for -pack -horses -a -substitute -for -a -cab -darjeeling -the -hotel -the -highest -thing -in -the -himalayas -the -club -kinchinjunga -and -mt -everest -thibetans -the -prayer -wheel -people -going -to -the -bazar -chapter -lvi -on -the -road -again -the -hand -car -a -thirty -five -mile -slide -the -banyan -tree -a -dramatic -performance -the -railroad -the -half -way -house -the -brain -fever -bird -the -coppersmith -bird -nightingales -and -cue -owls -chapter -lvii -india -the -most -extraordinary -country -on -earth -nothing -forgotten -the -land -of -wonders -annual -statistics -everywhere -about -violence -tiger -vs -man -a -handsome -fight -annual -man -killing -and -tiger -killing -other -animals -snakes -insurance -and -snake -tables -the -cobra -bite -muzaffurpore -dinapore -a -train -that -stopped -for -gossip -six -hours -for -thirty -five -miles -a -rupee -to -the -engineer -ninety -miles -an -hour -again -to -benares -the -piety -hive -to -lucknow -chapter -lviii -the -great -mutiny -the -massacre -in -cawnpore -terrible -scenes -in -lucknow -the -residency -the -siege -chapter -lix -a -visit -to -the -residency -cawnpore -the -adjutant -bird -and -the -hindoo -corpse -the -tai -mahal -the -true -conception -the -ice -storm -true -gems -syrian -fountains -an -exaggerated -niagara -chapter -lx -to -lahore -the -governor's -elephant -taking -a -ride -no -danger -from -collision -rawal -pindi -back -to -delhi -an -orientalized -englishman -monkeys -and -the -paint -pot -monkey -crying -over -my -note -book -arrival -at -jeypore -in -rajputana -watching -servants -the -jeypore -hotel -our -old -and -new -satan -satan -as -a -liar -the -museum -a -street -show -blocks -of -houses -a -religious -procession -chapter -lxi -methods -in -american -deaf -and -dumb -asylums -methods -in -the -public -schools -a -letter -from -a -youth -in -punjab -highly -educated -service -a -damage -to -the -country -a -little -book -from -calcutta -writing -poor -english -embarrassed -by -a -beggar -girl -a -specimen -letter -an -application -for -employment -a -calcutta -school -examination -two -samples -of -literature -chapter -lxii -sail -from -calcutta -to -madras -thence -to -ceylon -thence -for -mauritius -the -indian -ocean -our -captain's -peculiarity -the -scot -has -one -too -the -flying -fish -that -went -hunting -in -the -field -fined -for -smuggling -lots -of -pets -on -board -the -color -of -the -sea -the -most -important -member -of -nature's -family -the -captain's -story -of -cold -weather -omissions -in -the -ship's -library -washing -decks -pyjamas -on -deck -the -cat's -toilet -no -interest -in -the -bulletin -perfect -rest -the -milky -way -and -the -magellan -clouds -mauritius -port -louis -a -hot -country -under -french -control -a -variety -of -people -and -complexions -train -to -curepipe -a -wonderful -office -holder -the -wooden -peg -ornament -the -prominent -historical -event -of -mauritius -paul -and -virginia -one -of -virginia's -wedding -gifts -heaven -copied -after -mauritius -early -history -of -mauritius -quarantines -population -of -all -kinds -what -the -world -consists -of -where -russia -and -germany -are -a -picture -of -milan -cathedral -newspapers -the -language -best -sugar -in -the -world -literature -of -mauritius -chapter -lxiii -port -louis -matches -no -good -good -roads -death -notices -why -european -nations -rob -each -other -what -immigrants -to -mauritius -do -population -labor -wages -the -camaron -the -palmiste -and -other -eatables -monkeys -the -cyclone -of -1892 -mauritius -a -sunday -landscape -chapter -lxiv -the -steamer -arundel -castle -poor -beds -in -ships -the -beds -in -noah's -ark -getting -a -rest -in -europe -ship -in -sight -mozambique -channel -the -engineer -and -the -band -thackeray's -madagascar -africanders -going -home -singing -on -the -after -deck -an -out -of -place -story -dynamite -explosion -in -johannesburg -entering -delagoa -bay -ashore -a -hot -winter -small -town -no -sights -no -carriages -working -women -barnum's -purchase -of -shakespeare's -birthplace -jumbo -and -the -nelson -monument -arrival -at -durban -chapter -lxv -royal -hotel -durban -bells -that -did -not -ring -early -inquiries -for -comforts -change -of -temperature -after -sunset -rickhaws -the -hotel -chameleon -natives -not -out -after -the -bell -preponderance -of -blacks -in -natal -hair -fashions -in -natal -zulus -for -police -a -drive -round -the -berea -the -cactus -and -other -trees -religion -a -vital -matter -peculiar -views -about -babies -zulu -kings -a -trappist -monastery -transvaal -politics -reasons -why -the -trouble -came -about -chapter -lxvi -jameson -over -the -border -his -defeat -and -capture -sent -to -england -for -trial -arrest -of -citizens -by -the -boers -commuted -sentences -final -release -of -all -but -two -interesting -days -for -a -stranger -hard -to -understand -either -side -what -the -reformers -expected -to -accomplish -how -they -proposed -to -do -it -testimonies -a -year -later -a -woman's -part -the -truth -of -the -south -african -situation -jameson's -ride -a -poem -chapter -lxvil -jameson's -raid -the -reform -committee's -difficult -task -possible -plans -advice -that -jameson -ought -to -have -the -war -of -1881 -and -its -lessons -statistics -of -losses -of -the -combatants -jameson's -battles -losses -on -both -sides -the -military -errors -how -the -warfare -should -have -been -carried -on -to -be -successful -chapter -lxviii -judicious -mr -rhodes -what -south -africa -consists -of -johannesburg -the -gold -mines -the -heaven -of -american -engineers -what -the -author -knows -about -mining -description -of -the -boer -what -should -be -expected -of -him -what -was -a -dizzy -jump -for -rhodes -taxes -rhodesian -method -of -reducing -native -population -journeying -in -cape -colony -the -cars -the -country -the -weather -tamed -blacks -familiar -figures -in -king -william's -town -boer -dress -boer -country -life -sleeping -accommodations -the -reformers -in -boer -prison -torturing -a -black -prisoner -chapter -lxix -an -absorbing -novelty -the -kimberley -diamond -mines -discovery -of -diamonds -the -wronged -stranger -where -the -gems -are -a -judicious -change -of -boundary -modern -machinery -and -appliances -thrilling -excitement -in -finding -a -diamond -testing -a -diamond -fences -deep -mining -by -natives -in -the -compound -stealing -reward -for -the -biggest -diamond -a -fortune -in -wine -the -great -diamond -office -of -the -de -beer -co -sorting -the -gems -cape -town -the -most -imposing -man -in -british -provinces -various -reasons -for -his -supremacy -how -he -makes -friends -conclusion -table -rock -table -bay -the -castle -government -and -parliament -the -club -dutch -mansions -and -their -hospitality -dr -john -barry -and -his -doings -on -the -ship -norman -madeira -arrived -in -southampton -following -the -equator -chapter -i -a -man -may -have -no -bad -habits -and -have -worse -pudd'nhead -wilson's -new -calendar -the -starting -point -of -this -lecturing -trip -around -the -world -was -paris -where -we -had -been -living -a -year -or -two -we -sailed -for -america -and -there -made -certain -preparations -this -took -but -little -time -two -members -of -my -family -elected -to -go -with -me -also -a -carbuncle -the -dictionary -says -a -carbuncle -is -a -kind -of -jewel -humor -is -out -of -place -in -a -dictionary -we -started -westward -from -new -york -in -midsummer -with -major -pond -to -manage -the -platform -business -as -far -as -the -pacific -it -was -warm -work -all -the -way -and -the -last -fortnight -of -it -was -suffocatingly -smoky -for -in -oregon -and -columbia -the -forest -fires -were -raging -we -had -an -added -week -of -smoke -at -the -seaboard -where -we -were -obliged -awhile -for -our -ship -she -had -been -getting -herself -ashore -in -the -smoke -and -she -had -to -be -docked -and -repaired -we -sailed -at -last -and -so -ended -a -snail -paced -march -across -the -continent -which -had -lasted -forty -days -we -moved -westward -about -mid -afternoon -over -a -rippled -and -summer -sea -an -enticing -sea -a -clean -and -cool -sea -and -apparently -a -welcome -sea -to -all -on -board -it -certainly -was -to -the -distressful -dustings -and -smokings -and -swelterings -of -the -past -weeks -the -voyage -would -furnish -a -three -weeks -holiday -with -hardly -a -break -in -it -we -had -the -whole -pacific -ocean -in -front -of -us -with -nothing -to -do -but -do -nothing -and -be -comfortable -the -city -of -victoria -was -twinkling -dim -in -the -deep -heart -of -her -smoke -cloud -and -getting -ready -to -vanish -and -now -we -closed -the -field -glasses -and -sat -down -on -our -steamer -chairs -contented -and -at -peace -but -they -went -to -wreck -and -ruin -under -us -and -brought -us -to -shame -before -all -the -passengers -they -had -been -furnished -by -the -largest -furniture -dealing -house -in -victoria -and -were -worth -a -couple -of -farthings -a -dozen -though -they -had -cost -us -the -price -of -honest -chairs -in -the -pacific -and -indian -oceans -one -must -still -bring -his -own -deck -chair -on -board -or -go -without -just -as -in -the -old -forgotten -atlantic -times -those -dark -ages -of -sea -travel -ours -was -a -reasonably -comfortable -ship -with -the -customary -sea -going -fare -plenty -of -good -food -furnished -by -the -deity -and -cooked -by -the -devil -the -discipline -observable -on -board -was -perhaps -as -good -as -it -is -anywhere -in -the -pacific -and -indian -oceans -the -ship -was -not -very -well -arranged -for -tropical -service -but -that -is -nothing -for -this -is -the -rule -for -ships -which -ply -in -the -tropics -she -had -an -over -supply -of -cockroaches -but -this -is -also -the -rule -with -ships -doing -business -in -the -summer -seas -at -least -such -as -have -been -long -in -service -our -young -captain -was -a -very -handsome -man -tall -and -perfectly -formed -the -very -figure -to -show -up -a -smart -uniform's -best -effects -he -was -a -man -of -the -best -intentions -and -was -polite -and -courteous -even -to -courtliness -there -was -a -soft -and -finish -about -his -manners -which -made -whatever -place -he -happened -to -be -in -seem -for -the -moment -a -drawing -room -he -avoided -the -smoking -room -he -had -no -vices -he -did -not -smoke -or -chew -tobacco -or -take -snuff -he -did -not -swear -or -use -slang -or -rude -or -coarse -or -indelicate -language -or -make -puns -or -tell -anecdotes -or -laugh -intemperately -or -raise -his -voice -above -the -moderate -pitch -enjoined -by -the -canons -of -good -form -when -he -gave -an -order -his -manner -modified -it -into -a -request -after -dinner -he -and -his -officers -joined -the -ladies -and -gentlemen -in -the -ladies' -saloon -and -shared -in -the -singing -and -piano -playing -and -helped -turn -the -music -he -had -a -sweet -and -sympathetic -tenor -voice -and -used -it -with -taste -and -effect -the -music -he -played -whist -there -always -with -the -same -partner -and -opponents -until -the -ladies' -bedtime -the -electric -lights -burned -there -as -late -as -the -ladies -and -their -friends -might -desire -but -they -were -not -allowed -to -burn -in -the -smoking -room -after -eleven -there -were -many -laws -on -the -ship's -statute -book -of -course -but -so -far -as -i -could -see -this -and -one -other -were -the -only -ones -that -were -rigidly -enforced -the -captain -explained -that -he -enforced -this -one -because -his -own -cabin -adjoined -the -smoking -room -and -the -smell -of -tobacco -smoke -made -him -sick -i -did -not -see -how -our -smoke -could -reach -him -for -the -smoking -room -and -his -cabin -were -on -the -upper -deck -targets -for -all -the -winds -that -blew -and -besides -there -was -no -crack -of -communication -between -them -no -opening -of -any -sort -in -the -solid -intervening -bulkhead -still -to -a -delicate -stomach -even -imaginary -smoke -can -convey -damage -the -captain -with -his -gentle -nature -his -polish -his -sweetness -his -moral -and -verbal -purity -seemed -pathetically -out -of -place -in -his -rude -and -autocratic -vocation -it -seemed -another -instance -of -the -irony -of -fate -he -was -going -home -under -a -cloud -the -passengers -knew -about -his -trouble -and -were -sorry -for -him -approaching -vancouver -through -a -narrow -and -difficult -passage -densely -befogged -with -smoke -from -the -forest -fires -he -had -had -the -ill -luck -to -lose -his -bearings -and -get -his -ship -on -the -rocks -a -matter -like -this -would -rank -merely -as -an -error -with -you -and -me -it -ranks -as -a -crime -with -the -directors -of -steamship -companies -the -captain -had -been -tried -by -the -admiralty -court -at -vancouver -and -its -verdict -had -acquitted -him -of -blame -but -that -was -insufficient -comfort -a -sterner -court -would -examine -the -case -in -sydney -the -court -of -directors -the -lords -of -a -company -in -whose -ships -the -captain -had -served -as -mate -a -number -of -years -this -was -his -first -voyage -as -captain -the -officers -of -our -ship -were -hearty -and -companionable -young -men -and -they -entered -into -the -general -amusements -and -helped -the -passengers -pass -the -time -voyages -in -the -pacific -and -indian -oceans -are -but -pleasure -excursions -for -all -hands -our -purser -was -a -young -scotchman -who -was -equipped -with -a -grit -that -was -remarkable -he -was -an -invalid -and -looked -it -as -far -as -his -body -was -concerned -but -illness -could -not -subdue -his -spirit -he -was -full -of -life -and -had -a -gay -and -capable -tongue -to -all -appearances -he -was -a -sick -man -without -being -aware -of -it -for -he -did -not -talk -about -his -ailments -and -his -bearing -and -conduct -were -those -of -a -person -in -robust -health -yet -he -was -the -prey -at -intervals -of -ghastly -sieges -of -pain -in -his -heart -these -lasted -many -hours -and -while -the -attack -continued -he -could -neither -sit -nor -lie -in -one -instance -he -stood -on -his -feet -twenty -four -hours -fighting -for -his -life -with -these -sharp -agonies -and -yet -was -as -full -of -life -and -cheer -and -activity -the -next -day -as -if -nothing -had -happened -the -brightest -passenger -in -the -ship -and -the -most -interesting -and -felicitous -talker -was -a -young -canadian -who -was -not -able -to -let -the -whisky -bottle -alone -he -was -of -a -rich -and -powerful -family -and -could -have -had -a -distinguished -career -and -abundance -of -effective -help -toward -it -if -he -could -have -conquered -his -appetite -for -drink -but -he -could -not -do -it -so -his -great -equipment -of -talent -was -of -no -use -to -him -he -had -often -taken -the -pledge -to -drink -no -more -and -was -a -good -sample -of -what -that -sort -of -unwisdom -can -do -for -a -man -for -a -man -with -anything -short -of -an -iron -will -the -system -is -wrong -in -two -ways -it -does -not -strike -at -the -root -of -the -trouble -for -one -thing -and -to -make -a -pledge -of -any -kind -is -to -declare -war -against -nature -for -a -pledge -is -a -chain -that -is -always -clanking -and -reminding -the -wearer -of -it -that -he -is -not -a -free -man -i -have -said -that -the -system -does -not -strike -at -the -root -of -the -trouble -and -i -venture -to -repeat -that -the -root -is -not -the -drinking -but -the -desire -to -drink -these -are -very -different -things -the -one -merely -requires -will -and -a -great -deal -of -it -both -as -to -bulk -and -staying -capacity -the -other -merely -requires -watchfulness -and -for -no -long -time -the -desire -of -course -precedes -the -act -and -should -have -one's -first -attention -it -can -do -but -little -good -to -refuse -the -act -over -and -over -again -always -leaving -the -desire -unmolested -unconquered -the -desire -will -continue -to -assert -itself -and -will -be -almost -sure -to -win -in -the -long -run -when -the -desire -intrudes -it -should -be -at -once -banished -out -of -the -mind -one -should -be -on -the -watch -for -it -all -the -time -otherwise -it -will -get -in -it -must -be -taken -in -time -and -not -allowed -to -get -a -lodgment -a -desire -constantly -repulsed -for -a -fortnight -should -die -then -that -should -cure -the -drinking -habit -the -system -of -refusing -the -mere -act -of -drinking -and -leaving -the -desire -in -full -force -is -unintelligent -war -tactics -it -seems -to -me -i -used -to -take -pledges -and -soon -violate -them -my -will -was -not -strong -and -i -could -not -help -it -and -then -to -be -tied -in -any -way -naturally -irks -an -otherwise -free -person -and -makes -him -chafe -in -his -bonds -and -want -to -get -his -liberty -but -when -i -finally -ceased -from -taking -definite -pledges -and -merely -resolved -that -i -would -kill -an -injurious -desire -but -leave -myself -free -to -resume -the -desire -and -the -habit -whenever -i -should -choose -to -do -so -i -had -no -more -trouble -in -five -days -i -drove -out -the -desire -to -smoke -and -was -not -obliged -to -keep -watch -after -that -and -i -never -experienced -any -strong -desire -to -smoke -again -at -the -end -of -a -year -and -a -quarter -of -idleness -i -began -to -write -a -book -and -presently -found -that -the -pen -was -strangely -reluctant -to -go -i -tried -a -smoke -to -see -if -that -would -help -me -out -of -the -difficulty -it -did -i -smoked -eight -or -ten -cigars -and -as -many -pipes -a -day -for -five -months -finished -the -book -and -did -not -smoke -again -until -a -year -had -gone -by -and -another -book -had -to -be -begun -i -can -quit -any -of -my -nineteen -injurious -habits -at -any -time -and -without -discomfort -or -inconvenience -i -think -that -the -dr -tanners -and -those -others -who -go -forty -days -without -eating -do -it -by -resolutely -keeping -out -the -desire -to -eat -in -the -beginning -and -that -after -a -few -hours -the -desire -is -discouraged -and -comes -no -more -once -i -tried -my -scheme -in -a -large -medical -way -i -had -been -confined -to -my -bed -several -days -with -lumbago -my -case -refused -to -improve -finally -the -doctor -said -my -remedies -have -no -fair -chance -consider -what -they -have -to -fight -besides -the -lumbago -you -smoke -extravagantly -don't -you -yes -you -take -coffee -immoderately -yes -and -some -tea -yes -you -eat -all -kinds -of -things -that -are -dissatisfied -with -each -other's -company -yes -you -drink -two -hot -scotches -every -night -yes -very -well -there -you -see -what -i -have -to -contend -against -we -can't -make -progress -the -way -the -matter -stands -you -must -make -a -reduction -in -these -things -you -must -cut -down -your -consumption -of -them -considerably -for -some -days -i -can't -doctor -why -can't -you -i -lack -the -will -power -i -can -cut -them -off -entirely -but -i -can't -merely -moderate -them -he -said -that -that -would -answer -and -said -he -would -come -around -in -twenty -four -hours -and -begin -work -again -he -was -taken -ill -himself -and -could -not -come -but -i -did -not -need -him -i -cut -off -all -those -things -for -two -days -and -nights -in -fact -i -cut -off -all -kinds -of -food -too -and -all -drinks -except -water -and -at -the -end -of -the -forty -eight -hours -the -lumbago -was -discouraged -and -left -me -i -was -a -well -man -so -i -gave -thanks -and -took -to -those -delicacies -again -it -seemed -a -valuable -medical -course -and -i -recommended -it -to -a -lady -she -had -run -down -and -down -and -down -and -had -at -last -reached -a -point -where -medicines -no -longer -had -any -helpful -effect -upon -her -i -said -i -knew -i -could -put -her -upon -her -feet -in -a -week -it -brightened -her -up -it -filled -her -with -hope -and -she -said -she -would -do -everything -i -told -her -to -do -so -i -said -she -must -stop -swearing -and -drinking -and -smoking -and -eating -for -four -days -and -then -she -would -be -all -right -again -and -it -would -have -happened -just -so -i -know -it -but -she -said -she -could -not -stop -swearing -and -smoking -and -drinking -because -she -had -never -done -those -things -so -there -it -was -she -had -neglected -her -habits -and -hadn't -any -now -that -they -would -have -come -good -there -were -none -in -stock -she -had -nothing -to -fall -back -on -she -was -a -sinking -vessel -with -no -freight -in -her -to -throw -over -lighten -ship -withal -why -even -one -or -two -little -bad -habits -could -have -saved -her -but -she -was -just -a -moral -pauper -when -she -could -have -acquired -them -she -was -dissuaded -by -her -parents -who -were -ignorant -people -though -reared -in -the -best -society -and -it -was -too -late -to -begin -now -it -seemed -such -a -pity -but -there -was -no -help -for -it -these -things -ought -to -be -attended -to -while -a -person -is -young -otherwise -when -age -and -disease -come -there -is -nothing -effectual -to -fight -them -with -when -i -was -a -youth -i -used -to -take -all -kinds -of -pledges -and -do -my -best -to -keep -them -but -i -never -could -because -i -didn't -strike -at -the -root -of -the -habit -the -desire -i -generally -broke -down -within -the -month -once -i -tried -limiting -a -habit -that -worked -tolerably -well -for -a -while -i -pledged -myself -to -smoke -but -one -cigar -a -day -i -kept -the -cigar -waiting -until -bedtime -then -i -had -a -luxurious -time -with -it -but -desire -persecuted -me -every -day -and -all -day -long -so -within -the -week -i -found -myself -hunting -for -larger -cigars -than -i -had -been -used -to -smoke -then -larger -ones -still -and -still -larger -ones -within -the -fortnight -i -was -getting -cigars -made -for -me -on -a -yet -larger -pattern -they -still -grew -and -grew -in -size -within -the -month -my -cigar -had -grown -to -such -proportions -that -i -could -have -used -it -as -a -crutch -it -now -seemed -to -me -that -a -one -cigar -limit -was -no -real -protection -to -a -person -so -i -knocked -my -pledge -on -the -head -and -resumed -my -liberty -to -go -back -to -that -young -canadian -he -was -a -remittance -man -the -first -one -i -had -ever -seen -or -heard -of -passengers -explained -the -term -to -me -they -said -that -dissipated -ne'er -do -wells -belonging -to -important -families -in -england -and -canada -were -not -cast -off -by -their -people -while -there -was -any -hope -of -reforming -them -but -when -that -last -hope -perished -at -last -the -ne'er -do -well -was -sent -abroad -to -get -him -out -of -the -way -he -was -shipped -off -with -just -enough -money -in -his -pocket -no -in -the -purser's -pocket -for -the -needs -of -the -voyage -and -when -he -reached -his -destined -port -he -would -find -a -remittance -awaiting -him -there -not -a -large -one -but -just -enough -to -keep -him -a -month -a -similar -remittance -would -come -monthly -thereafter -it -was -the -remittance -man's -custom -to -pay -his -month's -board -and -lodging -straightway -a -duty -which -his -landlord -did -not -allow -him -to -forget -then -spree -away -the -rest -of -his -money -in -a -single -night -then -brood -and -mope -and -grieve -in -idleness -till -the -next -remittance -came -it -is -a -pathetic -life -we -had -other -remittance -men -on -board -it -was -said -at -least -they -said -they -were -r -m -'s -there -were -two -but -they -did -not -resemble -the -canadian -they -lacked -his -tidiness -and -his -brains -and -his -gentlemanly -ways -and -his -resolute -spirit -and -his -humanities -and -generosities -one -of -them -was -a -lad -of -nineteen -or -twenty -and -he -was -a -good -deal -of -a -ruin -as -to -clothes -and -morals -and -general -aspect -he -said -he -was -a -scion -of -a -ducal -house -in -england -and -had -been -shipped -to -canada -for -the -house's -relief -that -he -had -fallen -into -trouble -there -and -was -now -being -shipped -to -australia -he -said -he -had -no -title -beyond -this -remark -he -was -economical -of -the -truth -the -first -thing -he -did -in -australia -was -to -get -into -the -lockup -and -the -next -thing -he -did -was -to -proclaim -himself -an -earl -in -the -police -court -in -the -morning -and -fail -to -prove -it -chapter -ii -when -in -doubt -tell -the -truth -pudd'nhead -wilson's -new -calendar -about -four -days -out -from -victoria -we -plunged -into -hot -weather -and -all -the -male -passengers -put -on -white -linen -clothes -one -or -two -days -later -we -crossed -the -25th -parallel -of -north -latitude -and -then -by -order -the -officers -of -the -ship -laid -away -their -blue -uniforms -and -came -out -in -white -linen -ones -all -the -ladies -were -in -white -by -this -time -this -prevalence -of -snowy -costumes -gave -the -promenade -deck -an -invitingly -cool -and -cheerful -and -picnicky -aspect -from -my -diary -there -are -several -sorts -of -ills -in -the -world -from -which -a -person -can -never -escape -altogether -let -him -journey -as -far -as -he -will -one -escapes -from -one -breed -of -an -ill -only -to -encounter -another -breed -of -it -we -have -come -far -from -the -snake -liar -and -the -fish -liar -and -there -was -rest -and -peace -in -the -thought -but -now -we -have -reached -the -realm -of -the -boomerang -liar -and -sorrow -is -with -us -once -more -the -first -officer -has -seen -a -man -try -to -escape -from -his -enemy -by -getting -behind -a -tree -but -the -enemy -sent -his -boomerang -sailing -into -the -sky -far -above -and -beyond -the -tree -then -it -turned -descended -and -killed -the -man -the -australian -passenger -has -seen -this -thing -done -to -two -men -behind -two -trees -and -by -the -one -arrow -this -being -received -with -a -large -silence -that -suggested -doubt -he -buttressed -it -with -the -statement -that -his -brother -once -saw -the -boomerang -kill -a -bird -away -off -a -hundred -yards -and -bring -it -to -the -thrower -but -these -are -ills -which -must -be -borne -there -is -no -other -way -the -talk -passed -from -the -boomerang -to -dreams -usually -a -fruitful -subject -afloat -or -ashore -but -this -time -the -output -was -poor -then -it -passed -to -instances -of -extraordinary -memory -with -better -results -blind -tom -the -negro -pianist -was -spoken -of -and -it -was -said -that -he -could -accurately -play -any -piece -of -music -howsoever -long -and -difficult -after -hearing -it -once -and -that -six -months -later -he -could -accurately -play -it -again -without -having -touched -it -in -the -interval -one -of -the -most -striking -of -the -stories -told -was -furnished -by -a -gentleman -who -had -served -on -the -staff -of -the -viceroy -of -india -he -read -the -details -from -his -note -book -and -explained -that -he -had -written -them -down -right -after -the -consummation -of -the -incident -which -they -described -because -he -thought -that -if -he -did -not -put -them -down -in -black -and -white -he -might -presently -come -to -think -he -had -dreamed -them -or -invented -them -the -viceroy -was -making -a -progress -and -among -the -shows -offered -by -the -maharajah -of -mysore -for -his -entertainment -was -a -memory -exhibition -the -viceroy -and -thirty -gentlemen -of -his -suite -sat -in -a -row -and -the -memory -expert -a -high -caste -brahmin -was -brought -in -and -seated -on -the -floor -in -front -of -them -he -said -he -knew -but -two -languages -the -english -and -his -own -but -would -not -exclude -any -foreign -tongue -from -the -tests -to -be -applied -to -his -memory -then -he -laid -before -the -assemblage -his -program -a -sufficiently -extraordinary -one -he -proposed -that -one -gentleman -should -give -him -one -word -of -a -foreign -sentence -and -tell -him -its -place -in -the -sentence -he -was -furnished -with -the -french -word -'est' -and -was -told -it -was -second -in -a -sentence -of -three -words -the -next -gentleman -gave -him -the -german -word -'verloren' -and -said -it -was -the -third -in -a -sentence -of -four -words -he -asked -the -next -gentleman -for -one -detail -in -a -sum -in -addition -another -for -one -detail -in -a -sum -of -subtraction -others -for -single -details -in -mathematical -problems -of -various -kinds -he -got -them -intermediates -gave -him -single -words -from -sentences -in -greek -latin -spanish -portuguese -italian -and -other -languages -and -told -him -their -places -in -the -sentences -when -at -last -everybody -had -furnished -him -a -single -rag -from -a -foreign -sentence -or -a -figure -from -a -problem -he -went -over -the -ground -again -and -got -a -second -word -and -a -second -figure -and -was -told -their -places -in -the -sentences -and -the -sums -and -so -on -and -so -on -he -went -over -the -ground -again -and -again -until -he -had -collected -all -the -parts -of -the -sums -and -all -the -parts -of -the -sentences -and -all -in -disorder -of -course -not -in -their -proper -rotation -this -had -occupied -two -hours -the -brahmin -now -sat -silent -and -thinking -a -while -then -began -and -repeated -all -the -sentences -placing -the -words -in -their -proper -order -and -untangled -the -disordered -arithmetical -problems -and -gave -accurate -answers -to -them -all -in -the -beginning -he -had -asked -the -company -to -throw -almonds -at -him -during -the -two -hours -he -to -remember -how -many -each -gentleman -had -thrown -but -none -were -thrown -for -the -viceroy -said -that -the -test -would -be -a -sufficiently -severe -strain -without -adding -that -burden -to -it -general -grant -had -a -fine -memory -for -all -kinds -of -things -including -even -names -and -faces -and -i -could -have -furnished -an -instance -of -it -if -i -had -thought -of -it -the -first -time -i -ever -saw -him -was -early -in -his -first -term -as -president -i -had -just -arrived -in -washington -from -the -pacific -coast -a -stranger -and -wholly -unknown -to -the -public -and -was -passing -the -white -house -one -morning -when -i -met -a -friend -a -senator -from -nevada -he -asked -me -if -i -would -like -to -see -the -president -i -said -i -should -be -very -glad -so -we -entered -i -supposed -that -the -president -would -be -in -the -midst -of -a -crowd -and -that -i -could -look -at -him -in -peace -and -security -from -a -distance -as -another -stray -cat -might -look -at -another -king -but -it -was -in -the -morning -and -the -senator -was -using -a -privilege -of -his -office -which -i -had -not -heard -of -the -privilege -of -intruding -upon -the -chief -magistrate's -working -hours -before -i -knew -it -the -senator -and -i -were -in -the -presence -and -there -was -none -there -but -we -three -general -grant -got -slowly -up -from -his -table -put -his -pen -down -and -stood -before -me -with -the -iron -expression -of -a -man -who -had -not -smiled -for -seven -years -and -was -not -intending -to -smile -for -another -seven -he -looked -me -steadily -in -the -eyes -mine -lost -confidence -and -fell -i -had -never -confronted -a -great -man -before -and -was -in -a -miserable -state -of -funk -and -inefficiency -the -senator -said -mr -president -may -i -have -the -privilege -of -introducing -mr -clemens -the -president -gave -my -hand -an -unsympathetic -wag -and -dropped -it -he -did -not -say -a -word -but -just -stood -in -my -trouble -i -could -not -think -of -anything -to -say -i -merely -wanted -to -resign -there -was -an -awkward -pause -a -dreary -pause -a -horrible -pause -then -i -thought -of -something -and -looked -up -into -that -unyielding -face -and -said -timidly -mr -president -i -i -am -embarrassed -are -you -his -face -broke -just -a -little -a -wee -glimmer -the -momentary -flicker -of -a -summer -lightning -smile -seven -years -ahead -of -time -and -i -was -out -and -gone -as -soon -as -it -was -ten -years -passed -away -before -i -saw -him -the -second -time -meantime -i -was -become -better -known -and -was -one -of -the -people -appointed -to -respond -to -toasts -at -the -banquet -given -to -general -grant -in -chicago -by -the -army -of -the -tennessee -when -he -came -back -from -his -tour -around -the -world -i -arrived -late -at -night -and -got -up -late -in -the -morning -all -the -corridors -of -the -hotel -were -crowded -with -people -waiting -to -get -a -glimpse -of -general -grant -when -he -should -pass -to -the -place -whence -he -was -to -review -the -great -procession -i -worked -my -way -by -the -suite -of -packed -drawing -rooms -and -at -the -corner -of -the -house -i -found -a -window -open -where -there -was -a -roomy -platform -decorated -with -flags -and -carpeted -i -stepped -out -on -it -and -saw -below -me -millions -of -people -blocking -all -the -streets -and -other -millions -caked -together -in -all -the -windows -and -on -all -the -house -tops -around -these -masses -took -me -for -general -grant -and -broke -into -volcanic -explosions -and -cheers -but -it -was -a -good -place -to -see -the -procession -and -i -stayed -presently -i -heard -the -distant -blare -of -military -music -and -far -up -the -street -i -saw -the -procession -come -in -sight -cleaving -its -way -through -the -huzzaing -multitudes -with -sheridan -the -most -martial -figure -of -the -war -riding -at -its -head -in -the -dress -uniform -of -a -lieutenant -general -and -now -general -grant -arm -in -arm -with -major -carter -harrison -stepped -out -on -the -platform -followed -two -and -two -by -the -badged -and -uniformed -reception -committee -general -grant -was -looking -exactly -as -he -had -looked -upon -that -trying -occasion -of -ten -years -before -all -iron -and -bronze -self -possession -mr -harrison -came -over -and -led -me -to -the -general -and -formally -introduced -me -before -i -could -put -together -the -proper -remark -general -grant -said -mr -clemens -i -am -not -embarrassed -are -you -and -that -little -seven -year -smile -twinkled -across -his -face -again -seventeen -years -have -gone -by -since -then -and -to -day -in -new -york -the -streets -are -a -crush -of -people -who -are -there -to -honor -the -remains -of -the -great -soldier -as -they -pass -to -their -final -resting -place -under -the -monument -and -the -air -is -heavy -with -dirges -and -the -boom -of -artillery -and -all -the -millions -of -america -are -thinking -of -the -man -who -restored -the -union -and -the -flag -and -gave -to -democratic -government -a -new -lease -of -life -and -as -we -may -hope -and -do -believe -a -permanent -place -among -the -beneficent -institutions -of -men -we -had -one -game -in -the -ship -which -was -a -good -time -passer -at -least -it -was -at -night -in -the -smoking -room -when -the -men -were -getting -freshened -up -from -the -day's -monotonies -and -dullnesses -it -was -the -completing -of -non -complete -stories -that -is -to -say -a -man -would -tell -all -of -a -story -except -the -finish -then -the -others -would -try -to -supply -the -ending -out -of -their -own -invention -when -every -one -who -wanted -a -chance -had -had -it -the -man -who -had -introduced -the -story -would -give -it -its -original -ending -then -you -could -take -your -choice -sometimes -the -new -endings -turned -out -to -be -better -than -the -old -one -but -the -story -which -called -out -the -most -persistent -and -determined -and -ambitious -effort -was -one -which -had -no -ending -and -so -there -was -nothing -to -compare -the -new -made -endings -with -the -man -who -told -it -said -he -could -furnish -the -particulars -up -to -a -certain -point -only -because -that -was -as -much -of -the -tale -as -he -knew -he -had -read -it -in -a -volume -of -`sketches -twenty -five -years -ago -and -was -interrupted -before -the -end -was -reached -he -would -give -any -one -fifty -dollars -who -would -finish -the -story -to -the -satisfaction -of -a -jury -to -be -appointed -by -ourselves -we -appointed -a -jury -and -wrestled -with -the -tale -we -invented -plenty -of -endings -but -the -jury -voted -them -all -down -the -jury -was -right -it -was -a -tale -which -the -author -of -it -may -possibly -have -completed -satisfactorily -and -if -he -really -had -that -good -fortune -i -would -like -to -know -what -the -ending -was -any -ordinary -man -will -find -that -the -story's -strength -is -in -its -middle -and -that -there -is -apparently -no -way -to -transfer -it -to -the -close -where -of -course -it -ought -to -be -in -substance -the -storiette -was -as -follows -john -brown -aged -thirty -one -good -gentle -bashful -timid -lived -in -a -quiet -village -in -missouri -he -was -superintendent -of -the -presbyterian -sunday -school -it -was -but -a -humble -distinction -still -it -was -his -only -official -one -and -he -was -modestly -proud -of -it -and -was -devoted -to -its -work -and -its -interests -the -extreme -kindliness -of -his -nature -was -recognized -by -all -in -fact -people -said -that -he -was -made -entirely -out -of -good -impulses -and -bashfulness -that -he -could -always -be -counted -upon -for -help -when -it -was -needed -and -for -bashfulness -both -when -it -was -needed -and -when -it -wasn't -mary -taylor -twenty -three -modest -sweet -winning -and -in -character -and -person -beautiful -was -all -in -all -to -him -and -he -was -very -nearly -all -in -all -to -her -she -was -wavering -his -hopes -were -high -her -mother -had -been -in -opposition -from -the -first -but -she -was -wavering -too -he -could -see -it -she -was -being -touched -by -his -warm -interest -in -her -two -charity -proteges -and -by -his -contributions -toward -their -support -these -were -two -forlorn -and -aged -sisters -who -lived -in -a -log -hut -in -a -lonely -place -up -a -cross -road -four -miles -from -mrs -taylor's -farm -one -of -the -sisters -was -crazy -and -sometimes -a -little -violent -but -not -often -at -last -the -time -seemed -ripe -for -a -final -advance -and -brown -gathered -his -courage -together -and -resolved -to -make -it -he -would -take -along -a -contribution -of -double -the -usual -size -and -win -the -mother -over -with -her -opposition -annulled -the -rest -of -the -conquest -would -be -sure -and -prompt -he -took -to -the -road -in -the -middle -of -a -placid -sunday -afternoon -in -the -soft -missourian -summer -and -he -was -equipped -properly -for -his -mission -he -was -clothed -all -in -white -linen -with -a -blue -ribbon -for -a -necktie -and -he -had -on -dressy -tight -boots -his -horse -and -buggy -were -the -finest -that -the -livery -stable -could -furnish -the -lap -robe -was -of -white -linen -it -was -new -and -it -had -a -hand -worked -border -that -could -not -be -rivaled -in -that -region -for -beauty -and -elaboration -when -he -was -four -miles -out -on -the -lonely -road -and -was -walking -his -horse -over -a -wooden -bridge -his -straw -hat -blew -off -and -fell -in -the -creek -and -floated -down -and -lodged -against -a -bar -he -did -not -quite -know -what -to -do -he -must -have -the -hat -that -was -manifest -but -how -was -he -to -get -it -then -he -had -an -idea -the -roads -were -empty -nobody -was -stirring -yes -he -would -risk -it -he -led -the -horse -to -the -roadside -and -set -it -to -cropping -the -grass -then -he -undressed -and -put -his -clothes -in -the -buggy -petted -the -horse -a -moment -to -secure -its -compassion -and -its -loyalty -then -hurried -to -the -stream -he -swam -out -and -soon -had -the -hat -when -he -got -to -the -top -of -the -bank -the -horse -was -gone! -his -legs -almost -gave -way -under -him -the -horse -was -walking -leisurely -along -the -road -brown -trotted -after -it -saying -whoa -whoa -there's -a -good -fellow -but -whenever -he -got -near -enough -to -chance -a -jump -for -the -buggy -the -horse -quickened -its -pace -a -little -and -defeated -him -and -so -this -went -on -the -naked -man -perishing -with -anxiety -and -expecting -every -moment -to -see -people -come -in -sight -he -tagged -on -and -on -imploring -the -horse -beseeching -the -horse -till -he -had -left -a -mile -behind -him -and -was -closing -up -on -the -taylor -premises -then -at -last -he -was -successful -and -got -into -the -buggy -he -flung -on -his -shirt -his -necktie -and -his -coat -then -reached -for -but -he -was -too -late -he -sat -suddenly -down -and -pulled -up -the -lap -robe -for -he -saw -some -one -coming -out -of -the -gate -a -woman -he -thought -he -wheeled -the -horse -to -the -left -and -struck -briskly -up -the -cross -road -it -was -perfectly -straight -and -exposed -on -both -sides -but -there -were -woods -and -a -sharp -turn -three -miles -ahead -and -he -was -very -grateful -when -he -got -there -as -he -passed -around -the -turn -he -slowed -down -to -a -walk -and -reached -for -his -tr -too -late -again -he -had -come -upon -mrs -enderby -mrs -glossop -mrs -taylor -and -mary -they -were -on -foot -and -seemed -tired -and -excited -they -came -at -once -to -the -buggy -and -shook -hands -and -all -spoke -at -once -and -said -eagerly -and -earnestly -how -glad -they -were -that -he -was -come -and -how -fortunate -it -was -and -mrs -enderby -said -impressively -it -looks -like -an -accident -his -coming -at -such -a -time -but -let -no -one -profane -it -with -such -a -name -he -was -sent -sent -from -on -high -they -were -all -moved -and -mrs -glossop -said -in -an -awed -voice -sarah -enderby -you -never -said -a -truer -word -in -your -life -this -is -no -accident -it -is -a -special -providence -he -was -sent -he -is -an -angel -an -angel -as -truly -as -ever -angel -was -an -angel -of -deliverance -i -say -angel -sarah -enderby -and -will -have -no -other -word -don't -let -any -one -ever -say -to -me -again -that -there's -no -such -thing -as -special -providences -for -if -this -isn't -one -let -them -account -for -it -that -can -i -know -it's -so -said -mrs -taylor -fervently -john -brown -i -could -worship -you -i -could -go -down -on -my -knees -to -you -didn't -something -tell -you -didn't -you -feel -that -you -were -sent -i -could -kiss -the -hem -of -your -laprobe -he -was -not -able -to -speak -he -was -helpless -with -shame -and -fright -mrs -taylor -went -on -why -just -look -at -it -all -around -julia -glossop -any -person -can -see -the -hand -of -providence -in -it -here -at -noon -what -do -we -see -we -see -the -smoke -rising -i -speak -up -and -say -'that's -the -old -people's -cabin -afire -' -didn't -i -julia -glossop -the -very -words -you -said -nancy -taylor -i -was -as -close -to -you -as -i -am -now -and -i -heard -them -you -may -have -said -hut -instead -of -cabin -but -in -substance -it's -the -same -and -you -were -looking -pale -too -pale -i -was -that -pale -that -if -why -you -just -compare -it -with -this -laprobe -then -the -next -thing -i -said -was -'mary -taylor -tell -the -hired -man -to -rig -up -the -team -we'll -go -to -the -rescue -' -and -she -said -'mother -don't -you -know -you -told -him -he -could -drive -to -see -his -people -and -stay -over -sunday -' -and -it -was -just -so -i -declare -for -it -i -had -forgotten -it -'then -' -said -i -'we'll -go -afoot -' -and -go -we -did -and -found -sarah -enderby -on -the -road -and -we -all -went -together -said -mrs -enderby -and -found -the -cabin -set -fire -to -and -burnt -down -by -the -crazy -one -and -the -poor -old -things -so -old -and -feeble -that -they -couldn't -go -afoot -and -we -got -them -to -a -shady -place -and -made -them -as -comfortable -as -we -could -and -began -to -wonder -which -way -to -turn -to -find -some -way -to -get -them -conveyed -to -nancy -taylor's -house -and -i -spoke -up -and -said -now -what -did -i -say -didn't -i -say -'providence -will -provide' -why -sure -as -you -live -so -you -did! -i -had -forgotten -it -so -had -i -said -mrs -glossop -and -mrs -taylor -but -you -certainly -said -it -now -wasn't -that -remarkable -yes -i -said -it -and -then -we -went -to -mr -moseley's -two -miles -and -all -of -them -were -gone -to -the -camp -meeting -over -on -stony -fork -and -then -we -came -all -the -way -back -two -miles -and -then -here -another -mile -and -providence -has -provided -you -see -it -yourselves -they -gazed -at -each -other -awe -struck -and -lifted -their -hands -and -said -in -unison -it's -per -fectly -wonderful -and -then -said -mrs -glossop -what -do -you -think -we -had -better -do -let -mr -brown -drive -the -old -people -to -nancy -taylor's -one -at -a -time -or -put -both -of -them -in -the -buggy -and -him -lead -the -horse -brown -gasped -now -then -that's -a -question -said -mrs -enderby -you -see -we -are -all -tired -out -and -any -way -we -fix -it -it's -going -to -be -difficult -for -if -mr -brown -takes -both -of -them -at -least -one -of -us -must -go -back -to -help -him -for -he -can't -load -them -into -the -buggy -by -himself -and -they -so -helpless -that -is -so -said -mrs -taylor -it -doesn't -look -oh -how -would -this -do -one -of -us -drive -there -with -mr -brown -and -the -rest -of -you -go -along -to -my -house -and -get -things -ready -i'll -go -with -him -he -and -i -together -can -lift -one -of -the -old -people -into -the -buggy -then -drive -her -to -my -house -and -but -who -will -take -care -of -the -other -one -said -mrs -enderby -we -musn't -leave -her -there -in -the -woods -alone -you -know -especially -the -crazy -one -there -and -back -is -eight -miles -you -see -they -had -all -been -sitting -on -the -grass -beside -the -buggy -for -a -while -now -trying -to -rest -their -weary -bodies -they -fell -silent -a -moment -or -two -and -struggled -in -thought -over -the -baffling -situation -then -mrs -enderby -brightened -and -said -i -think -i've -got -the -idea -now -you -see -we -can't -walk -any -more -think -what -we've -done -four -miles -there -two -to -moseley's -is -six -then -back -to -here -nine -miles -since -noon -and -not -a -bite -to -eat -i -declare -i -don't -see -how -we've -done -it -and -as -for -me -i -am -just -famishing -now -somebody's -got -to -go -back -to -help -mr -brown -there's -no -getting -mound -that -but -whoever -goes -has -got -to -ride -not -walk -so -my -idea -is -this -one -of -us -to -ride -back -with -mr -brown -then -ride -to -nancy -taylor's -house -with -one -of -the -old -people -leaving -mr -brown -to -keep -the -other -old -one -company -you -all -to -go -now -to -nancy's -and -rest -and -wait -then -one -of -you -drive -back -and -get -the -other -one -and -drive -her -to -nancy's -and -mr -brown -walk -splendid! -they -all -cried -oh -that -will -do -that -will -answer -perfectly -and -they -all -said -that -mrs -enderby -had -the -best -head -for -planning -in -the -company -and -they -said -that -they -wondered -that -they -hadn't -thought -of -this -simple -plan -themselves -they -hadn't -meant -to -take -back -the -compliment -good -simple -souls -and -didn't -know -they -had -done -it -after -a -consultation -it -was -decided -that -mrs -enderby -should -drive -back -with -brown -she -being -entitled -to -the -distinction -because -she -had -invented -the -plan -everything -now -being -satisfactorily -arranged -and -settled -the -ladies -rose -relieved -and -happy -and -brushed -down -their -gowns -and -three -of -them -started -homeward -mrs -enderby -set -her -foot -on -the -buggy -step -and -was -about -to -climb -in -when -brown -found -a -remnant -of -his -voice -and -gasped -out -please -mrs -enderby -call -them -back -i -am -very -weak -i -can't -walk -i -can't -indeed -why -dear -mr -brown! -you -do -look -pale -i -am -ashamed -of -myself -that -i -didn't -notice -it -sooner -come -back -all -of -you! -mr -brown -is -not -well -is -there -anything -i -can -do -for -you -mr -brown -i'm -real -sorry -are -you -in -pain -no -madam -only -weak -i -am -not -sick -but -only -just -weak -lately -not -long -but -just -lately -the -others -came -back -and -poured -out -their -sympathies -and -commiserations -and -were -full -of -self -reproaches -for -not -having -noticed -how -pale -he -was -and -they -at -once -struck -out -a -new -plan -and -soon -agreed -that -it -was -by -far -the -best -of -all -they -would -all -go -to -nancy -taylor's -house -and -see -to -brown's -needs -first -he -could -lie -on -the -sofa -in -the -parlor -and -while -mrs -taylor -and -mary -took -care -of -him -the -other -two -ladies -would -take -the -buggy -and -go -and -get -one -of -the -old -people -and -leave -one -of -themselves -with -the -other -one -and -by -this -time -without -any -solicitation -they -were -at -the -horse's -head -and -were -beginning -to -turn -him -around -the -danger -was -imminent -but -brown -found -his -voice -again -and -saved -himself -he -said -but -ladies -you -are -overlooking -something -which -makes -the -plan -impracticable -you -see -if -you -bring -one -of -them -home -and -one -remains -behind -with -the -other -there -will -be -three -persons -there -when -one -of -you -comes -back -for -that -other -for -some -one -must -drive -the -buggy -back -and -three -can't -come -home -in -it -they -all -exclaimed -why -sure -ly -that -is -so! -and -they -were -all -perplexed -again -dear -dear -what -can -we -do -said -mrs -glossop -it -is -the -most -mixed -up -thing -that -ever -was -the -fox -and -the -goose -and -the -corn -and -things -oh -dear -they -are -nothing -to -it -they -sat -wearily -down -once -more -to -further -torture -their -tormented -heads -for -a -plan -that -would -work -presently -mary -offered -a -plan -it -was -her -first -effort -she -said -i -am -young -and -strong -and -am -refreshed -now -take -mr -brown -to -our -house -and -give -him -help -you -see -how -plainly -he -needs -it -i -will -go -back -and -take -care -of -the -old -people -i -can -be -there -in -twenty -minutes -you -can -go -on -and -do -what -you -first -started -to -do -wait -on -the -main -road -at -our -house -until -somebody -comes -along -with -a -wagon -then -send -and -bring -away -the -three -of -us -you -won't -have -to -wait -long -the -farmers -will -soon -be -coming -back -from -town -now -i -will -keep -old -polly -patient -and -cheered -up -the -crazy -one -doesn't -need -it -this -plan -was -discussed -and -accepted -it -seemed -the -best -that -could -be -done -in -the -circumstances -and -the -old -people -must -be -getting -discouraged -by -this -time -brown -felt -relieved -and -was -deeply -thankful -let -him -once -get -to -the -main -road -and -he -would -find -a -way -to -escape -then -mrs -taylor -said -the -evening -chill -will -be -coming -on -pretty -soon -and -those -poor -old -burnt -out -things -will -need -some -kind -of -covering -take -the -lap -robe -with -you -dear -very -well -mother -i -will -she -stepped -to -the -buggy -and -put -out -her -hand -to -take -it -that -was -the -end -of -the -tale -the -passenger -who -told -it -said -that -when -he -read -the -story -twenty -five -years -ago -in -a -train -he -was -interrupted -at -that -point -the -train -jumped -off -a -bridge -at -first -we -thought -we -could -finish -the -story -quite -easily -and -we -set -to -work -with -confidence -but -it -soon -began -to -appear -that -it -was -not -a -simple -thing -but -difficult -and -baffling -this -was -on -account -of -brown's -character -great -generosity -and -kindliness -but -complicated -with -unusual -shyness -and -diffidence -particularly -in -the -presence -of -ladies -there -was -his -love -for -mary -in -a -hopeful -state -but -not -yet -secure -just -in -a -condition -indeed -where -its -affair -must -be -handled -with -great -tact -and -no -mistakes -made -no -offense -given -and -there -was -the -mother -wavering -half -willing -by -adroit -and -flawless -diplomacy -to -be -won -over -now -or -perhaps -never -at -all -also -there -were -the -helpless -old -people -yonder -in -the -woods -waiting -their -fate -and -brown's -happiness -to -be -determined -by -what -brown -should -do -within -the -next -two -seconds -mary -was -reaching -for -the -lap -robe -brown -must -decide -there -was -no -time -to -be -lost -of -course -none -but -a -happy -ending -of -the -story -would -be -accepted -by -the -jury -the -finish -must -find -brown -in -high -credit -with -the -ladies -his -behavior -without -blemish -his -modesty -unwounded -his -character -for -self -sacrifice -maintained -the -old -people -rescued -through -him -their -benefactor -all -the -party -proud -of -him -happy -in -him -his -praises -on -all -their -tongues -we -tried -to -arrange -this -but -it -was -beset -with -persistent -and -irreconcilable -difficulties -we -saw -that -brown's -shyness -would -not -allow -him -to -give -up -the -lap -robe -this -would -offend -mary -and -her -mother -and -it -would -surprise -the -other -ladies -partly -because -this -stinginess -toward -the -suffering -old -people -would -be -out -of -character -with -brown -and -partly -because -he -was -a -special -providence -and -could -not -properly -act -so -if -asked -to -explain -his -conduct -his -shyness -would -not -allow -him -to -tell -the -truth -and -lack -of -invention -and -practice -would -find -him -incapable -of -contriving -a -lie -that -would -wash -we -worked -at -the -troublesome -problem -until -three -in -the -morning -meantime -mary -was -still -reaching -for -the -lap -robe -we -gave -it -up -and -decided -to -let -her -continue -to -reach -it -is -the -reader's -privilege -to -determine -for -himself -how -the -thing -came -out -chapter -iii -it -is -more -trouble -to -make -a -maxim -than -it -is -to -do -right -pudd'nhead -wilson's -new -calendar -on -the -seventh -day -out -we -saw -a -dim -vast -bulk -standing -up -out -of -the -wastes -of -the -pacific -and -knew -that -that -spectral -promontory -was -diamond -head -a -piece -of -this -world -which -i -had -not -seen -before -for -twenty -nine -years -so -we -were -nearing -honolulu -the -capital -city -of -the -sandwich -islands -those -islands -which -to -me -were -paradise -a -paradise -which -i -had -been -longing -all -those -years -to -see -again -not -any -other -thing -in -the -world -could -have -stirred -me -as -the -sight -of -that -great -rock -did -in -the -night -we -anchored -a -mile -from -shore -through -my -port -i -could -see -the -twinkling -lights -of -honolulu -and -the -dark -bulk -of -the -mountain -range -that -stretched -away -right -and -left -i -could -not -make -out -the -beautiful -nuuana -valley -but -i -knew -where -it -lay -and -remembered -how -it -used -to -look -in -the -old -times -we -used -to -ride -up -it -on -horseback -in -those -days -we -young -people -and -branch -off -and -gather -bones -in -a -sandy -region -where -one -of -the -first -kamehameha's -battles -was -fought -he -was -a -remarkable -man -for -a -king -and -he -was -also -a -remarkable -man -for -a -savage -he -was -a -mere -kinglet -and -of -little -or -no -consequence -at -the -time -of -captain -cook's -arrival -in -1788 -but -about -four -years -afterward -he -conceived -the -idea -of -enlarging -his -sphere -of -influence -that -is -a -courteous -modern -phrase -which -means -robbing -your -neighbor -for -your -neighbor's -benefit -and -the -great -theater -of -its -benevolences -is -africa -kamehameha -went -to -war -and -in -the -course -of -ten -years -he -whipped -out -all -the -other -kings -and -made -himself -master -of -every -one -of -the -nine -or -ten -islands -that -form -the -group -but -he -did -more -than -that -he -bought -ships -freighted -them -with -sandal -wood -and -other -native -products -and -sent -them -as -far -as -south -america -and -china -he -sold -to -his -savages -the -foreign -stuffs -and -tools -and -utensils -which -came -back -in -these -ships -and -started -the -march -of -civilization -it -is -doubtful -if -the -match -to -this -extraordinary -thing -is -to -be -found -in -the -history -of -any -other -savage -savages -are -eager -to -learn -from -the -white -man -any -new -way -to -kill -each -other -but -it -is -not -their -habit -to -seize -with -avidity -and -apply -with -energy -the -larger -and -nobler -ideas -which -he -offers -them -the -details -of -kamehameha's -history -show -that -he -was -always -hospitably -ready -to -examine -the -white -man's -ideas -and -that -he -exercised -a -tidy -discrimination -in -making -his -selections -from -the -samples -placed -on -view -a -shrewder -discrimination -than -was -exhibited -by -his -son -and -successor -liholiho -i -think -liholiho -could -have -qualified -as -a -reformer -perhaps -but -as -a -king -he -was -a -mistake -a -mistake -because -he -tried -to -be -both -king -and -reformer -this -is -mixing -fire -and -gunpowder -together -a -king -has -no -proper -business -with -reforming -his -best -policy -is -to -keep -things -as -they -are -and -if -he -can't -do -that -he -ought -to -try -to -make -them -worse -than -they -are -this -is -not -guesswork -i -have -thought -over -this -matter -a -good -deal -so -that -if -i -should -ever -have -a -chance -to -become -a -king -i -would -know -how -to -conduct -the -business -in -the -best -way -when -liholiho -succeeded -his -father -he -found -himself -possessed -of -an -equipment -of -royal -tools -and -safeguards -which -a -wiser -king -would -have -known -how -to -husband -and -judiciously -employ -and -make -profitable -the -entire -country -was -under -the -one -scepter -and -his -was -that -scepter -there -was -an -established -church -and -he -was -the -head -of -it -there -was -a -standing -army -and -he -was -the -head -of -that -an -army -of -114 -privates -under -command -of -27 -generals -and -a -field -marshal -there -was -a -proud -and -ancient -hereditary -nobility -there -was -still -one -other -asset -this -was -the -tabu -an -agent -endowed -with -a -mysterious -and -stupendous -power -an -agent -not -found -among -the -properties -of -any -european -monarch -a -tool -of -inestimable -value -in -the -business -liholiho -was -headmaster -of -the -tabu -the -tabu -was -the -most -ingenious -and -effective -of -all -the -inventions -that -has -ever -been -devised -for -keeping -a -people's -privileges -satisfactorily -restricted -it -required -the -sexes -to -live -in -separate -houses -it -did -not -allow -people -to -eat -in -either -house -they -must -eat -in -another -place -it -did -not -allow -a -man's -woman -folk -to -enter -his -house -it -did -not -allow -the -sexes -to -eat -together -the -men -must -eat -first -and -the -women -must -wait -on -them -then -the -women -could -eat -what -was -left -if -anything -was -left -and -wait -on -themselves -i -mean -if -anything -of -a -coarse -or -unpalatable -sort -was -left -the -women -could -have -it -but -not -the -good -things -the -fine -things -the -choice -things -such -as -pork -poultry -bananas -cocoanuts -the -choicer -varieties -of -fish -and -so -on -by -the -tabu -all -these -were -sacred -to -the -men -the -women -spent -their -lives -longing -for -them -and -wondering -what -they -might -taste -like -and -they -died -without -finding -out -these -rules -as -you -see -were -quite -simple -and -clear -it -was -easy -to -remember -them -and -useful -for -the -penalty -for -infringing -any -rule -in -the -whole -list -was -death -those -women -easily -learned -to -put -up -with -shark -and -taro -and -dog -for -a -diet -when -the -other -things -were -so -expensive -it -was -death -for -any -one -to -walk -upon -tabu'd -ground -or -defile -a -tabu'd -thing -with -his -touch -or -fail -in -due -servility -to -a -chief -or -step -upon -the -king's -shadow -the -nobles -and -the -king -and -the -priests -were -always -suspending -little -rags -here -and -there -and -yonder -to -give -notice -to -the -people -that -the -decorated -spot -or -thing -was -tabu -and -death -lurking -near -the -struggle -for -life -was -difficult -and -chancy -in -the -islands -in -those -days -thus -advantageously -was -the -new -king -situated -will -it -be -believed -that -the -first -thing -he -did -was -to -destroy -his -established -church -root -and -branch -he -did -indeed -do -that -to -state -the -case -figuratively -he -was -a -prosperous -sailor -who -burnt -his -ship -and -took -to -a -raft -this -church -was -a -horrid -thing -it -heavily -oppressed -the -people -it -kept -them -always -trembling -in -the -gloom -of -mysterious -threatenings -it -slaughtered -them -in -sacrifice -before -its -grotesque -idols -of -wood -and -stone -it -cowed -them -it -terrorized -them -it -made -them -slaves -to -its -priests -and -through -the -priests -to -the -king -it -was -the -best -friend -a -king -could -have -and -the -most -dependable -to -a -professional -reformer -who -should -annihilate -so -frightful -and -so -devastating -a -power -as -this -church -reverence -and -praise -would -be -due -but -to -a -king -who -should -do -it -could -properly -be -due -nothing -but -reproach -reproach -softened -by -sorrow -sorrow -for -his -unfitness -for -his -position -he -destroyed -his -established -church -and -his -kingdom -is -a -republic -today -in -consequence -of -that -act -when -he -destroyed -the -church -and -burned -the -idols -he -did -a -mighty -thing -for -civilization -and -for -his -people's -weal -but -it -was -not -business -it -was -unkingly -it -was -inartistic -it -made -trouble -for -his -line -the -american -missionaries -arrived -while -the -burned -idols -were -still -smoking -they -found -the -nation -without -a -religion -and -they -repaired -the -defect -they -offered -their -own -religion -and -it -was -gladly -received -but -it -was -no -support -to -arbitrary -kingship -and -so -the -kingly -power -began -to -weaken -from -that -day -forty -seven -years -later -when -i -was -in -the -islands -kainehameha -v -was -trying -to -repair -liholiho's -blunder -and -not -succeeding -he -had -set -up -an -established -church -and -made -himself -the -head -of -it -but -it -was -only -a -pinchbeck -thing -an -imitation -a -bauble -an -empty -show -it -had -no -power -no -value -for -a -king -it -could -not -harry -or -burn -or -slay -it -in -no -way -resembled -the -admirable -machine -which -liholiho -destroyed -it -was -an -established -church -without -an -establishment -all -the -people -were -dissenters -long -before -that -the -kingship -had -itself -become -but -a -name -a -show -at -an -early -day -the -missionaries -had -turned -it -into -something -very -much -like -a -republic -and -here -lately -the -business -whites -have -turned -it -into -something -exactly -like -it -in -captain -cook's -time -1778 -the -native -population -of -the -islands -was -estimated -at -400 -000 -in -1836 -at -something -short -of -200 -000 -in -1866 -at -50 -000 -it -is -to -day -per -census -25 -000 -all -intelligent -people -praise -kamehameha -i -and -liholiho -for -conferring -upon -their -people -the -great -boon -of -civilization -i -would -do -it -myself -but -my -intelligence -is -out -of -repair -now -from -over -work -when -i -was -in -the -islands -nearly -a -generation -ago -i -was -acquainted -with -a -young -american -couple -who -had -among -their -belongings -an -attractive -little -son -of -the -age -of -seven -attractive -but -not -practicably -companionable -with -me -because -he -knew -no -english -he -had -played -from -his -birth -with -the -little -kanakas -on -his -father's -plantation -and -had -preferred -their -language -and -would -learn -no -other -the -family -removed -to -america -a -month -after -i -arrived -in -the -islands -and -straightway -the -boy -began -to -lose -his -kanaka -and -pick -up -english -by -the -time -he -was -twelve -be -hadn't -a -word -of -kanaka -left -the -language -had -wholly -departed -from -his -tongue -and -from -his -comprehension -nine -years -later -when -he -was -twenty -one -i -came -upon -the -family -in -one -of -the -lake -towns -of -new -york -and -the -mother -told -me -about -an -adventure -which -her -son -had -been -having -by -trade -he -was -now -a -professional -diver -a -passenger -boat -had -been -caught -in -a -storm -on -the -lake -and -had -gone -down -carrying -her -people -with -her -a -few -days -later -the -young -diver -descended -with -his -armor -on -and -entered -the -berth -saloon -of -the -boat -and -stood -at -the -foot -of -the -companionway -with -his -hand -on -the -rail -peering -through -the -dim -water -presently -something -touched -him -on -the -shoulder -and -he -turned -and -found -a -dead -man -swaying -and -bobbing -about -him -and -seemingly -inspecting -him -inquiringly -he -was -paralyzed -with -fright -his -entry -had -disturbed -the -water -and -now -he -discerned -a -number -of -dim -corpses -making -for -him -and -wagging -their -heads -and -swaying -their -bodies -like -sleepy -people -trying -to -dance -his -senses -forsook -him -and -in -that -condition -he -was -drawn -to -the -surface -he -was -put -to -bed -at -home -and -was -soon -very -ill -during -some -days -he -had -seasons -of -delirium -which -lasted -several -hours -at -a -time -and -while -they -lasted -he -talked -kanaka -incessantly -and -glibly -and -kanaka -only -he -was -still -very -ill -and -he -talked -to -me -in -that -tongue -but -i -did -not -understand -it -of -course -the -doctor -books -tell -us -that -cases -like -this -are -not -uncommon -then -the -doctors -ought -to -study -the -cases -and -find -out -how -to -multiply -them -many -languages -and -things -get -mislaid -in -a -person's -head -and -stay -mislaid -for -lack -of -this -remedy -many -memories -of -my -former -visit -to -the -islands -came -up -in -my -mind -while -we -lay -at -anchor -in -front -of -honolulu -that -night -and -pictures -pictures -pictures -an -enchanting -procession -of -them! -i -was -impatient -for -the -morning -to -come -when -it -came -it -brought -disappointment -of -course -cholera -had -broken -out -in -the -town -and -we -were -not -allowed -to -have -any -communication -with -the -shore -thus -suddenly -did -my -dream -of -twenty -nine -years -go -to -ruin -messages -came -from -friends -but -the -friends -themselves -i -was -not -to -have -any -sight -of -my -lecture -hall -was -ready -but -i -was -not -to -see -that -either -several -of -our -passengers -belonged -in -honolulu -and -these -were -sent -ashore -but -nobody -could -go -ashore -and -return -there -were -people -on -shore -who -were -booked -to -go -with -us -to -australia -but -we -could -not -receive -them -to -do -it -would -cost -us -a -quarantine -term -in -sydney -they -could -have -escaped -the -day -before -by -ship -to -san -francisco -but -the -bars -had -been -put -up -now -and -they -might -have -to -wait -weeks -before -any -ship -could -venture -to -give -them -a -passage -any -whither -and -there -were -hardships -for -others -an -elderly -lady -and -her -son -recreation -seekers -from -massachusetts -had -wandered -westward -further -and -further -from -home -always -intending -to -take -the -return -track -but -always -concluding -to -go -still -a -little -further -and -now -here -they -were -at -anchor -before -honolulu -positively -their -last -westward -bound -indulgence -they -had -made -up -their -minds -to -that -but -where -is -the -use -in -making -up -your -mind -in -this -world -it -is -usually -a -waste -of -time -to -do -it -these -two -would -have -to -stay -with -us -as -far -as -australia -then -they -could -go -on -around -the -world -or -go -back -the -way -they -had -come -the -distance -and -the -accommodations -and -outlay -of -time -would -be -just -the -same -whichever -of -the -two -routes -they -might -elect -to -take -think -of -it -a -projected -excursion -of -five -hundred -miles -gradually -enlarged -without -any -elaborate -degree -of -intention -to -a -possible -twenty -four -thousand -however -they -were -used -to -extensions -by -this -time -and -did -not -mind -this -new -one -much -and -we -had -with -us -a -lawyer -from -victoria -who -had -been -sent -out -by -the -government -on -an -international -matter -and -he -had -brought -his -wife -with -him -and -left -the -children -at -home -with -the -servants -and -now -what -was -to -be -done -go -ashore -amongst -the -cholera -and -take -the -risks -most -certainly -not -they -decided -to -go -on -to -the -fiji -islands -wait -there -a -fortnight -for -the -next -ship -and -then -sail -for -home -they -couldn't -foresee -that -they -wouldn't -see -a -homeward -bound -ship -again -for -six -weeks -and -that -no -word -could -come -to -them -from -the -children -and -no -word -go -from -them -to -the -children -in -all -that -time -it -is -easy -to -make -plans -in -this -world -even -a -cat -can -do -it -and -when -one -is -out -in -those -remote -oceans -it -is -noticeable -that -a -cat's -plans -and -a -man's -are -worth -about -the -same -there -is -much -the -same -shrinkage -in -both -in -the -matter -of -values -there -was -nothing -for -us -to -do -but -sit -about -the -decks -in -the -shade -of -the -awnings -and -look -at -the -distant -shore -we -lay -in -luminous -blue -water -shoreward -the -water -was -green -green -and -brilliant -at -the -shore -itself -it -broke -in -a -long -white -ruffle -and -with -no -crash -no -sound -that -we -could -hear -the -town -was -buried -under -a -mat -of -foliage -that -looked -like -a -cushion -of -moss -the -silky -mountains -were -clothed -in -soft -rich -splendors -of -melting -color -and -some -of -the -cliffs -were -veiled -in -slanting -mists -i -recognized -it -all -it -was -just -as -i -had -seen -it -long -before -with -nothing -of -its -beauty -lost -nothing -of -its -charm -wanting -a -change -had -come -but -that -was -political -and -not -visible -from -the -ship -the -monarchy -of -my -day -was -gone -and -a -republic -was -sitting -in -its -seat -it -was -not -a -material -change -the -old -imitation -pomps -the -fuss -and -feathers -have -departed -and -the -royal -trademark -that -is -about -all -that -one -could -miss -i -suppose -that -imitation -monarchy -was -grotesque -enough -in -my -time -if -it -had -held -on -another -thirty -years -it -would -have -been -a -monarchy -without -subjects -of -the -king's -race -we -had -a -sunset -of -a -very -fine -sort -the -vast -plain -of -the -sea -was -marked -off -in -bands -of -sharply -contrasted -colors -great -stretches -of -dark -blue -others -of -purple -others -of -polished -bronze -the -billowy -mountains -showed -all -sorts -of -dainty -browns -and -greens -blues -and -purples -and -blacks -and -the -rounded -velvety -backs -of -certain -of -them -made -one -want -to -stroke -them -as -one -would -the -sleek -back -of -a -cat -the -long -sloping -promontory -projecting -into -the -sea -at -the -west -turned -dim -and -leaden -and -spectral -then -became -suffused -with -pink -dissolved -itself -in -a -pink -dream -so -to -speak -it -seemed -so -airy -and -unreal -presently -the -cloud -rack -was -flooded -with -fiery -splendors -and -these -were -copied -on -the -surface -of -the -sea -and -it -made -one -drunk -with -delight -to -look -upon -it -from -talks -with -certain -of -our -passengers -whose -home -was -honolulu -and -from -a -sketch -by -mrs -mary -h -krout -i -was -able -to -perceive -what -the -honolulu -of -to -day -is -as -compared -with -the -honolulu -of -my -time -in -my -time -it -was -a -beautiful -little -town -made -up -of -snow -white -wooden -cottages -deliciously -smothered -in -tropical -vines -and -flowers -and -trees -and -shrubs -and -its -coral -roads -and -streets -were -hard -and -smooth -and -as -white -as -the -houses -the -outside -aspects -of -the -place -suggested -the -presence -of -a -modest -and -comfortable -prosperity -a -general -prosperity -perhaps -one -might -strengthen -the -term -and -say -universal -there -were -no -fine -houses -no -fine -furniture -there -were -no -decorations -tallow -candles -furnished -the -light -for -the -bedrooms -a -whale -oil -lamp -furnished -it -for -the -parlor -native -matting -served -as -carpeting -in -the -parlor -one -would -find -two -or -three -lithographs -on -the -walls -portraits -as -a -rule -kamehameha -iv -louis -kossuth -jenny -lind -and -may -be -an -engraving -or -two -rebecca -at -the -well -moses -smiting -the -rock -joseph's -servants -finding -the -cup -in -benjamin's -sack -there -would -be -a -center -table -with -books -of -a -tranquil -sort -on -it -the -whole -duty -of -man -baxter's -saints' -rest -fox's -martyrs -tupper's -proverbial -philosophy -bound -copies -of -the -missionary -herald -and -of -father -damon's -seaman's -friend -a -melodeon -a -music -stand -with -'willie -we -have -missed -you' -'star -of -the -evening' -'roll -on -silver -moon' -'are -we -most -there' -'i -would -not -live -alway' -and -other -songs -of -love -and -sentiment -together -with -an -assortment -of -hymns -a -what -not -with -semi -globular -glass -paperweights -enclosing -miniature -pictures -of -ships -new -england -rural -snowstorms -and -the -like -sea -shells -with -bible -texts -carved -on -them -in -cameo -style -native -curios -whale's -tooth -with -full -rigged -ship -carved -on -it -there -was -nothing -reminiscent -of -foreign -parts -for -nobody -had -been -abroad -trips -were -made -to -san -francisco -but -that -could -not -be -called -going -abroad -comprehensively -speaking -nobody -traveled -but -honolulu -has -grown -wealthy -since -then -and -of -course -wealth -has -introduced -changes -some -of -the -old -simplicities -have -disappeared -here -is -a -modern -house -as -pictured -by -mrs -krout -almost -every -house -is -surrounded -by -extensive -lawns -and -gardens -enclosed -by -walls -of -volcanic -stone -or -by -thick -hedges -of -the -brilliant -hibiscus -the -houses -are -most -tastefully -and -comfortably -furnished -the -floors -are -either -of -hard -wood -covered -with -rugs -or -with -fine -indian -matting -while -there -is -a -preference -as -in -most -warm -countries -for -rattan -or -bamboo -furniture -there -are -the -usual -accessories -of -bric -a -brac -pictures -books -and -curios -from -all -parts -of -the -world -for -these -island -dwellers -are -indefatigable -travelers -nearly -every -house -has -what -is -called -a -lanai -it -is -a -large -apartment -roofed -floored -open -on -three -sides -with -a -door -or -a -draped -archway -opening -into -the -drawing -room -frequently -the -roof -is -formed -by -the -thick -interlacing -boughs -of -the -hou -tree -impervious -to -the -sun -and -even -to -the -rain -except -in -violent -storms -vines -are -trained -about -the -sides -the -stephanotis -or -some -one -of -the -countless -fragrant -and -blossoming -trailers -which -abound -in -the -islands -there -are -also -curtains -of -matting -that -may -be -drawn -to -exclude -the -sun -or -rain -the -floor -is -bare -for -coolness -or -partially -covered -with -rugs -and -the -lanai -is -prettily -furnished -with -comfortable -chairs -sofas -and -tables -loaded -with -flowers -or -wonderful -ferns -in -pots -the -lanai -is -the -favorite -reception -room -and -here -at -any -social -function -the -musical -program -is -given -and -cakes -and -ices -are -served -here -morning -callers -are -received -or -gay -riding -parties -the -ladies -in -pretty -divided -skirts -worn -for -convenience -in -riding -astride -the -universal -mode -adopted -by -europeans -and -americans -as -well -as -by -the -natives -the -comfort -and -luxury -of -such -an -apartment -especially -at -a -seashore -villa -can -hardly -be -imagined -the -soft -breezes -sweep -across -it -heavy -with -the -fragrance -of -jasmine -and -gardenia -and -through -the -swaying -boughs -of -palm -and -mimosa -there -are -glimpses -of -rugged -mountains -their -summits -veiled -in -clouds -of -purple -sea -with -the -white -surf -beating -eternally -against -the -reefs -whiter -still -in -the -yellow -sunlight -or -the -magical -moonlight -of -the -tropics -there -rugs -ices -pictures -lanais -worldly -books -sinful -bric -a -brac -fetched -from -everywhere -and -the -ladies -riding -astride -these -are -changes -indeed -in -my -time -the -native -women -rode -astride -but -the -white -ones -lacked -the -courage -to -adopt -their -wise -custom -in -my -time -ice -was -seldom -seen -in -honolulu -it -sometimes -came -in -sailing -vessels -from -new -england -as -ballast -and -then -if -there -happened -to -be -a -man -of -war -in -port -and -balls -and -suppers -raging -by -consequence -the -ballast -was -worth -six -hundred -dollars -a -ton -as -is -evidenced -by -reputable -tradition -but -the -ice -machine -has -traveled -all -over -the -world -now -and -brought -ice -within -everybody's -reach -in -lapland -and -spitzbergen -no -one -uses -native -ice -in -our -day -except -the -bears -and -the -walruses -the -bicycle -is -not -mentioned -it -was -not -necessary -we -know -that -it -is -there -without -inquiring -it -is -everywhere -but -for -it -people -could -never -have -had -summer -homes -on -the -summit -of -mont -blanc -before -its -day -property -up -there -had -but -a -nominal -value -the -ladies -of -the -hawaiian -capital -learned -too -late -the -right -way -to -occupy -a -horse -too -late -to -get -much -benefit -from -it -the -riding -horse -is -retiring -from -business -everywhere -in -the -world -in -honolulu -a -few -years -from -now -he -will -be -only -a -tradition -we -all -know -about -father -damien -the -french -priest -who -voluntarily -forsook -the -world -and -went -to -the -leper -island -of -molokai -to -labor -among -its -population -of -sorrowful -exiles -who -wait -there -in -slow -consuming -misery -for -death -to -cone -and -release -them -from -their -troubles -and -we -know -that -the -thing -which -he -knew -beforehand -would -happen -did -happen -that -he -became -a -leper -himself -and -died -of -that -horrible -disease -there -was -still -another -case -of -self -sacrifice -it -appears -i -asked -after -billy -ragsdale -interpreter -to -the -parliament -in -my -time -a -half -white -he -was -a -brilliant -young -fellow -and -very -popular -as -an -interpreter -he -would -have -been -hard -to -match -anywhere -he -used -to -stand -up -in -the -parliament -and -turn -the -english -speeches -into -hawaiian -and -the -hawaiian -speeches -into -english -with -a -readiness -and -a -volubility -that -were -astonishing -i -asked -after -him -and -was -told -that -his -prosperous -career -was -cut -short -in -a -sudden -and -unexpected -way -just -as -he -was -about -to -marry -a -beautiful -half -caste -girl -he -discovered -by -some -nearly -invisible -sign -about -his -skin -that -the -poison -of -leprosy -was -in -him -the -secret -was -his -own -and -might -be -kept -concealed -for -years -but -he -would -not -be -treacherous -to -the -girl -that -loved -him -he -would -not -marry -her -to -a -doom -like -his -and -so -he -put -his -affairs -in -order -and -went -around -to -all -his -friends -and -bade -them -good -bye -and -sailed -in -the -leper -ship -to -molokai -there -he -died -the -loathsome -and -lingering -death -that -all -lepers -die -in -this -place -let -me -insert -a -paragraph -or -two -from -the -paradise -of -the -pacific -rev -h -h -gowen -poor -lepers! -it -is -easy -for -those -who -have -no -relatives -or -friends -among -them -to -enforce -the -decree -of -segregation -to -the -letter -but -who -can -write -of -the -terrible -the -heart -breaking -scenes -which -that -enforcement -has -brought -about -a -man -upon -hawaii -was -suddenly -taken -away -after -a -summary -arrest -leaving -behind -him -a -helpless -wife -about -to -give -birth -to -a -babe -the -devoted -wife -with -great -pain -and -risk -came -the -whole -journey -to -honolulu -and -pleaded -until -the -authorities -were -unable -to -resist -her -entreaty -that -she -might -go -and -live -like -a -leper -with -her -leper -husband -a -woman -in -the -prime -of -life -and -activity -is -condemned -as -an -incipient -leper -suddenly -removed -from -her -home -and -her -husband -returns -to -find -his -two -helpless -babes -moaning -for -their -lost -mother -imagine -it! -the -case -of -the -babies -is -hard -but -its -bitterness -is -a -trifle -less -than -a -trifle -less -than -nothing -compared -to -what -the -mother -must -suffer -and -suffer -minute -by -minute -hour -by -hour -day -by -day -month -by -month -year -by -year -without -respite -relief -or -any -abatement -of -her -pain -till -she -dies -one -woman -luka -kaaukau -has -been -living -with -her -leper -husband -in -the -settlement -for -twelve -years -the -man -has -scarcely -a -joint -left -his -limbs -are -only -distorted -ulcerated -stumps -for -four -years -his -wife -has -put -every -particle -of -food -into -his -mouth -he -wanted -his -wife -to -abandon -his -wretched -carcass -long -ago -as -she -herself -was -sound -and -well -but -luka -said -that -she -was -content -to -remain -and -wait -on -the -man -she -loved -till -the -spirit -should -be -freed -from -its -burden -i -myself -have -known -hard -cases -enough -of -a -girl -apparently -in -full -health -decorating -the -church -with -me -at -easter -who -before -christmas -is -taken -away -as -a -confirmed -leper -of -a -mother -hiding -her -child -in -the -mountains -for -years -so -that -not -even -her -dearest -friends -knew -that -she -had -a -child -alive -that -he -might -not -be -taken -away -of -a -respectable -white -man -taken -away -from -his -wife -and -family -and -compelled -to -become -a -dweller -in -the -leper -settlement -where -he -is -counted -dead -even -by -the -insurance -companies -and -one -great -pity -of -it -all -is -that -these -poor -sufferers -are -innocent -the -leprosy -does -not -come -of -sins -which -they -committed -but -of -sins -committed -by -their -ancestors -who -escaped -the -curse -of -leprosy! -mr -gowan -has -made -record -of -a -certain -very -striking -circumstance -would -you -expect -to -find -in -that -awful -leper -settlement -a -custom -worthy -to -be -transplanted -to -your -own -country -they -have -one -such -and -it -is -inexpressibly -touching -and -beautiful -when -death -sets -open -the -prison -door -of -life -there -the -band -salutes -the -freed -soul -with -a -burst -of -glad -music! -chapter -iv -a -dozen -direct -censures -are -easier -to -bear -than -one -morganatic -compliment -pudd'nhead -wilson's -new -calendar -sailed -from -honolulu -from -diary -sept -2 -flocks -of -flying -fish -slim -shapely -graceful -and -intensely -white -with -the -sun -on -them -they -look -like -a -flight -of -silver -fruit -knives -they -are -able -to -fly -a -hundred -yards -sept -3 -in -9 -deg -50' -north -latitude -at -breakfast -approaching -the -equator -on -a -long -slant -those -of -us -who -have -never -seen -the -equator -are -a -good -deal -excited -i -think -i -would -rather -see -it -than -any -other -thing -in -the -world -we -entered -the -doldrums -last -night -variable -winds -bursts -of -rain -intervals -of -calm -with -chopping -seas -and -a -wobbly -and -drunken -motion -to -the -ship -a -condition -of -things -findable -in -other -regions -sometimes -but -present -in -the -doldrums -always -the -globe -girdling -belt -called -the -doldrums -is -20 -degrees -wide -and -the -thread -called -the -equator -lies -along -the -middle -of -it -sept -4 -total -eclipse -of -the -moon -last -night -at -1 -30 -it -began -to -go -off -at -total -or -about -that -it -was -like -a -rich -rosy -cloud -with -a -tumbled -surface -framed -in -the -circle -and -projecting -from -it -a -bulge -of -strawberry -ice -so -to -speak -at -half -eclipse -the -moon -was -like -a -gilded -acorn -in -its -cup -sept -5 -closing -in -on -the -equator -this -noon -a -sailor -explained -to -a -young -girl -that -the -ship's -speed -is -poor -because -we -are -climbing -up -the -bulge -toward -the -center -of -the -globe -but -that -when -we -should -once -get -over -at -the -equator -and -start -down -hill -we -should -fly -when -she -asked -him -the -other -day -what -the -fore -yard -was -he -said -it -was -the -front -yard -the -open -area -in -the -front -end -of -the -ship -that -man -has -a -good -deal -of -learning -stored -up -and -the -girl -is -likely -to -get -it -all -afternoon -crossed -the -equator -in -the -distance -it -looked -like -a -blue -ribbon -stretched -across -the -ocean -several -passengers -kodak'd -it -we -had -no -fool -ceremonies -no -fantastics -no -horse -play -all -that -sort -of -thing -has -gone -out -in -old -times -a -sailor -dressed -as -neptune -used -to -come -in -over -the -bows -with -his -suite -and -lather -up -and -shave -everybody -who -was -crossing -the -equator -for -the -first -time -and -then -cleanse -these -unfortunates -by -swinging -them -from -the -yard -arm -and -ducking -them -three -times -in -the -sea -this -was -considered -funny -nobody -knows -why -no -that -is -not -true -we -do -know -why -such -a -thing -could -never -be -funny -on -land -no -part -of -the -old -time -grotesque -performances -gotten -up -on -shipboard -to -celebrate -the -passage -of -the -line -would -ever -be -funny -on -shore -they -would -seem -dreary -and -less -to -shore -people -but -the -shore -people -would -change -their -minds -about -it -at -sea -on -a -long -voyage -on -such -a -voyage -with -its -eternal -monotonies -people's -intellects -deteriorate -the -owners -of -the -intellects -soon -reach -a -point -where -they -almost -seem -to -prefer -childish -things -to -things -of -a -maturer -degree -one -is -often -surprised -at -the -juvenilities -which -grown -people -indulge -in -at -sea -and -the -interest -they -take -in -them -and -the -consuming -enjoyment -they -get -out -of -them -this -is -on -long -voyages -only -the -mind -gradually -becomes -inert -dull -blunted -it -loses -its -accustomed -interest -in -intellectual -things -nothing -but -horse -play -can -rouse -it -nothing -but -wild -and -foolish -grotesqueries -can -entertain -it -on -short -voyages -it -makes -no -such -exposure -of -itself -it -hasn't -time -to -slump -down -to -this -sorrowful -level -the -short -voyage -passenger -gets -his -chief -physical -exercise -out -of -horse -billiards -shovel -board -it -is -a -good -game -we -play -it -in -this -ship -a -quartermaster -chalks -off -a -diagram -like -this -on -the -deck -the -player -uses -a -cue -that -is -like -a -broom -handle -with -a -quarter -moon -of -wood -fastened -to -the -end -of -it -with -this -he -shoves -wooden -disks -the -size -of -a -saucer -he -gives -the -disk -a -vigorous -shove -and -sends -it -fifteen -or -twenty -feet -along -the -deck -and -lands -it -in -one -of -the -squares -if -he -can -if -it -stays -there -till -the -inning -is -played -out -it -will -count -as -many -points -in -the -game -as -the -figure -in -the -square -it -has -stopped -in -represents -the -adversary -plays -to -knock -that -disk -out -and -leave -his -own -in -its -place -particularly -if -it -rests -upon -the -9 -or -10 -or -some -other -of -the -high -numbers -but -if -it -rests -in -the -10off -he -backs -it -up -lands -his -disk -behind -it -a -foot -or -two -to -make -it -difficult -for -its -owner -to -knock -it -out -of -that -damaging -place -and -improve -his -record -when -the -inning -is -played -out -it -may -be -found -that -each -adversary -has -placed -his -four -disks -where -they -count -it -may -be -found -that -some -of -them -are -touching -chalk -lines -and -not -counting -and -very -often -it -will -be -found -that -there -has -been -a -general -wreckage -and -that -not -a -disk -has -been -left -within -the -diagram -anyway -the -result -is -recorded -whatever -it -is -and -the -game -goes -on -the -game -is -100 -points -and -it -takes -from -twenty -minutes -to -forty -to -play -it -according -to -luck -and -the -condition -of -the -sea -it -is -an -exciting -game -and -the -crowd -of -spectators -furnish -abundance -of -applause -for -fortunate -shots -and -plenty -of -laughter -for -the -other -kind -it -is -a -game -of -skill -but -at -the -same -time -the -uneasy -motion -of -the -ship -is -constantly -interfering -with -skill -this -makes -it -a -chancy -game -and -the -element -of -luck -comes -largely -in -we -had -a -couple -of -grand -tournaments -to -determine -who -should -be -champion -of -the -pacific -they -included -among -the -participants -nearly -all -the -passengers -of -both -sexes -and -the -officers -of -the -ship -and -they -afforded -many -days -of -stupendous -interest -and -excitement -and -murderous -exercise -for -horse -billiards -is -a -physically -violent -game -the -figures -in -the -following -record -of -some -of -the -closing -games -in -the -first -tournament -will -show -better -than -any -description -how -very -chancy -the -game -is -the -losers -here -represented -had -all -been -winners -in -the -previous -games -of -the -series -some -of -them -by -fine -majorities -chase -102 -mrs -d -57 -mortimer -105 -the -surgeon -92 -miss -c -105 -mrs -t -9 -clemens -101 -taylor -92 -taylor -109 -davies -95 -miss -c -108 -mortimer -55 -thomas -102 -roper -76 -clemens -111 -miss -c -89 -coomber -106 -chase -98 -and -so -on -until -but -three -couples -of -winners -were -left -then -i -beat -my -man -young -smith -beat -his -man -and -thomas -beat -his -this -reduced -the -combatants -to -three -smith -and -i -took -the -deck -and -i -led -off -at -the -close -of -the -first -inning -i -was -10 -worse -than -nothing -and -smith -had -scored -7 -the -luck -continued -against -me -when -i -was -57 -smith -was -97 -within -3 -of -out -the -luck -changed -then -he -picked -up -a -10 -off -or -so -and -couldn't -recover -i -beat -him -the -next -game -would -end -tournament -no -1 -mr -thomas -and -i -were -the -contestants -he -won -the -lead -and -went -to -the -bat -so -to -speak -and -there -he -stood -with -the -crotch -of -his -cue -resting -against -his -disk -while -the -ship -rose -slowly -up -sank -slowly -down -rose -again -sank -again -she -never -seemed -to -rise -to -suit -him -exactly -she -started -up -once -more -and -when -she -was -nearly -ready -for -the -turn -he -let -drive -and -landed -his -disk -just -within -the -left -hand -end -of -the -10 -applause -the -umpire -proclaimed -a -good -10 -and -the -game -keeper -set -it -down -i -played -my -disk -grazed -the -edge -of -mr -thomas's -disk -and -went -out -of -the -diagram -no -applause -mr -thomas -played -again -and -landed -his -second -disk -alongside -of -the -first -and -almost -touching -its -right -hand -side -good -10 -great -applause -i -played -and -missed -both -of -them -no -applause -mr -thomas -delivered -his -third -shot -and -landed -his -disk -just -at -the -right -of -the -other -two -good -10 -immense -applause -there -they -lay -side -by -side -the -three -in -a -row -it -did -not -seem -possible -that -anybody -could -miss -them -still -i -did -it -immense -silence -mr -thomas -played -his -last -disk -it -seems -incredible -but -he -actually -landed -that -disk -alongside -of -the -others -and -just -to -the -right -of -them -a -straight -solid -row -of -4 -disks -tumultuous -and -long -continued -applause -then -i -played -my -last -disk -again -it -did -not -seem -possible -that -anybody -could -miss -that -row -a -row -which -would -have -been -14 -inches -long -if -the -disks -had -been -clamped -together -whereas -with -the -spaces -separating -them -they -made -a -longer -row -than -that -but -i -did -it -it -may -be -that -i -was -getting -nervous -i -think -it -unlikely -that -that -innings -has -ever -had -its -parallel -in -the -history -of -horse -billiards -to -place -the -four -disks -side -by -side -in -the -10 -was -an -extraordinary -feat -indeed -it -was -a -kind -of -miracle -to -miss -them -was -another -miracle -it -will -take -a -century -to -produce -another -man -who -can -place -the -four -disks -in -the -10 -and -longer -than -that -to -find -a -man -who -can't -knock -them -out -i -was -ashamed -of -my -performance -at -the -time -but -now -that -i -reflect -upon -it -i -see -that -it -was -rather -fine -and -difficult -mr -thomas -kept -his -luck -and -won -the -game -and -later -the -championship -in -a -minor -tournament -i -won -the -prize -which -was -a -waterbury -watch -i -put -it -in -my -trunk -in -pretoria -south -africa -nine -months -afterward -my -proper -watch -broke -down -and -i -took -the -waterbury -out -wound -it -set -it -by -the -great -clock -on -the -parliament -house -8 -05 -then -went -back -to -my -room -and -went -to -bed -tired -from -a -long -railway -journey -the -parliamentary -clock -had -a -peculiarity -which -i -was -not -aware -of -at -the -time -a -peculiarity -which -exists -in -no -other -clock -and -would -not -exist -in -that -one -if -it -had -been -made -by -a -sane -person -on -the -half -hour -it -strikes -the -succeeding -hour -then -strikes -the -hour -again -at -the -proper -time -i -lay -reading -and -smoking -awhile -then -when -i -could -hold -my -eyes -open -no -longer -and -was -about -to -put -out -the -light -the -great -clock -began -to -boom -and -i -counted -ten -i -reached -for -the -waterbury -to -see -how -it -was -getting -along -it -was -marking -9 -30 -it -seemed -rather -poor -speed -for -a -three -dollar -watch -but -i -supposed -that -the -climate -was -affecting -it -i -shoved -it -half -an -hour -ahead -and -took -to -my -book -and -waited -to -see -what -would -happen -at -10 -the -great -clock -struck -ten -again -i -looked -the -waterbury -was -marking -half -past -10 -this -was -too -much -speed -for -the -money -and -it -troubled -me -i -pushed -the -hands -back -a -half -hour -and -waited -once -more -i -had -to -for -i -was -vexed -and -restless -now -and -my -sleepiness -was -gone -by -and -by -the -great -clock -struck -11 -the -waterbury -was -marking -10 -30 -i -pushed -it -ahead -half -an -hour -with -some -show -of -temper -by -and -by -the -great -clock -struck -11 -again -the -waterbury -showed -up -11 -30 -now -and -i -beat -her -brains -out -against -the -bedstead -i -was -sorry -next -day -when -i -found -out -to -return -to -the -ship -the -average -human -being -is -a -perverse -creature -and -when -he -isn't -that -he -is -a -practical -joker -the -result -to -the -other -person -concerned -is -about -the -same -that -is -he -is -made -to -suffer -the -washing -down -of -the -decks -begins -at -a -very -early -hour -in -all -ships -in -but -few -ships -are -any -measures -taken -to -protect -the -passengers -either -by -waking -or -warning -them -or -by -sending -a -steward -to -close -their -ports -and -so -the -deckwashers -have -their -opportunity -and -they -use -it -they -send -a -bucket -of -water -slashing -along -the -side -of -the -ship -and -into -the -ports -drenching -the -passenger's -clothes -and -often -the -passenger -himself -this -good -old -custom -prevailed -in -this -ship -and -under -unusually -favorable -circumstances -for -in -the -blazing -tropical -regions -a -removable -zinc -thing -like -a -sugarshovel -projects -from -the -port -to -catch -the -wind -and -bring -it -in -this -thing -catches -the -wash -water -and -brings -it -in -too -and -in -flooding -abundance -mrs -l -an -invalid -had -to -sleep -on -the -locker -sofa -under -her -port -and -every -time -she -over -slept -and -thus -failed -to -take -care -of -herself -the -deck -washers -drowned -her -out -and -the -painters -what -a -good -time -they -had! -this -ship -would -be -going -into -dock -for -a -month -in -sydney -for -repairs -but -no -matter -painting -was -going -on -all -the -time -somewhere -or -other -the -ladies' -dresses -were -constantly -getting -ruined -nevertheless -protests -and -supplications -went -for -nothing -sometimes -a -lady -taking -an -afternoon -nap -on -deck -near -a -ventilator -or -some -other -thing -that -didn't -need -painting -would -wake -up -by -and -by -and -find -that -the -humorous -painter -had -been -noiselessly -daubing -that -thing -and -had -splattered -her -white -gown -all -over -with -little -greasy -yellow -spots -the -blame -for -this -untimely -painting -did -not -lie -with -the -ship's -officers -but -with -custom -as -far -back -as -noah's -time -it -became -law -that -ships -must -be -constantly -painted -and -fussed -at -when -at -sea -custom -grew -out -of -the -law -and -at -sea -custom -knows -no -death -this -custom -will -continue -until -the -sea -goes -dry -sept -8 -sunday -we -are -moving -so -nearly -south -that -we -cross -only -about -two -meridians -of -longitude -a -day -this -morning -we -were -in -longitude -178 -west -from -greenwich -and -57 -degrees -west -from -san -francisco -to -morrow -we -shall -be -close -to -the -center -of -the -globe -the -180th -degree -of -west -longitude -and -180th -degree -of -east -longitude -and -then -we -must -drop -out -a -day -lose -a -day -out -of -our -lives -a -day -never -to -be -found -again -we -shall -all -die -one -day -earlier -than -from -the -beginning -of -time -we -were -foreordained -to -die -we -shall -be -a -day -behindhand -all -through -eternity -we -shall -always -be -saying -to -the -other -angels -fine -day -today -and -they -will -be -always -retorting -but -it -isn't -to -day -it's -tomorrow -we -shall -be -in -a -state -of -confusion -all -the -time -and -shall -never -know -what -true -happiness -is -next -day -sure -enough -it -has -happened -yesterday -it -was -september -8 -sunday -to -day -per -the -bulletin -board -at -the -head -of -the -companionway -it -is -september -10 -tuesday -there -is -something -uncanny -about -it -and -uncomfortable -in -fact -nearly -unthinkable -and -wholly -unrealizable -when -one -comes -to -consider -it -while -we -were -crossing -the -180th -meridian -it -was -sunday -in -the -stern -of -the -ship -where -my -family -were -and -tuesday -in -the -bow -where -i -was -they -were -there -eating -the -half -of -a -fresh -apple -on -the -8th -and -i -was -at -the -same -time -eating -the -other -half -of -it -on -the -10th -and -i -could -notice -how -stale -it -was -already -the -family -were -the -same -age -that -they -were -when -i -had -left -them -five -minutes -before -but -i -was -a -day -older -now -than -i -was -then -the -day -they -were -living -in -stretched -behind -them -half -way -round -the -globe -across -the -pacific -ocean -and -america -and -europe -the -day -i -was -living -in -stretched -in -front -of -me -around -the -other -half -to -meet -it -they -were -stupendous -days -for -bulk -and -stretch -apparently -much -larger -days -than -we -had -ever -been -in -before -all -previous -days -had -been -but -shrunk -up -little -things -by -comparison -the -difference -in -temperature -between -the -two -days -was -very -marked -their -day -being -hotter -than -mine -because -it -was -closer -to -the -equator -along -about -the -moment -that -we -were -crossing -the -great -meridian -a -child -was -born -in -the -steerage -and -now -there -is -no -way -to -tell -which -day -it -was -born -on -the -nurse -thinks -it -was -sunday -the -surgeon -thinks -it -was -tuesday -the -child -will -never -know -its -own -birthday -it -will -always -be -choosing -first -one -and -then -the -other -and -will -never -be -able -to -make -up -its -mind -permanently -this -will -breed -vacillation -and -uncertainty -in -its -opinions -about -religion -and -politics -and -business -and -sweethearts -and -everything -and -will -undermine -its -principles -and -rot -them -away -and -make -the -poor -thing -characterless -and -its -success -in -life -impossible -every -one -in -the -ship -says -so -and -this -is -not -all -in -fact -not -the -worst -for -there -is -an -enormously -rich -brewer -in -the -ship -who -said -as -much -as -ten -days -ago -that -if -the -child -was -born -on -his -birthday -he -would -give -it -ten -thousand -dollars -to -start -its -little -life -with -his -birthday -was -monday -the -9th -of -september -if -the -ships -all -moved -in -the -one -direction -westward -i -mean -the -world -would -suffer -a -prodigious -loss -in -the -matter -of -valuable -time -through -the -dumping -overboard -on -the -great -meridian -of -such -multitudes -of -days -by -ships -crews -and -passengers -but -fortunately -the -ships -do -not -all -sail -west -half -of -them -sail -east -so -there -is -no -real -loss -these -latter -pick -up -all -the -discarded -days -and -add -them -to -the -world's -stock -again -and -about -as -good -as -new -too -for -of -course -the -salt -water -preserves -them -chapter -v -noise -proves -nothing -often -a -hen -who -has -merely -laid -an -egg -cackles -as -if -she -had -laid -an -asteroid -pudd'nhead -wilson's -new -calendar -wednesday -sept -11 -in -this -world -we -often -make -mistakes -of -judgment -we -do -not -as -a -rule -get -out -of -them -sound -and -whole -but -sometimes -we -do -at -dinner -yesterday -evening -present -a -mixture -of -scotch -english -american -canadian -and -australasian -folk -a -discussion -broke -out -about -the -pronunciation -of -certain -scottish -words -this -was -private -ground -and -the -non -scotch -nationalities -with -one -exception -discreetly -kept -still -but -i -am -not -discreet -and -i -took -a -hand -i -didn't -know -anything -about -the -subject -but -i -took -a -hand -just -to -have -something -to -do -at -that -moment -the -word -in -dispute -was -the -word -three -one -scotchman -was -claiming -that -the -peasantry -of -scotland -pronounced -it -three -his -adversaries -claimed -that -they -didn't -that -they -pronounced -it -'thraw' -the -solitary -scot -was -having -a -sultry -time -of -it -so -i -thought -i -would -enrich -him -with -my -help -in -my -position -i -was -necessarily -quite -impartial -and -was -equally -as -well -and -as -ill -equipped -to -fight -on -the -one -side -as -on -the -other -so -i -spoke -up -and -said -the -peasantry -pronounced -the -word -three -not -thraw -it -was -an -error -of -judgment -there -was -a -moment -of -astonished -and -ominous -silence -then -weather -ensued -the -storm -rose -and -spread -in -a -surprising -way -and -i -was -snowed -under -in -a -very -few -minutes -it -was -a -bad -defeat -for -me -a -kind -of -waterloo -it -promised -to -remain -so -and -i -wished -i -had -had -better -sense -than -to -enter -upon -such -a -forlorn -enterprise -but -just -then -i -had -a -saving -thought -at -least -a -thought -that -offered -a -chance -while -the -storm -was -still -raging -i -made -up -a -scotch -couplet -and -then -spoke -up -and -said -very -well -don't -say -any -more -i -confess -defeat -i -thought -i -knew -but -i -see -my -mistake -i -was -deceived -by -one -of -your -scotch -poets -a -scotch -poet! -o -come! -name -him -robert -burns -it -is -wonderful -the -power -of -that -name -these -men -looked -doubtful -but -paralyzed -all -the -same -they -were -quite -silent -for -a -moment -then -one -of -them -said -with -the -reverence -in -his -voice -which -is -always -present -in -a -scotchman's -tone -when -he -utters -the -name -does -robbie -burns -say -what -does -he -say -this -is -what -he -says -'there -were -nae -bairns -but -only -three -ane -at -the -breast -twa -at -the -knee -' -it -ended -the -discussion -there -was -no -man -there -profane -enough -disloyal -enough -to -say -any -word -against -a -thing -which -robert -burns -had -settled -i -shall -always -honor -that -great -name -for -the -salvation -it -brought -me -in -this -time -of -my -sore -need -it -is -my -belief -that -nearly -any -invented -quotation -played -with -confidence -stands -a -good -chance -to -deceive -there -are -people -who -think -that -honesty -is -always -the -best -policy -this -is -a -superstition -there -are -times -when -the -appearance -of -it -is -worth -six -of -it -we -are -moving -steadily -southward -getting -further -and -further -down -under -the -projecting -paunch -of -the -globe -yesterday -evening -we -saw -the -big -dipper -and -the -north -star -sink -below -the -horizon -and -disappear -from -our -world -no -not -we -but -they -they -saw -it -somebody -saw -it -and -told -me -about -it -but -it -is -no -matter -i -was -not -caring -for -those -things -i -am -tired -of -them -any -way -i -think -they -are -well -enough -but -one -doesn't -want -them -always -hanging -around -my -interest -was -all -in -the -southern -cross -i -had -never -seen -that -i -had -heard -about -it -all -my -life -and -it -was -but -natural -that -i -should -be -burning -to -see -it -no -other -constellation -makes -so -much -talk -i -had -nothing -against -the -big -dipper -and -naturally -couldn't -have -anything -against -it -since -it -is -a -citizen -of -our -own -sky -and -the -property -of -the -united -states -but -i -did -want -it -to -move -out -of -the -way -and -give -this -foreigner -a -chance -judging -by -the -size -of -the -talk -which -the -southern -cross -had -made -i -supposed -it -would -need -a -sky -all -to -itself -but -that -was -a -mistake -we -saw -the -cross -to -night -and -it -is -not -large -not -large -and -not -strikingly -bright -but -it -was -low -down -toward -the -horizon -and -it -may -improve -when -it -gets -up -higher -in -the -sky -it -is -ingeniously -named -for -it -looks -just -as -a -cross -would -look -if -it -looked -like -something -else -but -that -description -does -not -describe -it -is -too -vague -too -general -too -indefinite -it -does -after -a -fashion -suggest -a -cross -across -that -is -out -of -repair -or -out -of -drawing -not -correctly -shaped -it -is -long -with -a -short -cross -bar -and -the -cross -bar -is -canted -out -of -the -straight -line -it -consists -of -four -large -stars -and -one -little -one -the -little -one -is -out -of -line -and -further -damages -the -shape -it -should -have -been -placed -at -the -intersection -of -the -stem -and -the -cross -bar -if -you -do -not -draw -an -imaginary -line -from -star -to -star -it -does -not -suggest -a -cross -nor -anything -in -particular -one -must -ignore -the -little -star -and -leave -it -out -of -the -combination -it -confuses -everything -if -you -leave -it -out -then -you -can -make -out -of -the -four -stars -a -sort -of -cross -out -of -true -or -a -sort -of -kite -out -of -true -or -a -sort -of -coffin -out -of -true -constellations -have -always -been -troublesome -things -to -name -if -you -give -one -of -them -a -fanciful -name -it -will -always -refuse -to -live -up -to -it -it -will -always -persist -in -not -resembling -the -thing -it -has -been -named -for -ultimately -to -satisfy -the -public -the -fanciful -name -has -to -be -discarded -for -a -common -sense -one -a -manifestly -descriptive -one -the -great -bear -remained -the -great -bear -and -unrecognizable -as -such -for -thousands -of -years -and -people -complained -about -it -all -the -time -and -quite -properly -but -as -soon -as -it -became -the -property -of -the -united -states -congress -changed -it -to -the -big -dipper -and -now -every -body -is -satisfied -and -there -is -no -more -talk -about -riots -i -would -not -change -the -southern -cross -to -the -southern -coffin -i -would -change -it -to -the -southern -kite -for -up -there -in -the -general -emptiness -is -the -proper -home -of -a -kite -but -not -for -coffins -and -crosses -and -dippers -in -a -little -while -now -i -cannot -tell -exactly -how -long -it -will -be -the -globe -will -belong -to -the -english -speaking -race -and -of -course -the -skies -also -then -the -constellations -will -be -re -organized -and -polished -up -and -re -named -the -most -of -them -victoria -i -reckon -but -this -one -will -sail -thereafter -as -the -southern -kite -or -go -out -of -business -several -towns -and -things -here -and -there -have -been -named -for -her -majesty -already -in -these -past -few -days -we -are -plowing -through -a -mighty -milky -way -of -islands -they -are -so -thick -on -the -map -that -one -would -hardly -expect -to -find -room -between -them -for -a -canoe -yet -we -seldom -glimpse -one -once -we -saw -the -dim -bulk -of -a -couple -of -them -far -away -spectral -and -dreamy -things -members -of -the -horne -alofa -and -fortuna -on -the -larger -one -are -two -rival -native -kings -and -they -have -a -time -together -they -are -catholics -so -are -their -people -the -missionaries -there -are -french -priests -from -the -multitudinous -islands -in -these -regions -the -recruits -for -the -queensland -plantations -were -formerly -drawn -are -still -drawn -from -them -i -believe -vessels -fitted -up -like -old -time -slavers -came -here -and -carried -off -the -natives -to -serve -as -laborers -in -the -great -australian -province -in -the -beginning -it -was -plain -simple -man -stealing -as -per -testimony -of -the -missionaries -this -has -been -denied -but -not -disproven -afterward -it -was -forbidden -by -law -to -recruit -a -native -without -his -consent -and -governmental -agents -were -sent -in -all -recruiting -vessels -to -see -that -the -law -was -obeyed -which -they -did -according -to -the -recruiting -people -and -which -they -sometimes -didn't -according -to -the -missionaries -a -man -could -be -lawfully -recruited -for -a -three -years -term -of -service -he -could -volunteer -for -another -term -if -he -so -chose -when -his -time -was -up -he -could -return -to -his -island -and -would -also -have -the -means -to -do -it -for -the -government -required -the -employer -to -put -money -in -its -hands -for -this -purpose -before -the -recruit -was -delivered -to -him -captain -wawn -was -a -recruiting -ship -master -during -many -years -from -his -pleasant -book -one -gets -the -idea -that -the -recruiting -business -was -quite -popular -with -the -islanders -as -a -rule -and -yet -that -did -not -make -the -business -wholly -dull -and -uninteresting -for -one -finds -rather -frequent -little -breaks -in -the -monotony -of -it -like -this -for -instance -the -afternoon -of -our -arrival -at -leper -island -the -schooner -was -lying -almost -becalmed -under -the -lee -of -the -lofty -central -portion -of -the -island -about -three -quarters -of -a -mile -from -the -shore -the -boats -were -in -sight -at -some -distance -the -recruiter -boat -had -run -into -a -small -nook -on -the -rocky -coast -under -a -high -bank -above -which -stood -a -solitary -hut -backed -by -dense -forest -the -government -agent -and -mate -in -the -second -boat -lay -about -400 -yards -to -the -westward -suddenly -we -heard -the -sound -of -firing -followed -by -yells -from -the -natives -on -shore -and -then -we -saw -the -recruiter -boat -push -out -with -a -seemingly -diminished -crew -the -mate's -boat -pulled -quickly -up -took -her -in -tow -and -presently -brought -her -alongside -all -her -own -crew -being -more -or -less -hurt -it -seems -the -natives -had -called -them -into -the -place -on -pretence -of -friendship -a -crowd -gathered -about -the -stern -of -the -boat -and -several -fellows -even -got -into -her -all -of -a -sudden -our -men -were -attacked -with -clubs -and -tomahawks -the -recruiter -escaped -the -first -blows -aimed -at -him -making -play -with -his -fists -until -he -had -an -opportunity -to -draw -his -revolver -'tom -sayers -' -a -mare -man -received -a -tomahawk -blow -on -the -head -which -laid -the -scalp -open -but -did -not -penetrate -his -skull -fortunately -'bobby -towns -' -another -mare -boatman -had -both -his -thumbs -cut -in -warding -off -blows -one -of -them -being -so -nearly -severed -from -the -hand -that -the -doctors -had -to -finish -the -operation -lihu -a -lifu -boy -the -recruiter's -special -attendant -was -cut -and -pricked -in -various -places -but -nowhere -seriously -jack -an -unlucky -tanna -recruit -who -had -been -engaged -to -act -as -boatman -received -an -arrow -through -his -forearm -the -head -of -which -apiece -of -bone -seven -or -eight -inches -long -was -still -in -the -limb -protruding -from -both -sides -when -the -boats -returned -the -recruiter -himself -would -have -got -off -scot -free -had -not -an -arrow -pinned -one -of -his -fingers -to -the -loom -of -the -steering -oar -just -as -they -were -getting -off -the -fight -had -been -short -but -sharp -the -enemy -lost -two -men -both -shot -dead -the -truth -is -captain -wawn -furnishes -such -a -crowd -of -instances -of -fatal -encounters -between -natives -and -french -and -english -recruiting -crews -for -the -french -are -in -the -business -for -the -plantations -of -new -caledonia -that -one -is -almost -persuaded -that -recruiting -is -not -thoroughly -popular -among -the -islanders -else -why -this -bristling -string -of -attacks -and -bloodcurdling -slaughter -the -captain -lays -it -all -to -exeter -hall -influence -but -for -the -meddling -philanthropists -the -native -fathers -and -mothers -would -be -fond -of -seeing -their -children -carted -into -exile -and -now -and -then -the -grave -instead -of -weeping -about -it -and -trying -to -kill -the -kind -recruiters -chapter -vi -he -was -as -shy -as -a -newspaper -is -when -referring -to -its -own -merits -pudd'nhead -wilson's -new -calendar -captain -wawn -is -crystal -clear -on -one -point -he -does -not -approve -of -missionaries -they -obstruct -his -business -they -make -recruiting -as -he -calls -it -slave -catching -as -they -call -it -in -their -frank -way -a -trouble -when -it -ought -to -be -just -a -picnic -and -a -pleasure -excursion -the -missionaries -have -their -opinion -about -the -manner -in -which -the -labor -traffic -is -conducted -and -about -the -recruiter's -evasions -of -the -law -of -the -traffic -and -about -the -traffic -itself -and -it -is -distinctly -uncomplimentary -to -the -traffic -and -to -everything -connected -with -it -including -the -law -for -its -regulation -captain -wawn's -book -is -of -very -recent -date -i -have -by -me -a -pamphlet -of -still -later -date -hot -from -the -press -in -fact -by -rev -wm -gray -a -missionary -and -the -book -and -the -pamphlet -taken -together -make -exceedingly -interesting -reading -to -my -mind -interesting -and -easy -to -understand -except -in -one -detail -which -i -will -mention -presently -it -is -easy -to -understand -why -the -queensland -sugar -planter -should -want -the -kanaka -recruit -he -is -cheap -very -cheap -in -fact -these -are -the -figures -paid -by -the -planter -l20 -to -the -recruiter -for -getting -the -kanaka -or -catching -him -as -the -missionary -phrase -goes -l3 -to -the -queensland -government -for -superintending -the -importation -l5 -deposited -with -the -government -for -the -kanaka's -passage -home -when -his -three -years -are -up -in -case -he -shall -live -that -long -about -l25 -to -the -kanaka -himself -for -three -years' -wages -and -clothing -total -payment -for -the -use -of -a -man -three -years -l53 -or -including -diet -l60 -altogether -a -hundred -dollars -a -year -one -can -understand -why -the -recruiter -is -fond -of -the -business -the -recruit -costs -him -a -few -cheap -presents -given -to -the -recruit's -relatives -not -himself -and -the -recruit -is -worth -l20 -to -the -recruiter -when -delivered -in -queensland -all -this -is -clear -enough -but -the -thing -that -is -not -clear -is -what -there -is -about -it -all -to -persuade -the -recruit -he -is -young -and -brisk -life -at -home -in -his -beautiful -island -is -one -lazy -long -holiday -to -him -or -if -he -wants -to -work -he -can -turn -out -a -couple -of -bags -of -copra -per -week -and -sell -it -for -four -or -five -shillings -a -bag -in -queensland -he -must -get -up -at -dawn -and -work -from -eight -to -twelve -hours -a -day -in -the -canefields -in -a -much -hotter -climate -than -he -is -used -to -and -get -less -than -four -shillings -a -week -for -it -i -cannot -understand -his -willingness -to -go -to -queensland -it -is -a -deep -puzzle -to -me -here -is -the -explanation -from -the -planter's -point -of -view -at -least -i -gather -from -the -missionary's -pamphlet -that -it -is -the -planter's -when -he -comes -from -his -home -he -is -a -savage -pure -and -simple -he -feels -no -shame -at -his -nakedness -and -want -of -adornment -when -he -returns -home -he -does -so -well -dressed -sporting -a -waterbury -watch -collars -cuffs -boots -and -jewelry -he -takes -with -him -one -or -more -boxes -[ -box -is -english -for -trunk -] -well -filled -with -clothing -a -musical -instrument -or -two -and -perfumery -and -other -articles -of -luxury -he -has -learned -to -appreciate -for -just -one -moment -we -have -a -seeming -flash -of -comprehension -of -the -kanaka's -reason -for -exiling -himself -he -goes -away -to -acquire -civilization -yes -he -was -naked -and -not -ashamed -now -he -is -clothed -and -knows -how -to -be -ashamed -he -was -unenlightened -now -he -has -a -waterbury -watch -he -was -unrefined -now -he -has -jewelry -and -something -to -make -him -smell -good -he -was -a -nobody -a -provincial -now -he -has -been -to -far -countries -and -can -show -off -it -all -looks -plausible -for -a -moment -then -the -missionary -takes -hold -of -this -explanation -and -pulls -it -to -pieces -and -dances -on -it -and -damages -it -beyond -recognition -admitting -that -the -foregoing -description -is -the -average -one -the -average -sequel -is -this -the -cuffs -and -collars -if -used -at -all -are -carried -off -by -youngsters -who -fasten -them -round -the -leg -just -below -the -knee -as -ornaments -the -waterbury -broken -and -dirty -finds -its -way -to -the -trader -who -gives -a -trifle -for -it -or -the -inside -is -taken -out -the -wheels -strung -on -a -thread -and -hung -round -the -neck -knives -axes -calico -and -handkerchiefs -are -divided -among -friends -and -there -is -hardly -one -of -these -apiece -the -boxes -the -keys -often -lost -on -the -road -home -can -be -bought -for -2s -6d -they -are -to -be -seen -rotting -outside -in -almost -any -shore -village -on -tanna -i -speak -of -what -i -have -seen -a -returned -kanaka -has -been -furiously -angry -with -me -because -i -would -not -buy -his -trousers -which -he -declared -were -just -my -fit -he -sold -them -afterwards -to -one -of -my -aniwan -teachers -for -9d -worth -of -tobacco -a -pair -of -trousers -that -probably -cost -him -8s -or -10s -in -queensland -a -coat -or -shirt -is -handy -for -cold -weather -the -white -handkerchiefs -the -'senet' -perfumery -the -umbrella -and -perhaps -the -hat -are -kept -the -boots -have -to -take -their -chance -if -they -do -not -happen -to -fit -the -copra -trader -'senet' -on -the -hair -streaks -of -paint -on -the -face -a -dirty -white -handkerchief -round -the -neck -strips -of -turtle -shell -in -the -ears -a -belt -a -sheath -and -knife -and -an -umbrella -constitute -the -rig -of -returned -kanaka -at -home -the -day -after -landing -a -hat -an -umbrella -a -belt -a -neckerchief -otherwise -stark -naked -all -in -a -day -the -hard -earned -civilization -has -melted -away -to -this -and -even -these -perishable -things -must -presently -go -indeed -there -is -but -a -single -detail -of -his -civilization -that -can -be -depended -on -to -stay -by -him -according -to -the -missionary -he -has -learned -to -swear -this -is -art -and -art -is -long -as -the -poet -says -in -all -countries -the -laws -throw -light -upon -the -past -the -queensland -law -for -the -regulation -of -the -labor -traffic -is -a -confession -it -is -a -confession -that -the -evils -charged -by -the -missionaries -upon -the -traffic -had -existed -in -the -past -and -that -they -still -existed -when -the -law -was -made -the -missionaries -make -a -further -charge -that -the -law -is -evaded -by -the -recruiters -and -that -the -government -agent -sometimes -helps -them -to -do -it -regulation -31 -reveals -two -things -that -sometimes -a -young -fool -of -a -recruit -gets -his -senses -back -after -being -persuaded -to -sign -away -his -liberty -for -three -years -and -dearly -wants -to -get -out -of -the -engagement -and -stay -at -home -with -his -own -people -and -that -threats -intimidation -and -force -are -used -to -keep -him -on -board -the -recruiting -ship -and -to -hold -him -to -his -contract -regulation -31 -forbids -these -coercions -the -law -requires -that -he -shall -be -allowed -to -go -free -and -another -clause -of -it -requires -the -recruiter -to -set -him -ashore -per -boat -because -of -the -prevalence -of -sharks -testimony -from -rev -mr -gray -there -are -'wrinkles' -for -taking -the -penitent -kanaka -my -first -experience -of -the -traffic -was -a -case -of -this -kind -in -1884 -a -vessel -anchored -just -out -of -sight -of -our -station -word -was -brought -to -me -that -some -boys -were -stolen -and -the -relatives -wished -me -to -go -and -get -them -back -the -facts -were -as -i -found -that -six -boys -had -recruited -had -rushed -into -the -boat -the -government -agent -informed -me -they -had -all -'signed' -and -said -the -government -agent -'on -board -they -shall -remain -' -i -was -assured -that -the -six -boys -were -of -age -and -willing -to -go -yet -on -getting -ready -to -leave -the -ship -i -found -four -of -the -lads -ready -to -come -ashore -in -the -boat! -this -i -forbade -one -of -them -jumped -into -the -water -and -persisted -in -coming -ashore -in -my -boat -when -appealed -to -the -government -agent -suggested -that -we -go -and -leave -him -to -be -picked -up -by -the -ship's -boat -a -quarter -mile -distant -at -the -time! -the -law -and -the -missionaries -feel -for -the -repentant -recruit -and -properly -one -may -be -permitted -to -think -for -he -is -only -a -youth -and -ignorant -and -persuadable -to -his -hurt -but -sympathy -for -him -is -not -kept -in -stock -by -the -recruiter -rev -mr -gray -says -a -captain -many -years -in -the -traffic -explained -to -me -how -a -penitent -could -betaken -'when -a -boy -jumps -overboard -we -just -take -a -boat -and -pull -ahead -of -him -then -lie -between -him -and -the -shore -if -he -has -not -tired -himself -swimming -and -passes -the -boat -keep -on -heading -him -in -this -way -the -dodge -rarely -fails -the -boy -generally -tires -of -swimming -gets -into -the -boat -of -his -own -accord -and -goes -quietly -on -board -yes -exhaustion -is -likely -to -make -a -boy -quiet -if -the -distressed -boy -had -been -the -speaker's -son -and -the -captors -savages -the -speaker -would -have -been -surprised -to -see -how -differently -the -thing -looked -from -the -new -point -of -view -however -it -is -not -our -custom -to -put -ourselves -in -the -other -person's -place -somehow -there -is -something -pathetic -about -that -disappointed -young -savage's -resignation -i -must -explain -here -that -in -the -traffic -dialect -boy -does -not -always -mean -boy -it -means -a -youth -above -sixteen -years -of -age -that -is -by -queensland -law -the -age -of -consent -though -it -is -held -that -recruiters -allow -themselves -some -latitude -in -guessing -at -ages -captain -wawn -of -the -free -spirit -chafes -under -the -annoyance -of -cast -iron -regulations -they -and -the -missionaries -have -poisoned -his -life -he -grieves -for -the -good -old -days -vanished -to -come -no -more -see -him -weep -hear -him -cuss -between -the -lines! -for -a -long -time -we -were -allowed -to -apprehend -and -detain -all -deserters -who -had -signed -the -agreement -on -board -ship -but -the -'cast -iron' -regulations -of -the -act -of -1884 -put -a -stop -to -that -allowing -the -kanaka -to -sign -the -agreement -for -three -years' -service -travel -about -in -the -ship -in -receipt -of -the -regular -rations -cadge -all -he -could -and -leave -when -he -thought -fit -so -long -as -he -did -not -extend -his -pleasure -trip -to -queensland -rev -mr -gray -calls -this -same -restrictive -cast -iron -law -a -farce -there -is -as -much -cruelty -and -injustice -done -to -natives -by -acts -that -are -legal -as -by -deeds -unlawful -the -regulations -that -exist -are -unjust -and -inadequate -unjust -and -inadequate -they -must -ever -be -he -furnishes -his -reasons -for -his -position -but -they -are -too -long -for -reproduction -here -however -if -the -most -a -kanaka -advantages -himself -by -a -three -years -course -in -civilization -in -queensland -is -a -necklace -and -an -umbrella -and -a -showy -imperfection -in -the -art -of -swearing -it -must -be -that -all -the -profit -of -the -traffic -goes -to -the -white -man -this -could -be -twisted -into -a -plausible -argument -that -the -traffic -ought -to -be -squarely -abolished -however -there -is -reason -for -hope -that -that -can -be -left -alone -to -achieve -itself -it -is -claimed -that -the -traffic -will -depopulate -its -sources -of -supply -within -the -next -twenty -or -thirty -years -queensland -is -a -very -healthy -place -for -white -people -death -rate -12 -in -1 -000 -of -the -population -but -the -kanaka -death -rate -is -away -above -that -the -vital -statistics -for -1893 -place -it -at -52 -for -1894 -mackay -district -68 -the -first -six -months -of -the -kanaka's -exile -are -peculiarly -perilous -for -him -because -of -the -rigors -of -the -new -climate -the -death -rate -among -the -new -men -has -reached -as -high -as -180 -in -the -1 -000 -in -the -kanaka's -native -home -his -death -rate -is -12 -in -time -of -peace -and -15 -in -time -of -war -thus -exile -to -queensland -with -the -opportunity -to -acquire -civilization -an -umbrella -and -a -pretty -poor -quality -of -profanity -is -twelve -times -as -deadly -for -him -as -war -common -christian -charity -common -humanity -does -seem -to -require -not -only -that -these -people -be -returned -to -their -homes -but -that -war -pestilence -and -famine -be -introduced -among -them -for -their -preservation -concerning -these -pacific -isles -and -their -peoples -an -eloquent -prophet -spoke -long -years -ago -five -and -fifty -years -ago -in -fact -he -spoke -a -little -too -early -prophecy -is -a -good -line -of -business -but -it -is -full -of -risks -this -prophet -was -the -right -rev -m -russell -ll -d -d -c -l -of -edinburgh -is -the -tide -of -civilization -to -roll -only -to -the -foot -of -the -rocky -mountains -and -is -the -sun -of -knowledge -to -set -at -last -in -the -waves -of -the -pacific -no -the -mighty -day -of -four -thousand -years -is -drawing -to -its -close -the -sun -of -humanity -has -performed -its -destined -course -but -long -ere -its -setting -rays -are -extinguished -in -the -west -its -ascending -beams -have -glittered -on -the -isles -of -the -eastern -seas -and -now -we -see -the -race -of -japhet -setting -forth -to -people -the -isles -and -the -seeds -of -another -europe -and -a -second -england -sown -in -the -regions -of -the -sun -but -mark -the -words -of -the -prophecy -'he -shall -dwell -in -the -tents -of -shem -and -canaan -shall -be -his -servant -' -it -is -not -said -canaan -shall -be -his -slave -to -the -anglo -saxon -race -is -given -the -scepter -of -the -globe -but -there -is -not -given -either -the -lash -of -the -slave -driver -or -the -rack -of -the -executioner -the -east -will -not -be -stained -with -the -same -atrocities -as -the -west -the -frightful -gangrene -of -an -enthralled -race -is -not -to -mar -the -destinies -of -the -family -of -japhet -in -the -oriental -world -humanizing -not -destroying -as -they -advance -uniting -with -not -enslaving -the -inhabitants -with -whom -they -dwell -the -british -race -may -etc -etc -and -he -closes -his -vision -with -an -invocation -from -thomson -come -bright -improvement! -on -the -car -of -time -and -rule -the -spacious -world -from -clime -to -clime -very -well -bright -improvement -has -arrived -you -see -with -her -civilization -and -her -waterbury -and -her -umbrella -and -her -third -quality -profanity -and -her -humanizing -not -destroying -machinery -and -her -hundred -and -eighty -death -rate -and -everything -is -going -along -just -as -handsome! -but -the -prophet -that -speaks -last -has -an -advantage -over -the -pioneer -in -the -business -rev -mr -gray -says -what -i -am -concerned -about -is -that -we -as -a -christian -nation -should -wipe -out -these -races -to -enrich -ourselves -and -he -closes -his -pamphlet -with -a -grim -indictment -which -is -as -eloquent -in -its -flowerless -straightforward -english -as -is -the -hand -painted -rhapsody -of -the -early -prophet -my -indictment -of -the -queensland -kanaka -labor -traffic -is -this -1 -it -generally -demoralizes -and -always -impoverishes -the -kanaka -deprives -him -of -his -citizenship -and -depopulates -the -islands -fitted -to -his -home -2 -it -is -felt -to -lower -the -dignity -of -the -white -agricultural -laborer -in -queensland -and -beyond -a -doubt -it -lowers -his -wages -there -3 -the -whole -system -is -fraught -with -danger -to -australia -and -the -islands -on -the -score -of -health -4 -on -social -and -political -grounds -the -continuance -of -the -queensland -kanaka -labor -traffic -must -be -a -barrier -to -the -true -federation -of -the -australian -colonies -5 -the -regulations -under -which -the -traffic -exists -in -queensland -are -inadequate -to -prevent -abuses -and -in -the -nature -of -things -they -must -remain -so -6 -the -whole -system -is -contrary -to -the -spirit -and -doctrine -of -the -gospel -of -jesus -christ -the -gospel -requires -us -to -help -the -weak -but -the -kanaka -is -fleeced -and -trodden -down -7 -the -bed -rock -of -this -traffic -is -that -the -life -and -liberty -of -a -black -man -are -of -less -value -than -those -of -a -white -man -and -a -traffic -that -has -grown -out -of -'slave -hunting' -will -certainly -remain -to -the -end -not -unlike -its -origin -chapter -vii -truth -is -the -most -valuable -thing -we -have -let -us -economize -it -pudd'nhead -wilson's -new -calendar -from -diary -for -a -day -or -two -we -have -been -plowing -among -an -invisible -vast -wilderness -of -islands -catching -now -and -then -a -shadowy -glimpse -of -a -member -of -it -there -does -seem -to -be -a -prodigious -lot -of -islands -this -year -the -map -of -this -region -is -freckled -and -fly -specked -all -over -with -them -their -number -would -seem -to -be -uncountable -we -are -moving -among -the -fijis -now -224 -islands -and -islets -in -the -group -in -front -of -us -to -the -west -the -wilderness -stretches -toward -australia -then -curves -upward -to -new -guinea -and -still -up -and -up -to -japan -behind -us -to -the -east -the -wilderness -stretches -sixty -degrees -across -the -wastes -of -the -pacific -south -of -us -is -new -zealand -somewhere -or -other -among -these -myriads -samoa -is -concealed -and -not -discoverable -on -the -map -still -if -you -wish -to -go -there -you -will -have -no -trouble -about -finding -it -if -you -follow -the -directions -given -by -robert -louis -stevenson -to -dr -conan -doyle -and -to -mr -j -m -barrie -you -go -to -america -cross -the -continent -to -san -francisco -and -then -it's -the -second -turning -to -the -left -to -get -the -full -flavor -of -the -joke -one -must -take -a -glance -at -the -map -wednesday -september -11 -yesterday -we -passed -close -to -an -island -or -so -and -recognized -the -published -fiji -characteristics -a -broad -belt -of -clean -white -coral -sand -around -the -island -back -of -it -a -graceful -fringe -of -leaning -palms -with -native -huts -nestling -cosily -among -the -shrubbery -at -their -bases -back -of -these -a -stretch -of -level -land -clothed -in -tropic -vegetation -back -of -that -rugged -and -picturesque -mountains -a -detail -of -the -immediate -foreground -a -mouldering -ship -perched -high -up -on -a -reef -bench -this -completes -the -composition -and -makes -the -picture -artistically -perfect -in -the -afternoon -we -sighted -suva -the -capital -of -the -group -and -threaded -our -way -into -the -secluded -little -harbor -a -placid -basin -of -brilliant -blue -and -green -water -tucked -snugly -in -among -the -sheltering -hills -a -few -ships -rode -at -anchor -in -it -one -of -them -a -sailing -vessel -flying -the -american -flag -and -they -said -she -came -from -duluth! -there's -a -journey! -duluth -is -several -thousand -miles -from -the -sea -and -yet -she -is -entitled -to -the -proud -name -of -mistress -of -the -commercial -marine -of -the -united -states -of -america -there -is -only -one -free -independent -unsubsidized -american -ship -sailing -the -foreign -seas -and -duluth -owns -it -all -by -itself -that -ship -is -the -american -fleet -all -by -itself -it -causes -the -american -name -and -power -to -be -respected -in -the -far -regions -of -the -globe -all -by -itself -it -certifies -to -the -world -that -the -most -populous -civilized -nation -in -the -earth -has -a -just -pride -in -her -stupendous -stretch -of -sea -front -and -is -determined -to -assert -and -maintain -her -rightful -place -as -one -of -the -great -maritime -powers -of -the -planet -all -by -itself -it -is -making -foreign -eyes -familiar -with -a -flag -which -they -have -not -seen -before -for -forty -years -outside -of -the -museum -for -what -duluth -has -done -in -building -equipping -and -maintaining -at -her -sole -expense -the -american -foreign -commercial -fleet -and -in -thus -rescuing -the -american -name -from -shame -and -lifting -it -high -for -the -homage -of -the -nations -we -owe -her -a -debt -of -gratitude -which -our -hearts -shall -confess -with -quickened -beats -whenever -her -name -is -named -henceforth -many -national -toasts -will -die -in -the -lapse -of -time -but -while -the -flag -flies -and -the -republic -survives -they -who -live -under -their -shelter -will -still -drink -this -one -standing -and -uncovered -health -and -prosperity -to -thee -o -duluth -american -queen -of -the -alien -seas! -row -boats -began -to -flock -from -the -shore -their -crews -were -the -first -natives -we -had -seen -these -men -carried -no -overplus -of -clothing -and -this -was -wise -for -the -weather -was -hot -handsome -great -dusky -men -they -were -muscular -clean -limbed -and -with -faces -full -of -character -and -intelligence -it -would -be -hard -to -find -their -superiors -anywhere -among -the -dark -races -i -should -think -everybody -went -ashore -to -look -around -and -spy -out -the -land -and -have -that -luxury -of -luxuries -to -sea -voyagers -a -land -dinner -and -there -we -saw -more -natives -wrinkled -old -women -with -their -flat -mammals -flung -over -their -shoulders -or -hanging -down -in -front -like -the -cold -weather -drip -from -the -molasses -faucet -plump -and -smily -young -girls -blithe -and -content -easy -and -graceful -a -pleasure -to -look -at -young -matrons -tall -straight -comely -nobly -built -sweeping -by -with -chin -up -and -a -gait -incomparable -for -unconscious -stateliness -and -dignity -majestic -young -men -athletes -for -build -and -muscle -clothed -in -a -loose -arrangement -of -dazzling -white -with -bronze -breast -and -bronze -legs -naked -and -the -head -a -cannon -swab -of -solid -hair -combed -straight -out -from -the -skull -and -dyed -a -rich -brick -red -only -sixty -years -ago -they -were -sunk -in -darkness -now -they -have -the -bicycle -we -strolled -about -the -streets -of -the -white -folks' -little -town -and -around -over -the -hills -by -paths -and -roads -among -european -dwellings -and -gardens -and -plantations -and -past -clumps -of -hibiscus -that -made -a -body -blink -the -great -blossoms -were -so -intensely -red -and -by -and -by -we -stopped -to -ask -an -elderly -english -colonist -a -question -or -two -and -to -sympathize -with -him -concerning -the -torrid -weather -but -he -was -surprised -and -said -this -this -is -not -hot -you -ought -to -be -here -in -the -summer -time -once -we -supposed -that -this -was -summer -it -has -the -ear -marks -of -it -you -could -take -it -to -almost -any -country -and -deceive -people -with -it -but -if -it -isn't -summer -what -does -it -lack -it -lacks -half -a -year -this -is -mid -winter -i -had -been -suffering -from -colds -for -several -months -and -a -sudden -change -of -season -like -this -could -hardly -fail -to -do -me -hurt -it -brought -on -another -cold -it -is -odd -these -sudden -jumps -from -season -to -season -a -fortnight -ago -we -left -america -in -mid -summer -now -it -is -midwinter -about -a -week -hence -we -shall -arrive -in -australia -in -the -spring -after -dinner -i -found -in -the -billiard -room -a -resident -whom -i -had -known -somewhere -else -in -the -world -and -presently -made -some -new -friends -and -drove -with -them -out -into -the -country -to -visit -his -excellency -the -head -of -the -state -who -was -occupying -his -country -residence -to -escape -the -rigors -of -the -winter -weather -i -suppose -for -it -was -on -breezy -high -ground -and -much -more -comfortable -than -the -lower -regions -where -the -town -is -and -where -the -winter -has -full -swing -and -often -sets -a -person's -hair -afire -when -he -takes -off -his -hat -to -bow -there -is -a -noble -and -beautiful -view -of -ocean -and -islands -and -castellated -peaks -from -the -governor's -high -placed -house -and -its -immediate -surroundings -lie -drowsing -in -that -dreamy -repose -and -serenity -which -are -the -charm -of -life -in -the -pacific -islands -one -of -the -new -friends -who -went -out -there -with -me -was -a -large -man -and -i -had -been -admiring -his -size -all -the -way -i -was -still -admiring -it -as -he -stood -by -the -governor -on -the -veranda -talking -then -the -fijian -butler -stepped -out -there -to -announce -tea -and -dwarfed -him -maybe -he -did -not -quite -dwarf -him -but -at -any -rate -the -contrast -was -quite -striking -perhaps -that -dark -giant -was -a -king -in -a -condition -of -political -suspension -i -think -that -in -the -talk -there -on -the -veranda -it -was -said -that -in -fiji -as -in -the -sandwich -islands -native -kings -and -chiefs -are -of -much -grander -size -and -build -than -the -commoners -this -man -was -clothed -in -flowing -white -vestments -and -they -were -just -the -thing -for -him -they -comported -well -with -his -great -stature -and -his -kingly -port -and -dignity -european -clothes -would -have -degraded -him -and -made -him -commonplace -i -know -that -because -they -do -that -with -everybody -that -wears -them -it -was -said -that -the -old -time -devotion -to -chiefs -and -reverence -for -their -persons -still -survive -in -the -native -commoner -and -in -great -force -the -educated -young -gentleman -who -is -chief -of -the -tribe -that -live -in -the -region -about -the -capital -dresses -in -the -fashion -of -high -class -european -gentlemen -but -even -his -clothes -cannot -damn -him -in -the -reverence -of -his -people -their -pride -in -his -lofty -rank -and -ancient -lineage -lives -on -in -spite -of -his -lost -authority -and -the -evil -magic -of -his -tailor -he -has -no -need -to -defile -himself -with -work -or -trouble -his -heart -with -the -sordid -cares -of -life -the -tribe -will -see -to -it -that -he -shall -not -want -and -that -he -shall -hold -up -his -head -and -live -like -a -gentleman -i -had -a -glimpse -of -him -down -in -the -town -perhaps -he -is -a -descendant -of -the -last -king -the -king -with -the -difficult -name -whose -memory -is -preserved -by -a -notable -monument -of -cut -stone -which -one -sees -in -the -enclosure -in -the -middle -of -the -town -thakombau -i -remember -now -that -is -the -name -it -is -easier -to -preserve -it -on -a -granite -block -than -in -your -head -fiji -was -ceded -to -england -by -this -king -in -1858 -one -of -the -gentlemen -present -at -the -governor's -quoted -a -remark -made -by -the -king -at -the -time -of -the -session -a -neat -retort -and -with -a -touch -of -pathos -in -it -too -the -english -commissioner -had -offered -a -crumb -of -comfort -to -thakombau -by -saying -that -the -transfer -of -the -kingdom -to -great -britain -was -merely -a -sort -of -hermit -crab -formality -you -know -yes -said -poor -thakombau -but -with -this -difference -the -crab -moves -into -an -unoccupied -shell -but -mine -isn't -however -as -far -as -i -can -make -out -from -the -books -the -king -was -between -the -devil -and -the -deep -sea -at -the -time -and -hadn't -much -choice -he -owed -the -united -states -a -large -debt -a -debt -which -he -could -pay -if -allowed -time -but -time -was -denied -him -he -must -pay -up -right -away -or -the -warships -would -be -upon -him -to -protect -his -people -from -this -disaster -he -ceded -his -country -to -britain -with -a -clause -in -the -contract -providing -for -the -ultimate -payment -of -the -american -debt -in -old -times -the -fijians -were -fierce -fighters -they -were -very -religious -and -worshiped -idols -the -big -chiefs -were -proud -and -haughty -and -they -were -men -of -great -style -in -many -ways -all -chiefs -had -several -wives -the -biggest -chiefs -sometimes -had -as -many -as -fifty -when -a -chief -was -dead -and -ready -for -burial -four -or -five -of -his -wives -were -strangled -and -put -into -the -grave -with -him -in -1804 -twenty -seven -british -convicts -escaped -from -australia -to -fiji -and -brought -guns -and -ammunition -with -them -consider -what -a -power -they -were -armed -like -that -and -what -an -opportunity -they -had -if -they -had -been -energetic -men -and -sober -and -had -had -brains -and -known -how -to -use -them -they -could -have -achieved -the -sovereignty -of -the -archipelago -twenty -seven -kings -and -each -with -eight -or -nine -islands -under -his -scepter -but -nothing -came -of -this -chance -they -lived -worthless -lives -of -sin -and -luxury -and -died -without -honor -in -most -cases -by -violence -only -one -of -them -had -any -ambition -he -was -an -irishman -named -connor -he -tried -to -raise -a -family -of -fifty -children -and -scored -forty -eight -he -died -lamenting -his -failure -it -was -a -foolish -sort -of -avarice -many -a -father -would -have -been -rich -enough -with -forty -it -is -a -fine -race -the -fijians -with -brains -in -their -heads -and -an -inquiring -turn -of -mind -it -appears -that -their -savage -ancestors -had -a -doctrine -of -immortality -in -their -scheme -of -religion -with -limitations -that -is -to -say -their -dead -friend -would -go -to -a -happy -hereafter -if -he -could -be -accumulated -but -not -otherwise -they -drew -the -line -they -thought -that -the -missionary's -doctrine -was -too -sweeping -too -comprehensive -they -called -his -attention -to -certain -facts -for -instance -many -of -their -friends -had -been -devoured -by -sharks -the -sharks -in -their -turn -were -caught -and -eaten -by -other -men -later -these -men -were -captured -in -war -and -eaten -by -the -enemy -the -original -persons -had -entered -into -the -composition -of -the -sharks -next -they -and -the -sharks -had -become -part -of -the -flesh -and -blood -and -bone -of -the -cannibals -how -then -could -the -particles -of -the -original -men -be -searched -out -from -the -final -conglomerate -and -put -together -again -the -inquirers -were -full -of -doubts -and -considered -that -the -missionary -had -not -examined -the -matter -with -the -gravity -and -attention -which -so -serious -a -thing -deserved -the -missionary -taught -these -exacting -savages -many -valuable -things -and -got -from -them -one -a -very -dainty -and -poetical -idea -those -wild -and -ignorant -poor -children -of -nature -believed -that -the -flowers -after -they -perish -rise -on -the -winds -and -float -away -to -the -fair -fields -of -heaven -and -flourish -there -forever -in -immortal -beauty! -chapter -viii -it -could -probably -be -shown -by -facts -and -figures -that -there -is -no -distinctly -native -american -criminal -class -except -congress -pudd'nhead -wilson's -new -calendar -when -one -glances -at -the -map -the -members -of -the -stupendous -island -wilderness -of -the -pacific -seem -to -crowd -upon -each -other -but -no -there -is -no -crowding -even -in -the -center -of -a -group -and -between -groups -there -are -lonely -wide -deserts -of -sea -not -everything -is -known -about -the -islands -their -peoples -and -their -languages -a -startling -reminder -of -this -is -furnished -by -the -fact -that -in -fiji -twenty -years -ago -were -living -two -strange -and -solitary -beings -who -came -from -an -unknown -country -and -spoke -an -unknown -language -they -were -picked -up -by -a -passing -vessel -many -hundreds -of -miles -from -any -known -land -floating -in -the -same -tiny -canoe -in -which -they -had -been -blown -out -to -sea -when -found -they -were -but -skin -and -bone -no -one -could -understand -what -they -said -and -they -have -never -named -their -country -or -if -they -have -the -name -does -not -correspond -with -that -of -any -island -on -any -chart -they -are -now -fat -and -sleek -and -as -happy -as -the -day -is -long -in -the -ship's -log -there -is -an -entry -of -the -latitude -and -longitude -in -which -they -were -found -and -this -is -probably -all -the -clue -they -will -ever -have -to -their -lost -homes -[forbes's -two -years -in -fiji -] -what -a -strange -and -romantic -episode -it -is -and -how -one -is -tortured -with -curiosity -to -know -whence -those -mysterious -creatures -came -those -men -without -a -country -errant -waifs -who -cannot -name -their -lost -home -wandering -children -of -nowhere -indeed -the -island -wilderness -is -the -very -home -of -romance -and -dreams -and -mystery -the -loneliness -the -solemnity -the -beauty -and -the -deep -repose -of -this -wilderness -have -a -charm -which -is -all -their -own -for -the -bruised -spirit -of -men -who -have -fought -and -failed -in -the -struggle -for -life -in -the -great -world -and -for -men -who -have -been -hunted -out -of -the -great -world -for -crime -and -for -other -men -who -love -an -easy -and -indolent -existence -and -for -others -who -love -a -roving -free -life -and -stir -and -change -and -adventure -and -for -yet -others -who -love -an -easy -and -comfortable -career -of -trading -and -money -getting -mixed -with -plenty -of -loose -matrimony -by -purchase -divorce -without -trial -or -expense -and -limitless -spreeing -thrown -in -to -make -life -ideally -perfect -we -sailed -again -refreshed -the -most -cultivated -person -in -the -ship -was -a -young -english -man -whose -home -was -in -new -zealand -he -was -a -naturalist -his -learning -in -his -specialty -was -deep -and -thorough -his -interest -in -his -subject -amounted -to -a -passion -he -had -an -easy -gift -of -speech -and -so -when -he -talked -about -animals -it -was -a -pleasure -to -listen -to -him -and -profitable -too -though -he -was -sometimes -difficult -to -understand -because -now -and -then -he -used -scientific -technicalities -which -were -above -the -reach -of -some -of -us -they -were -pretty -sure -to -be -above -my -reach -but -as -he -was -quite -willing -to -explain -them -i -always -made -it -a -point -to -get -him -to -do -it -i -had -a -fair -knowledge -of -his -subject -layman's -knowledge -to -begin -with -but -it -was -his -teachings -which -crystalized -it -into -scientific -form -and -clarity -in -a -word -gave -it -value -his -special -interest -was -the -fauna -of -australasia -and -his -knowledge -of -the -matter -was -as -exhaustive -as -it -was -accurate -i -already -knew -a -good -deal -about -the -rabbits -in -australasia -and -their -marvelous -fecundity -but -in -my -talks -with -him -i -found -that -my -estimate -of -the -great -hindrance -and -obstruction -inflicted -by -the -rabbit -pest -upon -traffic -and -travel -was -far -short -of -the -facts -he -told -me -that -the -first -pair -of -rabbits -imported -into -australasia -bred -so -wonderfully -that -within -six -months -rabbits -were -so -thick -in -the -land -that -people -had -to -dig -trenches -through -them -to -get -from -town -to -town -he -told -me -a -great -deal -about -worms -and -the -kangaroo -and -other -coleoptera -and -said -he -knew -the -history -and -ways -of -all -such -pachydermata -he -said -the -kangaroo -had -pockets -and -carried -its -young -in -them -when -it -couldn't -get -apples -and -he -said -that -the -emu -was -as -big -as -an -ostrich -and -looked -like -one -and -had -an -amorphous -appetite -and -would -eat -bricks -also -that -the -dingo -was -not -a -dingo -at -all -but -just -a -wild -dog -and -that -the -only -difference -between -a -dingo -and -a -dodo -was -that -neither -of -them -barked -otherwise -they -were -just -the -same -he -said -that -the -only -game -bird -in -australia -was -the -wombat -and -the -only -song -bird -the -larrikin -and -that -both -were -protected -by -government -the -most -beautiful -of -the -native -birds -was -the -bird -of -paradise -next -came -the -two -kinds -of -lyres -not -spelt -the -same -he -said -the -one -kind -was -dying -out -the -other -thickening -up -he -explained -that -the -sundowner -was -not -a -bird -it -was -a -man -sundowner -was -merely -the -australian -equivalent -of -our -word -tramp -he -is -a -loafer -a -hard -drinker -and -a -sponge -he -tramps -across -the -country -in -the -sheep -shearing -season -pretending -to -look -for -work -but -he -always -times -himself -to -arrive -at -a -sheep -run -just -at -sundown -when -the -day's -labor -ends -all -he -wants -is -whisky -and -supper -and -bed -and -breakfast -he -gets -them -and -then -disappears -the -naturalist -spoke -of -the -bell -bird -the -creature -that -at -short -intervals -all -day -rings -out -its -mellow -and -exquisite -peal -from -the -deeps -of -the -forest -it -is -the -favorite -and -best -friend -of -the -weary -and -thirsty -sundowner -for -he -knows -that -wherever -the -bell -bird -is -there -is -water -and -he -goes -somewhere -else -the -naturalist -said -that -the -oddest -bird -in -australasia -was -the -laughing -jackass -and -the -biggest -the -now -extinct -great -moa -the -moa -stood -thirteen -feet -high -and -could -step -over -an -ordinary -man's -head -or -kick -his -hat -off -and -his -head -too -for -that -matter -he -said -it -was -wingless -but -a -swift -runner -the -natives -used -to -ride -it -it -could -make -forty -miles -an -hour -and -keep -it -up -for -four -hundred -miles -and -come -out -reasonably -fresh -it -was -still -in -existence -when -the -railway -was -introduced -into -new -zealand -still -in -existence -and -carrying -the -mails -the -railroad -began -with -the -same -schedule -it -has -now -two -expresses -a -week -time -twenty -miles -an -hour -the -company -exterminated -the -moa -to -get -the -mails -speaking -of -the -indigenous -coneys -and -bactrian -camels -the -naturalist -said -that -the -coniferous -and -bacteriological -output -of -australasia -was -remarkable -for -its -many -and -curious -departures -from -the -accepted -laws -governing -these -species -of -tubercles -but -that -in -his -opinion -nature's -fondness -for -dabbling -in -the -erratic -was -most -notably -exhibited -in -that -curious -combination -of -bird -fish -amphibian -burrower -crawler -quadruped -and -christian -called -the -ornithorhynchus -grotesquest -of -animals -king -of -the -animalculae -of -the -world -for -versatility -of -character -and -make -up -said -he -you -can -call -it -anything -you -want -to -and -be -right -it -is -a -fish -for -it -lives -in -the -river -half -the -time -it -is -a -land -animal -for -it -resides -on -the -land -half -the -time -it -is -an -amphibian -since -it -likes -both -and -does -not -know -which -it -prefers -it -is -a -hybernian -for -when -times -are -dull -and -nothing -much -going -on -it -buries -itself -under -the -mud -at -the -bottom -of -a -puddle -and -hybernates -there -a -couple -of -weeks -at -a -time -it -is -a -kind -of -duck -for -it -has -a -duck -bill -and -four -webbed -paddles -it -is -a -fish -and -quadruped -together -for -in -the -water -it -swims -with -the -paddles -and -on -shore -it -paws -itself -across -country -with -them -it -is -a -kind -of -seal -for -it -has -a -seal's -fur -it -is -carnivorous -herbivorous -insectivorous -and -vermifuginous -for -it -eats -fish -and -grass -and -butterflies -and -in -the -season -digs -worms -out -of -the -mud -and -devours -them -it -is -clearly -a -bird -for -it -lays -eggs -and -hatches -them -it -is -clearly -a -mammal -for -it -nurses -its -young -and -it -is -manifestly -a -kind -of -christian -for -it -keeps -the -sabbath -when -there -is -anybody -around -and -when -there -isn't -doesn't -it -has -all -the -tastes -there -are -except -refined -ones -it -has -all -the -habits -there -are -except -good -ones -it -is -a -survival -a -survival -of -the -fittest -mr -darwin -invented -the -theory -that -goes -by -that -name -but -the -ornithorhynchus -was -the -first -to -put -it -to -actual -experiment -and -prove -that -it -could -be -done -hence -it -should -have -as -much -of -the -credit -as -mr -darwin -it -was -never -in -the -ark -you -will -find -no -mention -of -it -there -it -nobly -stayed -out -and -worked -the -theory -of -all -creatures -in -the -world -it -was -the -only -one -properly -equipped -for -the -test -the -ark -was -thirteen -months -afloat -and -all -the -globe -submerged -no -land -visible -above -the -flood -no -vegetation -no -food -for -a -mammal -to -eat -nor -water -for -a -mammal -to -drink -for -all -mammal -food -was -destroyed -and -when -the -pure -floods -from -heaven -and -the -salt -oceans -of -the -earth -mingled -their -waters -and -rose -above -the -mountain -tops -the -result -was -a -drink -which -no -bird -or -beast -of -ordinary -construction -could -use -and -live -but -this -combination -was -nuts -for -the -ornithorhynchus -if -i -may -use -a -term -like -that -without -offense -its -river -home -had -always -been -salted -by -the -flood -tides -of -the -sea -on -the -face -of -the -noachian -deluge -innumerable -forest -trees -were -floating -upon -these -the -ornithorhynchus -voyaged -in -peace -voyaged -from -clime -to -clime -from -hemisphere -to -hemisphere -in -contentment -and -comfort -in -virile -interest -in -the -constant -change -of -scene -in -humble -thankfulness -for -its -privileges -in -ever -increasing -enthusiasm -in -the -development -of -the -great -theory -upon -whose -validity -it -had -staked -its -life -its -fortunes -and -its -sacred -honor -if -i -may -use -such -expressions -without -impropriety -in -connection -with -an -episode -of -this -nature -it -lived -the -tranquil -and -luxurious -life -of -a -creature -of -independent -means -of -things -actually -necessary -to -its -existence -and -its -happiness -not -a -detail -was -wanting -when -it -wished -to -walk -it -scrambled -along -the -tree -trunk -it -mused -in -the -shade -of -the -leaves -by -day -it -slept -in -their -shelter -by -night -when -it -wanted -the -refreshment -of -a -swim -it -had -it -it -ate -leaves -when -it -wanted -a -vegetable -diet -it -dug -under -the -bark -for -worms -and -grubs -when -it -wanted -fish -it -caught -them -when -it -wanted -eggs -it -laid -them -if -the -grubs -gave -out -in -one -tree -it -swam -to -another -and -as -for -fish -the -very -opulence -of -the -supply -was -an -embarrassment -and -finally -when -it -was -thirsty -it -smacked -its -chops -in -gratitude -over -a -blend -that -would -have -slain -a -crocodile -when -at -last -after -thirteen -months -of -travel -and -research -in -all -the -zones -it -went -aground -on -a -mountain -summit -it -strode -ashore -saying -in -its -heart -'let -them -that -come -after -me -invent -theories -and -dream -dreams -about -the -survival -of -the -fittest -if -they -like -but -i -am -the -first -that -has -done -it! -this -wonderful -creature -dates -back -like -the -kangaroo -and -many -other -australian -hydrocephalous -invertebrates -to -an -age -long -anterior -to -the -advent -of -man -upon -the -earth -they -date -back -indeed -to -a -time -when -a -causeway -hundreds -of -miles -wide -and -thousands -of -miles -long -joined -australia -to -africa -and -the -animals -of -the -two -countries -were -alike -and -all -belonged -to -that -remote -geological -epoch -known -to -science -as -the -old -red -grindstone -post -pleosaurian -later -the -causeway -sank -under -the -sea -subterranean -convulsions -lifted -the -african -continent -a -thousand -feet -higher -than -it -was -before -but -australia -kept -her -old -level -in -africa's -new -climate -the -animals -necessarily -began -to -develop -and -shade -off -into -new -forms -and -families -and -species -but -the -animals -of -australia -as -necessarily -remained -stationary -and -have -so -remained -until -this -day -in -the -course -of -some -millions -of -years -the -african -ornithorhynchus -developed -and -developed -and -developed -and -sluffed -off -detail -after -detail -of -its -make -up -until -at -last -the -creature -became -wholly -disintegrated -and -scattered -whenever -you -see -a -bird -or -a -beast -or -a -seal -or -an -otter -in -africa -you -know -that -he -is -merely -a -sorry -surviving -fragment -of -that -sublime -original -of -whom -i -have -been -speaking -that -creature -which -was -everything -in -general -and -nothing -in -particular -the -opulently -endowed -'e -pluribus -unum' -of -the -animal -world -such -is -the -history -of -the -most -hoary -the -most -ancient -the -most -venerable -creature -that -exists -in -the -earth -today -ornithorhynchus -platypus -extraordinariensis -whom -god -preserve! -when -he -was -strongly -moved -he -could -rise -and -soar -like -that -with -ease -and -not -only -in -the -prose -form -but -in -the -poetical -as -well -he -had -written -many -pieces -of -poetry -in -his -time -and -these -manuscripts -he -lent -around -among -the -passengers -and -was -willing -to -let -them -be -copied -it -seemed -to -me -that -the -least -technical -one -in -the -series -and -the -one -which -reached -the -loftiest -note -perhaps -was -his -invocation -come -forth -from -thy -oozy -couch -o -ornithorhynchus -dear! -and -greet -with -a -cordial -claw -the -stranger -that -longs -to -hear -from -thy -own -own -lips -the -tale -of -thy -origin -all -unknown -thy -misplaced -bone -where -flesh -should -be -and -flesh -where -should -be -bone -and -fishy -fin -where -should -be -paw -and -beaver -trowel -tail -and -snout -of -beast -equip'd -with -teeth -where -gills -ought -to -prevail -come -kangaroo -the -good -and -true -foreshortened -as -to -legs -and -body -tapered -like -a -churn -and -sack -marsupial -i' -fegs -and -tells -us -why -you -linger -here -thou -relic -of -a -vanished -time -when -all -your -friends -as -fossils -sleep -immortalized -in -lime! -perhaps -no -poet -is -a -conscious -plagiarist -but -there -seems -to -be -warrant -for -suspecting -that -there -is -no -poet -who -is -not -at -one -time -or -another -an -unconscious -one -the -above -verses -are -indeed -beautiful -and -in -a -way -touching -but -there -is -a -haunting -something -about -them -which -unavoidably -suggests -the -sweet -singer -of -michigan -it -can -hardly -be -doubted -that -the -author -had -read -the -works -of -that -poet -and -been -impressed -by -them -it -is -not -apparent -that -he -has -borrowed -from -them -any -word -or -yet -any -phrase -but -the -style -and -swing -and -mastery -and -melody -of -the -sweet -singer -all -are -there -compare -this -invocation -with -frank -dutton -particularly -stanzas -first -and -seventeenth -and -i -think -the -reader -will -feel -convinced -that -he -who -wrote -the -one -had -read -the -other -i -frank -dutton -was -as -fine -a -lad -as -ever -you -wish -to -see -and -he -was -drowned -in -pine -island -lake -on -earth -no -more -will -he -be -his -age -was -near -fifteen -years -and -he -was -a -motherless -boy -he -was -living -with -his -grandmother -when -he -was -drowned -poor -boy -xvii -he -was -drowned -on -tuesday -afternoon -on -sunday -he -was -found -and -the -tidings -of -that -drowned -boy -was -heard -for -miles -around -his -form -was -laid -by -his -mother's -side -beneath -the -cold -cold -ground -his -friends -for -him -will -drop -a -tear -when -they -view -his -little -mound -the -sentimental -song -book -by -mrs -julia -moore -p -36 -chapter -ix -it -is -your -human -environment -that -makes -climate -pudd'nhead -wilson's -new -calendar -sept -15 -night -close -to -australia -now -sydney -50 -miles -distant -that -note -recalls -an -experience -the -passengers -were -sent -for -to -come -up -in -the -bow -and -see -a -fine -sight -it -was -very -dark -one -could -not -follow -with -the -eye -the -surface -of -the -sea -more -than -fifty -yards -in -any -direction -it -dimmed -away -and -became -lost -to -sight -at -about -that -distance -from -us -but -if -you -patiently -gazed -into -the -darkness -a -little -while -there -was -a -sure -reward -for -you -presently -a -quarter -of -a -mile -away -you -would -see -a -blinding -splash -or -explosion -of -light -on -the -water -a -flash -so -sudden -and -so -astonishingly -brilliant -that -it -would -make -you -catch -your -breath -then -that -blotch -of -light -would -instantly -extend -itself -and -take -the -corkscrew -shape -and -imposing -length -of -the -fabled -sea -serpent -with -every -curve -of -its -body -and -the -break -spreading -away -from -its -head -and -the -wake -following -behind -its -tail -clothed -in -a -fierce -splendor -of -living -fire -and -my -but -it -was -coming -at -a -lightning -gait! -almost -before -you -could -think -this -monster -of -light -fifty -feet -long -would -go -flaming -and -storming -by -and -suddenly -disappear -and -out -in -the -distance -whence -he -came -you -would -see -another -flash -and -another -and -another -and -another -and -see -them -turn -into -sea -serpents -on -the -instant -and -once -sixteen -flashed -up -at -the -same -time -and -came -tearing -towards -us -a -swarm -of -wiggling -curves -a -moving -conflagration -a -vision -of -bewildering -beauty -a -spectacle -of -fire -and -energy -whose -equal -the -most -of -those -people -will -not -see -again -until -after -they -are -dead -it -was -porpoises -porpoises -aglow -with -phosphorescent -light -they -presently -collected -in -a -wild -and -magnificent -jumble -under -the -bows -and -there -they -played -for -an -hour -leaping -and -frollicking -and -carrying -on -turning -summersaults -in -front -of -the -stem -or -across -it -and -never -getting -hit -never -making -a -miscalculation -though -the -stem -missed -them -only -about -an -inch -as -a -rule -they -were -porpoises -of -the -ordinary -length -eight -or -ten -feet -but -every -twist -of -their -bodies -sent -a -long -procession -of -united -and -glowing -curves -astern -that -fiery -jumble -was -an -enchanting -thing -to -look -at -and -we -stayed -out -the -performance -one -cannot -have -such -a -show -as -that -twice -in -a -lifetime -the -porpoise -is -the -kitten -of -the -sea -he -never -has -a -serious -thought -he -cares -for -nothing -but -fun -and -play -but -i -think -i -never -saw -him -at -his -winsomest -until -that -night -it -was -near -a -center -of -civilization -and -he -could -have -been -drinking -by -and -by -when -we -had -approached -to -somewhere -within -thirty -miles -of -sydney -heads -the -great -electric -light -that -is -posted -on -one -of -those -lofty -ramparts -began -to -show -and -in -time -the -little -spark -grew -to -a -great -sun -and -pierced -the -firmament -of -darkness -with -a -far -reaching -sword -of -light -sydney -harbor -is -shut -in -behind -a -precipice -that -extends -some -miles -like -a -wall -and -exhibits -no -break -to -the -ignorant -stranger -it -has -a -break -in -the -middle -but -it -makes -so -little -show -that -even -captain -cook -sailed -by -it -without -seeing -it -near -by -that -break -is -a -false -break -which -resembles -it -and -which -used -to -make -trouble -for -the -mariner -at -night -in -the -early -days -before -the -place -was -lighted -it -caused -the -memorable -disaster -to -the -duncan -dunbar -one -of -the -most -pathetic -tragedies -in -the -history -of -that -pitiless -ruffian -the -sea -the -ship -was -a -sailing -vessel -a -fine -and -favorite -passenger -packet -commanded -by -a -popular -captain -of -high -reputation -she -was -due -from -england -and -sydney -was -waiting -and -counting -the -hours -counting -the -hours -and -making -ready -to -give -her -a -heart -stirring -welcome -for -she -was -bringing -back -a -great -company -of -mothers -and -daughters -the -long -missed -light -and -bloom -of -life -of -sydney -homes -daughters -that -had -been -years -absent -at -school -and -mothers -that -had -been -with -them -all -that -time -watching -over -them -of -all -the -world -only -india -and -australasia -have -by -custom -freighted -ships -and -fleets -with -their -hearts -and -know -the -tremendous -meaning -of -that -phrase -only -they -know -what -the -waiting -is -like -when -this -freightage -is -entrusted -to -the -fickle -winds -not -steam -and -what -the -joy -is -like -when -the -ship -that -is -returning -this -treasure -comes -safe -to -port -and -the -long -dread -is -over -on -board -the -duncan -dunbar -flying -toward -sydney -heads -in -the -waning -afternoon -the -happy -home -comers -made -busy -preparation -for -it -was -not -doubted -that -they -would -be -in -the -arms -of -their -friends -before -the -day -was -done -they -put -away -their -sea -going -clothes -and -put -on -clothes -meeter -for -the -meeting -their -richest -and -their -loveliest -these -poor -brides -of -the -grave -but -the -wind -lost -force -or -there -was -a -miscalculation -and -before -the -heads -were -sighted -the -darkness -came -on -it -was -said -that -ordinarily -the -captain -would -have -made -a -safe -offing -and -waited -for -the -morning -but -this -was -no -ordinary -occasion -all -about -him -were -appealing -faces -faces -pathetic -with -disappointment -so -his -sympathy -moved -him -to -try -the -dangerous -passage -in -the -dark -he -had -entered -the -heads -seventeen -times -and -believed -he -knew -the -ground -so -he -steered -straight -for -the -false -opening -mistaking -it -for -the -true -one -he -did -not -find -out -that -he -was -wrong -until -it -was -too -late -there -was -no -saving -the -ship -the -great -seas -swept -her -in -and -crushed -her -to -splinters -and -rubbish -upon -the -rock -tushes -at -the -base -of -the -precipice -not -one -of -all -that -fair -and -gracious -company -was -ever -seen -again -alive -the -tale -is -told -to -every -stranger -that -passes -the -spot -and -it -will -continue -to -be -told -to -all -that -come -for -generations -but -it -will -never -grow -old -custom -cannot -stale -it -the -heart -break -that -is -in -it -can -never -perish -out -of -it -there -were -two -hundred -persons -in -the -ship -and -but -one -survived -the -disaster -he -was -a -sailor -a -huge -sea -flung -him -up -the -face -of -the -precipice -and -stretched -him -on -a -narrow -shelf -of -rock -midway -between -the -top -and -the -bottom -and -there -he -lay -all -night -at -any -other -time -he -would -have -lain -there -for -the -rest -of -his -life -without -chance -of -discovery -but -the -next -morning -the -ghastly -news -swept -through -sydney -that -the -duncan -dunbar -had -gone -down -in -sight -of -home -and -straightway -the -walls -of -the -heads -were -black -with -mourners -and -one -of -these -stretching -himself -out -over -the -precipice -to -spy -out -what -might -be -seen -below -discovered -this -miraculously -preserved -relic -of -the -wreck -ropes -were -brought -and -the -nearly -impossible -feat -of -rescuing -the -man -was -accomplished -he -was -a -person -with -a -practical -turn -of -mind -and -he -hired -a -hall -in -sydney -and -exhibited -himself -at -sixpence -a -head -till -he -exhausted -the -output -of -the -gold -fields -for -that -year -we -entered -and -cast -anchor -and -in -the -morning -went -oh -ing -and -ah -ing -in -admiration -up -through -the -crooks -and -turns -of -the -spacious -and -beautiful -harbor -a -harbor -which -is -the -darling -of -sydney -and -the -wonder -of -the -world -it -is -not -surprising -that -the -people -are -proud -of -it -nor -that -they -put -their -enthusiasm -into -eloquent -words -a -returning -citizen -asked -me -what -i -thought -of -it -and -i -testified -with -a -cordiality -which -i -judged -would -be -up -to -the -market -rate -i -said -it -was -beautiful -superbly -beautiful -then -by -a -natural -impulse -i -gave -god -the -praise -the -citizen -did -not -seem -altogether -satisfied -he -said -it -is -beautiful -of -course -it's -beautiful -the -harbor -but -that -isn't -all -of -it -it's -only -half -of -it -sydney's -the -other -half -and -it -takes -both -of -them -together -to -ring -the -supremacy -bell -god -made -the -harbor -and -that's -all -right -but -satan -made -sydney -of -course -i -made -an -apology -and -asked -him -to -convey -it -to -his -friend -he -was -right -about -sydney -being -half -of -it -it -would -be -beautiful -without -sydney -but -not -above -half -as -beautiful -as -it -is -now -with -sydney -added -it -is -shaped -somewhat -like -an -oak -leaf -a -roomy -sheet -of -lovely -blue -water -with -narrow -off -shoots -of -water -running -up -into -the -country -on -both -sides -between -long -fingers -of -land -high -wooden -ridges -with -sides -sloped -like -graves -handsome -villas -are -perched -here -and -there -on -these -ridges -snuggling -amongst -the -foliage -and -one -catches -alluring -glimpses -of -them -as -the -ship -swims -by -toward -the -city -the -city -clothes -a -cluster -of -hills -and -a -ruffle -of -neighboring -ridges -with -its -undulating -masses -of -masonry -and -out -of -these -masses -spring -towers -and -spires -and -other -architectural -dignities -and -grandeurs -that -break -the -flowing -lines -and -give -picturesqueness -to -the -general -effect -the -narrow -inlets -which -i -have -mentioned -go -wandering -out -into -the -land -everywhere -and -hiding -themselves -in -it -and -pleasure -launches -are -always -exploring -them -with -picnic -parties -on -board -it -is -said -by -trustworthy -people -that -if -you -explore -them -all -you -will -find -that -you -have -covered -700 -miles -of -water -passage -but -there -are -liars -everywhere -this -year -and -they -will -double -that -when -their -works -are -in -good -going -order -october -was -close -at -hand -spring -was -come -it -was -really -spring -everybody -said -so -but -you -could -have -sold -it -for -summer -in -canada -and -nobody -would -have -suspected -it -was -the -very -weather -that -makes -our -home -summers -the -perfection -of -climatic -luxury -i -mean -when -you -are -out -in -the -wood -or -by -the -sea -but -these -people -said -it -was -cool -now -a -person -ought -to -see -sydney -in -the -summer -time -if -he -wanted -to -know -what -warm -weather -is -and -he -ought -to -go -north -ten -or -fifteen -hundred -miles -if -he -wanted -to -know -what -hot -weather -is -they -said -that -away -up -there -toward -the -equator -the -hens -laid -fried -eggs -sydney -is -the -place -to -go -to -get -information -about -other -people's -climates -it -seems -to -me -that -the -occupation -of -unbiased -traveler -seeking -information -is -the -pleasantest -and -most -irresponsible -trade -there -is -the -traveler -can -always -find -out -anything -he -wants -to -merely -by -asking -he -can -get -at -all -the -facts -and -more -everybody -helps -him -nobody -hinders -him -anybody -who -has -an -old -fact -in -stock -that -is -no -longer -negotiable -in -the -domestic -market -will -let -him -have -it -at -his -own -price -an -accumulation -of -such -goods -is -easily -and -quickly -made -they -cost -almost -nothing -and -they -bring -par -in -the -foreign -market -travelers -who -come -to -america -always -freight -up -with -the -same -old -nursery -tales -that -their -predecessors -selected -and -they -carry -them -back -and -always -work -them -off -without -any -trouble -in -the -home -market -if -the -climates -of -the -world -were -determined -by -parallels -of -latitude -then -we -could -know -a -place's -climate -by -its -position -on -the -map -and -so -we -should -know -that -the -climate -of -sydney -was -the -counterpart -of -the -climate -of -columbia -s -c -and -of -little -rock -arkansas -since -sydney -is -about -the -same -distance -south -of -the -equator -that -those -other -towns -are -north -of -it -thirty -four -degrees -but -no -climate -disregards -the -parallels -of -latitude -in -arkansas -they -have -a -winter -in -sydney -they -have -the -name -of -it -but -not -the -thing -itself -i -have -seen -the -ice -in -the -mississippi -floating -past -the -mouth -of -the -arkansas -river -and -at -memphis -but -a -little -way -above -the -mississippi -has -been -frozen -over -from -bank -to -bank -but -they -have -never -had -a -cold -spell -in -sydney -which -brought -the -mercury -down -to -freezing -point -once -in -a -mid -winter -day -there -in -the -month -of -july -the -mercury -went -down -to -36 -deg -and -that -remains -the -memorable -cold -day -in -the -history -of -the -town -no -doubt -little -rock -has -seen -it -below -zero -once -in -sydney -in -mid -summer -about -new -year's -day -the -mercury -went -up -to -106 -deg -in -the -shade -and -that -is -sydney's -memorable -hot -day -that -would -about -tally -with -little -rock's -hottest -day -also -i -imagine -my -sydney -figures -are -taken -from -a -government -report -and -are -trustworthy -in -the -matter -of -summer -weather -arkansas -has -no -advantage -over -sydney -perhaps -but -when -it -comes -to -winter -weather -that -is -another -affair -you -could -cut -up -an -arkansas -winter -into -a -hundred -sydney -winters -and -have -enough -left -for -arkansas -and -the -poor -the -whole -narrow -hilly -belt -of -the -pacific -side -of -new -south -wales -has -the -climate -of -its -capital -a -mean -winter -temperature -of -54 -deg -and -a -mean -summer -one -of -71 -deg -it -is -a -climate -which -cannot -be -improved -upon -for -healthfulness -but -the -experts -say -that -90 -deg -in -new -south -wales -is -harder -to -bear -than -112 -deg -in -the -neighboring -colony -of -victoria -because -the -atmosphere -of -the -former -is -humid -and -of -the -latter -dry -the -mean -temperature -of -the -southernmost -point -of -new -south -wales -is -the -same -as -that -of -nice -60 -deg -yet -nice -is -further -from -the -equator -by -460 -miles -than -is -the -former -but -nature -is -always -stingy -of -perfect -climates -stingier -in -the -case -of -australia -than -usual -apparently -this -vast -continent -has -a -really -good -climate -nowhere -but -around -the -edges -if -we -look -at -a -map -of -the -world -we -are -surprised -to -see -how -big -australia -is -it -is -about -two -thirds -as -large -as -the -united -states -was -before -we -added -alaska -but -where -as -one -finds -a -sufficiently -good -climate -and -fertile -land -almost -everywhere -in -the -united -states -it -seems -settled -that -inside -of -the -australian -border -belt -one -finds -many -deserts -and -in -spots -a -climate -which -nothing -can -stand -except -a -few -of -the -hardier -kinds -of -rocks -in -effect -australia -is -as -yet -unoccupied -if -you -take -a -map -of -the -united -states -and -leave -the -atlantic -sea -board -states -in -their -places -also -the -fringe -of -southern -states -from -florida -west -to -the -mouth -of -the -mississippi -also -a -narrow -inhabited -streak -up -the -mississippi -half -way -to -its -head -waters -also -a -narrow -inhabited -border -along -the -pacific -coast -then -take -a -brushful -of -paint -and -obliterate -the -whole -remaining -mighty -stretch -of -country -that -lies -between -the -atlantic -states -and -the -pacific -coast -strip -your -map -will -look -like -the -latest -map -of -australia -this -stupendous -blank -is -hot -not -to -say -torrid -a -part -of -it -is -fertile -the -rest -is -desert -it -is -not -liberally -watered -it -has -no -towns -one -has -only -to -cross -the -mountains -of -new -south -wales -and -descend -into -the -westward -lying -regions -to -find -that -he -has -left -the -choice -climate -behind -him -and -found -a -new -one -of -a -quite -different -character -in -fact -he -would -not -know -by -the -thermometer -that -he -was -not -in -the -blistering -plains -of -india -captain -sturt -the -great -explorer -gives -us -a -sample -of -the -heat -the -wind -which -had -been -blowing -all -the -morning -from -the -n -e -increased -to -a -heavy -gale -and -i -shall -never -forget -its -withering -effect -i -sought -shelter -behind -a -large -gum -tree -but -the -blasts -of -heat -were -so -terrific -that -i -wondered -the -very -grass -did -not -take -fire -this -really -was -nothing -ideal -everything -both -animate -and -inanimate -gave -way -before -it -the -horses -stood -with -their -backs -to -the -wind -and -their -noses -to -the -ground -without -the -muscular -strength -to -raise -their -heads -the -birds -were -mute -and -the -leaves -of -the -trees -under -which -we -were -sitting -fell -like -a -snow -shower -around -us -at -noon -i -took -a -thermometer -graded -to -127 -deg -out -of -my -box -and -observed -that -the -mercury -was -up -to -125 -thinking -that -it -had -been -unduly -influenced -i -put -it -in -the -fork -of -a -tree -close -to -me -sheltered -alike -from -the -wind -and -the -sun -i -went -to -examine -it -about -an -hour -afterwards -when -i -found -the -mercury -had -risen -to -the -top -of -the -instrument -and -had -burst -the -bulb -a -circumstance -that -i -believe -no -traveler -has -ever -before -had -to -record -i -cannot -find -language -to -convey -to -the -reader's -mind -an -idea -of -the -intense -and -oppressive -nature -of -the -heat -that -prevailed -that -hot -wind -sweeps -over -sydney -sometimes -and -brings -with -it -what -is -called -a -dust -storm -it -is -said -that -most -australian -towns -are -acquainted -with -the -dust -storm -i -think -i -know -what -it -is -like -for -the -following -description -by -mr -gape -tallies -very -well -with -the -alkali -duststorm -of -nevada -if -you -leave -out -the -shovel -part -still -the -shovel -part -is -a -pretty -important -part -and -seems -to -indicate -that -my -nevada -storm -is -but -a -poor -thing -after -all -as -we -proceeded -the -altitude -became -less -and -the -heat -proportionately -greater -until -we -reached -dubbo -which -is -only -600 -feet -above -sea -level -it -is -a -pretty -town -built -on -an -extensive -plain -after -the -effects -of -a -shower -of -rain -have -passed -away -the -surface -of -the -ground -crumbles -into -a -thick -layer -of -dust -and -occasionally -when -the -wind -is -in -a -particular -quarter -it -is -lifted -bodily -from -the -ground -in -one -long -opaque -cloud -in -the -midst -of -such -a -storm -nothing -can -be -seen -a -few -yards -ahead -and -the -unlucky -person -who -happens -to -be -out -at -the -time -is -compelled -to -seek -the -nearest -retreat -at -hand -when -the -thrifty -housewife -sees -in -the -distance -the -dark -column -advancing -in -a -steady -whirl -towards -her -house -she -closes -the -doors -and -windows -with -all -expedition -a -drawing -room -the -window -of -which -has -been -carelessly -left -open -during -a -dust -storm -is -indeed -an -extraordinary -sight -a -lady -who -has -resided -in -dubbo -for -some -years -says -that -the -dust -lies -so -thick -on -the -carpet -that -it -is -necessary -to -use -a -shovel -to -remove -it -and -probably -a -wagon -i -was -mistaken -i -have -not -seen -a -proper -duststorm -to -my -mind -the -exterior -aspects -and -character -of -australia -are -fascinating -things -to -look -at -and -think -about -they -are -so -strange -so -weird -so -new -so -uncommonplace -such -a -startling -and -interesting -contrast -to -the -other -sections -of -the -planet -the -sections -that -are -known -to -us -all -familiar -to -us -all -in -the -matter -of -particulars -a -detail -here -a -detail -there -we -have -had -the -choice -climate -of -new -south -wales' -seacoast -we -have -had -the -australian -heat -as -furnished -by -captain -sturt -we -have -had -the -wonderful -dust -storm -and -we -have -considered -the -phenomenon -of -an -almost -empty -hot -wilderness -half -as -big -as -the -united -states -with -a -narrow -belt -of -civilization -population -and -good -climate -around -it -chapter -x -everything -human -is -pathetic -the -secret -source -of -humor -itself -is -not -joy -but -sorrow -there -is -no -humor -in -heaven -pudd'nhead -wilson's -new -calendar -captain -cook -found -australia -in -1770 -and -eighteen -years -later -the -british -government -began -to -transport -convicts -to -it -altogether -new -south -wales -received -83 -000 -in -53 -years -the -convicts -wore -heavy -chains -they -were -ill -fed -and -badly -treated -by -the -officers -set -over -them -they -were -heavily -punished -for -even -slight -infractions -of -the -rules -the -cruelest -discipline -ever -known -is -one -historian's -description -of -their -life -[the -story -of -australasia -j -s -laurie -] -english -law -was -hard -hearted -in -those -days -for -trifling -offenses -which -in -our -day -would -be -punished -by -a -small -fine -or -a -few -days' -confinement -men -women -and -boys -were -sent -to -this -other -end -of -the -earth -to -serve -terms -of -seven -and -fourteen -years -and -for -serious -crimes -they -were -transported -for -life -children -were -sent -to -the -penal -colonies -for -seven -years -for -stealing -a -rabbit! -when -i -was -in -london -twenty -three -years -ago -there -was -a -new -penalty -in -force -for -diminishing -garroting -and -wife -beating -25 -lashes -on -the -bare -back -with -the -cat -o' -nine -tails -it -was -said -that -this -terrible -punishment -was -able -to -bring -the -stubbornest -ruffians -to -terms -and -that -no -man -had -been -found -with -grit -enough -to -keep -his -emotions -to -himself -beyond -the -ninth -blow -as -a -rule -the -man -shrieked -earlier -that -penalty -had -a -great -and -wholesome -effect -upon -the -garroters -and -wife -beaters -but -humane -modern -london -could -not -endure -it -it -got -its -law -rescinded -many -a -bruised -and -battered -english -wife -has -since -had -occasion -to -deplore -that -cruel -achievement -of -sentimental -humanity -twenty -five -lashes! -in -australia -and -tasmania -they -gave -a -convict -fifty -for -almost -any -little -offense -and -sometimes -a -brutal -officer -would -add -fifty -and -then -another -fifty -and -so -on -as -long -as -the -sufferer -could -endure -the -torture -and -live -in -tasmania -i -read -the -entry -in -an -old -manuscript -official -record -of -a -case -where -a -convict -was -given -three -hundred -lashes -for -stealing -some -silver -spoons -and -men -got -more -than -that -sometimes -who -handled -the -cat -often -it -was -another -convict -sometimes -it -was -the -culprit's -dearest -comrade -and -he -had -to -lay -on -with -all -his -might -otherwise -he -would -get -a -flogging -himself -for -his -mercy -for -he -was -under -watch -and -yet -not -do -his -friend -any -good -the -friend -would -be -attended -to -by -another -hand -and -suffer -no -lack -in -the -matter -of -full -punishment -the -convict -life -in -tasmania -was -so -unendurable -and -suicide -so -difficult -to -accomplish -that -once -or -twice -despairing -men -got -together -and -drew -straws -to -determine -which -of -them -should -kill -another -of -the -group -this -murder -to -secure -death -to -the -perpetrator -and -to -the -witnesses -of -it -by -the -hand -of -the -hangman! -the -incidents -quoted -above -are -mere -hints -mere -suggestions -of -what -convict -life -was -like -they -are -but -a -couple -of -details -tossed -into -view -out -of -a -shoreless -sea -of -such -or -to -change -the -figure -they -are -but -a -pair -of -flaming -steeples -photographed -from -a -point -which -hides -from -sight -the -burning -city -which -stretches -away -from -their -bases -on -every -hand -some -of -the -convicts -indeed -a -good -many -of -them -were -very -bad -people -even -for -that -day -but -the -most -of -them -were -probably -not -noticeably -worse -than -the -average -of -the -people -they -left -behind -them -at -home -we -must -believe -this -we -cannot -avoid -it -we -are -obliged -to -believe -that -a -nation -that -could -look -on -unmoved -and -see -starving -or -freezing -women -hanged -for -stealing -twenty -six -cents' -worth -of -bacon -or -rags -and -boys -snatched -from -their -mothers -and -men -from -their -families -and -sent -to -the -other -side -of -the -world -for -long -terms -of -years -for -similar -trifling -offenses -was -a -nation -to -whom -the -term -civilized -could -not -in -any -large -way -be -applied -and -we -must -also -believe -that -a -nation -that -knew -during -more -than -forty -years -what -was -happening -to -those -exiles -and -was -still -content -with -it -was -not -advancing -in -any -showy -way -toward -a -higher -grade -of -civilization -if -we -look -into -the -characters -and -conduct -of -the -officers -and -gentlemen -who -had -charge -of -the -convicts -and -attended -to -their -backs -and -stomachs -we -must -grant -again -that -as -between -the -convict -and -his -masters -and -between -both -and -the -nation -at -home -there -was -a -quite -noticeable -monotony -of -sameness -four -years -had -gone -by -and -many -convicts -had -come -respectable -settlers -were -beginning -to -arrive -these -two -classes -of -colonists -had -to -be -protected -in -case -of -trouble -among -themselves -or -with -the -natives -it -is -proper -to -mention -the -natives -though -they -could -hardly -count -they -were -so -scarce -at -a -time -when -they -had -not -as -yet -begun -to -be -much -disturbed -not -as -yet -being -in -the -way -it -was -estimated -that -in -new -south -wales -there -was -but -one -native -to -45 -000 -acres -of -territory -people -had -to -be -protected -officers -of -the -regular -army -did -not -want -this -service -away -off -there -where -neither -honor -nor -distinction -was -to -be -gained -so -england -recruited -and -officered -a -kind -of -militia -force -of -1 -000 -uniformed -civilians -called -the -new -south -wales -corps -and -shipped -it -this -was -the -worst -blow -of -all -the -colony -fairly -staggered -under -it -the -corps -was -an -object -lesson -of -the -moral -condition -of -england -outside -of -the -jails -the -colonists -trembled -it -was -feared -that -next -there -would -be -an -importation -of -the -nobility -in -those -early -days -the -colony -was -non -supporting -all -the -necessaries -of -life -food -clothing -and -all -were -sent -out -from -england -and -kept -in -great -government -store -houses -and -given -to -the -convicts -and -sold -to -the -settlers -sold -at -a -trifling -advance -upon -cost -the -corps -saw -its -opportunity -its -officers -went -into -commerce -and -in -a -most -lawless -way -they -went -to -importing -rum -and -also -to -manufacturing -it -in -private -stills -in -defiance -of -the -government's -commands -and -protests -they -leagued -themselves -together -and -ruled -the -market -they -boycotted -the -government -and -the -other -dealers -they -established -a -close -monopoly -and -kept -it -strictly -in -their -own -hands -when -a -vessel -arrived -with -spirits -they -allowed -nobody -to -buy -but -themselves -and -they -forced -the -owner -to -sell -to -them -at -a -price -named -by -themselves -and -it -was -always -low -enough -they -bought -rum -at -an -average -of -two -dollars -a -gallon -and -sold -it -at -an -average -of -ten -they -made -rum -the -currency -of -the -country -for -there -was -little -or -no -money -and -they -maintained -their -devastating -hold -and -kept -the -colony -under -their -heel -for -eighteen -or -twenty -years -before -they -were -finally -conquered -and -routed -by -the -government -meantime -they -had -spread -intemperance -everywhere -and -they -had -squeezed -farm -after -farm -out -of -the -settlers -hands -for -rum -and -thus -had -bountifully -enriched -themselves -when -a -farmer -was -caught -in -the -last -agonies -of -thirst -they -took -advantage -of -him -and -sweated -him -for -a -drink -in -one -instance -they -sold -a -man -a -gallon -of -rum -worth -two -dollars -for -a -piece -of -property -which -was -sold -some -years -later -for -$100 -000 -when -the -colony -was -about -eighteen -or -twenty -years -old -it -was -discovered -that -the -land -was -specially -fitted -for -the -wool -culture -prosperity -followed -commerce -with -the -world -began -by -and -by -rich -mines -of -the -noble -metals -were -opened -immigrants -flowed -in -capital -likewise -the -result -is -the -great -and -wealthy -and -enlightened -commonwealth -of -new -south -wales -it -is -a -country -that -is -rich -in -mines -wool -ranches -trams -railways -steamship -lines -schools -newspapers -botanical -gardens -art -galleries -libraries -museums -hospitals -learned -societies -it -is -the -hospitable -home -of -every -species -of -culture -and -of -every -species -of -material -enterprise -and -there -is -a -church -at -every -man's -door -and -a -race -track -over -the -way -chapter -xi -we -should -be -careful -to -get -out -of -an -experience -only -the -wisdom -that -is -in -it -and -stop -there -lest -we -be -like -the -cat -that -sits -down -on -a -hot -stove -lid -she -will -never -sit -down -on -a -hot -stove -lid -again -and -that -is -well -but -also -she -will -never -sit -down -on -a -cold -one -any -more -pudd'nhead -wilson's -new -calendar -all -english -speaking -colonies -are -made -up -of -lavishly -hospitable -people -and -new -south -wales -and -its -capital -are -like -the -rest -in -this -the -english -speaking -colony -of -the -united -states -of -america -is -always -called -lavishly -hospitable -by -the -english -traveler -as -to -the -other -english -speaking -colonies -throughout -the -world -from -canada -all -around -i -know -by -experience -that -the -description -fits -them -i -will -not -go -more -particularly -into -this -matter -for -i -find -that -when -writers -try -to -distribute -their -gratitude -here -and -there -and -yonder -by -detail -they -run -across -difficulties -and -do -some -ungraceful -stumbling -mr -gane -new -south -wales -and -victoria -in -1885 -tried -to -distribute -his -gratitude -and -was -not -lucky -the -inhabitants -of -sydney -are -renowned -for -their -hospitality -the -treatment -which -we -experienced -at -the -hands -of -this -generous -hearted -people -will -help -more -than -anything -else -to -make -us -recollect -with -pleasure -our -stay -amongst -them -in -the -character -of -hosts -and -hostesses -they -excel -the -'new -chum' -needs -only -the -acquaintanceship -of -one -of -their -number -and -he -becomes -at -once -the -happy -recipient -of -numerous -complimentary -invitations -and -thoughtful -kindnesses -of -the -towns -it -has -been -our -good -fortune -to -visit -none -have -portrayed -home -so -faithfully -as -sydney -nobody -could -say -it -finer -than -that -if -he -had -put -in -his -cork -then -and -stayed -away -from -dubbo -but -no -heedless -man -he -pulled -it -again -pulled -it -when -he -was -away -along -in -his -book -and -his -memory -of -what -he -had -said -about -sydney -had -grown -dim -we -cannot -quit -the -promising -town -of -dubbo -without -testifying -in -warm -praise -to -the -kind -hearted -and -hospitable -usages -of -its -inhabitants -sydney -though -well -deserving -the -character -it -bears -of -its -kindly -treatment -of -strangers -possesses -a -little -formality -and -reserve -in -dubbo -on -the -contrary -though -the -same -congenial -manners -prevail -there -is -a -pleasing -degree -of -respectful -familiarity -which -gives -the -town -a -homely -comfort -not -often -met -with -elsewhere -in -laying -on -one -side -our -pen -we -feel -contented -in -having -been -able -though -so -late -in -this -work -to -bestow -a -panegyric -however -unpretentious -on -a -town -which -though -possessing -no -picturesque -natural -surroundings -nor -interesting -architectural -productions -has -yet -a -body -of -citizens -whose -hearts -cannot -but -obtain -for -their -town -a -reputation -for -benevolence -and -kind -heartedness -i -wonder -what -soured -him -on -sydney -it -seems -strange -that -a -pleasing -degree -of -three -or -four -fingers -of -respectful -familiarity -should -fill -a -man -up -and -give -him -the -panegyrics -so -bad -for -he -has -them -the -worst -way -any -one -can -see -that -a -man -who -is -perfectly -at -himself -does -not -throw -cold -detraction -at -people's -architectural -productions -and -picturesque -surroundings -and -let -on -that -what -he -prefers -is -a -dubbonese -dust -storm -and -a -pleasing -degree -of -respectful -familiarity -no -these -are -old -old -symptoms -and -when -they -appear -we -know -that -the -man -has -got -the -panegyrics -sydney -has -a -population -of -400 -000 -when -a -stranger -from -america -steps -ashore -there -the -first -thing -that -strikes -him -is -that -the -place -is -eight -or -nine -times -as -large -as -he -was -expecting -it -to -be -and -the -next -thing -that -strikes -him -is -that -it -is -an -english -city -with -american -trimmings -later -on -in -melbourne -he -will -find -the -american -trimmings -still -more -in -evidence -there -even -the -architecture -will -often -suggest -america -a -photograph -of -its -stateliest -business -street -might -be -passed -upon -him -for -a -picture -of -the -finest -street -in -a -large -american -city -i -was -told -that -the -most -of -the -fine -residences -were -the -city -residences -of -squatters -the -name -seemed -out -of -focus -somehow -when -the -explanation -came -it -offered -a -new -instance -of -the -curious -changes -which -words -as -well -as -animals -undergo -through -change -of -habitat -and -climate -with -us -when -you -speak -of -a -squatter -you -are -always -supposed -to -be -speaking -of -a -poor -man -but -in -australia -when -you -speak -of -a -squatter -you -are -supposed -to -be -speaking -of -a -millionaire -in -america -the -word -indicates -the -possessor -of -a -few -acres -and -a -doubtful -title -in -australia -it -indicates -a -man -whose -landfront -is -as -long -as -a -railroad -and -whose -title -has -been -perfected -in -one -way -or -another -in -america -the -word -indicates -a -man -who -owns -a -dozen -head -of -live -stock -in -australia -a -man -who -owns -anywhere -from -fifty -thousand -up -to -half -a -million -head -in -america -the -word -indicates -a -man -who -is -obscure -and -not -important -in -australia -a -man -who -is -prominent -and -of -the -first -importance -in -america -you -take -off -your -hat -to -no -squatter -in -australia -you -do -in -america -if -your -uncle -is -a -squatter -you -keep -it -dark -in -australia -you -advertise -it -in -america -if -your -friend -is -a -squatter -nothing -comes -of -it -but -with -a -squatter -for -your -friend -in -australia -you -may -sup -with -kings -if -there -are -any -around -in -australia -it -takes -about -two -acres -and -a -half -of -pastureland -some -people -say -twice -as -many -to -support -a -sheep -and -when -the -squatter -has -half -a -million -sheep -his -private -domain -is -about -as -large -as -rhode -island -to -speak -in -general -terms -his -annual -wool -crop -may -be -worth -a -quarter -or -a -half -million -dollars -he -will -live -in -a -palace -in -melbourne -or -sydney -or -some -other -of -the -large -cities -and -make -occasional -trips -to -his -sheep -kingdom -several -hundred -miles -away -in -the -great -plains -to -look -after -his -battalions -of -riders -and -shepherds -and -other -hands -he -has -a -commodious -dwelling -out -there -and -if -he -approve -of -you -he -will -invite -you -to -spend -a -week -in -it -and -will -make -you -at -home -and -comfortable -and -let -you -see -the -great -industry -in -all -its -details -and -feed -you -and -slake -you -and -smoke -you -with -the -best -that -money -can -buy -on -at -least -one -of -these -vast -estates -there -is -a -considerable -town -with -all -the -various -businesses -and -occupations -that -go -to -make -an -important -town -and -the -town -and -the -land -it -stands -upon -are -the -property -of -the -squatters -i -have -seen -that -town -and -it -is -not -unlikely -that -there -are -other -squatter -owned -towns -in -australia -australia -supplies -the -world -not -only -with -fine -wool -but -with -mutton -also -the -modern -invention -of -cold -storage -and -its -application -in -ships -has -created -this -great -trade -in -sydney -i -visited -a -huge -establishment -where -they -kill -and -clean -and -solidly -freeze -a -thousand -sheep -a -day -for -shipment -to -england -the -australians -did -not -seem -to -me -to -differ -noticeably -from -americans -either -in -dress -carriage -ways -pronunciation -inflections -or -general -appearance -there -were -fleeting -and -subtle -suggestions -of -their -english -origin -but -these -were -not -pronounced -enough -as -a -rule -to -catch -one's -attention -the -people -have -easy -and -cordial -manners -from -the -beginning -from -the -moment -that -the -introduction -is -completed -this -is -american -to -put -it -in -another -way -it -is -english -friendliness -with -the -english -shyness -and -self -consciousness -left -out -now -and -then -but -this -is -rare -one -hears -such -words -as -piper -for -paper -lydy -for -lady -and -tyble -for -table -fall -from -lips -whence -one -would -not -expect -such -pronunciations -to -come -there -is -a -superstition -prevalent -in -sydney -that -this -pronunciation -is -an -australianism -but -people -who -have -been -home -as -the -native -reverently -and -lovingly -calls -england -know -better -it -is -costermonger -all -over -australasia -this -pronunciation -is -nearly -as -common -among -servants -as -it -is -in -london -among -the -uneducated -and -the -partially -educated -of -all -sorts -and -conditions -of -people -that -mislaid -'y' -is -rather -striking -when -a -person -gets -enough -of -it -into -a -short -sentence -to -enable -it -to -show -up -in -the -hotel -in -sydney -the -chambermaid -said -one -morning -the -tyble -is -set -and -here -is -the -piper -and -if -the -lydy -is -ready -i'll -tell -the -wyter -to -bring -up -the -breakfast -i -have -made -passing -mention -a -moment -ago -of -the -native -australasian's -custom -of -speaking -of -england -as -home -it -was -always -pretty -to -hear -it -and -often -it -was -said -in -an -unconsciously -caressing -way -that -made -it -touching -in -a -way -which -transmuted -a -sentiment -into -an -embodiment -and -made -one -seem -to -see -australasia -as -a -young -girl -stroking -mother -england's -old -gray -head -in -the -australasian -home -the -table -talk -is -vivacious -and -unembarrassed -it -is -without -stiffness -or -restraint -this -does -not -remind -one -of -england -so -much -as -it -does -of -america -but -australasia -is -strictly -democratic -and -reserves -and -restraints -are -things -that -are -bred -by -differences -of -rank -english -and -colonial -audiences -are -phenomenally -alert -and -responsive -where -masses -of -people -are -gathered -together -in -england -caste -is -submerged -and -with -it -the -english -reserve -equality -exists -for -the -moment -and -every -individual -is -free -so -free -from -any -consciousness -of -fetters -indeed -that -the -englishman's -habit -of -watching -himself -and -guarding -himself -against -any -injudicious -exposure -of -his -feelings -is -forgotten -and -falls -into -abeyance -and -to -such -a -degree -indeed -that -he -will -bravely -applaud -all -by -himself -if -he -wants -to -an -exhibition -of -daring -which -is -unusual -elsewhere -in -the -world -but -it -is -hard -to -move -a -new -english -acquaintance -when -he -is -by -himself -or -when -the -company -present -is -small -and -new -to -him -he -is -on -his -guard -then -and -his -natural -reserve -is -to -the -fore -this -has -given -him -the -false -reputation -of -being -without -humor -and -without -the -appreciation -of -humor -americans -are -not -englishmen -and -american -humor -is -not -english -humor -but -both -the -american -and -his -humor -had -their -origin -in -england -and -have -merely -undergone -changes -brought -about -by -changed -conditions -and -a -new -environment -about -the -best -humorous -speeches -i -have -yet -heard -were -a -couple -that -were -made -in -australia -at -club -suppers -one -of -them -by -an -englishman -the -other -by -an -australian -chapter -xii -there -are -those -who -scoff -at -the -schoolboy -calling -him -frivolous -and -shallow -yet -it -was -the -schoolboy -who -said -faith -is -believing -what -you -know -ain't -so -pudd'nhead -wilson's -new -calendar -in -sydney -i -had -a -large -dream -and -in -the -course -of -talk -i -told -it -to -a -missionary -from -india -who -was -on -his -way -to -visit -some -relatives -in -new -zealand -i -dreamed -that -the -visible -universe -is -the -physical -person -of -god -that -the -vast -worlds -that -we -see -twinkling -millions -of -miles -apart -in -the -fields -of -space -are -the -blood -corpuscles -in -his -veins -and -that -we -and -the -other -creatures -are -the -microbes -that -charge -with -multitudinous -life -the -corpuscles -mr -x -the -missionary -considered -the -dream -awhile -then -said -it -is -not -surpassable -for -magnitude -since -its -metes -and -bounds -are -the -metes -and -bounds -of -the -universe -itself -and -it -seems -to -me -that -it -almost -accounts -for -a -thing -which -is -otherwise -nearly -unaccountable -the -origin -of -the -sacred -legends -of -the -hindoos -perhaps -they -dream -them -and -then -honestly -believe -them -to -be -divine -revelations -of -fact -it -looks -like -that -for -the -legends -are -built -on -so -vast -a -scale -that -it -does -not -seem -reasonable -that -plodding -priests -would -happen -upon -such -colossal -fancies -when -awake -he -told -some -of -the -legends -and -said -that -they -were -implicitly -believed -by -all -classes -of -hindoos -including -those -of -high -social -position -and -intelligence -and -he -said -that -this -universal -credulity -was -a -great -hindrance -to -the -missionary -in -his -work -then -he -said -something -like -this -at -home -people -wonder -why -christianity -does -not -make -faster -progress -in -india -they -hear -that -the -indians -believe -easily -and -that -they -have -a -natural -trust -in -miracles -and -give -them -a -hospitable -reception -then -they -argue -like -this -since -the -indian -believes -easily -place -christianity -before -them -and -they -must -believe -confirm -its -truths -by -the -biblical -miracles -and -they -will -no -longer -doubt -the -natural -deduction -is -that -as -christianity -makes -but -indifferent -progress -in -india -the -fault -is -with -us -we -are -not -fortunate -in -presenting -the -doctrines -and -the -miracles -but -the -truth -is -we -are -not -by -any -means -so -well -equipped -as -they -think -we -have -not -the -easy -task -that -they -imagine -to -use -a -military -figure -we -are -sent -against -the -enemy -with -good -powder -in -our -guns -but -only -wads -for -bullets -that -is -to -say -our -miracles -are -not -effective -the -hindoos -do -not -care -for -them -they -have -more -extraordinary -ones -of -their -own -all -the -details -of -their -own -religion -are -proven -and -established -by -miracles -the -details -of -ours -must -be -proven -in -the -same -way -when -i -first -began -my -work -in -india -i -greatly -underestimated -the -difficulties -thus -put -upon -my -task -a -correction -was -not -long -in -coming -i -thought -as -our -friends -think -at -home -that -to -prepare -my -childlike -wonder -lovers -to -listen -with -favor -to -my -grave -message -i -only -needed -to -charm -the -way -to -it -with -wonders -marvels -miracles -with -full -confidence -i -told -the -wonders -performed -by -samson -the -strongest -man -that -had -ever -lived -for -so -i -called -him -at -first -i -saw -lively -anticipation -and -strong -interest -in -the -faces -of -my -people -but -as -i -moved -along -from -incident -to -incident -of -the -great -story -i -was -distressed -to -see -that -i -was -steadily -losing -the -sympathy -of -my -audience -i -could -not -understand -it -it -was -a -surprise -to -me -and -a -disappointment -before -i -was -through -the -fading -sympathy -had -paled -to -indifference -thence -to -the -end -the -indifference -remained -i -was -not -able -to -make -any -impression -upon -it -a -good -old -hindoo -gentleman -told -me -where -my -trouble -lay -he -said -'we -hindoos -recognize -a -god -by -the -work -of -his -hands -we -accept -no -other -testimony -apparently -this -is -also -the -rule -with -you -christians -and -we -know -when -a -man -has -his -power -from -a -god -by -the -fact -that -he -does -things -which -he -could -not -do -as -a -man -with -the -mere -powers -of -a -man -plainly -this -is -the -christian's -way -also -of -knowing -when -a -man -is -working -by -a -god's -power -and -not -by -his -own -you -saw -that -there -was -a -supernatural -property -in -the -hair -of -samson -for -you -perceived -that -when -his -hair -was -gone -he -was -as -other -men -it -is -our -way -as -i -have -said -there -are -many -nations -in -the -world -and -each -group -of -nations -has -its -own -gods -and -will -pay -no -worship -to -the -gods -of -the -others -each -group -believes -its -own -gods -to -be -strongest -and -it -will -not -exchange -them -except -for -gods -that -shall -be -proven -to -be -their -superiors -in -power -man -is -but -a -weak -creature -and -needs -the -help -of -gods -he -cannot -do -without -it -shall -he -place -his -fate -in -the -hands -of -weak -gods -when -there -may -be -stronger -ones -to -be -found -that -would -be -foolish -no -if -he -hear -of -gods -that -are -stronger -than -his -own -he -should -not -turn -a -deaf -ear -for -it -is -not -a -light -matter -that -is -at -stake -how -then -shall -he -determine -which -gods -are -the -stronger -his -own -or -those -that -preside -over -the -concerns -of -other -nations -by -comparing -the -known -works -of -his -own -gods -with -the -works -of -those -others -there -is -no -other -way -now -when -we -make -this -comparison -we -are -not -drawn -towards -the -gods -of -any -other -nation -our -gods -are -shown -by -their -works -to -be -the -strongest -the -most -powerful -the -christians -have -but -few -gods -and -they -are -new -new -and -not -strong -as -it -seems -to -us -they -will -increase -in -number -it -is -true -for -this -has -happened -with -all -gods -but -that -time -is -far -away -many -ages -and -decades -of -ages -away -for -gods -multiply -slowly -as -is -meet -for -beings -to -whom -a -thousand -years -is -but -a -single -moment -our -own -gods -have -been -born -millions -of -years -apart -the -process -is -slow -the -gathering -of -strength -and -power -is -similarly -slow -in -the -slow -lapse -of -the -ages -the -steadily -accumulating -power -of -our -gods -has -at -last -become -prodigious -we -have -a -thousand -proofs -of -this -in -the -colossal -character -of -their -personal -acts -and -the -acts -of -ordinary -men -to -whom -they -have -given -supernatural -qualities -to -your -samson -was -given -supernatural -power -and -when -he -broke -the -withes -and -slew -the -thousands -with -the -jawbone -of -an -ass -and -carried -away -the -gate's -of -the -city -upon -his -shoulders -you -were -amazed -and -also -awed -for -you -recognized -the -divine -source -of -his -strength -but -it -could -not -profit -to -place -these -things -before -your -hindoo -congregation -and -invite -their -wonder -for -they -would -compare -them -with -the -deed -done -by -hanuman -when -our -gods -infused -their -divine -strength -into -his -muscles -and -they -would -be -indifferent -to -them -as -you -saw -in -the -old -old -times -ages -and -ages -gone -by -when -our -god -rama -was -warring -with -the -demon -god -of -ceylon -rama -bethought -him -to -bridge -the -sea -and -connect -ceylon -with -india -so -that -his -armies -might -pass -easily -over -and -he -sent -his -general -hanuman -inspired -like -your -own -samson -with -divine -strength -to -bring -the -materials -for -the -bridge -in -two -days -hanuman -strode -fifteen -hundred -miles -to -the -himalayas -and -took -upon -his -shoulder -a -range -of -those -lofty -mountains -two -hundred -miles -long -and -started -with -it -toward -ceylon -it -was -in -the -night -and -as -he -passed -along -the -plain -the -people -of -govardhun -heard -the -thunder -of -his -tread -and -felt -the -earth -rocking -under -it -and -they -ran -out -and -there -with -their -snowy -summits -piled -to -heaven -they -saw -the -himalayas -passing -by -and -as -this -huge -continent -swept -along -overshadowing -the -earth -upon -its -slopes -they -discerned -the -twinkling -lights -of -a -thousand -sleeping -villages -and -it -was -as -if -the -constellations -were -filing -in -procession -through -the -sky -while -they -were -looking -hanuman -stumbled -and -a -small -ridge -of -red -sandstone -twenty -miles -long -was -jolted -loose -and -fell -half -of -its -length -has -wasted -away -in -the -course -of -the -ages -but -the -other -ten -miles -of -it -remain -in -the -plain -by -govardhun -to -this -day -as -proof -of -the -might -of -the -inspiration -of -our -gods -you -must -know -yourself -that -hanuman -could -not -have -carried -those -mountains -to -ceylon -except -by -the -strength -of -the -gods -you -know -that -it -was -not -done -by -his -own -strength -therefore -you -know -that -it -was -done -by -the -strength -of -the -gods -just -as -you -know -that -samson -carried -the -gates -by -the -divine -strength -and -not -by -his -own -i -think -you -must -concede -two -things -first -that -in -carrying -the -gates -of -the -city -upon -his -shoulders -samson -did -not -establish -the -superiority -of -his -gods -over -ours -secondly -that -his -feat -is -not -supported -by -any -but -verbal -evidence -while -hanuman's -is -not -only -supported -by -verbal -evidence -but -this -evidence -is -confirmed -established -proven -by -visible -tangible -evidence -which -is -the -strongest -of -all -testimony -we -have -the -sandstone -ridge -and -while -it -remains -we -cannot -doubt -and -shall -not -have -you -the -gates -' -chapter -xiii -the -timid -man -yearns -for -full -value -and -asks -a -tenth -the -bold -man -strikes -for -double -value -and -compromises -on -par -pudd'nhead -wilson's -new -calendar -one -is -sure -to -be -struck -by -the -liberal -way -in -which -australasia -spends -money -upon -public -works -such -as -legislative -buildings -town -halls -hospitals -asylums -parks -and -botanical -gardens -i -should -say -that -where -minor -towns -in -america -spend -a -hundred -dollars -on -the -town -hall -and -on -public -parks -and -gardens -the -like -towns -in -australasia -spend -a -thousand -and -i -think -that -this -ratio -will -hold -good -in -the -matter -of -hospitals -also -i -have -seen -a -costly -and -well -equipped -and -architecturally -handsome -hospital -in -an -australian -village -of -fifteen -hundred -inhabitants -it -was -built -by -private -funds -furnished -by -the -villagers -and -the -neighboring -planters -and -its -running -expenses -were -drawn -from -the -same -sources -i -suppose -it -would -be -hard -to -match -this -in -any -country -this -village -was -about -to -close -a -contract -for -lighting -its -streets -with -the -electric -light -when -i -was -there -that -is -ahead -of -london -london -is -still -obscured -by -gas -gas -pretty -widely -scattered -too -in -some -of -the -districts -so -widely -indeed -that -except -on -moonlight -nights -it -is -difficult -to -find -the -gas -lamps -the -botanical -garden -of -sydney -covers -thirty -eight -acres -beautifully -laid -out -and -rich -with -the -spoil -of -all -the -lands -and -all -the -climes -of -the -world -the -garden -is -on -high -ground -in -the -middle -of -the -town -overlooking -the -great -harbor -and -it -adjoins -the -spacious -grounds -of -government -house -fifty -six -acres -and -at -hand -also -is -a -recreation -ground -containing -eighty -two -acres -in -addition -there -are -the -zoological -gardens -the -race -course -and -the -great -cricket -grounds -where -the -international -matches -are -played -therefore -there -is -plenty -of -room -for -reposeful -lazying -and -lounging -and -for -exercise -too -for -such -as -like -that -kind -of -work -there -are -four -specialties -attainable -in -the -way -of -social -pleasure -if -you -enter -your -name -on -the -visitor's -book -at -government -house -you -will -receive -an -invitation -to -the -next -ball -that -takes -place -there -if -nothing -can -be -proven -against -you -and -it -will -be -very -pleasant -for -you -will -see -everybody -except -the -governor -and -add -a -number -of -acquaintances -and -several -friends -to -your -list -the -governor -will -be -in -england -he -always -is -the -continent -has -four -or -five -governors -and -i -do -not -know -how -many -it -takes -to -govern -the -outlying -archipelago -but -anyway -you -will -not -see -them -when -they -are -appointed -they -come -out -from -england -and -get -inaugurated -and -give -a -ball -and -help -pray -for -rain -and -get -aboard -ship -and -go -back -home -and -so -the -lieutenant -governor -has -to -do -all -the -work -i -was -in -australasia -three -months -and -a -half -and -saw -only -one -governor -the -others -were -at -home -the -australasian -governor -would -not -be -so -restless -perhaps -if -he -had -a -war -or -a -veto -or -something -like -that -to -call -for -his -reserve -energies -but -he -hasn't -there -isn't -any -war -and -there -isn't -any -veto -in -his -hands -and -so -there -is -really -little -or -nothing -doing -in -his -line -the -country -governs -itself -and -prefers -to -do -it -and -is -so -strenuous -about -it -and -so -jealous -of -its -independence -that -it -grows -restive -if -even -the -imperial -government -at -home -proposes -to -help -and -so -the -imperial -veto -while -a -fact -is -yet -mainly -a -name -thus -the -governor's -functions -are -much -more -limited -than -are -a -governor's -functions -with -us -and -therefore -more -fatiguing -he -is -the -apparent -head -of -the -state -he -is -the -real -head -of -society -he -represents -culture -refinement -elevated -sentiment -polite -life -religion -and -by -his -example -he -propagates -these -and -they -spread -and -flourish -and -bear -good -fruit -he -creates -the -fashion -and -leads -it -his -ball -is -the -ball -of -balls -and -his -countenance -makes -the -horse -race -thrive -he -is -usually -a -lord -and -this -is -well -for -his -position -compels -him -to -lead -an -expensive -life -and -an -english -lord -is -generally -well -equipped -for -that -another -of -sydney's -social -pleasures -is -the -visit -to -the -admiralty -house -which -is -nobly -situated -on -high -ground -overlooking -the -water -the -trim -boats -of -the -service -convey -the -guests -thither -and -there -or -on -board -the -flag -ship -they -have -the -duplicate -of -the -hospitalities -of -government -house -the -admiral -commanding -a -station -in -british -waters -is -a -magnate -of -the -first -degree -and -he -is -sumptuously -housed -as -becomes -the -dignity -of -his -office -third -in -the -list -of -special -pleasures -is -the -tour -of -the -harbor -in -a -fine -steam -pleasure -launch -your -richer -friends -own -boats -of -this -kind -and -they -will -invite -you -and -the -joys -of -the -trip -will -make -a -long -day -seem -short -and -finally -comes -the -shark -fishing -sydney -harbor -is -populous -with -the -finest -breeds -of -man -eating -sharks -in -the -world -some -people -make -their -living -catching -them -for -the -government -pays -a -cash -bounty -on -them -the -larger -the -shark -the -larger -the -bounty -and -some -of -the -sharks -are -twenty -feet -long -you -not -only -get -the -bounty -but -everything -that -is -in -the -shark -belongs -to -you -sometimes -the -contents -are -quite -valuable -the -shark -is -the -swiftest -fish -that -swims -the -speed -of -the -fastest -steamer -afloat -is -poor -compared -to -his -and -he -is -a -great -gad -about -and -roams -far -and -wide -in -the -oceans -and -visits -the -shores -of -all -of -them -ultimately -in -the -course -of -his -restless -excursions -i -have -a -tale -to -tell -now -which -has -not -as -yet -been -in -print -in -1870 -a -young -stranger -arrived -in -sydney -and -set -about -finding -something -to -do -but -he -knew -no -one -and -brought -no -recommendations -and -the -result -was -that -he -got -no -employment -he -had -aimed -high -at -first -but -as -time -and -his -money -wasted -away -he -grew -less -and -less -exacting -until -at -last -he -was -willing -to -serve -in -the -humblest -capacities -if -so -he -might -get -bread -and -shelter -but -luck -was -still -against -him -he -could -find -no -opening -of -any -sort -finally -his -money -was -all -gone -he -walked -the -streets -all -day -thinking -he -walked -them -all -night -thinking -thinking -and -growing -hungrier -and -hungrier -at -dawn -he -found -himself -well -away -from -the -town -and -drifting -aimlessly -along -the -harbor -shore -as -he -was -passing -by -a -nodding -shark -fisher -the -man -looked -up -and -said -say -young -fellow -take -my -line -a -spell -and -change -my -luck -for -me -how -do -you -know -i -won't -make -it -worse -because -you -can't -it -has -been -at -its -worst -all -night -if -you -can't -change -it -no -harm's -done -if -you -do -change -it -it's -for -the -better -of -course -come -all -right -what -will -you -give -i'll -give -you -the -shark -if -you -catch -one -and -i -will -eat -it -bones -and -all -give -me -the -line -here -you -are -i -will -get -away -now -for -awhile -so -that -my -luck -won't -spoil -yours -for -many -and -many -a -time -i've -noticed -that -if -there -pull -in -pull -in -man -you've -got -a -bite! -i -knew -how -it -would -be -why -i -knew -you -for -a -born -son -of -luck -the -minute -i -saw -you -all -right -he's -landed -it -was -an -unusually -large -shark -a -full -nineteen -footer -the -fisherman -said -as -he -laid -the -creature -open -with -his -knife -now -you -rob -him -young -man -while -i -step -to -my -hamper -for -a -fresh -bait -there's -generally -something -in -them -worth -going -for -you've -changed -my -luck -you -see -but -my -goodness -i -hope -you -haven't -changed -your -own -oh -it -wouldn't -matter -don't -worry -about -that -get -your -bait -i'll -rob -him -when -the -fisherman -got -back -the -young -man -had -just -finished -washing -his -hands -in -the -bay -and -was -starting -away -what -you -are -not -going -yes -good -bye -but -what -about -your -shark -the -shark -why -what -use -is -he -to -me -what -use -is -he -i -like -that -don't -you -know -that -we -can -go -and -report -him -to -government -and -you'll -get -a -clean -solid -eighty -shillings -bounty -hard -cash -you -know -what -do -you -think -about -it -now -oh -well -you -can -collect -it -and -keep -it -is -that -what -you -mean -yes -well -this -is -odd -you're -one -of -those -sort -they -call -eccentrics -i -judge -the -saying -is -you -mustn't -judge -a -man -by -his -clothes -and -i'm -believing -it -now -why -yours -are -looking -just -ratty -don't -you -know -and -yet -you -must -be -rich -i -am -the -young -man -walked -slowly -back -to -the -town -deeply -musing -as -he -went -he -halted -a -moment -in -front -of -the -best -restaurant -then -glanced -at -his -clothes -and -passed -on -and -got -his -breakfast -at -a -stand -up -there -was -a -good -deal -of -it -and -it -cost -five -shillings -he -tendered -a -sovereign -got -his -change -glanced -at -his -silver -muttered -to -himself -there -isn't -enough -to -buy -clothes -with -and -went -his -way -at -half -past -nine -the -richest -wool -broker -in -sydney -was -sitting -in -his -morning -room -at -home -settling -his -breakfast -with -the -morning -paper -a -servant -put -his -head -in -and -said -there's -a -sundowner -at -the -door -wants -to -see -you -sir -what -do -you -bring -that -kind -of -a -message -here -for -send -him -about -his -business -he -won't -go -sir -i've -tried -he -won't -go -that's -why -that's -unusual -he's -one -of -two -things -then -he's -a -remarkable -person -or -he's -crazy -is -he -crazy -no -sir -he -don't -look -it -then -he's -remarkable -what -does -he -say -he -wants -he -won't -tell -sir -only -says -it's -very -important -and -won't -go -does -he -say -he -won't -go -says -he'll -stand -there -till -he -sees -you -sir -if -it's -all -day -and -yet -isn't -crazy -show -him -up -the -sundowner -was -shown -in -the -broker -said -to -himself -no -he's -not -crazy -that -is -easy -to -see -so -he -must -be -the -other -thing -then -aloud -well -my -good -fellow -be -quick -about -it -don't -waste -any -words -what -is -it -you -want -i -want -to -borrow -a -hundred -thousand -pounds -scott! -it's -a -mistake -he -is -crazy -no -he -can't -be -not -with -that -eye -why -you -take -my -breath -away -come -who -are -you -nobody -that -you -know -what -is -your -name -cecil -rhodes -no -i -don't -remember -hearing -the -name -before -now -then -just -for -curiosity's -sake -what -has -sent -you -to -me -on -this -extraordinary -errand -the -intention -to -make -a -hundred -thousand -pounds -for -you -and -as -much -for -myself -within -the -next -sixty -days -well -well -well -it -is -the -most -extraordinary -idea -that -sit -down -you -interest -me -and -somehow -you -well -you -fascinate -me -i -think -that -that -is -about -the -word -and -it -isn't -your -proposition -no -that -doesn't -fascinate -me -it's -something -else -i -don't -quite -know -what -something -that's -born -in -you -and -oozes -out -of -you -i -suppose -now -then -just -for -curiosity's -sake -again -nothing -more -as -i -understand -it -it -is -your -desire -to -bor -i -said -intention -pardon -so -you -did -i -thought -it -was -an -unheedful -use -of -the -word -an -unheedful -valuing -of -its -strength -you -know -i -knew -its -strength -well -i -must -say -but -look -here -let -me -walk -the -floor -a -little -my -mind -is -getting -into -a -sort -of -whirl -though -you -don't -seem -disturbed -any -plainly -this -young -fellow -isn't -crazy -but -as -to -his -being -remarkable -well -really -he -amounts -to -that -and -something -over -now -then -i -believe -i -am -beyond -the -reach -of -further -astonishment -strike -and -spare -not -what -is -your -scheme -to -buy -the -wool -crop -deliverable -in -sixty -days -what -the -whole -of -it -the -whole -of -it -no -i -was -not -quite -out -of -the -reach -of -surprises -after -all -why -how -you -talk! -do -you -know -what -our -crop -is -going -to -foot -up -two -and -a -half -million -sterling -maybe -a -little -more -well -you've -got -your -statistics -right -any -way -now -then -do -you -know -what -the -margins -would -foot -up -to -buy -it -at -sixty -days -the -hundred -thousand -pounds -i -came -here -to -get -right -once -more -well -dear -me -just -to -see -what -would -happen -i -wish -you -had -the -money -and -if -you -had -it -what -would -you -do -with -it -i -shall -make -two -hundred -thousand -pounds -out -of -it -in -sixty -days -you -mean -of -course -that -you -might -make -it -if -i -said -'shall' -yes -by -george -you -did -say -'shall'! -you -are -the -most -definite -devil -i -ever -saw -in -the -matter -of -language -dear -dear -dear -look -here! -definite -speech -means -clarity -of -mind -upon -my -word -i -believe -you've -got -what -you -believe -to -be -a -rational -reason -for -venturing -into -this -house -an -entire -stranger -on -this -wild -scheme -of -buying -the -wool -crop -of -an -entire -colony -on -speculation -bring -it -out -i -am -prepared -acclimatized -if -i -may -use -the -word -why -would -you -buy -the -crop -and -why -would -you -make -that -sum -out -of -it -that -is -to -say -what -makes -you -think -you -i -don't -think -i -know -definite -again -how -do -you -know -because -france -has -declared -war -against -germany -and -wool -has -gone -up -fourteen -per -cent -in -london -and -is -still -rising -oh -in -deed -now -then -i've -got -you! -such -a -thunderbolt -as -you -have -just -let -fly -ought -to -have -made -me -jump -out -of -my -chair -but -it -didn't -stir -me -the -least -little -bit -you -see -and -for -a -very -simple -reason -i -have -read -the -morning -paper -you -can -look -at -it -if -you -want -to -the -fastest -ship -in -the -service -arrived -at -eleven -o'clock -last -night -fifty -days -out -from -london -all -her -news -is -printed -here -there -are -no -war -clouds -anywhere -and -as -for -wool -why -it -is -the -low -spiritedest -commodity -in -the -english -market -it -is -your -turn -to -jump -now -well -why -don't -you -jump -why -do -you -sit -there -in -that -placid -fashion -when -because -i -have -later -news -later -news -oh -come -later -news -than -fifty -days -brought -steaming -hot -from -london -by -the -my -news -is -only -ten -days -old -oh -mun -chausen -hear -the -maniac -talk! -where -did -you -get -it -got -it -out -of -a -shark -oh -oh -oh -this -is -too -much! -front! -call -the -police -bring -the -gun -raise -the -town! -all -the -asylums -in -christendom -have -broken -loose -in -the -single -person -of -sit -down! -and -collect -yourself -where -is -the -use -in -getting -excited -am -i -excited -there -is -nothing -to -get -excited -about -when -i -make -a -statement -which -i -cannot -prove -it -will -be -time -enough -for -you -to -begin -to -offer -hospitality -to -damaging -fancies -about -me -and -my -sanity -oh -a -thousand -thousand -pardons! -i -ought -to -be -ashamed -of -myself -and -i -am -ashamed -of -myself -for -thinking -that -a -little -bit -of -a -circumstance -like -sending -a -shark -to -england -to -fetch -back -a -market -report -what -does -your -middle -initial -stand -for -sir -andrew -what -are -you -writing -wait -a -moment -proof -about -the -shark -and -another -matter -only -ten -lines -there -now -it -is -done -sign -it -many -thanks -many -let -me -see -it -says -it -says -oh -come -this -is -interesting! -why -why -look -here! -prove -what -you -say -here -and -i'll -put -up -the -money -and -double -as -much -if -necessary -and -divide -the -winnings -with -you -half -and -half -there -now -i've -signed -make -your -promise -good -if -you -can -show -me -a -copy -of -the -london -times -only -ten -days -old -here -it -is -and -with -it -these -buttons -and -a -memorandum -book -that -belonged -to -the -man -the -shark -swallowed -swallowed -him -in -the -thames -without -a -doubt -for -you -will -notice -that -the -last -entry -in -the -book -is -dated -'london -' -and -is -of -the -same -date -as -the -times -and -says -'ber -confequentz -der -kreigeseflarun -reife -ich -heute -nach -deutchland -ab -aur -bak -ich -mein -leben -auf -dem -ultar -meines -landes -legen -mag' -as -clean -native -german -as -anybody -can -put -upon -paper -and -means -that -in -consequence -of -the -declaration -of -war -this -loyal -soul -is -leaving -for -home -to -day -to -fight -and -he -did -leave -too -but -the -shark -had -him -before -the -day -was -done -poor -fellow -and -a -pity -too -but -there -are -times -for -mourning -and -we -will -attend -to -this -case -further -on -other -matters -are -pressing -now -i -will -go -down -and -set -the -machinery -in -motion -in -a -quiet -way -and -buy -the -crop -it -will -cheer -the -drooping -spirits -of -the -boys -in -a -transitory -way -everything -is -transitory -in -this -world -sixty -days -hence -when -they -are -called -to -deliver -the -goods -they -will -think -they've -been -struck -by -lightning -but -there -is -a -time -for -mourning -and -we -will -attend -to -that -case -along -with -the -other -one -come -along -i'll -take -you -to -my -tailor -what -did -you -say -your -name -is -cecil -rhodes -it -is -hard -to -remember -however -i -think -you -will -make -it -easier -by -and -by -if -you -live -there -are -three -kinds -of -people -commonplace -men -remarkable -men -and -lunatics -i'll -classify -you -with -the -remarkables -and -take -the -chances -the -deal -went -through -and -secured -to -the -young -stranger -the -first -fortune -he -ever -pocketed -the -people -of -sydney -ought -to -be -afraid -of -the -sharks -but -for -some -reason -they -do -not -seem -to -be -on -saturdays -the -young -men -go -out -in -their -boats -and -sometimes -the -water -is -fairly -covered -with -the -little -sails -a -boat -upsets -now -and -then -by -accident -a -result -of -tumultuous -skylarking -sometimes -the -boys -upset -their -boat -for -fun -such -as -it -is -with -sharks -visibly -waiting -around -for -just -such -an -occurrence -the -young -fellows -scramble -aboard -whole -sometimes -not -always -tragedies -have -happened -more -than -once -while -i -was -in -sydney -it -was -reported -that -a -boy -fell -out -of -a -boat -in -the -mouth -of -the -paramatta -river -and -screamed -for -help -and -a -boy -jumped -overboard -from -another -boat -to -save -him -from -the -assembling -sharks -but -the -sharks -made -swift -work -with -the -lives -of -both -the -government -pays -a -bounty -for -the -shark -to -get -the -bounty -the -fishermen -bait -the -hook -or -the -seine -with -agreeable -mutton -the -news -spreads -and -the -sharks -come -from -all -over -the -pacific -ocean -to -get -the -free -board -in -time -the -shark -culture -will -be -one -of -the -most -successful -things -in -the -colony -chapter -xiv -we -can -secure -other -people's -approval -if -we -do -right -and -try -hard -but -our -own -is -worth -a -hundred -of -it -and -no -way -has -been -found -out -of -securing -that -pudd'nhead -wilson's -new -calendar -my -health -had -broken -down -in -new -york -in -may -it -had -remained -in -a -doubtful -but -fairish -condition -during -a -succeeding -period -of -82 -days -it -broke -again -on -the -pacific -it -broke -again -in -sydney -but -not -until -after -i -had -had -a -good -outing -and -had -also -filled -my -lecture -engagements -this -latest -break -lost -me -the -chance -of -seeing -queensland -in -the -circumstances -to -go -north -toward -hotter -weather -was -not -advisable -so -we -moved -south -with -a -westward -slant -17 -hours -by -rail -to -the -capital -of -the -colony -of -victoria -melbourne -that -juvenile -city -of -sixty -years -and -half -a -million -inhabitants -on -the -map -the -distance -looked -small -but -that -is -a -trouble -with -all -divisions -of -distance -in -such -a -vast -country -as -australia -the -colony -of -victoria -itself -looks -small -on -the -map -looks -like -a -county -in -fact -yet -it -is -about -as -large -as -england -scotland -and -wales -combined -or -to -get -another -focus -upon -it -it -is -just -80 -times -as -large -as -the -state -of -rhode -island -and -one -third -as -large -as -the -state -of -texas -outside -of -melbourne -victoria -seems -to -be -owned -by -a -handful -of -squatters -each -with -a -rhode -island -for -a -sheep -farm -that -is -the -impression -which -one -gathers -from -common -talk -yet -the -wool -industry -of -victoria -is -by -no -means -so -great -as -that -of -new -south -wales -the -climate -of -victoria -is -favorable -to -other -great -industries -among -others -wheat -growing -and -the -making -of -wine -we -took -the -train -at -sydney -at -about -four -in -the -afternoon -it -was -american -in -one -way -for -we -had -a -most -rational -sleeping -car -also -the -car -was -clean -and -fine -and -new -nothing -about -it -to -suggest -the -rolling -stock -of -the -continent -of -europe -but -our -baggage -was -weighed -and -extra -weight -charged -for -that -was -continental -continental -and -troublesome -any -detail -of -railroading -that -is -not -troublesome -cannot -honorably -be -described -as -continental -the -tickets -were -round -trip -ones -to -melbourne -and -clear -to -adelaide -in -south -australia -and -then -all -the -way -back -to -sydney -twelve -hundred -more -miles -than -we -really -expected -to -make -but -then -as -the -round -trip -wouldn't -cost -much -more -than -the -single -trip -it -seemed -well -enough -to -buy -as -many -miles -as -one -could -afford -even -if -one -was -not -likely -to -need -them -a -human -being -has -a -natural -desire -to -have -more -of -a -good -thing -than -he -needs -now -comes -a -singular -thing -the -oddest -thing -the -strangest -thing -the -most -baffling -and -unaccountable -marvel -that -australasia -can -show -at -the -frontier -between -new -south -wales -and -victoria -our -multitude -of -passengers -were -routed -out -of -their -snug -beds -by -lantern -light -in -the -morning -in -the -biting -cold -of -a -high -altitude -to -change -cars -on -a -road -that -has -no -break -in -it -from -sydney -to -melbourne! -think -of -the -paralysis -of -intellect -that -gave -that -idea -birth -imagine -the -boulder -it -emerged -from -on -some -petrified -legislator's -shoulders -it -is -a -narrow -gage -road -to -the -frontier -and -a -broader -gauge -thence -to -melbourne -the -two -governments -were -the -builders -of -the -road -and -are -the -owners -of -it -one -or -two -reasons -are -given -for -this -curious -state -of -things -one -is -that -it -represents -the -jealousy -existing -between -the -colonies -the -two -most -important -colonies -of -australasia -what -the -other -one -is -i -have -forgotten -but -it -is -of -no -consequence -it -could -be -but -another -effort -to -explain -the -inexplicable -all -passengers -fret -at -the -double -gauge -all -shippers -of -freight -must -of -course -fret -at -it -unnecessary -expense -delay -and -annoyance -are -imposed -upon -everybody -concerned -and -no -one -is -benefitted -each -australian -colony -fences -itself -off -from -its -neighbor -with -a -custom -house -personally -i -have -no -objection -but -it -must -be -a -good -deal -of -inconvenience -to -the -people -we -have -something -resembling -it -here -and -there -in -america -but -it -goes -by -another -name -the -large -empire -of -the -pacific -coast -requires -a -world -of -iron -machinery -and -could -manufacture -it -economically -on -the -spot -if -the -imposts -on -foreign -iron -were -removed -but -they -are -not -protection -to -pennsylvania -and -alabama -forbids -it -the -result -to -the -pacific -coast -is -the -same -as -if -there -were -several -rows -of -custom -fences -between -the -coast -and -the -east -iron -carted -across -the -american -continent -at -luxurious -railway -rates -would -be -valuable -enough -to -be -coined -when -it -arrived -we -changed -cars -this -was -at -albury -and -it -was -there -i -think -that -the -growing -day -and -the -early -sun -exposed -the -distant -range -called -the -blue -mountains -accurately -named -my -word! -as -the -australians -say -but -it -was -a -stunning -color -that -blue -deep -strong -rich -exquisite -towering -and -majestic -masses -of -blue -a -softly -luminous -blue -a -smouldering -blue -as -if -vaguely -lit -by -fires -within -it -extinguished -the -blue -of -the -sky -made -it -pallid -and -unwholesome -whitey -and -washed -out -a -wonderful -color -just -divine -a -resident -told -me -that -those -were -not -mountains -he -said -they -were -rabbit -piles -and -explained -that -long -exposure -and -the -over -ripe -condition -of -the -rabbits -was -what -made -them -look -so -blue -this -man -may -have -been -right -but -much -reading -of -books -of -travel -has -made -me -distrustful -of -gratis -information -furnished -by -unofficial -residents -of -a -country -the -facts -which -such -people -give -to -travelers -are -usually -erroneous -and -often -intemperately -so -the -rabbit -plague -has -indeed -been -very -bad -in -australia -and -it -could -account -for -one -mountain -but -not -for -a -mountain -range -it -seems -to -me -it -is -too -large -an -order -we -breakfasted -at -the -station -a -good -breakfast -except -the -coffee -and -cheap -the -government -establishes -the -prices -and -placards -them -the -waiters -were -men -i -think -but -that -is -not -usual -in -australasia -the -usual -thing -is -to -have -girls -no -not -girls -young -ladies -generally -duchesses -dress -they -would -attract -attention -at -any -royal -levee -in -europe -even -empresses -and -queens -do -not -dress -as -they -do -not -that -they -could -not -afford -it -perhaps -but -they -would -not -know -how -all -the -pleasant -morning -we -slid -smoothly -along -over -the -plains -through -thin -not -thick -forests -of -great -melancholy -gum -trees -with -trunks -rugged -with -curled -sheets -of -flaking -bark -erysipelas -convalescents -so -to -speak -shedding -their -dead -skins -and -all -along -were -tiny -cabins -built -sometimes -of -wood -sometimes -of -gray -blue -corrugated -iron -and -the -doorsteps -and -fences -were -clogged -with -children -rugged -little -simply -clad -chaps -that -looked -as -if -they -had -been -imported -from -the -banks -of -the -mississippi -without -breaking -bulk -and -there -were -little -villages -with -neat -stations -well -placarded -with -showy -advertisements -mainly -of -almost -too -self -righteous -brands -of -sheepdip -if -that -is -the -name -and -i -think -it -is -it -is -a -stuff -like -tar -and -is -dabbed -on -to -places -where -the -shearer -clips -a -piece -out -of -the -sheep -it -bars -out -the -flies -and -has -healing -properties -and -a -nip -to -it -which -makes -the -sheep -skip -like -the -cattle -on -a -thousand -hills -it -is -not -good -to -eat -that -is -it -is -not -good -to -eat -except -when -mixed -with -railroad -coffee -it -improves -railroad -coffee -without -it -railroad -coffee -is -too -vague -but -with -it -it -is -quite -assertive -and -enthusiastic -by -itself -railroad -coffee -is -too -passive -but -sheep -dip -makes -it -wake -up -and -get -down -to -business -i -wonder -where -they -get -railroad -coffee -we -saw -birds -but -not -a -kangaroo -not -an -emu -not -an -ornithorhynchus -not -a -lecturer -not -a -native -indeed -the -land -seemed -quite -destitute -of -game -but -i -have -misused -the -word -native -in -australia -it -is -applied -to -australian -born -whites -only -i -should -have -said -that -we -saw -no -aboriginals -no -blackfellows -and -to -this -day -i -have -never -seen -one -in -the -great -museums -you -will -find -all -the -other -curiosities -but -in -the -curio -of -chiefest -interest -to -the -stranger -all -of -them -are -lacking -we -have -at -home -an -abundance -of -museums -and -not -an -american -indian -in -them -it -is -clearly -an -absurdity -but -it -never -struck -me -before -chapter -xv -truth -is -stranger -than -fiction -to -some -people -but -i -am -measurably -familiar -with -it -pudd'nhead -wilson's -new -calendar -truth -is -stranger -than -fiction -but -it -is -because -fiction -is -obliged -to -stick -to -possibilities -truth -isn't -pudd'nhead -wilson's -new -calendar -the -air -was -balmy -and -delicious -the -sunshine -radiant -it -was -a -charming -excursion -in -the -course -of -it -we -came -to -a -town -whose -odd -name -was -famous -all -over -the -world -a -quarter -of -a -century -ago -wagga -wagga -this -was -because -the -tichborne -claimant -had -kept -a -butcher -shop -there -it -was -out -of -the -midst -of -his -humble -collection -of -sausages -and -tripe -that -he -soared -up -into -the -zenith -of -notoriety -and -hung -there -in -the -wastes -of -space -a -time -with -the -telescopes -of -all -nations -leveled -at -him -in -unappeasable -curiosity -curiosity -as -to -which -of -the -two -long -missing -persons -he -was -arthur -orton -the -mislaid -roustabout -of -wapping -or -sir -roger -tichborne -the -lost -heir -of -a -name -and -estates -as -old -as -english -history -we -all -know -now -but -not -a -dozen -people -knew -then -and -the -dozen -kept -the -mystery -to -themselves -and -allowed -the -most -intricate -and -fascinating -and -marvelous -real -life -romance -that -has -ever -been -played -upon -the -world's -stage -to -unfold -itself -serenely -act -by -act -in -a -british -court -by -the -long -and -laborious -processes -of -judicial -development -when -we -recall -the -details -of -that -great -romance -we -marvel -to -see -what -daring -chances -truth -may -freely -take -in -constructing -a -tale -as -compared -with -the -poor -little -conservative -risks -permitted -to -fiction -the -fiction -artist -could -achieve -no -success -with -the -materials -of -this -splendid -tichborne -romance -he -would -have -to -drop -out -the -chief -characters -the -public -would -say -such -people -are -impossible -he -would -have -to -drop -out -a -number -of -the -most -picturesque -incidents -the -public -would -say -such -things -could -never -happen -and -yet -the -chief -characters -did -exist -and -the -incidents -did -happen -it -cost -the -tichborne -estates -$400 -000 -to -unmask -the -claimant -and -drive -him -out -and -even -after -the -exposure -multitudes -of -englishmen -still -believed -in -him -it -cost -the -british -government -another -$400 -000 -to -convict -him -of -perjury -and -after -the -conviction -the -same -old -multitudes -still -believed -in -him -and -among -these -believers -were -many -educated -and -intelligent -men -and -some -of -them -had -personally -known -the -real -sir -roger -the -claimant -was -sentenced -to -14 -years' -imprisonment -when -he -got -out -of -prison -he -went -to -new -york -and -kept -a -whisky -saloon -in -the -bowery -for -a -time -then -disappeared -from -view -he -always -claimed -to -be -sir -roger -tichborne -until -death -called -for -him -this -was -but -a -few -months -ago -not -very -much -short -of -a -generation -since -he -left -wagga -wagga -to -go -and -possess -himself -of -his -estates -on -his -death -bed -he -yielded -up -his -secret -and -confessed -in -writing -that -he -was -only -arthur -orton -of -wapping -able -seaman -and -butcher -that -and -nothing -more -but -it -is -scarcely -to -be -doubted -that -there -are -people -whom -even -his -dying -confession -will -not -convince -the -old -habit -of -assimilating -incredibilities -must -have -made -strong -food -a -necessity -in -their -case -a -weaker -article -would -probably -disagree -with -them -i -was -in -london -when -the -claimant -stood -his -trial -for -perjury -i -attended -one -of -his -showy -evenings -in -the -sumptuous -quarters -provided -for -him -from -the -purses -of -his -adherents -and -well -wishers -he -was -in -evening -dress -and -i -thought -him -a -rather -fine -and -stately -creature -there -were -about -twenty -five -gentlemen -present -educated -men -men -moving -in -good -society -none -of -them -commonplace -some -of -them -were -men -of -distinction -none -of -them -were -obscurities -they -were -his -cordial -friends -and -admirers -it -was -sir -roger -always -sir -roger -on -all -hands -no -one -withheld -the -title -all -turned -it -from -the -tongue -with -unction -and -as -if -it -tasted -good -for -many -years -i -had -had -a -mystery -in -stock -melbourne -and -only -melbourne -could -unriddle -it -for -me -in -1873 -i -arrived -in -london -with -my -wife -and -young -child -and -presently -received -a -note -from -naples -signed -by -a -name -not -familiar -to -me -it -was -not -bascom -and -it -was -not -henry -but -i -will -call -it -henry -bascom -for -convenience's -sake -this -note -of -about -six -lines -was -written -on -a -strip -of -white -paper -whose -end -edges -were -ragged -i -came -to -be -familiar -with -those -strips -in -later -years -their -size -and -pattern -were -always -the -same -their -contents -were -usually -to -the -same -effect -would -i -and -mine -come -to -the -writer's -country -place -in -england -on -such -and -such -a -date -by -such -and -such -a -train -and -stay -twelve -days -and -depart -by -such -and -such -a -train -at -the -end -of -the -specified -time -a -carriage -would -meet -us -at -the -station -these -invitations -were -always -for -a -long -time -ahead -if -we -were -in -europe -three -months -ahead -if -we -were -in -america -six -to -twelve -months -ahead -they -always -named -the -exact -date -and -train -for -the -beginning -and -also -for -the -end -of -the -visit -this -first -note -invited -us -for -a -date -three -months -in -the -future -it -asked -us -to -arrive -by -the -4 -10 -p -m -train -from -london -august -6th -the -carriage -would -be -waiting -the -carriage -would -take -us -away -seven -days -later -train -specified -and -there -were -these -words -speak -to -tom -hughes -i -showed -the -note -to -the -author -of -tom -brown -at -rugby -and -be -said -accept -and -be -thankful -he -described -mr -bascom -as -being -a -man -of -genius -a -man -of -fine -attainments -a -choice -man -in -every -way -a -rare -and -beautiful -character -he -said -that -bascom -hall -was -a -particularly -fine -example -of -the -stately -manorial -mansion -of -elizabeth's -days -and -that -it -was -a -house -worth -going -a -long -way -to -see -like -knowle -that -mr -b -was -of -a -social -disposition -liked -the -company -of -agreeable -people -and -always -had -samples -of -the -sort -coming -and -going -we -paid -the -visit -we -paid -others -in -later -years -the -last -one -in -1879 -soon -after -that -mr -bascom -started -on -a -voyage -around -the -world -in -a -steam -yacht -a -long -and -leisurely -trip -for -he -was -making -collections -in -all -lands -of -birds -butterflies -and -such -things -the -day -that -president -garfield -was -shot -by -the -assassin -guiteau -we -were -at -a -little -watering -place -on -long -island -sound -and -in -the -mail -matter -of -that -day -came -a -letter -with -the -melbourne -post -mark -on -it -it -was -for -my -wife -but -i -recognized -mr -bascom's -handwriting -on -the -envelope -and -opened -it -it -was -the -usual -note -as -to -paucity -of -lines -and -was -written -on -the -customary -strip -of -paper -but -there -was -nothing -usual -about -the -contents -the -note -informed -my -wife -that -if -it -would -be -any -assuagement -of -her -grief -to -know -that -her -husband's -lecture -tour -in -australia -was -a -satisfactory -venture -from -the -beginning -to -the -end -he -the -writer -could -testify -that -such -was -the -case -also -that -her -husband's -untimely -death -had -been -mourned -by -all -classes -as -she -would -already -know -by -the -press -telegrams -long -before -the -reception -of -this -note -that -the -funeral -was -attended -by -the -officials -of -the -colonial -and -city -governments -and -that -while -he -the -writer -her -friend -and -mine -had -not -reached -melbourne -in -time -to -see -the -body -he -had -at -least -had -the -sad -privilege -of -acting -as -one -of -the -pall -bearers -signed -henry -bascom -my -first -thought -was -why -didn't -he -have -the -coffin -opened -he -would -have -seen -that -the -corpse -was -an -imposter -and -he -could -have -gone -right -ahead -and -dried -up -the -most -of -those -tears -and -comforted -those -sorrowing -governments -and -sold -the -remains -and -sent -me -the -money -i -did -nothing -about -the -matter -i -had -set -the -law -after -living -lecture -doubles -of -mine -a -couple -of -times -in -america -and -the -law -had -not -been -able -to -catch -them -others -in -my -trade -had -tried -to -catch -their -impostor -doubles -and -had -failed -then -where -was -the -use -in -harrying -a -ghost -none -and -so -i -did -not -disturb -it -i -had -a -curiosity -to -know -about -that -man's -lecture -tour -and -last -moments -but -that -could -wait -when -i -should -see -mr -bascom -he -would -tell -me -all -about -it -but -he -passed -from -life -and -i -never -saw -him -again -my -curiosity -faded -away -however -when -i -found -that -i -was -going -to -australia -it -revived -and -naturally -for -if -the -people -should -say -that -i -was -a -dull -poor -thing -compared -to -what -i -was -before -i -died -it -would -have -a -bad -effect -on -business -well -to -my -surprise -the -sydney -journalists -had -never -heard -of -that -impostor! -i -pressed -them -but -they -were -firm -they -had -never -heard -of -him -and -didn't -believe -in -him -i -could -not -understand -it -still -i -thought -it -would -all -come -right -in -melbourne -the -government -would -remember -and -the -other -mourners -at -the -supper -of -the -institute -of -journalists -i -should -find -out -all -about -the -matter -but -no -it -turned -out -that -they -had -never -heard -of -it -so -my -mystery -was -a -mystery -still -it -was -a -great -disappointment -i -believed -it -would -never -be -cleared -up -in -this -life -so -i -dropped -it -out -of -my -mind -but -at -last! -just -when -i -was -least -expecting -it -however -this -is -not -the -place -for -the -rest -of -it -i -shall -come -to -the -matter -again -in -a -far -distant -chapter -chapter -xvi -there -is -a -moral -sense -and -there -is -an -immoral -sense -history -shows -us -that -the -moral -sense -enables -us -to -perceive -morality -and -how -to -avoid -it -and -that -the -immoral -sense -enables -us -to -perceive -immorality -and -how -to -enjoy -it -pudd'nhead -wilson's -new -calendar -melbourne -spreads -around -over -an -immense -area -of -ground -it -is -a -stately -city -architecturally -as -well -as -in -magnitude -it -has -an -elaborate -system -of -cable -car -service -it -has -museums -and -colleges -and -schools -and -public -gardens -and -electricity -and -gas -and -libraries -and -theaters -and -mining -centers -and -wool -centers -and -centers -of -the -arts -and -sciences -and -boards -of -trade -and -ships -and -railroads -and -a -harbor -and -social -clubs -and -journalistic -clubs -and -racing -clubs -and -a -squatter -club -sumptuously -housed -and -appointed -and -as -many -churches -and -banks -as -can -make -a -living -in -a -word -it -is -equipped -with -everything -that -goes -to -make -the -modern -great -city -it -is -the -largest -city -of -australasia -and -fills -the -post -with -honor -and -credit -it -has -one -specialty -this -must -not -be -jumbled -in -with -those -other -things -it -is -the -mitred -metropolitan -of -the -horse -racing -cult -its -race -ground -is -the -mecca -of -australasia -on -the -great -annual -day -of -sacrifice -the -5th -of -november -guy -fawkes's -day -business -is -suspended -over -a -stretch -of -land -and -sea -as -wide -as -from -new -york -to -san -francisco -and -deeper -than -from -the -northern -lakes -to -the -gulf -of -mexico -and -every -man -and -woman -of -high -degree -or -low -who -can -afford -the -expense -put -away -their -other -duties -and -come -they -begin -to -swarm -in -by -ship -and -rail -a -fortnight -before -the -day -and -they -swarm -thicker -and -thicker -day -after -day -until -all -the -vehicles -of -transportation -are -taxed -to -their -uttermost -to -meet -the -demands -of -the -occasion -and -all -hotels -and -lodgings -are -bulging -outward -because -of -the -pressure -from -within -they -come -a -hundred -thousand -strong -as -all -the -best -authorities -say -and -they -pack -the -spacious -grounds -and -grandstands -and -make -a -spectacle -such -as -is -never -to -be -seen -in -australasia -elsewhere -it -is -the -melbourne -cup -that -brings -this -multitude -together -their -clothes -have -been -ordered -long -ago -at -unlimited -cost -and -without -bounds -as -to -beauty -and -magnificence -and -have -been -kept -in -concealment -until -now -for -unto -this -day -are -they -consecrate -i -am -speaking -of -the -ladies' -clothes -but -one -might -know -that -and -so -the -grand -stands -make -a -brilliant -and -wonderful -spectacle -a -delirium -of -color -a -vision -of -beauty -the -champagne -flows -everybody -is -vivacious -excited -happy -everybody -bets -and -gloves -and -fortunes -change -hands -right -along -all -the -time -day -after -day -the -races -go -on -and -the -fun -and -the -excitement -are -kept -at -white -heat -and -when -each -day -is -done -the -people -dance -all -night -so -as -to -be -fresh -for -the -race -in -the -morning -and -at -the -end -of -the -great -week -the -swarms -secure -lodgings -and -transportation -for -next -year -then -flock -away -to -their -remote -homes -and -count -their -gains -and -losses -and -order -next -year's -cup -clothes -and -then -lie -down -and -sleep -two -weeks -and -get -up -sorry -to -reflect -that -a -whole -year -must -be -put -in -somehow -or -other -before -they -can -be -wholly -happy -again -the -melbourne -cup -is -the -australasian -national -day -it -would -be -difficult -to -overstate -its -importance -it -overshadows -all -other -holidays -and -specialized -days -of -whatever -sort -in -that -congeries -of -colonies -overshadows -them -i -might -almost -say -it -blots -them -out -each -of -them -gets -attention -but -not -everybody's -each -of -them -evokes -interest -but -not -everybody's -each -of -them -rouses -enthusiasm -but -not -everybody's -in -each -case -a -part -of -the -attention -interest -and -enthusiasm -is -a -matter -of -habit -and -custom -and -another -part -of -it -is -official -and -perfunctory -cup -day -and -cup -day -only -commands -an -attention -an -interest -and -an -enthusiasm -which -are -universal -and -spontaneous -not -perfunctory -cup -day -is -supreme -it -has -no -rival -i -can -call -to -mind -no -specialized -annual -day -in -any -country -which -can -be -named -by -that -large -name -supreme -i -can -call -to -mind -no -specialized -annual -day -in -any -country -whose -approach -fires -the -whole -land -with -a -conflagration -of -conversation -and -preparation -and -anticipation -and -jubilation -no -day -save -this -one -but -this -one -does -it -in -america -we -have -no -annual -supreme -day -no -day -whose -approach -makes -the -whole -nation -glad -we -have -the -fourth -of -july -and -christmas -and -thanksgiving -neither -of -them -can -claim -the -primacy -neither -of -them -can -arouse -an -enthusiasm -which -comes -near -to -being -universal -eight -grown -americans -out -of -ten -dread -the -coming -of -the -fourth -with -its -pandemonium -and -its -perils -and -they -rejoice -when -it -is -gone -if -still -alive -the -approach -of -christmas -brings -harassment -and -dread -to -many -excellent -people -they -have -to -buy -a -cart -load -of -presents -and -they -never -know -what -to -buy -to -hit -the -various -tastes -they -put -in -three -weeks -of -hard -and -anxious -work -and -when -christmas -morning -comes -they -are -so -dissatisfied -with -the -result -and -so -disappointed -that -they -want -to -sit -down -and -cry -then -they -give -thanks -that -christmas -comes -but -once -a -year -the -observance -of -thanksgiving -day -as -a -function -has -become -general -of -late -years -the -thankfulness -is -not -so -general -this -is -natural -two -thirds -of -the -nation -have -always -had -hard -luck -and -a -hard -time -during -the -year -and -this -has -a -calming -effect -upon -their -enthusiasm -we -have -a -supreme -day -a -sweeping -and -tremendous -and -tumultuous -day -a -day -which -commands -an -absolute -universality -of -interest -and -excitement -but -it -is -not -annual -it -comes -but -once -in -four -years -therefore -it -cannot -count -as -a -rival -of -the -melbourne -cup -in -great -britain -and -ireland -they -have -two -great -days -christmas -and -the -queen's -birthday -but -they -are -equally -popular -there -is -no -supremacy -i -think -it -must -be -conceded -that -the -position -of -the -australasian -day -is -unique -solitary -unfellowed -and -likely -to -hold -that -high -place -a -long -time -the -next -things -which -interest -us -when -we -travel -are -first -the -people -next -the -novelties -and -finally -the -history -of -the -places -and -countries -visited -novelties -are -rare -in -cities -which -represent -the -most -advanced -civilization -of -the -modern -day -when -one -is -familiar -with -such -cities -in -the -other -parts -of -the -world -he -is -in -effect -familiar -with -the -cities -of -australasia -the -outside -aspects -will -furnish -little -that -is -new -there -will -be -new -names -but -the -things -which -they -represent -will -sometimes -be -found -to -be -less -new -than -their -names -there -may -be -shades -of -difference -but -these -can -easily -be -too -fine -for -detection -by -the -incompetent -eye -of -the -passing -stranger -in -the -larrikin -he -will -not -be -able -to -discover -a -new -species -but -only -an -old -one -met -elsewhere -and -variously -called -loafer -rough -tough -bummer -or -blatherskite -according -to -his -geographical -distribution -the -larrikin -differs -by -a -shade -from -those -others -in -that -he -is -more -sociable -toward -the -stranger -than -they -more -kindly -disposed -more -hospitable -more -hearty -more -friendly -at -least -it -seemed -so -to -me -and -i -had -opportunity -to -observe -in -sydney -at -least -in -melbourne -i -had -to -drive -to -and -from -the -lecture -theater -but -in -sydney -i -was -able -to -walk -both -ways -and -did -it -every -night -on -my -way -home -at -ten -or -a -quarter -past -i -found -the -larrikin -grouped -in -considerable -force -at -several -of -the -street -corners -and -he -always -gave -me -this -pleasant -salutation -hello -mark! -here's -to -you -old -chap! -say -mark! -is -he -dead -a -reference -to -a -passage -in -some -book -of -mine -though -i -did -not -detect -at -that -time -that -that -was -its -source -and -i -didn't -detect -it -afterward -in -melbourne -when -i -came -on -the -stage -for -the -first -time -and -the -same -question -was -dropped -down -upon -me -from -the -dizzy -height -of -the -gallery -it -is -always -difficult -to -answer -a -sudden -inquiry -like -that -when -you -have -come -unprepared -and -don't -know -what -it -means -i -will -remark -here -if -it -is -not -an -indecorum -that -the -welcome -which -an -american -lecturer -gets -from -a -british -colonial -audience -is -a -thing -which -will -move -him -to -his -deepest -deeps -and -veil -his -sight -and -break -his -voice -and -from -winnipeg -to -africa -experience -will -teach -him -nothing -he -will -never -learn -to -expect -it -it -will -catch -him -as -a -surprise -each -time -the -war -cloud -hanging -black -over -england -and -america -made -no -trouble -for -me -i -was -a -prospective -prisoner -of -war -but -at -dinners -suppers -on -the -platform -and -elsewhere -there -was -never -anything -to -remind -me -of -it -this -was -hospitality -of -the -right -metal -and -would -have -been -prominently -lacking -in -some -countries -in -the -circumstances -and -speaking -of -the -war -flurry -it -seemed -to -me -to -bring -to -light -the -unexpected -in -a -detail -or -two -it -seemed -to -relegate -the -war -talk -to -the -politicians -on -both -sides -of -the -water -whereas -whenever -a -prospective -war -between -two -nations -had -been -in -the -air -theretofore -the -public -had -done -most -of -the -talking -and -the -bitterest -the -attitude -of -the -newspapers -was -new -also -i -speak -of -those -of -australasia -and -india -for -i -had -access -to -those -only -they -treated -the -subject -argumentatively -and -with -dignity -not -with -spite -and -anger -that -was -a -new -spirit -too -and -not -learned -of -the -french -and -german -press -either -before -sedan -or -since -i -heard -many -public -speeches -and -they -reflected -the -moderation -of -the -journals -the -outlook -is -that -the -english -speaking -race -will -dominate -the -earth -a -hundred -years -from -now -if -its -sections -do -not -get -to -fighting -each -other -it -would -be -a -pity -to -spoil -that -prospect -by -baffling -and -retarding -wars -when -arbitration -would -settle -their -differences -so -much -better -and -also -so -much -more -definitely -no -as -i -have -suggested -novelties -are -rare -in -the -great -capitals -of -modern -times -even -the -wool -exchange -in -melbourne -could -not -be -told -from -the -familiar -stock -exchange -of -other -countries -wool -brokers -are -just -like -stockbrokers -they -all -bounce -from -their -seats -and -put -up -their -hands -and -yell -in -unison -no -stranger -can -tell -what -and -the -president -calmly -says -sold -to -smith -& -co -threpence -farthing -next! -when -probably -nothing -of -the -kind -happened -for -how -should -he -know -in -the -museums -you -will -find -acres -of -the -most -strange -and -fascinating -things -but -all -museums -are -fascinating -and -they -do -so -tire -your -eyes -and -break -your -back -and -burn -out -your -vitalities -with -their -consuming -interest -you -always -say -you -will -never -go -again -but -you -do -go -the -palaces -of -the -rich -in -melbourne -are -much -like -the -palaces -of -the -rich -in -america -and -the -life -in -them -is -the -same -but -there -the -resemblance -ends -the -grounds -surrounding -the -american -palace -are -not -often -large -and -not -often -beautiful -but -in -the -melbourne -case -the -grounds -are -often -ducally -spacious -and -the -climate -and -the -gardeners -together -make -them -as -beautiful -as -a -dream -it -is -said -that -some -of -the -country -seats -have -grounds -domains -about -them -which -rival -in -charm -and -magnitude -those -which -surround -the -country -mansion -of -an -english -lord -but -i -was -not -out -in -the -country -i -had -my -hands -full -in -town -and -what -was -the -origin -of -this -majestic -city -and -its -efflorescence -of -palatial -town -houses -and -country -seats -its -first -brick -was -laid -and -its -first -house -built -by -a -passing -convict -australian -history -is -almost -always -picturesque -indeed -it -is -so -curious -and -strange -that -it -is -itself -the -chiefest -novelty -the -country -has -to -offer -and -so -it -pushes -the -other -novelties -into -second -and -third -place -it -does -not -read -like -history -but -like -the -most -beautiful -lies -and -all -of -a -fresh -new -sort -no -mouldy -old -stale -ones -it -is -full -of -surprises -and -adventures -and -incongruities -and -contradictions -and -incredibilities -but -they -are -all -true -they -all -happened -chapter -xvii -the -english -are -mentioned -in -the -bible -blessed -are -the -meek -for -they -shall -inherit -the -earth -pudd'nhead -wilson's -new -calendar -when -we -consider -the -immensity -of -the -british -empire -in -territory -population -and -trade -it -requires -a -stern -exercise -of -faith -to -believe -in -the -figures -which -represent -australasia's -contribution -to -the -empire's -commercial -grandeur -as -compared -with -the -landed -estate -of -the -british -empire -the -landed -estate -dominated -by -any -other -power -except -one -russia -is -not -very -impressive -for -size -my -authorities -make -the -british -empire -not -much -short -of -a -fourth -larger -than -the -russian -empire -roughly -proportioned -if -you -will -allow -your -entire -hand -to -represent -the -british -empire -you -may -then -cut -off -the -fingers -a -trifle -above -the -middle -joint -of -the -middle -finger -and -what -is -left -of -the -hand -will -represent -russia -the -populations -ruled -by -great -britain -and -china -are -about -the -same -400 -000 -000 -each -no -other -power -approaches -these -figures -even -russia -is -left -far -behind -the -population -of -australasia -4 -000 -000 -sinks -into -nothingness -and -is -lost -from -sight -in -that -british -ocean -of -400 -000 -000 -yet -the -statistics -indicate -that -it -rises -again -and -shows -up -very -conspicuously -when -its -share -of -the -empire's -commerce -is -the -matter -under -consideration -the -value -of -england's -annual -exports -and -imports -is -stated -at -three -billions -of -dollars -[new -south -wales -blue -book -] -and -it -is -claimed -that -more -than -one -tenth -of -this -great -aggregate -is -represented -by -australasia's -exports -to -england -and -imports -from -england -in -addition -to -this -australasia -does -a -trade -with -countries -other -than -england -amounting -to -a -hundred -million -dollars -a -year -and -a -domestic -intercolonial -trade -amounting -to -a -hundred -and -fifty -millions -in -round -numbers -the -4 -000 -000 -buy -and -sell -about -$600 -000 -000 -worth -of -goods -a -year -it -is -claimed -that -about -half -of -this -represents -commodities -of -australasian -production -the -products -exported -annually -by -india -are -worth -a -trifle -over -$500 -000 -000 -now -here -are -some -faith -straining -figures -indian -production -300 -000 -000 -population -$500 -000 -000 -australasian -production -4 -000 -000 -population -$300 -000 -000 -that -is -to -say -the -product -of -the -individual -indian -annually -for -export -some -whither -is -worth -$1 -15 -that -of -the -individual -australasian -for -export -some -whither -$75! -or -to -put -it -in -another -way -the -indian -family -of -man -and -wife -and -three -children -sends -away -an -annual -result -worth -$8 -75 -while -the -australasian -family -sends -away -$375 -worth -there -are -trustworthy -statistics -furnished -by -sir -richard -temple -and -others -which -show -that -the -individual -indian's -whole -annual -product -both -for -export -and -home -use -is -worth -in -gold -only -$7 -50 -or -$37 -50 -for -the -family -aggregate -ciphered -out -on -a -like -ratio -of -multiplication -the -australasian -family's -aggregate -production -would -be -nearly -$1 -600 -truly -nothing -is -so -astonishing -as -figures -if -they -once -get -started -we -left -melbourne -by -rail -for -adelaide -the -capital -of -the -vast -province -of -south -australia -a -seventeen -hour -excursion -on -the -train -we -found -several -sydney -friends -among -them -a -judge -who -was -going -out -on -circuit -and -was -going -to -hold -court -at -broken -hill -where -the -celebrated -silver -mine -is -it -seemed -a -curious -road -to -take -to -get -to -that -region -broken -hill -is -close -to -the -western -border -of -new -south -wales -and -sydney -is -on -the -eastern -border -a -fairly -straight -line -700 -miles -long -drawn -westward -from -sydney -would -strike -broken -hill -just -as -a -somewhat -shorter -one -drawn -west -from -boston -would -strike -buffalo -the -way -the -judge -was -traveling -would -carry -him -over -2 -000 -miles -by -rail -he -said -southwest -from -sydney -down -to -melbourne -then -northward -up -to -adelaide -then -a -cant -back -northeastward -and -over -the -border -into -new -south -wales -once -more -to -broken -hill -it -was -like -going -from -boston -southwest -to -richmond -virginia -then -northwest -up -to -erie -pennsylvania -then -a -cant -back -northeast -and -over -the -border -to -buffalo -new -york -but -the -explanation -was -simple -years -ago -the -fabulously -rich -silver -discovery -at -broken -hill -burst -suddenly -upon -an -unexpectant -world -its -stocks -started -at -shillings -and -went -by -leaps -and -bounds -to -the -most -fanciful -figures -it -was -one -of -those -cases -where -the -cook -puts -a -month's -wages -into -shares -and -comes -next -mouth -and -buys -your -house -at -your -own -price -and -moves -into -it -herself -where -the -coachman -takes -a -few -shares -and -next -month -sets -up -a -bank -and -where -the -common -sailor -invests -the -price -of -a -spree -and -next -month -buys -out -the -steamship -company -and -goes -into -business -on -his -own -hook -in -a -word -it -was -one -of -those -excitements -which -bring -multitudes -of -people -to -a -common -center -with -a -rush -and -whose -needs -must -be -supplied -and -at -once -adelaide -was -close -by -sydney -was -far -away -adelaide -threw -a -short -railway -across -the -border -before -sydney -had -time -to -arrange -for -a -long -one -it -was -not -worth -while -for -sydney -to -arrange -at -all -the -whole -vast -trade -profit -of -broken -hill -fell -into -adelaide's -hands -irrevocably -new -south -wales -furnishes -for -broken -hill -and -sends -her -judges -2 -000 -miles -mainly -through -alien -countries -to -administer -it -but -adelaide -takes -the -dividends -and -makes -no -moan -we -started -at -4 -20 -in -the -afternoon -and -moved -across -level -until -night -in -the -morning -we -had -a -stretch -of -scrub -country -the -kind -of -thing -which -is -so -useful -to -the -australian -novelist -in -the -scrub -the -hostile -aboriginal -lurks -and -flits -mysteriously -about -slipping -out -from -time -to -time -to -surprise -and -slaughter -the -settler -then -slipping -back -again -and -leaving -no -track -that -the -white -man -can -follow -in -the -scrub -the -novelist's -heroine -gets -lost -search -fails -of -result -she -wanders -here -and -there -and -finally -sinks -down -exhausted -and -unconscious -and -the -searchers -pass -within -a -yard -or -two -of -her -not -suspecting -that -she -is -near -and -by -and -by -some -rambler -finds -her -bones -and -the -pathetic -diary -which -she -had -scribbled -with -her -failing -hand -and -left -behind -nobody -can -find -a -lost -heroine -in -the -scrub -but -the -aboriginal -tracker -and -he -will -not -lend -himself -to -the -scheme -if -it -will -interfere -with -the -novelist's -plot -the -scrub -stretches -miles -and -miles -in -all -directions -and -looks -like -a -level -roof -of -bush -tops -without -a -break -or -a -crack -in -it -as -seamless -as -a -blanket -to -all -appearance -one -might -as -well -walk -under -water -and -hope -to -guess -out -a -route -and -stick -to -it -i -should -think -yet -it -is -claimed -that -the -aboriginal -tracker -was -able -to -hunt -out -people -lost -in -the -scrub -also -in -the -bush -also -in -the -desert -and -even -follow -them -over -patches -of -bare -rocks -and -over -alluvial -ground -which -had -to -all -appearance -been -washed -clear -of -footprints -from -reading -australian -books -and -talking -with -the -people -i -became -convinced -that -the -aboriginal -tracker's -performances -evince -a -craft -a -penetration -a -luminous -sagacity -and -a -minuteness -and -accuracy -of -observation -in -the -matter -of -detective -work -not -found -in -nearly -so -remarkable -a -degree -in -any -other -people -white -or -colored -in -an -official -account -of -the -blacks -of -australia -published -by -the -government -of -victoria -one -reads -that -the -aboriginal -not -only -notices -the -faint -marks -left -on -the -bark -of -a -tree -by -the -claws -of -a -climbing -opossum -but -knows -in -some -way -or -other -whether -the -marks -were -made -to -day -or -yesterday -and -there -is -the -case -on -records -where -a -a -settler -makes -a -bet -with -b -that -b -may -lose -a -cow -as -effectually -as -he -can -and -a -will -produce -an -aboriginal -who -will -find -her -b -selects -a -cow -and -lets -the -tracker -see -the -cow's -footprint -then -be -put -under -guard -b -then -drives -the -cow -a -few -miles -over -a -course -which -drifts -in -all -directions -and -frequently -doubles -back -upon -itself -and -he -selects -difficult -ground -all -the -time -and -once -or -twice -even -drives -the -cow -through -herds -of -other -cows -and -mingles -her -tracks -in -the -wide -confusion -of -theirs -he -finally -brings -his -cow -home -the -aboriginal -is -set -at -liberty -and -at -once -moves -around -in -a -great -circle -examining -all -cow -tracks -until -he -finds -the -one -he -is -after -then -sets -off -and -follows -it -throughout -its -erratic -course -and -ultimately -tracks -it -to -the -stable -where -b -has -hidden -the -cow -now -wherein -does -one -cow -track -differ -from -another -there -must -be -a -difference -or -the -tracker -could -not -have -performed -the -feat -a -difference -minute -shadowy -and -not -detectible -by -you -or -me -or -by -the -late -sherlock -holmes -and -yet -discernible -by -a -member -of -a -race -charged -by -some -people -with -occupying -the -bottom -place -in -the -gradations -of -human -intelligence -chapter -xviii -it -is -easier -to -stay -out -than -get -out -pudd'nhead -wilson's -new -calendar -the -train -was -now -exploring -a -beautiful -hill -country -and -went -twisting -in -and -out -through -lovely -little -green -valleys -there -were -several -varieties -of -gum -trees -among -them -many -giants -some -of -them -were -bodied -and -barked -like -the -sycamore -some -were -of -fantastic -aspect -and -reminded -one -of -the -quaint -apple -trees -in -japanese -pictures -and -there -was -one -peculiarly -beautiful -tree -whose -name -and -breed -i -did -not -know -the -foliage -seemed -to -consist -of -big -bunches -of -pine -spines -the -lower -half -of -each -bunch -a -rich -brown -or -old -gold -color -the -upper -half -a -most -vivid -and -strenuous -and -shouting -green -the -effect -was -altogether -bewitching -the -tree -was -apparently -rare -i -should -say -that -the -first -and -last -samples -of -it -seen -by -us -were -not -more -than -half -an -hour -apart -there -was -another -tree -of -striking -aspect -a -kind -of -pine -we -were -told -its -foliage -was -as -fine -as -hair -apparently -and -its -mass -sphered -itself -above -the -naked -straight -stem -like -an -explosion -of -misty -smoke -it -was -not -a -sociable -sort -it -did -not -gather -in -groups -or -couples -but -each -individual -stood -far -away -from -its -nearest -neighbor -it -scattered -itself -in -this -spacious -and -exclusive -fashion -about -the -slopes -of -swelling -grassy -great -knolls -and -stood -in -the -full -flood -of -the -wonderful -sunshine -and -as -far -as -you -could -see -the -tree -itself -you -could -also -see -the -ink -black -blot -of -its -shadow -on -the -shining -green -carpet -at -its -feet -on -some -part -of -this -railway -journey -we -saw -gorse -and -broom -importations -from -england -and -a -gentleman -who -came -into -our -compartment -on -a -visit -tried -to -tell -me -which -was -which -but -as -he -didn't -know -he -had -difficulty -he -said -he -was -ashamed -of -his -ignorance -but -that -he -had -never -been -confronted -with -the -question -before -during -the -fifty -years -and -more -that -he -had -spent -in -australia -and -so -he -had -never -happened -to -get -interested -in -the -matter -but -there -was -no -need -to -be -ashamed -the -most -of -us -have -his -defect -we -take -a -natural -interest -in -novelties -but -it -is -against -nature -to -take -an -interest -in -familiar -things -the -gorse -and -the -broom -were -a -fine -accent -in -the -landscape -here -and -there -they -burst -out -in -sudden -conflagrations -of -vivid -yellow -against -a -background -of -sober -or -sombre -color -with -a -so -startling -effect -as -to -make -a -body -catch -his -breath -with -the -happy -surprise -of -it -and -then -there -was -the -wattle -a -native -bush -or -tree -an -inspiring -cloud -of -sumptuous -yellow -bloom -it -is -a -favorite -with -the -australians -and -has -a -fine -fragrance -a -quality -usually -wanting -in -australian -blossoms -the -gentleman -who -enriched -me -with -the -poverty -of -his -formation -about -the -gorse -and -the -broom -told -me -that -he -came -out -from -england -a -youth -of -twenty -and -entered -the -province -of -south -australia -with -thirty -six -shillings -in -his -pocket -an -adventurer -without -trade -profession -or -friends -but -with -a -clearly -defined -purpose -in -his -head -he -would -stay -until -he -was -worth -l200 -then -go -back -home -he -would -allow -himself -five -years -for -the -accumulation -of -this -fortune -that -was -more -than -fifty -years -ago -said -he -and -here -i -am -yet -as -he -went -out -at -the -door -he -met -a -friend -and -turned -and -introduced -him -to -me -and -the -friend -and -i -had -a -talk -and -a -smoke -i -spoke -of -the -previous -conversation -and -said -there -something -very -pathetic -about -this -half -century -of -exile -and -that -i -wished -the -l200 -scheme -had -succeeded -with -him -oh -it -did -it's -not -so -sad -a -case -he -is -modest -and -he -left -out -some -of -the -particulars -the -lad -reached -south -australia -just -in -time -to -help -discover -the -burra -burra -copper -mines -they -turned -out -l700 -000 -in -the -first -three -years -up -to -now -they -have -yielded -l120 -000 -000 -he -has -had -his -share -before -that -boy -had -been -in -the -country -two -years -he -could -have -gone -home -and -bought -a -village -he -could -go -now -and -buy -a -city -i -think -no -there -is -nothing -very -pathetic -about -his -case -he -and -his -copper -arrived -at -just -a -handy -time -to -save -south -australia -it -had -got -mashed -pretty -flat -under -the -collapse -of -a -land -boom -a -while -before -there -it -is -again -picturesque -history -australia's -specialty -in -1829 -south -australia -hadn't -a -white -man -in -it -in -1836 -the -british -parliament -erected -it -still -a -solitude -into -a -province -and -gave -it -a -governor -and -other -governmental -machinery -speculators -took -hold -now -and -inaugurated -a -vast -land -scheme -and -invited -immigration -encouraging -it -with -lurid -promises -of -sudden -wealth -it -was -well -worked -in -london -and -bishops -statesmen -and -all -ports -of -people -made -a -rush -for -the -land -company's -shares -immigrants -soon -began -to -pour -into -the -region -of -adelaide -and -select -town -lots -and -farms -in -the -sand -and -the -mangrove -swamps -by -the -sea -the -crowds -continued -to -come -prices -of -land -rose -high -then -higher -and -still -higher -everybody -was -prosperous -and -happy -the -boom -swelled -into -gigantic -proportions -a -village -of -sheet -iron -huts -and -clapboard -sheds -sprang -up -in -the -sand -and -in -these -wigwams -fashion -made -display -richly -dressed -ladies -played -on -costly -pianos -london -swells -in -evening -dress -and -patent -leather -boots -were -abundant -and -this -fine -society -drank -champagne -and -in -other -ways -conducted -itself -in -this -capital -of -humble -sheds -as -it -had -been -accustomed -to -do -in -the -aristocratic -quarters -of -the -metropolis -of -the -world -the -provincial -government -put -up -expensive -buildings -for -its -own -use -and -a -palace -with -gardens -for -the -use -of -its -governor -the -governor -had -a -guard -and -maintained -a -court -roads -wharves -and -hospitals -were -built -all -this -on -credit -on -paper -on -wind -on -inflated -and -fictitious -values -on -the -boom's -moonshine -in -fact -this -went -on -handsomely -during -four -or -five -years -then -of -a -sudden -came -a -smash -bills -for -a -huge -amount -drawn -the -governor -upon -the -treasury -were -dishonored -the -land -company's -credit -went -up -in -smoke -a -panic -followed -values -fell -with -a -rush -the -frightened -immigrants -seized -their -grips -and -fled -to -other -lands -leaving -behind -them -a -good -imitation -of -a -solitude -where -lately -had -been -a -buzzing -and -populous -hive -of -men -adelaide -was -indeed -almost -empty -its -population -had -fallen -to -3 -000 -during -two -years -or -more -the -death -trance -continued -prospect -of -revival -there -was -none -hope -of -it -ceased -then -as -suddenly -as -the -paralysis -had -come -came -the -resurrection -from -it -those -astonishingly -rich -copper -mines -were -discovered -and -the -corpse -got -up -and -danced -the -wool -production -began -to -grow -grain -raising -followed -followed -so -vigorously -too -that -four -or -five -years -after -the -copper -discovery -this -little -colony -which -had -had -to -import -its -breadstuffs -formerly -and -pay -hard -prices -for -them -once -$50 -a -barrel -for -flour -had -become -an -exporter -of -grain -the -prosperities -continued -after -many -years -providence -desiring -to -show -especial -regard -for -new -south -wales -and -exhibit -loving -interest -in -its -welfare -which -should -certify -to -all -nations -the -recognition -of -that -colony's -conspicuous -righteousness -and -distinguished -well -deserving -conferred -upon -it -that -treasury -of -inconceivable -riches -broken -hill -and -south -australia -went -over -the -border -and -took -it -giving -thanks -among -our -passengers -was -an -american -with -a -unique -vocation -unique -is -a -strong -word -but -i -use -it -justifiably -if -i -did -not -misconceive -what -the -american -told -me -for -i -understood -him -to -say -that -in -the -world -there -was -not -another -man -engaged -in -the -business -which -he -was -following -he -was -buying -the -kangaroo -skin -crop -buying -all -of -it -both -the -australian -crop -and -the -tasmanian -and -buying -it -for -an -american -house -in -new -york -the -prices -were -not -high -as -there -was -no -competition -but -the -year's -aggregate -of -skins -would -cost -him -l30 -000 -i -had -had -the -idea -that -the -kangaroo -was -about -extinct -in -tasmania -and -well -thinned -out -on -the -continent -in -america -the -skins -are -tanned -and -made -into -shoes -after -the -tanning -the -leather -takes -a -new -name -which -i -have -forgotten -i -only -remember -that -the -new -name -does -not -indicate -that -the -kangaroo -furnishes -the -leather -there -was -a -german -competition -for -a -while -some -years -ago -but -that -has -ceased -the -germans -failed -to -arrive -at -the -secret -of -tanning -the -skins -successfully -and -they -withdrew -from -the -business -now -then -i -suppose -that -i -have -seen -a -man -whose -occupation -is -really -entitled -to -bear -that -high -epithet -unique -and -i -suppose -that -there -is -not -another -occupation -in -the -world -that -is -restricted -to -the -hands -of -a -sole -person -i -can -think -of -no -instance -of -it -there -is -more -than -one -pope -there -is -more -than -one -emperor -there -is -even -more -than -one -living -god -walking -upon -the -earth -and -worshiped -in -all -sincerity -by -large -populations -of -men -i -have -seen -and -talked -with -two -of -these -beings -myself -in -india -and -i -have -the -autograph -of -one -of -them -it -can -come -good -by -and -by -i -reckon -if -i -attach -it -to -a -permit -approaching -adelaide -we -dismounted -from -the -train -as -the -french -say -and -were -driven -in -an -open -carriage -over -the -hills -and -along -their -slopes -to -the -city -it -was -an -excursion -of -an -hour -or -two -and -the -charm -of -it -could -not -be -overstated -i -think -the -road -wound -around -gaps -and -gorges -and -offered -all -varieties -of -scenery -and -prospect -mountains -crags -country -homes -gardens -forests -color -color -color -everywhere -and -the -air -fine -and -fresh -the -skies -blue -and -not -a -shred -of -cloud -to -mar -the -downpour -of -the -brilliant -sunshine -and -finally -the -mountain -gateway -opened -and -the -immense -plain -lay -spread -out -below -and -stretching -away -into -dim -distances -on -every -hand -soft -and -delicate -and -dainty -and -beautiful -on -its -near -edge -reposed -the -city -we -descended -and -entered -there -was -nothing -to -remind -one -of -the -humble -capital -of -buts -and -sheds -of -the -long -vanished -day -of -the -land -boom -no -this -was -a -modern -city -with -wide -streets -compactly -built -with -fine -homes -everywhere -embowered -in -foliage -and -flowers -and -with -imposing -masses -of -public -buildings -nobly -grouped -and -architecturally -beautiful -there -was -prosperity -in -the -air -for -another -boom -was -on -providence -desiring -to -show -especial -regard -for -the -neighboring -colony -on -the -west -called -western -australia -and -exhibit -a -loving -interest -in -its -welfare -which -should -certify -to -all -nations -the -recognition -of -that -colony's -conspicuous -righteousness -and -distinguished -well -deserving -had -recently -conferred -upon -it -that -majestic -treasury -of -golden -riches -coolgardie -and -now -south -australia -had -gone -around -the -corner -and -taken -it -giving -thanks -everything -comes -to -him -who -is -patient -and -good -and -waits -but -south -australia -deserves -much -for -apparently -she -is -a -hospitable -home -for -every -alien -who -chooses -to -come -and -for -his -religion -too -she -has -a -population -as -per -the -latest -census -of -only -320 -000 -odd -and -yet -her -varieties -of -religion -indicate -the -presence -within -her -borders -of -samples -of -people -from -pretty -nearly -every -part -of -the -globe -you -can -think -of -tabulated -these -varieties -of -religion -make -a -remarkable -show -one -would -have -to -go -far -to -find -its -match -i -copy -here -this -cosmopolitan -curiosity -and -it -comes -from -the -published -census -church -of -england -89 -271 -roman -catholic -47 -179 -wesleyan -49 -159 -lutheran -23 -328 -presbyterian -18 -206 -congregationalist -11 -882 -bible -christian -15 -762 -primitive -methodist -11 -654 -baptist -17 -547 -christian -brethren -465 -methodist -new -connexion -39 -unitarian -688 -church -of -christ -3 -367 -society -of -friends -100 -salvation -army -4 -356 -new -jerusalem -church -168 -jews -840 -protestants -undefined -6 -532 -mohammedans -299 -confucians -etc -3 -884 -other -religions -1 -719 -object -6 -940 -not -stated -8 -046 -total -320 -431 -the -item -in -the -above -list -other -religions -includes -the -following -as -returned -agnostics -atheists -believers -in -christ -buddhists -calvinists -christadelphians -christians -christ's -chapel -christian -israelites -christian -socialists -church -of -god -cosmopolitans -deists -evangelists -exclusive -brethren -free -church -free -methodists -freethinkers -followers -of -christ -gospel -meetings -greek -church -infidels -maronites -memnonists -moravians -mormons -naturalists -orthodox -others -indefinite -pagans -pantheists -plymouth -brethren -rationalists -reformers -secularists -seventh -day -adventists -shaker -shintoists -spiritualists -theosophists -town -city -mission -welsh -church -huguenot -hussite -zoroastrians -zwinglian -about -64 -roads -to -the -other -world -you -see -how -healthy -the -religious -atmosphere -is -anything -can -live -in -it -agnostics -atheists -freethinkers -infidels -mormons -pagans -indefinites -they -are -all -there -and -all -the -big -sects -of -the -world -can -do -more -than -merely -live -in -it -they -can -spread -flourish -prosper -all -except -the -spiritualists -and -the -theosophists -that -is -the -most -curious -feature -of -this -curious -table -what -is -the -matter -with -the -specter -why -do -they -puff -him -away -he -is -a -welcome -toy -everywhere -else -in -the -world -chapter -xix -pity -is -for -the -living -envy -is -for -the -dead -pudd'nhead -wilson's -new -calendar -the -successor -of -the -sheet -iron -hamlet -of -the -mangrove -marshes -has -that -other -australian -specialty -the -botanical -gardens -we -cannot -have -these -paradises -the -best -we -could -do -would -be -to -cover -a -vast -acreage -under -glass -and -apply -steam -heat -but -it -would -be -inadequate -the -lacks -would -still -be -so -great -the -confined -sense -the -sense -of -suffocation -the -atmospheric -dimness -the -sweaty -heat -these -would -all -be -there -in -place -of -the -australian -openness -to -the -sky -the -sunshine -and -the -breeze -whatever -will -grow -under -glass -with -us -will -flourish -rampantly -out -of -doors -in -australia -[the -greatest -heat -in -victoria -that -there -is -an -authoritative -record -of -was -at -sandhurst -in -january -1862 -the -thermometer -then -registered -117 -degrees -in -the -shade -in -january -1880 -the -heat -at -adelaide -south -australia -was -172 -degrees -in -the -sun -] -when -the -white -man -came -the -continent -was -nearly -as -poor -in -variety -of -vegetation -as -the -desert -of -sahara -now -it -has -everything -that -grows -on -the -earth -in -fact -not -australia -only -but -all -australasia -has -levied -tribute -upon -the -flora -of -the -rest -of -the -world -and -wherever -one -goes -the -results -appear -in -gardens -private -and -public -in -the -woodsy -walls -of -the -highways -and -in -even -the -forests -if -you -see -a -curious -or -beautiful -tree -or -bush -or -flower -and -ask -about -it -the -people -answering -usually -name -a -foreign -country -as -the -place -of -its -origin -india -africa -japan -china -england -america -java -sumatra -new -guinea -polynesia -and -so -on -in -the -zoological -gardens -of -adelaide -i -saw -the -only -laughing -jackass -that -ever -showed -any -disposition -to -be -courteous -to -me -this -one -opened -his -head -wide -and -laughed -like -a -demon -or -like -a -maniac -who -was -consumed -with -humorous -scorn -over -a -cheap -and -degraded -pun -it -was -a -very -human -laugh -if -he -had -been -out -of -sight -i -could -have -believed -that -the -laughter -came -from -a -man -it -is -an -odd -looking -bird -with -a -head -and -beak -that -are -much -too -large -for -its -body -in -time -man -will -exterminate -the -rest -of -the -wild -creatures -of -australia -but -this -one -will -probably -survive -for -man -is -his -friend -and -lets -him -alone -man -always -has -a -good -reason -for -his -charities -towards -wild -things -human -or -animal -when -he -has -any -in -this -case -the -bird -is -spared -because -he -kills -snakes -if -l -j -he -will -not -kill -all -of -them -in -that -garden -i -also -saw -the -wild -australian -dog -the -dingo -he -was -a -beautiful -creature -shapely -graceful -a -little -wolfish -in -some -of -his -aspects -but -with -a -most -friendly -eye -and -sociable -disposition -the -dingo -is -not -an -importation -he -was -present -in -great -force -when -the -whites -first -came -to -the -continent -it -may -be -that -he -is -the -oldest -dog -in -the -universe -his -origin -his -descent -the -place -where -his -ancestors -first -appeared -are -as -unknown -and -as -untraceable -as -are -the -camel's -he -is -the -most -precious -dog -in -the -world -for -he -does -not -bark -but -in -an -evil -hour -he -got -to -raiding -the -sheep -runs -to -appease -his -hunger -and -that -sealed -his -doom -he -is -hunted -now -just -as -if -he -were -a -wolf -he -has -been -sentenced -to -extermination -and -the -sentence -will -be -carried -out -this -is -all -right -and -not -objectionable -the -world -was -made -for -man -the -white -man -south -australia -is -confusingly -named -all -of -the -colonies -have -a -southern -exposure -except -one -queensland -properly -speaking -south -australia -is -middle -australia -it -extends -straight -up -through -the -center -of -the -continent -like -the -middle -board -in -a -center -table -it -is -2 -000 -miles -high -from -south -to -north -and -about -a -third -as -wide -a -wee -little -spot -down -in -its -southeastern -corner -contains -eight -or -nine -tenths -of -its -population -the -other -one -or -two -tenths -are -elsewhere -as -elsewhere -as -they -could -be -in -the -united -states -with -all -the -country -between -denver -and -chicago -and -canada -and -the -gulf -of -mexico -to -scatter -over -there -is -plenty -of -room -a -telegraph -line -stretches -straight -up -north -through -that -2 -000 -miles -of -wilderness -and -desert -from -adelaide -to -port -darwin -on -the -edge -of -the -upper -ocean -south -australia -built -the -line -and -did -it -in -1871 -2 -when -her -population -numbered -only -185 -000 -it -was -a -great -work -for -there -were -no -roads -no -paths -1 -300 -miles -of -the -route -had -been -traversed -but -once -before -by -white -men -provisions -wire -and -poles -had -to -be -carried -over -immense -stretches -of -desert -wells -had -to -be -dug -along -the -route -to -supply -the -men -and -cattle -with -water -a -cable -had -been -previously -laid -from -port -darwin -to -java -and -thence -to -india -and -there -was -telegraphic -communication -with -england -from -india -and -so -if -adelaide -could -make -connection -with -port -darwin -it -meant -connection -with -the -whole -world -the -enterprise -succeeded -one -could -watch -the -london -markets -daily -now -the -profit -to -the -wool -growers -of -australia -was -instant -and -enormous -a -telegram -from -melbourne -to -san -francisco -covers -approximately -20 -000 -miles -the -equivalent -of -five -sixths -of -the -way -around -the -globe -it -has -to -halt -along -the -way -a -good -many -times -and -be -repeated -still -but -little -time -is -lost -these -halts -and -the -distances -between -them -are -here -tabulated -[from -round -the -empire -george -r -parkin -all -but -the -last -two -] -miles -melbourne -mount -gambier -300 -mount -gambier -adelaide -270 -adelaide -port -augusta -200 -port -augusta -alice -springs -1 -036 -alice -springs -port -darwin -898 -port -darwin -banjoewangie -1 -150 -banjoewangie -batavia -480 -batavia -singapore -553 -singapore -penang -399 -penang -madras -1 -280 -madras -bombay -650 -bombay -aden -1 -662 -aden -suez -1 -346 -suez -alexandria -224 -alexandria -malta -828 -malta -gibraltar -1 -008 -gibraltar -falmouth -1 -061 -falmouth -london -350 -london -new -york -2 -500 -new -york -san -francisco -3 -500 -i -was -in -adelaide -again -some -months -later -and -saw -the -multitudes -gather -in -the -neighboring -city -of -glenelg -to -commemorate -the -reading -of -the -proclamation -in -1836 -which -founded -the -province -if -i -have -at -any -time -called -it -a -colony -i -withdraw -the -discourtesy -it -is -not -a -colony -it -is -a -province -and -officially -so -moreover -it -is -the -only -one -so -named -in -australasia -there -was -great -enthusiasm -it -was -the -province's -national -holiday -its -fourth -of -july -so -to -speak -it -is -the -pre -eminent -holiday -and -that -is -saying -much -in -a -country -where -they -seem -to -have -a -most -un -english -mania -for -holidays -mainly -they -are -workingmen's -holidays -for -in -south -australia -the -workingman -is -sovereign -his -vote -is -the -desire -of -the -politician -indeed -it -is -the -very -breath -of -the -politician's -being -the -parliament -exists -to -deliver -the -will -of -the -workingman -and -the -government -exists -to -execute -it -the -workingman -is -a -great -power -everywhere -in -australia -but -south -australia -is -his -paradise -he -has -had -a -hard -time -in -this -world -and -has -earned -a -paradise -i -am -glad -he -has -found -it -the -holidays -there -are -frequent -enough -to -be -bewildering -to -the -stranger -i -tried -to -get -the -hang -of -the -system -but -was -not -able -to -do -it -you -have -seen -that -the -province -is -tolerant -religious -wise -it -is -so -politically -also -one -of -the -speakers -at -the -commemoration -banquet -the -minister -of -public -works -was -an -american -born -and -reared -in -new -england -there -is -nothing -narrow -about -the -province -politically -or -in -any -other -way -that -i -know -of -sixty -four -religions -and -a -yankee -cabinet -minister -no -amount -of -horse -racing -can -damn -this -community -the -mean -temperature -of -the -province -is -62 -deg -the -death -rate -is -13 -in -the -1 -000 -about -half -what -it -is -in -the -city -of -new -york -i -should -think -and -new -york -is -a -healthy -city -thirteen -is -the -death -rate -for -the -average -citizen -of -the -province -but -there -seems -to -be -no -death -rate -for -the -old -people -there -were -people -at -the -commemoration -banquet -who -could -remember -cromwell -there -were -six -of -them -these -old -settlers -had -all -been -present -at -the -original -reading -of -the -proclamation -in -1536 -they -showed -signs -of -the -blightings -and -blastings -of -time -in -their -outward -aspect -but -they -were -young -within -young -and -cheerful -and -ready -to -talk -ready -to -talk -and -talk -all -you -wanted -in -their -turn -and -out -of -it -they -were -down -for -six -speeches -and -they -made -42 -the -governor -and -the -cabinet -and -the -mayor -were -down -for -42 -speeches -and -they -made -6 -they -have -splendid -grit -the -old -settlers -splendid -staying -power -but -they -do -not -hear -well -and -when -they -see -the -mayor -going -through -motions -which -they -recognize -as -the -introducing -of -a -speaker -they -think -they -are -the -one -and -they -all -get -up -together -and -begin -to -respond -in -the -most -animated -way -and -the -more -the -mayor -gesticulates -and -shouts -sit -down! -sit -down! -the -more -they -take -it -for -applause -and -the -more -excited -and -reminiscent -and -enthusiastic -they -get -and -next -when -they -see -the -whole -house -laughing -and -crying -three -of -them -think -it -is -about -the -bitter -old -time -hardships -they -are -describing -and -the -other -three -think -the -laughter -is -caused -by -the -jokes -they -have -been -uncorking -jokes -of -the -vintage -of -1836 -and -then -the -way -they -do -go -on! -and -finally -when -ushers -come -and -plead -and -beg -and -gently -and -reverently -crowd -them -down -into -their -seats -they -say -oh -i'm -not -tired -i -could -bang -along -a -week! -and -they -sit -there -looking -simple -and -childlike -and -gentle -and -proud -of -their -oratory -and -wholly -unconscious -of -what -is -going -on -at -the -other -end -of -the -room -and -so -one -of -the -great -dignitaries -gets -a -chance -and -begins -his -carefully -prepared -speech -impressively -and -with -solemnity -when -we -now -great -and -prosperous -and -powerful -bow -our -heads -in -reverent -wonder -in -the -contemplation -of -those -sublimities -of -energy -of -wisdom -of -forethought -of -up -come -the -immortal -six -again -in -a -body -with -a -joyous -hey -i've -thought -of -another -one! -and -at -it -they -go -with -might -and -main -hearing -not -a -whisper -of -the -pandemonium -that -salutes -them -but -taking -all -the -visible -violences -for -applause -as -before -and -hammering -joyously -away -till -the -imploring -ushers -pray -them -into -their -seats -again -and -a -pity -too -for -those -lovely -old -boys -did -so -enjoy -living -their -heroic -youth -over -in -these -days -of -their -honored -antiquity -and -certainly -the -things -they -had -to -tell -were -usually -worth -the -telling -and -the -hearing -it -was -a -stirring -spectacle -stirring -in -more -ways -than -one -for -it -was -amazingly -funny -and -at -the -same -time -deeply -pathetic -for -they -had -seen -so -much -these -time -worn -veterans -end -had -suffered -so -much -and -had -built -so -strongly -and -well -and -laid -the -foundations -of -their -commonwealth -so -deep -in -liberty -and -tolerance -and -had -lived -to -see -the -structure -rise -to -such -state -and -dignity -and -hear -themselves -so -praised -for -honorable -work -one -of -these -old -gentlemen -told -me -some -things -of -interest -afterward -things -about -the -aboriginals -mainly -he -thought -them -intelligent -remarkably -so -in -some -directions -and -he -said -that -along -with -their -unpleasant -qualities -they -had -some -exceedingly -good -ones -and -he -considered -it -a -great -pity -that -the -race -had -died -out -he -instanced -their -invention -of -the -boomerang -and -the -weet -weet -as -evidences -of -their -brightness -and -as -another -evidence -of -it -he -said -he -had -never -seen -a -white -man -who -had -cleverness -enough -to -learn -to -do -the -miracles -with -those -two -toys -that -the -aboriginals -achieved -he -said -that -even -the -smartest -whites -had -been -obliged -to -confess -that -they -could -not -learn -the -trick -of -the -boomerang -in -perfection -that -it -had -possibilities -which -they -could -not -master -the -white -man -could -not -control -its -motions -could -not -make -it -obey -him -but -the -aboriginal -could -he -told -me -some -wonderful -things -some -almost -incredible -things -which -he -had -seen -the -blacks -do -with -the -boomerang -and -the -weet -weet -they -have -been -confirmed -to -me -since -by -other -early -settlers -and -by -trustworthy -books -it -is -contended -and -may -be -said -to -be -conceded -that -the -boomerang -was -known -to -certain -savage -tribes -in -europe -in -roman -times -in -support -of -this -virgil -and -two -other -roman -poets -are -quoted -it -is -also -contended -that -it -was -known -to -the -ancient -egyptians -one -of -two -things -either -some -one -with -is -then -apparent -a -boomerang -arrived -in -australia -in -the -days -of -antiquity -before -european -knowledge -of -the -thing -had -been -lost -or -the -australian -aboriginal -reinvented -it -it -will -take -some -time -to -find -out -which -of -these -two -propositions -is -the -fact -but -there -is -no -hurry -chapter -xx -it -is -by -the -goodness -of -god -that -in -our -country -we -have -those -three -unspeakably -precious -things -freedom -of -speech -freedom -of -conscience -and -the -prudence -never -to -practice -either -of -them -pudd'nhead -wilson's -new -calendar -from -diary -mr -g -called -i -had -not -seen -him -since -nauheim -germany -several -years -ago -the -time -that -the -cholera -broke -out -at -hamburg -we -talked -of -the -people -we -had -known -there -or -had -casually -met -and -g -said -do -you -remember -my -introducing -you -to -an -earl -the -earl -of -c -yes -that -was -the -last -time -i -saw -you -you -and -he -were -in -a -carriage -just -starting -belated -for -the -train -i -remember -it -i -remember -it -too -because -of -a -thing -which -happened -then -which -i -was -not -looking -for -he -had -told -me -a -while -before -about -a -remarkable -and -interesting -californian -whom -he -had -met -and -who -was -a -friend -of -yours -and -said -that -if -he -should -ever -meet -you -he -would -ask -you -for -some -particulars -about -that -californian -the -subject -was -not -mentioned -that -day -at -nauheim -for -we -were -hurrying -away -and -there -was -no -time -but -the -thing -that -surprised -me -was -this -when -i -induced -you -you -said -'i -am -glad -to -meet -your -lordship -gain -' -the -i -again' -was -the -surprise -he -is -a -little -hard -of -hearing -and -didn't -catch -that -word -and -i -thought -you -hadn't -intended -that -he -should -as -we -drove -off -i -had -only -time -to -say -'why -what -do -you -know -about -him -' -and -i -understood -you -to -say -'oh -nothing -except -that -he -is -the -quickest -judge -of -' -then -we -were -gone -and -i -didn't -get -the -rest -i -wondered -what -it -was -that -he -was -such -a -quick -judge -of -i -have -thought -of -it -many -times -since -and -still -wondered -what -it -could -be -he -and -i -talked -it -over -but -could -not -guess -it -out -he -thought -it -must -be -fox -hounds -or -horses -for -he -is -a -good -judge -of -those -no -one -is -a -better -but -you -couldn't -know -that -because -you -didn't -know -him -you -had -mistaken -him -for -some -one -else -it -must -be -that -he -said -because -he -knew -you -had -never -met -him -before -and -of -course -you -hadn't -had -you -yes -i -had -is -that -so -where -at -a -fox -hunt -in -england -how -curious -that -is -why -he -hadn't -the -least -recollection -of -it -had -you -any -conversation -with -him -some -yes -well -it -left -not -the -least -impression -upon -him -what -did -you -talk -about -about -the -fox -i -think -that -was -all -why -that -would -interest -him -that -ought -to -have -left -an -impression -what -did -he -talk -about -the -fox -it's -very -curious -i -don't -understand -it -did -what -he -said -leave -an -impression -upon -you -yes -it -showed -me -that -he -was -a -quick -judge -of -however -i -will -tell -you -all -about -it -then -you -will -understand -it -was -a -quarter -of -a -century -ago -1873 -or -'74 -i -had -an -american -friend -in -london -named -f -who -was -fond -of -hunting -and -his -friends -the -blanks -invited -him -and -me -to -come -out -to -a -hunt -and -be -their -guests -at -their -country -place -in -the -morning -the -mounts -were -provided -but -when -i -saw -the -horses -i -changed -my -mind -and -asked -permission -to -walk -i -had -never -seen -an -english -hunter -before -and -it -seemed -to -me -that -i -could -hunt -a -fox -safer -on -the -ground -i -had -always -been -diffident -about -horses -anyway -even -those -of -the -common -altitudes -and -i -did -not -feel -competent -to -hunt -on -a -horse -that -went -on -stilts -so -then -mrs -blank -came -to -my -help -and -said -i -could -go -with -her -in -the -dog -cart -and -we -would -drive -to -a -place -she -knew -of -and -there -we -should -have -a -good -glimpse -of -the -hunt -as -it -went -by -when -we -got -to -that -place -i -got -out -and -went -and -leaned -my -elbows -on -a -low -stone -wall -which -enclosed -a -turfy -and -beautiful -great -field -with -heavy -wood -on -all -its -sides -except -ours -mrs -blank -sat -in -the -dog -cart -fifty -yards -away -which -was -as -near -as -she -could -get -with -the -vehicle -i -was -full -of -interest -for -i -had -never -seen -a -fox -hunt -i -waited -dreaming -and -imagining -in -the -deep -stillness -and -impressive -tranquility -which -reigned -in -that -retired -spot -presently -from -away -off -in -the -forest -on -the -left -a -mellow -bugle -note -came -floating -then -all -of -a -sudden -a -multitude -of -dogs -burst -out -of -that -forest -and -went -tearing -by -and -disappeared -in -the -forest -on -the -right -there -was -a -pause -and -then -a -cloud -of -horsemen -in -black -caps -and -crimson -coats -plunged -out -of -the -left -hand -forest -and -went -flaming -across -the -field -like -a -prairie -fire -a -stirring -sight -to -see -there -was -one -man -ahead -of -the -rest -and -he -came -spurring -straight -at -me -he -was -fiercely -excited -it -was -fine -to -see -him -ride -he -was -a -master -horseman -he -came -like -a -storm -till -he -was -within -seven -feet -of -me -where -i -was -leaning -on -the -wall -then -he -stood -his -horse -straight -up -in -the -air -on -his -hind -toe -nails -and -shouted -like -a -demon -'which -way'd -the -fox -go -' -i -didn't -much -like -the -tone -but -i -did -not -let -on -for -he -was -excited -you -know -but -i -was -calm -so -i -said -softly -and -without -acrimony -'which -fox -' -it -seemed -to -anger -him -i -don't -know -why -and -he -thundered -out -'which -fox -why -the -fox -which -way -did -the -fox -go -' -i -said -with -great -gentleness -even -argumentatively -'if -you -could -be -a -little -more -definite -a -little -less -vague -because -i -am -a -stranger -and -there -are -many -foxes -as -you -will -know -even -better -than -i -and -unless -i -know -which -one -it -is -that -you -desire -to -identify -and -' -'you're -certainly -the -damdest -idiot -that -has -escaped -in -a -thousand -years!' -and -he -snatched -his -great -horse -around -as -easily -as -i -would -snatch -a -cat -and -was -away -like -a -hurricane -a -very -excitable -man -i -went -back -to -mrs -blank -and -she -was -excited -too -oh -all -alive -she -said -'he -spoke -to -you! -didn't -he -' -'yes -it -is -what -happened -' -'i -knew -it! -i -couldn't -hear -what -he -said -but -i -knew -be -spoke -to -you! -do -you -know -who -it -was -it -was -lord -c -and -he -is -master -of -the -buckhounds! -tell -me -what -do -you -think -of -him -' -'him -well -for -sizing -up -a -stranger -he's -got -the -most -sudden -and -accurate -judgment -of -any -man -i -ever -saw -' -it -pleased -her -i -thought -it -would -g -got -away -from -nauheim -just -in -time -to -escape -being -shut -in -by -the -quarantine -bars -on -the -frontiers -and -so -did -we -for -we -left -the -next -day -but -g -had -a -great -deal -of -trouble -in -getting -by -the -italian -custom -house -and -we -should -have -fared -likewise -but -for -the -thoughtfulness -of -our -consul -general -in -frankfort -he -introduced -me -to -the -italian -consul -general -and -i -brought -away -from -that -consulate -a -letter -which -made -our -way -smooth -it -was -a -dozen -lines -merely -commending -me -in -a -general -way -to -the -courtesies -of -servants -in -his -italian -majesty's -service -but -it -was -more -powerful -than -it -looked -in -addition -to -a -raft -of -ordinary -baggage -we -had -six -or -eight -trunks -which -were -filled -exclusively -with -dutiable -stuff -household -goods -purchased -in -frankfort -for -use -in -florence -where -we -had -taken -a -house -i -was -going -to -ship -these -through -by -express -but -at -the -last -moment -an -order -went -throughout -germany -forbidding -the -moving -of -any -parcels -by -train -unless -the -owner -went -with -them -this -was -a -bad -outlook -we -must -take -these -things -along -and -the -delay -sure -to -be -caused -by -the -examination -of -them -in -the -custom -house -might -lose -us -our -train -i -imagined -all -sorts -of -terrors -and -enlarged -them -steadily -as -we -approached -the -italian -frontier -we -were -six -in -number -clogged -with -all -that -baggage -and -i -was -courier -for -the -party -the -most -incapable -one -they -ever -employed -we -arrived -and -pressed -with -the -crowd -into -the -immense -custom -house -and -the -usual -worries -began -everybody -crowding -to -the -counter -and -begging -to -have -his -baggage -examined -first -and -all -hands -clattering -and -chattering -at -once -it -seemed -to -me -that -i -could -do -nothing -it -would -be -better -to -give -it -all -up -and -go -away -and -leave -the -baggage -i -couldn't -speak -the -language -i -should -never -accomplish -anything -just -then -a -tall -handsome -man -in -a -fine -uniform -was -passing -by -and -i -knew -he -must -be -the -station -master -and -that -reminded -me -of -my -letter -i -ran -to -him -and -put -it -into -his -hands -he -took -it -out -of -the -envelope -and -the -moment -his -eye -caught -the -royal -coat -of -arms -printed -at -its -top -he -took -off -his -cap -and -made -a -beautiful -bow -to -me -and -said -in -english -which -is -your -baggage -please -show -it -to -me -i -showed -him -the -mountain -nobody -was -disturbing -it -nobody -was -interested -in -it -all -the -family's -attempts -to -get -attention -to -it -had -failed -except -in -the -case -of -one -of -the -trunks -containing -the -dutiable -goods -it -was -just -being -opened -my -officer -said -there -let -that -alone! -lock -it -now -chalk -it -chalk -all -of -the -lot -now -please -come -and -show -the -hand -baggage -he -plowed -through -the -waiting -crowd -i -following -to -the -counter -and -he -gave -orders -again -in -his -emphatic -military -way -chalk -these -chalk -all -of -them -then -he -took -off -his -cap -and -made -that -beautiful -bow -again -and -went -his -way -by -this -time -these -attentions -had -attracted -the -wonder -of -that -acre -of -passengers -and -the -whisper -had -gone -around -that -the -royal -family -were -present -getting -their -baggage -chalked -and -as -we -passed -down -in -review -on -our -way -to -the -door -i -was -conscious -of -a -pervading -atmosphere -of -envy -which -gave -me -deep -satisfaction -but -soon -there -was -an -accident -my -overcoat -pockets -were -stuffed -with -german -cigars -and -linen -packages -of -american -smoking -tobacco -and -a -porter -was -following -us -around -with -this -overcoat -on -his -arm -and -gradually -getting -it -upside -down -just -as -i -in -the -rear -of -my -family -moved -by -the -sentinels -at -the -door -about -three -hatfuls -of -the -tobacco -tumbled -out -on -the -floor -one -of -the -soldiers -pounced -upon -it -gathered -it -up -in -his -arms -pointed -back -whence -i -had -come -and -marched -me -ahead -of -him -past -that -long -wall -of -passengers -again -he -chattering -and -exulting -like -a -devil -they -smiling -in -peaceful -joy -and -i -trying -to -look -as -if -my -pride -was -not -hurt -and -as -if -i -did -not -mind -being -brought -to -shame -before -these -pleased -people -who -had -so -lately -envied -me -but -at -heart -i -was -cruelly -humbled -when -i -had -been -marched -two -thirds -of -the -long -distance -and -the -misery -of -it -was -at -the -worst -the -stately -station -master -stepped -out -from -somewhere -and -the -soldier -left -me -and -darted -after -him -and -overtook -him -and -i -could -see -by -the -soldier's -excited -gestures -that -he -was -betraying -to -him -the -whole -shabby -business -the -station -master -was -plainly -very -angry -he -came -striding -down -toward -me -and -when -he -was -come -near -he -began -to -pour -out -a -stream -of -indignant -italian -then -suddenly -took -off -his -hat -and -made -that -beautiful -bow -and -said -oh -it -is -you! -i -beg -a -thousands -pardons! -this -idiot -here -he -turned -to -the -exulting -soldier -and -burst -out -with -a -flood -of -white -hot -italian -lava -and -the -next -moment -he -was -bowing -and -the -soldier -and -i -were -moving -in -procession -again -he -in -the -lead -and -ashamed -this -time -i -with -my -chin -up -and -so -we -marched -by -the -crowd -of -fascinated -passengers -and -i -went -forth -to -the -train -with -the -honors -of -war -tobacco -and -all -chapter -xxi -man -will -do -many -things -to -get -himself -loved -he -will -do -all -things -to -get -himself -envied -pudd'nhead -wilson's -new -calendar -before -i -saw -australia -i -had -never -heard -of -the -weet -weet -at -all -i -met -but -few -men -who -had -seen -it -thrown -at -least -i -met -but -few -who -mentioned -having -seen -it -thrown -roughly -described -it -is -a -fat -wooden -cigar -with -its -butt -end -fastened -to -a -flexible -twig -the -whole -thing -is -only -a -couple -of -feet -long -and -weighs -less -than -two -ounces -this -feather -so -to -call -it -is -not -thrown -through -the -air -but -is -flung -with -an -underhanded -throw -and -made -to -strike -the -ground -a -little -way -in -front -of -the -thrower -then -it -glances -and -makes -a -long -skip -glances -again -skips -again -and -again -and -again -like -the -flat -stone -which -a -boy -sends -skating -over -the -water -the -water -is -smooth -and -the -stone -has -a -good -chance -so -a -strong -man -may -make -it -travel -fifty -or -seventy -five -yards -but -the -weet -weet -has -no -such -good -chance -for -it -strikes -sand -grass -and -earth -in -its -course -yet -an -expert -aboriginal -has -sent -it -a -measured -distance -of -two -hundred -and -twenty -yards -it -would -have -gone -even -further -but -it -encountered -rank -ferns -and -underwood -on -its -passage -and -they -damaged -its -speed -two -hundred -and -twenty -yards -and -so -weightless -a -toy -a -mouse -on -the -end -of -a -bit -of -wire -in -effect -and -not -sailing -through -the -accommodating -air -but -encountering -grass -and -sand -and -stuff -at -every -jump -it -looks -wholly -impossible -but -mr -brough -smyth -saw -the -feat -and -did -the -measuring -and -set -down -the -facts -in -his -book -about -aboriginal -life -which -he -wrote -by -command -of -the -victorian -government -what -is -the -secret -of -the -feat -no -one -explains -it -cannot -be -physical -strength -for -that -could -not -drive -such -a -feather -weight -any -distance -it -must -be -art -but -no -one -explains -what -the -art -of -it -is -nor -how -it -gets -around -that -law -of -nature -which -says -you -shall -not -throw -any -two -ounce -thing -220 -yards -either -through -the -air -or -bumping -along -the -ground -rev -j -g -woods -says -the -distance -to -which -the -weet -weet -or -kangaroo -rat -can -be -thrown -is -truly -astonishing -i -have -seen -an -australian -stand -at -one -side -of -kennington -oval -and -throw -the -kangaroo -rat -completely -across -it -width -of -kensington -oval -not -stated -it -darts -through -the -air -with -the -sharp -and -menacing -hiss -of -a -rifle -ball -its -greatest -height -from -the -ground -being -some -seven -or -eight -feet -when -properly -thrown -it -looks -just -like -a -living -animal -leaping -along -its -movements -have -a -wonderful -resemblance -to -the -long -leaps -of -a -kangaroo -rat -fleeing -in -alarm -with -its -long -tail -trailing -behind -it -the -old -settler -said -that -he -had -seen -distances -made -by -the -weet -weet -in -the -early -days -which -almost -convinced -him -that -it -was -as -extraordinary -an -instrument -as -the -boomerang -there -must -have -been -a -large -distribution -of -acuteness -among -those -naked -skinny -aboriginals -or -they -couldn't -have -been -such -unapproachable -trackers -and -boomerangers -and -weet -weeters -it -must -have -been -race -aversion -that -put -upon -them -a -good -deal -of -the -low -rate -intellectual -reputation -which -they -bear -and -have -borne -this -long -time -in -the -world's -estimate -of -them -they -were -lazy -always -lazy -perhaps -that -was -their -trouble -it -is -a -killing -defect -surely -they -could -have -invented -and -built -a -competent -house -but -they -didn't -and -they -could -have -invented -and -developed -the -agricultural -arts -but -they -didn't -they -went -naked -and -houseless -and -lived -on -fish -and -grubs -and -worms -and -wild -fruits -and -were -just -plain -savages -for -all -their -smartness -with -a -country -as -big -as -the -united -states -to -live -and -multiply -in -and -with -no -epidemic -diseases -among -them -till -the -white -man -came -with -those -and -his -other -appliances -of -civilization -it -is -quite -probable -that -there -was -never -a -day -in -his -history -when -he -could -muster -100 -000 -of -his -race -in -all -australia -he -diligently -and -deliberately -kept -population -down -by -infanticide -largely -but -mainly -by -certain -other -methods -he -did -not -need -to -practise -these -artificialities -any -more -after -the -white -man -came -the -white -man -knew -ways -of -keeping -down -population -which -were -worth -several -of -his -the -white -man -knew -ways -of -reducing -a -native -population -80 -percent -in -20 -years -the -native -had -never -seen -anything -as -fine -as -that -before -for -example -there -is -the -case -of -the -country -now -called -victoria -a -country -eighty -times -as -large -as -rhode -island -as -i -have -already -said -by -the -best -official -guess -there -were -4 -500 -aboriginals -in -it -when -the -whites -came -along -in -the -middle -of -the -'thirties -of -these -1 -000 -lived -in -gippsland -a -patch -of -territory -the -size -of -fifteen -or -sixteen -rhode -islands -they -did -not -diminish -as -fast -as -some -of -the -other -communities -indeed -at -the -end -of -forty -years -there -were -still -200 -of -them -left -the -geelong -tribe -diminished -more -satisfactorily -from -173 -persons -it -faded -to -34 -in -twenty -years -at -the -end -of -another -twenty -the -tribe -numbered -one -person -altogether -the -two -melbourne -tribes -could -muster -almost -300 -when -the -white -man -came -they -could -muster -but -twenty -thirty -seven -years -later -in -1875 -in -that -year -there -were -still -odds -and -ends -of -tribes -scattered -about -the -colony -of -victoria -but -i -was -told -that -natives -of -full -blood -are -very -scarce -now -it -is -said -that -the -aboriginals -continue -in -some -force -in -the -huge -territory -called -queensland -the -early -whites -were -not -used -to -savages -they -could -not -understand -the -primary -law -of -savage -life -that -if -a -man -do -you -a -wrong -his -whole -tribe -is -responsible -each -individual -of -it -and -you -may -take -your -change -out -of -any -individual -of -it -without -bothering -to -seek -out -the -guilty -one -when -a -white -killed -an -aboriginal -the -tribe -applied -the -ancient -law -and -killed -the -first -white -they -came -across -to -the -whites -this -was -a -monstrous -thing -extermination -seemed -to -be -the -proper -medicine -for -such -creatures -as -this -they -did -not -kill -all -the -blacks -but -they -promptly -killed -enough -of -them -to -make -their -own -persons -safe -from -the -dawn -of -civilization -down -to -this -day -the -white -man -has -always -used -that -very -precaution -mrs -campbell -praed -lived -in -queensland -as -a -child -in -the -early -days -and -in -her -sketches -of -australian -life -we -get -informing -pictures -of -the -early -struggles -of -the -white -and -the -black -to -reform -each -other -speaking -of -pioneer -days -in -the -mighty -wilderness -of -queensland -mrs -praed -says -at -first -the -natives -retreated -before -the -whites -and -except -that -they -every -now -and -then -speared -a -beast -in -one -of -the -herds -gave -little -cause -for -uneasiness -but -as -the -number -of -squatters -increased -each -one -taking -up -miles -of -country -and -bringing -two -or -three -men -in -his -train -so -that -shepherds' -huts -and -stockmen's -camps -lay -far -apart -and -defenseless -in -the -midst -of -hostile -tribes -the -blacks' -depredations -became -more -frequent -and -murder -was -no -unusual -event -the -loneliness -of -the -australian -bush -can -hardly -be -painted -in -words -here -extends -mile -after -mile -of -primeval -forest -where -perhaps -foot -of -white -man -has -never -trod -interminable -vistas -where -the -eucalyptus -trees -rear -their -lofty -trunks -and -spread -forth -their -lanky -limbs -from -which -the -red -gum -oozes -and -hangs -in -fantastic -pendants -like -crimson -stalactites -ravines -along -the -sides -of -which -the -long -bladed -grass -grows -rankly -level -untimbered -plains -alternating -with -undulating -tracts -of -pasture -here -and -there -broken -by -a -stony -ridge -steep -gully -or -dried -up -creek -all -wild -vast -and -desolate -all -the -same -monotonous -gray -coloring -except -where -the -wattle -when -in -blossom -shows -patches -of -feathery -gold -or -a -belt -of -scrub -lies -green -glossy -and -impenetrable -as -indian -jungle -the -solitude -seems -intensified -by -the -strange -sounds -of -reptiles -birds -and -insects -and -by -the -absence -of -larger -creatures -of -which -in -the -day -time -the -only -audible -signs -are -the -stampede -of -a -herd -of -kangaroo -or -the -rustle -of -a -wallabi -or -a -dingo -stirring -the -grass -as -it -creeps -to -its -lair -but -there -are -the -whirring -of -locusts -the -demoniac -chuckle -of -the -laughing -jack -ass -the -screeching -of -cockatoos -and -parrots -the -hissing -of -the -frilled -lizard -and -the -buzzing -of -innumerable -insects -hidden -under -the -dense -undergrowth -and -then -at -night -the -melancholy -wailing -of -the -curlews -the -dismal -howling -of -dingoes -the -discordant -croaking -of -tree -frogs -might -well -shake -the -nerves -of -the -solitary -watcher -that -is -the -theater -for -the -drama -when -you -comprehend -one -or -two -other -details -you -will -perceive -how -well -suited -for -trouble -it -was -and -how -loudly -it -invited -it -the -cattlemen's -stations -were -scattered -over -that -profound -wilderness -miles -and -miles -apart -at -each -station -half -a -dozen -persons -there -was -a -plenty -of -cattle -the -black -natives -were -always -ill -nourished -and -hungry -the -land -belonged -to -them -the -whites -had -not -bought -it -and -couldn't -buy -it -for -the -tribes -had -no -chiefs -nobody -in -authority -nobody -competent -to -sell -and -convey -and -the -tribes -themselves -had -no -comprehension -of -the -idea -of -transferable -ownership -of -land -the -ousted -owners -were -despised -by -the -white -interlopers -and -this -opinion -was -not -hidden -under -a -bushel -more -promising -materials -for -a -tragedy -could -not -have -been -collated -let -mrs -praed -speak -at -nie -station -one -dark -night -the -unsuspecting -hut -keeper -having -as -he -believed -secured -himself -against -assault -was -lying -wrapped -in -his -blankets -sleeping -profoundly -the -blacks -crept -stealthily -down -the -chimney -and -battered -in -his -skull -while -he -slept -one -could -guess -the -whole -drama -from -that -little -text -the -curtain -was -up -it -would -not -fall -until -the -mastership -of -one -party -or -the -other -was -determined -and -permanently -there -was -treachery -on -both -sides -the -blacks -killed -the -whites -when -they -found -them -defenseless -and -the -whites -slew -the -blacks -in -a -wholesale -and -promiscuous -fashion -which -offended -against -my -childish -sense -of -justice -they -were -regarded -as -little -above -the -level -of -brutes -and -in -some -cases -were -destroyed -like -vermin -here -is -an -instance -a -squatter -whose -station -was -surrounded -by -blacks -whom -he -suspected -to -be -hostile -and -from -whom -he -feared -an -attack -parleyed -with -them -from -his -house -door -he -told -them -it -was -christmas -time -a -time -at -which -all -men -black -or -white -feasted -that -there -were -flour -sugar -plums -good -things -in -plenty -in -the -store -and -that -he -would -make -for -them -such -a -pudding -as -they -had -never -dreamed -of -a -great -pudding -of -which -all -might -eat -and -be -filled -the -blacks -listened -and -were -lost -the -pudding -was -made -and -distributed -next -morning -there -was -howling -in -the -camp -for -it -had -been -sweetened -with -sugar -and -arsenic! -the -white -man's -spirit -was -right -but -his -method -was -wrong -his -spirit -was -the -spirit -which -the -civilized -white -has -always -exhibited -toward -the -savage -but -the -use -of -poison -was -a -departure -from -custom -true -it -was -merely -a -technical -departure -not -a -real -one -still -it -was -a -departure -and -therefore -a -mistake -in -my -opinion -it -was -better -kinder -swifter -and -much -more -humane -than -a -number -of -the -methods -which -have -been -sanctified -by -custom -but -that -does -not -justify -its -employment -that -is -it -does -not -wholly -justify -it -its -unusual -nature -makes -it -stand -out -and -attract -an -amount -of -attention -which -it -is -not -entitled -to -it -takes -hold -upon -morbid -imaginations -and -they -work -it -up -into -a -sort -of -exhibition -of -cruelty -and -this -smirches -the -good -name -of -our -civilization -whereas -one -of -the -old -harsher -methods -would -have -had -no -such -effect -because -usage -has -made -those -methods -familiar -to -us -and -innocent -in -many -countries -we -have -chained -the -savage -and -starved -him -to -death -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -many -countries -we -have -burned -the -savage -at -the -stake -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -is -loving -kindness -to -it -in -more -than -one -country -we -have -hunted -the -savage -and -his -little -children -and -their -mother -with -dogs -and -guns -through -the -woods -and -swamps -for -an -afternoon's -sport -and -filled -the -region -with -happy -laughter -over -their -sprawling -and -stumbling -flight -and -their -wild -supplications -for -mercy -but -this -method -we -do -not -mind -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -many -countries -we -have -taken -the -savage's -land -from -him -and -made -him -our -slave -and -lashed -him -every -day -and -broken -his -pride -and -made -death -his -only -friend -and -overworked -him -till -he -dropped -in -his -tracks -and -this -we -do -not -care -for -because -custom -has -inured -us -to -it -yet -a -quick -death -by -poison -is -loving -kindness -to -it -in -the -matabeleland -today -why -there -we -are -confining -ourselves -to -sanctified -custom -we -rhodes -beit -millionaires -in -south -africa -and -dukes -in -london -and -nobody -cares -because -we -are -used -to -the -old -holy -customs -and -all -we -ask -is -that -no -notice -inviting -new -ones -shall -be -intruded -upon -the -attention -of -our -comfortable -consciences -mrs -praed -says -of -the -poisoner -that -squatter -deserves -to -have -his -name -handed -down -to -the -contempt -of -posterity -i -am -sorry -to -hear -her -say -that -i -myself -blame -him -for -one -thing -and -severely -but -i -stop -there -i -blame -him -for -the -indiscretion -of -introducing -a -novelty -which -was -calculated -to -attract -attention -to -our -civilization -there -was -no -occasion -to -do -that -it -was -his -duty -and -it -is -every -loyal -man's -duty -to -protect -that -heritage -in -every -way -he -can -and -the -best -way -to -do -that -is -to -attract -attention -elsewhere -the -squatter's -judgment -was -bad -that -is -plain -but -his -heart -was -right -he -is -almost -the -only -pioneering -representative -of -civilization -in -history -who -has -risen -above -the -prejudices -of -his -caste -and -his -heredity -and -tried -to -introduce -the -element -of -mercy -into -the -superior -race's -dealings -with -the -savage -his -name -is -lost -and -it -is -a -pity -for -it -deserves -to -be -handed -down -to -posterity -with -homage -and -reverence -this -paragraph -is -from -a -london -journal -to -learn -what -france -is -doing -to -spread -the -blessings -of -civilization -in -her -distant -dependencies -we -may -turn -with -advantage -to -new -caledonia -with -a -view -to -attracting -free -settlers -to -that -penal -colony -m -feillet -the -governor -forcibly -expropriated -the -kanaka -cultivators -from -the -best -of -their -plantations -with -a -derisory -compensation -in -spite -of -the -protests -of -the -council -general -of -the -island -such -immigrants -as -could -be -induced -to -cross -the -seas -thus -found -themselves -in -possession -of -thousands -of -coffee -cocoa -banana -and -bread -fruit -trees -the -raising -of -which -had -cost -the -wretched -natives -years -of -toil -whilst -the -latter -had -a -few -five -franc -pieces -to -spend -in -the -liquor -stores -of -noumea -you -observe -the -combination -it -is -robbery -humiliation -and -slow -slow -murder -through -poverty -and -the -white -man's -whisky -the -savage's -gentle -friend -the -savage's -noble -friend -the -only -magnanimous -and -unselfish -friend -the -savage -has -ever -had -was -not -there -with -the -merciful -swift -release -of -his -poisoned -pudding -there -are -many -humorous -things -in -the -world -among -them -the -white -man's -notion -that -he -is -less -savage -than -the -other -savages -[see -chapter -on -tasmania -post -] -chapter -xxii -nothing -is -so -ignorant -as -a -man's -left -hand -except -a -lady's -watch -pudd'nhead -wilson's -new -calendar -you -notice -that -mrs -praed -knows -her -art -she -can -place -a -thing -before -you -so -that -you -can -see -it -she -is -not -alone -in -that -australia -is -fertile -in -writers -whose -books -are -faithful -mirrors -of -the -life -of -the -country -and -of -its -history -the -materials -were -surprisingly -rich -both -in -quality -and -in -mass -and -marcus -clarke -ralph -boldrewood -cordon -kendall -and -the -others -have -built -out -of -them -a -brilliant -and -vigorous -literature -and -one -which -must -endure -materials -there -is -no -end -to -them! -why -a -literature -might -be -made -out -of -the -aboriginal -all -by -himself -his -character -and -ways -are -so -freckled -with -varieties -varieties -not -staled -by -familiarity -but -new -to -us -you -do -not -need -to -invent -any -picturesquenesses -whatever -you -want -in -that -line -he -can -furnish -you -and -they -will -not -be -fancies -and -doubtful -but -realities -and -authentic -in -his -history -as -preserved -by -the -white -man's -official -records -he -is -everything -everything -that -a -human -creature -can -be -he -covers -the -entire -ground -he -is -a -coward -there -are -a -thousand -fact -to -prove -it -he -is -brave -there -are -a -thousand -facts -to -prove -it -he -is -treacherous -oh -beyond -imagination! -he -is -faithful -loyal -true -the -white -man's -records -supply -you -with -a -harvest -of -instances -of -it -that -are -noble -worshipful -and -pathetically -beautiful -he -kills -the -starving -stranger -who -comes -begging -for -food -and -shelter -there -is -proof -of -it -he -succors -and -feeds -and -guides -to -safety -to -day -the -lost -stranger -who -fired -on -him -only -yesterday -there -is -proof -of -it -he -takes -his -reluctant -bride -by -force -he -courts -her -with -a -club -then -loves -her -faithfully -through -a -long -life -it -is -of -record -he -gathers -to -himself -another -wife -by -the -same -processes -beats -and -bangs -her -as -a -daily -diversion -and -by -and -by -lays -down -his -life -in -defending -her -from -some -outside -harm -it -is -of -record -he -will -face -a -hundred -hostiles -to -rescue -one -of -his -children -and -will -kill -another -of -his -children -because -the -family -is -large -enough -without -it -his -delicate -stomach -turns -at -certain -details -of -the -white -man's -food -but -he -likes -over -ripe -fish -and -brazed -dog -and -cat -and -rat -and -will -eat -his -own -uncle -with -relish -he -is -a -sociable -animal -yet -he -turns -aside -and -hides -behind -his -shield -when -his -mother -in -law -goes -by -he -is -childishly -afraid -of -ghosts -and -other -trivialities -that -menace -his -soul -but -dread -of -physical -pain -is -a -weakness -which -he -is -not -acquainted -with -he -knows -all -the -great -and -many -of -the -little -constellations -and -has -names -for -them -he -has -a -symbol -writing -by -means -of -which -he -can -convey -messages -far -and -wide -among -the -tribes -he -has -a -correct -eye -for -form -and -expression -and -draws -a -good -picture -he -can -track -a -fugitive -by -delicate -traces -which -the -white -man's -eye -cannot -discern -and -by -methods -which -the -finest -white -intelligence -cannot -master -he -makes -a -missile -which -science -itself -cannot -duplicate -without -the -model -if -with -it -a -missile -whose -secret -baffled -and -defeated -the -searchings -and -theorizings -of -the -white -mathematicians -for -seventy -years -and -by -an -art -all -his -own -he -performs -miracles -with -it -which -the -white -man -cannot -approach -untaught -nor -parallel -after -teaching -within -certain -limits -this -savage's -intellect -is -the -alertest -and -the -brightest -known -to -history -or -tradition -and -yet -the -poor -creature -was -never -able -to -invent -a -counting -system -that -would -reach -above -five -nor -a -vessel -that -he -could -boil -water -in -he -is -the -prize -curiosity -of -all -the -races -to -all -intents -and -purposes -he -is -dead -in -the -body -but -he -has -features -that -will -live -in -literature -mr -philip -chauncy -an -officer -of -the -victorian -government -contributed -to -its -archives -a -report -of -his -personal -observations -of -the -aboriginals -which -has -in -it -some -things -which -i -wish -to -condense -slightly -and -insert -here -he -speaks -of -the -quickness -of -their -eyes -and -the -accuracy -of -their -judgment -of -the -direction -of -approaching -missiles -as -being -quite -extraordinary -and -of -the -answering -suppleness -and -accuracy -of -limb -and -muscle -in -avoiding -the -missile -as -being -extraordinary -also -he -has -seen -an -aboriginal -stand -as -a -target -for -cricket -balls -thrown -with -great -force -ten -or -fifteen -yards -by -professional -bowlers -and -successfully -dodge -them -or -parry -them -with -his -shield -during -about -half -an -hour -one -of -those -balls -properly -placed -could -have -killed -him -yet -he -depended -with -the -utmost -self -possession -on -the -quickness -of -his -eye -and -his -agility -the -shield -was -the -customary -war -shield -of -his -race -and -would -not -be -a -protection -to -you -or -to -me -it -is -no -broader -than -a -stovepipe -and -is -about -as -long -as -a -man's -arm -the -opposing -surface -is -not -flat -but -slopes -away -from -the -centerline -like -a -boat's -bow -the -difficulty -about -a -cricket -ball -that -has -been -thrown -with -a -scientific -twist -is -that -it -suddenly -changes -it -course -when -it -is -close -to -its -target -and -comes -straight -for -the -mark -when -apparently -it -was -going -overhead -or -to -one -side -i -should -not -be -able -to -protect -myself -from -such -balls -for -half -an -hour -or -less -mr -chauncy -once -saw -a -little -native -man -throw -a -cricket -ball -119 -yards -this -is -said -to -beat -the -english -professional -record -by -thirteen -yards -we -have -all -seen -the -circus -man -bound -into -the -air -from -a -spring -board -and -make -a -somersault -over -eight -horses -standing -side -by -side -mr -chauncy -saw -an -aboriginal -do -it -over -eleven -and -was -assured -that -he -had -sometimes -done -it -over -fourteen -but -what -is -that -to -this -i -saw -the -same -man -leap -from -the -ground -and -in -going -over -he -dipped -his -head -unaided -by -his -hands -into -a -hat -placed -in -an -inverted -position -on -the -top -of -the -head -of -another -man -sitting -upright -on -horseback -both -man -and -horse -being -of -the -average -size -the -native -landed -on -the -other -side -of -the -horse -with -the -hat -fairly -on -his -head -the -prodigious -height -of -the -leap -and -the -precision -with -which -it -was -taken -so -as -to -enable -him -to -dip -his -head -into -the -hat -exceeded -any -feat -of -the -kind -i -have -ever -beheld -i -should -think -so! -on -board -a -ship -lately -i -saw -a -young -oxford -athlete -run -four -steps -and -spring -into -the -air -and -squirm -his -hips -by -a -side -twist -over -a -bar -that -was -five -and -one -half -feet -high -but -he -could -not -have -stood -still -and -cleared -a -bar -that -was -four -feet -high -i -know -this -because -i -tried -it -myself -one -can -see -now -where -the -kangaroo -learned -its -art -sir -george -grey -and -mr -eyre -testify -that -the -natives -dug -wells -fourteen -or -fifteen -feet -deep -and -two -feet -in -diameter -at -the -bore -dug -them -in -the -sand -wells -that -were -quite -circular -carried -straight -down -and -the -work -beautifully -executed -their -tools -were -their -hands -and -feet -how -did -they -throw -sand -out -from -such -a -depth -how -could -they -stoop -down -and -get -it -with -only -two -feet -of -space -to -stoop -in -how -did -they -keep -that -sand -pipe -from -caving -in -on -them -i -do -not -know -still -they -did -manage -those -seeming -impossibilities -swallowed -the -sand -may -be -mr -chauncy -speaks -highly -of -the -patience -and -skill -and -alert -intelligence -of -the -native -huntsman -when -he -is -stalking -the -emu -the -kangaroo -and -other -game -as -he -walks -through -the -bush -his -step -is -light -elastic -and -noiseless -every -track -on -the -earth -catches -his -keen -eye -a -leaf -or -fragment -of -a -stick -turned -or -a -blade -of -grass -recently -bent -by -the -tread -of -one -of -the -lower -animals -instantly -arrests -his -attention -in -fact -nothing -escapes -his -quick -and -powerful -sight -on -the -ground -in -the -trees -or -in -the -distance -which -may -supply -him -with -a -meal -or -warn -him -of -danger -a -little -examination -of -the -trunk -of -a -tree -which -may -be -nearly -covered -with -the -scratches -of -opossums -ascending -and -descending -is -sufficient -to -inform -him -whether -one -went -up -the -night -before -without -coming -down -again -or -not -fennimore -cooper -lost -his -chance -he -would -have -known -how -to -value -these -people -he -wouldn't -have -traded -the -dullest -of -them -for -the -brightest -mohawk -he -ever -invented -all -savages -draw -outline -pictures -upon -bark -but -the -resemblances -are -not -close -and -expression -is -usually -lacking -but -the -australian -aboriginal's -pictures -of -animals -were -nicely -accurate -in -form -attitude -carriage -and -he -put -spirit -into -them -and -expression -and -his -pictures -of -white -people -and -natives -were -pretty -nearly -as -good -as -his -pictures -of -the -other -animals -he -dressed -his -whites -in -the -fashion -of -their -day -both -the -ladies -and -the -gentlemen -as -an -untaught -wielder -of -the -pencil -it -is -not -likely -that -he -has -had -his -equal -among -savage -people -his -place -in -art -as -to -drawing -not -color -work -is -well -up -all -things -considered -his -art -is -not -to -be -classified -with -savage -art -at -all -but -on -a -plane -two -degrees -above -it -and -one -degree -above -the -lowest -plane -of -civilized -art -to -be -exact -his -place -in -art -is -between -botticelli -and -de -maurier -that -is -to -say -he -could -not -draw -as -well -as -de -maurier -but -better -than -boticelli -in -feeling -he -resembles -both -also -in -grouping -and -in -his -preferences -in -the -matter -of -subjects -his -corrobboree -of -the -australian -wilds -reappears -in -de -maurier's -belgravian -ballrooms -with -clothes -and -the -smirk -of -civilization -added -botticelli's -spring -is -the -corrobboree -further -idealized -but -with -fewer -clothes -and -more -smirk -and -well -enough -as -to -intention -but -my -word! -the -aboriginal -can -make -a -fire -by -friction -i -have -tried -that -all -savages -are -able -to -stand -a -good -deal -of -physical -pain -the -australian -aboriginal -has -this -quality -in -a -well -developed -degree -do -not -read -the -following -instances -if -horrors -are -not -pleasant -to -you -they -were -recorded -by -the -rev -henry -n -wolloston -of -melbourne -who -had -been -a -surgeon -before -he -became -a -clergyman -1 -in -the -summer -of -1852 -i -started -on -horseback -from -albany -king -george's -sound -to -visit -at -cape -riche -accompanied -by -a -native -on -foot -we -traveled -about -forty -miles -the -first -day -then -camped -by -a -water -hole -for -the -night -after -cooking -and -eating -our -supper -i -observed -the -native -who -had -said -nothing -to -me -on -the -subject -collect -the -hot -embers -of -the -fire -together -and -deliberately -place -his -right -foot -in -the -glowing -mass -for -a -moment -then -suddenly -withdraw -it -stamping -on -the -ground -and -uttering -a -long -drawn -guttural -sound -of -mingled -pain -and -satisfaction -this -operation -he -repeated -several -times -on -my -inquiring -the -meaning -of -his -strange -conduct -he -only -said -'me -carpenter -make -'em' -'i -am -mending -my -foot' -and -then -showed -me -his -charred -great -toe -the -nail -of -which -had -been -torn -off -by -a -tea -tree -stump -in -which -it -had -been -caught -during -the -journey -and -the -pain -of -which -he -had -borne -with -stoical -composure -until -the -evening -when -he -had -an -opportunity -of -cauterizing -the -wound -in -the -primitive -manner -above -described -and -he -proceeded -on -the -journey -the -next -day -as -if -nothing -had -happened -and -walked -thirty -miles -it -was -a -strange -idea -to -keep -a -surgeon -and -then -do -his -own -surgery -2 -a -native -about -twenty -five -years -of -age -once -applied -to -me -as -a -doctor -to -extract -the -wooden -barb -of -a -spear -which -during -a -fight -in -the -bush -some -four -months -previously -had -entered -his -chest -just -missing -the -heart -and -penetrated -the -viscera -to -a -considerable -depth -the -spear -had -been -cut -off -leaving -the -barb -behind -which -continued -to -force -its -way -by -muscular -action -gradually -toward -the -back -and -when -i -examined -him -i -could -feel -a -hard -substance -between -the -ribs -below -the -left -blade -bone -i -made -a -deep -incision -and -with -a -pair -of -forceps -extracted -the -barb -which -was -made -as -usual -of -hard -wood -about -four -inches -long -and -from -half -an -inch -to -an -inch -thick -it -was -very -smooth -and -partly -digested -so -to -speak -by -the -maceration -to -which -it -had -been -exposed -during -its -four -months' -journey -through -the -body -the -wound -made -by -the -spear -had -long -since -healed -leaving -only -a -small -cicatrix -and -after -the -operation -which -the -native -bore -without -flinching -he -appeared -to -suffer -no -pain -indeed -judging -from -his -good -state -of -health -the -presence -of -the -foreign -matter -did -not -materially -annoy -him -he -was -perfectly -well -in -a -few -days -but -no -3 -is -my -favorite -whenever -i -read -it -i -seem -to -enjoy -all -that -the -patient -enjoyed -whatever -it -was -3 -once -at -king -george's -sound -a -native -presented -himself -to -me -with -one -leg -only -and -requested -me -to -supply -him -with -a -wooden -leg -he -had -traveled -in -this -maimed -state -about -ninety -six -miles -for -this -purpose -i -examined -the -limb -which -had -been -severed -just -below -the -knee -and -found -that -it -had -been -charred -by -fire -while -about -two -inches -of -the -partially -calcined -bone -protruded -through -the -flesh -i -at -once -removed -this -with -the -saw -and -having -made -as -presentable -a -stump -of -it -as -i -could -covered -the -amputated -end -of -the -bone -with -a -surrounding -of -muscle -and -kept -the -patient -a -few -days -under -my -care -to -allow -the -wound -to -heal -on -inquiring -the -native -told -me -that -in -a -fight -with -other -black -fellows -a -spear -had -struck -his -leg -and -penetrated -the -bone -below -the -knee -finding -it -was -serious -he -had -recourse -to -the -following -crude -and -barbarous -operation -which -it -appears -is -not -uncommon -among -these -people -in -their -native -state -he -made -a -fire -and -dug -a -hole -in -the -earth -only -sufficiently -large -to -admit -his -leg -and -deep -enough -to -allow -the -wounded -part -to -be -on -a -level -with -the -surface -of -the -ground -he -then -surrounded -the -limb -with -the -live -coals -or -charcoal -which -was -replenished -until -the -leg -was -literally -burnt -off -the -cauterization -thus -applied -completely -checked -the -hemorrhage -and -he -was -able -in -a -day -or -two -to -hobble -down -to -the -sound -with -the -aid -of -a -long -stout -stick -although -he -was -more -than -a -week -on -the -road -but -he -was -a -fastidious -native -he -soon -discarded -the -wooden -leg -made -for -him -by -the -doctor -because -it -had -no -feeling -in -it -it -must -have -had -as -much -as -the -one -he -burnt -off -i -should -think -so -much -for -the -aboriginals -it -is -difficult -for -me -to -let -them -alone -they -are -marvelously -interesting -creatures -for -a -quarter -of -a -century -now -the -several -colonial -governments -have -housed -their -remnants -in -comfortable -stations -and -fed -them -well -and -taken -good -care -of -them -in -every -way -if -i -had -found -this -out -while -i -was -in -australia -i -could -have -seen -some -of -those -people -but -i -didn't -i -would -walk -thirty -miles -to -see -a -stuffed -one -australia -has -a -slang -of -its -own -this -is -a -matter -of -course -the -vast -cattle -and -sheep -industries -the -strange -aspects -of -the -country -and -the -strange -native -animals -brute -and -human -are -matters -which -would -naturally -breed -a -local -slang -i -have -notes -of -this -slang -somewhere -but -at -the -moment -i -can -call -to -mind -only -a -few -of -the -words -and -phrases -they -are -expressive -ones -the -wide -sterile -unpeopled -deserts -have -created -eloquent -phrases -like -no -man's -land -and -the -never -never -country -also -this -felicitous -form -she -lives -in -the -never -never -country -that -is -she -is -an -old -maid -and -this -one -is -not -without -merit -heifer -paddock -young -ladies' -seminary -bail -up -and -stick -up -equivalent -of -our -highwayman -term -to -hold -up -a -stage -coach -or -a -train -new -chum -is -the -equivalent -of -our -tenderfoot -new -arrival -and -then -there -is -the -immortal -my -word! -we -must -import -it -m -y -word! -in -cold -print -it -is -the -equivalent -of -our -ger -rreat -caesar! -but -spoken -with -the -proper -australian -unction -and -fervency -it -is -worth -six -of -it -for -grace -and -charm -and -expressiveness -our -form -is -rude -and -explosive -it -is -not -suited -to -the -drawing -room -or -the -heifer -paddock -but -m -y -word! -is -and -is -music -to -the -ear -too -when -the -utterer -knows -how -to -say -it -i -saw -it -in -print -several -times -on -the -pacific -ocean -but -it -struck -me -coldly -it -aroused -no -sympathy -that -was -because -it -was -the -dead -corpse -of -the -thing -the -'soul -was -not -there -the -tones -were -lacking -the -informing -spirit -the -deep -feeling -the -eloquence -but -the -first -time -i -heard -an -australian -say -it -it -was -positively -thrilling -chapter -xxiii -be -careless -in -your -dress -if -you -must -but -keep -a -tidy -soul -pudd'nhead -wilson's -new -calendar -we -left -adelaide -in -due -course -and -went -to -horsham -in -the -colony -of -victoria -a -good -deal -of -a -journey -if -i -remember -rightly -but -pleasant -horsham -sits -in -a -plain -which -is -as -level -as -a -floor -one -of -those -famous -dead -levels -which -australian -books -describe -so -often -gray -bare -sombre -melancholy -baked -cracked -in -the -tedious -long -drouths -but -a -horizonless -ocean -of -vivid -green -grass -the -day -after -a -rain -a -country -town -peaceful -reposeful -inviting -full -of -snug -homes -with -garden -plots -and -plenty -of -shrubbery -and -flowers -horsham -october -17 -at -the -hotel -the -weather -divine -across -the -way -in -front -of -the -london -bank -of -australia -is -a -very -handsome -cottonwood -it -is -in -opulent -leaf -and -every -leaf -perfect -the -full -power -of -the -on -rushing -spring -is -upon -it -and -i -imagine -i -can -see -it -grow -alongside -the -bank -and -a -little -way -back -in -the -garden -there -is -a -row -of -soaring -fountain -sprays -of -delicate -feathery -foliage -quivering -in -the -breeze -and -mottled -with -flashes -of -light -that -shift -and -play -through -the -mass -like -flash -lights -through -an -opal -a -most -beautiful -tree -and -a -striking -contrast -to -the -cottonwood -every -leaf -of -the -cottonwood -is -distinctly -defined -it -is -a -kodak -for -faithful -hard -unsentimental -detail -the -other -an -impressionist -picture -delicious -to -look -upon -full -of -a -subtle -and -exquisite -charm -but -all -details -fused -in -a -swoon -of -vague -and -soft -loveliness -it -turned -out -upon -inquiry -to -be -a -pepper -tree -an -importation -from -china -it -has -a -silky -sheen -soft -and -rich -i -saw -some -that -had -long -red -bunches -of -currant -like -berries -ambushed -among -the -foliage -at -a -distance -in -certain -lights -they -give -the -tree -a -pinkish -tint -and -a -new -charm -there -is -an -agricultural -college -eight -miles -from -horsham -we -were -driven -out -to -it -by -its -chief -the -conveyance -was -an -open -wagon -the -time -noonday -no -wind -the -sky -without -a -cloud -the -sunshine -brilliant -and -the -mercury -at -92 -deg -in -the -shade -in -some -countries -an -indolent -unsheltered -drive -of -an -hour -and -a -half -under -such -conditions -would -have -been -a -sweltering -and -prostrating -experience -but -there -was -nothing -of -that -in -this -case -it -is -a -climate -that -is -perfect -there -was -no -sense -of -heat -indeed -there -was -no -heat -the -air -was -fine -and -pure -and -exhilarating -if -the -drive -had -lasted -half -a -day -i -think -we -should -not -have -felt -any -discomfort -or -grown -silent -or -droopy -or -tired -of -course -the -secret -of -it -was -the -exceeding -dryness -of -the -atmosphere -in -that -plain -112 -deg -in -the -shade -is -without -doubt -no -harder -upon -a -man -than -is -88 -or -90 -deg -in -new -york -the -road -lay -through -the -middle -of -an -empty -space -which -seemed -to -me -to -be -a -hundred -yards -wide -between -the -fences -i -was -not -given -the -width -in -yards -but -only -in -chains -and -perches -and -furlongs -i -think -i -would -have -given -a -good -deal -to -know -what -the -width -was -but -i -did -not -pursue -the -matter -i -think -it -is -best -to -put -up -with -information -the -way -you -get -it -and -seem -satisfied -with -it -and -surprised -at -it -and -grateful -for -it -and -say -my -word! -and -never -let -on -it -was -a -wide -space -i -could -tell -you -how -wide -in -chains -and -perches -and -furlongs -and -things -but -that -would -not -help -you -any -those -things -sound -well -but -they -are -shadowy -and -indefinite -like -troy -weight -and -avoirdupois -nobody -knows -what -they -mean -when -you -buy -a -pound -of -a -drug -and -the -man -asks -you -which -you -want -troy -or -avoirdupois -it -is -best -to -say -yes -and -shift -the -subject -they -said -that -the -wide -space -dates -from -the -earliest -sheep -and -cattle -raising -days -people -had -to -drive -their -stock -long -distances -immense -journeys -from -worn -out -places -to -new -ones -where -were -water -and -fresh -pasturage -and -this -wide -space -had -to -be -left -in -grass -and -unfenced -or -the -stock -would -have -starved -to -death -in -the -transit -on -the -way -we -saw -the -usual -birds -the -beautiful -little -green -parrots -the -magpie -and -some -others -and -also -the -slender -native -bird -of -modest -plumage -and -the -eternally -forgettable -name -the -bird -that -is -the -smartest -among -birds -and -can -give -a -parrot -30 -to -1 -in -the -game -and -then -talk -him -to -death -i -cannot -recall -that -bird's -name -i -think -it -begins -with -m -i -wish -it -began -with -g -or -something -that -a -person -can -remember -the -magpie -was -out -in -great -force -in -the -fields -and -on -the -fences -he -is -a -handsome -large -creature -with -snowy -white -decorations -and -is -a -singer -he -has -a -murmurous -rich -note -that -is -lovely -he -was -once -modest -even -diffident -but -he -lost -all -that -when -he -found -out -that -he -was -australia's -sole -musical -bird -he -has -talent -and -cuteness -and -impudence -and -in -his -tame -state -he -is -a -most -satisfactory -pet -never -coming -when -he -is -called -always -coming -when -he -isn't -and -studying -disobedience -as -an -accomplishment -he -is -not -confined -but -loafs -all -over -the -house -and -grounds -like -the -laughing -jackass -i -think -he -learns -to -talk -i -know -he -learns -to -sing -tunes -and -his -friends -say -that -he -knows -how -to -steal -without -learning -i -was -acquainted -with -a -tame -magpie -in -melbourne -he -had -lived -in -a -lady's -house -several -years -and -believed -he -owned -it -the -lady -had -tamed -him -and -in -return -he -had -tamed -the -lady -he -was -always -on -deck -when -not -wanted -always -having -his -own -way -always -tyrannizing -over -the -dog -and -always -making -the -cat's -life -a -slow -sorrow -and -a -martyrdom -he -knew -a -number -of -tunes -and -could -sing -them -in -perfect -time -and -tune -and -would -do -it -too -at -any -time -that -silence -was -wanted -and -then -encore -himself -and -do -it -again -but -if -he -was -asked -to -sing -he -would -go -out -and -take -a -walk -it -was -long -believed -that -fruit -trees -would -not -grow -in -that -baked -and -waterless -plain -around -horsham -but -the -agricultural -college -has -dissipated -that -idea -its -ample -nurseries -were -producing -oranges -apricots -lemons -almonds -peaches -cherries -48 -varieties -of -apples -in -fact -all -manner -of -fruits -and -in -abundance -the -trees -did -not -seem -to -miss -the -water -they -were -in -vigorous -and -flourishing -condition -experiments -are -made -with -different -soils -to -see -what -things -thrive -best -in -them -and -what -climates -are -best -for -them -a -man -who -is -ignorantly -trying -to -produce -upon -his -farm -things -not -suited -to -its -soil -and -its -other -conditions -can -make -a -journey -to -the -college -from -anywhere -in -australia -and -go -back -with -a -change -of -scheme -which -will -make -his -farm -productive -and -profitable -there -were -forty -pupils -there -a -few -of -them -farmers -relearning -their -trade -the -rest -young -men -mainly -from -the -cities -novices -it -seemed -a -strange -thing -that -an -agricultural -college -should -have -an -attraction -for -city -bred -youths -but -such -is -the -fact -they -are -good -stuff -too -they -are -above -the -agricultural -average -of -intelligence -and -they -come -without -any -inherited -prejudices -in -favor -of -hoary -ignorances -made -sacred -by -long -descent -the -students -work -all -day -in -the -fields -the -nurseries -and -the -shearing -sheds -learning -and -doing -all -the -practical -work -of -the -business -three -days -in -a -week -on -the -other -three -they -study -and -hear -lectures -they -are -taught -the -beginnings -of -such -sciences -as -bear -upon -agriculture -like -chemistry -for -instance -we -saw -the -sophomore -class -in -sheep -shearing -shear -a -dozen -sheep -they -did -it -by -hand -not -with -the -machine -the -sheep -was -seized -and -flung -down -on -his -side -and -held -there -and -the -students -took -off -his -coat -with -great -celerity -and -adroitness -sometimes -they -clipped -off -a -sample -of -the -sheep -but -that -is -customary -with -shearers -and -they -don't -mind -it -they -don't -even -mind -it -as -much -as -the -sheep -they -dab -a -splotch -of -sheep -dip -on -the -place -and -go -right -ahead -the -coat -of -wool -was -unbelievably -thick -before -the -shearing -the -sheep -looked -like -the -fat -woman -in -the -circus -after -it -he -looked -like -a -bench -he -was -clipped -to -the -skin -and -smoothly -and -uniformly -the -fleece -comes -from -him -all -in -one -piece -and -has -the -spread -of -a -blanket -the -college -was -flying -the -australian -flag -the -gridiron -of -england -smuggled -up -in -the -northwest -corner -of -a -big -red -field -that -had -the -random -stars -of -the -southern -cross -wandering -around -over -it -from -horsham -we -went -to -stawell -by -rail -still -in -the -colony -of -victoria -stawell -is -in -the -gold -mining -country -in -the -bank -safe -was -half -a -peck -of -surface -gold -gold -dust -grain -gold -rich -pure -in -fact -and -pleasant -to -sift -through -one's -fingers -and -would -be -pleasanter -if -it -would -stick -and -there -were -a -couple -of -gold -bricks -very -heavy -to -handle -and -worth -$7 -500 -a -piece -they -were -from -a -very -valuable -quartz -mine -a -lady -owns -two -thirds -of -it -she -has -an -income -of -$75 -000 -a -month -from -it -and -is -able -to -keep -house -the -stawell -region -is -not -productive -of -gold -only -it -has -great -vineyards -and -produces -exceptionally -fine -wines -one -of -these -vineyards -the -great -western -owned -by -mr -irving -is -regarded -as -a -model -its -product -has -reputation -abroad -it -yields -a -choice -champagne -and -a -fine -claret -and -its -hock -took -a -prize -in -france -two -or -three -years -ago -the -champagne -is -kept -in -a -maze -of -passages -under -ground -cut -in -the -rock -to -secure -it -an -even -temperature -during -the -three -year -term -required -to -perfect -it -in -those -vaults -i -saw -120 -000 -bottles -of -champagne -the -colony -of -victoria -has -a -population -of -1 -000 -000 -and -those -people -are -said -to -drink -25 -000 -000 -bottles -of -champagne -per -year -the -dryest -community -on -the -earth -the -government -has -lately -reduced -the -duty -upon -foreign -wines -that -is -one -of -the -unkindnesses -of -protection -a -man -invests -years -of -work -and -a -vast -sum -of -money -in -a -worthy -enterprise -upon -the -faith -of -existing -laws -then -the -law -is -changed -and -the -man -is -robbed -by -his -own -government -on -the -way -back -to -stawell -we -had -a -chance -to -see -a -group -of -boulders -called -the -three -sisters -a -curiosity -oddly -located -for -it -was -upon -high -ground -with -the -land -sloping -away -from -it -and -no -height -above -it -from -whence -the -boulders -could -have -rolled -down -relics -of -an -early -ice -drift -perhaps -they -are -noble -boulders -one -of -them -has -the -size -and -smoothness -and -plump -sphericity -of -a -balloon -of -the -biggest -pattern -the -road -led -through -a -forest -of -great -gum -trees -lean -and -scraggy -and -sorrowful -the -road -was -cream -white -a -clayey -kind -of -earth -apparently -along -it -toiled -occasional -freight -wagons -drawn -by -long -double -files -of -oxen -those -wagons -were -going -a -journey -of -two -hundred -miles -i -was -told -and -were -running -a -successful -opposition -to -the -railway! -the -railways -are -owned -and -run -by -the -government -those -sad -gums -stood -up -out -of -the -dry -white -clay -pictures -of -patience -and -resignation -it -is -a -tree -that -can -get -along -without -water -still -it -is -fond -of -it -ravenously -so -it -is -a -very -intelligent -tree -and -will -detect -the -presence -of -hidden -water -at -a -distance -of -fifty -feet -and -send -out -slender -long -root -fibres -to -prospect -it -they -will -find -it -and -will -also -get -at -it -even -through -a -cement -wall -six -inches -thick -once -a -cement -water -pipe -under -ground -at -stawell -began -to -gradually -reduce -its -output -and -finally -ceased -altogether -to -deliver -water -upon -examining -into -the -matter -it -was -found -stopped -up -wadded -compactly -with -a -mass -of -root -fibres -delicate -and -hair -like -how -this -stuff -had -gotten -into -the -pipe -was -a -puzzle -for -some -little -time -finally -it -was -found -that -it -had -crept -in -through -a -crack -that -was -almost -invisible -to -the -eye -a -gum -tree -forty -feet -away -had -tapped -the -pipe -and -was -drinking -the -water -chapter -xxiv -there -is -no -such -thing -as -the -queen's -english -the -property -has -gone -into -the -hands -of -a -joint -stock -company -and -we -own -the -bulk -of -the -shares! -pudd'nhead -wilson's -new -calendar -frequently -in -australia -one -has -cloud -effects -of -an -unfamiliar -sort -we -had -this -kind -of -scenery -finely -staged -all -the -way -to -ballarat -consequently -we -saw -more -sky -than -country -on -that -journey -at -one -time -a -great -stretch -of -the -vault -was -densely -flecked -with -wee -ragged -edged -flakes -of -painfully -white -cloud -stuff -all -of -one -shape -and -size -and -equidistant -apart -with -narrow -cracks -of -adorable -blue -showing -between -the -whole -was -suggestive -of -a -hurricane -of -snow -flakes -drifting -across -the -skies -by -and -by -these -flakes -fused -themselves -together -in -interminable -lines -with -shady -faint -hollows -between -the -lines -the -long -satin -surfaced -rollers -following -each -other -in -simulated -movement -and -enchantingly -counterfeiting -the -majestic -march -of -a -flowing -sea -later -the -sea -solidified -itself -then -gradually -broke -up -its -mass -into -innumerable -lofty -white -pillars -of -about -one -size -and -ranged -these -across -the -firmament -in -receding -and -fading -perspective -in -the -similitude -of -a -stupendous -colonnade -a -mirage -without -a -doubt -flung -from -the -far -gates -of -the -hereafter -the -approaches -to -ballarat -were -beautiful -the -features -great -green -expanses -of -rolling -pasture -land -bisected -by -eye -contenting -hedges -of -commingled -new -gold -and -old -gold -gorse -and -a -lovely -lake -one -must -put -in -the -pause -there -to -fetch -the -reader -up -with -a -slight -jolt -and -keep -him -from -gliding -by -without -noticing -the -lake -one -must -notice -it -for -a -lovely -lake -is -not -as -common -a -thing -along -the -railways -of -australia -as -are -the -dry -places -ninety -two -in -the -shade -again -but -balmy -and -comfortable -fresh -and -bracing -a -perfect -climate -forty -five -years -ago -the -site -now -occupied -by -the -city -of -ballarat -was -a -sylvan -solitude -as -quiet -as -eden -and -as -lovely -nobody -had -ever -heard -of -it -on -the -25th -of -august -1851 -the -first -great -gold -strike -made -in -australia -was -made -here -the -wandering -prospectors -who -made -it -scraped -up -two -pounds -and -a -half -of -gold -the -first -day -worth -$600 -a -few -days -later -the -place -was -a -hive -a -town -the -news -of -the -strike -spread -everywhere -in -a -sort -of -instantaneous -way -spread -like -a -flash -to -the -very -ends -of -the -earth -a -celebrity -so -prompt -and -so -universal -has -hardly -been -paralleled -in -history -perhaps -it -was -as -if -the -name -ballarat -had -suddenly -been -written -on -the -sky -where -all -the -world -could -read -it -at -once -the -smaller -discoveries -made -in -the -colony -of -new -south -wales -three -months -before -had -already -started -emigrants -toward -australia -they -had -been -coming -as -a -stream -but -they -came -as -a -flood -now -a -hundred -thousand -people -poured -into -melbourne -from -england -and -other -countries -in -a -single -month -and -flocked -away -to -the -mines -the -crews -of -the -ships -that -brought -them -flocked -with -them -the -clerks -in -the -government -offices -followed -so -did -the -cooks -the -maids -the -coachmen -the -butlers -and -the -other -domestic -servants -so -did -the -carpenters -the -smiths -the -plumbers -the -painters -the -reporters -the -editors -the -lawyers -the -clients -the -barkeepers -the -bummers -the -blacklegs -the -thieves -the -loose -women -the -grocers -the -butchers -the -bakers -the -doctors -the -druggists -the -nurses -so -did -the -police -even -officials -of -high -and -hitherto -envied -place -threw -up -their -positions -and -joined -the -procession -this -roaring -avalanche -swept -out -of -melbourne -and -left -it -desolate -sunday -like -paralyzed -everything -at -a -stand -still -the -ships -lying -idle -at -anchor -all -signs -of -life -departed -all -sounds -stilled -save -the -rasping -of -the -cloud -shadows -as -they -scraped -across -the -vacant -streets -that -grassy -and -leafy -paradise -at -ballarat -was -soon -ripped -open -and -lacerated -and -scarified -and -gutted -in -the -feverish -search -for -its -hidden -riches -there -is -nothing -like -surface -mining -to -snatch -the -graces -and -beauties -and -benignities -out -of -a -paradise -and -make -an -odious -and -repulsive -spectacle -of -it -what -fortunes -were -made! -immigrants -got -rich -while -the -ship -unloaded -and -reloaded -and -went -back -home -for -good -in -the -same -cabin -they -had -come -out -in! -not -all -of -them -only -some -i -saw -the -others -in -ballarat -myself -forty -five -years -later -what -were -left -of -them -by -time -and -death -and -the -disposition -to -rove -they -were -young -and -gay -then -they -are -patriarchal -and -grave -now -and -they -do -not -get -excited -any -more -they -talk -of -the -past -they -live -in -it -their -life -is -a -dream -a -retrospection -ballarat -was -a -great -region -for -nuggets -no -such -nuggets -were -found -in -california -as -ballarat -produced -in -fact -the -ballarat -region -has -yielded -the -largest -ones -known -to -history -two -of -them -weighed -about -180 -pounds -each -and -together -were -worth -$90 -000 -they -were -offered -to -any -poor -person -who -would -shoulder -them -and -carry -them -away -gold -was -so -plentiful -that -it -made -people -liberal -like -that -ballarat -was -a -swarming -city -of -tents -in -the -early -days -everybody -was -happy -for -a -time -and -apparently -prosperous -then -came -trouble -the -government -swooped -down -with -a -mining -tax -and -in -its -worst -form -too -for -it -was -not -a -tax -upon -what -the -miner -had -taken -out -but -upon -what -he -was -going -to -take -out -if -he -could -find -it -it -was -a -license -tax -license -to -work -his -claim -and -it -had -to -be -paid -before -he -could -begin -digging -consider -the -situation -no -business -is -so -uncertain -as -surface -mining -your -claim -may -be -good -and -it -may -be -worthless -it -may -make -you -well -off -in -a -month -and -then -again -you -may -have -to -dig -and -slave -for -half -a -year -at -heavy -expense -only -to -find -out -at -last -that -the -gold -is -not -there -in -cost -paying -quantity -and -that -your -time -and -your -hard -work -have -been -thrown -away -it -might -be -wise -policy -to -advance -the -miner -a -monthly -sum -to -encourage -him -to -develop -the -country's -riches -but -to -tax -him -monthly -in -advance -instead -why -such -a -thing -was -never -dreamed -of -in -america -there -neither -the -claim -itself -nor -its -products -howsoever -rich -or -poor -were -taxed -the -ballarat -miners -protested -petitioned -complained -it -was -of -no -use -the -government -held -its -ground -and -went -on -collecting -the -tax -and -not -by -pleasant -methods -but -by -ways -which -must -have -been -very -galling -to -free -people -the -rumblings -of -a -coming -storm -began -to -be -audible -by -and -by -there -was -a -result -and -i -think -it -may -be -called -the -finest -thing -in -australasian -history -it -was -a -revolution -small -in -size -but -great -politically -it -was -a -strike -for -liberty -a -struggle -for -a -principle -a -stand -against -injustice -and -oppression -it -was -the -barons -and -john -over -again -it -was -hampden -and -ship -money -it -was -concord -and -lexington -small -beginnings -all -of -them -but -all -of -them -great -in -political -results -all -of -them -epoch -making -it -is -another -instance -of -a -victory -won -by -a -lost -battle -it -adds -an -honorable -page -to -history -the -people -know -it -and -are -proud -of -it -they -keep -green -the -memory -of -the -men -who -fell -at -the -eureka -stockade -and -peter -lalor -has -his -monument -the -surface -soil -of -ballarat -was -full -of -gold -this -soil -the -miners -ripped -and -tore -and -trenched -and -harried -and -disembowled -and -made -it -yield -up -its -immense -treasure -then -they -went -down -into -the -earth -with -deep -shafts -seeking -the -gravelly -beds -of -ancient -rivers -and -brooks -and -found -them -they -followed -the -courses -of -these -streams -and -gutted -them -sending -the -gravel -up -in -buckets -to -the -upper -world -and -washing -out -of -it -its -enormous -deposits -of -gold -the -next -biggest -of -the -two -monster -nuggets -mentioned -above -came -from -an -old -river -channel -180 -feet -under -ground -finally -the -quartz -lodes -were -attacked -that -is -not -poor -man's -mining -quartz -mining -and -milling -require -capital -and -staying -power -and -patience -big -companies -were -formed -and -for -several -decades -now -the -lodes -have -been -successfully -worked -and -have -yielded -great -wealth -since -the -gold -discovery -in -1853 -the -ballarat -mines -taking -the -three -kinds -of -mining -together -have -contributed -to -the -world's -pocket -something -over -three -hundred -millions -of -dollars -which -is -to -say -that -this -nearly -invisible -little -spot -on -the -earth's -surface -has -yielded -about -one -fourth -as -much -gold -in -forty -four -years -as -all -california -has -yielded -in -forty -seven -the -californian -aggregate -from -1848 -to -1895 -inclusive -as -reported -by -the -statistician -of -the -united -states -mint -is -$1 -265 -215 -217 -a -citizen -told -me -a -curious -thing -about -those -mines -with -all -my -experience -of -mining -i -had -never -heard -of -anything -of -the -sort -before -the -main -gold -reef -runs -about -north -and -south -of -course -for -that -is -the -custom -of -a -rich -gold -reef -at -ballarat -its -course -is -between -walls -of -slate -now -the -citizen -told -me -that -throughout -a -stretch -of -twelve -miles -along -the -reef -the -reef -is -crossed -at -intervals -by -a -straight -black -streak -of -a -carbonaceous -nature -a -streak -in -the -slate -a -streak -no -thicker -than -a -pencil -and -that -wherever -it -crosses -the -reef -you -will -certainly -find -gold -at -the -junction -it -is -called -the -indicator -thirty -feet -on -each -side -of -the -indicator -and -down -in -the -slate -of -course -is -a -still -finer -streak -a -streak -as -fine -as -a -pencil -mark -and -indeed -that -is -its -name -pencil -mark -whenever -you -find -the -pencil -mark -you -know -that -thirty -feet -from -it -is -the -indicator -you -measure -the -distance -excavate -find -the -indicator -trace -it -straight -to -the -reef -and -sink -your -shaft -your -fortune -is -made -for -certain -if -that -is -true -it -is -curious -and -it -is -curious -anyway -ballarat -is -a -town -of -only -40 -000 -population -and -yet -since -it -is -in -australia -it -has -every -essential -of -an -advanced -and -enlightened -big -city -this -is -pure -matter -of -course -i -must -stop -dwelling -upon -these -things -it -is -hard -to -keep -from -dwelling -upon -them -though -for -it -is -difficult -to -get -away -from -the -surprise -of -it -i -will -let -the -other -details -go -this -time -but -i -must -allow -myself -to -mention -that -this -little -town -has -a -park -of -326 -acres -a -flower -garden -of -83 -acres -with -an -elaborate -and -expensive -fernery -in -it -and -some -costly -and -unusually -fine -statuary -and -an -artificial -lake -covering -600 -acres -equipped -with -a -fleet -of -200 -shells -small -sail -boats -and -little -steam -yachts -at -this -point -i -strike -out -some -other -praiseful -things -which -i -was -tempted -to -add -i -do -not -strike -them -out -because -they -were -not -true -or -not -well -said -but -because -i -find -them -better -said -by -another -man -and -a -man -more -competent -to -testify -too -because -he -belongs -on -the -ground -and -knows -i -clip -them -from -a -chatty -speech -delivered -some -years -ago -by -mr -william -little -who -was -at -that -time -mayor -of -ballarat -the -language -of -our -citizens -in -this -as -in -other -parts -of -australasia -is -mostly -healthy -anglo -saxon -free -from -americanisms -vulgarisms -and -the -conflicting -dialects -of -our -fatherland -and -is -pure -enough -to -suit -a -trench -or -a -latham -our -youth -aided -by -climatic -influence -are -in -point -of -physique -and -comeliness -unsurpassed -in -the -sunny -south -our -young -men -are -well -ordered -and -our -maidens -'not -stepping -over -the -bounds -of -modesty -' -are -as -fair -as -psyches -dispensing -smiles -as -charming -as -november -flowers -the -closing -clause -has -the -seeming -of -a -rather -frosty -compliment -but -that -is -apparent -only -not -real -november -is -summer -time -there -his -compliment -to -the -local -purity -of -the -language -is -warranted -it -is -quite -free -from -impurities -this -is -acknowledged -far -and -wide -as -in -the -german -empire -all -cultivated -people -claim -to -speak -hanovarian -german -so -in -australasia -all -cultivated -people -claim -to -speak -ballarat -english -even -in -england -this -cult -has -made -considerable -progress -and -now -that -it -is -favored -by -the -two -great -universities -the -time -is -not -far -away -when -ballarat -english -will -come -into -general -use -among -the -educated -classes -of -great -britain -at -large -its -great -merit -is -that -it -is -shorter -than -ordinary -english -that -is -it -is -more -compressed -at -first -you -have -some -difficulty -in -understanding -it -when -it -is -spoken -as -rapidly -as -the -orator -whom -i -have -quoted -speaks -it -an -illustration -will -show -what -i -mean -when -he -called -and -i -handed -him -a -chair -he -bowed -and -said -q -presently -when -we -were -lighting -our -cigars -he -held -a -match -to -mine -and -i -said -thank -you -and -he -said -km -then -i -saw -'q' -is -the -end -of -the -phrase -i -thank -you -'km' -is -the -end -of -the -phrase -you -are -welcome -mr -little -puts -no -emphasis -upon -either -of -them -but -delivers -them -so -reduced -that -they -hardly -have -a -sound -all -ballarat -english -is -like -that -and -the -effect -is -very -soft -and -pleasant -it -takes -all -the -hardness -and -harshness -out -of -our -tongue -and -gives -to -it -a -delicate -whispery -and -vanishing -cadence -which -charms -the -ear -like -the -faint -rustling -of -the -forest -leaves -chapter -xxv -classic -a -book -which -people -praise -and -don't -read -pudd'nhead -wilson's -new -calendar -on -the -rail -again -bound -for -bendigo -from -diary -october -23 -got -up -at -6 -left -at -7 -30 -soon -reached -castlemaine -one -of -the -rich -gold -fields -of -the -early -days -waited -several -hours -for -a -train -left -at -3 -40 -and -reached -bendigo -in -an -hour -for -comrade -a -catholic -priest -who -was -better -than -i -was -but -didn't -seem -to -know -it -a -man -full -of -graces -of -the -heart -the -mind -and -the -spirit -a -lovable -man -he -will -rise -he -will -be -a -bishop -some -day -later -an -archbishop -later -a -cardinal -finally -an -archangel -i -hope -and -then -he -will -recall -me -when -i -say -do -you -remember -that -trip -we -made -from -ballarat -to -bendigo -when -you -were -nothing -but -father -c -and -i -was -nothing -to -what -i -am -now -it -has -actually -taken -nine -hours -to -come -from -ballarat -to -bendigo -we -could -have -saved -seven -by -walking -however -there -was -no -hurry -bendigo -was -another -of -the -rich -strikes -of -the -early -days -it -does -a -great -quartz -mining -business -now -that -business -which -more -than -any -other -that -i -know -of -teaches -patience -and -requires -grit -and -a -steady -nerve -the -town -is -full -of -towering -chimney -stacks -and -hoisting -works -and -looks -like -a -petroleum -city -speaking -of -patience -for -example -one -of -the -local -companies -went -steadily -on -with -its -deep -borings -and -searchings -without -show -of -gold -or -a -penny -of -reward -for -eleven -years -then -struck -it -and -became -suddenly -rich -the -eleven -years' -work -had -cost -$55 -000 -and -the -first -gold -found -was -a -grain -the -size -of -a -pin's -head -it -is -kept -under -locks -and -bars -as -a -precious -thing -and -is -reverently -shown -to -the -visitor -hats -off -when -i -saw -it -i -had -not -heard -its -history -it -is -gold -examine -it -take -the -glass -now -how -much -should -you -say -it -is -worth -i -said -i -should -say -about -two -cents -or -in -your -english -dialect -four -farthings -well -it -cost -l11 -000 -oh -come! -yes -it -did -ballarat -and -bendigo -have -produced -the -three -monumental -nuggets -of -the -world -and -this -one -is -the -monumentalest -one -of -the -three -the -other -two -represent -19 -000 -a -piece -this -one -a -couple -of -thousand -more -it -is -small -and -not -much -to -look -at -but -it -is -entitled -to -its -name -adam -it -is -the -adam -nugget -of -this -mine -and -its -children -run -up -into -the -millions -speaking -of -patience -again -another -of -the -mines -was -worked -under -heavy -expenses -during -17 -years -before -pay -was -struck -and -still -another -one -compelled -a -wait -of -21 -years -before -pay -was -struck -then -in -both -instances -the -outlay -was -all -back -in -a -year -or -two -with -compound -interest -bendigo -has -turned -out -even -more -gold -than -ballarat -the -two -together -have -produced -$650 -000 -000 -worth -which -is -half -as -much -as -california -has -produced -it -was -through -mr -blank -not -to -go -into -particulars -about -his -name -it -was -mainly -through -mr -blank -that -my -stay -in -bendigo -was -made -memorably -pleasant -and -interesting -he -explained -this -to -me -himself -he -told -me -that -it -was -through -his -influence -that -the -city -government -invited -me -to -the -town -hall -to -hear -complimentary -speeches -and -respond -to -them -that -it -was -through -his -influence -that -i -had -been -taken -on -a -long -pleasure -drive -through -the -city -and -shown -its -notable -features -that -it -was -through -his -influence -that -i -was -invited -to -visit -the -great -mines -that -it -was -through -his -influence -that -i -was -taken -to -the -hospital -and -allowed -to -see -the -convalescent -chinaman -who -had -been -attacked -at -midnight -in -his -lonely -hut -eight -weeks -before -by -robbers -and -stabbed -forty -six -times -and -scalped -besides -that -it -was -through -his -influence -that -when -i -arrived -this -awful -spectacle -of -piecings -and -patchings -and -bandagings -was -sitting -up -in -his -cot -letting -on -to -read -one -of -my -books -that -it -was -through -his -influence -that -efforts -had -been -made -to -get -the -catholic -archbishop -of -bendigo -to -invite -me -to -dinner -that -it -was -through -his -influence -that -efforts -had -been -made -to -get -the -anglican -bishop -of -bendigo -to -ask -me -to -supper -that -it -was -through -his -influence -that -the -dean -of -the -editorial -fraternity -had -driven -me -through -the -woodsy -outlying -country -and -shown -me -from -the -summit -of -lone -tree -hill -the -mightiest -and -loveliest -expanse -of -forest -clad -mountain -and -valley -that -i -had -seen -in -all -australia -and -when -he -asked -me -what -had -most -impressed -me -in -bendigo -and -i -answered -and -said -it -was -the -taste -and -the -public -spirit -which -had -adorned -the -streets -with -105 -miles -of -shade -trees -he -said -that -it -was -through -his -influence -that -it -had -been -done -but -i -am -not -representing -him -quite -correctly -he -did -not -say -it -was -through -his -influence -that -all -these -things -had -happened -for -that -would -have -been -coarse -be -merely -conveyed -that -idea -conveyed -it -so -subtly -that -i -only -caught -it -fleetingly -as -one -catches -vagrant -faint -breaths -of -perfume -when -one -traverses -the -meadows -in -summer -conveyed -it -without -offense -and -without -any -suggestion -of -egoism -or -ostentation -but -conveyed -it -nevertheless -he -was -an -irishman -an -educated -gentleman -grave -and -kindly -and -courteous -a -bachelor -and -about -forty -five -or -possibly -fifty -years -old -apparently -he -called -upon -me -at -the -hotel -and -it -was -there -that -we -had -this -talk -he -made -me -like -him -and -did -it -without -trouble -this -was -partly -through -his -winning -and -gentle -ways -but -mainly -through -the -amazing -familiarity -with -my -books -which -his -conversation -showed -he -was -down -to -date -with -them -too -and -if -he -had -made -them -the -study -of -his -life -he -could -hardly -have -been -better -posted -as -to -their -contents -than -he -was -he -made -me -better -satisfied -with -myself -than -i -had -ever -been -before -it -was -plain -that -he -had -a -deep -fondness -for -humor -yet -he -never -laughed -he -never -even -chuckled -in -fact -humor -could -not -win -to -outward -expression -on -his -face -at -all -no -he -was -always -grave -tenderly -pensively -grave -but -he -made -me -laugh -all -along -and -this -was -very -trying -and -very -pleasant -at -the -same -time -for -it -was -at -quotations -from -my -own -books -when -he -was -going -he -turned -and -said -you -don't -remember -me -i -why -no -have -we -met -before -no -it -was -a -matter -of -correspondence -correspondence -yes -many -years -ago -twelve -or -fifteen -oh -longer -than -that -but -of -course -you -a -musing -pause -then -he -said -do -you -remember -corrigan -castle -n -no -i -believe -i -don't -i -don't -seem -to -recall -the -name -he -waited -a -moment -pondering -with -the -door -knob -in -his -hand -then -started -out -but -turned -back -and -said -that -i -had -once -been -interested -in -corrigan -castle -and -asked -me -if -i -would -go -with -him -to -his -quarters -in -the -evening -and -take -a -hot -scotch -and -talk -it -over -i -was -a -teetotaler -and -liked -relaxation -so -i -said -i -would -we -drove -from -the -lecture -hall -together -about -half -past -ten -he -had -a -most -comfortably -and -tastefully -furnished -parlor -with -good -pictures -on -the -walls -indian -and -japanese -ornaments -on -the -mantel -and -here -and -there -and -books -everywhere -largely -mine -which -made -me -proud -the -light -was -brilliant -the -easy -chairs -were -deep -cushioned -the -arrangements -for -brewing -and -smoking -were -all -there -we -brewed -and -lit -up -then -he -passed -a -sheet -of -note -paper -to -me -and -said -do -you -remember -that -oh -yes -indeed! -the -paper -was -of -a -sumptuous -quality -at -the -top -was -a -twisted -and -interlaced -monogram -printed -from -steel -dies -in -gold -and -blue -and -red -in -the -ornate -english -fashion -of -long -years -ago -and -under -it -in -neat -gothic -capitals -was -this -printed -in -blue -the -mark -twain -club -corrigan -castle -187 -my! -said -i -how -did -you -come -by -this -i -was -president -of -it -no! -you -don't -mean -it -it -is -true -i -was -its -first -president -i -was -re -elected -annually -as -long -as -its -meetings -were -held -in -my -castle -corrigan -which -was -five -years -then -he -showed -me -an -album -with -twenty -three -photographs -of -me -in -it -five -of -them -were -of -old -dates -the -others -of -various -later -crops -the -list -closed -with -a -picture -taken -by -falk -in -sydney -a -month -before -you -sent -us -the -first -five -the -rest -were -bought -this -was -paradise! -we -ran -late -and -talked -talked -talked -subject -the -mark -twain -club -of -corrigan -castle -ireland -my -first -knowledge -of -that -club -dates -away -back -all -of -twenty -years -i -should -say -it -came -to -me -in -the -form -of -a -courteous -letter -written -on -the -note -paper -which -i -have -described -and -signed -by -order -of -the -president -c -pembroke -secretary -it -conveyed -the -fact -that -the -club -had -been -created -in -my -honor -and -added -the -hope -that -this -token -of -appreciation -of -my -work -would -meet -with -my -approval -i -answered -with -thanks -and -did -what -i -could -to -keep -my -gratification -from -over -exposure -it -was -then -that -the -long -correspondence -began -a -letter -came -back -by -order -of -the -president -furnishing -me -the -names -of -the -members -thirty -two -in -number -with -it -came -a -copy -of -the -constitution -and -by -laws -in -pamphlet -form -and -artistically -printed -the -initiation -fee -and -dues -were -in -their -proper -place -also -schedule -of -meetings -monthly -for -essays -upon -works -of -mine -followed -by -discussions -quarterly -for -business -and -a -supper -without -essays -but -with -after -supper -speeches -also -there -was -a -list -of -the -officers -president -vice -president -secretary -treasurer -etc -the -letter -was -brief -but -it -was -pleasant -reading -for -it -told -me -about -the -strong -interest -which -the -membership -took -in -their -new -venture -etc -etc -it -also -asked -me -for -a -photograph -a -special -one -i -went -down -and -sat -for -it -and -sent -it -with -a -letter -of -course -presently -came -the -badge -of -the -club -and -very -dainty -and -pretty -it -was -and -very -artistic -it -was -a -frog -peeping -out -from -a -graceful -tangle -of -grass -sprays -and -rushes -and -was -done -in -enamels -on -a -gold -basis -and -had -a -gold -pin -back -of -it -after -i -had -petted -it -and -played -with -it -and -caressed -it -and -enjoyed -it -a -couple -of -hours -the -light -happened -to -fall -upon -it -at -a -new -angle -and -revealed -to -me -a -cunning -new -detail -with -the -light -just -right -certain -delicate -shadings -of -the -grass -blades -and -rush -stems -wove -themselves -into -a -monogram -mine! -you -can -see -that -that -jewel -was -a -work -of -art -and -when -you -come -to -consider -the -intrinsic -value -of -it -you -must -concede -that -it -is -not -every -literary -club -that -could -afford -a -badge -like -that -it -was -easily -worth -$75 -in -the -opinion -of -messrs -marcus -and -ward -of -new -york -they -said -they -could -not -duplicate -it -for -that -and -make -a -profit -by -this -time -the -club -was -well -under -way -and -from -that -time -forth -its -secretary -kept -my -off -hours -well -supplied -with -business -he -reported -the -club's -discussions -of -my -books -with -laborious -fullness -and -did -his -work -with -great -spirit -and -ability -as -a -rule -he -synopsized -but -when -a -speech -was -especially -brilliant -he -short -handed -it -and -gave -me -the -best -passages -from -it -written -out -there -were -five -speakers -whom -he -particularly -favored -in -that -way -palmer -forbes -naylor -norris -and -calder -palmer -and -forbes -could -never -get -through -a -speech -without -attacking -each -other -and -each -in -his -own -way -was -formidably -effective -palmer -in -virile -and -eloquent -abuse -forbes -in -courtly -and -elegant -but -scalding -satire -i -could -always -tell -which -of -them -was -talking -without -looking -for -his -name -naylor -had -a -polished -style -and -a -happy -knack -at -felicitous -metaphor -norris's -style -was -wholly -without -ornament -but -enviably -compact -lucid -and -strong -but -after -all -calder -was -the -gem -he -never -spoke -when -sober -he -spoke -continuously -when -he -wasn't -and -certainly -they -were -the -drunkest -speeches -that -a -man -ever -uttered -they -were -full -of -good -things -but -so -incredibly -mixed -up -and -wandering -that -it -made -one's -head -swim -to -follow -him -they -were -not -intended -to -be -funny -but -they -were -funny -for -the -very -gravity -which -the -speaker -put -into -his -flowing -miracles -of -incongruity -in -the -course -of -five -years -i -came -to -know -the -styles -of -the -five -orators -as -well -as -i -knew -the -style -of -any -speaker -in -my -own -club -at -home -these -reports -came -every -month -they -were -written -on -foolscap -600 -words -to -the -page -and -usually -about -twenty -five -pages -in -a -report -a -good -15 -000 -words -i -should -say -a -solid -week's -work -the -reports -were -absorbingly -entertaining -long -as -they -were -but -unfortunately -for -me -they -did -not -come -alone -they -were -always -accompanied -by -a -lot -of -questions -about -passages -and -purposes -in -my -books -which -the -club -wanted -answered -and -additionally -accompanied -every -quarter -by -the -treasurer's -report -and -the -auditor's -report -and -the -committee's -report -and -the -president's -review -and -my -opinion -of -these -was -always -desired -also -suggestions -for -the -good -of -the -club -if -any -occurred -to -me -by -and -by -i -came -to -dread -those -things -and -this -dread -grew -and -grew -and -grew -grew -until -i -got -to -anticipating -them -with -a -cold -horror -for -i -was -an -indolent -man -and -not -fond -of -letter -writing -and -whenever -these -things -came -i -had -to -put -everything -by -and -sit -down -for -my -own -peace -of -mind -and -dig -and -dig -until -i -got -something -out -of -my -head -which -would -answer -for -a -reply -i -got -along -fairly -well -the -first -year -but -for -the -succeeding -four -years -the -mark -twain -club -of -corrigan -castle -was -my -curse -my -nightmare -the -grief -and -misery -of -my -life -and -i -got -so -so -sick -of -sitting -for -photographs -i -sat -every -year -for -five -years -trying -to -satisfy -that -insatiable -organization -then -at -last -i -rose -in -revolt -i -could -endure -my -oppressions -no -longer -i -pulled -my -fortitude -together -and -tore -off -my -chains -and -was -a -free -man -again -and -happy -from -that -day -i -burned -the -secretary's -fat -envelopes -the -moment -they -arrived -and -by -and -by -they -ceased -to -come -well -in -the -sociable -frankness -of -that -night -in -bendigo -i -brought -this -all -out -in -full -confession -then -mr -blank -came -out -in -the -same -frank -way -and -with -a -preliminary -word -of -gentle -apology -said -that -he -was -the -mark -twain -club -and -the -only -member -it -had -ever -had! -why -it -was -matter -for -anger -but -i -didn't -feel -any -he -said -he -never -had -to -work -for -a -living -and -that -by -the -time -he -was -thirty -life -had -become -a -bore -and -a -weariness -to -him -he -had -no -interests -left -they -had -paled -and -perished -one -by -one -and -left -him -desolate -he -had -begun -to -think -of -suicide -then -all -of -a -sudden -he -thought -of -that -happy -idea -of -starting -an -imaginary -club -and -went -straightway -to -work -at -it -with -enthusiasm -and -love -he -was -charmed -with -it -it -gave -him -something -to -do -it -elaborated -itself -on -his -hands -it -became -twenty -times -more -complex -and -formidable -than -was -his -first -rude -draft -of -it -every -new -addition -to -his -original -plan -which -cropped -up -in -his -mind -gave -him -a -fresh -interest -and -a -new -pleasure -he -designed -the -club -badge -himself -and -worked -over -it -altering -and -improving -it -a -number -of -days -and -nights -then -sent -to -london -and -had -it -made -it -was -the -only -one -that -was -made -it -was -made -for -me -the -rest -of -the -club -went -without -he -invented -the -thirty -two -members -and -their -names -he -invented -the -five -favorite -speakers -and -their -five -separate -styles -he -invented -their -speeches -and -reported -them -himself -he -would -have -kept -that -club -going -until -now -if -i -hadn't -deserted -he -said -he -said -he -worked -like -a -slave -over -those -reports -each -of -them -cost -him -from -a -week -to -a -fortnight's -work -and -the -work -gave -him -pleasure -and -kept -him -alive -and -willing -to -be -alive -it -was -a -bitter -blow -to -him -when -the -club -died -finally -there -wasn't -any -corrigan -castle -he -had -invented -that -too -it -was -wonderful -the -whole -thing -and -altogether -the -most -ingenious -and -laborious -and -cheerful -and -painstaking -practical -joke -i -have -ever -heard -of -and -i -liked -it -liked -to -bear -him -tell -about -it -yet -i -have -been -a -hater -of -practical -jokes -from -as -long -back -as -i -can -remember -finally -he -said -do -you -remember -a -note -from -melbourne -fourteen -or -fifteen -years -ago -telling -about -your -lecture -tour -in -australia -and -your -death -and -burial -in -melbourne -a -note -from -henry -bascomb -of -bascomb -hall -upper -holywell -hants -yes -i -wrote -it -m -y -word! -yes -i -did -it -i -don't -know -why -i -just -took -the -notion -and -carried -it -out -without -stopping -to -think -it -was -wrong -it -could -have -done -harm -i -was -always -sorry -about -it -afterward -you -must -forgive -me -i -was -mr -bascom's -guest -on -his -yacht -on -his -voyage -around -the -world -he -often -spoke -of -you -and -of -the -pleasant -times -you -had -had -together -in -his -home -and -the -notion -took -me -there -in -melbourne -and -i -imitated -his -hand -and -wrote -the -letter -so -the -mystery -was -cleared -up -after -so -many -many -years -chapter -xxvi -there -are -people -who -can -do -all -fine -and -heroic -things -but -one! -keep -from -telling -their -happinesses -to -the -unhappy -pudd'nhead -wilson's -new -calendar -after -visits -to -maryborough -and -some -other -australian -towns -we -presently -took -passage -for -new -zealand -if -it -would -not -look -too -much -like -showing -off -i -would -tell -the -reader -where -new -zealand -is -for -he -is -as -i -was -he -thinks -he -knows -and -he -thinks -he -knows -where -hertzegovina -is -and -how -to -pronounce -pariah -and -how -to -use -the -word -unique -without -exposing -himself -to -the -derision -of -the -dictionary -but -in -truth -he -knows -none -of -these -things -there -are -but -four -or -five -people -in -the -world -who -possess -this -knowledge -and -these -make -their -living -out -of -it -they -travel -from -place -to -place -visiting -literary -assemblages -geographical -societies -and -seats -of -learning -and -springing -sudden -bets -that -these -people -do -not -know -these -things -since -all -people -think -they -know -them -they -are -an -easy -prey -to -these -adventurers -or -rather -they -were -an -easy -prey -until -the -law -interfered -three -months -ago -and -a -new -york -court -decided -that -this -kind -of -gambling -is -illegal -because -it -traverses -article -iv -section -9 -of -the -constitution -of -the -united -states -which -forbids -betting -on -a -sure -thing -this -decision -was -rendered -by -the -full -bench -of -the -new -york -supreme -court -after -a -test -sprung -upon -the -court -by -counsel -for -the -prosecution -which -showed -that -none -of -the -nine -judges -was -able -to -answer -any -of -the -four -questions -all -people -think -that -new -zealand -is -close -to -australia -or -asia -or -somewhere -and -that -you -cross -to -it -on -a -bridge -but -that -is -not -so -it -is -not -close -to -anything -but -lies -by -itself -out -in -the -water -it -is -nearest -to -australia -but -still -not -near -the -gap -between -is -very -wide -it -will -be -a -surprise -to -the -reader -as -it -was -to -me -to -learn -that -the -distance -from -australia -to -new -zealand -is -really -twelve -or -thirteen -hundred -miles -and -that -there -is -no -bridge -i -learned -this -from -professor -x -of -yale -university -whom -i -met -in -the -steamer -on -the -great -lakes -when -i -was -crossing -the -continent -to -sail -across -the -pacific -i -asked -him -about -new -zealand -in -order -to -make -conversation -i -supposed -he -would -generalize -a -little -without -compromising -himself -and -then -turn -the -subject -to -something -he -was -acquainted -with -and -my -object -would -then -be -attained -the -ice -would -be -broken -and -we -could -go -smoothly -on -and -get -acquainted -and -have -a -pleasant -time -but -to -my -surprise -he -was -not -only -not -embarrassed -by -my -question -but -seemed -to -welcome -it -and -to -take -a -distinct -interest -in -it -he -began -to -talk -fluently -confidently -comfortably -and -as -he -talked -my -admiration -grew -and -grew -for -as -the -subject -developed -under -his -hands -i -saw -that -he -not -only -knew -where -new -zealand -was -but -that -he -was -minutely -familiar -with -every -detail -of -its -history -politics -religions -and -commerce -its -fauna -flora -geology -products -and -climatic -peculiarities -when -he -was -done -i -was -lost -in -wonder -and -admiration -and -said -to -myself -he -knows -everything -in -the -domain -of -human -knowledge -he -is -king -i -wanted -to -see -him -do -more -miracles -and -so -just -for -the -pleasure -of -hearing -him -answer -i -asked -him -about -hertzegovina -and -pariah -and -unique -but -he -began -to -generalize -then -and -show -distress -i -saw -that -with -new -zealand -gone -he -was -a -samson -shorn -of -his -locks -he -was -as -other -men -this -was -a -curious -and -interesting -mystery -and -i -was -frank -with -him -and -asked -him -to -explain -it -he -tried -to -avoid -it -at -first -but -then -laughed -and -said -that -after -all -the -matter -was -not -worth -concealment -so -he -would -let -me -into -the -secret -in -substance -this -is -his -story -last -autumn -i -was -at -work -one -morning -at -home -when -a -card -came -up -the -card -of -a -stranger -under -the -name -was -printed -a -line -which -showed -that -this -visitor -was -professor -of -theological -engineering -in -wellington -university -new -zealand -i -was -troubled -troubled -i -mean -by -the -shortness -of -the -notice -college -etiquette -required -that -he -be -at -once -invited -to -dinner -by -some -member -of -the -faculty -invited -to -dine -on -that -day -not -put -off -till -a -subsequent -day -i -did -not -quite -know -what -to -do -college -etiquette -requires -in -the -case -of -a -foreign -guest -that -the -dinner -talk -shall -begin -with -complimentary -references -to -his -country -its -great -men -its -services -to -civilization -its -seats -of -learning -and -things -like -that -and -of -course -the -host -is -responsible -and -must -either -begin -this -talk -himself -or -see -that -it -is -done -by -some -one -else -i -was -in -great -difficulty -and -the -more -i -searched -my -memory -the -more -my -trouble -grew -i -found -that -i -knew -nothing -about -new -zealand -i -thought -i -knew -where -it -was -and -that -was -all -i -had -an -impression -that -it -was -close -to -australia -or -asia -or -somewhere -and -that -one -went -over -to -it -on -a -bridge -this -might -turn -out -to -be -incorrect -and -even -if -correct -it -would -not -furnish -matter -enough -for -the -purpose -at -the -dinner -and -i -should -expose -my -college -to -shame -before -my -guest -he -would -see -that -i -a -member -of -the -faculty -of -the -first -university -in -america -was -wholly -ignorant -of -his -country -and -he -would -go -away -and -tell -this -and -laugh -at -it -the -thought -of -it -made -my -face -burn -i -sent -for -my -wife -and -told -her -how -i -was -situated -and -asked -for -her -help -and -she -thought -of -a -thing -which -i -might -have -thought -of -myself -if -i -had -not -been -excited -and -worried -she -said -she -would -go -and -tell -the -visitor -that -i -was -out -but -would -be -in -in -a -few -minutes -and -she -would -talk -and -keep -him -busy -while -i -got -out -the -back -way -and -hurried -over -and -make -professor -lawson -give -the -dinner -for -lawson -knew -everything -and -could -meet -the -guest -in -a -creditable -way -and -save -the -reputation -of -the -university -i -ran -to -lawson -but -was -disappointed -he -did -not -know -anything -about -new -zealand -he -said -that -as -far -as -his -recollection -went -it -was -close -to -australia -or -asia -or -somewhere -and -you -go -over -to -it -on -a -bridge -but -that -was -all -he -knew -it -was -too -bad -lawson -was -a -perfect -encyclopedia -of -abstruse -learning -but -now -in -this -hour -of -our -need -it -turned -out -that -he -did -not -know -any -useful -thing -we -consulted -he -saw -that -the -reputation -of -the -university -was -in -very -real -peril -and -he -walked -the -floor -in -anxiety -talking -and -trying -to -think -out -some -way -to -meet -the -difficulty -presently -he -decided -that -we -must -try -the -rest -of -the -faculty -some -of -them -might -know -about -new -zealand -so -we -went -to -the -telephone -and -called -up -the -professor -of -astronomy -and -asked -him -and -he -said -that -all -he -knew -was -that -it -was -close -to -australia -or -asia -or -somewhere -and -you -went -over -to -it -on -we -shut -him -off -and -called -up -the -professor -of -biology -and -he -said -that -all -he -knew -was -that -it -was -close -to -aus -we -shut -him -off -and -sat -down -worried -and -disheartened -to -see -if -we -could -think -up -some -other -scheme -we -shortly -hit -upon -one -which -promised -well -and -this -one -we -adopted -and -set -its -machinery -going -at -once -it -was -this -lawson -must -give -the -dinner -the -faculty -must -be -notified -by -telephone -to -prepare -we -must -all -get -to -work -diligently -and -at -the -end -of -eight -hours -and -a -half -we -must -come -to -dinner -acquainted -with -new -zealand -at -least -well -enough -informed -to -appear -without -discredit -before -this -native -to -seem -properly -intelligent -we -should -have -to -know -about -new -zealand's -population -and -politics -and -form -of -government -and -commerce -and -taxes -and -products -and -ancient -history -and -modern -history -and -varieties -of -religion -and -nature -of -the -laws -and -their -codification -and -amount -of -revenue -and -whence -drawn -and -methods -of -collection -and -percentage -of -loss -and -character -of -climate -and -well -a -lot -of -things -like -that -we -must -suck -the -maps -and -cyclopedias -dry -and -while -we -posted -up -in -this -way -the -faculty's -wives -must -flock -over -one -after -the -other -in -a -studiedly -casual -way -and -help -my -wife -keep -the -new -zealander -quiet -and -not -let -him -get -out -and -come -interfering -with -our -studies -the -scheme -worked -admirably -but -it -stopped -business -stopped -it -entirely -it -is -in -the -official -log -book -of -yale -to -be -read -and -wondered -at -by -future -generations -the -account -of -the -great -blank -day -the -memorable -blank -day -the -day -wherein -the -wheels -of -culture -were -stopped -a -sunday -silence -prevailed -all -about -and -the -whole -university -stood -still -while -the -faculty -read -up -and -qualified -itself -to -sit -at -meat -without -shame -in -the -presence -of -the -professor -of -theological -engineering -from -new -zealand -when -we -assembled -at -the -dinner -we -were -miserably -tired -and -worn -but -we -were -posted -yes -it -is -fair -to -claim -that -in -fact -erudition -is -a -pale -name -for -it -new -zealand -was -the -only -subject -and -it -was -just -beautiful -to -hear -us -ripple -it -out -and -with -such -an -air -of -unembarrassed -ease -and -unostentatious -familiarity -with -detail -and -trained -and -seasoned -mastery -of -the -subject -and -oh -the -grace -and -fluency -of -it! -well -finally -somebody -happened -to -notice -that -the -guest -was -looking -dazed -and -wasn't -saying -anything -so -they -stirred -him -up -of -course -then -that -man -came -out -with -a -good -honest -eloquent -compliment -that -made -the -faculty -blush -he -said -he -was -not -worthy -to -sit -in -the -company -of -men -like -these -that -he -had -been -silent -from -admiration -that -he -had -been -silent -from -another -cause -also -silent -from -shame -silent -from -ignorance! -'for -' -said -he -'i -who -have -lived -eighteen -years -in -new -zealand -and -have -served -five -in -a -professorship -and -ought -to -know -much -about -that -country -perceive -now -that -i -know -almost -nothing -about -it -i -say -it -with -shame -that -i -have -learned -fifty -times -yes -a -hundred -times -more -about -new -zealand -in -these -two -hours -at -this -table -than -i -ever -knew -before -in -all -the -eighteen -years -put -together -i -was -silent -because -i -could -not -help -myself -what -i -knew -about -taxes -and -policies -and -laws -and -revenue -and -products -and -history -and -all -that -multitude -of -things -was -but -general -and -ordinary -and -vague -unscientific -in -a -word -and -it -would -have -been -insanity -to -expose -it -here -to -the -searching -glare -of -your -amazingly -accurate -and -all -comprehensive -knowledge -of -those -matters -gentlemen -i -beg -you -to -let -me -sit -silent -as -becomes -me -but -do -not -change -the -subject -i -can -at -least -follow -you -in -this -one -whereas -if -you -change -to -one -which -shall -call -out -the -full -strength -of -your -mighty -erudition -i -shall -be -as -one -lost -if -you -know -all -this -about -a -remote -little -inconsequent -patch -like -new -zealand -ah -what -wouldn't -you -know -about -any -other -subject!' -chapter -xxvil -man -is -the -only -animal -that -blushes -or -needs -to -pudd'nhead -wilson's -new -calendar -the -universal -brotherhood -of -man -is -our -most -precious -possession -what -there -is -of -it -pudd'nhead -wilson's -new -calendar -from -diary -november -1 -noon -a -fine -day -a -brilliant -sun -warm -in -the -sun -cold -in -the -shade -an -icy -breeze -blowing -out -of -the -south -a -solemn -long -swell -rolling -up -northward -it -comes -from -the -south -pole -with -nothing -in -the -way -to -obstruct -its -march -and -tone -its -energy -down -i -have -read -somewhere -that -an -acute -observer -among -the -early -explorers -cook -or -tasman -accepted -this -majestic -swell -as -trustworthy -circumstantial -evidence -that -no -important -land -lay -to -the -southward -and -so -did -not -waste -time -on -a -useless -quest -in -that -direction -but -changed -his -course -and -went -searching -elsewhere -afternoon -passing -between -tasmania -formerly -van -diemen's -land -and -neighboring -islands -islands -whence -the -poor -exiled -tasmanian -savages -used -to -gaze -at -their -lost -homeland -and -cry -and -die -of -broken -hearts -how -glad -i -am -that -all -these -native -races -are -dead -and -gone -or -nearly -so -the -work -was -mercifully -swift -and -horrible -in -some -portions -of -australia -as -far -as -tasmania -is -concerned -the -extermination -was -complete -not -a -native -is -left -it -was -a -strife -of -years -and -decades -of -years -the -whites -and -the -blacks -hunted -each -other -ambushed -each -other -butchered -each -other -the -blacks -were -not -numerous -but -they -were -wary -alert -cunning -and -they -knew -their -country -well -they -lasted -a -long -time -few -as -they -were -and -inflicted -much -slaughter -upon -the -whites -the -government -wanted -to -save -the -blacks -from -ultimate -extermination -if -possible -one -of -its -schemes -was -to -capture -them -and -coop -them -up -on -a -neighboring -island -under -guard -bodies -of -whites -volunteered -for -the -hunt -for -the -pay -was -good -l5 -for -each -black -captured -and -delivered -but -the -success -achieved -was -not -very -satisfactory -the -black -was -naked -and -his -body -was -greased -it -was -hard -to -get -a -grip -on -him -that -would -hold -the -whites -moved -about -in -armed -bodies -and -surprised -little -families -of -natives -and -did -make -captures -but -it -was -suspected -that -in -these -surprises -half -a -dozen -natives -were -killed -to -one -caught -and -that -was -not -what -the -government -desired -another -scheme -was -to -drive -the -natives -into -a -corner -of -the -island -and -fence -them -in -by -a -cordon -of -men -placed -in -line -across -the -country -but -the -natives -managed -to -slip -through -constantly -and -continue -their -murders -and -arsons -the -governor -warned -these -unlettered -savages -by -printed -proclamation -that -they -must -stay -in -the -desolate -region -officially -appointed -for -them! -the -proclamation -was -a -dead -letter -the -savages -could -not -read -it -afterward -a -picture -proclamation -was -issued -it -was -painted -up -on -boards -and -these -were -nailed -to -trees -in -the -forest -herewith -is -a -photographic -reproduction -of -this -fashion -plate -substantially -it -means -1 -the -governor -wishes -the -whites -and -the -blacks -to -love -each -other -2 -he -loves -his -black -subjects -3 -blacks -who -kill -whites -will -be -hanged -4 -whites -who -kill -blacks -will -be -hanged -upon -its -several -schemes -the -government -spent -l30 -000 -and -employed -the -labors -and -ingenuities -of -several -thousand -whites -for -a -long -time -with -failure -as -a -result -then -at -last -a -quarter -of -a -century -after -the -beginning -of -the -troubles -between -the -two -races -the -right -man -was -found -no -he -found -himself -this -was -george -augustus -robinson -called -in -history -the -conciliator -he -was -not -educated -and -not -conspicuous -in -any -way -he -was -a -working -bricklayer -in -hobart -town -but -he -must -have -been -an -amazing -personality -a -man -worth -traveling -far -to -see -it -may -be -his -counterpart -appears -in -history -but -i -do -not -know -where -to -look -for -it -he -set -himself -this -incredible -task -to -go -out -into -the -wilderness -the -jungle -and -the -mountain -retreats -where -the -hunted -and -implacable -savages -were -hidden -and -appear -among -them -unarmed -speak -the -language -of -love -and -of -kindness -to -them -and -persuade -them -to -forsake -their -homes -and -the -wild -free -life -that -was -so -dear -to -them -and -go -with -him -and -surrender -to -the -hated -whites -and -live -under -their -watch -and -ward -and -upon -their -charity -the -rest -of -their -lives! -on -its -face -it -was -the -dream -of -a -madman -in -the -beginning -his -moral -suasion -project -was -sarcastically -dubbed -the -sugar -plum -speculation -if -the -scheme -was -striking -and -new -to -the -world's -experience -the -situation -was -not -less -so -it -was -this -the -white -population -numbered -40 -000 -in -1831 -the -black -population -numbered -three -hundred -not -300 -warriors -but -300 -men -women -and -children -the -whites -were -armed -with -guns -the -blacks -with -clubs -and -spears -the -whites -had -fought -the -blacks -for -a -quarter -of -a -century -and -had -tried -every -thinkable -way -to -capture -kill -or -subdue -them -and -could -not -do -it -if -white -men -of -any -race -could -have -done -it -these -would -have -accomplished -it -but -every -scheme -had -failed -the -splendid -300 -the -matchless -300 -were -unconquered -and -manifestly -unconquerable -they -would -not -yield -they -would -listen -to -no -terms -they -would -fight -to -the -bitter -end -yet -they -had -no -poet -to -keep -up -their -heart -and -sing -the -marvel -of -their -magnificent -patriotism -at -the -end -of -five -and -twenty -years -of -hard -fighting -the -surviving -300 -naked -patriots -were -still -defiant -still -persistent -still -efficacious -with -their -rude -weapons -and -the -governor -and -the -40 -000 -knew -not -which -way -to -turn -nor -what -to -do -then -the -bricklayer -that -wonderful -man -proposed -to -go -out -into -the -wilderness -with -no -weapon -but -his -tongue -and -no -protection -but -his -honest -eye -and -his -humane -heart -and -track -those -embittered -savages -to -their -lairs -in -the -gloomy -forests -and -among -the -mountain -snows -naturally -he -was -considered -a -crank -but -he -was -not -quite -that -in -fact -he -was -a -good -way -short -of -that -he -was -building -upon -his -long -and -intimate -knowledge -of -the -native -character -the -deriders -of -his -project -were -right -from -their -standpoint -for -they -believed -the -natives -to -be -mere -wild -beasts -and -robinson -was -right -from -his -standpoint -for -he -believed -the -natives -to -be -human -beings -the -truth -did -really -lie -between -the -two -the -event -proved -that -robinson's -judgment -was -soundest -but -about -once -a -month -for -four -years -the -event -came -near -to -giving -the -verdict -to -the -deriders -for -about -that -frequently -robinson -barely -escaped -falling -under -the -native -spears -but -history -shows -that -he -had -a -thinking -head -and -was -not -a -mere -wild -sentimentalist -for -instance -he -wanted -the -war -parties -called -in -before -he -started -unarmed -upon -his -mission -of -peace -he -wanted -the -best -chance -of -success -not -a -half -chance -and -he -was -very -willing -to -have -help -and -so -high -rewards -were -advertised -for -any -who -would -go -unarmed -with -him -this -opportunity -was -declined -robinson -persuaded -some -tamed -natives -of -both -sexes -to -go -with -him -a -strong -evidence -of -his -persuasive -powers -for -those -natives -well -knew -that -their -destruction -would -be -almost -certain -as -it -turned -out -they -had -to -face -death -over -and -over -again -robinson -and -his -little -party -had -a -difficult -undertaking -upon -their -hands -they -could -not -ride -off -horseback -comfortably -into -the -woods -and -call -leonidas -and -his -300 -together -for -a -talk -and -a -treaty -the -following -day -for -the -wild -men -were -not -in -a -body -they -were -scattered -immense -distances -apart -over -regions -so -desolate -that -even -the -birds -could -not -make -a -living -with -the -chances -offered -scattered -in -groups -of -twenty -a -dozen -half -a -dozen -even -in -groups -of -three -and -the -mission -must -go -on -foot -mr -bonwick -furnishes -a -description -of -those -horrible -regions -whereby -it -will -be -seen -that -even -fugitive -gangs -of -the -hardiest -and -choicest -human -devils -the -world -has -seen -the -convicts -set -apart -to -people -the -hell -of -macquarrie -harbor -station -were -never -able -but -once -to -survive -the -horrors -of -a -march -through -them -but -starving -and -struggling -and -fainting -and -failing -ate -each -other -and -died -onward -still -onward -was -the -order -of -the -indomitable -robinson -no -one -ignorant -of -the -western -country -of -tasmania -can -form -a -correct -idea -of -the -traveling -difficulties -while -i -was -resident -in -hobart -town -the -governor -sir -john -franklin -and -his -lady -undertook -the -western -journey -to -macquarrie -harbor -and -suffered -terribly -one -man -who -assisted -to -carry -her -ladyship -through -the -swamps -gave -me -his -bitter -experience -of -its -miseries -several -were -disabled -for -life -no -wonder -that -but -one -party -escaping -from -macquarrie -harbor -convict -settlement -arrived -at -the -civilized -region -in -safety -men -perished -in -the -scrub -were -lost -in -snow -or -were -devoured -by -their -companions -this -was -the -territory -traversed -by -mr -robinson -and -his -black -guides -all -honor -to -his -intrepidity -and -their -wonderful -fidelity! -when -they -had -in -the -depth -of -winter -to -cross -deep -and -rapid -rivers -pass -among -mountains -six -thousand -feet -high -pierce -dangerous -thickets -and -find -food -in -a -country -forsaken -even -by -birds -we -can -realize -their -hardships -after -a -frightful -journey -by -cradle -mountain -and -over -the -lofty -plateau -of -middlesex -plains -the -travelers -experienced -unwonted -misery -and -the -circumstances -called -forth -the -best -qualities -of -the -noble -little -band -mr -robinson -wrote -afterwards -to -mr -secretary -burnett -some -details -of -this -passage -of -horrors -in -that -letter -of -oct -2 -1834 -he -states -that -his -natives -were -very -reluctant -to -go -over -the -dreadful -mountain -passes -that -'for -seven -successive -days -we -continued -traveling -over -one -solid -body -of -snow -' -that -'the -snows -were -of -incredible -depth -' -that -'the -natives -were -frequently -up -to -their -middle -in -snow -' -but -still -the -ill -clad -ill -fed -diseased -and -way -worn -men -and -women -were -sustained -by -the -cheerful -voice -of -their -unconquerable -friend -and -responded -most -nobly -to -his -call -mr -bonwick -says -that -robinson's -friendly -capture -of -the -big -river -tribe -remember -it -was -a -whole -tribe -was -by -far -the -grandest -feature -of -the -war -and -the -crowning -glory -of -his -efforts -the -word -war -was -not -well -chosen -and -is -misleading -there -was -war -still -but -only -the -blacks -were -conducting -it -the -whites -were -holding -off -until -robinson -could -give -his -scheme -a -fair -trial -i -think -that -we -are -to -understand -that -the -friendly -capture -of -that -tribe -was -by -far -the -most -important -thing -the -highest -in -value -that -happened -during -the -whole -thirty -years -of -truceless -hostilities -that -it -was -a -decisive -thing -a -peaceful -waterloo -the -surrender -of -the -native -napoleon -and -his -dreaded -forces -the -happy -ending -of -the -long -strife -for -that -tribe -was -the -terror -of -the -colony -its -chief -the -black -douglas -of -bush -households -robinson -knew -that -these -formidable -people -were -lurking -somewhere -in -some -remote -corner -of -the -hideous -regions -just -described -and -he -and -his -unarmed -little -party -started -on -a -tedious -and -perilous -hunt -for -them -at -last -there -under -the -shadows -of -the -frenchman's -cap -whose -grim -cone -rose -five -thousand -feet -in -the -uninhabited -westward -interior -they -were -found -it -was -a -serious -moment -robinson -himself -believed -for -once -that -his -mission -successful -until -now -was -to -end -here -in -failure -and -that -his -own -death -hour -had -struck -the -redoubtable -chief -stood -in -menacing -attitude -with -his -eighteen -foot -spear -poised -his -warriors -stood -massed -at -his -back -armed -for -battle -their -faces -eloquent -with -their -long -cherished -loathing -for -white -men -they -rattled -their -spears -and -shouted -their -war -cry -their -women -were -back -of -them -laden -with -supplies -of -weapons -and -keeping -their -150 -eager -dogs -quiet -until -the -chief -should -give -the -signal -to -fall -on -i -think -we -shall -soon -be -in -the -resurrection -whispered -a -member -of -robinson's -little -party -i -think -we -shall -answered -robinson -then -plucked -up -heart -and -began -his -persuasions -in -the -tribe's -own -dialect -which -surprised -and -pleased -the -chief -presently -there -was -an -interruption -by -the -chief -who -are -you -we -are -gentlemen -where -are -your -guns -we -have -none -the -warrior -was -astonished -where -your -little -guns -pistols -we -have -none -a -few -minutes -passed -in -by -play -suspense -discussion -among -the -tribesmen -robinson's -tamed -squaws -ventured -to -cross -the -line -and -begin -persuasions -upon -the -wild -squaws -then -the -chief -stepped -back -to -confer -with -the -old -women -the -real -arbiters -of -savage -war -mr -bonwick -continues -as -the -fallen -gladiator -in -the -arena -looks -for -the -signal -of -life -or -death -from -the -president -of -the -amphitheatre -so -waited -our -friends -in -anxious -suspense -while -the -conference -continued -in -a -few -minutes -before -a -word -was -uttered -the -women -of -the -tribe -threw -up -their -arms -three -times -this -was -the -inviolable -sign -of -peace! -down -fell -the -spears -forward -with -a -heavy -sigh -of -relief -and -upward -glance -of -gratitude -came -the -friends -of -peace -the -impulsive -natives -rushed -forth -with -tears -and -cries -as -each -saw -in -the -other's -rank -a -loved -one -of -the -past -it -was -a -jubilee -of -joy -a -festival -followed -and -while -tears -flowed -at -the -recital -of -woe -a -corrobory -of -pleasant -laughter -closed -the -eventful -day -in -four -years -without -the -spilling -of -a -drop -of -blood -robinson -brought -them -all -in -willing -captives -and -delivered -them -to -the -white -governor -and -ended -the -war -which -powder -and -bullets -and -thousands -of -men -to -use -them -had -prosecuted -without -result -since -1804 -marsyas -charming -the -wild -beasts -with -his -music -that -is -fable -but -the -miracle -wrought -by -robinson -is -fact -it -is -history -and -authentic -and -surely -there -is -nothing -greater -nothing -more -reverence -compelling -in -the -history -of -any -country -ancient -or -modern -and -in -memory -of -the -greatest -man -australasia -ever -developed -or -ever -will -develop -there -is -a -stately -monument -to -george -augustus -robinson -the -conciliator -in -no -it -is -to -another -man -i -forget -his -name -however -robertson's -own -generation -honored -him -and -in -manifesting -it -honored -themselves -the -government -gave -him -a -money -reward -and -a -thousand -acres -of -land -and -the -people -held -mass -meetings -and -praised -him -and -emphasized -their -praise -with -a -large -subscription -of -money -a -good -dramatic -situation -but -the -curtain -fell -on -another -when -this -desperate -tribe -was -thus -captured -there -was -much -surprise -to -find -that -the -l30 -000 -of -a -little -earlier -day -had -been -spent -and -the -whole -population -of -the -colony -placed -under -arms -in -contention -with -an -opposing -force -of -sixteen -men -with -wooden -spears! -yet -such -was -the -fact -the -celebrated -big -river -tribe -that -had -been -raised -by -european -fears -to -a -host -consisted -of -sixteen -men -nine -women -and -one -child -with -a -knowledge -of -the -mischief -done -by -these -few -their -wonderful -marches -and -their -widespread -aggressions -their -enemies -cannot -deny -to -them -the -attributes -of -courage -and -military -tact -a -wallace -might -harass -a -large -army -with -a -small -and -determined -band -but -the -contending -parties -were -at -least -equal -in -arms -and -civilization -the -zulus -who -fought -us -in -africa -the -maories -in -new -zealand -the -arabs -in -the -soudan -were -far -better -provided -with -weapons -more -advanced -in -the -science -of -war -and -considerably -more -numerous -than -the -naked -tasmanians -governor -arthur -rightly -termed -them -a -noble -race -these -were -indeed -wonderful -people -the -natives -they -ought -not -to -have -been -wasted -they -should -have -been -crossed -with -the -whites -it -would -have -improved -the -whites -and -done -the -natives -no -harm -but -the -natives -were -wasted -poor -heroic -wild -creatures -they -were -gathered -together -in -little -settlements -on -neighboring -islands -and -paternally -cared -for -by -the -government -and -instructed -in -religion -and -deprived -of -tobacco -because -the -superintendent -of -the -sunday -school -was -not -a -smoker -and -so -considered -smoking -immoral -the -natives -were -not -used -to -clothes -and -houses -and -regular -hours -and -church -and -school -and -sunday -school -and -work -and -the -other -misplaced -persecutions -of -civilization -and -they -pined -for -their -lost -home -and -their -wild -free -life -too -late -they -repented -that -they -had -traded -that -heaven -for -this -hell -they -sat -homesick -on -their -alien -crags -and -day -by -day -gazed -out -through -their -tears -over -the -sea -with -unappeasable -longing -toward -the -hazy -bulk -which -was -the -specter -of -what -had -been -their -paradise -one -by -one -their -hearts -broke -and -they -died -in -a -very -few -years -nothing -but -a -scant -remnant -remained -alive -a -handful -lingered -along -into -age -in -1864 -the -last -man -died -in -1876 -the -last -woman -died -and -the -spartans -of -australasia -were -extinct -the -whites -always -mean -well -when -they -take -human -fish -out -of -the -ocean -and -try -to -make -them -dry -and -warm -and -happy -and -comfortable -in -a -chicken -coop -but -the -kindest -hearted -white -man -can -always -be -depended -on -to -prove -himself -inadequate -when -he -deals -with -savages -he -cannot -turn -the -situation -around -and -imagine -how -he -would -like -it -to -have -a -well -meaning -savage -transfer -him -from -his -house -and -his -church -and -his -clothes -and -his -books -and -his -choice -food -to -a -hideous -wilderness -of -sand -and -rocks -and -snow -and -ice -and -sleet -and -storm -and -blistering -sun -with -no -shelter -no -bed -no -covering -for -his -and -his -family's -naked -bodies -and -nothing -to -eat -but -snakes -and -grubs -and -'offal -this -would -be -a -hell -to -him -and -if -he -had -any -wisdom -he -would -know -that -his -own -civilization -is -a -hell -to -the -savage -but -he -hasn't -any -and -has -never -had -any -and -for -lack -of -it -he -shut -up -those -poor -natives -in -the -unimaginable -perdition -of -his -civilization -committing -his -crime -with -the -very -best -intentions -and -saw -those -poor -creatures -waste -away -under -his -tortures -and -gazed -at -it -vaguely -troubled -and -sorrowful -and -wondered -what -could -be -the -matter -with -them -one -is -almost -betrayed -into -respecting -those -criminals -they -were -so -sincerely -kind -and -tender -and -humane -and -well -meaning -they -didn't -know -why -those -exiled -savages -faded -away -and -they -did -their -honest -best -to -reason -it -out -and -one -man -in -a -like -case -in -new -south -wales -did -reason -it -out -and -arrive -at -a -solution -it -is -from -the -wrath -of -god -which -is -revealed -from -heaven -against -cold -ungodliness -and -unrighteousness -of -men -that -settles -it -chapter -xxviii -let -us -be -thankful -for -the -fools -but -for -them -the -rest -of -us -could -not -succeed -pudd'nhead -wilson's -new -calendar -the -aphorism -does -really -seem -true -given -the -circumstances -the -man -will -appear -but -the -man -musn't -appear -ahead -of -time -or -it -will -spoil -everything -in -robinson's -case -the -moment -had -been -approaching -for -a -quarter -of -a -century -and -meantime -the -future -conciliator -was -tranquilly -laying -bricks -in -hobart -when -all -other -means -had -failed -the -moment -had -arrived -and -the -bricklayer -put -down -his -trowel -and -came -forward -earlier -he -would -have -been -jeered -back -to -his -trowel -again -it -reminds -me -of -a -tale -that -was -told -me -by -a -kentuckian -on -the -train -when -we -were -crossing -montana -he -said -the -tale -was -current -in -louisville -years -ago -he -thought -it -had -been -in -print -but -could -not -remember -at -any -rate -in -substance -it -was -this -as -nearly -as -i -can -call -it -back -to -mind -a -few -years -before -the -outbreak -of -the -civil -war -it -began -to -appear -that -memphis -tennessee -was -going -to -be -a -great -tobacco -entrepot -the -wise -could -see -the -signs -of -it -at -that -time -memphis -had -a -wharf -boat -of -course -there -was -a -paved -sloping -wharf -for -the -accommodation -of -freight -but -the -steamers -landed -on -the -outside -of -the -wharfboat -and -all -loading -and -unloading -was -done -across -it -between -steamer -and -shore -a -number -of -wharfboat -clerks -were -needed -and -part -of -the -time -every -day -they -were -very -busy -and -part -of -the -time -tediously -idle -they -were -boiling -over -with -youth -and -spirits -and -they -had -to -make -the -intervals -of -idleness -endurable -in -some -way -and -as -a -rule -they -did -it -by -contriving -practical -jokes -and -playing -them -upon -each -other -the -favorite -butt -for -the -jokes -was -ed -jackson -because -he -played -none -himself -and -was -easy -game -for -other -people's -for -he -always -believed -whatever -was -told -him -one -day -he -told -the -others -his -scheme -for -his -holiday -he -was -not -going -fishing -or -hunting -this -time -no -he -had -thought -out -a -better -plan -out -of -his -$40 -a -month -he -had -saved -enough -for -his -purpose -in -an -economical -way -and -he -was -going -to -have -a -look -at -new -york -it -was -a -great -and -surprising -idea -it -meant -travel -immense -travel -in -those -days -it -meant -seeing -the -world -it -was -the -equivalent -of -a -voyage -around -it -in -ours -at -first -the -other -youths -thought -his -mind -was -affected -but -when -they -found -that -he -was -in -earnest -the -next -thing -to -be -thought -of -was -what -sort -of -opportunity -this -venture -might -afford -for -a -practical -joke -the -young -men -studied -over -the -matter -then -held -a -secret -consultation -and -made -a -plan -the -idea -was -that -one -of -the -conspirators -should -offer -ed -a -letter -of -introduction -to -commodore -vanderbilt -and -trick -him -into -delivering -it -it -would -be -easy -to -do -this -but -what -would -ed -do -when -he -got -back -to -memphis -that -was -a -serious -matter -he -was -good -hearted -and -had -always -taken -the -jokes -patiently -but -they -had -been -jokes -which -did -not -humiliate -him -did -not -bring -him -to -shame -whereas -this -would -be -a -cruel -one -in -that -way -and -to -play -it -was -to -meddle -with -fire -for -with -all -his -good -nature -ed -was -a -southerner -and -the -english -of -that -was -that -when -he -came -back -he -would -kill -as -many -of -the -conspirators -as -he -could -before -falling -himself -however -the -chances -must -be -taken -it -wouldn't -do -to -waste -such -a -joke -as -that -so -the -letter -was -prepared -with -great -care -and -elaboration -it -was -signed -alfred -fairchild -and -was -written -in -an -easy -and -friendly -spirit -it -stated -that -the -bearer -was -the -bosom -friend -of -the -writer's -son -and -was -of -good -parts -and -sterling -character -and -it -begged -the -commodore -to -be -kind -to -the -young -stranger -for -the -writer's -sake -it -went -on -to -say -you -may -have -forgotten -me -in -this -long -stretch -of -time -but -you -will -easily -call -me -back -out -of -your -boyhood -memories -when -i -remind -you -of -how -we -robbed -old -stevenson's -orchard -that -night -and -how -while -he -was -chasing -down -the -road -after -us -we -cut -across -the -field -and -doubled -back -and -sold -his -own -apples -to -his -own -cook -for -a -hat -full -of -doughnuts -and -the -time -that -we -and -so -forth -and -so -on -bringing -in -names -of -imaginary -comrades -and -detailing -all -sorts -of -wild -and -absurd -and -of -course -wholly -imaginary -schoolboy -pranks -and -adventures -but -putting -them -into -lively -and -telling -shape -with -all -gravity -ed -was -asked -if -he -would -like -to -have -a -letter -to -commodore -vanderbilt -the -great -millionaire -it -was -expected -that -the -question -would -astonish -ed -and -it -did -what -do -you -know -that -extraordinary -man -no -but -my -father -does -they -were -schoolboys -together -and -if -you -like -i'll -write -and -ask -father -i -know -he'll -be -glad -to -give -it -to -you -for -my -sake -ed -could -not -find -words -capable -of -expressing -his -gratitude -and -delight -the -three -days -passed -and -the -letter -was -put -into -his -bands -he -started -on -his -trip -still -pouring -out -his -thanks -while -he -shook -good -bye -all -around -and -when -he -was -out -of -sight -his -comrades -let -fly -their -laughter -in -a -storm -of -happy -satisfaction -and -then -quieted -down -and -were -less -happy -less -satisfied -for -the -old -doubts -as -to -the -wisdom -of -this -deception -began -to -intrude -again -arrived -in -new -york -ed -found -his -way -to -commodore -vanderbilt's -business -quarters -and -was -ushered -into -a -large -anteroom -where -a -score -of -people -were -patiently -awaiting -their -turn -for -a -two -minute -interview -with -the -millionaire -in -his -private -office -a -servant -asked -for -ed's -card -and -got -the -letter -instead -ed -was -sent -for -a -moment -later -and -found -mr -vanderbilt -alone -with -the -letter -open -in -his -hand -pray -sit -down -mr -er -jackson -ah -sit -down -mr -jackson -by -the -opening -sentences -it -seems -to -be -a -letter -from -an -old -friend -allow -me -i -will -run -my -eye -through -it -he -says -he -says -why -who -is -it -he -turned -the -sheet -and -found -the -signature -alfred -fairchild -hm -fairchild -i -don't -recall -the -name -but -that -is -nothing -a -thousand -names -have -gone -from -me -he -says -he -says -hm -hmoh -dear -but -it's -good! -oh -it's -rare! -i -don't -quite -remember -it -but -i -seem -to -it'll -all -come -back -to -me -presently -he -says -he -says -hm -hm -oh -but -that -was -a -game! -oh -spl -endid! -how -it -carries -me -back! -it's -all -dim -of -course -it's -a -long -time -ago -and -the -names -some -of -the -names -are -wavery -and -indistinct -but -sho' -i -know -it -happened -i -can -feel -it! -and -lord -how -it -warms -my -heart -and -brings -back -my -lost -youth! -well -well -well -i've -got -to -come -back -into -this -work -a -day -world -now -business -presses -and -people -are -waiting -i'll -keep -the -rest -for -bed -to -night -and -live -my -youth -over -again -and -you'll -thank -fairchild -for -me -when -you -see -him -i -used -to -call -him -alf -i -think -and -you'll -give -him -my -gratitude -for -what -this -letter -has -done -for -the -tired -spirit -of -a -hard -worked -man -and -tell -him -there -isn't -anything -that -i -can -do -for -him -or -any -friend -of -his -that -i -won't -do -and -as -for -you -my -lad -you -are -my -guest -you -can't -stop -at -any -hotel -in -new -york -sit -where -you -are -a -little -while -till -i -get -through -with -these -people -then -we'll -go -home -i'll -take -care -of -you -my -boy -make -yourself -easy -as -to -that -ed -stayed -a -week -and -had -an -immense -time -and -never -suspected -that -the -commodore's -shrewd -eye -was -on -him -and -that -he -was -daily -being -weighed -and -measured -and -analyzed -and -tried -and -tested -yes -he -had -an -immense -time -and -never -wrote -home -but -saved -it -all -up -to -tell -when -he -should -get -back -twice -with -proper -modesty -and -decency -he -proposed -to -end -his -visit -but -the -commodore -said -no -wait -leave -it -to -me -i'll -tell -you -when -to -go -in -those -days -the -commodore -was -making -some -of -those -vast -combinations -of -his -consolidations -of -warring -odds -and -ends -of -railroads -into -harmonious -systems -and -concentrations -of -floating -and -rudderless -commerce -in -effective -centers -and -among -other -things -his -farseeing -eye -had -detected -the -convergence -of -that -huge -tobacco -commerce -already -spoken -of -toward -memphis -and -he -had -resolved -to -set -his -grasp -upon -it -and -make -it -his -own -the -week -came -to -an -end -then -the -commodore -said -now -you -can -start -home -but -first -we -will -have -some -more -talk -about -that -tobacco -matter -i -know -you -now -i -know -your -abilities -as -well -as -you -know -them -yourself -perhaps -better -you -understand -that -tobacco -matter -you -understand -that -i -am -going -to -take -possession -of -it -and -you -also -understand -the -plans -which -i -have -matured -for -doing -it -what -i -want -is -a -man -who -knows -my -mind -and -is -qualified -to -represent -me -in -memphis -and -be -in -supreme -command -of -that -important -business -and -i -appoint -you -me! -yes -your -salary -will -be -high -of -course -for -you -are -representing -me -later -you -will -earn -increases -of -it -and -will -get -them -you -will -need -a -small -army -of -assistants -choose -them -yourself -and -carefully -take -no -man -for -friendship's -sake -but -all -things -being -equal -take -the -man -you -know -take -your -friend -in -preference -to -the -stranger -after -some -further -talk -under -this -head -the -commodore -said -good -bye -my -boy -and -thank -alf -for -me -for -sending -you -to -me -when -ed -reached -memphis -he -rushed -down -to -the -wharf -in -a -fever -to -tell -his -great -news -and -thank -the -boys -over -and -over -again -for -thinking -to -give -him -the -letter -to -mr -vanderbilt -it -happened -to -be -one -of -those -idle -times -blazing -hot -noonday -and -no -sign -of -life -on -the -wharf -but -as -ed -threaded -his -way -among -the -freight -piles -he -saw -a -white -linen -figure -stretched -in -slumber -upon -a -pile -of -grain -sacks -under -an -awning -and -said -to -himself -that's -one -of -them -and -hastened -his -step -next -he -said -it's -charley -it's -fairchild -good -and -the -next -moment -laid -an -affectionate -hand -on -the -sleeper's -shoulder -the -eyes -opened -lazily -took -one -glance -the -face -blanched -the -form -whirled -itself -from -the -sack -pile -and -in -an -instant -ed -was -alone -and -fairchild -was -flying -for -the -wharf -boat -like -the -wind! -ed -was -dazed -stupefied -was -fairchild -crazy -what -could -be -the -meaning -of -this -he -started -slow -and -dreamily -down -toward -the -wharf -boat -turned -the -corner -of -a -freight -pile -and -came -suddenly -upon -two -of -the -boys -they -were -lightly -laughing -over -some -pleasant -matter -they -heard -his -step -and -glanced -up -just -as -he -discovered -them -the -laugh -died -abruptly -and -before -ed -could -speak -they -were -off -and -sailing -over -barrels -and -bales -like -hunted -deer -again -ed -was -paralyzed -had -the -boys -all -gone -mad -what -could -be -the -explanation -of -this -extraordinary -conduct -and -so -dreaming -along -he -reached -the -wharf -boat -and -stepped -aboard -nothing -but -silence -there -and -vacancy -he -crossed -the -deck -turned -the -corner -to -go -down -the -outer -guard -heard -a -fervent -o -lord! -and -saw -a -white -linen -form -plunge -overboard -the -youth -came -up -coughing -and -strangling -and -cried -out -go -'way -from -here! -you -let -me -alone -i -didn't -do -it -i -swear -i -didn't! -didn't -do -what -give -you -the -never -mind -what -you -didn't -do -come -out -of -that! -what -makes -you -all -act -so -what -have -i -done -you -why -you -haven't -done -anything -but -well -then -what -have -you -got -against -me -what -do -you -all -treat -me -so -for -i -er -but -haven't -you -got -anything -against -us -of -course -not -what -put -such -a -thing -into -your -head -honor -bright -you -haven't -honor -bright -swear -it! -i -don't -know -what -in -the -world -you -mean -but -i -swear -it -anyway -and -you'll -shake -hands -with -me -goodness -knows -i'll -be -glad -to! -why -i'm -just -starving -to -shake -hands -with -somebody! -the -swimmer -muttered -hang -him -he -smelt -a -rat -and -never -delivered -the -letter! -but -it's -all -right -i'm -not -going -to -fetch -up -the -subject -and -he -crawled -out -and -came -dripping -and -draining -to -shake -hands -first -one -and -then -another -of -the -conspirators -showed -up -cautiously -armed -to -the -teeth -took -in -the -amicable -situation -then -ventured -warily -forward -and -joined -the -love -feast -and -to -ed's -eager -inquiry -as -to -what -made -them -act -as -they -had -been -acting -they -answered -evasively -and -pretended -that -they -had -put -it -up -as -a -joke -to -see -what -he -would -do -it -was -the -best -explanation -they -could -invent -at -such -short -notice -and -each -said -to -himself -he -never -delivered -that -letter -and -the -joke -is -on -us -if -he -only -knew -it -or -we -were -dull -enough -to -come -out -and -tell -then -of -course -they -wanted -to -know -all -about -the -trip -and -he -said -come -right -up -on -the -boiler -deck -and -order -the -drinks -it's -my -treat -i'm -going -to -tell -you -all -about -it -and -to -night -it's -my -treat -again -and -we'll -have -oysters -and -a -time! -when -the -drinks -were -brought -and -cigars -lighted -ed -said -well -when -i -delivered -the -letter -to -mr -vanderbilt -great -scott! -gracious -how -you -scared -me -what's -the -matter -oh -er -nothing -nothing -it -was -a -tack -in -the -chair -seat -said -one -but -you -all -said -it -however -no -matter -when -i -delivered -the -letter -did -you -deliver -it -and -they -looked -at -each -other -as -people -might -who -thought -that -maybe -they -were -dreaming -then -they -settled -to -listening -and -as -the -story -deepened -and -its -marvels -grew -the -amazement -of -it -made -them -dumb -and -the -interest -of -it -took -their -breath -they -hardly -uttered -a -whisper -during -two -hours -but -sat -like -petrifactions -and -drank -in -the -immortal -romance -at -last -the -tale -was -ended -and -ed -said -and -it's -all -owing -to -you -boys -and -you'll -never -find -me -ungrateful -bless -your -hearts -the -best -friends -a -fellow -ever -had! -you'll -all -have -places -i -want -every -one -of -you -i -know -you -i -know -you -'by -the -back -' -as -the -gamblers -say -you're -jokers -and -all -that -but -you're -sterling -with -the -hallmark -on -and -charley -fairchild -you -shall -be -my -first -assistant -and -right -hand -because -of -your -first -class -ability -and -because -you -got -me -the -letter -and -for -your -father's -sake -who -wrote -it -for -me -and -to -please -mr -vanderbilt -who -said -it -would! -and -here's -to -that -great -man -drink -hearty! -yes -when -the -moment -comes -the -man -appears -even -if -he -is -a -thousand -miles -away -and -has -to -be -discovered -by -a -practical -joke -chapter -xxix -when -people -do -not -respect -us -we -are -sharply -offended -yet -deep -down -in -his -private -heart -no -man -much -respects -himself -pudd'nhead -wilson's -new -calendar -necessarily -the -human -interest -is -the -first -interest -in -the -log -book -of -any -country -the -annals -of -tasmania -in -whose -shadow -we -were -sailing -are -lurid -with -that -feature -tasmania -was -a -convict -dump -in -old -times -this -has -been -indicated -in -the -account -of -the -conciliator -where -reference -is -made -to -vain -attempts -of -desperate -convicts -to -win -to -permanent -freedom -after -escaping -from -macquarrie -harbor -and -the -gates -of -hell -in -the -early -days -tasmania -had -a -great -population -of -convicts -of -both -sexes -and -all -ages -and -a -bitter -hard -life -they -had -in -one -spot -there -was -a -settlement -of -juvenile -convicts -children -who -had -been -sent -thither -from -their -home -and -their -friends -on -the -other -side -of -the -globe -to -expiate -their -crimes -in -due -course -our -ship -entered -the -estuary -called -the -derwent -at -whose -head -stands -hobart -the -capital -of -tasmania -the -derwent's -shores -furnish -scenery -of -an -interesting -sort -the -historian -laurie -whose -book -the -story -of -australasia -is -just -out -invoices -its -features -with -considerable -truth -and -intemperance -the -marvelous -picturesqueness -of -every -point -of -view -combined -with -the -clear -balmy -atmosphere -and -the -transparency -of -the -ocean -depths -must -have -delighted -and -deeply -impressed -the -early -explorers -if -the -rock -bound -coasts -sullen -defiant -and -lowering -seemed -uninviting -these -were -occasionally -broken -into -charmingly -alluring -coves -floored -with -golden -sand -clad -with -evergreen -shrubbery -and -adorned -with -every -variety -of -indigenous -wattle -she -oak -wild -flower -and -fern -from -the -delicately -graceful -'maiden -hair' -to -the -palm -like -'old -man' -while -the -majestic -gum -tree -clean -and -smooth -as -the -mast -of -'some -tall -admiral' -pierces -the -clear -air -to -the -height -of -230 -feet -or -more -it -looked -so -to -me -coasting -along -tasman's -peninsula -what -a -shock -of -pleasant -wonder -must -have -struck -the -early -mariner -on -suddenly -sighting -cape -pillar -with -its -cluster -of -black -ribbed -basaltic -columns -rising -to -a -height -of -900 -feet -the -hydra -head -wreathed -in -a -turban -of -fleecy -cloud -the -base -lashed -by -jealous -waves -spouting -angry -fountains -of -foam -that -is -well -enough -but -i -did -not -suppose -those -snags -were -900 -feet -high -still -they -were -a -very -fine -show -they -stood -boldly -out -by -themselves -and -made -a -fascinatingly -odd -spectacle -but -there -was -nothing -about -their -appearance -to -suggest -the -heads -of -a -hydra -they -looked -like -a -row -of -lofty -slabs -with -their -upper -ends -tapered -to -the -shape -of -a -carving -knife -point -in -fact -the -early -voyager -ignorant -of -their -great -height -might -have -mistaken -them -for -a -rusty -old -rank -of -piles -that -had -sagged -this -way -and -that -out -of -the -perpendicular -the -peninsula -is -lofty -rocky -and -densely -clothed -with -scrub -or -brush -or -both -it -is -joined -to -the -main -by -a -low -neck -at -this -junction -was -formerly -a -convict -station -called -port -arthur -a -place -hard -to -escape -from -behind -it -was -the -wilderness -of -scrub -in -which -a -fugitive -would -soon -starve -in -front -was -the -narrow -neck -with -a -cordon -of -chained -dogs -across -it -and -a -line -of -lanterns -and -a -fence -of -living -guards -armed -we -saw -the -place -as -we -swept -by -that -is -we -had -a -glimpse -of -what -we -were -told -was -the -entrance -to -port -arthur -the -glimpse -was -worth -something -as -a -remembrancer -but -that -was -all -the -voyage -thence -up -the -derwent -frith -displays -a -grand -succession -of -fairy -visions -in -its -entire -length -elsewhere -unequaled -in -gliding -over -the -deep -blue -sea -studded -with -lovely -islets -luxuriant -to -the -water's -edge -one -is -at -a -loss -which -scene -to -choose -for -contemplation -and -to -admire -most -when -the -huon -and -bruni -have -been -passed -there -seems -no -possible -chance -of -a -rival -but -suddenly -mount -wellington -massive -and -noble -like -his -brother -etna -literally -heaves -in -sight -sternly -guarded -on -either -hand -by -mounts -nelson -and -rumney -presently -we -arrive -at -sullivan's -cove -hobart! -it -is -an -attractive -town -it -sits -on -low -hills -that -slope -to -the -harbor -a -harbor -that -looks -like -a -river -and -is -as -smooth -as -one -its -still -surface -is -pictured -with -dainty -reflections -of -boats -and -grassy -banks -and -luxuriant -foliage -back -of -the -town -rise -highlands -that -are -clothed -in -woodland -loveliness -and -over -the -way -is -that -noble -mountain -wellington -a -stately -bulk -a -most -majestic -pile -how -beautiful -is -the -whole -region -for -form -and -grouping -and -opulence -and -freshness -of -foliage -and -variety -of -color -and -grace -and -shapeliness -of -the -hills -the -capes -the -promontories -and -then -the -splendor -of -the -sunlight -the -dim -rich -distances -the -charm -of -the -water -glimpses! -and -it -was -in -this -paradise -that -the -yellow -liveried -convicts -were -landed -and -the -corps -bandits -quartered -and -the -wanton -slaughter -of -the -kangaroo -chasing -black -innocents -consummated -on -that -autumn -day -in -may -in -the -brutish -old -time -it -was -all -out -of -keeping -with -the -place -a -sort -of -bringing -of -heaven -and -hell -together -the -remembrance -of -this -paradise -reminds -me -that -it -was -at -hobart -that -we -struck -the -head -of -the -procession -of -junior -englands -we -were -to -encounter -other -sections -of -it -in -new -zealand -presently -and -others -later -in -natal -wherever -the -exiled -englishman -can -find -in -his -new -home -resemblances -to -his -old -one -he -is -touched -to -the -marrow -of -his -being -the -love -that -is -in -his -heart -inspires -his -imagination -and -these -allied -forces -transfigure -those -resemblances -into -authentic -duplicates -of -the -revered -originals -it -is -beautiful -the -feeling -which -works -this -enchantment -and -it -compels -one's -homage -compels -it -and -also -compels -one's -assent -compels -it -always -even -when -as -happens -sometimes -one -does -not -see -the -resemblances -as -clearly -as -does -the -exile -who -is -pointing -them -out -the -resemblances -do -exist -it -is -quite -true -and -often -they -cunningly -approximate -the -originals -but -after -all -in -the -matter -of -certain -physical -patent -rights -there -is -only -one -england -now -that -i -have -sampled -the -globe -i -am -not -in -doubt -there -is -a -beauty -of -switzerland -and -it -is -repeated -in -the -glaciers -and -snowy -ranges -of -many -parts -of -the -earth -there -is -a -beauty -of -the -fiord -and -it -is -repeated -in -new -zealand -and -alaska -there -is -a -beauty -of -hawaii -and -it -is -repeated -in -ten -thousand -islands -of -the -southern -seas -there -is -a -beauty -of -the -prairie -and -the -plain -and -it -is -repeated -here -and -there -in -the -earth -each -of -these -is -worshipful -each -is -perfect -in -its -way -yet -holds -no -monopoly -of -its -beauty -but -that -beauty -which -is -england -is -alone -it -has -no -duplicate -it -is -made -up -of -very -simple -details -just -grass -and -trees -and -shrubs -and -roads -and -hedges -and -gardens -and -houses -and -vines -and -churches -and -castles -and -here -and -there -a -ruin -and -over -it -all -a -mellow -dream -haze -of -history -but -its -beauty -is -incomparable -and -all -its -own -hobart -has -a -peculiarity -it -is -the -neatest -town -that -the -sun -shines -on -and -i -incline -to -believe -that -it -is -also -the -cleanest -however -that -may -be -its -supremacy -in -neatness -is -not -to -be -questioned -there -cannot -be -another -town -in -the -world -that -has -no -shabby -exteriors -no -rickety -gates -and -fences -no -neglected -houses -crumbling -to -ruin -no -crazy -and -unsightly -sheds -no -weed -grown -front -yards -of -the -poor -no -back -yards -littered -with -tin -cans -and -old -boots -and -empty -bottles -no -rubbish -in -the -gutters -no -clutter -on -the -sidewalks -no -outer -borders -fraying -out -into -dirty -lanes -and -tin -patched -huts -no -in -hobart -all -the -aspects -are -tidy -and -all -a -comfort -to -the -eye -the -modestest -cottage -looks -combed -and -brushed -and -has -its -vines -its -flowers -its -neat -fence -its -neat -gate -its -comely -cat -asleep -on -the -window -ledge -we -had -a -glimpse -of -the -museum -by -courtesy -of -the -american -gentleman -who -is -curator -of -it -it -has -samples -of -half -a -dozen -different -kinds -of -marsupials -[a -marsupial -is -a -plantigrade -vertebrate -whose -specialty -is -its -pocket -in -some -countries -it -is -extinct -in -the -others -it -is -rare -the -first -american -marsupials -were -stephen -girard -mr -aston -and -the -opossum -the -principal -marsupials -of -the -southern -hemisphere -are -mr -rhodes -and -the -kangaroo -i -myself -am -the -latest -marsupial -also -i -might -boast -that -i -have -the -largest -pocket -of -them -all -but -there -is -nothing -in -that -] -one -the -tasmanian -devil -that -is -i -think -he -was -one -of -them -and -there -was -a -fish -with -lungs -when -the -water -dries -up -it -can -live -in -the -mud -most -curious -of -all -was -a -parrot -that -kills -sheep -on -one -great -sheep -run -this -bird -killed -a -thousand -sheep -in -a -whole -year -he -doesn't -want -the -whole -sheep -but -only -the -kidney -fat -this -restricted -taste -makes -him -an -expensive -bird -to -support -to -get -the -fat -he -drives -his -beak -in -and -rips -it -out -the -wound -is -mortal -this -parrot -furnishes -a -notable -example -of -evolution -brought -about -by -changed -conditions -when -the -sheep -culture -was -introduced -it -presently -brought -famine -to -the -parrot -by -exterminating -a -kind -of -grub -which -had -always -thitherto -been -the -parrot's -diet -the -miseries -of -hunger -made -the -bird -willing -to -eat -raw -flesh -since -it -could -get -no -other -food -and -it -began -to -pick -remnants -of -meat -from -sheep -skins -hung -out -on -the -fences -to -dry -it -soon -came -to -prefer -sheep -meat -to -any -other -food -and -by -and -by -it -came -to -prefer -the -kidney -fat -to -any -other -detail -of -the -sheep -the -parrot's -bill -was -not -well -shaped -for -digging -out -the -fat -but -nature -fixed -that -matter -she -altered -the -bill's -shape -and -now -the -parrot -can -dig -out -kidney -fat -better -than -the -chief -justice -of -the -supreme -court -or -anybody -else -for -that -matter -even -an -admiral -and -there -was -another -curiosity -quite -a -stunning -one -i -thought -arrow -heads -and -knives -just -like -those -which -primeval -man -made -out -of -flint -and -thought -he -had -done -such -a -wonderful -thing -yes -and -has -been -humored -and -coddled -in -that -superstition -by -this -age -of -admiring -scientists -until -there -is -probably -no -living -with -him -in -the -other -world -by -now -yet -here -is -his -finest -and -nicest -work -exactly -duplicated -in -our -day -and -by -people -who -have -never -heard -of -him -or -his -works -by -aborigines -who -lived -in -the -islands -of -these -seas -within -our -time -and -they -not -only -duplicated -those -works -of -art -but -did -it -in -the -brittlest -and -most -treacherous -of -substances -glass -made -them -out -of -old -brandy -bottles -flung -out -of -the -british -camps -millions -of -tons -of -them -it -is -time -for -primeval -man -to -make -a -little -less -noise -now -he -has -had -his -day -he -is -not -what -he -used -to -be -we -had -a -drive -through -a -bloomy -and -odorous -fairy -land -to -the -refuge -for -the -indigent -a -spacious -and -comfortable -home -with -hospitals -etc -for -both -sexes -there -was -a -crowd -in -there -of -the -oldest -people -i -have -ever -seen -it -was -like -being -suddenly -set -down -in -a -new -world -a -weird -world -where -youth -has -never -been -a -world -sacred -to -age -and -bowed -forms -and -wrinkles -out -of -the -359 -persons -present -223 -were -ex -convicts -and -could -have -told -stirring -tales -no -doubt -if -they -had -been -minded -to -talk -42 -of -the -359 -were -past -80 -and -several -were -close -upon -90 -the -average -age -at -death -there -is -76 -years -as -for -me -i -have -no -use -for -that -place -it -is -too -healthy -seventy -is -old -enough -after -that -there -is -too -much -risk -youth -and -gaiety -might -vanish -any -day -and -then -what -is -left -death -in -life -death -without -its -privileges -death -without -its -benefits -there -were -185 -women -in -that -refuge -and -81 -of -them -were -ex -convicts -the -steamer -disappointed -us -instead -of -making -a -long -visit -at -hobart -as -usual -she -made -a -short -one -so -we -got -but -a -glimpse -of -tasmania -and -then -moved -on -chapter -xxx -nature -makes -the -locust -with -an -appetite -for -crops -man -would -have -made -him -with -an -appetite -for -sand -pudd'nhead -wilson's -new -calendar -we -spent -part -of -an -afternoon -and -a -night -at -sea -and -reached -bluff -in -new -zealand -early -in -the -morning -bluff -is -at -the -bottom -of -the -middle -island -and -is -away -down -south -nearly -forty -seven -degrees -below -the -equator -it -lies -as -far -south -of -the -line -as -quebec -lies -north -of -it -and -the -climates -of -the -two -should -be -alike -but -for -some -reason -or -other -it -has -not -been -so -arranged -quebec -is -hot -in -the -summer -and -cold -in -the -winter -but -bluff's -climate -is -less -intense -the -cold -weather -is -not -very -cold -the -hot -weather -is -not -very -hot -and -the -difference -between -the -hottest -month -and -the -coldest -is -but -17 -degrees -fahrenheit -in -new -zealand -the -rabbit -plague -began -at -bluff -the -man -who -introduced -the -rabbit -there -was -banqueted -and -lauded -but -they -would -hang -him -now -if -they -could -get -him -in -england -the -natural -enemy -of -the -rabbit -is -detested -and -persecuted -in -the -bluff -region -the -natural -enemy -of -the -rabbit -is -honored -and -his -person -is -sacred -the -rabbit's -natural -enemy -in -england -is -the -poacher -in -bluff -its -natural -enemy -is -the -stoat -the -weasel -the -ferret -the -cat -and -the -mongoose -in -england -any -person -below -the -heir -who -is -caught -with -a -rabbit -in -his -possession -must -satisfactorily -explain -how -it -got -there -or -he -will -suffer -fine -and -imprisonment -together -with -extinction -of -his -peerage -in -bluff -the -cat -found -with -a -rabbit -in -its -possession -does -not -have -to -explain -everybody -looks -the -other -way -the -person -caught -noticing -would -suffer -fine -and -imprisonment -with -extinction -of -peerage -this -is -a -sure -way -to -undermine -the -moral -fabric -of -a -cat -thirty -years -from -now -there -will -not -be -a -moral -cat -in -new -zealand -some -think -there -is -none -there -now -in -england -the -poacher -is -watched -tracked -hunted -he -dare -not -show -his -face -in -bluff -the -cat -the -weasel -the -stoat -and -the -mongoose -go -up -and -down -whither -they -will -unmolested -by -a -law -of -the -legislature -posted -where -all -may -read -it -is -decreed -that -any -person -found -in -possession -of -one -of -these -creatures -dead -must -satisfactorily -explain -the -circumstances -or -pay -a -fine -of -not -less -than -l5 -nor -more -than -l20 -the -revenue -from -this -source -is -not -large -persons -who -want -to -pay -a -hundred -dollars -for -a -dead -cat -are -getting -rarer -and -rarer -every -day -this -is -bad -for -the -revenue -was -to -go -to -the -endowment -of -a -university -all -governments -are -more -or -less -short -sighted -in -england -they -fine -the -poacher -whereas -he -ought -to -be -banished -to -new -zealand -new -zealand -would -pay -his -way -and -give -him -wages -it -was -from -bluff -that -we -ought -to -have -cut -across -to -the -west -coast -and -visited -the -new -zealand -switzerland -a -land -of -superb -scenery -made -up -of -snowy -grandeurs -anal -mighty -glaciers -and -beautiful -lakes -and -over -there -also -are -the -wonderful -rivals -of -the -norwegian -and -alaskan -fiords -and -for -neighbor -a -waterfall -of -1 -900 -feet -but -we -were -obliged -to -postpone -the -trip -to -some -later -and -indefinite -time -november -6 -a -lovely -summer -morning -brilliant -blue -sky -a -few -miles -out -from -invercargill -passed -through -vast -level -green -expanses -snowed -over -with -sheep -fine -to -see -the -green -deep -and -very -vivid -sometimes -at -other -times -less -so -but -delicate -and -lovely -a -passenger -reminds -me -that -i -am -in -the -england -of -the -far -south -dunedin -same -date -the -town -justifies -michael -davitt's -praises -the -people -are -scotch -they -stopped -here -on -their -way -from -home -to -heaven -thinking -they -had -arrived -the -population -is -stated -at -40 -000 -by -malcolm -ross -journalist -stated -by -an -m -p -at -60 -000 -a -journalist -cannot -lie -to -the -residence -of -dr -hockin -he -has -a -fine -collection -of -books -relating -to -new -zealand -and -his -house -is -a -museum -of -maori -art -and -antiquities -he -has -pictures -and -prints -in -color -of -many -native -chiefs -of -the -past -some -of -them -of -note -in -history -there -is -nothing -of -the -savage -in -the -faces -nothing -could -be -finer -than -these -men's -features -nothing -more -intellectual -than -these -faces -nothing -more -masculine -nothing -nobler -than -their -aspect -the -aboriginals -of -australia -and -tasmania -looked -the -savage -but -these -chiefs -looked -like -roman -patricians -the -tattooing -in -these -portraits -ought -to -suggest -the -savage -of -course -but -it -does -not -the -designs -are -so -flowing -and -graceful -and -beautiful -that -they -are -a -most -satisfactory -decoration -it -takes -but -fifteen -minutes -to -get -reconciled -to -the -tattooing -and -but -fifteen -more -to -perceive -that -it -is -just -the -thing -after -that -the -undecorated -european -face -is -unpleasant -and -ignoble -dr -hockiu -gave -us -a -ghastly -curiosity -a -lignified -caterpillar -with -a -plant -growing -out -of -the -back -of -its -neck -a -plant -with -a -slender -stem -4 -inches -high -it -happened -not -by -accident -but -by -design -nature's -design -this -caterpillar -was -in -the -act -of -loyally -carrying -out -a -law -inflicted -upon -him -by -nature -a -law -purposely -inflicted -upon -him -to -get -him -into -trouble -a -law -which -was -a -trap -in -pursuance -of -this -law -he -made -the -proper -preparations -for -turning -himself -into -a -night -moth -that -is -to -say -he -dug -a -little -trench -a -little -grave -and -then -stretched -himself -out -in -it -on -his -stomach -and -partially -buried -himself -then -nature -was -ready -for -him -she -blew -the -spores -of -a -peculiar -fungus -through -the -air -with -a -purpose -some -of -them -fell -into -a -crease -in -the -back -of -the -caterpillar's -neck -and -began -to -sprout -and -grow -for -there -was -soil -there -he -had -not -washed -his -neck -the -roots -forced -themselves -down -into -the -worm's -person -and -rearward -along -through -its -body -sucking -up -the -creature's -juices -for -sap -the -worm -slowly -died -and -turned -to -wood -and -here -he -was -now -a -wooden -caterpillar -with -every -detail -of -his -former -physique -delicately -and -exactly -preserved -and -perpetuated -and -with -that -stem -standing -up -out -of -him -for -his -monument -monument -commemorative -of -his -own -loyalty -and -of -nature's -unfair -return -for -it -nature -is -always -acting -like -that -mrs -x -said -of -course -that -the -caterpillar -was -not -conscious -and -didn't -suffer -she -should -have -known -better -no -caterpillar -can -deceive -nature -if -this -one -couldn't -suffer -nature -would -have -known -it -and -would -have -hunted -up -another -caterpillar -not -that -she -would -have -let -this -one -go -merely -because -it -was -defective -no -she -would -have -waited -and -let -him -turn -into -a -night -moth -and -then -fried -him -in -the -candle -nature -cakes -a -fish's -eyes -over -with -parasites -so -that -it -shan't -be -able -to -avoid -its -enemies -or -find -its -food -she -sends -parasites -into -a -star -fish's -system -which -clog -up -its -prongs -and -swell -them -and -make -them -so -uncomfortable -that -the -poor -creature -delivers -itself -from -the -prong -to -ease -its -misery -and -presently -it -has -to -part -with -another -prong -for -the -sake -of -comfort -and -finally -with -a -third -if -it -re -grows -the -prongs -the -parasite -returns -and -the -same -thing -is -repeated -and -finally -when -the -ability -to -reproduce -prongs -is -lost -through -age -that -poor -old -star -fish -can't -get -around -any -more -and -so -it -dies -of -starvation -in -australia -is -prevalent -a -horrible -disease -due -to -an -unperfected -tapeworm -unperfected -that -is -what -they -call -it -i -do -not -know -why -for -it -transacts -business -just -as -well -as -if -it -were -finished -and -frescoed -and -gilded -and -all -that -november -9 -to -the -museum -and -public -picture -gallery -with -the -president -of -the -society -of -artists -some -fine -pictures -there -lent -by -the -s -of -a -several -of -them -they -bought -the -others -came -to -them -by -gift -next -to -the -gallery -of -the -s -of -a -annual -exhibition -just -opened -fine -think -of -a -town -like -this -having -two -such -collections -as -this -and -a -society -of -artists -it -is -so -all -over -australasia -if -it -were -a -monarchy -one -might -understand -it -i -mean -an -absolute -monarchy -where -it -isn't -necessary -to -vote -money -but -take -it -then -art -flourishes -but -these -colonies -are -republics -republics -with -a -wide -suffrage -voters -of -both -sexes -this -one -of -new -zealand -in -republics -neither -the -government -nor -the -rich -private -citizen -is -much -given -to -propagating -art -all -over -australasia -pictures -by -famous -european -artists -are -bought -for -the -public -galleries -by -the -state -and -by -societies -of -citizens -living -citizens -not -dead -ones -they -rob -themselves -to -give -not -their -heirs -this -s -of -a -here -owns -its -buildings -built -it -by -subscription -chapter -xxxi -the -spirit -of -wrath -not -the -words -is -the -sin -and -the -spirit -of -wrath -is -cursing -we -begin -to -swear -before -we -can -talk -pudd'nhead -wilson's -new -calendar -november -11 -on -the -road -this -train -express -goes -twenty -and -one -half -miles -an -hour -schedule -time -but -it -is -fast -enough -the -outlook -upon -sea -and -land -is -so -interesting -and -the -cars -so -comfortable -they -are -not -english -and -not -american -they -are -the -swiss -combination -of -the -two -a -narrow -and -railed -porch -along -the -side -where -a -person -can -walk -up -and -down -a -lavatory -in -each -car -this -is -progress -this -is -nineteenth -century -spirit -in -new -zealand -these -fast -expresses -run -twice -a -week -it -is -well -to -know -this -if -you -want -to -be -a -bird -and -fly -through -the -country -at -a -20 -mile -gait -otherwise -you -may -start -on -one -of -the -five -wrong -days -and -then -you -will -get -a -train -that -can't -overtake -its -own -shadow -by -contrast -these -pleasant -cars -call -to -mind -the -branch -road -cars -at -maryborough -australia -and -the -passengers' -talk -about -the -branch -road -and -the -hotel -somewhere -on -the -road -to -maryborough -i -changed -for -a -while -to -a -smoking -carriage -there -were -two -gentlemen -there -both -riding -backward -one -at -each -end -of -the -compartment -they -were -acquaintances -of -each -other -i -sat -down -facing -the -one -that -sat -at -the -starboard -window -he -had -a -good -face -and -a -friendly -look -and -i -judged -from -his -dress -that -he -was -a -dissenting -minister -he -was -along -toward -fifty -of -his -own -motion -he -struck -a -match -and -shaded -it -with -his -hand -for -me -to -light -my -cigar -i -take -the -rest -from -my -diary -in -order -to -start -conversation -i -asked -him -something -about -maryborough -he -said -in -a -most -pleasant -even -musical -voice -but -with -quiet -and -cultured -decision -it's -a -charming -town -with -a -hell -of -a -hotel -i -was -astonished -it -seemed -so -odd -to -hear -a -minister -swear -out -loud -he -went -placidly -on -it's -the -worst -hotel -in -australia -well -one -may -go -further -and -say -in -australasia -bad -beds -no -none -at -all -just -sand -bags -the -pillows -too -yes -the -pillows -too -just -sand -and -not -a -good -quality -of -sand -it -packs -too -hard -and -has -never -been -screened -there -is -too -much -gravel -in -it -it -is -like -sleeping -on -nuts -isn't -there -any -good -sand -plenty -of -it -there -is -as -good -bed -sand -in -this -region -as -the -world -can -furnish -aerated -sand -and -loose -but -they -won't -buy -it -they -want -something -that -will -pack -solid -and -petrify -how -are -the -rooms -eight -feet -square -and -a -sheet -of -iced -oil -cloth -to -step -on -in -the -morning -when -you -get -out -of -the -sand -quarry -as -to -lights -coal -oil -lamp -a -good -one -no -it's -the -kind -that -sheds -a -gloom -i -like -a -lamp -that -burns -all -night -this -one -won't -you -must -blow -it -out -early -that -is -bad -one -might -want -it -again -in -the -night -can't -find -it -in -the -dark -there's -no -trouble -you -can -find -it -by -the -stench -wardrobe -two -nails -on -the -door -to -hang -seven -suits -of -clothes -on -if -you've -got -them -bells -there -aren't -any -what -do -you -do -when -you -want -service -shout -but -it -won't -fetch -anybody -suppose -you -want -the -chambermaid -to -empty -the -slopjar -there -isn't -any -slop -jar -the -hotels -don't -keep -them -that -is -outside -of -sydney -and -melbourne -yes -i -knew -that -i -was -only -talking -it's -the -oddest -thing -in -australia -another -thing -i've -got -to -get -up -in -the -dark -in -the -morning -to -take -the -5 -o'clock -train -now -if -the -boots -there -isn't -any -well -the -porter -there -isn't -any -but -who -will -call -me -nobody -you'll -call -yourself -and -you'll -light -yourself -too -there'll -not -be -a -light -burning -in -the -halls -or -anywhere -and -if -you -don't -carry -a -light -you'll -break -your -neck -but -who -will -help -me -down -with -my -baggage -nobody -however -i -will -tell -you -what -to -do -in -maryborough -there's -an -american -who -has -lived -there -half -a -lifetime -a -fine -man -and -prosperous -and -popular -he -will -be -on -the -lookout -for -you -you -won't -have -any -trouble -sleep -in -peace -he -will -rout -you -out -and -you -will -make -your -train -where -is -your -manager -i -left -him -at -ballarat -studying -the -language -and -besides -he -had -to -go -to -melbourne -and -get -us -ready -for -new -zealand -i've -not -tried -to -pilot -myself -before -and -it -doesn't -look -easy -easy! -you've -selected -the -very -most -difficult -piece -of -railroad -in -australia -for -your -experiment -there -are -twelve -miles -of -this -road -which -no -man -without -good -executive -ability -can -ever -hope -tell -me -have -you -good -executive -ability -first -rate -executive -ability -i -well -i -think -so -but -that -settles -it -the -tone -of -oh -you -wouldn't -ever -make -it -in -the -world -however -that -american -will -point -you -right -and -you'll -go -you've -got -tickets -yes -round -trip -all -the -way -to -sydney -ah -there -it -is -you -see! -you -are -going -in -the -5 -o'clock -by -castlemaine -twelve -miles -instead -of -the -7 -15 -by -ballarat -in -order -to -save -two -hours -of -fooling -along -the -road -now -then -don't -interrupt -let -me -have -the -floor -you're -going -to -save -the -government -a -deal -of -hauling -but -that's -nothing -your -ticket -is -by -ballarat -and -it -isn't -good -over -that -twelve -miles -and -so -but -why -should -the -government -care -which -way -i -go -goodness -knows! -ask -of -the -winds -that -far -away -with -fragments -strewed -the -sea -as -the -boy -that -stood -on -the -burning -deck -used -to -say -the -government -chooses -to -do -its -railway -business -in -its -own -way -and -it -doesn't -know -as -much -about -it -as -the -french -in -the -beginning -they -tried -idiots -then -they -imported -the -french -which -was -going -backwards -you -see -now -it -runs -the -roads -itself -which -is -going -backwards -again -you -see -why -do -you -know -in -order -to -curry -favor -with -the -voters -the -government -puts -down -a -road -wherever -anybody -wants -it -anybody -that -owns -two -sheep -and -a -dog -and -by -consequence -we've -got -in -the -colony -of -victoria -800 -railway -stations -and -the -business -done -at -eighty -of -them -doesn't -foot -up -twenty -shillings -a -week -five -dollars -oh -come! -it's -true -it's -the -absolute -truth -why -there -are -three -or -four -men -on -wages -at -every -station -i -know -it -and -the -station -business -doesn't -pay -for -the -sheep -dip -to -sanctify -their -coffee -with -it's -just -as -i -say -and -accommodating -why -if -you -shake -a -rag -the -train -will -stop -in -the -midst -of -the -wilderness -to -pick -you -up -all -that -kind -of -politics -costs -you -see -and -then -besides -any -town -that -has -a -good -many -votes -and -wants -a -fine -station -gets -it -don't -you -overlook -that -maryborough -station -if -you -take -an -interest -in -governmental -curiosities -why -you -can -put -the -whole -population -of -maryborough -into -it -and -give -them -a -sofa -apiece -and -have -room -for -more -you -haven't -fifteen -stations -in -america -that -are -as -big -and -you -probably -haven't -five -that -are -half -as -fine -why -it's -perfectly -elegant -and -the -clock! -everybody -will -show -you -the -clock -there -isn't -a -station -in -europe -that's -got -such -a -clock -it -doesn't -strike -and -that's -one -mercy -it -hasn't -any -bell -and -as -you'll -have -cause -to -remember -if -you -keep -your -reason -all -australia -is -simply -bedamned -with -bells -on -every -quarter -hour -night -and -day -they -jingle -a -tiresome -chime -of -half -a -dozen -notes -all -the -clocks -in -town -at -once -all -the -clocks -in -australasia -at -once -and -all -the -very -same -notes -first -downward -scale -mi -re -do -sol -then -upward -scale -sol -si -re -do -down -again -mi -re -do -sol -up -again -sol -si -re -do -then -the -clock -say -at -midnight -clang -clang -clang -clang -clang -clang -clang -clang -clang -clang -and -by -that -time -you're -hello -what's -all -this -excitement -about -a -runaway -scared -by -the -train -why -you -think -this -train -could -scare -anything -well -when -they -build -eighty -stations -at -a -loss -and -a -lot -of -palace -stations -and -clocks -like -maryborough's -at -another -loss -the -government -has -got -to -economize -somewhere -hasn't -it -very -well -look -at -the -rolling -stock -that's -where -they -save -the -money -why -that -train -from -maryborough -will -consist -of -eighteen -freight -cars -and -two -passenger -kennels -cheap -poor -shabby -slovenly -no -drinking -water -no -sanitary -arrangements -every -imaginable -inconvenience -and -slow -oh -the -gait -of -cold -molasses -no -air -brake -no -springs -and -they'll -jolt -your -head -off -every -time -they -start -or -stop -that's -where -they -make -their -little -economies -you -see -they -spend -tons -of -money -to -house -you -palatially -while -you -wait -fifteen -minutes -for -a -train -then -degrade -you -to -six -hours' -convict -transportation -to -get -the -foolish -outlay -back -what -a -rational -man -really -needs -is -discomfort -while -he's -waiting -then -his -journey -in -a -nice -train -would -be -a -grateful -change -but -no -that -would -be -common -sense -and -out -of -place -in -a -government -and -then -besides -they -save -in -that -other -little -detail -you -know -repudiate -their -own -tickets -and -collect -a -poor -little -illegitimate -extra -shilling -out -of -you -for -that -twelve -miles -and -well -in -any -case -wait -there's -more -leave -that -american -out -of -the -account -and -see -what -would -happen -there's -nobody -on -hand -to -examine -your -ticket -when -you -arrive -but -the -conductor -will -come -and -examine -it -when -the -train -is -ready -to -start -it -is -too -late -to -buy -your -extra -ticket -now -the -train -can't -wait -and -won't -you -must -climb -out -but -can't -i -pay -the -conductor -no -he -is -not -authorized -to -receive -the -money -and -he -won't -you -must -climb -out -there's -no -other -way -i -tell -you -the -railway -management -is -about -the -only -thoroughly -european -thing -here -continentally -european -i -mean -not -english -it's -the -continental -business -in -perfection -down -fine -oh -yes -even -to -the -peanut -commerce -of -weighing -baggage -the -train -slowed -up -at -his -place -as -he -stepped -out -he -said -yes -you'll -like -maryborough -plenty -of -intelligence -there -it's -a -charming -place -with -a -hell -of -a -hotel -then -he -was -gone -i -turned -to -the -other -gentleman -is -your -friend -in -the -ministry -no -studying -for -it -chapter -xxxii -the -man -with -a -new -idea -is -a -crank -until -the -idea -succeeds -pudd'nhead -wilson's -new -calendar -it -was -junior -england -all -the -way -to -christchurch -in -fact -just -a -garden -and -christchurch -is -an -english -town -with -an -english -park -annex -and -a -winding -english -brook -just -like -the -avon -and -named -the -avon -but -from -a -man -not -from -shakespeare's -river -its -grassy -banks -are -bordered -by -the -stateliest -and -most -impressive -weeping -willows -to -be -found -in -the -world -i -suppose -they -continue -the -line -of -a -great -ancestor -they -were -grown -from -sprouts -of -the -willow -that -sheltered -napoleon's -grave -in -st -helena -it -is -a -settled -old -community -with -all -the -serenities -the -graces -the -conveniences -and -the -comforts -of -the -ideal -home -life -if -it -had -an -established -church -and -social -inequality -it -would -be -england -over -again -with -hardly -a -lack -in -the -museum -we -saw -many -curious -and -interesting -things -among -others -a -fine -native -house -of -the -olden -time -with -all -the -details -true -to -the -facts -and -the -showy -colors -right -and -in -their -proper -places -all -the -details -the -fine -mats -and -rugs -and -things -the -elaborate -and -wonderful -wood -carvings -wonderful -surely -considering -who -did -them -wonderful -in -design -and -particularly -in -execution -for -they -were -done -with -admirable -sharpness -and -exactness -and -yet -with -no -better -tools -than -flint -and -jade -and -shell -could -furnish -and -the -totem -posts -were -there -ancestor -above -ancestor -with -tongues -protruded -and -hands -clasped -comfortably -over -bellies -containing -other -people's -ancestors -grotesque -and -ugly -devils -every -one -but -lovingly -carved -and -ably -and -the -stuffed -natives -were -present -in -their -proper -places -and -looking -as -natural -as -life -and -the -housekeeping -utensils -were -there -too -and -close -at -hand -the -carved -and -finely -ornamented -war -canoe -and -we -saw -little -jade -gods -to -hang -around -the -neck -not -everybody's -but -sacred -to -the -necks -of -natives -of -rank -also -jade -weapons -and -many -kinds -of -jade -trinkets -all -made -out -of -that -excessively -hard -stone -without -the -help -of -any -tool -of -iron -and -some -of -these -things -had -small -round -holes -bored -through -them -nobody -knows -how -it -was -done -a -mystery -a -lost -art -i -think -it -was -said -that -if -you -want -such -a -hole -bored -in -a -piece -of -jade -now -you -must -send -it -to -london -or -amsterdam -where -the -lapidaries -are -also -we -saw -a -complete -skeleton -of -the -giant -moa -it -stood -ten -feet -high -and -must -have -been -a -sight -to -look -at -when -it -was -a -living -bird -it -was -a -kicker -like -the -ostrich -in -fight -it -did -not -use -its -beak -but -its -foot -it -must -have -been -a -convincing -kind -of -kick -if -a -person -had -his -back -to -the -bird -and -did -not -see -who -it -was -that -did -it -he -would -think -he -had -been -kicked -by -a -wind -mill -there -must -have -been -a -sufficiency -of -moas -in -the -old -forgotten -days -when -his -breed -walked -the -earth -his -bones -are -found -in -vast -masses -all -crammed -together -in -huge -graves -they -are -not -in -caves -but -in -the -ground -nobody -knows -how -they -happened -to -get -concentrated -there -mind -they -are -bones -not -fossils -this -means -that -the -moa -has -not -been -extinct -very -long -still -this -is -the -only -new -zealand -creature -which -has -no -mention -in -that -otherwise -comprehensive -literature -the -native -legends -this -is -a -significant -detail -and -is -good -circumstantial -evidence -that -the -moa -has -been -extinct -500 -years -since -the -maori -has -himself -by -tradition -been -in -new -zealand -since -the -end -of -the -fifteenth -century -he -came -from -an -unknown -land -the -first -maori -did -then -sailed -back -in -his -canoe -and -brought -his -tribe -and -they -removed -the -aboriginal -peoples -into -the -sea -and -into -the -ground -and -took -the -land -that -is -the -tradition -that -that -first -maori -could -come -is -understandable -for -anybody -can -come -to -a -place -when -he -isn't -trying -to -but -how -that -discoverer -found -his -way -back -home -again -without -a -compass -is -his -secret -and -he -died -with -it -in -him -his -language -indicates -that -he -came -from -polynesia -he -told -where -he -came -from -but -he -couldn't -spell -well -so -one -can't -find -the -place -on -the -map -because -people -who -could -spell -better -than -he -could -spelt -the -resemblance -all -out -of -it -when -they -made -the -map -however -it -is -better -to -have -a -map -that -is -spelt -right -than -one -that -has -information -in -it -in -new -zealand -women -have -the -right -to -vote -for -members -of -the -legislature -but -they -cannot -be -members -themselves -the -law -extending -the -suffrage -to -them -event -into -effect -in -1893 -the -population -of -christchurch -census -of -1891 -was -31 -454 -the -first -election -under -the -law -was -held -in -november -of -that -year -number -of -men -who -voted -6 -313 -number -of -women -who -voted -5 -989 -these -figures -ought -to -convince -us -that -women -are -not -as -indifferent -about -politics -as -some -people -would -have -us -believe -in -new -zealand -as -a -whole -the -estimated -adult -female -population -was -139 -915 -of -these -109 -461 -qualified -and -registered -their -names -on -the -rolls -78 -23 -per -cent -of -the -whole -of -these -90 -290 -went -to -the -polls -and -voted -85 -18 -per -cent -do -men -ever -turn -out -better -than -that -in -america -or -elsewhere -here -is -a -remark -to -the -other -sex's -credit -too -i -take -it -from -the -official -report -a -feature -of -the -election -was -the -orderliness -and -sobriety -of -the -people -women -were -in -no -way -molested -at -home -a -standing -argument -against -woman -suffrage -has -always -been -that -women -could -not -go -to -the -polls -without -being -insulted -the -arguments -against -woman -suffrage -have -always -taken -the -easy -form -of -prophecy -the -prophets -have -been -prophesying -ever -since -the -woman's -rights -movement -began -in -1848 -and -in -forty -seven -years -they -have -never -scored -a -hit -men -ought -to -begin -to -feel -a -sort -of -respect -for -their -mothers -and -wives -and -sisters -by -this -time -the -women -deserve -a -change -of -attitude -like -that -for -they -have -wrought -well -in -forty -seven -years -they -have -swept -an -imposingly -large -number -of -unfair -laws -from -the -statute -books -of -america -in -that -brief -time -these -serfs -have -set -themselves -free -essentially -men -could -not -have -done -so -much -for -themselves -in -that -time -without -bloodshed -at -least -they -never -have -and -that -is -argument -that -they -didn't -know -how -the -women -have -accomplished -a -peaceful -revolution -and -a -very -beneficent -one -and -yet -that -has -not -convinced -the -average -man -that -they -are -intelligent -and -have -courage -and -energy -and -perseverance -and -fortitude -it -takes -much -to -convince -the -average -man -of -anything -and -perhaps -nothing -can -ever -make -him -realize -that -he -is -the -average -woman's -inferior -yet -in -several -important -details -the -evidences -seems -to -show -that -that -is -what -he -is -man -has -ruled -the -human -race -from -the -beginning -but -he -should -remember -that -up -to -the -middle -of -the -present -century -it -was -a -dull -world -and -ignorant -and -stupid -but -it -is -not -such -a -dull -world -now -and -is -growing -less -and -less -dull -all -the -time -this -is -woman's -opportunity -she -has -had -none -before -i -wonder -where -man -will -be -in -another -forty -seven -years -in -the -new -zealand -law -occurs -this -the -word -person -wherever -it -occurs -throughout -the -act -includes -woman -that -is -promotion -you -see -by -that -enlargement -of -the -word -the -matron -with -the -garnered -wisdom -and -experience -of -fifty -years -becomes -at -one -jump -the -political -equal -of -her -callow -kid -of -twenty -one -the -white -population -of -the -colony -is -626 -000 -the -maori -population -is -42 -000 -the -whites -elect -seventy -members -of -the -house -of -representatives -the -maoris -four -the -maori -women -vote -for -their -four -members -november -16 -after -four -pleasant -days -in -christchurch -we -are -to -leave -at -midnight -to -night -mr -kinsey -gave -me -an -ornithorhynchus -and -i -am -taming -it -sunday -17th -sailed -last -night -in -the -flora -from -lyttelton -so -we -did -i -remember -it -yet -the -people -who -sailed -in -the -flora -that -night -may -forget -some -other -things -if -they -live -a -good -while -but -they -will -not -live -long -enough -to -forget -that -the -flora -is -about -the -equivalent -of -a -cattle -scow -but -when -the -union -company -find -it -inconvenient -to -keep -a -contract -and -lucrative -to -break -it -they -smuggle -her -into -passenger -service -and -keep -the -change -they -give -no -notice -of -their -projected -depredation -you -innocently -buy -tickets -for -the -advertised -passenger -boat -and -when -you -get -down -to -lyttelton -at -midnight -you -find -that -they -have -substituted -the -scow -they -have -plenty -of -good -boats -but -no -competition -and -that -is -the -trouble -it -is -too -late -now -to -make -other -arrangements -if -you -have -engagements -ahead -it -is -a -powerful -company -it -has -a -monopoly -and -everybody -is -afraid -of -it -including -the -government's -representative -who -stands -at -the -end -of -the -stage -plank -to -tally -the -passengers -and -see -that -no -boat -receives -a -greater -number -than -the -law -allows -her -to -carry -this -conveniently -blind -representative -saw -the -scow -receive -a -number -which -was -far -in -excess -of -its -privilege -and -winked -a -politic -wink -and -said -nothing -the -passengers -bore -with -meekness -the -cheat -which -had -been -put -upon -them -and -made -no -complaint -it -was -like -being -at -home -in -america -where -abused -passengers -act -in -just -the -same -way -a -few -days -before -the -union -company -had -discharged -a -captain -for -getting -a -boat -into -danger -and -had -advertised -this -act -as -evidence -of -its -vigilance -in -looking -after -the -safety -of -the -passengers -for -thugging -a -captain -costs -the -company -nothing -but -when -opportunity -offered -to -send -this -dangerously -overcrowded -tub -to -sea -and -save -a -little -trouble -and -a -tidy -penny -by -it -it -forgot -to -worry -about -the -passenger's -safety -the -first -officer -told -me -that -the -flora -was -privileged -to -carry -125 -passengers -she -must -have -had -all -of -200 -on -board -all -the -cabins -were -full -all -the -cattle -stalls -in -the -main -stable -were -full -the -spaces -at -the -heads -of -companionways -were -full -every -inch -of -floor -and -table -in -the -swill -room -was -packed -with -sleeping -men -and -remained -so -until -the -place -was -required -for -breakfast -all -the -chairs -and -benches -on -the -hurricane -deck -were -occupied -and -still -there -were -people -who -had -to -walk -about -all -night! -if -the -flora -had -gone -down -that -night -half -of -the -people -on -board -would -have -been -wholly -without -means -of -escape -the -owners -of -that -boat -were -not -technically -guilty -of -conspiracy -to -commit -murder -but -they -were -morally -guilty -of -it -i -had -a -cattle -stall -in -the -main -stable -a -cavern -fitted -up -with -a -long -double -file -of -two -storied -bunks -the -files -separated -by -a -calico -partition -twenty -men -and -boys -on -one -side -of -it -twenty -women -and -girls -on -the -other -the -place -was -as -dark -as -the -soul -of -the -union -company -and -smelt -like -a -kennel -when -the -vessel -got -out -into -the -heavy -seas -and -began -to -pitch -and -wallow -the -cavern -prisoners -became -immediately -seasick -and -then -the -peculiar -results -that -ensued -laid -all -my -previous -experiences -of -the -kind -well -away -in -the -shade -and -the -wails -the -groans -the -cries -the -shrieks -the -strange -ejaculations -it -was -wonderful -the -women -and -children -and -some -of -the -men -and -boys -spent -the -night -in -that -place -for -they -were -too -ill -to -leave -it -but -the -rest -of -us -got -up -by -and -by -and -finished -the -night -on -the -hurricane -deck -that -boat -was -the -foulest -i -was -ever -in -and -the -smell -of -the -breakfast -saloon -when -we -threaded -our -way -among -the -layers -of -steaming -passengers -stretched -upon -its -floor -and -its -tables -was -incomparable -for -efficiency -a -good -many -of -us -got -ashore -at -the -first -way -port -to -seek -another -ship -after -a -wait -of -three -hours -we -got -good -rooms -in -the -mahinapua -a -wee -little -bridal -parlor -of -a -boat -only -205 -tons -burthen -clean -and -comfortable -good -service -good -beds -good -table -and -no -crowding -the -seas -danced -her -about -like -a -duck -but -she -was -safe -and -capable -next -morning -early -she -went -through -the -french -pass -a -narrow -gateway -of -rock -between -bold -headlands -so -narrow -in -fact -that -it -seemed -no -wider -than -a -street -the -current -tore -through -there -like -a -mill -race -and -the -boat -darted -through -like -a -telegram -the -passage -was -made -in -half -a -minute -then -we -were -in -a -wide -place -where -noble -vast -eddies -swept -grandly -round -and -round -in -shoal -water -and -i -wondered -what -they -would -do -with -the -little -boat -they -did -as -they -pleased -with -her -they -picked -her -up -and -flung -her -around -like -nothing -and -landed -her -gently -on -the -solid -smooth -bottom -of -sand -so -gently -indeed -that -we -barely -felt -her -touch -it -barely -felt -her -quiver -when -she -came -to -a -standstill -the -water -was -as -clear -as -glass -the -sand -on -the -bottom -was -vividly -distinct -and -the -fishes -seemed -to -be -swimming -about -in -nothing -fishing -lines -were -brought -out -but -before -we -could -bait -the -hooks -the -boat -was -off -and -away -again -chapter -xxxiii -let -us -be -grateful -to -adam -our -benefactor -he -cut -us -out -of -the -blessing -of -idleness -and -won -for -us -the -curse -of -labor -pudd'nhead -wilson's -new -calendar -we -soon -reached -the -town -of -nelson -and -spent -the -most -of -the -day -there -visiting -acquaintances -and -driving -with -them -about -the -garden -the -whole -region -is -a -garden -excepting -the -scene -of -the -maungatapu -murders -of -thirty -years -ago -that -is -a -wild -place -wild -and -lonely -an -ideal -place -for -a -murder -it -is -at -the -base -of -a -vast -rugged -densely -timbered -mountain -in -the -deep -twilight -of -that -forest -solitude -four -desperate -rascals -burgess -sullivan -levy -and -kelley -ambushed -themselves -beside -the -mountain -trail -to -murder -and -rob -four -travelers -kempthorne -mathieu -dudley -and -de -pontius -the -latter -a -new -yorker -a -harmless -old -laboring -man -came -wandering -along -and -as -his -presence -was -an -embarrassment -they -choked -him -hid -him -and -then -resumed -their -watch -for -the -four -they -had -to -wait -a -while -but -eventually -everything -turned -out -as -they -desired -that -dark -episode -is -the -one -large -event -in -the -history -of -nelson -the -fame -of -it -traveled -far -burgess -made -a -confession -it -is -a -remarkable -paper -for -brevity -succinctness -and -concentration -it -is -perhaps -without -its -peer -in -the -literature -of -murder -there -are -no -waste -words -in -it -there -is -no -obtrusion -of -matter -not -pertinent -to -the -occasion -nor -any -departure -from -the -dispassionate -tone -proper -to -a -formal -business -statement -for -that -is -what -it -is -a -business -statement -of -a -murder -by -the -chief -engineer -of -it -or -superintendent -or -foreman -or -whatever -one -may -prefer -to -call -him -we -were -getting -impatient -when -we -saw -four -men -and -a -pack -horse -coming -i -left -my -cover -and -had -a -look -at -the -men -for -levy -had -told -me -that -mathieu -was -a -small -man -and -wore -a -large -beard -and -that -it -was -a -chestnut -horse -i -said -'here -they -come -' -they -were -then -a -good -distance -away -i -took -the -caps -off -my -gun -and -put -fresh -ones -on -i -said -'you -keep -where -you -are -i'll -put -them -up -and -you -give -me -your -gun -while -you -tie -them -' -it -was -arranged -as -i -have -described -the -men -came -they -arrived -within -about -fifteen -yards -when -i -stepped -up -and -said -'stand! -bail -up!' -that -means -all -of -them -to -get -together -i -made -them -fall -back -on -the -upper -side -of -the -road -with -their -faces -up -the -range -and -sullivan -brought -me -his -gun -and -then -tied -their -hands -behind -them -the -horse -was -very -quiet -all -the -time -he -did -not -move -when -they -were -all -tied -sullivan -took -the -horse -up -the -hill -and -put -him -in -the -bush -he -cut -the -rope -and -let -the -swags -[a -swag -is -a -kit -a -pack -small -baggage -] -fall -on -the -ground -and -then -came -to -me -we -then -marched -the -men -down -the -incline -to -the -creek -the -water -at -this -time -barely -running -up -this -creek -we -took -the -men -we -went -i -daresay -five -or -six -hundred -yards -up -it -which -took -us -nearly -half -an -hour -to -accomplish -then -we -turned -to -the -right -up -the -range -we -went -i -daresay -one -hundred -and -fifty -yards -from -the -creek -and -there -we -sat -down -with -the -men -i -said -to -sullivan -'put -down -your -gun -and -search -these -men -' -which -he -did -i -asked -them -their -several -names -they -told -me -i -asked -them -if -they -were -expected -at -nelson -they -said -'no -' -if -such -their -lives -would -have -been -spared -in -money -we -took -l60 -odd -i -said -'is -this -all -you -have -you -had -better -tell -me -' -sullivan -said -'here -is -a -bag -of -gold -' -i -said -'what's -on -that -pack -horse -is -there -any -gold -' -when -kempthorne -said -'yes -my -gold -is -in -the -portmanteau -and -i -trust -you -will -not -take -it -all -' -'well -' -i -said -'we -must -take -you -away -one -at -a -time -because -the -range -is -steep -just -here -and -then -we -will -let -you -go -' -they -said -'all -right -' -most -cheerfully -we -tied -their -feet -and -took -dudley -with -us -we -went -about -sixty -yards -with -him -this -was -through -a -scrub -it -was -arranged -the -night -previously -that -it -would -be -best -to -choke -them -in -case -the -report -of -the -arms -might -be -heard -from -the -road -and -if -they -were -missed -they -never -would -be -found -so -we -tied -a -handkerchief -over -his -eyes -when -sullivan -took -the -sash -off -his -waist -put -it -round -his -neck -and -so -strangled -him -sullivan -after -i -had -killed -the -old -laboring -man -found -fault -with -the -way -he -was -choked -he -said -'the -next -we -do -i'll -show -you -my -way -' -i -said -'i -have -never -done -such -a -thing -before -i -have -shot -a -man -but -never -choked -one -' -we -returned -to -the -others -when -kempthorne -said -'what -noise -was -that -' -i -said -it -was -caused -by -breaking -through -the -scrub -this -was -taking -too -much -time -so -it -was -agreed -to -shoot -them -with -that -i -said -'we'll -take -you -no -further -but -separate -you -and -then -loose -one -of -you -and -he -can -relieve -the -others -' -so -with -that -sullivan -took -de -pontius -to -the -left -of -where -kempthorne -was -sitting -i -took -mathieu -to -the -right -i -tied -a -strap -round -his -legs -and -shot -him -with -a -revolver -he -yelled -i -ran -from -him -with -my -gun -in -my -hand -i -sighted -kempthorne -who -had -risen -to -his -feet -i -presented -the -gun -and -shot -him -behind -the -right -ear -his -life's -blood -welled -from -him -and -he -died -instantaneously -sullivan -had -shot -de -pontius -in -the -meantime -and -then -came -to -me -i -said -'look -to -mathieu -' -indicating -the -spot -where -he -lay -he -shortly -returned -and -said -'i -had -to -chiv -that -fellow -he -was -not -dead -' -a -cant -word -meaning -that -he -had -to -stab -him -returning -to -the -road -we -passed -where -de -pontius -lay -and -was -dead -sullivan -said -'this -is -the -digger -the -others -were -all -storekeepers -this -is -the -digger -let's -cover -him -up -for -should -the -others -be -found -they'll -think -he -done -it -and -sloped -' -meaning -he -had -gone -so -with -that -we -threw -all -the -stones -on -him -and -then -left -him -this -bloody -work -took -nearly -an -hour -and -a -half -from -the -time -we -stopped -the -men -anyone -who -reads -that -confession -will -think -that -the -man -who -wrote -it -was -destitute -of -emotions -destitute -of -feeling -that -is -partly -true -as -regarded -others -he -was -plainly -without -feeling -utterly -cold -and -pitiless -but -as -regarded -himself -the -case -was -different -while -he -cared -nothing -for -the -future -of -the -murdered -men -he -cared -a -great -deal -for -his -own -it -makes -one's -flesh -creep -to -read -the -introduction -to -his -confession -the -judge -on -the -bench -characterized -it -as -scandalously -blasphemous -and -it -certainly -reads -so -but -burgess -meant -no -blasphemy -he -was -merely -a -brute -and -whatever -he -said -or -wrote -was -sure -to -expose -the -fact -his -redemption -was -a -very -real -thing -to -him -and -he -was -as -jubilantly -happy -on -the -gallows -as -ever -was -christian -martyr -at -the -stake -we -dwellers -in -this -world -are -strangely -made -and -mysteriously -circumstanced -we -have -to -suppose -that -the -murdered -men -are -lost -and -that -burgess -is -saved -but -we -cannot -suppress -our -natural -regrets -written -in -my -dungeon -drear -this -7th -of -august -in -the -year -of -grace -1866 -to -god -be -ascribed -all -power -and -glory -in -subduing -the -rebellious -spirit -of -a -most -guilty -wretch -who -has -been -brought -through -the -instrumentality -of -a -faithful -follower -of -christ -to -see -his -wretched -and -guilty -state -inasmuch -as -hitherto -he -has -led -an -awful -and -wretched -life -and -through -the -assurance -of -this -faithful -soldier -of -christ -he -has -been -led -and -also -believes -that -christ -will -yet -receive -and -cleanse -him -from -all -his -deep -dyed -and -bloody -sins -i -lie -under -the -imputation -which -says -'come -now -and -let -us -reason -together -saith -the -lord -though -your -sins -be -as -scarlet -they -shall -be -as -white -as -snow -though -they -be -red -like -crimson -they -shall -be -as -wool -' -on -this -promise -i -rely -we -sailed -in -the -afternoon -late -spent -a -few -hours -at -new -plymouth -then -sailed -again -and -reached -auckland -the -next -day -november -20th -and -remained -in -that -fine -city -several -days -its -situation -is -commanding -and -the -sea -view -is -superb -there -are -charming -drives -all -about -and -by -courtesy -of -friends -we -had -opportunity -to -enjoy -them -from -the -grassy -crater -summit -of -mount -eden -one's -eye -ranges -over -a -grand -sweep -and -variety -of -scenery -forests -clothed -in -luxuriant -foliage -rolling -green -fields -conflagrations -of -flowers -receding -and -dimming -stretches -of -green -plain -broken -by -lofty -and -symmetrical -old -craters -then -the -blue -bays -twinkling -and -sparkling -away -into -the -dreamy -distances -where -the -mountains -loom -spiritual -in -their -veils -of -haze -it -is -from -auckland -that -one -goes -to -rotorua -the -region -of -the -renowned -hot -lakes -and -geysers -one -of -the -chief -wonders -of -new -zealand -but -i -was -not -well -enough -to -make -the -trip -the -government -has -a -sanitorium -there -and -everything -is -comfortable -for -the -tourist -and -the -invalid -the -government's -official -physician -is -almost -over -cautious -in -his -estimates -of -the -efficacy -of -the -baths -when -he -is -talking -about -rheumatism -gout -paralysis -and -such -things -but -when -he -is -talking -about -the -effectiveness -of -the -waters -in -eradicating -the -whisky -habit -he -seems -to -have -no -reserves -the -baths -will -cure -the -drinking -habit -no -matter -how -chronic -it -is -and -cure -it -so -effectually -that -even -the -desire -to -drink -intoxicants -will -come -no -more -there -should -be -a -rush -from -europe -and -america -to -that -place -and -when -the -victims -of -alcoholism -find -out -what -they -can -get -by -going -there -the -rush -will -begin -the -thermal -springs -district -of -new -zealand -comprises -an -area -of -upwards -of -600 -000 -acres -or -close -on -1 -000 -square -miles -rotorua -is -the -favorite -place -it -is -the -center -of -a -rich -field -of -lake -and -mountain -scenery -from -rotorua -as -a -base -the -pleasure -seeker -makes -excursions -the -crowd -of -sick -people -is -great -and -growing -rotorua -is -the -carlsbad -of -australasia -it -is -from -auckland -that -the -kauri -gum -is -shipped -for -a -long -time -now -about -8 -000 -tons -of -it -have -been -brought -into -the -town -per -year -it -is -worth -about -$300 -per -ton -unassorted -assorted -the -finest -grades -are -worth -about -$1 -000 -it -goes -to -america -chiefly -it -is -in -lumps -and -is -hard -and -smooth -and -looks -like -amber -the -light -colored -like -new -amber -and -the -dark -brown -like -rich -old -amber -and -it -has -the -pleasant -feel -of -amber -too -some -of -the -light -colored -samples -were -a -tolerably -fair -counterfeit -of -uncut -south -african -diamonds -they -were -so -perfectly -smooth -and -polished -and -transparent -it -is -manufactured -into -varnish -a -varnish -which -answers -for -copal -varnish -and -is -cheaper -the -gum -is -dug -up -out -of -the -ground -it -has -been -there -for -ages -it -is -the -sap -of -the -kauri -tree -dr -campbell -of -auckland -told -me -he -sent -a -cargo -of -it -to -england -fifty -years -ago -but -nothing -came -of -the -venture -nobody -knew -what -to -do -with -it -so -it -was -sold -at -15 -a -ton -to -light -fires -with -november -26 -3 -p -m -sailed -vast -and -beautiful -harbor -land -all -about -for -hours -tangariwa -the -mountain -that -has -the -same -shape -from -every -point -of -view -that -is -the -common -belief -in -auckland -and -so -it -has -from -every -point -of -view -except -thirteen -perfect -summer -weather -large -school -of -whales -in -the -distance -nothing -could -be -daintier -than -the -puffs -of -vapor -they -spout -up -when -seen -against -the -pink -glory -of -the -sinking -sun -or -against -the -dark -mass -of -an -island -reposing -in -the -deep -blue -shadow -of -a -storm -cloud -great -barrier -rock -standing -up -out -of -the -sea -away -to -the -left -sometime -ago -a -ship -hit -it -full -speed -in -a -fog -20 -miles -out -of -her -course -140 -lives -lost -the -captain -committed -suicide -without -waiting -a -moment -he -knew -that -whether -he -was -to -blame -or -not -the -company -owning -the -vessel -would -discharge -him -and -make -a -devotion -to -passengers' -safety -advertisement -out -of -it -and -his -chance -to -make -a -livelihood -would -be -permanently -gone -chapter -xxxiv -let -us -not -be -too -particular -it -is -better -to -have -old -second -hand -diamonds -than -none -at -all -pudd'nhead -wilson's -new -calendar -november -27 -to -day -we -reached -gisborne -and -anchored -in -a -big -bay -there -was -a -heavy -sea -on -so -we -remained -on -board -we -were -a -mile -from -shore -a -little -steam -tug -put -out -from -the -land -she -was -an -object -of -thrilling -interest -she -would -climb -to -the -summit -of -a -billow -reel -drunkenly -there -a -moment -dim -and -gray -in -the -driving -storm -of -spindrift -then -make -a -plunge -like -a -diver -and -remain -out -of -sight -until -one -had -given -her -up -then -up -she -would -dart -again -on -a -steep -slant -toward -the -sky -shedding -niagaras -of -water -from -her -forecastle -and -this -she -kept -up -all -the -way -out -to -us -she -brought -twenty -five -passengers -in -her -stomach -men -and -women -mainly -a -traveling -dramatic -company -in -sight -on -deck -were -the -crew -in -sou'westers -yellow -waterproof -canvas -suits -and -boots -to -the -thigh -the -deck -was -never -quiet -for -a -moment -and -seldom -nearer -level -than -a -ladder -and -noble -were -the -seas -which -leapt -aboard -and -went -flooding -aft -we -rove -a -long -line -to -the -yard -arm -hung -a -most -primitive -basketchair -to -it -and -swung -it -out -into -the -spacious -air -of -heaven -and -there -it -swayed -pendulum -fashion -waiting -for -its -chance -then -down -it -shot -skillfully -aimed -and -was -grabbed -by -the -two -men -on -the -forecastle -a -young -fellow -belonging -to -our -crew -was -in -the -chair -to -be -a -protection -to -the -lady -comers -at -once -a -couple -of -ladies -appeared -from -below -took -seats -in -his -lap -we -hoisted -them -into -the -sky -waited -a -moment -till -the -roll -of -the -ship -brought -them -in -overhead -then -we -lowered -suddenly -away -and -seized -the -chair -as -it -struck -the -deck -we -took -the -twenty -five -aboard -and -delivered -twenty -five -into -the -tug -among -them -several -aged -ladies -and -one -blind -one -and -all -without -accident -it -was -a -fine -piece -of -work -ours -is -a -nice -ship -roomy -comfortable -well -ordered -and -satisfactory -now -and -then -we -step -on -a -rat -in -a -hotel -but -we -have -had -no -rats -on -shipboard -lately -unless -perhaps -in -the -flora -we -had -more -serious -things -to -think -of -there -and -did -not -notice -i -have -noticed -that -it -is -only -in -ships -and -hotels -which -still -employ -the -odious -chinese -gong -that -you -find -rats -the -reason -would -seem -to -be -that -as -a -rat -cannot -tell -the -time -of -day -by -a -clock -he -won't -stay -where -he -cannot -find -out -when -dinner -is -ready -november -29 -the -doctor -tells -me -of -several -old -drunkards -one -spiritless -loafer -and -several -far -gone -moral -wrecks -who -have -been -reclaimed -by -the -salvation -army -and -have -remained -staunch -people -and -hard -workers -these -two -years -wherever -one -goes -these -testimonials -to -the -army's -efficiency -are -forthcoming -this -morning -we -had -one -of -those -whizzing -green -ballarat -flies -in -the -room -with -his -stunning -buzz -saw -noise -the -swiftest -creature -in -the -world -except -the -lightning -flash -it -is -a -stupendous -force -that -is -stored -up -in -that -little -body -if -we -had -it -in -a -ship -in -the -same -proportion -we -could -spin -from -liverpool -to -new -york -in -the -space -of -an -hour -the -time -it -takes -to -eat -luncheon -the -new -zealand -express -train -is -called -the -ballarat -fly -bad -teeth -in -the -colonies -a -citizen -told -me -they -don't -have -teeth -filled -but -pull -them -out -and -put -in -false -ones -and -that -now -and -then -one -sees -a -young -lady -with -a -full -set -she -is -fortunate -i -wish -i -had -been -born -with -false -teeth -and -a -false -liver -and -false -carbuncles -i -should -get -along -better -december -2 -monday -left -napier -in -the -ballarat -fly -the -one -that -goes -twice -a -week -from -napier -to -hastings -twelve -miles -time -fifty -five -minutes -not -so -far -short -of -thirteen -miles -an -hour -a -perfect -summer -day -cool -breeze -brilliant -sky -rich -vegetation -two -or -three -times -during -the -afternoon -we -saw -wonderfully -dense -and -beautiful -forests -tumultuously -piled -skyward -on -the -broken -highlands -not -the -customary -roof -like -slant -of -a -hillside -where -the -trees -are -all -the -same -height -the -noblest -of -these -trees -were -of -the -kauri -breed -we -were -told -the -timber -that -is -now -furnishing -the -wood -paving -for -europe -and -is -the -best -of -all -wood -for -that -purpose -sometimes -these -towering -upheavals -of -forestry -were -festooned -and -garlanded -with -vine -cables -and -sometimes -the -masses -of -undergrowth -were -cocooned -in -another -sort -of -vine -of -a -delicate -cobwebby -texture -they -call -it -the -supplejack -i -think -tree -ferns -everywhere -a -stem -fifteen -feet -high -with -a -graceful -chalice -of -fern -fronds -sprouting -from -its -top -a -lovely -forest -ornament -and -there -was -a -ten -foot -reed -with -a -flowing -suit -of -what -looked -like -yellow -hair -hanging -from -its -upper -end -i -do -not -know -its -name -but -if -there -is -such -a -thing -as -a -scalp -plant -this -is -it -a -romantic -gorge -with -a -brook -flowing -in -its -bottom -approaching -palmerston -north -waitukurau -twenty -minutes -for -luncheon -with -me -sat -my -wife -and -daughter -and -my -manager -mr -carlyle -smythe -i -sat -at -the -head -of -the -table -and -could -see -the -right -hand -wall -the -others -had -their -backs -to -it -on -that -wall -at -a -good -distance -away -were -a -couple -of -framed -pictures -i -could -not -see -them -clearly -but -from -the -groupings -of -the -figures -i -fancied -that -they -represented -the -killing -of -napoleon -iii's -son -by -the -zulus -in -south -africa -i -broke -into -the -conversation -which -was -about -poetry -and -cabbage -and -art -and -said -to -my -wife -do -you -remember -when -the -news -came -to -paris -of -the -killing -of -the -prince -those -were -the -very -words -i -had -in -my -mind -yes -but -what -prince -napoleon -lulu -what -made -you -think -of -that -i -don't -know -there -was -no -collusion -she -had -not -seen -the -pictures -and -they -had -not -been -mentioned -she -ought -to -have -thought -of -some -recent -news -that -came -to -paris -for -we -were -but -seven -months -from -there -and -had -been -living -there -a -couple -of -years -when -we -started -on -this -trip -but -instead -of -that -she -thought -of -an -incident -of -our -brief -sojourn -in -paris -of -sixteen -years -before -here -was -a -clear -case -of -mental -telegraphy -of -mind -transference -of -my -mind -telegraphing -a -thought -into -hers -how -do -i -know -because -i -telegraphed -an -error -for -it -turned -out -that -the -pictures -did -not -represent -the -killing -of -lulu -at -all -nor -anything -connected -with -lulu -she -had -to -get -the -error -from -my -head -it -existed -nowhere -else -chapter -xxxv -the -autocrat -of -russia -possesses -more -power -than -any -other -man -in -the -earth -but -he -cannot -stop -a -sneeze -pudd'nhead -wilson's -new -calendar -wauganiui -december -3 -a -pleasant -trip -yesterday -per -ballarat -fly -four -hours -i -do -not -know -the -distance -but -it -must -have -been -well -along -toward -fifty -miles -the -fly -could -have -spun -it -out -to -eight -hours -and -not -discommoded -me -for -where -there -is -comfort -and -no -need -for -hurry -speed -is -of -no -value -at -least -to -me -and -nothing -that -goes -on -wheels -can -be -more -comfortable -more -satisfactory -than -the -new -zealand -trains -outside -of -america -there -are -no -cars -that -are -so -rationally -devised -when -you -add -the -constant -presence -of -charming -scenery -and -the -nearly -constant -absence -of -dust -well -if -one -is -not -content -then -he -ought -to -get -out -and -walk -that -would -change -his -spirit -perhaps -i -think -so -at -the -end -of -an -hour -you -would -find -him -waiting -humbly -beside -the -track -and -glad -to -be -taken -aboard -again -much -horseback -riding -in -and -around -this -town -many -comely -girls -in -cool -and -pretty -summer -gowns -much -salvation -army -lots -of -maoris -the -faces -and -bodies -of -some -of -the -old -ones -very -tastefully -frescoed -maori -council -house -over -the -river -large -strong -carpeted -from -end -to -end -with -matting -and -decorated -with -elaborate -wood -carvings -artistically -executed -the -maoris -were -very -polite -i -was -assured -by -a -member -of -the -house -of -representatives -that -the -native -race -is -not -decreasing -but -actually -increasing -slightly -it -is -another -evidence -that -they -are -a -superior -breed -of -savages -i -do -not -call -to -mind -any -savage -race -that -built -such -good -houses -or -such -strong -and -ingenious -and -scientific -fortresses -or -gave -so -much -attention -to -agriculture -or -had -military -arts -and -devices -which -so -nearly -approached -the -white -man's -these -taken -together -with -their -high -abilities -in -boat -building -and -their -tastes -and -capacities -in -the -ornamental -arts -modify -their -savagery -to -a -semi -civilization -or -at -least -to -a -quarter -civilization -it -is -a -compliment -to -them -that -the -british -did -not -exterminate -them -as -they -did -the -australians -and -the -tasmanians -but -were -content -with -subduing -them -and -showed -no -desire -to -go -further -and -it -is -another -compliment -to -them -that -the -british -did -not -take -the -whole -of -their -choicest -lands -but -left -them -a -considerable -part -and -then -went -further -and -protected -them -from -the -rapacities -of -landsharks -a -protection -which -the -new -zealand -government -still -extends -to -them -and -it -is -still -another -compliment -to -the -maoris -that -the -government -allows -native -representation -in -both -the -legislature -and -the -cabinet -and -gives -both -sexes -the -vote -and -in -doing -these -things -the -government -also -compliments -itself -it -has -not -been -the -custom -of -the -world -for -conquerors -to -act -in -this -large -spirit -toward -the -conquered -the -highest -class -white -men -who -lived -among -the -maoris -in -the -earliest -time -had -a -high -opinion -of -them -and -a -strong -affection -for -them -among -the -whites -of -this -sort -was -the -author -of -old -new -zealand -and -dr -campbell -of -auckland -was -another -dr -campbell -was -a -close -friend -of -several -chiefs -and -has -many -pleasant -things -to -say -of -their -fidelity -their -magnanimity -and -their -generosity -also -of -their -quaint -notions -about -the -white -man's -queer -civilization -and -their -equally -quaint -comments -upon -it -one -of -them -thought -the -missionary -had -got -everything -wrong -end -first -and -upside -down -why -he -wants -us -to -stop -worshiping -and -supplicating -the -evil -gods -and -go -to -worshiping -and -supplicating -the -good -one! -there -is -no -sense -in -that -a -good -god -is -not -going -to -do -us -any -harm -the -maoris -had -the -tabu -and -had -it -on -a -polynesian -scale -of -comprehensiveness -and -elaboration -some -of -its -features -could -have -been -importations -from -india -and -judea -neither -the -maori -nor -the -hindoo -of -common -degree -could -cook -by -a -fire -that -a -person -of -higher -caste -had -used -nor -could -the -high -maori -or -high -hindoo -employ -fire -that -had -served -a -man -of -low -grade -if -a -low -grade -maori -or -hindoo -drank -from -a -vessel -belonging -to -a -high -grade -man -the -vessel -was -defiled -and -had -to -be -destroyed -there -were -other -resemblances -between -maori -tabu -and -hindoo -caste -custom -yesterday -a -lunatic -burst -into -my -quarters -and -warned -me -that -the -jesuits -were -going -to -cook -poison -me -in -my -food -or -kill -me -on -the -stage -at -night -he -said -a -mysterious -sign -was -visible -upon -my -posters -and -meant -my -death -he -said -he -saved -rev -mr -haweis's -life -by -warning -him -that -there -were -three -men -on -his -platform -who -would -kill -him -if -he -took -his -eyes -off -them -for -a -moment -during -his -lecture -the -same -men -were -in -my -audience -last -night -but -they -saw -that -he -was -there -will -they -be -there -again -to -night -he -hesitated -then -said -no -he -thought -they -would -rather -take -a -rest -and -chance -the -poison -this -lunatic -has -no -delicacy -but -he -was -not -uninteresting -he -told -me -a -lot -of -things -he -said -he -had -saved -so -many -lecturers -in -twenty -years -that -they -put -him -in -the -asylum -i -think -he -has -less -refinement -than -any -lunatic -i -have -met -december -8 -a -couple -of -curious -war -monuments -here -at -wanganui -one -is -in -honor -of -white -men -who -fell -in -defence -of -law -and -order -against -fanaticism -and -barbarism -fanaticism -we -americans -are -english -in -blood -english -in -speech -english -in -religion -english -in -the -essentials -of -our -governmental -system -english -in -the -essentials -of -our -civilization -and -so -let -us -hope -for -the -honor -of -the -blend -for -the -honor -of -the -blood -for -the -honor -of -the -race -that -that -word -got -there -through -lack -of -heedfulness -and -will -not -be -suffered -to -remain -if -you -carve -it -at -thermopylae -or -where -winkelried -died -or -upon -bunker -hill -monument -and -read -it -again -who -fell -in -defence -of -law -and -order -against -fanaticism -you -will -perceive -what -the -word -means -and -how -mischosen -it -is -patriotism -is -patriotism -calling -it -fanaticism -cannot -degrade -it -nothing -can -degrade -it -even -though -it -be -a -political -mistake -and -a -thousand -times -a -political -mistake -that -does -not -affect -it -it -is -honorable -always -honorable -always -noble -and -privileged -to -hold -its -head -up -and -look -the -nations -in -the -face -it -is -right -to -praise -these -brave -white -men -who -fell -in -the -maori -war -they -deserve -it -but -the -presence -of -that -word -detracts -from -the -dignity -of -their -cause -and -their -deeds -and -makes -them -appear -to -have -spilt -their -blood -in -a -conflict -with -ignoble -men -men -not -worthy -of -that -costly -sacrifice -but -the -men -were -worthy -it -was -no -shame -to -fight -them -they -fought -for -their -homes -they -fought -for -their -country -they -bravely -fought -and -bravely -fell -and -it -would -take -nothing -from -the -honor -of -the -brave -englishmen -who -lie -under -the -monument -but -add -to -it -to -say -that -they -died -in -defense -of -english -laws -and -english -homes -against -men -worthy -of -the -sacrifice -the -maori -patriots -the -other -monument -cannot -be -rectified -except -with -dynamite -it -is -a -mistake -all -through -and -a -strangely -thoughtless -one -it -is -a -monument -erected -by -white -men -to -maoris -who -fell -fighting -with -the -whites -and -against -their -own -people -in -the -maori -war -sacred -to -the -memory -of -the -brave -men -who -fell -on -the -14th -of -may -1864 -etc -on -one -side -are -the -names -of -about -twenty -maoris -it -is -not -a -fancy -of -mine -the -monument -exists -i -saw -it -it -is -an -object -lesson -to -the -rising -generation -it -invites -to -treachery -disloyalty -unpatriotism -its -lesson -in -frank -terms -is -desert -your -flag -slay -your -people -burn -their -homes -shame -your -nationality -we -honor -such -december -9 -wellington -ten -hours -from -wanganui -by -the -fly -december -12 -it -is -a -fine -city -and -nobly -situated -a -busy -place -and -full -of -life -and -movement -have -spent -the -three -days -partly -in -walking -about -partly -in -enjoying -social -privileges -and -largely -in -idling -around -the -magnificent -garden -at -hutt -a -little -distance -away -around -the -shore -i -suppose -we -shall -not -see -such -another -one -soon -we -are -packing -to -night -for -the -return -voyage -to -australia -our -stay -in -new -zealand -has -been -too -brief -still -we -are -not -unthankful -for -the -glimpse -which -we -have -had -of -it -the -sturdy -maoris -made -the -settlement -of -the -country -by -the -whites -rather -difficult -not -at -first -but -later -at -first -they -welcomed -the -whites -and -were -eager -to -trade -with -them -particularly -for -muskets -for -their -pastime -was -internecine -war -and -they -greatly -preferred -the -white -man's -weapons -to -their -own -war -was -their -pastime -i -use -the -word -advisedly -they -often -met -and -slaughtered -each -other -just -for -a -lark -and -when -there -was -no -quarrel -the -author -of -old -new -zealand -mentions -a -case -where -a -victorious -army -could -have -followed -up -its -advantage -and -exterminated -the -opposing -army -but -declined -to -do -it -explaining -naively -that -if -we -did -that -there -couldn't -be -any -more -fighting -in -another -battle -one -army -sent -word -that -it -was -out -of -ammunition -and -would -be -obliged -to -stop -unless -the -opposing -army -would -send -some -it -was -sent -and -the -fight -went -on -in -the -early -days -things -went -well -enough -the -natives -sold -land -without -clearly -understanding -the -terms -of -exchange -and -the -whites -bought -it -without -being -much -disturbed -about -the -native's -confusion -of -mind -but -by -and -by -the -maori -began -to -comprehend -that -he -was -being -wronged -then -there -was -trouble -for -he -was -not -the -man -to -swallow -a -wrong -and -go -aside -and -cry -about -it -he -had -the -tasmanian's -spirit -and -endurance -and -a -notable -share -of -military -science -besides -and -so -he -rose -against -the -oppressor -did -this -gallant -fanatic -and -started -a -war -that -was -not -brought -to -a -definite -end -until -more -than -a -generation -had -sped -chapter -xxxvi -there -are -several -good -protections -against -temptations -but -the -surest -is -cowardice -pudd'nhead -wilson's -new -calendar -names -are -not -always -what -they -seem -the -common -welsh -name -bzjxxllwep -is -pronounced -jackson -pudd'nhead -wilson's -new -calendar -friday -december -13 -sailed -at -3 -p -m -in -the -'mararoa' -summer -seas -and -a -good -ship -life -has -nothing -better -monday -three -days -of -paradise -warm -and -sunny -and -smooth -the -sea -a -luminous -mediterranean -blue -one -lolls -in -a -long -chair -all -day -under -deck -awnings -and -reads -and -smokes -in -measureless -content -one -does -not -read -prose -at -such -a -time -but -poetry -i -have -been -reading -the -poems -of -mrs -julia -a -moore -again -and -i -find -in -them -the -same -grace -and -melody -that -attracted -me -when -they -were -first -published -twenty -years -ago -and -have -held -me -in -happy -bonds -ever -since -the -sentimental -song -book -has -long -been -out -of -print -and -has -been -forgotten -by -the -world -in -general -but -not -by -me -i -carry -it -with -me -always -it -and -goldsmith's -deathless -story -indeed -it -has -the -same -deep -charm -for -me -that -the -vicar -of -wakefield -has -and -i -find -in -it -the -same -subtle -touch -the -touch -that -makes -an -intentionally -humorous -episode -pathetic -and -an -intentionally -pathetic -one -funny -in -her -time -mrs -moore -was -called -the -sweet -singer -of -michigan -and -was -best -known -by -that -name -i -have -read -her -book -through -twice -today -with -the -purpose -of -determining -which -of -her -pieces -has -most -merit -and -i -am -persuaded -that -for -wide -grasp -and -sustained -power -william -upson -may -claim -first -place -william -upson -air -the -major's -only -son -come -all -good -people -far -and -near -oh -come -and -see -what -you -can -hear -it's -of -a -young -man -true -and -brave -that -is -now -sleeping -in -his -grave -now -william -upson -was -his -name -if -it's -not -that -it's -all -the -same -he -did -enlist -in -a -cruel -strife -and -it -caused -him -to -lose -his -life -he -was -perry -upson's -eldest -son -his -father -loved -his -noble -son -this -son -was -nineteen -years -of -age -when -first -in -the -rebellion -he -engaged -his -father -said -that -he -might -go -but -his -dear -mother -she -said -no -oh! -stay -at -home -dear -billy -she -said -but -she -could -not -turn -his -head -he -went -to -nashville -in -tennessee -there -his -kind -friends -he -could -not -see -he -died -among -strangers -so -far -away -they -did -not -know -where -his -body -lay -he -was -taken -sick -and -lived -four -weeks -and -oh! -how -his -parents -weep -but -now -they -must -in -sorrow -mourn -for -billy -has -gone -to -his -heavenly -home -oh! -if -his -mother -could -have -seen -her -son -for -she -loved -him -her -darling -son -if -she -could -heard -his -dying -prayer -it -would -ease -her -heart -till -she -met -him -there -how -it -would -relieve -his -mother's -heart -to -see -her -son -from -this -world -depart -and -hear -his -noble -words -of -love -as -he -left -this -world -for -that -above -now -it -will -relieve -his -mother's -heart -for -her -son -is -laid -in -our -graveyard -for -now -she -knows -that -his -grave -is -near -she -will -not -shed -so -many -tears -although -she -knows -not -that -it -was -her -son -for -his -coffin -could -not -be -opened -it -might -be -someone -in -his -place -for -she -could -not -see -his -noble -face -december -17 -reached -sydney -december -19 -in -the -train -fellow -of -30 -with -four -valises -a -slim -creature -with -teeth -which -made -his -mouth -look -like -a -neglected -churchyard -he -had -solidified -hair -solidified -with -pomatum -it -was -all -one -shell -he -smoked -the -most -extraordinary -cigarettes -made -of -some -kind -of -manure -apparently -these -and -his -hair -made -him -smell -like -the -very -nation -he -had -a -low -cut -vest -on -which -exposed -a -deal -of -frayed -and -broken -and -unclean -shirtfront -showy -studs -of -imitation -gold -they -had -made -black -disks -on -the -linen -oversized -sleeve -buttons -of -imitation -gold -the -copper -base -showing -through -ponderous -watch -chain -of -imitation -gold -i -judge -that -he -couldn't -tell -the -time -by -it -for -he -asked -smythe -what -time -it -was -once -he -wore -a -coat -which -had -been -gay -when -it -was -young -5 -o'clock -tea -trousers -of -a -light -tint -and -marvelously -soiled -yellow -mustache -with -a -dashing -upward -whirl -at -the -ends -foxy -shoes -imitation -patent -leather -he -was -a -novelty -an -imitation -dude -he -would -have -been -a -real -one -if -he -could -have -afforded -it -but -he -was -satisfied -with -himself -you -could -see -it -in -his -expression -and -in -all -his -attitudes -and -movements -he -was -living -in -a -dude -dreamland -where -all -his -squalid -shams -were -genuine -and -himself -a -sincerity -it -disarmed -criticism -it -mollified -spite -to -see -him -so -enjoy -his -imitation -languors -and -arts -and -airs -and -his -studied -daintinesses -of -gesture -and -misbegotten -refinements -it -was -plain -to -me -that -he -was -imagining -himself -the -prince -of -wales -and -was -doing -everything -the -way -he -thought -the -prince -would -do -it -for -bringing -his -four -valises -aboard -and -stowing -them -in -the -nettings -he -gave -his -porter -four -cents -and -lightly -apologized -for -the -smallness -of -the -gratuity -just -with -the -condescendingest -little -royal -air -in -the -world -he -stretched -himself -out -on -the -front -seat -and -rested -his -pomatum -cake -on -the -middle -arm -and -stuck -his -feet -out -of -the -window -and -began -to -pose -as -the -prince -and -work -his -dreams -and -languors -for -exhibition -and -he -would -indolently -watch -the -blue -films -curling -up -from -his -cigarette -and -inhale -the -stench -and -look -so -grateful -and -would -flip -the -ash -away -with -the -daintiest -gesture -unintentionally -displaying -his -brass -ring -in -the -most -intentional -way -why -it -was -as -good -as -being -in -marlborough -house -itself -to -see -him -do -it -so -like -there -was -other -scenery -in -the -trip -that -of -the -hawksbury -river -in -the -national -park -region -fine -extraordinarily -fine -with -spacious -views -of -stream -and -lake -imposingly -framed -in -woody -hills -and -every -now -and -then -the -noblest -groupings -of -mountains -and -the -most -enchanting -rearrangements -of -the -water -effects -further -along -green -flats -thinly -covered -with -gum -forests -with -here -and -there -the -huts -and -cabins -of -small -farmers -engaged -in -raising -children -still -further -along -arid -stretches -lifeless -and -melancholy -then -newcastle -a -rushing -town -capital -of -the -rich -coal -regions -approaching -scone -wide -farming -and -grazing -levels -with -pretty -frequent -glimpses -of -a -troublesome -plant -a -particularly -devilish -little -prickly -pear -daily -damned -in -the -orisons -of -the -agriculturist -imported -by -a -lady -of -sentiment -and -contributed -gratis -to -the -colony -blazing -hot -all -day -december -20 -back -to -sydney -blazing -hot -again -from -the -newspaper -and -from -the -map -i -have -made -a -collection -of -curious -names -of -australasian -towns -with -the -idea -of -making -a -poem -out -of -them -tumut -takee -murriwillumba -bowral -ballarat -mullengudgery -murrurundi -wagga -wagga -wyalong -murrumbidgee -goomeroo -wolloway -wangary -wanilla -worrow -koppio -yankalilla -yaranyacka -yackamoorundie -kaiwaka -coomooroo -tauranga -geelong -tongariro -kaikoura -wakatipu -oohipara -waitpinga -goelwa -munno -para -nangkita -myponga -kapunda -kooringa -penola -nangwarry -kongorong -comaum -koolywurtie -killanoola -naracoorte -muloowurtie -binnum -wallaroo -wirrega -mundoora -hauraki -rangiriri -teawamute -taranaki -toowoomba -goondiwindi -jerrilderie -whangaroa -wollongong -woolloomooloo -bombola -coolgardie -bendigo -coonamble -cootamundra -woolgoolga -mittagong -jamberoo -kondoparinga -kuitpo -tungkillo -oukaparinga -talunga -yatala -parawirra -moorooroo -whangarei -woolundunga -booleroo -pernatty -parramatta -taroom -narrandera -deniliquin -kawakawa -it -may -be -best -to -build -the -poem -now -and -make -the -weather -help -a -sweltering -day -in -australia -to -be -read -soft -and -low -with -the -lights -turned -down -the -bombola -faints -in -the -hot -bowral -tree -where -fierce -mullengudgery's -smothering -fires -far -from -the -breezes -of -coolgardie -burn -ghastly -and -blue -as -the -day -expires -and -murriwillumba -complaineth -in -song -for -the -garlanded -bowers -of -woolloomooloo -and -the -ballarat -fly -and -the -lone -wollongong -they -dream -of -the -gardens -of -jamberoo -the -wallabi -sighs -for -the -murrubidgee -for -the -velvety -sod -of -the -munno -parah -where -the -waters -of -healing -from -muloowurtie -flow -dim -in -the -gloaming -by -yaranyackah -the -koppio -sorrows -for -lost -wolloway -and -sigheth -in -secret -for -murrurundi -the -whangeroo -wombat -lamenteth -the -day -that -made -him -an -exile -from -jerrilderie -the -teawamute -tumut -from -wirrega's -glade -the -nangkita -swallow -the -wallaroo -swan -they -long -for -the -peace -of -the -timaru -shade -and -thy -balmy -soft -airs -o -sweet -mittagong! -the -kooringa -buffalo -pants -in -the -sun -the -kondoparinga -lies -gaping -for -breath -the -kongorong -camaum -to -the -shadow -has -won -but -the -goomeroo -sinks -in -the -slumber -of -death -in -the -weltering -hell -of -the -moorooroo -plain -the -yatala -wangary -withers -and -dies -and -the -worrow -wanilla -demented -with -pain -to -the -woolgoolga -woodlands -despairingly -flies -sweet -nangwarry's -desolate -coonamble -wails -and -tungkillo -kuito -in -sables -is -drest -for -the -whangerei -winds -fall -asleep -in -the -sails -and -the -booleroo -life -breeze -is -dead -in -the -west -mypongo -kapunda -o -slumber -no -more -yankalilla -parawirra -be -warned -there's -death -in -the -air! -killanoola -wherefore -shall -the -prayer -of -penola -be -scorned -cootamundra -and -takee -and -wakatipu -toowoomba -kaikoura -are -lost -from -onkaparinga -to -far -oamaru -all -burn -in -this -hell's -holocaust! -paramatta -and -binnum -are -gone -to -their -rest -in -the -vale -of -tapanni -taroom -kawakawa -deniliquin -all -that -was -best -in -the -earth -are -but -graves -and -a -tomb! -narrandera -mourns -cameron -answers -not -when -the -roll -of -the -scathless -we -cry -tongariro -goondiwindi -woolundunga -the -spot -is -mute -and -forlorn -where -ye -lie -those -are -good -words -for -poetry -among -the -best -i -have -ever -seen -there -are -81 -in -the -list -i -did -not -need -them -all -but -i -have -knocked -down -66 -of -them -which -is -a -good -bag -it -seems -to -me -for -a -person -not -in -the -business -perhaps -a -poet -laureate -could -do -better -but -a -poet -laureate -gets -wages -and -that -is -different -when -i -write -poetry -i -do -not -get -any -wages -often -i -lose -money -by -it -the -best -word -in -that -list -and -the -most -musical -and -gurgly -is -woolloomoolloo -it -is -a -place -near -sydney -and -is -a -favorite -pleasure -resort -it -has -eight -o's -in -it -chapter -xxxvii -to -succeed -in -the -other -trades -capacity -must -be -shown -in -the -law -concealment -of -it -will -do -pudd'nhead -wilson's -new -calendar -monday -december -23 -1895 -sailed -from -sydney -for -ceylon -in -the -p -& -o -steamer -'oceana' -a -lascar -crew -mans -this -ship -the -first -i -have -seen -white -cotton -petticoat -and -pants -barefoot -red -shawl -for -belt -straw -cap -brimless -on -head -with -red -scarf -wound -around -it -complexion -a -rich -dark -brown -short -straight -black -hair -whiskers -fine -and -silky -lustrous -and -intensely -black -mild -good -faces -willing -and -obedient -people -capable -too -but -are -said -to -go -into -hopeless -panics -when -there -is -danger -they -are -from -bombay -and -the -coast -thereabouts -left -some -of -the -trunks -in -sydney -to -be -shipped -to -south -africa -by -a -vessel -advertised -to -sail -three -months -hence -the -proverb -says -separate -not -yourself -from -your -baggage -this -'oceana' -is -a -stately -big -ship -luxuriously -appointed -she -has -spacious -promenade -decks -large -rooms -a -surpassingly -comfortable -ship -the -officers' -library -is -well -selected -a -ship's -library -is -not -usually -that -for -meals -the -bugle -call -man -of -war -fashion -a -pleasant -change -from -the -terrible -gong -three -big -cats -very -friendly -loafers -they -wander -all -over -the -ship -the -white -one -follows -the -chief -steward -around -like -a -dog -there -is -also -a -basket -of -kittens -one -of -these -cats -goes -ashore -in -port -in -england -australia -and -india -to -see -how -his -various -families -are -getting -along -and -is -seen -no -more -till -the -ship -is -ready -to -sail -no -one -knows -how -he -finds -out -the -sailing -date -but -no -doubt -he -comes -down -to -the -dock -every -day -and -takes -a -look -and -when -he -sees -baggage -and -passengers -flocking -in -recognizes -that -it -is -time -to -get -aboard -this -is -what -the -sailors -believe -the -chief -engineer -has -been -in -the -china -and -india -trade -thirty -three -years -and -has -had -but -three -christmases -at -home -in -that -time -conversational -items -at -dinner -mocha! -sold -all -over -the -world! -it -is -not -true -in -fact -very -few -foreigners -except -the -emperor -of -russia -have -ever -seen -a -grain -of -it -or -ever -will -while -they -live -another -man -said -there -is -no -sale -in -australia -for -australian -wine -but -it -goes -to -france -and -comes -back -with -a -french -label -on -it -and -then -they -buy -it -i -have -heard -that -the -most -of -the -french -labeled -claret -in -new -york -is -made -in -california -and -i -remember -what -professor -s -told -me -once -about -veuve -cliquot -if -that -was -the -wine -and -i -think -it -was -he -was -the -guest -of -a -great -wine -merchant -whose -town -was -quite -near -that -vineyard -and -this -merchant -asked -him -if -very -much -v -c -was -drunk -in -america -oh -yes -said -s -a -great -abundance -of -it -is -it -easy -to -be -had -oh -yes -easy -as -water -all -first -and -second -class -hotels -have -it -what -do -you -pay -for -it -it -depends -on -the -style -of -the -hotel -from -fifteen -to -twenty -five -francs -a -bottle -oh -fortunate -country! -why -it's -worth -100 -francs -right -here -on -the -ground -no! -yes! -do -you -mean -that -we -are -drinking -a -bogus -veuve -cliquot -over -there -yes -and -there -was -never -a -bottle -of -the -genuine -in -america -since -columbus's -time -that -wine -all -comes -from -a -little -bit -of -a -patch -of -ground -which -isn't -big -enough -to -raise -many -bottles -and -all -of -it -that -is -produced -goes -every -year -to -one -person -the -emperor -of -russia -he -takes -the -whole -crop -in -advance -be -it -big -or -little -january -4 -1898 -christmas -in -melbourne -new -year's -day -in -adelaide -and -saw -most -of -the -friends -again -in -both -places -lying -here -at -anchor -all -day -albany -king -george's -sound -western -australia -it -is -a -perfectly -landlocked -harbor -or -roadstead -spacious -to -look -at -but -not -deep -water -desolate -looking -rocks -and -scarred -hills -plenty -of -ships -arriving -now -rushing -to -the -new -gold -fields -the -papers -are -full -of -wonderful -tales -of -the -sort -always -to -be -heard -in -connection -with -new -gold -diggings -a -sample -a -youth -staked -out -a -claim -and -tried -to -sell -half -for -l5 -no -takers -he -stuck -to -it -fourteen -days -starving -then -struck -it -rich -and -sold -out -for -l10 -000 -about -sunset -strong -breeze -blowing -got -up -the -anchor -we -were -in -a -small -deep -puddle -with -a -narrow -channel -leading -out -of -it -minutely -buoyed -to -the -sea -i -stayed -on -deck -to -see -how -we -were -going -to -manage -it -with -such -a -big -ship -and -such -a -strong -wind -on -the -bridge -our -giant -captain -in -uniform -at -his -side -a -little -pilot -in -elaborately -gold -laced -uniform -on -the -forecastle -a -white -mate -and -quartermaster -or -two -and -a -brilliant -crowd -of -lascars -standing -by -for -business -our -stern -was -pointing -straight -at -the -head -of -the -channel -so -we -must -turn -entirely -around -in -the -puddle -and -the -wind -blowing -as -described -it -was -done -and -beautifully -it -was -done -by -help -of -a -jib -we -stirred -up -much -mud -but -did -not -touch -the -bottom -we -turned -right -around -in -our -tracks -a -seeming -impossibility -we -had -several -casts -of -quarter -less -5 -and -one -cast -of -half -4 -27 -feet -we -were -drawing -26 -astern -by -the -time -we -were -entirely -around -and -pointed -the -first -buoy -was -not -more -than -a -hundred -yards -in -front -of -us -it -was -a -fine -piece -of -work -and -i -was -the -only -passenger -that -saw -it -however -the -others -got -their -dinner -the -p -& -o -company -got -mine -more -cats -developed -smythe -says -it -is -a -british -law -that -they -must -be -carried -and -he -instanced -a -case -of -a -ship -not -allowed -to -sail -till -she -sent -for -a -couple -the -bill -came -too -debtor -to -2 -cats -20 -shillings -news -comes -that -within -this -week -siam -has -acknowledged -herself -to -be -in -effect -a -french -province -it -seems -plain -that -all -savage -and -semi -civilized -countries -are -going -to -be -grabbed -a -vulture -on -board -bald -red -queer -shaped -head -featherless -red -places -here -and -there -on -his -body -intense -great -black -eyes -set -in -featherless -rims -of -inflamed -flesh -dissipated -look -a -businesslike -style -a -selfish -conscienceless -murderous -aspect -the -very -look -of -a -professional -assassin -and -yet -a -bird -which -does -no -murder -what -was -the -use -of -getting -him -up -in -that -tragic -style -for -so -innocent -a -trade -as -his -for -this -one -isn't -the -sort -that -wars -upon -the -living -his -diet -is -offal -and -the -more -out -of -date -it -is -the -better -he -likes -it -nature -should -give -him -a -suit -of -rusty -black -then -he -would -be -all -right -for -he -would -look -like -an -undertaker -and -would -harmonize -with -his -business -whereas -the -way -he -is -now -he -is -horribly -out -of -true -january -5 -at -9 -this -morning -we -passed -cape -leeuwin -lioness -and -ceased -from -our -long -due -west -course -along -the -southern -shore -of -australia -turning -this -extreme -southwestern -corner -we -now -take -a -long -straight -slant -nearly -n -w -without -a -break -for -ceylon -as -we -speed -northward -it -will -grow -hotter -very -fast -but -it -isn't -chilly -now -the -vulture -is -from -the -public -menagerie -at -adelaide -a -great -and -interesting -collection -it -was -there -that -we -saw -the -baby -tiger -solemnly -spreading -its -mouth -and -trying -to -roar -like -its -majestic -mother -it -swaggered -scowling -back -and -forth -on -its -short -legs -just -as -it -had -seen -her -do -on -her -long -ones -and -now -and -then -snarling -viciously -exposing -its -teeth -with -a -threatening -lift -of -its -upper -lip -and -bristling -moustache -and -when -it -thought -it -was -impressing -the -visitors -it -would -spread -its -mouth -wide -and -do -that -screechy -cry -which -it -meant -for -a -roar -but -which -did -not -deceive -it -took -itself -quite -seriously -and -was -lovably -comical -and -there -was -a -hyena -an -ugly -creature -as -ugly -as -the -tiger -kitty -was -pretty -it -repeatedly -arched -its -back -and -delivered -itself -of -such -a -human -cry -a -startling -resemblance -a -cry -which -was -just -that -of -a -grown -person -badly -hurt -in -the -dark -one -would -assuredly -go -to -its -assistance -and -be -disappointed -many -friends -of -australasian -federation -on -board -they -feel -sure -that -the -good -day -is -not -far -off -now -but -there -seems -to -be -a -party -that -would -go -further -have -australasia -cut -loose -from -the -british -empire -and -set -up -housekeeping -on -her -own -hook -it -seems -an -unwise -idea -they -point -to -the -united -states -but -it -seems -to -me -that -the -cases -lack -a -good -deal -of -being -alike -australasia -governs -herself -wholly -there -is -no -interference -and -her -commerce -and -manufactures -are -not -oppressed -in -any -way -if -our -case -had -been -the -same -we -should -not -have -gone -out -when -we -did -january -13 -unspeakably -hot -the -equator -is -arriving -again -we -are -within -eight -degrees -of -it -ceylon -present -dear -me -it -is -beautiful! -and -most -sumptuously -tropical -as -to -character -of -foliage -and -opulence -of -it -what -though -the -spicy -breezes -blow -soft -o'er -ceylon's -isle -an -eloquent -line -an -incomparable -line -it -says -little -but -conveys -whole -libraries -of -sentiment -and -oriental -charm -and -mystery -and -tropic -deliciousness -a -line -that -quivers -and -tingles -with -a -thousand -unexpressed -and -inexpressible -things -things -that -haunt -one -and -find -no -articulate -voice -colombo -the -capital -an -oriental -town -most -manifestly -and -fascinating -in -this -palatial -ship -the -passengers -dress -for -dinner -the -ladies' -toilettes -make -a -fine -display -of -color -and -this -is -in -keeping -with -the -elegance -of -the -vessel's -furnishings -and -the -flooding -brilliancies -of -the -electric -light -on -the -stormy -atlantic -one -never -sees -a -man -in -evening -dress -except -at -the -rarest -intervals -and -then -there -is -only -one -not -two -and -he -shows -up -but -once -on -the -voyage -the -night -before -the -ship -makes -port -the -night -when -they -have -the -concert -and -do -the -amateur -wailings -and -recitations -he -is -the -tenor -as -a -rule -there -has -been -a -deal -of -cricket -playing -on -board -it -seems -a -queer -game -for -a -ship -but -they -enclose -the -promenade -deck -with -nettings -and -keep -the -ball -from -flying -overboard -and -the -sport -goes -very -well -and -is -properly -violent -and -exciting -we -must -part -from -this -vessel -here -january -14 -hotel -bristol -servant -brompy -alert -gentle -smiling -winning -young -brown -creature -as -ever -was -beautiful -shining -black -hair -combed -back -like -a -woman's -and -knotted -at -the -back -of -his -head -tortoise -shell -comb -in -it -sign -that -he -is -a -singhalese -slender -shapely -form -jacket -under -it -is -a -beltless -and -flowing -white -cotton -gown -from -neck -straight -to -heel -he -and -his -outfit -quite -unmasculine -it -was -an -embarrassment -to -undress -before -him -we -drove -to -the -market -using -the -japanese -jinriksha -our -first -acquaintanceship -with -it -it -is -a -light -cart -with -a -native -to -draw -it -he -makes -good -speed -for -half -an -hour -but -it -is -hard -work -for -him -he -is -too -slight -for -it -after -the -half -hour -there -is -no -more -pleasure -for -you -your -attention -is -all -on -the -man -just -as -it -would -be -on -a -tired -horse -and -necessarily -your -sympathy -is -there -too -there's -a -plenty -of -these -'rickshas -and -the -tariff -is -incredibly -cheap -i -was -in -cairo -years -ago -that -was -oriental -but -there -was -a -lack -when -you -are -in -florida -or -new -orleans -you -are -in -the -south -that -is -granted -but -you -are -not -in -the -south -you -are -in -a -modified -south -a -tempered -south -cairo -was -a -tempered -orient -an -orient -with -an -indefinite -something -wanting -that -feeling -was -not -present -in -ceylon -ceylon -was -oriental -in -the -last -measure -of -completeness -utterly -oriental -also -utterly -tropical -and -indeed -to -one's -unreasoning -spiritual -sense -the -two -things -belong -together -all -the -requisites -were -present -the -costumes -were -right -the -black -and -brown -exposures -unconscious -of -immodesty -were -right -the -juggler -was -there -with -his -basket -his -snakes -his -mongoose -and -his -arrangements -for -growing -a -tree -from -seed -to -foliage -and -ripe -fruitage -before -one's -eyes -in -sight -were -plants -and -flowers -familiar -to -one -on -books -but -in -no -other -way -celebrated -desirable -strange -but -in -production -restricted -to -the -hot -belt -of -the -equator -and -out -a -little -way -in -the -country -were -the -proper -deadly -snakes -and -fierce -beasts -of -prey -and -the -wild -elephant -and -the -monkey -and -there -was -that -swoon -in -the -air -which -one -associates -with -the -tropics -and -that -smother -of -heat -heavy -with -odors -of -unknown -flowers -and -that -sudden -invasion -of -purple -gloom -fissured -with -lightnings -then -the -tumult -of -crashing -thunder -and -the -downpour -and -presently -all -sunny -and -smiling -again -all -these -things -were -there -the -conditions -were -complete -nothing -was -lacking -and -away -off -in -the -deeps -of -the -jungle -and -in -the -remotenesses -of -the -mountains -were -the -ruined -cities -and -mouldering -temples -mysterious -relics -of -the -pomps -of -a -forgotten -time -and -a -vanished -race -and -this -was -as -it -should -be -also -for -nothing -is -quite -satisfyingly -oriental -that -lacks -the -somber -and -impressive -qualities -of -mystery -and -antiquity -the -drive -through -the -town -and -out -to -the -galle -face -by -the -seashore -what -a -dream -it -was -of -tropical -splendors -of -bloom -and -blossom -and -oriental -conflagrations -of -costume! -the -walking -groups -of -men -women -boys -girls -babies -each -individual -was -a -flame -each -group -a -house -afire -for -color -and -such -stunning -colors -such -intensely -vivid -colors -such -rich -and -exquisite -minglings -and -fusings -of -rainbows -and -lightnings! -and -all -harmonious -all -in -perfect -taste -never -a -discordant -note -never -a -color -on -any -person -swearing -at -another -color -on -him -or -failing -to -harmonize -faultlessly -with -the -colors -of -any -group -the -wearer -might -join -the -stuffs -were -silk -thin -soft -delicate -clinging -and -as -a -rule -each -piece -a -solid -color -a -splendid -green -a -splendid -blue -a -splendid -yellow -a -splendid -purple -a -splendid -ruby -deep -and -rich -with -smouldering -fires -they -swept -continuously -by -in -crowds -and -legions -and -multitudes -glowing -flashing -burning -radiant -and -every -five -seconds -came -a -burst -of -blinding -red -that -made -a -body -catch -his -breath -and -filled -his -heart -with -joy -and -then -the -unimaginable -grace -of -those -costumes! -sometimes -a -woman's -whole -dress -was -but -a -scarf -wound -about -her -person -and -her -head -sometimes -a -man's -was -but -a -turban -and -a -careless -rag -or -two -in -both -cases -generous -areas -of -polished -dark -skin -showing -but -always -the -arrangement -compelled -the -homage -of -the -eye -and -made -the -heart -sing -for -gladness -i -can -see -it -to -this -day -that -radiant -panorama -that -wilderness -of -rich -color -that -incomparable -dissolving -view -of -harmonious -tints -and -lithe -half -covered -forms -and -beautiful -brown -faces -and -gracious -and -graceful -gestures -and -attitudes -and -movements -free -unstudied -barren -of -stiffness -and -restraint -and -just -then -into -this -dream -of -fairyland -and -paradise -a -grating -dissonance -was -injected -out -of -a -missionary -school -came -marching -two -and -two -sixteen -prim -and -pious -little -christian -black -girls -europeanly -clothed -dressed -to -the -last -detail -as -they -would -have -been -dressed -on -a -summer -sunday -in -an -english -or -american -village -those -clothes -oh -they -were -unspeakably -ugly! -ugly -barbarous -destitute -of -taste -destitute -of -grace -repulsive -as -a -shroud -i -looked -at -my -womenfolk's -clothes -just -full -grown -duplicates -of -the -outrages -disguising -those -poor -little -abused -creatures -and -was -ashamed -to -be -seen -in -the -street -with -them -then -i -looked -at -my -own -clothes -and -was -ashamed -to -be -seen -in -the -street -with -myself -however -we -must -put -up -with -our -clothes -as -they -are -they -have -their -reason -for -existing -they -are -on -us -to -expose -us -to -advertise -what -we -wear -them -to -conceal -they -are -a -sign -a -sign -of -insincerity -a -sign -of -suppressed -vanity -a -pretense -that -we -despise -gorgeous -colors -and -the -graces -of -harmony -and -form -and -we -put -them -on -to -propagate -that -lie -and -back -it -up -but -we -do -not -deceive -our -neighbor -and -when -we -step -into -ceylon -we -realize -that -we -have -not -even -deceived -ourselves -we -do -love -brilliant -colors -and -graceful -costumes -and -at -home -we -will -turn -out -in -a -storm -to -see -them -when -the -procession -goes -by -and -envy -the -wearers -we -go -to -the -theater -to -look -at -them -and -grieve -that -we -can't -be -clothed -like -that -we -go -to -the -king's -ball -when -we -get -a -chance -and -are -glad -of -a -sight -of -the -splendid -uniforms -and -the -glittering -orders -when -we -are -granted -permission -to -attend -an -imperial -drawing -room -we -shut -ourselves -up -in -private -and -parade -around -in -the -theatrical -court -dress -by -the -hour -and -admire -ourselves -in -the -glass -and -are -utterly -happy -and -every -member -of -every -governor's -staff -in -democratic -america -does -the -same -with -his -grand -new -uniform -and -if -he -is -not -watched -he -will -get -himself -photographed -in -it -too -when -i -see -the -lord -mayor's -footman -i -am -dissatisfied -with -my -lot -yes -our -clothes -are -a -lie -and -have -been -nothing -short -of -that -these -hundred -years -they -are -insincere -they -are -the -ugly -and -appropriate -outward -exposure -of -an -inward -sham -and -a -moral -decay -the -last -little -brown -boy -i -chanced -to -notice -in -the -crowds -and -swarms -of -colombo -had -nothing -on -but -a -twine -string -around -his -waist -but -in -my -memory -the -frank -honesty -of -his -costume -still -stands -out -in -pleasant -contrast -with -the -odious -flummery -in -which -the -little -sunday -school -dowdies -were -masquerading -chapter -xxxviii -prosperity -is -the -best -protector -of -principle -pudd'nhead -wilson's -new -calendar -evening -11th -sailed -in -the -rosetta -this -is -a -poor -old -ship -and -ought -to -be -insured -and -sunk -as -in -the -'oceana' -just -so -here -everybody -dresses -for -dinner -they -make -it -a -sort -of -pious -duty -these -fine -and -formal -costumes -are -a -rather -conspicuous -contrast -to -the -poverty -and -shabbiness -of -the -surroundings -if -you -want -a -slice -of -a -lime -at -four -o'clock -tea -you -must -sign -an -order -on -the -bar -limes -cost -14 -cents -a -barrel -january -18th -we -have -been -running -up -the -arabian -sea -latterly -closing -up -on -bombay -now -and -due -to -arrive -this -evening -january -20th -bombay! -a -bewitching -place -a -bewildering -place -an -enchanting -place -the -arabian -nights -come -again -it -is -a -vast -city -contains -about -a -million -inhabitants -natives -they -are -with -a -slight -sprinkling -of -white -people -not -enough -to -have -the -slightest -modifying -effect -upon -the -massed -dark -complexion -of -the -public -it -is -winter -here -yet -the -weather -is -the -divine -weather -of -june -and -the -foliage -is -the -fresh -and -heavenly -foliage -of -june -there -is -a -rank -of -noble -great -shade -trees -across -the -way -from -the -hotel -and -under -them -sit -groups -of -picturesque -natives -of -both -sexes -and -the -juggler -in -his -turban -is -there -with -his -snakes -and -his -magic -and -all -day -long -the -cabs -and -the -multitudinous -varieties -of -costumes -flock -by -it -does -not -seem -as -if -one -could -ever -get -tired -of -watching -this -moving -show -this -shining -and -shifting -spectacle -in -the -great -bazar -the -pack -and -jam -of -natives -was -marvelous -the -sea -of -rich -colored -turbans -and -draperies -an -inspiring -sight -and -the -quaint -and -showy -indian -architecture -was -just -the -right -setting -for -it -toward -sunset -another -show -this -is -the -drive -around -the -sea -shore -to -malabar -point -where -lord -sandhurst -the -governor -of -the -bombay -presidency -lives -parsee -palaces -all -along -the -first -part -of -the -drive -and -past -them -all -the -world -is -driving -the -private -carriages -of -wealthy -englishmen -and -natives -of -rank -are -manned -by -a -driver -and -three -footmen -in -stunning -oriental -liveries -two -of -these -turbaned -statues -standing -up -behind -as -fine -as -monuments -sometimes -even -the -public -carriages -have -this -superabundant -crew -slightly -modified -one -to -drive -one -to -sit -by -and -see -it -done -and -one -to -stand -up -behind -and -yell -yell -when -there -is -anybody -in -the -way -and -for -practice -when -there -isn't -it -all -helps -to -keep -up -the -liveliness -and -augment -the -general -sense -of -swiftness -and -energy -and -confusion -and -pow -wow -in -the -region -of -scandal -point -felicitous -name -where -there -are -handy -rocks -to -sit -on -and -a -noble -view -of -the -sea -on -the -one -hand -and -on -the -other -the -passing -and -reprising -whirl -and -tumult -of -gay -carriages -are -great -groups -of -comfortably -off -parsee -women -perfect -flower -beds -of -brilliant -color -a -fascinating -spectacle -tramp -tramp -tramping -along -the -road -in -singles -couples -groups -and -gangs -you -have -the -working -man -and -the -working -woman -but -not -clothed -like -ours -usually -the -man -is -a -nobly -built -great -athlete -with -not -a -rag -on -but -his -loin -handkerchief -his -color -a -deep -dark -brown -his -skin -satin -his -rounded -muscles -knobbing -it -as -if -it -had -eggs -under -it -usually -the -woman -is -a -slender -and -shapely -creature -as -erect -as -a -lightning -rod -and -she -has -but -one -thing -on -a -bright -colored -piece -of -stuff -which -is -wound -about -her -head -and -her -body -down -nearly -half -way -to -her -knees -and -which -clings -like -her -own -skin -her -legs -and -feet -are -bare -and -so -are -her -arms -except -for -her -fanciful -bunches -of -loose -silver -rings -on -her -ankles -and -on -her -arms -she -has -jewelry -bunched -on -the -side -of -her -nose -also -and -showy -clusterings -on -her -toes -when -she -undresses -for -bed -she -takes -off -her -jewelry -i -suppose -if -she -took -off -anything -more -she -would -catch -cold -as -a -rule -she -has -a -large -shiney -brass -water -jar -of -graceful -shape -on -her -head -and -one -of -her -naked -arms -curves -up -and -the -hand -holds -it -there -she -is -so -straight -so -erect -and -she -steps -with -such -style -and -such -easy -grace -and -dignity -and -her -curved -arm -and -her -brazen -jar -are -such -a -help -to -the -picture -indeed -our -working -women -cannot -begin -with -her -as -a -road -decoration -it -is -all -color -bewitching -color -enchanting -color -everywhere -all -around -all -the -way -around -the -curving -great -opaline -bay -clear -to -government -house -where -the -turbaned -big -native -'chuprassies' -stand -grouped -in -state -at -the -door -in -their -robes -of -fiery -red -and -do -most -properly -and -stunningly -finish -up -the -splendid -show -and -make -it -theatrically -complete -i -wish -i -were -a -'chuprassy' -this -is -indeed -india! -the -land -of -dreams -and -romance -of -fabulous -wealth -and -fabulous -poverty -of -splendor -and -rags -of -palaces -and -hovels -of -famine -and -pestilence -of -genii -and -giants -and -aladdin -lamps -of -tigers -and -elephants -the -cobra -and -the -jungle -the -country -of -a -hundred -nations -and -a -hundred -tongues -of -a -thousand -religions -and -two -million -gods -cradle -of -the -human -race -birthplace -of -human -speech -mother -of -history -grandmother -of -legend -great -grandmother -of -tradition -whose -yesterdays -bear -date -with -the -mouldering -antiquities -of -the -rest -of -the -nations -the -one -sole -country -under -the -sun -that -is -endowed -with -an -imperishable -interest -for -alien -prince -and -alien -peasant -for -lettered -and -ignorant -wise -and -fool -rich -and -poor -bond -and -free -the -one -land -that -all -men -desire -to -see -and -having -seen -once -by -even -a -glimpse -would -not -give -that -glimpse -for -the -shows -of -all -the -rest -of -the -globe -combined -even -now -after -the -lapse -of -a -year -the -delirium -of -those -days -in -bombay -has -not -left -me -and -i -hope -never -will -it -was -all -new -no -detail -of -it -hackneyed -and -india -did -not -wait -for -morning -it -began -at -the -hotel -straight -away -the -lobbies -and -halls -were -full -of -turbaned -and -fez'd -and -embroidered -cap'd -and -barefooted -and -cotton -clad -dark -natives -some -of -them -rushing -about -others -at -rest -squatting -or -sitting -on -the -ground -some -of -them -chattering -with -energy -others -still -and -dreamy -in -the -dining -room -every -man's -own -private -native -servant -standing -behind -his -chair -and -dressed -for -a -part -in -the -arabian -nights -our -rooms -were -high -up -on -the -front -a -white -man -he -was -a -burly -german -went -up -with -us -and -brought -three -natives -along -to -see -to -arranging -things -about -fourteen -others -followed -in -procession -with -the -hand -baggage -each -carried -an -article -and -only -one -a -bag -in -some -cases -in -other -cases -less -one -strong -native -carried -my -overcoat -another -a -parasol -another -a -box -of -cigars -another -a -novel -and -the -last -man -in -the -procession -had -no -load -but -a -fan -it -was -all -done -with -earnestness -and -sincerity -there -was -not -a -smile -in -the -procession -from -the -head -of -it -to -the -tail -of -it -each -man -waited -patiently -tranquilly -in -no -sort -of -hurry -till -one -of -us -found -time -to -give -him -a -copper -then -he -bent -his -head -reverently -touched -his -forehead -with -his -fingers -and -went -his -way -they -seemed -a -soft -and -gentle -race -and -there -was -something -both -winning -and -touching -about -their -demeanor -there -was -a -vast -glazed -door -which -opened -upon -the -balcony -it -needed -closing -or -cleaning -or -something -and -a -native -got -down -on -his -knees -and -went -to -work -at -it -he -seemed -to -be -doing -it -well -enough -but -perhaps -he -wasn't -for -the -burly -german -put -on -a -look -that -betrayed -dissatisfaction -then -without -explaining -what -was -wrong -gave -the -native -a -brisk -cuff -on -the -jaw -and -then -told -him -where -the -defect -was -it -seemed -such -a -shame -to -do -that -before -us -all -the -native -took -it -with -meekness -saying -nothing -and -not -showing -in -his -face -or -manner -any -resentment -i -had -not -seen -the -like -of -this -for -fifty -years -it -carried -me -back -to -my -boyhood -and -flashed -upon -me -the -forgotten -fact -that -this -was -the -usual -way -of -explaining -one's -desires -to -a -slave -i -was -able -to -remember -that -the -method -seemed -right -and -natural -to -me -in -those -days -i -being -born -to -it -and -unaware -that -elsewhere -there -were -other -methods -but -i -was -also -able -to -remember -that -those -unresented -cuffings -made -me -sorry -for -the -victim -and -ashamed -for -the -punisher -my -father -was -a -refined -and -kindly -gentleman -very -grave -rather -austere -of -rigid -probity -a -sternly -just -and -upright -man -albeit -he -attended -no -church -and -never -spoke -of -religious -matters -and -had -no -part -nor -lot -in -the -pious -joys -of -his -presbyterian -family -nor -ever -seemed -to -suffer -from -this -deprivation -he -laid -his -hand -upon -me -in -punishment -only -twice -in -his -life -and -then -not -heavily -once -for -telling -him -a -lie -which -surprised -me -and -showed -me -how -unsuspicious -he -was -for -that -was -not -my -maiden -effort -he -punished -me -those -two -times -only -and -never -any -other -member -of -the -family -at -all -yet -every -now -and -then -he -cuffed -our -harmless -slave -boy -lewis -for -trifling -little -blunders -and -awkwardnesses -my -father -had -passed -his -life -among -the -slaves -from -his -cradle -up -and -his -cuffings -proceeded -from -the -custom -of -the -time -not -from -his -nature -when -i -was -ten -years -old -i -saw -a -man -fling -a -lump -of -iron -ore -at -a -slaveman -in -anger -for -merely -doing -something -awkwardly -as -if -that -were -a -crime -it -bounded -from -the -man's -skull -and -the -man -fell -and -never -spoke -again -he -was -dead -in -an -hour -i -knew -the -man -had -a -right -to -kill -his -slave -if -he -wanted -to -and -yet -it -seemed -a -pitiful -thing -and -somehow -wrong -though -why -wrong -i -was -not -deep -enough -to -explain -if -i -had -been -asked -to -do -it -nobody -in -the -village -approved -of -that -murder -but -of -course -no -one -said -much -about -it -it -is -curious -the -space -annihilating -power -of -thought -for -just -one -second -all -that -goes -to -make -the -me -in -me -was -in -a -missourian -village -on -the -other -side -of -the -globe -vividly -seeing -again -these -forgotten -pictures -of -fifty -years -ago -and -wholly -unconscious -of -all -things -but -just -those -and -in -the -next -second -i -was -back -in -bombay -and -that -kneeling -native's -smitten -cheek -was -not -done -tingling -yet! -back -to -boyhood -fifty -years -back -to -age -again -another -fifty -and -a -flight -equal -to -the -circumference -of -the -globe -all -in -two -seconds -by -the -watch! -some -natives -i -don't -remember -how -many -went -into -my -bedroom -now -and -put -things -to -rights -and -arranged -the -mosquito -bar -and -i -went -to -bed -to -nurse -my -cough -it -was -about -nine -in -the -evening -what -a -state -of -things! -for -three -hours -the -yelling -and -shouting -of -natives -in -the -hall -continued -along -with -the -velvety -patter -of -their -swift -bare -feet -what -a -racket -it -was! -they -were -yelling -orders -and -messages -down -three -flights -why -in -the -matter -of -noise -it -amounted -to -a -riot -an -insurrection -a -revolution -and -then -there -were -other -noises -mixed -up -with -these -and -at -intervals -tremendously -accenting -them -roofs -falling -in -i -judged -windows -smashing -persons -being -murdered -crows -squawking -and -deriding -and -cursing -canaries -screeching -monkeys -jabbering -macaws -blaspheming -and -every -now -and -then -fiendish -bursts -of -laughter -and -explosions -of -dynamite -by -midnight -i -had -suffered -all -the -different -kinds -of -shocks -there -are -and -knew -that -i -could -never -more -be -disturbed -by -them -either -isolated -or -in -combination -then -came -peace -stillness -deep -and -solemn -and -lasted -till -five -then -it -all -broke -loose -again -and -who -re -started -it -the -bird -of -birds -the -indian -crow -i -came -to -know -him -well -by -and -by -and -be -infatuated -with -him -i -suppose -he -is -the -hardest -lot -that -wears -feathers -yes -and -the -cheerfulest -and -the -best -satisfied -with -himself -he -never -arrived -at -what -he -is -by -any -careless -process -or -any -sudden -one -he -is -a -work -of -art -and -art -is -long -he -is -the -product -of -immemorial -ages -and -of -deep -calculation -one -can't -make -a -bird -like -that -in -a -day -he -has -been -reincarnated -more -times -than -shiva -and -he -has -kept -a -sample -of -each -incarnation -and -fused -it -into -his -constitution -in -the -course -of -his -evolutionary -promotions -his -sublime -march -toward -ultimate -perfection -he -has -been -a -gambler -a -low -comedian -a -dissolute -priest -a -fussy -woman -a -blackguard -a -scoffer -a -liar -a -thief -a -spy -an -informer -a -trading -politician -a -swindler -a -professional -hypocrite -a -patriot -for -cash -a -reformer -a -lecturer -a -lawyer -a -conspirator -a -rebel -a -royalist -a -democrat -a -practicer -and -propagator -of -irreverence -a -meddler -an -intruder -a -busybody -an -infidel -and -a -wallower -in -sin -for -the -mere -love -of -it -the -strange -result -the -incredible -result -of -this -patient -accumulation -of -all -damnable -traits -is -that -be -does -not -know -what -care -is -he -does -not -know -what -sorrow -is -he -does -not -know -what -remorse -is -his -life -is -one -long -thundering -ecstasy -of -happiness -and -he -will -go -to -his -death -untroubled -knowing -that -he -will -soon -turn -up -again -as -an -author -or -something -and -be -even -more -intolerably -capable -and -comfortable -than -ever -he -was -before -in -his -straddling -wide -forward -step -and -his -springy -side -wise -series -of -hops -and -his -impudent -air -and -his -cunning -way -of -canting -his -head -to -one -side -upon -occasion -he -reminds -one -of -the -american -blackbird -but -the -sharp -resemblances -stop -there -he -is -much -bigger -than -the -blackbird -and -he -lacks -the -blackbird's -trim -and -slender -and -beautiful -build -and -shapely -beak -and -of -course -his -sober -garb -of -gray -and -rusty -black -is -a -poor -and -humble -thing -compared -with -the -splendid -lustre -of -the -blackbird's -metallic -sables -and -shifting -and -flashing -bronze -glories -the -blackbird -is -a -perfect -gentleman -in -deportment -and -attire -and -is -not -noisy -i -believe -except -when -holding -religious -services -and -political -conventions -in -a -tree -but -this -indian -sham -quaker -is -just -a -rowdy -and -is -always -noisy -when -awake -always -chaffing -scolding -scoffing -laughing -ripping -and -cursing -and -carrying -on -about -something -or -other -i -never -saw -such -a -bird -for -delivering -opinions -nothing -escapes -him -he -notices -everything -that -happens -and -brings -out -his -opinion -about -it -particularly -if -it -is -a -matter -that -is -none -of -his -business -and -it -is -never -a -mild -opinion -but -always -violent -violent -and -profane -the -presence -of -ladies -does -not -affect -him -his -opinions -are -not -the -outcome -of -reflection -for -he -never -thinks -about -anything -but -heaves -out -the -opinion -that -is -on -top -in -his -mind -and -which -is -often -an -opinion -about -some -quite -different -thing -and -does -not -fit -the -case -but -that -is -his -way -his -main -idea -is -to -get -out -an -opinion -and -if -he -stopped -to -think -he -would -lose -chances -i -suppose -he -has -no -enemies -among -men -the -whites -and -mohammedans -never -seemed -to -molest -him -and -the -hindoos -because -of -their -religion -never -take -the -life -of -any -creature -but -spare -even -the -snakes -and -tigers -and -fleas -and -rats -if -i -sat -on -one -end -of -the -balcony -the -crows -would -gather -on -the -railing -at -the -other -end -and -talk -about -me -and -edge -closer -little -by -little -till -i -could -almost -reach -them -and -they -would -sit -there -in -the -most -unabashed -way -and -talk -about -my -clothes -and -my -hair -and -my -complexion -and -probable -character -and -vocation -and -politics -and -how -i -came -to -be -in -india -and -what -i -had -been -doing -and -how -many -days -i -had -got -for -it -and -how -i -had -happened -to -go -unhanged -so -long -and -when -would -it -probably -come -off -and -might -there -be -more -of -my -sort -where -i -came -from -and -when -would -they -be -hanged -and -so -on -and -so -on -until -i -could -not -longer -endure -the -embarrassment -of -it -then -i -would -shoo -them -away -and -they -would -circle -around -in -the -air -a -little -while -laughing -and -deriding -and -mocking -and -presently -settle -on -the -rail -and -do -it -all -over -again -they -were -very -sociable -when -there -was -anything -to -eat -oppressively -so -with -a -little -encouragement -they -would -come -in -and -light -on -the -table -and -help -me -eat -my -breakfast -and -once -when -i -was -in -the -other -room -and -they -found -themselves -alone -they -carried -off -everything -they -could -lift -and -they -were -particular -to -choose -things -which -they -could -make -no -use -of -after -they -got -them -in -india -their -number -is -beyond -estimate -and -their -noise -is -in -proportion -i -suppose -they -cost -the -country -more -than -the -government -does -yet -that -is -not -a -light -matter -still -they -pay -their -company -pays -it -would -sadden -the -land -to -take -their -cheerful -voice -out -of -it -chapter -xxxix -by -trying -we -can -easily -learn -to -endure -adversity -another -man's -i -mean -pudd'nhead -wilson's -new -calendar -you -soon -find -your -long -ago -dreams -of -india -rising -in -a -sort -of -vague -and -luscious -moonlight -above -the -horizon -rim -of -your -opaque -consciousness -and -softly -lighting -up -a -thousand -forgotten -details -which -were -parts -of -a -vision -that -had -once -been -vivid -to -you -when -you -were -a -boy -and -steeped -your -spirit -in -tales -of -the -east -the -barbaric -gorgeousnesses -for -instance -and -the -princely -titles -the -sumptuous -titles -the -sounding -titles -how -good -they -taste -in -the -mouth! -the -nizam -of -hyderabad -the -maharajah -of -travancore -the -nabob -of -jubbelpore -the -begum -of -bhopal -the -nawab -of -mysore -the -rance -of -gulnare -the -ahkoond -of -swat's -the -rao -of -rohilkund -the -gaikwar -of -baroda -indeed -it -is -a -country -that -runs -richly -to -name -the -great -god -vishnu -has -108 -108 -special -ones -108 -peculiarly -holy -ones -names -just -for -sunday -use -only -i -learned -the -whole -of -vishnu's -108 -by -heart -once -but -they -wouldn't -stay -i -don't -remember -any -of -them -now -but -john -w -and -the -romances -connected -with -those -princely -native -houses -to -this -day -they -are -always -turning -up -just -as -in -the -old -old -times -they -were -sweating -out -a -romance -in -an -english -court -in -bombay -a -while -before -we -were -there -in -this -case -a -native -prince -16 -1/2 -years -old -who -has -been -enjoying -his -titles -and -dignities -and -estates -unmolested -for -fourteen -years -is -suddenly -haled -into -court -on -the -charge -that -he -is -rightfully -no -prince -at -all -but -a -pauper -peasant -that -the -real -prince -died -when -two -and -one -half -years -old -that -the -death -was -concealed -and -a -peasant -child -smuggled -into -the -royal -cradle -and -that -this -present -incumbent -was -that -smuggled -substitute -this -is -the -very -material -that -so -many -oriental -tales -have -been -made -of -the -case -of -that -great -prince -the -gaikwar -of -baroda -is -a -reversal -of -the -theme -when -that -throne -fell -vacant -no -heir -could -be -found -for -some -time -but -at -last -one -was -found -in -the -person -of -a -peasant -child -who -was -making -mud -pies -in -a -village -street -and -having -an -innocent -good -time -but -his -pedigree -was -straight -he -was -the -true -prince -and -he -has -reigned -ever -since -with -none -to -dispute -his -right -lately -there -was -another -hunt -for -an -heir -to -another -princely -house -and -one -was -found -who -was -circumstanced -about -as -the -gaikwar -had -been -his -fathers -were -traced -back -in -humble -life -along -a -branch -of -the -ancestral -tree -to -the -point -where -it -joined -the -stem -fourteen -generations -ago -and -his -heirship -was -thereby -squarely -established -the -tracing -was -done -by -means -of -the -records -of -one -of -the -great -hindoo -shrines -where -princes -on -pilgrimage -record -their -names -and -the -date -of -their -visit -this -is -to -keep -the -prince's -religious -account -straight -and -his -spiritual -person -safe -but -the -record -has -the -added -value -of -keeping -the -pedigree -authentic -too -when -i -think -of -bombay -now -at -this -distance -of -time -i -seem -to -have -a -kaleidoscope -at -my -eye -and -i -hear -the -clash -of -the -glass -bits -as -the -splendid -figures -change -and -fall -apart -and -flash -into -new -forms -figure -after -figure -and -with -the -birth -of -each -new -form -i -feel -my -skin -crinkle -and -my -nerve -web -tingle -with -a -new -thrill -of -wonder -and -delight -these -remembered -pictures -float -past -me -in -a -sequence -of -contracts -following -the -same -order -always -and -always -whirling -by -and -disappearing -with -the -swiftness -of -a -dream -leaving -me -with -the -sense -that -the -actuality -was -the -experience -of -an -hour -at -most -whereas -it -really -covered -days -i -think -the -series -begins -with -the -hiring -of -a -bearer -native -man -servant -a -person -who -should -be -selected -with -some -care -because -as -long -as -he -is -in -your -employ -he -will -be -about -as -near -to -you -as -your -clothes -in -india -your -day -may -be -said -to -begin -with -the -bearer's -knock -on -the -bedroom -door -accompanied -by -a -formula -of -words -a -formula -which -is -intended -to -mean -that -the -bath -is -ready -it -doesn't -really -seem -to -mean -anything -at -all -but -that -is -because -you -are -not -used -to -bearer -english -you -will -presently -understand -where -he -gets -his -english -is -his -own -secret -there -is -nothing -like -it -elsewhere -in -the -earth -or -even -in -paradise -perhaps -but -the -other -place -is -probably -full -of -it -you -hire -him -as -soon -as -you -touch -indian -soil -for -no -matter -what -your -sex -is -you -cannot -do -without -him -he -is -messenger -valet -chambermaid -table -waiter -lady's -maid -courier -he -is -everything -he -carries -a -coarse -linen -clothes -bag -and -a -quilt -he -sleeps -on -the -stone -floor -outside -your -chamber -door -and -gets -his -meals -you -do -not -know -where -nor -when -you -only -know -that -he -is -not -fed -on -the -premises -either -when -you -are -in -a -hotel -or -when -you -are -a -guest -in -a -private -house -his -wages -are -large -from -an -indian -point -of -view -and -he -feeds -and -clothes -himself -out -of -them -we -had -three -of -him -in -two -and -a -half -months -the -first -one's -rate -was -thirty -rupees -a -month -that -is -to -say -twenty -seven -cents -a -day -the -rate -of -the -others -rs -40 -40 -rupees -a -month -a -princely -sum -for -the -native -switchman -on -a -railway -and -the -native -servant -in -a -private -family -get -only -rs -7 -per -month -and -the -farm -hand -only -4 -the -two -former -feed -and -clothe -themselves -and -their -families -on -their -$1 -90 -per -month -but -i -cannot -believe -that -the -farmhand -has -to -feed -himself -on -his -$1 -08 -i -think -the -farm -probably -feeds -him -and -that -the -whole -of -his -wages -except -a -trifle -for -the -priest -go -to -the -support -of -his -family -that -is -to -the -feeding -of -his -family -for -they -live -in -a -mud -hut -hand -made -and -doubtless -rent -free -and -they -wear -no -clothes -at -least -nothing -more -than -a -rag -and -not -much -of -a -rag -at -that -in -the -case -of -the -males -however -these -are -handsome -times -for -the -farm -hand -he -was -not -always -the -child -of -luxury -that -he -is -now -the -chief -commissioner -of -the -central -provinces -in -a -recent -official -utterance -wherein -he -was -rebuking -a -native -deputation -for -complaining -of -hard -times -reminded -them -that -they -could -easily -remember -when -a -farm -hand's -wages -were -only -half -a -rupee -former -value -a -month -that -is -to -say -less -than -a -cent -a -day -nearly -$2 -90 -a -year -if -such -a -wage -earner -had -a -good -deal -of -a -family -and -they -all -have -that -for -god -is -very -good -to -these -poor -natives -in -some -ways -he -would -save -a -profit -of -fifteen -cents -clean -and -clear -out -of -his -year's -toil -i -mean -a -frugal -thrifty -person -would -not -one -given -to -display -and -ostentation -and -if -he -owed -$13 -50 -and -took -good -care -of -his -health -he -could -pay -it -off -in -ninety -years -then -he -could -hold -up -his -head -and -look -his -creditors -in -the -face -again -think -of -these -facts -and -what -they -mean -india -does -not -consist -of -cities -there -are -no -cities -in -india -to -speak -of -its -stupendous -population -consists -of -farm -laborers -india -is -one -vast -farm -one -almost -interminable -stretch -of -fields -with -mud -fences -between -think -of -the -above -facts -and -consider -what -an -incredible -aggregate -of -poverty -they -place -before -you -the -first -bearer -that -applied -waited -below -and -sent -up -his -recommendations -that -was -the -first -morning -in -bombay -we -read -them -over -carefully -cautiously -thoughtfully -there -was -not -a -fault -to -find -with -them -except -one -they -were -all -from -americans -is -that -a -slur -if -it -is -it -is -a -deserved -one -in -my -experience -an -american's -recommendation -of -a -servant -is -not -usually -valuable -we -are -too -good -natured -a -race -we -hate -to -say -the -unpleasant -thing -we -shrink -from -speaking -the -unkind -truth -about -a -poor -fellow -whose -bread -depends -upon -our -verdict -so -we -speak -of -his -good -points -only -thus -not -scrupling -to -tell -a -lie -a -silent -lie -for -in -not -mentioning -his -bad -ones -we -as -good -as -say -he -hasn't -any -the -only -difference -that -i -know -of -between -a -silent -lie -and -a -spoken -one -is -that -the -silent -lie -is -a -less -respectable -one -than -the -other -and -it -can -deceive -whereas -the -other -can't -as -a -rule -we -not -only -tell -the -silent -lie -as -to -a -servant's -faults -but -we -sin -in -another -way -we -overpraise -his -merits -for -when -it -comes -to -writing -recommendations -of -servants -we -are -a -nation -of -gushers -and -we -have -not -the -frenchman's -excuse -in -france -you -must -give -the -departing -servant -a -good -recommendation -and -you -must -conceal -his -faults -you -have -no -choice -if -you -mention -his -faults -for -the -protection -of -the -next -candidate -for -his -services -he -can -sue -you -for -damages -and -the -court -will -award -them -too -and -moreover -the -judge -will -give -you -a -sharp -dressing -down -from -the -bench -for -trying -to -destroy -a -poor -man's -character -and -rob -him -of -his -bread -i -do -not -state -this -on -my -own -authority -i -got -it -from -a -french -physician -of -fame -and -repute -a -man -who -was -born -in -paris -and -had -practiced -there -all -his -life -and -he -said -that -he -spoke -not -merely -from -common -knowledge -but -from -exasperating -personal -experience -as -i -was -saying -the -bearer's -recommendations -were -all -from -american -tourists -and -st -peter -would -have -admitted -him -to -the -fields -of -the -blest -on -them -i -mean -if -he -is -as -unfamiliar -with -our -people -and -our -ways -as -i -suppose -he -is -according -to -these -recommendations -manuel -x -was -supreme -in -all -the -arts -connected -with -his -complex -trade -and -these -manifold -arts -were -mentioned -and -praised -in -detail -his -english -was -spoken -of -in -terms -of -warm -admiration -admiration -verging -upon -rapture -i -took -pleased -note -of -that -and -hoped -that -some -of -it -might -be -true -we -had -to -have -some -one -right -away -so -the -family -went -down -stairs -and -took -him -a -week -on -trial -then -sent -him -up -to -me -and -departed -on -their -affairs -i -was -shut -up -in -my -quarters -with -a -bronchial -cough -and -glad -to -have -something -fresh -to -look -at -something -new -to -play -with -manuel -filled -the -bill -manuel -was -very -welcome -he -was -toward -fifty -years -old -tall -slender -with -a -slight -stoop -an -artificial -stoop -a -deferential -stoop -a -stoop -rigidified -by -long -habit -with -face -of -european -mould -short -hair -intensely -black -gentle -black -eyes -timid -black -eyes -indeed -complexion -very -dark -nearly -black -in -fact -face -smooth -shaven -he -was -bareheaded -and -barefooted -and -was -never -otherwise -while -his -week -with -us -lasted -his -clothing -was -european -cheap -flimsy -and -showed -much -wear -he -stood -before -me -and -inclined -his -head -and -body -in -the -pathetic -indian -way -touching -his -forehead -with -the -finger -ends -of -his -right -hand -in -salute -i -said -manuel -you -are -evidently -indian -but -you -seem -to -have -a -spanish -name -when -you -put -it -all -together -how -is -that -a -perplexed -look -gathered -in -his -face -it -was -plain -that -he -had -not -understood -but -he -didn't -let -on -he -spoke -back -placidly -name -manuel -yes -master -i -know -but -how -did -you -get -the -name -oh -yes -i -suppose -think -happen -so -father -same -name -not -mother -i -saw -that -i -must -simplify -my -language -and -spread -my -words -apart -if -i -would -be -understood -by -this -english -scholar -well -then -how -did -your -father -get -his -name -oh -he -brightening -a -little -he -christian -portygee -live -in -goa -i -born -goa -mother -not -portygee -mother -native -high -caste -brahmin -coolin -brahmin -highest -caste -no -other -so -high -caste -i -high -caste -brahmin -too -christian -too -same -like -father -high -caste -christian -brahmin -master -salvation -army -all -this -haltingly -and -with -difficulty -then -he -had -an -inspiration -and -began -to -pour -out -a -flood -of -words -that -i -could -make -nothing -of -so -i -said -there -don't -do -that -i -can't -understand -hindostani -not -hindostani -master -english -always -i -speaking -english -sometimes -when -i -talking -every -day -all -the -time -at -you -very -well -stick -to -that -that -is -intelligible -it -is -not -up -to -my -hopes -it -is -not -up -to -the -promise -of -the -recommendations -still -it -is -english -and -i -understand -it -don't -elaborate -it -i -don't -like -elaborations -when -they -are -crippled -by -uncertainty -of -touch -master -oh -never -mind -it -was -only -a -random -thought -i -didn't -expect -you -to -understand -it -how -did -you -get -your -english -is -it -an -acquirement -or -just -a -gift -of -god -after -some -hesitation -piously -yes -he -very -good -christian -god -very -good -hindoo -god -very -good -too -two -million -hindoo -god -one -christian -god -make -two -million -and -one -all -mine -two -million -and -one -god -i -got -a -plenty -sometime -i -pray -all -time -at -those -keep -it -up -go -all -time -every -day -give -something -at -shrine -all -good -for -me -make -me -better -man -good -for -me -good -for -my -family -dam -good -then -he -had -another -inspiration -and -went -rambling -off -into -fervent -confusions -and -incoherencies -and -i -had -to -stop -him -again -i -thought -we -had -talked -enough -so -i -told -him -to -go -to -the -bathroom -and -clean -it -up -and -remove -the -slops -this -to -get -rid -of -him -he -went -away -seeming -to -understand -and -got -out -some -of -my -clothes -and -began -to -brush -them -i -repeated -my -desire -several -times -simplifying -and -re -simplifying -it -and -at -last -he -got -the -idea -then -he -went -away -and -put -a -coolie -at -the -work -and -explained -that -he -would -lose -caste -if -he -did -it -himself -it -would -be -pollution -by -the -law -of -his -caste -and -it -would -cost -him -a -deal -of -fuss -and -trouble -to -purify -himself -and -accomplish -his -rehabilitation -he -said -that -that -kind -of -work -was -strictly -forbidden -to -persons -of -caste -and -as -strictly -restricted -to -the -very -bottom -layer -of -hindoo -society -the -despised -'sudra' -the -toiler -the -laborer -he -was -right -and -apparently -the -poor -sudra -has -been -content -with -his -strange -lot -his -insulting -distinction -for -ages -and -ages -clear -back -to -the -beginning -of -things -so -to -speak -buckle -says -that -his -name -laborer -is -a -term -of -contempt -that -it -is -ordained -by -the -institutes -of -menu -900 -b -c -that -if -a -sudra -sit -on -a -level -with -his -superior -he -shall -be -exiled -or -branded -[without -going -into -particulars -i -will -remark -that -as -a -rule -they -wear -no -clothing -that -would -conceal -the -brand -m -t -] -if -he -speak -contemptuously -of -his -superior -or -insult -him -he -shall -suffer -death -if -he -listen -to -the -reading -of -the -sacred -books -he -shall -have -burning -oil -poured -in -his -ears -if -he -memorize -passages -from -them -he -shall -be -killed -if -he -marry -his -daughter -to -a -brahmin -the -husband -shall -go -to -hell -for -defiling -himself -by -contact -with -a -woman -so -infinitely -his -inferior -and -that -it -is -forbidden -to -a -sudra -to -acquire -wealth -the -bulk -of -the -population -of -india -says -bucklet -[population -to -day -300 -000 -000 -] -is -the -sudras -the -workers -the -farmers -the -creators -of -wealth -manuel -was -a -failure -poor -old -fellow -his -age -was -against -him -he -was -desperately -slow -and -phenomenally -forgetful -when -he -went -three -blocks -on -an -errand -he -would -be -gone -two -hours -and -then -forget -what -it -was -he -went -for -when -he -packed -a -trunk -it -took -him -forever -and -the -trunk's -contents -were -an -unimaginable -chaos -when -he -got -done -he -couldn't -wait -satisfactorily -at -table -a -prime -defect -for -if -you -haven't -your -own -servant -in -an -indian -hotel -you -are -likely -to -have -a -slow -time -of -it -and -go -away -hungry -we -couldn't -understand -his -english -he -couldn't -understand -ours -and -when -we -found -that -he -couldn't -understand -his -own -it -seemed -time -for -us -to -part -i -had -to -discharge -him -there -was -no -help -for -it -but -i -did -it -as -kindly -as -i -could -and -as -gently -we -must -part -said -i -but -i -hoped -we -should -meet -again -in -a -better -world -it -was -not -true -but -it -was -only -a -little -thing -to -say -and -saved -his -feelings -and -cost -me -nothing -but -now -that -he -was -gone -and -was -off -my -mind -and -heart -my -spirits -began -to -rise -at -once -and -i -was -soon -feeling -brisk -and -ready -to -go -out -and -have -adventures -then -his -newly -hired -successor -flitted -in -touched -his -forehead -and -began -to -fly -around -here -there -and -everywhere -on -his -velvet -feet -and -in -five -minutes -he -had -everything -in -the -room -ship -shape -and -bristol -fashion -as -the -sailors -say -and -was -standing -at -the -salute -waiting -for -orders -dear -me -what -a -rustler -he -was -after -the -slumbrous -way -of -manuel -poor -old -slug! -all -my -heart -all -my -affection -all -my -admiration -went -out -spontaneously -to -this -frisky -little -forked -black -thing -this -compact -and -compressed -incarnation -of -energy -and -force -and -promptness -and -celerity -and -confidence -this -smart -smily -engaging -shiney -eyed -little -devil -feruled -on -his -upper -end -by -a -gleaming -fire -coal -of -a -fez -with -a -red -hot -tassel -dangling -from -it -i -said -with -deep -satisfaction -you'll -suit -what -is -your -name -he -reeled -it -mellowly -off -let -me -see -if -i -can -make -a -selection -out -of -it -for -business -uses -i -mean -we -will -keep -the -rest -for -sundays -give -it -to -me -in -installments -he -did -it -but -there -did -not -seem -to -be -any -short -ones -except -mousawhich -suggested -mouse -it -was -out -of -character -it -was -too -soft -too -quiet -too -conservative -it -didn't -fit -his -splendid -style -i -considered -and -said -mousa -is -short -enough -but -i -don't -quite -like -it -it -seems -colorless -inharmonious -inadequate -and -i -am -sensitive -to -such -things -how -do -you -think -satan -would -do -yes -master -satan -do -wair -good -it -was -his -way -of -saying -very -good -there -was -a -rap -at -the -door -satan -covered -the -ground -with -a -single -skip -there -was -a -word -or -two -of -hindostani -then -he -disappeared -three -minutes -later -he -was -before -me -again -militarily -erect -and -waiting -for -me -to -speak -first -what -is -it -satan -god -want -to -see -you -who -god -i -show -him -up -master -why -this -is -so -unusual -that -that -well -you -see -indeed -i -am -so -unprepared -i -don't -quite -know -what -i -do -mean -dear -me -can't -you -explain -don't -you -see -that -this -is -a -most -ex -here -his -card -master -wasn't -it -curious -and -amazing -and -tremendous -and -all -that -such -a -personage -going -around -calling -on -such -as -i -and -sending -up -his -card -like -a -mortal -sending -it -up -by -satan -it -was -a -bewildering -collision -of -the -impossibles -but -this -was -the -land -of -the -arabian -nights -this -was -india! -and -what -is -it -that -cannot -happen -in -india -we -had -the -interview -satan -was -right -the -visitor -was -indeed -a -god -in -the -conviction -of -his -multitudinous -followers -and -was -worshiped -by -them -in -sincerity -and -humble -adoration -they -are -troubled -by -no -doubts -as -to -his -divine -origin -and -office -they -believe -in -him -they -pray -to -him -they -make -offerings -to -him -they -beg -of -him -remission -of -sins -to -them -his -person -together -with -everything -connected -with -it -is -sacred -from -his -barber -they -buy -the -parings -of -his -nails -and -set -them -in -gold -and -wear -them -as -precious -amulets -i -tried -to -seem -tranquilly -conversational -and -at -rest -but -i -was -not -would -you -have -been -i -was -in -a -suppressed -frenzy -of -excitement -and -curiosity -and -glad -wonder -i -could -not -keep -my -eyes -off -him -i -was -looking -upon -a -god -an -actual -god -a -recognized -and -accepted -god -and -every -detail -of -his -person -and -his -dress -had -a -consuming -interest -for -me -and -the -thought -went -floating -through -my -head -he -is -worshiped -think -of -it -he -is -not -a -recipient -of -the -pale -homage -called -compliment -wherewith -the -highest -human -clay -must -make -shift -to -be -satisfied -but -of -an -infinitely -richer -spiritual -food -adoration -worship! -men -and -women -lay -their -cares -and -their -griefs -and -their -broken -hearts -at -his -feet -and -he -gives -them -his -peace -and -they -go -away -healed -and -just -then -the -awful -visitor -said -in -the -simplest -way -there -is -a -feature -of -the -philosophy -of -huck -finn -which -and -went -luminously -on -with -the -construction -of -a -compact -and -nicely -discriminated -literary -verdict -it -is -a -land -of -surprises -india! -i -had -had -my -ambitions -i -had -hoped -and -almost -expected -to -be -read -by -kings -and -presidents -and -emperors -but -i -had -never -looked -so -high -as -that -it -would -be -false -modesty -to -pretend -that -i -was -not -inordinately -pleased -i -was -i -was -much -more -pleased -than -i -should -have -been -with -a -compliment -from -a -man -he -remained -half -an -hour -and -i -found -him -a -most -courteous -and -charming -gentleman -the -godship -has -been -in -his -family -a -good -while -but -i -do -not -know -how -long -he -is -a -mohammedan -deity -by -earthly -rank -he -is -a -prince -not -an -indian -but -a -persian -prince -he -is -a -direct -descendant -of -the -prophet's -line -he -is -comely -also -young -for -a -god -not -forty -perhaps -not -above -thirty -five -years -old -he -wears -his -immense -honors -with -tranquil -brace -and -with -a -dignity -proper -to -his -awful -calling -he -speaks -english -with -the -ease -and -purity -of -a -person -born -to -it -i -think -i -am -not -overstating -this -he -was -the -only -god -i -had -ever -seen -and -i -was -very -favorably -impressed -when -he -rose -to -say -good -bye -the -door -swung -open -and -i -caught -the -flash -of -a -red -fez -and -heard -these -words -reverently -said -satan -see -god -out -yes -and -these -mis -mated -beings -passed -from -view -satan -in -the -lead -and -the -other -following -after -chapter -xl -few -of -us -can -stand -prosperity -another -man's -i -mean -pudd'nhead -wilson's -new -calendar -the -next -picture -in -my -mind -is -government -house -on -malabar -point -with -the -wide -sea -view -from -the -windows -and -broad -balconies -abode -of -his -excellency -the -governor -of -the -bombay -presidency -a -residence -which -is -european -in -everything -but -the -native -guards -and -servants -and -is -a -home -and -a -palace -of -state -harmoniously -combined -that -was -england -the -english -power -the -english -civilization -the -modern -civilization -with -the -quiet -elegancies -and -quiet -colors -and -quiet -tastes -and -quiet -dignity -that -are -the -outcome -of -the -modern -cultivation -and -following -it -came -a -picture -of -the -ancient -civilization -of -india -an -hour -in -the -mansion -of -a -native -prince -kumar -schri -samatsinhji -bahadur -of -the -palitana -state -the -young -lad -his -heir -was -with -the -prince -also -the -lad's -sister -a -wee -brown -sprite -very -pretty -very -serious -very -winning -delicately -moulded -costumed -like -the -daintiest -butterfly -a -dear -little -fairyland -princess -gravely -willing -to -be -friendly -with -the -strangers -but -in -the -beginning -preferring -to -hold -her -father's -hand -until -she -could -take -stock -of -them -and -determine -how -far -they -were -to -be -trusted -she -must -have -been -eight -years -old -so -in -the -natural -indian -order -of -things -she -would -be -a -bride -in -three -or -four -years -from -now -and -then -this -free -contact -with -the -sun -and -the -air -and -the -other -belongings -of -out -door -nature -and -comradeship -with -visiting -male -folk -would -end -and -she -would -shut -herself -up -in -the -zenana -for -life -like -her -mother -and -by -inherited -habit -of -mind -would -be -happy -in -that -seclusion -and -not -look -upon -it -as -an -irksome -restraint -and -a -weary -captivity -the -game -which -the -prince -amuses -his -leisure -with -however -never -mind -it -i -should -never -be -able -to -describe -it -intelligibly -i -tried -to -get -an -idea -of -it -while -my -wife -and -daughter -visited -the -princess -in -the -zenana -a -lady -of -charming -graces -and -a -fluent -speaker -of -english -but -i -did -not -make -it -out -it -is -a -complicated -game -and -i -believe -it -is -said -that -nobody -can -learn -to -play -it -well -but -an -indian -and -i -was -not -able -to -learn -how -to -wind -a -turban -it -seemed -a -simple -art -and -easy -but -that -was -a -deception -it -is -a -piece -of -thin -delicate -stuff -a -foot -wide -or -more -and -forty -or -fifty -feet -long -and -the -exhibitor -of -the -art -takes -one -end -of -it -in -his -hands -and -winds -it -in -and -out -intricately -about -his -head -twisting -it -as -he -goes -and -in -a -minute -or -two -the -thing -is -finished -and -is -neat -and -symmetrical -and -fits -as -snugly -as -a -mould -we -were -interested -in -the -wardrobe -and -the -jewels -and -in -the -silverware -and -its -grace -of -shape -and -beauty -and -delicacy -of -ornamentation -the -silverware -is -kept -locked -up -except -at -meal -times -and -none -but -the -chief -butler -and -the -prince -have -keys -to -the -safe -i -did -not -clearly -understand -why -but -it -was -not -for -the -protection -of -the -silver -it -was -either -to -protect -the -prince -from -the -contamination -which -his -caste -would -suffer -if -the -vessels -were -touched -by -low -caste -hands -or -it -was -to -protect -his -highness -from -poison -possibly -it -was -both -i -believe -a -salaried -taster -has -to -taste -everything -before -the -prince -ventures -it -an -ancient -and -judicious -custom -in -the -east -and -has -thinned -out -the -tasters -a -good -deal -for -of -course -it -is -the -cook -that -puts -the -poison -in -if -i -were -an -indian -prince -i -would -not -go -to -the -expense -of -a -taster -i -would -eat -with -the -cook -ceremonials -are -always -interesting -and -i -noted -that -the -indian -good -morning -is -a -ceremonial -whereas -ours -doesn't -amount -to -that -in -salutation -the -son -reverently -touches -the -father's -forehead -with -a -small -silver -implement -tipped -with -vermillion -paste -which -leaves -a -red -spot -there -and -in -return -the -son -receives -the -father's -blessing -our -good -morning -is -well -enough -for -the -rowdy -west -perhaps -but -would -be -too -brusque -for -the -soft -and -ceremonious -east -after -being -properly -necklaced -according -to -custom -with -great -garlands -made -of -yellow -flowers -and -provided -with -betel -nut -to -chew -this -pleasant -visit -closed -and -we -passed -thence -to -a -scene -of -a -different -sort -from -this -glow -of -color -and -this -sunny -life -to -those -grim -receptacles -of -the -parsee -dead -the -towers -of -silence -there -is -something -stately -about -that -name -and -an -impressiveness -which -sinks -deep -the -hush -of -death -is -in -it -we -have -the -grave -the -tomb -the -mausoleum -god's -acre -the -cemetery -and -association -has -made -them -eloquent -with -solemn -meaning -but -we -have -no -name -that -is -so -majestic -as -that -one -or -lingers -upon -the -ear -with -such -deep -and -haunting -pathos -on -lofty -ground -in -the -midst -of -a -paradise -of -tropical -foliage -and -flowers -remote -from -the -world -and -its -turmoil -and -noise -they -stood -the -towers -of -silence -and -away -below -was -spread -the -wide -groves -of -cocoa -palms -then -the -city -mile -on -mile -then -the -ocean -with -its -fleets -of -creeping -ships -all -steeped -in -a -stillness -as -deep -as -the -hush -that -hallowed -this -high -place -of -the -dead -the -vultures -were -there -they -stood -close -together -in -a -great -circle -all -around -the -rim -of -a -massive -low -tower -waiting -stood -as -motionless -as -sculptured -ornaments -and -indeed -almost -deceived -one -into -the -belief -that -that -was -what -they -were -presently -there -was -a -slight -stir -among -the -score -of -persons -present -and -all -moved -reverently -out -of -the -path -and -ceased -from -talking -a -funeral -procession -entered -the -great -gate -marching -two -and -two -and -moved -silently -by -toward -the -tower -the -corpse -lay -in -a -shallow -shell -and -was -under -cover -of -a -white -cloth -but -was -otherwise -naked -the -bearers -of -the -body -were -separated -by -an -interval -of -thirty -feet -from -the -mourners -they -and -also -the -mourners -were -draped -all -in -pure -white -and -each -couple -of -mourners -was -figuratively -bound -together -by -a -piece -of -white -rope -or -a -handkerchief -though -they -merely -held -the -ends -of -it -in -their -hands -behind -the -procession -followed -a -dog -which -was -led -in -a -leash -when -the -mourners -had -reached -the -neighborhood -of -the -tower -neither -they -nor -any -other -human -being -but -the -bearers -of -the -dead -must -approach -within -thirty -feet -of -it -they -turned -and -went -back -to -one -of -the -prayer -houses -within -the -gates -to -pray -for -the -spirit -of -their -dead -the -bearers -unlocked -the -tower's -sole -door -and -disappeared -from -view -within -in -a -little -while -they -came -out -bringing -the -bier -and -the -white -covering -cloth -and -locked -the -door -again -then -the -ring -of -vultures -rose -flapping -their -wings -and -swooped -down -into -the -tower -to -devour -the -body -nothing -was -left -of -it -but -a -clean -picked -skeleton -when -they -flocked -out -again -a -few -minutes -afterward -the -principle -which -underlies -and -orders -everything -connected -with -a -parsee -funeral -is -purity -by -the -tenets -of -the -zoroastrian -religion -the -elements -earth -fire -and -water -are -sacred -and -must -not -be -contaminated -by -contact -with -a -dead -body -hence -corpses -must -not -be -burned -neither -must -they -be -buried -none -may -touch -the -dead -or -enter -the -towers -where -they -repose -except -certain -men -who -are -officially -appointed -for -that -purpose -they -receive -high -pay -but -theirs -is -a -dismal -life -for -they -must -live -apart -from -their -species -because -their -commerce -with -the -dead -defiles -them -and -any -who -should -associate -with -them -would -share -their -defilement -when -they -come -out -of -the -tower -the -clothes -they -are -wearing -are -exchanged -for -others -in -a -building -within -the -grounds -and -the -ones -which -they -have -taken -off -are -left -behind -for -they -are -contaminated -and -must -never -be -used -again -or -suffered -to -go -outside -the -grounds -these -bearers -come -to -every -funeral -in -new -garments -so -far -as -is -known -no -human -being -other -than -an -official -corpse -bearer -save -one -has -ever -entered -a -tower -of -silence -after -its -consecration -just -a -hundred -years -ago -a -european -rushed -in -behind -the -bearers -and -fed -his -brutal -curiosity -with -a -glimpse -of -the -forbidden -mysteries -of -the -place -this -shabby -savage's -name -is -not -given -his -quality -is -also -concealed -these -two -details -taken -in -connection -with -the -fact -that -for -his -extraordinary -offense -the -only -punishment -he -got -from -the -east -india -company's -government -was -a -solemn -official -reprimand -suggest -the -suspicion -that -he -was -a -european -of -consequence -the -same -public -document -which -contained -the -reprimand -gave -warning -that -future -offenders -of -his -sort -if -in -the -company's -service -would -be -dismissed -and -if -merchants -suffer -revocation -of -license -and -exile -to -england -the -towers -are -not -tall -but -are -low -in -proportion -to -their -circumference -like -a -gasometer -if -you -should -fill -a -gasometer -half -way -up -with -solid -granite -masonry -then -drive -a -wide -and -deep -well -down -through -the -center -of -this -mass -of -masonry -you -would -have -the -idea -of -a -tower -of -silence -on -the -masonry -surrounding -the -well -the -bodies -lie -in -shallow -trenches -which -radiate -like -wheel -spokes -from -the -well -the -trenches -slant -toward -the -well -and -carry -into -it -the -rainfall -underground -drains -with -charcoal -filters -in -them -carry -off -this -water -from -the -bottom -of -the -well -when -a -skeleton -has -lain -in -the -tower -exposed -to -the -rain -and -the -flaming -sun -a -month -it -is -perfectly -dry -and -clean -then -the -same -bearers -that -brought -it -there -come -gloved -and -take -it -up -with -tongs -and -throw -it -into -the -well -there -it -turns -to -dust -it -is -never -seen -again -never -touched -again -in -the -world -other -peoples -separate -their -dead -and -preserve -and -continue -social -distinctions -in -the -grave -the -skeletons -of -kings -and -statesmen -and -generals -in -temples -and -pantheons -proper -to -skeletons -of -their -degree -and -the -skeletons -of -the -commonplace -and -the -poor -in -places -suited -to -their -meaner -estate -but -the -parsees -hold -that -all -men -rank -alike -in -death -all -are -humble -all -poor -all -destitute -in -sign -of -their -poverty -they -are -sent -to -their -grave -naked -in -sign -of -their -equality -the -bones -of -the -rich -the -poor -the -illustrious -and -the -obscure -are -flung -into -the -common -well -together -at -a -parsee -funeral -there -are -no -vehicles -all -concerned -must -walk -both -rich -and -poor -howsoever -great -the -distance -to -be -traversed -may -be -in -the -wells -of -the -five -towers -of -silence -is -mingled -the -dust -of -all -the -parsee -men -and -women -and -children -who -have -died -in -bombay -and -its -vicinity -during -the -two -centuries -which -have -elapsed -since -the -mohammedan -conquerors -drove -the -parsees -out -of -persia -and -into -that -region -of -india -the -earliest -of -the -five -towers -was -built -by -the -modi -family -something -more -than -200 -years -ago -and -it -is -now -reserved -to -the -heirs -of -that -house -none -but -the -dead -of -that -blood -are -carried -thither -the -origin -of -at -least -one -of -the -details -of -a -parsee -funeral -is -not -now -known -the -presence -of -the -dog -before -a -corpse -is -borne -from -the -house -of -mourning -it -must -be -uncovered -and -exposed -to -the -gaze -of -a -dog -a -dog -must -also -be -led -in -the -rear -of -the -funeral -mr -nusserwanjee -byranijee -secretary -to -the -parsee -punchayet -said -that -these -formalities -had -once -had -a -meaning -and -a -reason -for -their -institution -but -that -they -were -survivals -whose -origin -none -could -now -account -for -custom -and -tradition -continue -them -in -force -antiquity -hallows -them -it -is -thought -that -in -ancient -times -in -persia -the -dog -was -a -sacred -animal -and -could -guide -souls -to -heaven -also -that -his -eye -had -the -power -of -purifying -objects -which -had -been -contaminated -by -the -touch -of -the -dead -and -that -hence -his -presence -with -the -funeral -cortege -provides -an -ever -applicable -remedy -in -case -of -need -the -parsees -claim -that -their -method -of -disposing -of -the -dead -is -an -effective -protection -of -the -living -that -it -disseminates -no -corruption -no -impurities -of -any -sort -no -disease -germs -that -no -wrap -no -garment -which -has -touched -the -dead -is -allowed -to -touch -the -living -afterward -that -from -the -towers -of -silence -nothing -proceeds -which -can -carry -harm -to -the -outside -world -these -are -just -claims -i -think -as -a -sanitary -measure -their -system -seems -to -be -about -the -equivalent -of -cremation -and -as -sure -we -are -drifting -slowly -but -hopefully -toward -cremation -in -these -days -it -could -not -be -expected -that -this -progress -should -be -swift -but -if -it -be -steady -and -continuous -even -if -slow -that -will -suffice -when -cremation -becomes -the -rule -we -shall -cease -to -shudder -at -it -we -should -shudder -at -burial -if -we -allowed -ourselves -to -think -what -goes -on -in -the -grave -the -dog -was -an -impressive -figure -to -me -representing -as -he -did -a -mystery -whose -key -is -lost -he -was -humble -and -apparently -depressed -and -he -let -his -head -droop -pensively -and -looked -as -if -he -might -be -trying -to -call -back -to -his -mind -what -it -was -that -he -had -used -to -symbolize -ages -ago -when -he -began -his -function -there -was -another -impressive -thing -close -at -hand -but -i -was -not -privileged -to -see -it -that -was -the -sacred -fire -a -fire -which -is -supposed -to -have -been -burning -without -interruption -for -more -than -two -centuries -and -so -living -by -the -same -heat -that -was -imparted -to -it -so -long -ago -the -parsees -are -a -remarkable -community -there -are -only -about -60 -000 -in -bombay -and -only -about -half -as -many -as -that -in -the -rest -of -india -but -they -make -up -in -importance -what -they -lack -in -numbers -they -are -highly -educated -energetic -enterprising -progressive -rich -and -the -jew -himself -is -not -more -lavish -or -catholic -in -his -charities -and -benevolences -the -parsees -build -and -endow -hospitals -for -both -men -and -animals -and -they -and -their -womenkind -keep -an -open -purse -for -all -great -and -good -objects -they -are -a -political -force -and -a -valued -support -to -the -government -they -have -a -pure -and -lofty -religion -and -they -preserve -it -in -its -integrity -and -order -their -lives -by -it -we -took -a -final -sweep -of -the -wonderful -view -of -plain -and -city -and -ocean -and -so -ended -our -visit -to -the -garden -and -the -towers -of -silence -and -the -last -thing -i -noticed -was -another -symbol -a -voluntary -symbol -this -one -it -was -a -vulture -standing -on -the -sawed -off -top -of -a -tall -and -slender -and -branchless -palm -in -an -open -space -in -the -ground -he -was -perfectly -motionless -and -looked -like -a -piece -of -sculpture -on -a -pillar -and -he -had -a -mortuary -look -too -which -was -in -keeping -with -the -place -chapter -xli -there -is -an -old -time -toast -which -is -golden -for -its -beauty -when -you -ascend -the -hill -of -prosperity -may -you -not -meet -a -friend -pudd'nhead -wilson's -new -calendar -the -next -picture -that -drifts -across -the -field -of -my -memory -is -one -which -is -connected -with -religious -things -we -were -taken -by -friends -to -see -a -jain -temple -it -was -small -and -had -many -flags -or -streamers -flying -from -poles -standing -above -its -roof -and -its -little -battlements -supported -a -great -many -small -idols -or -images -upstairs -inside -a -solitary -jain -was -praying -or -reciting -aloud -in -the -middle -of -the -room -our -presence -did -not -interrupt -him -nor -even -incommode -him -or -modify -his -fervor -ten -or -twelve -feet -in -front -of -him -was -the -idol -a -small -figure -in -a -sitting -posture -it -had -the -pinkish -look -of -a -wax -doll -but -lacked -the -doll's -roundness -of -limb -and -approximation -to -correctness -of -form -and -justness -of -proportion -mr -gandhi -explained -every -thing -to -us -he -was -delegate -to -the -chicago -fair -congress -of -religions -it -was -lucidly -done -in -masterly -english -but -in -time -it -faded -from -me -and -now -i -have -nothing -left -of -that -episode -but -an -impression -a -dim -idea -of -a -religious -belief -clothed -in -subtle -intellectual -forms -lofty -and -clean -barren -of -fleshly -grossnesses -and -with -this -another -dim -impression -which -connects -that -intellectual -system -somehow -with -that -crude -image -that -inadequate -idol -how -i -do -not -know -properly -they -do -not -seem -to -belong -together -apparently -the -idol -symbolized -a -person -who -had -become -a -saint -or -a -god -through -accessions -of -steadily -augmenting -holiness -acquired -through -a -series -of -reincarnations -and -promotions -extending -over -many -ages -and -was -now -at -last -a -saint -and -qualified -to -vicariously -receive -worship -and -transmit -it -to -heaven's -chancellery -was -that -it -and -thence -we -went -to -mr -premchand -roychand's -bungalow -in -lovelane -byculla -where -an -indian -prince -was -to -receive -a -deputation -of -the -jain -community -who -desired -to -congratulate -him -upon -a -high -honor -lately -conferred -upon -him -by -his -sovereign -victoria -empress -of -india -she -had -made -him -a -knight -of -the -order -of -the -star -of -india -it -would -seem -that -even -the -grandest -indian -prince -is -glad -to -add -the -modest -title -sir -to -his -ancient -native -grandeurs -and -is -willing -to -do -valuable -service -to -win -it -he -will -remit -taxes -liberally -and -will -spend -money -freely -upon -the -betterment -of -the -condition -of -his -subjects -if -there -is -a -knighthood -to -be -gotten -by -it -and -he -will -also -do -good -work -and -a -deal -of -it -to -get -a -gun -added -to -the -salute -allowed -him -by -the -british -government -every -year -the -empress -distributes -knighthoods -and -adds -guns -for -public -services -done -by -native -princes -the -salute -of -a -small -prince -is -three -or -four -guns -princes -of -greater -consequence -have -salutes -that -run -higher -and -higher -gun -by -gun -oh -clear -away -up -to -eleven -possibly -more -but -i -did -not -hear -of -any -above -eleven -gun -princes -i -was -told -that -when -a -four -gun -prince -gets -a -gun -added -he -is -pretty -troublesome -for -a -while -till -the -novelty -wears -off -for -he -likes -the -music -and -keeps -hunting -up -pretexts -to -get -himself -saluted -it -may -be -that -supremely -grand -folk -like -the -nyzam -of -hyderabad -and -the -gaikwar -of -baroda -have -more -than -eleven -guns -but -i -don't -know -when -we -arrived -at -the -bungalow -the -large -hall -on -the -ground -floor -was -already -about -full -and -carriages -were -still -flowing -into -the -grounds -the -company -present -made -a -fine -show -an -exhibition -of -human -fireworks -so -to -speak -in -the -matters -of -costume -and -comminglings -of -brilliant -color -the -variety -of -form -noticeable -in -the -display -of -turbans -was -remarkable -we -were -told -that -the -explanation -of -this -was -that -this -jain -delegation -was -drawn -from -many -parts -of -india -and -that -each -man -wore -the -turban -that -was -in -vogue -in -his -own -region -this -diversity -of -turbans -made -a -beautiful -effect -i -could -have -wished -to -start -a -rival -exhibition -there -of -christian -hats -and -clothes -i -would -have -cleared -one -side -of -the -room -of -its -indian -splendors -and -repacked -the -space -with -christians -drawn -from -america -england -and -the -colonies -dressed -in -the -hats -and -habits -of -now -and -of -twenty -and -forty -and -fifty -years -ago -it -would -have -been -a -hideous -exhibition -a -thoroughly -devilish -spectacle -then -there -would -have -been -the -added -disadvantage -of -the -white -complexion -it -is -not -an -unbearably -unpleasant -complexion -when -it -keeps -to -itself -but -when -it -comes -into -competition -with -masses -of -brown -and -black -the -fact -is -betrayed -that -it -is -endurable -only -because -we -are -used -to -it -nearly -all -black -and -brown -skins -are -beautiful -but -a -beautiful -white -skin -is -rare -how -rare -one -may -learn -by -walking -down -a -street -in -paris -new -york -or -london -on -a -week -day -particularly -an -unfashionable -street -and -keeping -count -of -the -satisfactory -complexions -encountered -in -the -course -of -a -mile -where -dark -complexions -are -massed -they -make -the -whites -look -bleached -out -unwholesome -and -sometimes -frankly -ghastly -i -could -notice -this -as -a -boy -down -south -in -the -slavery -days -before -the -war -the -splendid -black -satin -skin -of -the -south -african -zulus -of -durban -seemed -to -me -to -come -very -close -to -perfection -i -can -see -those -zulus -yet -'ricksha -athletes -waiting -in -front -of -the -hotel -for -custom -handsome -and -intensely -black -creatures -moderately -clothed -in -loose -summer -stuffs -whose -snowy -whiteness -made -the -black -all -the -blacker -by -contrast -keeping -that -group -in -my -mind -i -can -compare -those -complexions -with -the -white -ones -which -are -streaming -past -this -london -window -now -a -lady -complexion -new -parchment -another -lady -complexion -old -parchment -another -pink -and -white -very -fine -man -grayish -skin -with -purple -areas -man -unwholesome -fish -belly -skin -girl -sallow -face -sprinkled -with -freckles -old -woman -face -whitey -gray -young -butcher -face -a -general -red -flush -jaundiced -man -mustard -yellow -elderly -lady -colorless -skin -with -two -conspicuous -moles -elderly -man -a -drinker -boiled -cauliflower -nose -in -a -flabby -face -veined -with -purple -crinklings -healthy -young -gentleman -fine -fresh -complexion -sick -young -man -his -face -a -ghastly -white -no -end -of -people -whose -skins -are -dull -and -characterless -modifications -of -the -tint -which -we -miscall -white -some -of -these -faces -are -pimply -some -exhibit -other -signs -of -diseased -blood -some -show -scars -of -a -tint -out -of -a -harmony -with -the -surrounding -shades -of -color -the -white -man's -complexion -makes -no -concealments -it -can't -it -seemed -to -have -been -designed -as -a -catch -all -for -everything -that -can -damage -it -ladies -have -to -paint -it -and -powder -it -and -cosmetic -it -and -diet -it -with -arsenic -and -enamel -it -and -be -always -enticing -it -and -persuading -it -and -pestering -it -and -fussing -at -it -to -make -it -beautiful -and -they -do -not -succeed -but -these -efforts -show -what -they -think -of -the -natural -complexion -as -distributed -as -distributed -it -needs -these -helps -the -complexion -which -they -try -to -counterfeit -is -one -which -nature -restricts -to -the -few -to -the -very -few -to -ninety -nine -persons -she -gives -a -bad -complexion -to -the -hundredth -a -good -one -the -hundredth -can -keep -it -how -long -ten -years -perhaps -the -advantage -is -with -the -zulu -i -think -he -starts -with -a -beautiful -complexion -and -it -will -last -him -through -and -as -for -the -indian -brown -firm -smooth -blemishless -pleasant -and -restful -to -the -eye -afraid -of -no -color -harmonizing -with -all -colors -and -adding -a -grace -to -them -all -i -think -there -is -no -sort -of -chance -for -the -average -white -complexion -against -that -rich -and -perfect -tint -to -return -to -the -bungalow -the -most -gorgeous -costume -present -were -worn -by -some -children -they -seemed -to -blaze -so -bright -were -the -colors -and -so -brilliant -the -jewels -strum -over -the -rich -materials -these -children -were -professional -nautch -dancers -and -looked -like -girls -but -they -were -boys -they -got -up -by -ones -and -twos -and -fours -and -danced -and -sang -to -an -accompaniment -of -weird -music -their -posturings -and -gesturings -were -elaborate -and -graceful -but -their -voices -were -stringently -raspy -and -unpleasant -and -there -was -a -good -deal -of -monotony -about -the -tune -by -and -by -there -was -a -burst -of -shouts -and -cheers -outside -and -the -prince -with -his -train -entered -in -fine -dramatic -style -he -was -a -stately -man -he -was -ideally -costumed -and -fairly -festooned -with -ropes -of -gems -some -of -the -ropes -were -of -pearls -some -were -of -uncut -great -emeralds -emeralds -renowned -in -bombay -for -their -quality -and -value -their -size -was -marvelous -and -enticing -to -the -eye -those -rocks -a -boy -a -princeling -was -with -the -prince -and -he -also -was -a -radiant -exhibition -the -ceremonies -were -not -tedious -the -prince -strode -to -his -throne -with -the -port -and -majesty -and -the -sternness -of -a -julius -caesar -coming -to -receive -and -receipt -for -a -back -country -kingdom -and -have -it -over -and -get -out -and -no -fooling -there -was -a -throne -for -the -young -prince -too -and -the -two -sat -there -side -by -side -with -their -officers -grouped -at -either -hand -and -most -accurately -and -creditably -reproducing -the -pictures -which -one -sees -in -the -books -pictures -which -people -in -the -prince's -line -of -business -have -been -furnishing -ever -since -solomon -received -the -queen -of -sheba -and -showed -her -his -things -the -chief -of -the -jain -delegation -read -his -paper -of -congratulations -then -pushed -it -into -a -beautifully -engraved -silver -cylinder -which -was -delivered -with -ceremony -into -the -prince's -hands -and -at -once -delivered -by -him -without -ceremony -into -the -hands -of -an -officer -i -will -copy -the -address -here -it -is -interesting -as -showing -what -an -indian -prince's -subject -may -have -opportunity -to -thank -him -for -in -these -days -of -modern -english -rule -as -contrasted -with -what -his -ancestor -would -have -given -them -opportunity -to -thank -him -for -a -century -and -a -half -ago -the -days -of -freedom -unhampered -by -english -interference -a -century -and -a -half -ago -an -address -of -thanks -could -have -been -put -into -small -space -it -would -have -thanked -the -prince -1 -for -not -slaughtering -too -many -of -his -people -upon -mere -caprice -2 -for -not -stripping -them -bare -by -sudden -and -arbitrary -tax -levies -and -bringing -famine -upon -them -3 -for -not -upon -empty -pretext -destroying -the -rich -and -seizing -their -property -4 -for -not -killing -blinding -imprisoning -or -banishing -the -relatives -of -the -royal -house -to -protect -the -throne -from -possible -plots -5 -for -not -betraying -the -subject -secretly -for -a -bribe -into -the -hands -of -bands -of -professional -thugs -to -be -murdered -and -robbed -in -the -prince's -back -lot -those -were -rather -common -princely -industries -in -the -old -times -but -they -and -some -others -of -a -harsh -sort -ceased -long -ago -under -english -rule -better -industries -have -taken -their -place -as -this -address -from -the -jain -community -will -show -your -highness -we -the -undersigned -members -of -the -jain -community -of -bombay -have -the -pleasure -to -approach -your -highness -with -the -expression -of -our -heartfelt -congratulations -on -the -recent -conference -on -your -highness -of -the -knighthood -of -the -most -exalted -order -of -the -star -of -india -ten -years -ago -we -had -the -pleasure -and -privilege -of -welcoming -your -highness -to -this -city -under -circumstances -which -have -made -a -memorable -epoch -in -the -history -of -your -state -for -had -it -not -been -for -a -generous -and -reasonable -spirit -that -your -highness -displayed -in -the -negotiations -between -the -palitana -durbar -and -the -jain -community -the -conciliatory -spirit -that -animated -our -people -could -not -have -borne -fruit -that -was -the -first -step -in -your -highness's -administration -and -it -fitly -elicited -the -praise -of -the -jain -community -and -of -the -bombay -government -a -decade -of -your -highness's -administration -combined -with -the -abilities -training -and -acquirements -that -your -highness -brought -to -bear -upon -it -has -justly -earned -for -your -highness -the -unique -and -honourable -distinction -the -knighthood -of -the -most -exalted -order -of -the -star -of -india -which -we -understand -your -highness -is -the -first -to -enjoy -among -chiefs -of -your -highness's -rank -and -standing -and -we -assure -your -highness -that -for -this -mark -of -honour -that -has -been -conferred -on -you -by -her -most -gracious -majesty -the -queen -empress -we -feel -no -less -proud -than -your -highness -establishment -of -commercial -factories -schools -hospitals -etc -by -your -highness -in -your -state -has -marked -your -highness's -career -during -these -ten -years -and -we -trust -that -your -highness -will -be -spared -to -rule -over -your -people -with -wisdom -and -foresight -and -foster -the -many -reforms -that -your -highness -has -been -pleased -to -introduce -in -your -state -we -again -offer -your -highness -our -warmest -felicitations -for -the -honour -that -has -been -conferred -on -you -we -beg -to -remain -your -highness's -obedient -servants -factories -schools -hospitals -reforms -the -prince -propagates -that -kind -of -things -in -the -modern -times -and -gets -knighthood -and -guns -for -it -after -the -address -the -prince -responded -with -snap -and -brevity -spoke -a -moment -with -half -a -dozen -guests -in -english -and -with -an -official -or -two -in -a -native -tongue -then -the -garlands -were -distributed -as -usual -and -the -function -ended -chapter -xlii -each -person -is -born -to -one -possession -which -outvalues -all -his -others -his -last -breath -pudd'nhead -wilson's -new -calendar -toward -midnight -that -night -there -was -another -function -this -was -a -hindoo -wedding -no -i -think -it -was -a -betrothal -ceremony -always -before -we -had -driven -through -streets -that -were -multitudinous -and -tumultuous -with -picturesque -native -life -but -now -there -was -nothing -of -that -we -seemed -to -move -through -a -city -of -the -dead -there -was -hardly -a -suggestion -of -life -in -those -still -and -vacant -streets -even -the -crows -were -silent -but -everywhere -on -the -ground -lay -sleeping -natives -hundreds -and -hundreds -they -lay -stretched -at -full -length -and -tightly -wrapped -in -blankets -beads -and -all -their -attitude -and -their -rigidity -counterfeited -death -the -plague -was -not -in -bombay -then -but -it -is -devastating -the -city -now -the -shops -are -deserted -now -half -of -the -people -have -fled -and -of -the -remainder -the -smitten -perish -by -shoals -every -day -no -doubt -the -city -looks -now -in -the -daytime -as -it -looked -then -at -night -when -we -had -pierced -deep -into -the -native -quarter -and -were -threading -its -narrow -dim -lanes -we -had -to -go -carefully -for -men -were -stretched -asleep -all -about -and -there -was -hardly -room -to -drive -between -them -and -every -now -and -then -a -swarm -of -rats -would -scamper -across -past -the -horses' -feet -in -the -vague -light -the -forbears -of -the -rats -that -are -carrying -the -plague -from -house -to -house -in -bombay -now -the -shops -were -but -sheds -little -booths -open -to -the -street -and -the -goods -had -been -removed -and -on -the -counters -families -were -sleeping -usually -with -an -oil -lamp -present -recurrent -dead -watches -it -looked -like -but -at -last -we -turned -a -corner -and -saw -a -great -glare -of -light -ahead -it -was -the -home -of -the -bride -wrapped -in -a -perfect -conflagration -of -illuminations -mainly -gas -work -designs -gotten -up -specially -for -the -occasion -within -was -abundance -of -brilliancy -flames -costumes -colors -decorations -mirrors -it -was -another -aladdin -show -the -bride -was -a -trim -and -comely -little -thing -of -twelve -years -dressed -as -we -would -dress -a -boy -though -more -expensively -than -we -should -do -it -of -course -she -moved -about -very -much -at -her -ease -and -stopped -and -talked -with -the -guests -and -allowed -her -wedding -jewelry -to -be -examined -it -was -very -fine -particularly -a -rope -of -great -diamonds -a -lovely -thing -to -look -at -and -handle -it -had -a -great -emerald -hanging -to -it -the -bridegroom -was -not -present -he -was -having -betrothal -festivities -of -his -own -at -his -father's -house -as -i -understood -it -he -and -the -bride -were -to -entertain -company -every -night -and -nearly -all -night -for -a -week -or -more -then -get -married -if -alive -both -of -the -children -were -a -little -elderly -as -brides -and -grooms -go -in -india -twelve -they -ought -to -have -been -married -a -year -or -two -sooner -still -to -a -stranger -twelve -seems -quite -young -enough -a -while -after -midnight -a -couple -of -celebrated -and -high -priced -nautch -girls -appeared -in -the -gorgeous -place -and -danced -and -sang -with -them -were -men -who -played -upon -strange -instruments -which -made -uncanny -noises -of -a -sort -to -make -one's -flesh -creep -one -of -these -instruments -was -a -pipe -and -to -its -music -the -girls -went -through -a -performance -which -represented -snake -charming -it -seemed -a -doubtful -sort -of -music -to -charm -anything -with -but -a -native -gentleman -assured -me -that -snakes -like -it -and -will -come -out -of -their -holes -and -listen -to -it -with -every -evidence -of -refreshment -and -gratitude -he -said -that -at -an -entertainment -in -his -grounds -once -the -pipe -brought -out -half -a -dozen -snakes -and -the -music -had -to -be -stopped -before -they -would -be -persuaded -to -go -nobody -wanted -their -company -for -they -were -bold -familiar -and -dangerous -but -no -one -would -kill -them -of -course -for -it -is -sinful -for -a -hindoo -to -kill -any -kind -of -a -creature -we -withdrew -from -the -festivities -at -two -in -the -morning -another -picture -then -but -it -has -lodged -itself -in -my -memory -rather -as -a -stage -scene -than -as -a -reality -it -is -of -a -porch -and -short -flight -of -steps -crowded -with -dark -faces -and -ghostly -white -draperies -flooded -with -the -strong -glare -from -the -dazzling -concentration -of -illuminations -and -midway -of -the -steps -one -conspicuous -figure -for -accent -a -turbaned -giant -with -a -name -according -to -his -size -rao -bahadur -baskirao -balinkanje -pitale -vakeel -to -his -highness -the -gaikwar -of -baroda -without -him -the -picture -would -not -have -been -complete -and -if -his -name -had -been -merely -smith -he -wouldn't -have -answered -close -at -hand -on -house -fronts -on -both -sides -of -the -narrow -street -were -illuminations -of -a -kind -commonly -employed -by -the -natives -scores -of -glass -tumblers -containing -tapers -fastened -a -few -in -inches -apart -all -over -great -latticed -frames -forming -starry -constellations -which -showed -out -vividly -against -their -black -back -grounds -as -we -drew -away -into -the -distance -down -the -dim -lanes -the -illuminations -gathered -together -into -a -single -mass -and -glowed -out -of -the -enveloping -darkness -like -a -sun -then -again -the -deep -silence -the -skurrying -rats -the -dim -forms -stretched -every -where -on -the -ground -and -on -either -hand -those -open -booths -counterfeiting -sepulchres -with -counterfeit -corpses -sleeping -motionless -in -the -flicker -of -the -counterfeit -death -lamps -and -now -a -year -later -when -i -read -the -cablegrams -i -seem -to -be -reading -of -what -i -myself -partly -saw -saw -before -it -happened -in -a -prophetic -dream -as -it -were -one -cablegram -says -business -in -the -native -town -is -about -suspended -except -the -wailing -and -the -tramp -of -the -funerals -there -is -but -little -life -or -movement -the -closed -shops -exceed -in -number -those -that -remain -open -another -says -that -325 -000 -of -the -people -have -fled -the -city -and -are -carrying -the -plague -to -the -country -three -days -later -comes -the -news -the -population -is -reduced -by -half -the -refugees -have -carried -the -disease -to -karachi -220 -cases -214 -deaths -a -day -or -two -later -52 -fresh -cases -all -of -which -proved -fatal -the -plague -carries -with -it -a -terror -which -no -other -disease -can -excite -for -of -all -diseases -known -to -men -it -is -the -deadliest -by -far -the -deadliest -fifty -two -fresh -cases -all -fatal -it -is -the -black -death -alone -that -slays -like -that -we -can -all -imagine -after -a -fashion -the -desolation -of -a -plague -stricken -city -and -the -stupor -of -stillness -broken -at -intervals -by -distant -bursts -of -wailing -marking -the -passing -of -funerals -here -and -there -and -yonder -but -i -suppose -it -is -not -possible -for -us -to -realize -to -ourselves -the -nightmare -of -dread -and -fear -that -possesses -the -living -who -are -present -in -such -a -place -and -cannot -get -away -that -half -million -fled -from -bombay -in -a -wild -panic -suggests -to -us -something -of -what -they -were -feeling -but -perhaps -not -even -they -could -realize -what -the -half -million -were -feeling -whom -they -left -stranded -behind -to -face -the -stalking -horror -without -chance -of -escape -kinglake -was -in -cairo -many -years -ago -during -an -epidemic -of -the -black -death -and -he -has -imagined -the -terrors -that -creep -into -a -man's -heart -at -such -a -time -and -follow -him -until -they -themselves -breed -the -fatal -sign -in -the -armpit -and -then -the -delirium -with -confused -images -and -home -dreams -and -reeling -billiard -tables -and -then -the -sudden -blank -of -death -to -the -contagionist -filled -as -he -is -with -the -dread -of -final -causes -having -no -faith -in -destiny -nor -in -the -fixed -will -of -god -and -with -none -of -the -devil -may -care -indifference -which -might -stand -him -instead -of -creeds -to -such -one -every -rag -that -shivers -in -the -breeze -of -a -plague -stricken -city -has -this -sort -of -sublimity -if -by -any -terrible -ordinance -he -be -forced -to -venture -forth -be -sees -death -dangling -from -every -sleeve -and -as -he -creeps -forward -he -poises -his -shuddering -limbs -between -the -imminent -jacket -that -is -stabbing -at -his -right -elbow -and -the -murderous -pelisse -that -threatens -to -mow -him -clean -down -as -it -sweeps -along -on -his -left -but -most -of -all -he -dreads -that -which -most -of -all -he -should -love -the -touch -of -a -woman's -dress -for -mothers -and -wives -hurrying -forth -on -kindly -errands -from -the -bedsides -of -the -dying -go -slouching -along -through -the -streets -more -willfully -and -less -courteously -than -the -men -for -a -while -it -may -be -that -the -caution -of -the -poor -levantine -may -enable -him -to -avoid -contact -but -sooner -or -later -perhaps -the -dreaded -chance -arrives -that -bundle -of -linen -with -the -dark -tearful -eyes -at -the -top -of -it -that -labors -along -with -the -voluptuous -clumsiness -of -grisi -she -has -touched -the -poor -levantine -with -the -hem -of -her -sleeve! -from -that -dread -moment -his -peace -is -gone -his -mind -for -ever -hanging -upon -the -fatal -touch -invites -the -blow -which -he -fears -he -watches -for -the -symptoms -of -plague -so -carefully -that -sooner -or -later -they -come -in -truth -the -parched -mouth -is -a -sign -his -mouth -is -parched -the -throbbing -brain -his -brain -does -throb -the -rapid -pulse -he -touches -his -own -wrist -for -he -dares -not -ask -counsel -of -any -man -lest -he -be -deserted -he -touches -his -wrist -and -feels -how -his -frighted -blood -goes -galloping -out -of -his -heart -there -is -nothing -but -the -fatal -swelling -that -is -wanting -to -make -his -sad -conviction -complete -immediately -he -has -an -odd -feel -under -the -arm -no -pain -but -a -little -straining -of -the -skin -he -would -to -god -it -were -his -fancy -that -were -strong -enough -to -give -him -that -sensation -this -is -the -worst -of -all -it -now -seems -to -him -that -he -could -be -happy -and -contented -with -his -parched -mouth -and -his -throbbing -brain -and -his -rapid -pulse -if -only -he -could -know -that -there -were -no -swelling -under -the -left -arm -but -dares -he -try -in -a -moment -of -calmness -and -deliberation -he -dares -not -but -when -for -a -while -he -has -writhed -under -the -torture -of -suspense -a -sudden -strength -of -will -drives -him -to -seek -and -know -his -fate -he -touches -the -gland -and -finds -the -skin -sane -and -sound -but -under -the -cuticle -there -lies -a -small -lump -like -a -pistol -bullet -that -moves -as -he -pushes -it -oh! -but -is -this -for -all -certainty -is -this -the -sentence -of -death -feel -the -gland -of -the -other -arm -there -is -not -the -same -lump -exactly -yet -something -a -little -like -it -have -not -some -people -glands -naturally -enlarged -would -to -heaven -he -were -one! -so -he -does -for -himself -the -work -of -the -plague -and -when -the -angel -of -death -thus -courted -does -indeed -and -in -truth -come -he -has -only -to -finish -that -which -has -been -so -well -begun -he -passes -his -fiery -hand -over -the -brain -of -the -victim -and -lets -him -rave -for -a -season -but -all -chance -wise -of -people -and -things -once -dear -or -of -people -and -things -indifferent -once -more -the -poor -fellow -is -back -at -his -home -in -fair -provence -and -sees -the -sundial -that -stood -in -his -childhood's -garden -sees -his -mother -and -the -long -since -forgotten -face -of -that -little -dear -sister -he -sees -her -he -says -on -a -sunday -morning -for -all -the -church -bells -are -ringing -he -looks -up -and -down -through -the -universe -and -owns -it -well -piled -with -bales -upon -bales -of -cotton -and -cotton -eternal -so -much -so -that -he -feels -he -knows -he -swears -he -could -make -that -winning -hazard -if -the -billiard -table -would -not -slant -upwards -and -if -the -cue -were -a -cue -worth -playing -with -but -it -is -not -it's -a -cue -that -won't -move -his -own -arm -won't -move -in -short -there's -the -devil -to -pay -in -the -brain -of -the -poor -levantine -and -perhaps -the -next -night -but -one -he -becomes -the -'life -and -the -soul' -of -some -squalling -jackal -family -who -fish -him -out -by -the -foot -from -his -shallow -and -sandy -grave -chapter -xliii -hunger -is -the -handmaid -of -genius -pudd'nhead -wilson's -new -calendar -one -day -during -our -stay -in -bombay -there -was -a -criminal -trial -of -a -most -interesting -sort -a -terribly -realistic -chapter -out -of -the -arabian -nights -a -strange -mixture -of -simplicities -and -pieties -and -murderous -practicalities -which -brought -back -the -forgotten -days -of -thuggee -and -made -them -live -again -in -fact -even -made -them -believable -it -was -a -case -where -a -young -girl -had -been -assassinated -for -the -sake -of -her -trifling -ornaments -things -not -worth -a -laborer's -day's -wages -in -america -this -thing -could -have -been -done -in -many -other -countries -but -hardly -with -the -cold -business -like -depravity -absence -of -fear -absence -of -caution -destitution -of -the -sense -of -horror -repentance -remorse -exhibited -in -this -case -elsewhere -the -murderer -would -have -done -his -crime -secretly -by -night -and -without -witnesses -his -fears -would -have -allowed -him -no -peace -while -the -dead -body -was -in -his -neighborhood -he -would -not -have -rested -until -he -had -gotten -it -safe -out -of -the -way -and -hidden -as -effectually -as -he -could -hide -it -but -this -indian -murderer -does -his -deed -in -the -full -light -of -day -cares -nothing -for -the -society -of -witnesses -is -in -no -way -incommoded -by -the -presence -of -the -corpse -takes -his -own -time -about -disposing -of -it -and -the -whole -party -are -so -indifferent -so -phlegmatic -that -they -take -their -regular -sleep -as -if -nothing -was -happening -and -no -halters -hanging -over -them -and -these -five -bland -people -close -the -episode -with -a -religious -service -the -thing -reads -like -a -meadows -taylor -thug -tale -of -half -a -century -ago -as -may -be -seen -by -the -official -report -of -the -trial -at -the -mazagon -police -court -yesterday -superintendent -nolan -again -charged -tookaram -suntoo -savat -baya -woman -her -daughter -krishni -and -gopal -yithoo -bhanayker -before -mr -phiroze -hoshang -dastur -fourth -presidency -magistrate -under -sections -302 -and -109 -of -the -code -with -having -on -the -night -of -the -30th -of -december -last -murdered -a -hindoo -girl -named -cassi -aged -12 -by -strangulation -in -the -room -of -a -chawl -at -jakaria -bunder -on -the -sewriroad -and -also -with -aiding -and -abetting -each -other -in -the -commission -of -the -offense -mr -f -a -little -public -prosecutor -conducted -the -case -on -behalf -of -the -crown -the -accused -being -undefended -mr -little -applied -under -the -provisions -of -the -criminal -procedure -code -to -tender -pardon -to -one -of -the -accused -krishni -woman -aged -22 -on -her -undertaking -to -make -a -true -and -full -statement -of -facts -under -which -the -deceased -girl -cassi -was -murdered -the -magistrate -having -granted -the -public -prosecutor's -application -the -accused -krishni -went -into -the -witness -box -and -on -being -examined -by -mr -little -made -the -following -confession -i -am -a -mill -hand -employed -at -the -jubilee -mill -i -recollect -the -day -tuesday -on -which -the -body -of -the -deceased -cassi -was -found -previous -to -that -i -attended -the -mill -for -half -a -day -and -then -returned -home -at -3 -in -the -afternoon -when -i -saw -five -persons -in -the -house -viz -the -first -accused -tookaram -who -is -my -paramour -my -mother -the -second -accused -baya -the -accused -gopal -and -two -guests -named -ramji -daji -and -annaji -gungaram -tookaram -rented -the -room -of -the -chawl -situated -at -jakaria -bunder -road -from -its -owner -girdharilal -radhakishan -and -in -that -room -i -my -paramour -tookaram -and -his -younger -brother -yesso -mahadhoo -live -since -his -arrival -in -bombay -from -his -native -country -yesso -came -and -lived -with -us -when -i -returned -from -the -mill -on -the -afternoon -of -that -day -i -saw -the -two -guests -seated -on -a -cot -in -the -veranda -and -a -few -minutes -after -the -accused -gopal -came -and -took -his -seat -by -their -side -while -i -and -my -mother -were -seated -inside -the -room -tookaram -who -had -gone -out -to -fetch -some -'pan' -and -betelnuts -on -his -return -home -had -brought -the -two -guests -with -him -after -returning -home -he -gave -them -'pan -supari' -while -they -were -eating -it -my -mother -came -out -of -the -room -and -inquired -of -one -of -the -guests -ramji -what -had -happened -to -his -foot -when -he -replied -that -he -had -tried -many -remedies -but -they -had -done -him -no -good -my -mother -then -took -some -rice -in -her -hand -and -prophesied -that -the -disease -which -ramji -was -suffering -from -would -not -be -cured -until -he -returned -to -his -native -country -in -the -meantime -the -deceased -casi -came -from -the -direction -of -an -out -house -and -stood -in -front -on -the -threshold -of -our -room -with -a -'lota' -in -her -hand -tookaram -then -told -his -two -guests -to -leave -the -room -and -they -then -went -up -the -steps -towards -the -quarry -after -the -guests -had -gone -away -tookaram -seized -the -deceased -who -had -come -into -the -room -and -he -afterwards -put -a -waistband -around -her -and -tied -her -to -a -post -which -supports -a -loft -after -doing -this -he -pressed -the -girl's -throat -and -having -tied -her -mouth -with -the -'dhotur' -now -shown -in -court -fastened -it -to -the -post -having -killed -the -girl -tookaram -removed -her -gold -head -ornament -and -a -gold -'putlee' -and -also -took -charge -of -her -'lota' -besides -these -two -ornaments -cassi -had -on -her -person -ear -studs -a -nose -ring -some -silver -toe -rings -two -necklaces -a -pair -of -silver -anklets -and -bracelets -tookaram -afterwards -tried -to -remove -the -silver -amulets -the -ear -studs -and -the -nose -ring -but -he -failed -in -his -attempt -while -he -was -doing -so -i -my -mother -and -gopal -were -present -after -removing -the -two -gold -ornaments -he -handed -them -over -to -gopal -who -was -at -the -time -standing -near -me -when -he -killed -cassi -tookaram -threatened -to -strangle -me -also -if -i -informed -any -one -of -this -gopal -and -myself -were -then -standing -at -the -door -of -our -room -and -we -both -were -threatened -by -tookaram -my -mother -baya -had -seized -the -legs -of -the -deceased -at -the -time -she -was -killed -and -whilst -she -was -being -tied -to -the -post -cassi -then -made -a -noise -tookaram -and -my -mother -took -part -in -killing -the -girl -after -the -murder -her -body -was -wrapped -up -in -a -mattress -and -kept -on -the -loft -over -the -door -of -our -room -when -cassi -was -strangled -the -door -of -the -room -was -fastened -from -the -inside -by -tookaram -this -deed -was -committed -shortly -after -my -return -home -from -work -in -the -mill -tookaram -put -the -body -of -the -deceased -in -the -mattress -and -after -it -was -left -on -the -loft -he -went -to -have -his -head -shaved -by -a -barber -named -sambhoo -raghoo -who -lives -only -one -door -away -from -me -my -mother -and -myself -then -remained -in -the -possession -of -the -information -i -was -slapped -and -threatened -by -my -paramour -tookaram -and -that -was -the -only -reason -why -i -did -not -inform -any -one -at -that -time -when -i -told -tookaram -that -i -would -give -information -of -the -occurrence -he -slapped -me -the -accused -gopal -was -asked -by -tookaram -to -go -back -to -his -room -and -he -did -so -taking -away -with -him -the -two -gold -ornaments -and -the -'lota' -yesso -mahadhoo -a -brother -in -law -of -tookaram -came -to -the -house -and -asked -taokaram -why -he -was -washing -the -water -pipe -being -just -opposite -tookaram -replied -that -he -was -washing -his -dhotur -as -a -fowl -had -polluted -it -about -6 -o'clock -of -the -evening -of -that -day -my -mother -gave -me -three -pice -and -asked -me -to -buy -a -cocoanut -and -i -gave -the -money -to -yessoo -who -went -and -fetched -a -cocoanut -and -some -betel -leaves -when -yessoo -and -others -were -in -the -room -i -was -bathing -and -after -i -finished -my -bath -my -mother -took -the -cocoanut -and -the -betel -leaves -from -yessoo -and -we -five -went -to -the -sea -the -party -consisted -of -tookaram -my -mother -yessoo -tookaram's -younger -brother -and -myself -on -reaching -the -seashore -my -mother -made -the -offering -to -the -sea -and -prayed -to -be -pardoned -for -what -we -had -done -before -we -went -to -the -sea -some -one -came -to -inquire -after -the -girl -cassi -the -police -and -other -people -came -to -make -these -inquiries -both -before -and -after -we -left -the -house -for -the -seashore -the -police -questioned -my -mother -about -the -girl -and -she -replied -that -cassi -had -come -to -her -door -but -had -left -the -next -day -the -police -questioned -tookaram -and -he -too -gave -a -similar -reply -this -was -said -the -same -night -when -the -search -was -made -for -the -girl -after -the -offering -was -made -to -the -sea -we -partook -of -the -cocoanut -and -returned -home -when -my -mother -gave -me -some -food -but -tookaram -did -not -partake -of -any -food -that -night -after -dinner -i -and -my -mother -slept -inside -the -room -and -tookaram -slept -on -a -cot -near -his -brother -in -law -yessoo -mahadhoo -just -outside -the -door -that -was -not -the -usual -place -where -tookaram -slept -he -usually -slept -inside -the -room -the -body -of -the -deceased -remained -on -the -loft -when -i -went -to -sleep -the -room -in -which -we -slept -was -locked -and -i -heard -that -my -paramour -tookaram -was -restless -outside -about -3 -o'clock -the -following -morning -tookaram -knocked -at -the -door -when -both -myself -and -my -mother -opened -it -he -then -told -me -to -go -to -the -steps -leading -to -the -quarry -and -see -if -any -one -was -about -those -steps -lead -to -a -stable -through -which -we -go -to -the -quarry -at -the -back -of -the -compound -when -i -got -to -the -steps -i -saw -no -one -there -tookaram -asked -me -if -any -one -was -there -and -i -replied -that -i -could -see -no -one -about -he -then -took -the -body -of -the -deceased -from -the -loft -and -having -wrapped -it -up -in -his -saree -asked -me -to -accompany -him -to -the -steps -of -the -quarry -and -i -did -so -the -'saree' -now -produced -here -was -the -same -besides -the -'saree' -there -was -also -a -'cholee' -on -the -body -he -then -carried -the -body -in -his -arms -and -went -up -the -steps -through -the -stable -and -then -to -the -right -hand -towards -a -sahib's -bungalow -where -tookaram -placed -the -body -near -a -wall -all -the -time -i -and -my -mother -were -with -him -when -the -body -was -taken -down -yessoo -was -lying -on -the -cot -after -depositing -the -body -under -the -wall -we -all -returned -home -and -soon -after -5 -a -m -the -police -again -came -and -took -tookaram -away -about -an -hour -after -they -returned -and -took -me -and -my -mother -away -we -were -questioned -about -it -when -i -made -a -statement -two -hours -later -i -was -taken -to -the -room -and -i -pointed -out -this -waistband -the -'dhotur' -the -mattress -and -the -wooden -post -to -superintendent -nolan -and -inspectors -roberts -and -rashanali -in -the -presence -of -my -mother -and -tookaram -tookaram -killed -the -girl -cassi -for -her -ornaments -which -he -wanted -for -the -girl -to -whom -he -was -shortly -going -to -be -married -the -body -was -found -in -the -same -place -where -it -was -deposited -by -tookaram -the -criminal -side -of -the -native -has -always -been -picturesque -always -readable -the -thuggee -and -one -or -two -other -particularly -outrageous -features -of -it -have -been -suppressed -by -the -english -but -there -is -enough -of -it -left -to -keep -it -darkly -interesting -one -finds -evidence -of -these -survivals -in -the -newspapers -macaulay -has -a -light -throwing -passage -upon -this -matter -in -his -great -historical -sketch -of -warren -hastings -where -he -is -describing -some -effects -which -followed -the -temporary -paralysis -of -hastings' -powerful -government -brought -about -by -sir -philip -francis -and -his -party -the -natives -considered -hastings -as -a -fallen -man -and -they -acted -after -their -kind -some -of -our -readers -may -have -seen -in -india -a -cloud -of -crows -pecking -a -sick -vulture -to -death -no -bad -type -of -what -happens -in -that -country -as -often -as -fortune -deserts -one -who -has -been -great -and -dreaded -in -an -instant -all -the -sycophants -who -had -lately -been -ready -to -lie -for -him -to -forge -for -him -to -pander -for -him -to -poison -for -him -hasten -to -purchase -the -favor -of -his -victorious -enemies -by -accusing -him -an -indian -government -has -only -to -let -it -be -understood -that -it -wishes -a -particular -man -to -be -ruined -and -in -twenty -four -hours -it -will -be -furnished -with -grave -charges -supported -by -depositions -so -full -and -circumstantial -that -any -person -unaccustomed -to -asiatic -mendacity -would -regard -them -as -decisive -it -is -well -if -the -signature -of -the -destined -victim -is -not -counterfeited -at -the -foot -of -some -illegal -compact -and -if -some -treasonable -paper -is -not -slipped -into -a -hiding -place -in -his -house -that -was -nearly -a -century -and -a -quarter -ago -an -article -in -one -of -the -chief -journals -of -india -the -pioneer -shows -that -in -some -respects -the -native -of -to -day -is -just -what -his -ancestor -was -then -here -are -niceties -of -so -subtle -and -delicate -a -sort -that -they -lift -their -breed -of -rascality -to -a -place -among -the -fine -arts -and -almost -entitle -it -to -respect -the -records -of -the -indian -courts -might -certainly -be -relied -upon -to -prove -that -swindlers -as -a -class -in -the -east -come -very -close -to -if -they -do -not -surpass -in -brilliancy -of -execution -and -originality -of -design -the -most -expert -of -their -fraternity -in -europe -and -america -india -in -especial -is -the -home -of -forgery -there -are -some -particular -districts -which -are -noted -as -marts -for -the -finest -specimens -of -the -forger's -handiwork -the -business -is -carried -on -by -firms -who -possess -stores -of -stamped -papers -to -suit -every -emergency -they -habitually -lay -in -a -store -of -fresh -stamped -papers -every -year -and -some -of -the -older -and -more -thriving -houses -can -supply -documents -for -the -past -forty -years -bearing -the -proper -water -mark -and -possessing -the -genuine -appearance -of -age -other -districts -have -earned -notoriety -for -skilled -perjury -a -pre -eminence -that -excites -a -respectful -admiration -when -one -thinks -of -the -universal -prevalence -of -the -art -and -persons -desirous -of -succeeding -in -false -suits -are -ready -to -pay -handsomely -to -avail -themselves -of -the -services -of -these -local -experts -as -witnesses -various -instances -illustrative -of -the -methods -of -these -swindlers -are -given -they -exhibit -deep -cunning -and -total -depravity -on -the -part -of -the -swindler -and -his -pals -and -more -obtuseness -on -the -part -of -the -victim -than -one -would -expect -to -find -in -a -country -where -suspicion -of -your -neighbor -must -surely -be -one -of -the -earliest -things -learned -the -favorite -subject -is -the -young -fool -who -has -just -come -into -a -fortune -and -is -trying -to -see -how -poor -a -use -he -can -put -it -to -i -will -quote -one -example -sometimes -another -form -of -confidence -trick -is -adopted -which -is -invariably -successful -the -particular -pigeon -is -spotted -and -his -acquaintance -having -been -made -he -is -encouraged -in -every -form -of -vice -when -the -friendship -is -thoroughly -established -the -swindler -remarks -to -the -young -man -that -he -has -a -brother -who -has -asked -him -to -lend -him -rs -10 -000 -the -swindler -says -he -has -the -money -and -would -lend -it -but -as -the -borrower -is -his -brother -he -cannot -charge -interest -so -he -proposes -that -he -should -hand -the -dupe -the -money -and -the -latter -should -lend -it -to -the -swindler's -brother -exacting -a -heavy -pre -payment -of -interest -which -it -is -pointed -out -they -may -equally -enjoy -in -dissipation -the -dupe -sees -no -objection -and -on -the -appointed -day -receives -rs -7 -000 -from -the -swindler -which -he -hands -over -to -the -confederate -the -latter -is -profuse -in -his -thanks -and -executes -a -promissory -note -for -rs -10 -000 -payable -to -bearer -the -swindler -allows -the -scheme -to -remain -quiescent -for -a -time -and -then -suggests -that -as -the -money -has -not -been -repaid -and -as -it -would -be -unpleasant -to -sue -his -brother -it -would -be -better -to -sell -the -note -in -the -bazaar -the -dupe -hands -the -note -over -for -the -money -he -advanced -was -not -his -and -on -being -informed -that -it -would -be -necessary -to -have -his -signature -on -the -back -so -as -to -render -the -security -negotiable -he -signs -without -any -hesitation -the -swindler -passes -it -on -to -confederates -and -the -latter -employ -a -respectable -firm -of -solicitors -to -ask -the -dupe -if -his -signature -is -genuine -he -admits -it -at -once -and -his -fate -is -sealed -a -suit -is -filed -by -a -confederate -against -the -dupe -two -accomplices -being -made -co -defendants -they -admit -their -signatures -as -indorsers -and -the -one -swears -he -bought -the -note -for -value -from -the -dupe -the -latter -has -no -defense -for -no -court -would -believe -the -apparently -idle -explanation -of -the -manner -in -which -he -came -to -endorse -the -note -there -is -only -one -india! -it -is -the -only -country -that -has -a -monopoly -of -grand -and -imposing -specialties -when -another -country -has -a -remarkable -thing -it -cannot -have -it -all -to -itself -some -other -country -has -a -duplicate -but -india -that -is -different -its -marvels -are -its -own -the -patents -cannot -be -infringed -imitations -are -not -possible -and -think -of -the -size -of -them -the -majesty -of -them -the -weird -and -outlandish -character -of -the -most -of -them! -there -is -the -plague -the -black -death -india -invented -it -india -is -the -cradle -of -that -mighty -birth -the -car -of -juggernaut -was -india's -invention -so -was -the -suttee -and -within -the -time -of -men -still -living -eight -hundred -widows -willingly -and -in -fact -rejoicingly -burned -themselves -to -death -on -the -bodies -of -their -dead -husbands -in -a -single -year -eight -hundred -would -do -it -this -year -if -the -british -government -would -let -them -famine -is -india's -specialty -elsewhere -famines -are -inconsequential -incidents -in -india -they -are -devastating -cataclysms -in -one -case -they -annihilate -hundreds -in -the -other -millions -india -had -2 -000 -000 -gods -and -worships -them -all -in -religion -all -other -countries -are -paupers -india -is -the -only -millionaire -with -her -everything -is -on -a -giant -scale -even -her -poverty -no -other -country -can -show -anything -to -compare -with -it -and -she -has -been -used -to -wealth -on -so -vast -a -scale -that -she -has -to -shorten -to -single -words -the -expressions -describing -great -sums -she -describes -100 -000 -with -one -word -a -'lahk' -she -describes -ten -millions -with -one -word -a -'crore' -in -the -bowels -of -the -granite -mountains -she -has -patiently -carved -out -dozens -of -vast -temples -and -made -them -glorious -with -sculptured -colonnades -and -stately -groups -of -statuary -and -has -adorned -the -eternal -walls -with -noble -paintings -she -has -built -fortresses -of -such -magnitude -that -the -show -strongholds -of -the -rest -of -the -world -are -but -modest -little -things -by -comparison -palaces -that -are -wonders -for -rarity -of -materials -delicacy -and -beauty -of -workmanship -and -for -cost -and -one -tomb -which -men -go -around -the -globe -to -see -it -takes -eighty -nations -speaking -eighty -languages -to -people -her -and -they -number -three -hundred -millions -on -top -of -all -this -she -is -the -mother -and -home -of -that -wonder -of -wonders -caste -and -of -that -mystery -of -mysteries -the -satanic -brotherhood -of -the -thugs -india -had -the -start -of -the -whole -world -in -the -beginning -of -things -she -had -the -first -civilization -she -had -the -first -accumulation -of -material -wealth -she -was -populous -with -deep -thinkers -and -subtle -intellects -she -had -mines -and -woods -and -a -fruitful -soil -it -would -seem -as -if -she -should -have -kept -the -lead -and -should -be -to -day -not -the -meek -dependent -of -an -alien -master -but -mistress -of -the -world -and -delivering -law -and -command -to -every -tribe -and -nation -in -it -but -in -truth -there -was -never -any -possibility -of -such -supremacy -for -her -if -there -had -been -but -one -india -and -one -language -but -there -were -eighty -of -them! -where -there -are -eighty -nations -and -several -hundred -governments -fighting -and -quarreling -must -be -the -common -business -of -life -unity -of -purpose -and -policy -are -impossible -out -of -such -elements -supremacy -in -the -world -cannot -come -even -caste -itself -could -have -had -the -defeating -effect -of -a -multiplicity -of -tongues -no -doubt -for -it -separates -a -people -into -layers -and -layers -and -still -other -layers -that -have -no -community -of -feeling -with -each -other -and -in -such -a -condition -of -things -as -that -patriotism -can -have -no -healthy -growth -it -was -the -division -of -the -country -into -so -many -states -and -nations -that -made -thuggee -possible -and -prosperous -it -is -difficult -to -realize -the -situation -but -perhaps -one -may -approximate -it -by -imagining -the -states -of -our -union -peopled -by -separate -nations -speaking -separate -languages -with -guards -and -custom -houses -strung -along -all -frontiers -plenty -of -interruptions -for -travelers -and -traders -interpreters -able -to -handle -all -the -languages -very -rare -or -non -existent -and -a -few -wars -always -going -on -here -and -there -and -yonder -as -a -further -embarrassment -to -commerce -and -excursioning -it -would -make -intercommunication -in -a -measure -ungeneral -india -had -eighty -languages -and -more -custom -houses -than -cats -no -clever -man -with -the -instinct -of -a -highway -robber -could -fail -to -notice -what -a -chance -for -business -was -here -offered -india -was -full -of -clever -men -with -the -highwayman -instinct -and -so -quite -naturally -the -brotherhood -of -the -thugs -came -into -being -to -meet -the -long -felt -want -how -long -ago -that -was -nobody -knows -centuries -it -is -supposed -one -of -the -chiefest -wonders -connected -with -it -was -the -success -with -which -it -kept -its -secret -the -english -trader -did -business -in -india -two -hundred -years -and -more -before -he -ever -heard -of -it -and -yet -it -was -assassinating -its -thousands -all -around -him -every -year -the -whole -time -chapter -xliv -the -old -saw -says -let -a -sleeping -dog -lie -right -still -when -there -is -much -at -stake -it -is -better -to -get -a -newspaper -to -do -it -pudd'nhead -wilson's -new -calendar -from -diary -january -28 -i -learned -of -an -official -thug -book -the -other -day -i -was -not -aware -before -that -there -was -such -a -thing -i -am -allowed -the -temporary -use -of -it -we -are -making -preparations -for -travel -mainly -the -preparations -are -purchases -of -bedding -this -is -to -be -used -in -sleeping -berths -in -the -trains -in -private -houses -sometimes -and -in -nine -tenths -of -the -hotels -it -is -not -realizable -and -yet -it -is -true -it -is -a -survival -an -apparently -unnecessary -thing -which -in -some -strange -way -has -outlived -the -conditions -which -once -made -it -necessary -it -comes -down -from -a -time -when -the -railway -and -the -hotel -did -not -exist -when -the -occasional -white -traveler -went -horseback -or -by -bullock -cart -and -stopped -over -night -in -the -small -dak -bungalow -provided -at -easy -distances -by -the -government -a -shelter -merely -and -nothing -more -he -had -to -carry -bedding -along -or -do -without -the -dwellings -of -the -english -residents -are -spacious -and -comfortable -and -commodiously -furnished -and -surely -it -must -be -an -odd -sight -to -see -half -a -dozen -guests -come -filing -into -such -a -place -and -dumping -blankets -and -pillows -here -and -there -and -everywhere -but -custom -makes -incongruous -things -congruous -one -buys -the -bedding -with -waterproof -hold -all -for -it -at -almost -any -shop -there -is -no -difficulty -about -it -january -30 -what -a -spectacle -the -railway -station -was -at -train -time! -it -was -a -very -large -station -yet -when -we -arrived -it -seemed -as -if -the -whole -world -was -present -half -of -it -inside -the -other -half -outside -and -both -halves -bearing -mountainous -head -loads -of -bedding -and -other -freight -trying -simultaneously -to -pass -each -other -in -opposing -floods -in -one -narrow -door -these -opposing -floods -were -patient -gentle -long -suffering -natives -with -whites -scattered -among -them -at -rare -intervals -and -wherever -a -white -man's -native -servant -appeared -that -native -seemed -to -have -put -aside -his -natural -gentleness -for -the -time -and -invested -himself -with -the -white -man's -privilege -of -making -a -way -for -himself -by -promptly -shoving -all -intervening -black -things -out -of -it -in -these -exhibitions -of -authority -satan -was -scandalous -he -was -probably -a -thug -in -one -of -his -former -incarnations -inside -the -great -station -tides -upon -tides -of -rainbow -costumed -natives -swept -along -this -way -and -that -in -massed -and -bewildering -confusion -eager -anxious -belated -distressed -and -washed -up -to -the -long -trains -and -flowed -into -them -with -their -packs -and -bundles -and -disappeared -followed -at -once -by -the -next -wash -the -next -wave -and -here -and -there -in -the -midst -of -this -hurly -burly -and -seemingly -undisturbed -by -it -sat -great -groups -of -natives -on -the -bare -stone -floor -young -slender -brown -women -old -gray -wrinkled -women -little -soft -brown -babies -old -men -young -men -boys -all -poor -people -but -all -the -females -among -them -both -big -and -little -bejeweled -with -cheap -and -showy -nose -rings -toe -rings -leglets -and -armlets -these -things -constituting -all -their -wealth -no -doubt -these -silent -crowds -sat -there -with -their -humble -bundles -and -baskets -and -small -household -gear -about -them -and -patiently -waited -for -what -a -train -that -was -to -start -at -some -time -or -other -during -the -day -or -night! -they -hadn't -timed -themselves -well -but -that -was -no -matter -the -thing -had -been -so -ordered -from -on -high -therefore -why -worry -there -was -plenty -of -time -hours -and -hours -of -it -and -the -thing -that -was -to -happen -would -happen -there -was -no -hurrying -it -the -natives -traveled -third -class -and -at -marvelously -cheap -rates -they -were -packed -and -crammed -into -cars -that -held -each -about -fifty -and -it -was -said -that -often -a -brahmin -of -the -highest -caste -was -thus -brought -into -personal -touch -and -consequent -defilement -with -persons -of -the -lowest -castes -no -doubt -a -very -shocking -thing -if -a -body -could -understand -it -and -properly -appreciate -it -yes -a -brahmin -who -didn't -own -a -rupee -and -couldn't -borrow -one -might -have -to -touch -elbows -with -a -rich -hereditary -lord -of -inferior -caste -inheritor -of -an -ancient -title -a -couple -of -yards -long -and -he -would -just -have -to -stand -it -for -if -either -of -the -two -was -allowed -to -go -in -the -cars -where -the -sacred -white -people -were -it -probably -wouldn't -be -the -august -poor -brahmin -there -was -an -immense -string -of -those -third -class -cars -for -the -natives -travel -by -hordes -and -a -weary -hard -night -of -it -the -occupants -would -have -no -doubt -when -we -reached -our -car -satan -and -barney -had -already -arrived -there -with -their -train -of -porters -carrying -bedding -and -parasols -and -cigar -boxes -and -were -at -work -we -named -him -barney -for -short -we -couldn't -use -his -real -name -there -wasn't -time -it -was -a -car -that -promised -comfort -indeed -luxury -yet -the -cost -of -it -well -economy -could -no -further -go -even -in -france -not -even -in -italy -it -was -built -of -the -plainest -and -cheapest -partially -smoothed -boards -with -a -coating -of -dull -paint -on -them -and -there -was -nowhere -a -thought -of -decoration -the -floor -was -bare -but -would -not -long -remain -so -when -the -dust -should -begin -to -fly -across -one -end -of -the -compartment -ran -a -netting -for -the -accommodation -of -hand -baggage -at -the -other -end -was -a -door -which -would -shut -upon -compulsion -but -wouldn't -stay -shut -it -opened -into -a -narrow -little -closet -which -had -a -wash -bowl -in -one -end -of -it -and -a -place -to -put -a -towel -in -case -you -had -one -with -you -and -you -would -be -sure -to -have -towels -because -you -buy -them -with -the -bedding -knowing -that -the -railway -doesn't -furnish -them -on -each -side -of -the -car -and -running -fore -and -aft -was -a -broad -leather -covered -sofa -to -sit -on -in -the -day -and -sleep -on -at -night -over -each -sofa -hung -by -straps -a -wide -flat -leather -covered -shelf -to -sleep -on -in -the -daytime -you -can -hitch -it -up -against -the -wall -out -of -the -way -and -then -you -have -a -big -unencumbered -and -most -comfortable -room -to -spread -out -in -no -car -in -any -country -is -quite -its -equal -for -comfort -and -privacy -i -think -for -usually -there -are -but -two -persons -in -it -and -even -when -there -are -four -there -is -but -little -sense -of -impaired -privacy -our -own -cars -at -home -can -surpass -the -railway -world -in -all -details -but -that -one -they -have -no -cosiness -there -are -too -many -people -together -at -the -foot -of -each -sofa -was -a -side -door -for -entrance -and -exit -along -the -whole -length -of -the -sofa -on -each -side -of -the -car -ran -a -row -of -large -single -plate -windows -of -a -blue -tint -blue -to -soften -the -bitter -glare -of -the -sun -and -protect -one's -eyes -from -torture -these -could -be -let -down -out -of -the -way -when -one -wanted -the -breeze -in -the -roof -were -two -oil -lamps -which -gave -a -light -strong -enough -to -read -by -each -had -a -green -cloth -attachment -by -which -it -could -be -covered -when -the -light -should -be -no -longer -needed -while -we -talked -outside -with -friends -barney -and -satan -placed -the -hand -baggage -books -fruits -and -soda -bottles -in -the -racks -and -the -hold -alls -and -heavy -baggage -in -the -closet -hung -the -overcoats -and -sun -helmets -and -towels -on -the -hooks -hoisted -the -two -bed -shelves -up -out -of -the -way -then -shouldered -their -bedding -and -retired -to -the -third -class -now -then -you -see -what -a -handsome -spacious -light -airy -homelike -place -it -was -wherein -to -walk -up -and -down -or -sit -and -write -or -stretch -out -and -read -and -smoke -a -central -door -in -the -forward -end -of -the -compartment -opened -into -a -similar -compartment -it -was -occupied -by -my -wife -and -daughter -about -nine -in -the -evening -while -we -halted -a -while -at -a -station -barney -and -satan -came -and -undid -the -clumsy -big -hold -alls -and -spread -the -bedding -on -the -sofas -in -both -compartments -mattresses -sheets -gay -coverlets -pillows -all -complete -there -are -no -chambermaids -in -india -apparently -it -was -an -office -that -was -never -heard -of -then -they -closed -the -communicating -door -nimbly -tidied -up -our -place -put -the -night -clothing -on -the -beds -and -the -slippers -under -them -then -returned -to -their -own -quarters -january -31 -it -was -novel -and -pleasant -and -i -stayed -awake -as -long -as -i -could -to -enjoy -it -and -to -read -about -those -strange -people -the -thugs -in -my -sleep -they -remained -with -me -and -tried -to -strangle -me -the -leader -of -the -gang -was -that -giant -hindoo -who -was -such -a -picture -in -the -strong -light -when -we -were -leaving -those -hindoo -betrothal -festivities -at -two -o'clock -in -the -morning -rao -bahadur -baskirao -balinkanje -pitale -vakeel -to -the -gaikwar -of -baroda -it -was -he -that -brought -me -the -invitation -from -his -master -to -go -to -baroda -and -lecture -to -that -prince -and -now -he -was -misbehaving -in -my -dreams -but -all -things -can -happen -in -dreams -it -is -indeed -as -the -sweet -singer -of -michigan -says -irrelevantly -of -course -for -the -one -and -unfailing -great -quality -which -distinguishes -her -poetry -from -shakespeare's -and -makes -it -precious -to -us -is -its -stern -and -simple -irrelevancy -my -heart -was -gay -and -happy -this -was -ever -in -my -mind -there -is -better -times -a -coming -and -i -hope -some -day -to -find -myself -capable -of -composing -it -was -my -heart's -delight -to -compose -on -a -sentimental -subject -if -it -came -in -my -mind -just -right -[ -the -sentimental -song -book -p -49 -theme -the -author's -early -life -19th -stanza -] -barroda -arrived -at -7 -this -morning -the -dawn -was -just -beginning -to -show -it -was -forlorn -to -have -to -turn -out -in -a -strange -place -at -such -a -time -and -the -blinking -lights -in -the -station -made -it -seem -night -still -but -the -gentlemen -who -had -come -to -receive -us -were -there -with -their -servants -and -they -make -quick -work -there -was -no -lost -time -we -were -soon -outside -and -moving -swiftly -through -the -soft -gray -light -and -presently -were -comfortably -housed -with -more -servants -to -help -than -we -were -used -to -and -with -rather -embarassingly -important -officials -to -direct -them -but -it -was -custom -they -spoke -ballarat -english -their -bearing -was -charming -and -hospitable -and -so -all -went -well -breakfast -was -a -satisfaction -across -the -lawns -was -visible -in -the -distance -through -the -open -window -an -indian -well -with -two -oxen -tramping -leisurely -up -and -down -long -inclines -drawing -water -and -out -of -the -stillness -came -the -suffering -screech -of -the -machinery -not -quite -musical -and -yet -soothingly -melancholy -and -dreamy -and -reposeful -a -wail -of -lost -spirits -one -might -imagine -and -commemorative -and -reminiscent -perhaps -for -of -course -the -thugs -used -to -throw -people -down -that -well -when -they -were -done -with -them -after -breakfast -the -day -began -a -sufficiently -busy -one -we -were -driven -by -winding -roads -through -a -vast -park -with -noble -forests -of -great -trees -and -with -tangles -and -jungles -of -lovely -growths -of -a -humbler -sort -and -at -one -place -three -large -gray -apes -came -out -and -pranced -across -the -road -a -good -deal -of -a -surprise -and -an -unpleasant -one -for -such -creatures -belong -in -the -menagerie -and -they -look -artificial -and -out -of -place -in -a -wilderness -we -came -to -the -city -by -and -by -and -drove -all -through -it -intensely -indian -it -was -and -crumbly -and -mouldering -and -immemorially -old -to -all -appearance -and -the -houses -oh -indescribably -quaint -and -curious -they -were -with -their -fronts -an -elaborate -lace -work -of -intricate -and -beautiful -wood -carving -and -now -and -then -further -adorned -with -rude -pictures -of -elephants -and -princes -and -gods -done -in -shouting -colors -and -all -the -ground -floors -along -these -cramped -and -narrow -lanes -occupied -as -shops -shops -unbelievably -small -and -impossibly -packed -with -merchantable -rubbish -and -with -nine -tenths -naked -natives -squatting -at -their -work -of -hammering -pounding -brazing -soldering -sewing -designing -cooking -measuring -out -grain -grinding -it -repairing -idols -and -then -the -swarm -of -ragged -and -noisy -humanity -under -the -horses' -feet -and -everywhere -and -the -pervading -reek -and -fume -and -smell! -it -was -all -wonderful -and -delightful -imagine -a -file -of -elephants -marching -through -such -a -crevice -of -a -street -and -scraping -the -paint -off -both -sides -of -it -with -their -hides -how -big -they -must -look -and -how -little -they -must -make -the -houses -look -and -when -the -elephants -are -in -their -glittering -court -costume -what -a -contrast -they -must -make -with -the -humble -and -sordid -surroundings -and -when -a -mad -elephant -goes -raging -through -belting -right -and -left -with -his -trunk -how -do -these -swarms -of -people -get -out -of -the -way -i -suppose -it -is -a -thing -which -happens -now -and -then -in -the -mad -season -for -elephants -have -a -mad -season -i -wonder -how -old -the -town -is -there -are -patches -of -building -massive -structures -monuments -apparently -that -are -so -battered -and -worn -and -seemingly -so -tired -and -so -burdened -with -the -weight -of -age -and -so -dulled -and -stupefied -with -trying -to -remember -things -they -forgot -before -history -began -that -they -give -one -the -feeling -that -they -must -have -been -a -part -of -original -creation -this -is -indeed -one -of -the -oldest -of -the -princedoms -of -india -and -has -always -been -celebrated -for -its -barbaric -pomps -and -splendors -and -for -the -wealth -of -its -princes -chapter -xlv -it -takes -your -enemy -and -your -friend -working -together -to -hurt -you -to -the -heart -the -one -to -slander -you -and -the -other -to -get -the -news -to -you -pudd'nhead -wilson's -new -calendar -out -of -the -town -again -a -long -drive -through -open -country -by -winding -roads -among -secluded -villages -nestling -in -the -inviting -shade -of -tropic -vegetation -a -sabbath -stillness -everywhere -sometimes -a -pervading -sense -of -solitude -but -always -barefoot -natives -gliding -by -like -spirits -without -sound -of -footfall -and -others -in -the -distance -dissolving -away -and -vanishing -like -the -creatures -of -dreams -now -and -then -a -string -of -stately -camels -passed -by -always -interesting -things -to -look -at -and -they -were -velvet -shod -by -nature -and -made -no -noise -indeed -there -were -no -noises -of -any -sort -in -this -paradise -yes -once -there -was -one -for -a -moment -a -file -of -native -convicts -passed -along -in -charge -of -an -officer -and -we -caught -the -soft -clink -of -their -chains -in -a -retired -spot -resting -himself -under -a -tree -was -a -holy -person -a -naked -black -fakeer -thin -and -skinny -and -whitey -gray -all -over -with -ashes -by -and -by -to -the -elephant -stables -and -i -took -a -ride -but -it -was -by -request -i -did -not -ask -for -it -and -didn't -want -it -but -i -took -it -because -otherwise -they -would -have -thought -i -was -afraid -which -i -was -the -elephant -kneels -down -by -command -one -end -of -him -at -a -time -and -you -climb -the -ladder -and -get -into -the -howdah -and -then -he -gets -up -one -end -at -a -time -just -as -a -ship -gets -up -over -a -wave -and -after -that -as -he -strides -monstrously -about -his -motion -is -much -like -a -ship's -motion -the -mahout -bores -into -the -back -of -his -head -with -a -great -iron -prod -and -you -wonder -at -his -temerity -and -at -the -elephant's -patience -and -you -think -that -perhaps -the -patience -will -not -last -but -it -does -and -nothing -happens -the -mahout -talks -to -the -elephant -in -a -low -voice -all -the -time -and -the -elephant -seems -to -understand -it -all -and -to -be -pleased -with -it -and -he -obeys -every -order -in -the -most -contented -and -docile -way -among -these -twenty -five -elephants -were -two -which -were -larger -than -any -i -had -ever -seen -before -and -if -i -had -thought -i -could -learn -to -not -be -afraid -i -would -have -taken -one -of -them -while -the -police -were -not -looking -in -the -howdah -house -there -were -many -howdahs -that -were -made -of -silver -one -of -gold -and -one -of -old -ivory -and -equipped -with -cushions -and -canopies -of -rich -and -costly -stuffs -the -wardrobe -of -the -elephants -was -there -too -vast -velvet -covers -stiff -and -heavy -with -gold -embroidery -and -bells -of -silver -and -gold -and -ropes -of -these -metals -for -fastening -the -things -on -harness -so -to -speak -and -monster -hoops -of -massive -gold -for -the -elephant -to -wear -on -his -ankles -when -he -is -out -in -procession -on -business -of -state -but -we -did -not -see -the -treasury -of -crown -jewels -and -that -was -a -disappointment -for -in -mass -and -richness -it -ranks -only -second -in -india -by -mistake -we -were -taken -to -see -the -new -palace -instead -and -we -used -up -the -last -remnant -of -our -spare -time -there -it -was -a -pity -too -for -the -new -palace -is -mixed -modern -american -european -and -has -not -a -merit -except -costliness -it -is -wholly -foreign -to -india -and -impudent -and -out -of -place -the -architect -has -escaped -this -comes -of -overdoing -the -suppression -of -the -thugs -they -had -their -merits -the -old -palace -is -oriental -and -charming -and -in -consonance -with -the -country -the -old -palace -would -still -be -great -if -there -were -nothing -of -it -but -the -spacious -and -lofty -hall -where -the -durbars -are -held -it -is -not -a -good -place -to -lecture -in -on -account -of -the -echoes -but -it -is -a -good -place -to -hold -durbars -in -and -regulate -the -affairs -of -a -kingdom -and -that -is -what -it -is -for -if -i -had -it -i -would -have -a -durbar -every -day -instead -of -once -or -twice -a -year -the -prince -is -an -educated -gentleman -his -culture -is -european -he -has -been -in -europe -five -times -people -say -that -this -is -costly -amusement -for -him -since -in -crossing -the -sea -he -must -sometimes -be -obliged -to -drink -water -from -vessels -that -are -more -or -less -public -and -thus -damage -his -caste -to -get -it -purified -again -he -must -make -pilgrimage -to -some -renowned -hindoo -temples -and -contribute -a -fortune -or -two -to -them -his -people -are -like -the -other -hindoos -profoundly -religious -and -they -could -not -be -content -with -a -master -who -was -impure -we -failed -to -see -the -jewels -but -we -saw -the -gold -cannon -and -the -silver -one -they -seemed -to -be -six -pounders -they -were -not -designed -for -business -but -for -salutes -upon -rare -and -particularly -important -state -occasions -an -ancestor -of -the -present -gaikwar -had -the -silver -one -made -and -a -subsequent -ancestor -had -the -gold -one -made -in -order -to -outdo -him -this -sort -of -artillery -is -in -keeping -with -the -traditions -of -baroda -which -was -of -old -famous -for -style -and -show -it -used -to -entertain -visiting -rajahs -and -viceroys -with -tiger -fights -elephant -fights -illuminations -and -elephant -processions -of -the -most -glittering -and -gorgeous -character -it -makes -the -circus -a -pale -poor -thing -in -the -train -during -a -part -of -the -return -journey -from -baroda -we -had -the -company -of -a -gentleman -who -had -with -him -a -remarkable -looking -dog -i -had -not -seen -one -of -its -kind -before -as -far -as -i -could -remember -though -of -course -i -might -have -seen -one -and -not -noticed -it -for -i -am -not -acquainted -with -dogs -but -only -with -cats -this -dog's -coat -was -smooth -and -shiny -and -black -and -i -think -it -had -tan -trimmings -around -the -edges -of -the -dog -and -perhaps -underneath -it -was -a -long -low -dog -with -very -short -strange -legs -legs -that -curved -inboard -something -like -parentheses -wrong -way -indeed -it -was -made -on -the -plan -of -a -bench -for -length -and -lowness -it -seemed -to -be -satisfied -but -i -thought -the -plan -poor -and -structurally -weak -on -account -of -the -distance -between -the -forward -supports -and -those -abaft -with -age -the -dog's -back -was -likely -to -sag -and -it -seemed -to -me -that -it -would -have -been -a -stronger -and -more -practicable -dog -if -it -had -had -some -more -legs -it -had -not -begun -to -sag -yet -but -the -shape -of -the -legs -showed -that -the -undue -weight -imposed -upon -them -was -beginning -to -tell -it -had -a -long -nose -and -floppy -ears -that -hung -down -and -a -resigned -expression -of -countenance -i -did -not -like -to -ask -what -kind -of -a -dog -it -was -or -how -it -came -to -be -deformed -for -it -was -plain -that -the -gentleman -was -very -fond -of -it -and -naturally -he -could -be -sensitive -about -it -from -delicacy -i -thought -it -best -not -to -seem -to -notice -it -too -much -no -doubt -a -man -with -a -dog -like -that -feels -just -as -a -person -does -who -has -a -child -that -is -out -of -true -the -gentleman -was -not -merely -fond -of -the -dog -he -was -also -proud -of -it -just -the -same -again -as -a -mother -feels -about -her -child -when -it -is -an -idiot -i -could -see -that -he -was -proud -of -it -not -withstanding -it -was -such -a -long -dog -and -looked -so -resigned -and -pious -it -had -been -all -over -the -world -with -him -and -had -been -pilgriming -like -that -for -years -and -years -it -had -traveled -50 -000 -miles -by -sea -and -rail -and -had -ridden -in -front -of -him -on -his -horse -8 -000 -it -had -a -silver -medal -from -the -geographical -society -of -great -britain -for -its -travels -and -i -saw -it -it -had -won -prizes -in -dog -shows -both -in -india -and -in -england -i -saw -them -he -said -its -pedigree -was -on -record -in -the -kennel -club -and -that -it -was -a -well -known -dog -he -said -a -great -many -people -in -london -could -recognize -it -the -moment -they -saw -it -i -did -not -say -anything -but -i -did -not -think -it -anything -strange -i -should -know -that -dog -again -myself -yet -i -am -not -careful -about -noticing -dogs -he -said -that -when -he -walked -along -in -london -people -often -stopped -and -looked -at -the -dog -of -course -i -did -not -say -anything -for -i -did -not -want -to -hurt -his -feelings -but -i -could -have -explained -to -him -that -if -you -take -a -great -long -low -dog -like -that -and -waddle -it -along -the -street -anywhere -in -the -world -and -not -charge -anything -people -will -stop -and -look -he -was -gratified -because -the -dog -took -prizes -but -that -was -nothing -if -i -were -built -like -that -i -could -take -prizes -myself -i -wished -i -knew -what -kind -of -a -dog -it -was -and -what -it -was -for -but -i -could -not -very -well -ask -for -that -would -show -that -i -did -not -know -not -that -i -want -a -dog -like -that -but -only -to -know -the -secret -of -its -birth -i -think -he -was -going -to -hunt -elephants -with -it -because -i -know -from -remarks -dropped -by -him -that -he -has -hunted -large -game -in -india -and -africa -and -likes -it -but -i -think -that -if -he -tries -to -hunt -elephants -with -it -he -is -going -to -be -disappointed -i -do -not -believe -that -it -is -suited -for -elephants -it -lacks -energy -it -lacks -force -of -character -it -lacks -bitterness -these -things -all -show -in -the -meekness -and -resignation -of -its -expression -it -would -not -attack -an -elephant -i -am -sure -of -it -it -might -not -run -if -it -saw -one -coming -but -it -looked -to -me -like -a -dog -that -would -sit -down -and -pray -i -wish -he -had -told -me -what -breed -it -was -if -there -are -others -but -i -shall -know -the -dog -next -time -and -then -if -i -can -bring -myself -to -it -i -will -put -delicacy -aside -and -ask -if -i -seem -strangely -interested -in -dogs -i -have -a -reason -for -it -for -a -dog -saved -me -from -an -embarrassing -position -once -and -that -has -made -me -grateful -to -these -animals -and -if -by -study -i -could -learn -to -tell -some -of -the -kinds -from -the -others -i -should -be -greatly -pleased -i -only -know -one -kind -apart -yet -and -that -is -the -kind -that -saved -me -that -time -i -always -know -that -kind -when -i -meet -it -and -if -it -is -hungry -or -lost -i -take -care -of -it -the -matter -happened -in -this -way -it -was -years -and -years -ago -i -had -received -a -note -from -mr -augustin -daly -of -the -fifth -avenue -theatre -asking -me -to -call -the -next -time -i -should -be -in -new -york -i -was -writing -plays -in -those -days -and -he -was -admiring -them -and -trying -to -get -me -a -chance -to -get -them -played -in -siberia -i -took -the -first -train -the -early -one -the -one -that -leaves -hartford -at -8 -29 -in -the -morning -at -new -haven -i -bought -a -paper -and -found -it -filled -with -glaring -display -lines -about -a -bench -show -there -i -had -often -heard -of -bench -shows -but -had -never -felt -any -interest -in -them -because -i -supposed -they -were -lectures -that -were -not -well -attended -it -turned -out -now -that -it -was -not -that -but -a -dog -show -there -was -a -double -leaded -column -about -the -king -feature -of -this -one -which -was -called -a -saint -bernard -and -was -worth -$10 -000 -and -was -known -to -be -the -largest -and -finest -of -his -species -in -the -world -i -read -all -this -with -interest -because -out -of -my -school -boy -readings -i -dimly -remembered -how -the -priests -and -pilgrims -of -st -bernard -used -to -go -out -in -the -storms -and -dig -these -dogs -out -of -the -snowdrifts -when -lost -and -exhausted -and -give -them -brandy -and -save -their -lives -and -drag -them -to -the -monastery -and -restore -them -with -gruel -also -there -was -a -picture -of -this -prize -dog -in -the -paper -a -noble -great -creature -with -a -benignant -countenance -standing -by -a -table -he -was -placed -in -that -way -so -that -one -could -get -a -right -idea -of -his -great -dimensions -you -could -see -that -he -was -just -a -shade -higher -than -the -table -indeed -a -huge -fellow -for -a -dog -then -there -was -a -description -which -event -into -the -details -it -gave -his -enormous -weight -150 -1/2 -pounds -and -his -length -4 -feet -2 -inches -from -stem -to -stern -post -and -his -height -3 -feet -1 -inch -to -the -top -of -his -back -the -pictures -and -the -figures -so -impressed -me -that -i -could -see -the -beautiful -colossus -before -me -and -i -kept -on -thinking -about -him -for -the -next -two -hours -then -i -reached -new -york -and -he -dropped -out -of -my -mind -in -the -swirl -and -tumult -of -the -hotel -lobby -i -ran -across -mr -daly's -comedian -the -late -james -lewis -of -beloved -memory -and -i -casually -mentioned -that -i -was -going -to -call -upon -mr -daly -in -the -evening -at -8 -he -looked -surprised -and -said -he -reckoned -not -for -answer -i -handed -him -mr -daly's -note -its -substance -was -come -to -my -private -den -over -the -theater -where -we -cannot -be -interrupted -and -come -by -the -back -way -not -the -front -no -642 -sixth -avenue -is -a -cigar -shop -pass -through -it -and -you -are -in -a -paved -court -with -high -buildings -all -around -enter -the -second -door -on -the -left -and -come -up -stairs -is -this -all -yes -i -said -well -you'll -never -get -in -why -because -you -won't -or -if -you -do -you -can -draw -on -me -for -a -hundred -dollars -for -you -will -be -the -first -man -that -has -accomplished -it -in -twenty -five -years -i -can't -think -what -mr -daly -can -have -been -absorbed -in -he -has -forgotten -a -most -important -detail -and -he -will -feel -humiliated -in -the -morning -when -he -finds -that -you -tried -to -get -in -and -couldn't -why -what -is -the -trouble -i'll -tell -you -you -see -at -that -point -we -were -swept -apart -by -the -crowd -somebody -detained -me -with -a -moment's -talk -and -we -did -not -get -together -again -but -it -did -not -matter -i -believed -he -was -joking -anyway -at -eight -in -the -evening -i -passed -through -the -cigar -shop -and -into -the -court -and -knocked -at -the -second -door -come -in! -i -entered -it -was -a -small -room -carpetless -dusty -with -a -naked -deal -table -and -two -cheap -wooden -chairs -for -furniture -a -giant -irishman -was -standing -there -with -shirt -collar -and -vest -unbuttoned -and -no -coat -on -i -put -my -hat -on -the -table -and -was -about -to -say -something -when -the -irishman -took -the -innings -himself -and -not -with -marked -courtesy -of -tone -well -sor -what -will -you -have -i -was -a -little -disconcerted -and -my -easy -confidence -suffered -a -shrinkage -the -man -stood -as -motionless -as -gibraltar -and -kept -his -unblinking -eye -upon -me -it -was -very -embarrassing -very -humiliating -i -stammered -at -a -false -start -or -two -then -i -have -just -run -down -from -av -ye -plaze -ye'll -not -smoke -here -ye -understand -i -laid -my -cigar -on -the -window -ledge -chased -my -flighty -thoughts -a -moment -then -said -in -a -placating -manner -i -i -have -come -to -see -mr -daly -oh -ye -have -have -ye -yes -well -ye'll -not -see -him -but -he -asked -me -to -come -oh -he -did -did -he -yes -he -sent -me -this -note -and -lemme -see -it -for -a -moment -i -fancied -there -would -be -a -change -in -the -atmosphere -now -but -this -idea -was -premature -the -big -man -was -examining -the -note -searchingly -under -the -gas -jet -a -glance -showed -me -that -he -had -it -upside -down -disheartening -evidence -that -he -could -not -read -is -ut -his -own -handwrite -yes -he -wrote -it -himself -he -did -did -he -yes -h'm -well -then -why -ud -he -write -it -like -that -how -do -you -mean -i -mane -why -wudn't -he -put -his -naime -to -ut -his -name -is -to -it -that's -not -it -you -are -looking -at -my -name -i -thought -that -that -was -a -home -shot -but -he -did -not -betray -that -he -had -been -hit -he -said -it's -not -an -aisy -one -to -spell -how -do -you -pronounce -ut -mark -twain -h'm -h'm -mike -train -h'm -i -don't -remember -ut -what -is -it -ye -want -to -see -him -about -it -isn't -i -that -want -to -see -him -he -wants -to -see -me -oh -he -does -does -he -yes -what -does -he -want -to -see -ye -about -i -don't -know -ye -don't -know! -and -ye -confess -it -becod! -well -i -can -tell -ye -wan -thing -ye'll -not -see -him -are -ye -in -the -business -what -business -the -show -business -a -fatal -question -i -recognized -that -i -was -defeated -if -i -answered -no -he -would -cut -the -matter -short -and -wave -me -to -the -door -without -the -grace -of -a -word -i -saw -it -in -his -uncompromising -eye -if -i -said -i -was -a -lecturer -he -would -despise -me -and -dismiss -me -with -opprobrious -words -if -i -said -i -was -a -dramatist -he -would -throw -me -out -of -the -window -i -saw -that -my -case -was -hopeless -so -i -chose -the -course -which -seemed -least -humiliating -i -would -pocket -my -shame -and -glide -out -without -answering -the -silence -was -growing -lengthy -i'll -ask -ye -again -are -ye -in -the -show -business -yerself -yes! -i -said -it -with -splendid -confidence -for -in -that -moment -the -very -twin -of -that -grand -new -haven -dog -loafed -into -the -room -and -i -saw -that -irishman's -eye -light -eloquently -with -pride -and -affection -ye -are -and -what -is -it -i've -got -a -bench -show -in -new -haven -the -weather -did -change -then -you -don't -say -sir! -and -that's -your -show -sir! -oh -it's -a -grand -show -it's -a -wonderful -show -sir -and -a -proud -man -i -am -to -see -your -honor -this -day -and -ye'll -be -an -expert -sir -and -ye'll -know -all -about -dogs -more -than -ever -they -know -theirselves -i'll -take -me -oath -to -ut -i -said -with -modesty -i -believe -i -have -some -reputation -that -way -in -fact -my -business -requires -it -ye -have -some -reputation -your -honor! -bedad -i -believe -you! -there's -not -a -jintleman -in -the -worrld -that -can -lay -over -ye -in -the -judgmint -of -a -dog -sir -now -i'll -vinture -that -your -honor'll -know -that -dog's -dimensions -there -better -than -he -knows -them -his -own -self -and -just -by -the -casting -of -your -educated -eye -upon -him -would -you -mind -giving -a -guess -if -ye'll -be -so -good -i -knew -that -upon -my -answer -would -depend -my -fate -if -i -made -this -dog -bigger -than -the -prize -dog -it -would -be -bad -diplomacy -and -suspicious -if -i -fell -too -far -short -of -the -prizedog -that -would -be -equally -damaging -the -dog -was -standing -by -the -table -and -i -believed -i -knew -the -difference -between -him -and -the -one -whose -picture -i -had -seen -in -the -newspaper -to -a -shade -i -spoke -promptly -up -and -said -it's -no -trouble -to -guess -this -noble -creature's -figures -height -three -feet -length -four -feet -and -three -quarters -of -an -inch -weight -a -hundred -and -forty -eight -and -a -quarter -the -man -snatched -his -hat -from -its -peg -and -danced -on -it -with -joy -shouting -ye've -hardly -missed -it -the -hair's -breadth -hardly -the -shade -of -a -shade -your -honor! -oh -it's -the -miraculous -eye -ye've -got -for -the -judgmint -of -a -dog! -and -still -pouring -out -his -admiration -of -my -capacities -he -snatched -off -his -vest -and -scoured -off -one -of -the -wooden -chairs -with -it -and -scrubbed -it -and -polished -it -and -said -there -sit -down -your -honor -i'm -ashamed -of -meself -that -i -forgot -ye -were -standing -all -this -time -and -do -put -on -your -hat -ye -mustn't -take -cold -it's -a -drafty -place -and -here -is -your -cigar -sir -a -getting -cold -i'll -give -ye -a -light -there -the -place -is -all -yours -sir -and -if -ye'll -just -put -your -feet -on -the -table -and -make -yourself -at -home -i'll -stir -around -and -get -a -candle -and -light -ye -up -the -ould -crazy -stairs -and -see -that -ye -don't -come -to -anny -harm -for -be -this -time -mr -daly'll -be -that -impatient -to -see -your -honor -that -he'll -be -taking -the -roof -off -he -conducted -me -cautiously -and -tenderly -up -the -stairs -lighting -the -way -and -protecting -me -with -friendly -warnings -then -pushed -the -door -open -and -bowed -me -in -and -went -his -way -mumbling -hearty -things -about -my -wonderful -eye -for -points -of -a -dog -mr -daly -was -writing -and -had -his -back -to -me -he -glanced -over -his -shoulder -presently -then -jumped -up -and -said -oh -dear -me -i -forgot -all -about -giving -instructions -i -was -just -writing -you -to -beg -a -thousand -pardons -but -how -is -it -you -are -here -how -did -you -get -by -that -irishman -you -are -the -first -man -that's -done -it -in -five -and -twenty -years -you -didn't -bribe -him -i -know -that -there's -not -money -enough -in -new -york -to -do -it -and -you -didn't -persuade -him -he -is -all -ice -and -iron -there -isn't -a -soft -place -nor -a -warm -one -in -him -anywhere -that -is -your -secret -look -here -you -owe -me -a -hundred -dollars -for -unintentionally -giving -you -a -chance -to -perform -a -miracle -for -it -is -a -miracle -that -you've -done -that -is -all -right -i -said -collect -it -of -jimmy -lewis -that -good -dog -not -only -did -me -that -good -turn -in -the -time -of -my -need -but -he -won -for -me -the -envious -reputation -among -all -the -theatrical -people -from -the -atlantic -to -the -pacific -of -being -the -only -man -in -history -who -had -ever -run -the -blockade -of -augustin -daly's -back -door -chapter -xlvi -if -the -desire -to -kill -and -the -opportunity -to -kill -came -always -together -who -would -escape -hanging -pudd'nhead -wilson's -new -calendar -on -the -train -fifty -years -ago -when -i -was -a -boy -in -the -then -remote -and -sparsely -peopled -mississippi -valley -vague -tales -and -rumors -of -a -mysterious -body -of -professional -murderers -came -wandering -in -from -a -country -which -was -constructively -as -far -from -us -as -the -constellations -blinking -in -space -india -vague -tales -and -rumors -of -a -sect -called -thugs -who -waylaid -travelers -in -lonely -places -and -killed -them -for -the -contentment -of -a -god -whom -they -worshiped -tales -which -everybody -liked -to -listen -to -and -nobody -believed -except -with -reservations -it -was -considered -that -the -stories -had -gathered -bulk -on -their -travels -the -matter -died -down -and -a -lull -followed -then -eugene -sue's -wandering -jew -appeared -and -made -great -talk -for -a -while -one -character -in -it -was -a -chief -of -thugs -feringhea -a -mysterious -and -terrible -indian -who -was -as -slippery -and -sly -as -a -serpent -and -as -deadly -and -he -stirred -up -the -thug -interest -once -more -but -it -did -not -last -it -presently -died -again -this -time -to -stay -dead -at -first -glance -it -seems -strange -that -this -should -have -happened -but -really -it -was -not -strange -on -the -contrary -it -was -natural -i -mean -on -our -side -of -the -water -for -the -source -whence -the -thug -tales -mainly -came -was -a -government -report -and -without -doubt -was -not -republished -in -america -it -was -probably -never -even -seen -there -government -reports -have -no -general -circulation -they -are -distributed -to -the -few -and -are -not -always -read -by -those -few -i -heard -of -this -report -for -the -first -time -a -day -or -two -ago -and -borrowed -it -it -is -full -of -fascinations -and -it -turns -those -dim -dark -fairy -tales -of -my -boyhood -days -into -realities -the -report -was -made -in -1889 -by -major -sleeman -of -the -indian -service -and -was -printed -in -calcutta -in -1840 -it -is -a -clumsy -great -fat -poor -sample -of -the -printer's -art -but -good -enough -for -a -government -printing -office -in -that -old -day -and -in -that -remote -region -perhaps -to -major -sleeman -was -given -the -general -superintendence -of -the -giant -task -of -ridding -india -of -thuggee -and -he -and -his -seventeen -assistants -accomplished -it -it -was -the -augean -stables -over -again -captain -vallancey -writing -in -a -madras -journal -in -those -old -times -makes -this -remark -the -day -that -sees -this -far -spread -evil -eradicated -from -india -and -known -only -in -name -will -greatly -tend -to -immortalize -british -rule -in -the -east -he -did -not -overestimate -the -magnitude -and -difficulty -of -the -work -nor -the -immensity -of -the -credit -which -would -justly -be -due -to -british -rule -in -case -it -was -accomplished -thuggee -became -known -to -the -british -authorities -in -india -about -1810 -but -its -wide -prevalence -was -not -suspected -it -was -not -regarded -as -a -serious -matter -and -no -systematic -measures -were -taken -for -its -suppression -until -about -1830 -about -that -time -major -sleeman -captured -eugene -sue's -thug -chief -feringhea -and -got -him -to -turn -king's -evidence -the -revelations -were -so -stupefying -that -sleeman -was -not -able -to -believe -them -sleeman -thought -he -knew -every -criminal -within -his -jurisdiction -and -that -the -worst -of -them -were -merely -thieves -but -feringhea -told -him -that -he -was -in -reality -living -in -the -midst -of -a -swarm -of -professional -murderers -that -they -had -been -all -about -him -for -many -years -and -that -they -buried -their -dead -close -by -these -seemed -insane -tales -but -feringhea -said -come -and -see -and -he -took -him -to -a -grave -and -dug -up -a -hundred -bodies -and -told -him -all -the -circumstances -of -the -killings -and -named -the -thugs -who -had -done -the -work -it -was -a -staggering -business -sleeman -captured -some -of -these -thugs -and -proceeded -to -examine -them -separately -and -with -proper -precautions -against -collusion -for -he -would -not -believe -any -indian's -unsupported -word -the -evidence -gathered -proved -the -truth -of -what -feringhea -had -said -and -also -revealed -the -fact -that -gangs -of -thugs -were -plying -their -trade -all -over -india -the -astonished -government -now -took -hold -of -thuggee -and -for -ten -years -made -systematic -and -relentless -war -upon -it -and -finally -destroyed -it -gang -after -gang -was -captured -tried -and -punished -the -thugs -were -harried -and -hunted -from -one -end -of -india -to -the -other -the -government -got -all -their -secrets -out -of -them -and -also -got -the -names -of -the -members -of -the -bands -and -recorded -them -in -a -book -together -with -their -birthplaces -and -places -of -residence -the -thugs -were -worshipers -of -bhowanee -and -to -this -god -they -sacrificed -anybody -that -came -handy -but -they -kept -the -dead -man's -things -themselves -for -the -god -cared -for -nothing -but -the -corpse -men -were -initiated -into -the -sect -with -solemn -ceremonies -then -they -were -taught -how -to -strangle -a -person -with -the -sacred -choke -cloth -but -were -not -allowed -to -perform -officially -with -it -until -after -long -practice -no -half -educated -strangler -could -choke -a -man -to -death -quickly -enough -to -keep -him -from -uttering -a -sound -a -muffled -scream -gurgle -gasp -moan -or -something -of -the -sort -but -the -expert's -work -was -instantaneous -the -cloth -was -whipped -around -the -victim's -neck -there -was -a -sudden -twist -and -the -head -fell -silently -forward -the -eyes -starting -from -the -sockets -and -all -was -over -the -thug -carefully -guarded -against -resistance -it -was -usual -to -to -get -the -victims -to -sit -down -for -that -was -the -handiest -position -for -business -if -the -thug -had -planned -india -itself -it -could -not -have -been -more -conveniently -arranged -for -the -needs -of -his -occupation -there -were -no -public -conveyances -there -were -no -conveyances -for -hire -the -traveler -went -on -foot -or -in -a -bullock -cart -or -on -a -horse -which -he -bought -for -the -purpose -as -soon -as -he -was -out -of -his -own -little -state -or -principality -he -was -among -strangers -nobody -knew -him -nobody -took -note -of -him -and -from -that -time -his -movements -could -no -longer -be -traced -he -did -not -stop -in -towns -or -villages -but -camped -outside -of -them -and -sent -his -servants -in -to -buy -provisions -there -were -no -habitations -between -villages -whenever -he -was -between -villages -he -was -an -easy -prey -particularly -as -he -usually -traveled -by -night -to -avoid -the -heat -he -was -always -being -overtaken -by -strangers -who -offered -him -the -protection -of -their -company -or -asked -for -the -protection -of -his -and -these -strangers -were -often -thugs -as -he -presently -found -out -to -his -cost -the -landholders -the -native -police -the -petty -princes -the -village -officials -the -customs -officers -were -in -many -cases -protectors -and -harborers -of -the -thugs -and -betrayed -travelers -to -them -for -a -share -of -the -spoil -at -first -this -condition -of -things -made -it -next -to -impossible -for -the -government -to -catch -the -marauders -they -were -spirited -away -by -these -watchful -friends -all -through -a -vast -continent -thus -infested -helpless -people -of -every -caste -and -kind -moved -along -the -paths -and -trails -in -couples -and -groups -silently -by -night -carrying -the -commerce -of -the -country -treasure -jewels -money -and -petty -batches -of -silks -spices -and -all -manner -of -wares -it -was -a -paradise -for -the -thug -when -the -autumn -opened -the -thugs -began -to -gather -together -by -pre -concert -other -people -had -to -have -interpreters -at -every -turn -but -not -the -thugs -they -could -talk -together -no -matter -how -far -apart -they -were -born -for -they -had -a -language -of -their -own -and -they -had -secret -signs -by -which -they -knew -each -other -for -thugs -and -they -were -always -friends -even -their -diversities -of -religion -and -caste -were -sunk -in -devotion -to -their -calling -and -the -moslem -and -the -high -caste -and -low -caste -hindoo -were -staunch -and -affectionate -brothers -in -thuggery -when -a -gang -had -been -assembled -they -had -religious -worship -and -waited -for -an -omen -they -had -definite -notions -about -the -omens -the -cries -of -certain -animals -were -good -omens -the -cries -of -certain -other -creatures -were -bad -omens -a -bad -omen -would -stop -proceedings -and -send -the -men -home -the -sword -and -the -strangling -cloth -were -sacred -emblems -the -thugs -worshiped -the -sword -at -home -before -going -out -to -the -assembling -place -the -strangling -cloth -was -worshiped -at -the -place -of -assembly -the -chiefs -of -most -of -the -bands -performed -the -religious -ceremonies -themselves -but -the -kaets -delegated -them -to -certain -official -stranglers -chaurs -the -rites -of -the -kaets -were -so -holy -that -no -one -but -the -chaur -was -allowed -to -touch -the -vessels -and -other -things -used -in -them -thug -methods -exhibit -a -curious -mixture -of -caution -and -the -absence -of -it -cold -business -calculation -and -sudden -unreflecting -impulse -but -there -were -two -details -which -were -constant -and -not -subject -to -caprice -patient -persistence -in -following -up -the -prey -and -pitilessness -when -the -time -came -to -act -caution -was -exhibited -in -the -strength -of -the -bands -they -never -felt -comfortable -and -confident -unless -their -strength -exceeded -that -of -any -party -of -travelers -they -were -likely -to -meet -by -four -or -fivefold -yet -it -was -never -their -purpose -to -attack -openly -but -only -when -the -victims -were -off -their -guard -when -they -got -hold -of -a -party -of -travelers -they -often -moved -along -in -their -company -several -days -using -all -manner -of -arts -to -win -their -friendship -and -get -their -confidence -at -last -when -this -was -accomplished -to -their -satisfaction -the -real -business -began -a -few -thugs -were -privately -detached -and -sent -forward -in -the -dark -to -select -a -good -killing -place -and -dig -the -graves -when -the -rest -reached -the -spot -a -halt -was -called -for -a -rest -or -a -smoke -the -travelers -were -invited -to -sit -by -signs -the -chief -appointed -certain -thugs -to -sit -down -in -front -of -the -travelers -as -if -to -wait -upon -them -others -to -sit -down -beside -them -and -engage -them -in -conversation -and -certain -expert -stranglers -to -stand -behind -the -travelers -and -be -ready -when -the -signal -was -given -the -signal -was -usually -some -commonplace -remark -like -bring -the -tobacco -sometimes -a -considerable -wait -ensued -after -all -the -actors -were -in -their -places -the -chief -was -biding -his -time -in -order -to -make -everything -sure -meantime -the -talk -droned -on -dim -figures -moved -about -in -the -dull -light -peace -and -tranquility -reigned -the -travelers -resigned -themselves -to -the -pleasant -reposefulness -and -comfort -of -the -situation -unconscious -of -the -death -angels -standing -motionless -at -their -backs -the -time -was -ripe -now -and -the -signal -came -bring -the -tobacco -there -was -a -mute -swift -movement -all -in -the -same -instant -the -men -at -each -victim's -sides -seized -his -hands -the -man -in -front -seized -his -feet -and -pulled -the -man -at -his -back -whipped -the -cloth -around -his -neck -and -gave -it -a -twist -the -head -sunk -forward -the -tragedy -was -over -the -bodies -were -stripped -and -covered -up -in -the -graves -the -spoil -packed -for -transportation -then -the -thugs -gave -pious -thanks -to -bhowanee -and -departed -on -further -holy -service -the -report -shows -that -the -travelers -moved -in -exceedingly -small -groups -twos -threes -fours -as -a -rule -a -party -with -a -dozen -in -it -was -rare -the -thugs -themselves -seem -to -have -been -the -only -people -who -moved -in -force -they -went -about -in -gangs -of -10 -15 -25 -40 -60 -100 -150 -200 -250 -and -one -gang -of -310 -is -mentioned -considering -their -numbers -their -catch -was -not -extraordinary -particularly -when -you -consider -that -they -were -not -in -the -least -fastidious -but -took -anybody -they -could -get -whether -rich -or -poor -and -sometimes -even -killed -children -now -and -then -they -killed -women -but -it -was -considered -sinful -to -do -it -and -unlucky -the -season -was -six -or -eight -months -long -one -season -the -half -dozen -bundelkand -and -gwalior -gangs -aggregated -712 -men -and -they -murdered -210 -people -one -season -the -malwa -and -kandeish -gangs -aggregated -702 -men -and -they -murdered -232 -one -season -the -kandeish -and -berar -gangs -aggregated -963 -men -and -they -murdered -385 -people -here -is -the -tally -sheet -of -a -gang -of -sixty -thugs -for -a -whole -season -gang -under -two -noted -chiefs -chotee -and -sheik -nungoo -from -gwalior -left -poora -in -jhansee -and -on -arrival -at -sarora -murdered -a -traveler -on -nearly -reaching -bhopal -met -3 -brahmins -and -murdered -them -cross -the -nerbudda -at -a -village -called -hutteea -murdered -a -hindoo -went -through -aurungabad -to -walagow -there -met -a -havildar -of -the -barber -caste -and -5 -sepoys -native -soldiers -in -the -evening -came -to -jokur -and -in -the -morning -killed -them -near -the -place -where -the -treasure -bearers -were -killed -the -year -before -between -jokur -and -dholeea -met -a -sepoy -of -the -shepherd -caste -killed -him -in -the -jungle -passed -through -dholeea -and -lodged -in -a -village -two -miles -beyond -on -the -road -to -indore -met -a -byragee -beggar -holy -mendicant -murdered -him -at -the -thapa -in -the -morning -beyond -the -thapa -fell -in -with -3 -marwarie -travelers -murdered -them -near -a -village -on -the -banks -of -the -taptee -met -4 -travelers -and -killed -them -between -choupra -and -dhoreea -met -a -marwarie -murdered -him -at -dhoreea -met -3 -marwaries -took -them -two -miles -and -murdered -them -two -miles -further -on -overtaken -by -three -treasure -bearers -took -them -two -miles -and -murdered -them -in -the -jungle -came -on -to -khurgore -bateesa -in -indore -divided -spoil -and -dispersed -a -total -of -27 -men -murdered -on -one -expedition -chotee -to -save -his -neck -was -informer -and -furnished -these -facts -several -things -are -noticeable -about -his -resume -1 -business -brevity -2 -absence -of -emotion -3 -smallness -of -the -parties -encountered -by -the -60 -4 -variety -in -character -and -quality -of -the -game -captured -5 -hindoo -and -mohammedan -chiefs -in -business -together -for -bhowanee -6 -the -sacred -caste -of -the -brahmins -not -respected -by -either -7 -nor -yet -the -character -of -that -mendicant -that -byragee -a -beggar -is -a -holy -creature -and -some -of -the -gangs -spared -him -on -that -account -no -matter -how -slack -business -might -be -but -other -gangs -slaughtered -not -only -him -but -even -that -sacredest -of -sacred -creatures -the -fakeer -that -repulsive -skin -and -bone -thing -that -goes -around -naked -and -mats -his -bushy -hair -with -dust -and -dirt -and -so -beflours -his -lean -body -with -ashes -that -he -looks -like -a -specter -sometimes -a -fakeer -trusted -a -shade -too -far -in -the -protection -of -his -sacredness -in -the -middle -of -a -tally -sheet -of -feringhea's -who -had -been -out -with -forty -thugs -i -find -a -case -of -the -kind -after -the -killing -of -thirty -nine -men -and -one -woman -the -fakeer -appears -on -the -scene -approaching -doregow -met -3 -pundits -also -a -fakeer -mounted -on -a -pony -he -was -plastered -over -with -sugar -to -collect -flies -and -was -covered -with -them -drove -off -the -fakeer -and -killed -the -other -three -leaving -doregow -the -fakeer -joined -again -and -went -on -in -company -to -raojana -met -6 -khutries -on -their -way -from -bombay -to -nagpore -drove -off -the -fakeer -with -stones -and -killed -the -6 -men -in -camp -and -buried -them -in -the -grove -next -day -the -fakeer -joined -again -made -him -leave -at -mana -beyond -there -fell -in -with -two -kahars -and -a -sepoy -and -came -on -towards -the -place -selected -for -the -murder -when -near -it -the -fakeer -came -again -losing -all -patience -with -him -gave -mithoo -one -of -the -gang -5 -rupees -$2 -50 -to -murder -him -and -take -the -sin -upon -himself -all -four -were -strangled -including -the -fakeer -surprised -to -find -among -the -fakeer's -effects -30 -pounds -of -coral -350 -strings -of -small -pearls -15 -strings -of -large -pearls -and -a -gilt -necklace -it -it -curious -the -little -effect -that -time -has -upon -a -really -interesting -circumstance -this -one -so -old -so -long -ago -gone -down -into -oblivion -reads -with -the -same -freshness -and -charm -that -attach -to -the -news -in -the -morning -paper -one's -spirits -go -up -then -down -then -up -again -following -the -chances -which -the -fakeer -is -running -now -you -hope -now -you -despair -now -you -hope -again -and -at -last -everything -comes -out -right -and -you -feel -a -great -wave -of -personal -satisfaction -go -weltering -through -you -and -without -thinking -you -put -out -your -hand -to -pat -mithoo -on -the -back -when -puff! -the -whole -thing -has -vanished -away -there -is -nothing -there -mithoo -and -all -the -crowd -have -been -dust -and -ashes -and -forgotten -oh -so -many -many -many -lagging -years! -and -then -comes -a -sense -of -injury -you -don't -know -whether -mithoo -got -the -swag -along -with -the -sin -or -had -to -divide -up -the -swag -and -keep -all -the -sin -himself -there -is -no -literary -art -about -a -government -report -it -stops -a -story -right -in -the -most -interesting -place -these -reports -of -thug -expeditions -run -along -interminably -in -one -monotonous -tune -met -a -sepoy -killed -him -met -5 -pundits -killed -them -met -4 -rajpoots -and -a -woman -killed -them -and -so -on -till -the -statistics -get -to -be -pretty -dry -but -this -small -trip -of -feringhea's -forty -had -some -little -variety -about -it -once -they -came -across -a -man -hiding -in -a -grave -a -thief -he -had -stolen -1 -100 -rupees -from -dhunroj -seith -of -parowtee -they -strangled -him -and -took -the -money -they -had -no -patience -with -thieves -they -killed -two -treasure -bearers -and -got -4 -000 -rupees -they -came -across -two -bullocks -laden -with -copper -pice -and -killed -the -four -drivers -and -took -the -money -there -must -have -been -half -a -ton -of -it -i -think -it -takes -a -double -handful -of -pice -to -make -an -anna -and -16 -annas -to -make -a -rupee -and -even -in -those -days -the -rupee -was -worth -only -half -a -dollar -coming -back -over -their -tracks -from -baroda -they -had -another -picturesque -stroke -of -luck -'the -lohars -of -oodeypore' -put -a -traveler -in -their -charge -for -safety -dear -dear -across -this -abyssmal -gulf -of -time -we -still -see -feringhea's -lips -uncover -his -teeth -and -through -the -dim -haze -we -catch -the -incandescent -glimmer -of -his -smile -he -accepted -that -trust -good -man -and -so -we -know -what -went -with -the -traveler -even -rajahs -had -no -terrors -for -feringhea -he -came -across -an -elephant -driver -belonging -to -the -rajah -of -oodeypore -and -promptly -strangled -him -a -total -of -100 -men -and -5 -women -murdered -on -this -expedition -among -the -reports -of -expeditions -we -find -mention -of -victims -of -almost -every -quality -and -estate -also -a -prince's -cook -and -even -the -water -carrier -of -that -sublime -lord -of -lords -and -king -of -kings -the -governor -general -of -india! -how -broad -they -were -in -their -tastes! -they -also -murdered -actors -poor -wandering -barnstormers -there -are -two -instances -recorded -the -first -one -by -a -gang -of -thugs -under -a -chief -who -soils -a -great -name -borne -by -a -better -man -kipling's -deathless -gungadin -after -murdering -4 -sepoys -going -on -toward -indore -met -4 -strolling -players -and -persuaded -them -to -come -with -us -on -the -pretense -that -we -would -see -their -performance -at -the -next -stage -murdered -them -at -a -temple -near -bhopal -second -instance -at -deohuttee -joined -by -comedians -murdered -them -eastward -of -that -place -but -this -gang -was -a -particularly -bad -crew -on -that -expedition -they -murdered -a -fakeer -and -twelve -beggars -and -yet -bhowanee -protected -them -for -once -when -they -were -strangling -a -man -in -a -wood -when -a -crowd -was -going -by -close -at -hand -and -the -noose -slipped -and -the -man -screamed -bhowanee -made -a -camel -burst -out -at -the -same -moment -with -a -roar -that -drowned -the -scream -and -before -the -man -could -repeat -it -the -breath -was -choked -out -of -his -body -the -cow -is -so -sacred -in -india -that -to -kill -her -keeper -is -an -awful -sacrilege -and -even -the -thugs -recognized -this -yet -now -and -then -the -lust -for -blood -was -too -strong -and -so -they -did -kill -a -few -cow -keepers -in -one -of -these -instances -the -witness -who -killed -the -cowherd -said -in -thuggee -this -is -strictly -forbidden -and -is -an -act -from -which -no -good -can -come -i -was -ill -of -a -fever -for -ten -days -afterward -i -do -believe -that -evil -will -follow -the -murder -of -a -man -with -a -cow -if -there -be -no -cow -it -does -not -signify -another -thug -said -he -held -the -cowherd's -feet -while -this -witness -did -the -strangling -he -felt -no -concern -because -the -bad -fortune -of -such -a -deed -is -upon -the -strangler -and -not -upon -the -assistants -even -if -there -should -be -a -hundred -of -them -there -were -thousands -of -thugs -roving -over -india -constantly -during -many -generations -they -made -thug -gee -a -hereditary -vocation -and -taught -it -to -their -sons -and -to -their -son's -sons -boys -were -in -full -membership -as -early -as -16 -years -of -age -veterans -were -still -at -work -at -70 -what -was -the -fascination -what -was -the -impulse -apparently -it -was -partly -piety -largely -gain -and -there -is -reason -to -suspect -that -the -sport -afforded -was -the -chiefest -fascination -of -all -meadows -taylor -makes -a -thug -in -one -of -his -books -claim -that -the -pleasure -of -killing -men -was -the -white -man's -beast -hunting -instinct -enlarged -refined -ennobled -i -will -quote -the -passage -chapter -xlvii -simple -rules -for -saving -money -to -save -half -when -you -are -fired -by -an -eager -impulse -to -contribute -to -a -charity -wait -and -count -forty -to -save -three -quarters -count -sixty -to -save -it -all -count -sixty -five -pudd'nhead -wilson's -new -calendar -the -thug -said -how -many -of -you -english -are -passionately -devoted -to -sporting! -your -days -and -months -are -passed -in -its -excitement -a -tiger -a -panther -a -buffalo -or -a -hog -rouses -your -utmost -energies -for -its -destruction -you -even -risk -your -lives -in -its -pursuit -how -much -higher -game -is -a -thug's! -that -must -really -be -the -secret -of -the -rise -and -development -of -thuggee -the -joy -of -killing! -the -joy -of -seeing -killing -done -these -are -traits -of -the -human -race -at -large -we -white -people -are -merely -modified -thugs -thugs -fretting -under -the -restraints -of -a -not -very -thick -skin -of -civilization -thugs -who -long -ago -enjoyed -the -slaughter -of -the -roman -arena -and -later -the -burning -of -doubtful -christians -by -authentic -christians -in -the -public -squares -and -who -now -with -the -thugs -of -spain -and -nimes -flock -to -enjoy -the -blood -and -misery -of -the -bullring -we -have -no -tourists -of -either -sex -or -any -religion -who -are -able -to -resist -the -delights -of -the -bull -ring -when -opportunity -offers -and -we -are -gentle -thugs -in -the -hunting -season -and -love -to -chase -a -tame -rabbit -and -kill -it -still -we -have -made -some -progress -microscopic -and -in -truth -scarcely -worth -mentioning -and -certainly -nothing -to -be -proud -of -still -it -is -progress -we -no -longer -take -pleasure -in -slaughtering -or -burning -helpless -men -we -have -reached -a -little -altitude -where -we -may -look -down -upon -the -indian -thugs -with -a -complacent -shudder -and -we -may -even -hope -for -a -day -many -centuries -hence -when -our -posterity -will -look -down -upon -us -in -the -same -way -there -are -many -indications -that -the -thug -often -hunted -men -for -the -mere -sport -of -it -that -the -fright -and -pain -of -the -quarry -were -no -more -to -him -than -are -the -fright -and -pain -of -the -rabbit -or -the -stag -to -us -and -that -he -was -no -more -ashamed -of -beguiling -his -game -with -deceits -and -abusing -its -trust -than -are -we -when -we -have -imitated -a -wild -animal's -call -and -shot -it -when -it -honored -us -with -its -confidence -and -came -to -see -what -we -wanted -madara -son -of -nihal -and -i -ramzam -set -out -from -kotdee -in -the -cold -weather -and -followed -the -high -road -for -about -twenty -days -in -search -of -travelers -until -we -came -to -selempore -where -we -met -a -very -old -man -going -to -the -east -we -won -his -confidence -in -this -manner -he -carried -a -load -which -was -too -heavy -for -his -old -age -i -said -to -him -'you -are -an -old -man -i -will -aid -you -in -carrying -your -load -as -you -are -from -my -part -of -the -country -' -he -said -'very -well -take -me -with -you -' -so -we -took -him -with -us -to -selempore -where -we -slept -that -night -we -woke -him -next -morning -before -dawn -and -set -out -and -at -the -distance -of -three -miles -we -seated -him -to -rest -while -it -was -still -very -dark -madara -was -ready -behind -him -and -strangled -him -he -never -spoke -a -word -he -was -about -60 -or -70 -years -of -age -another -gang -fell -in -with -a -couple -of -barbers -and -persuaded -them -to -come -along -in -their -company -by -promising -them -the -job -of -shaving -the -whole -crew -30 -thugs -at -the -place -appointed -for -the -murder -15 -got -shaved -and -actually -paid -the -barbers -for -their -work -then -killed -them -and -took -back -the -money -a -gang -of -forty -two -thugs -came -across -two -brahmins -and -a -shopkeeper -on -the -road -beguiled -them -into -a -grove -and -got -up -a -concert -for -their -entertainment -while -these -poor -fellows -were -listening -to -the -music -the -stranglers -were -standing -behind -them -and -at -the -proper -moment -for -dramatic -effect -they -applied -the -noose -the -most -devoted -fisherman -must -have -a -bite -at -least -as -often -as -once -a -week -or -his -passion -will -cool -and -he -will -put -up -his -tackle -the -tiger -sportsman -must -find -a -tiger -at -least -once -a -fortnight -or -he -will -get -tired -and -quit -the -elephant -hunter's -enthusiasm -will -waste -away -little -by -little -and -his -zeal -will -perish -at -last -if -he -plod -around -a -month -without -finding -a -member -of -that -noble -family -to -assassinate -but -when -the -lust -in -the -hunter's -heart -is -for -the -noblest -of -all -quarries -man -how -different -is -the -case! -and -how -watery -and -poor -is -the -zeal -and -how -childish -the -endurance -of -those -other -hunters -by -comparison -then -neither -hunger -nor -thirst -nor -fatigue -nor -deferred -hope -nor -monotonous -disappointment -nor -leaden -footed -lapse -of -time -can -conquer -the -hunter's -patience -or -weaken -the -joy -of -his -quest -or -cool -the -splendid -rage -of -his -desire -of -all -the -hunting -passions -that -burn -in -the -breast -of -man -there -is -none -that -can -lift -him -superior -to -discouragements -like -these -but -the -one -the -royal -sport -the -supreme -sport -whose -quarry -is -his -brother -by -comparison -tiger -hunting -is -a -colorless -poor -thing -for -all -it -has -been -so -bragged -about -why -the -thug -was -content -to -tramp -patiently -along -afoot -in -the -wasting -heat -of -india -week -after -week -at -an -average -of -nine -or -ten -miles -a -day -if -he -might -but -hope -to -find -game -some -time -or -other -and -refresh -his -longing -soul -with -blood -here -is -an -instance -i -ramzam -and -hyder -set -out -for -the -purpose -of -strangling -travelers -from -guddapore -and -proceeded -via -the -fort -of -julalabad -newulgunge -bangermow -on -the -banks -of -the -ganges -upwards -of -100 -miles -from -whence -we -returned -by -another -route -still -no -travelers! -till -we -reached -bowaneegunge -where -we -fell -in -with -a -traveler -a -boatman -we -inveigled -him -and -about -two -miles -east -of -there -hyder -strangled -him -as -he -stood -for -he -was -troubled -and -afraid -and -would -not -sit -we -then -made -a -long -journey -about -130 -miles -and -reached -hussunpore -bundwa -where -at -the -tank -we -fell -in -with -a -traveler -he -slept -there -that -night -next -morning -we -followed -him -and -tried -to -win -his -confidence -at -the -distance -of -two -miles -we -endeavored -to -induce -him -to -sit -down -but -he -would -not -having -become -aware -of -us -i -attempted -to -strangle -him -as -he -walked -along -but -did -not -succeed -both -of -us -then -fell -upon -him -he -made -a -great -outcry -'they -are -murdering -me!' -at -length -we -strangled -him -and -flung -his -body -into -a -well -after -this -we -returned -to -our -homes -having -been -out -a -month -and -traveled -about -260 -miles -a -total -of -two -men -murdered -on -the -expedition -and -here -is -another -case -related -by -the -terrible -futty -khan -a -man -with -a -tremendous -record -to -be -re -mentioned -by -and -by -i -with -three -others -traveled -for -about -45 -days -a -distance -of -about -200 -miles -in -search -of -victims -along -the -highway -to -bundwa -and -returned -by -davodpore -another -200 -miles -during -which -journey -we -had -only -one -murder -which -happened -in -this -manner -four -miles -to -the -east -of -noubustaghat -we -fell -in -with -a -traveler -an -old -man -i -with -koshal -and -hyder -inveigled -him -and -accompanied -him -that -day -within -3 -miles -of -rampoor -where -after -dark -in -a -lonely -place -we -got -him -to -sit -down -and -rest -and -while -i -kept -him -in -talk -seated -before -him -hyder -behind -strangled -him -he -made -no -resistance -koshal -stabbed -him -under -the -arms -and -in -the -throat -and -we -flung -the -body -into -a -running -stream -we -got -about -4 -or -5 -rupees -each -$2 -or -$2 -50 -we -then -proceeded -homewards -a -total -of -one -man -murdered -on -this -expedition -there -they -tramped -400 -miles -were -gone -about -three -months -and -harvested -two -dollars -and -a -half -apiece -but -the -mere -pleasure -of -the -hunt -was -sufficient -that -was -pay -enough -they -did -no -grumbling -every -now -and -then -in -this -big -book -one -comes -across -that -pathetic -remark -we -tried -to -get -him -to -sit -down -but -he -would -not -it -tells -the -whole -story -some -accident -had -awakened -the -suspicion -in -him -that -these -smooth -friends -who -had -been -petting -and -coddling -him -and -making -him -feel -so -safe -and -so -fortunate -after -his -forlorn -and -lonely -wanderings -were -the -dreaded -thugs -and -now -their -ghastly -invitation -to -sit -and -rest -had -confirmed -its -truth -he -knew -there -was -no -help -for -him -and -that -he -was -looking -his -last -upon -earthly -things -but -he -would -not -sit -no -not -that -it -was -too -awful -to -think -of! -there -are -a -number -of -instances -which -indicate -that -when -a -man -had -once -tasted -the -regal -joys -of -man -hunting -he -could -not -be -content -with -the -dull -monotony -of -a -crimeless -life -after -ward -example -from -a -thug's -testimony -we -passed -through -to -kurnaul -where -we -found -a -former -thug -named -junooa -an -old -comrade -of -ours -who -had -turned -religious -mendicant -and -become -a -disciple -and -holy -he -came -to -us -in -the -serai -and -weeping -with -joy -returned -to -his -old -trade -neither -wealth -nor -honors -nor -dignities -could -satisfy -a -reformed -thug -for -long -he -would -throw -them -all -away -someday -and -go -back -to -the -lurid -pleasures -of -hunting -men -and -being -hunted -himself -by -the -british -ramzam -was -taken -into -a -great -native -grandee's -service -and -given -authority -over -five -villages -my -authority -extended -over -these -people -to -summons -them -to -my -presence -to -make -them -stand -or -sit -i -dressed -well -rode -my -pony -and -had -two -sepoys -a -scribe -and -a -village -guard -to -attend -me -during -three -years -i -used -to -pay -each -village -a -monthly -visit -and -no -one -suspected -that -i -was -a -thug! -the -chief -man -used -to -wait -on -me -to -transact -business -and -as -i -passed -along -old -and -young -made -their -salaam -to -me -and -yet -during -that -very -three -years -he -got -leave -of -absence -to -attend -a -wedding -and -instead -went -off -on -a -thugging -lark -with -six -other -thugs -and -hunted -the -highway -for -fifteen -days! -with -satisfactory -results -afterwards -he -held -a -great -office -under -a -rajah -there -he -had -ten -miles -of -country -under -his -command -and -a -military -guard -of -fifteen -men -with -authority -to -call -out -2 -000 -more -upon -occasion -but -the -british -got -on -his -track -and -they -crowded -him -so -that -he -had -to -give -himself -up -see -what -a -figure -he -was -when -he -was -gotten -up -for -style -and -had -all -his -things -on -i -was -fully -armed -a -sword -shield -pistols -a -matchlock -musket -and -a -flint -gun -for -i -was -fond -of -being -thus -arrayed -and -when -so -armed -feared -not -though -forty -men -stood -before -me -he -gave -himself -up -and -proudly -proclaimed -himself -a -thug -then -by -request -he -agreed -to -betray -his -friend -and -pal -buhram -a -thug -with -the -most -tremendous -record -in -india -i -went -to -the -house -where -buhram -slept -often -has -he -led -our -gangs! -i -woke -him -he -knew -me -well -and -came -outside -to -me -it -was -a -cold -night -so -under -pretence -of -warming -myself -but -in -reality -to -have -light -for -his -seizure -by -the -guards -i -lighted -some -straw -and -made -a -blaze -we -were -warming -our -hands -the -guards -drew -around -us -i -said -to -them -'this -is -buhram -' -and -he -was -seized -just -as -a -cat -seizes -a -mouse -then -buhram -said -'i -am -a -thug! -my -father -was -a -thug -my -grandfather -was -a -thug -and -i -have -thugged -with -many!' -so -spoke -the -mighty -hunter -the -mightiest -of -the -mighty -the -gordon -cumming -of -his -day -not -much -regret -noticeable -in -it -[ -having -planted -a -bullet -in -the -shoulder -bone -of -an -elephant -and -caused -the -agonized -creature -to -lean -for -support -against -a -tree -i -proceeded -to -brew -some -coffee -having -refreshed -myself -taking -observations -of -the -elephant's -spasms -and -writhings -between -the -sips -i -resolved -to -make -experiments -on -vulnerable -points -and -approaching -very -near -i -fired -several -bullets -at -different -parts -of -his -enormous -skull -he -only -acknowledged -the -shots -by -a -salaam -like -movement -of -his -trunk -with -the -point -of -which -he -gently -touched -the -wounds -with -a -striking -and -peculiar -action -surprised -and -shocked -to -find -that -i -was -only -prolonging -the -suffering -of -the -noble -beast -which -bore -its -trials -with -such -dignified -composure -i -resolved -to -finish -the -proceeding -with -all -possible -despatch -and -accordingly -opened -fire -upon -him -from -the -left -side -aiming -at -the -shoulder -i -fired -six -shots -with -the -two -grooved -rifle -which -must -have -eventually -proved -mortal -after -which -i -fired -six -shots -at -the -same -part -with -the -dutch -six -founder -large -tears -now -trickled -down -from -his -eyes -which -he -slowly -shut -and -opened -his -colossal -frame -shivered -convulsively -and -falling -on -his -side -he -expired -gordon -cumming -] -so -many -many -times -this -official -report -leaves -one's -curiosity -unsatisfied -for -instance -here -is -a -little -paragraph -out -of -the -record -of -a -certain -band -of -193 -thugs -which -has -that -defect -fell -in -with -lall -sing -subahdar -and -his -family -consisting -of -nine -persons -traveled -with -them -two -days -and -the -third -put -them -all -to -death -except -the -two -children -little -boys -of -one -and -a -half -years -old -there -it -stops -what -did -they -do -with -those -poor -little -fellows -what -was -their -subsequent -history -did -they -purpose -training -them -up -as -thugs -how -could -they -take -care -of -such -little -creatures -on -a -march -which -stretched -over -several -months -no -one -seems -to -have -cared -to -ask -any -questions -about -the -babies -but -i -do -wish -i -knew -one -would -be -apt -to -imagine -that -the -thugs -were -utterly -callous -utterly -destitute -of -human -feelings -heartless -toward -their -own -families -as -well -as -toward -other -people's -but -this -was -not -so -like -all -other -indians -they -had -a -passionate -love -for -their -kin -a -shrewd -british -officer -who -knew -the -indian -character -took -that -characteristic -into -account -in -laying -his -plans -for -the -capture -of -eugene -sue's -famous -feringhea -he -found -out -feringhea's -hiding -place -and -sent -a -guard -by -night -to -seize -him -but -the -squad -was -awkward -and -he -got -away -however -they -got -the -rest -of -the -family -the -mother -wife -child -and -brother -and -brought -them -to -the -officer -at -jubbulpore -the -officer -did -not -fret -but -bided -his -time -i -knew -feringhea -would -not -go -far -while -links -so -dear -to -him -were -in -my -hands -he -was -right -feringhea -knew -all -the -danger -he -was -running -by -staying -in -the -neighborhood -still -he -could -not -tear -himself -away -the -officer -found -that -he -divided -his -time -between -five -villages -where -be -had -relatives -and -friends -who -could -get -news -for -him -from -his -family -in -jubbulpore -jail -and -that -he -never -slept -two -consecutive -nights -in -the -same -village -the -officer -traced -out -his -several -haunts -then -pounced -upon -all -the -five -villages -on -the -one -night -and -at -the -same -hour -and -got -his -man -another -example -of -family -affection -a -little -while -previously -to -the -capture -of -feringhea's -family -the -british -officer -had -captured -feringhea's -foster -brother -leader -of -a -gang -of -ten -and -had -tried -the -eleven -and -condemned -them -to -be -hanged -feringhea's -captured -family -arrived -at -the -jail -the -day -before -the -execution -was -to -take -place -the -foster -brother -jhurhoo -entreated -to -be -allowed -to -see -the -aged -mother -and -the -others -the -prayer -was -granted -and -this -is -what -took -place -it -is -the -british -officer -who -speaks -in -the -morning -just -before -going -to -the -scaffold -the -interview -took -place -before -me -he -fell -at -the -old -woman's -feet -and -begged -that -she -would -relieve -him -from -the -obligations -of -the -milk -with -which -she -had -nourished -him -from -infancy -as -he -was -about -to -die -before -he -could -fulfill -any -of -them -she -placed -her -hands -on -his -head -and -he -knelt -and -she -said -she -forgave -him -all -and -bid -him -die -like -a -man -if -a -capable -artist -should -make -a -picture -of -it -it -would -be -full -of -dignity -and -solemnity -and -pathos -and -it -could -touch -you -you -would -imagine -it -to -be -anything -but -what -it -was -there -is -reverence -there -and -tenderness -and -gratefulness -and -compassion -and -resignation -and -fortitude -and -self -respect -and -no -sense -of -disgrace -no -thought -of -dishonor -everything -is -there -that -goes -to -make -a -noble -parting -and -give -it -a -moving -grace -and -beauty -and -dignity -and -yet -one -of -these -people -is -a -thug -and -the -other -a -mother -of -thugs! -the -incongruities -of -our -human -nature -seem -to -reach -their -limit -here -i -wish -to -make -note -of -one -curious -thing -while -i -think -of -it -one -of -the -very -commonest -remarks -to -be -found -in -this -bewildering -array -of -thug -confessions -is -this -strangled -him -and -threw -him -an -a -well! -in -one -case -they -threw -sixteen -into -a -well -and -they -had -thrown -others -in -the -same -well -before -it -makes -a -body -thirsty -to -read -about -it -and -there -is -another -very -curious -thing -the -bands -of -thugs -had -private -graveyards -they -did -not -like -to -kill -and -bury -at -random -here -and -there -and -everywhere -they -preferred -to -wait -and -toll -the -victims -along -and -get -to -one -of -their -regular -burying -places -'bheels' -if -they -could -in -the -little -kingdom -of -oude -which -was -about -half -as -big -as -ireland -and -about -as -big -as -the -state -of -maine -they -had -two -hundred -and -seventy -four -'bheels' -they -were -scattered -along -fourteen -hundred -miles -of -road -at -an -average -of -only -five -miles -apart -and -the -british -government -traced -out -and -located -each -and -every -one -of -them -and -set -them -down -on -the -map -the -oude -bands -seldom -went -out -of -their -own -country -but -they -did -a -thriving -business -within -its -borders -so -did -outside -bands -who -came -in -and -helped -some -of -the -thug -leaders -of -oude -were -noted -for -their -successful -careers -each -of -four -of -them -confessed -to -above -300 -murders -another -to -nearly -400 -our -friend -ramzam -to -604 -he -is -the -one -who -got -leave -of -absence -to -attend -a -wedding -and -went -thugging -instead -and -he -is -also -the -one -who -betrayed -buhram -to -the -british -but -the -biggest -records -of -all -were -the -murder -lists -of -futty -khan -and -buhram -futty -khan's -number -is -smaller -than -ramzam's -but -he -is -placed -at -the -head -because -his -average -is -the -best -in -oude -thug -history -per -year -of -service -his -slaughter -was -508 -men -in -twenty -years -and -he -was -still -a -young -man -when -the -british -stopped -his -industry -buhram's -list -was -931 -murders -but -it -took -him -forty -years -his -average -was -one -man -and -nearly -all -of -another -man -per -month -for -forty -years -but -futty -khan's -average -was -two -men -and -a -little -of -another -man -per -month -during -his -twenty -years -of -usefulness -there -is -one -very -striking -thing -which -i -wish -to -call -attention -to -you -have -surmised -from -the -listed -callings -followed -by -the -victims -of -the -thugs -that -nobody -could -travel -the -indian -roads -unprotected -and -live -to -get -through -that -the -thugs -respected -no -quality -no -vocation -no -religion -nobody -that -they -killed -every -unarmed -man -that -came -in -their -way -that -is -wholly -true -with -one -reservation -in -all -the -long -file -of -thug -confessions -an -english -traveler -is -mentioned -but -once -and -this -is -what -the -thug -says -of -the -circumstance -he -was -on -his -way -from -mhow -to -bombay -we -studiously -avoided -him -he -proceeded -next -morning -with -a -number -of -travelers -who -had -sought -his -protection -and -they -took -the -road -to -baroda -we -do -not -know -who -he -was -he -flits -across -the -page -of -this -rusty -old -book -and -disappears -in -the -obscurity -beyond -but -he -is -an -impressive -figure -moving -through -that -valley -of -death -serene -and -unafraid -clothed -in -the -might -of -the -english -name -we -have -now -followed -the -big -official -book -through -and -we -understand -what -thuggee -was -what -a -bloody -terror -it -was -what -a -desolating -scourge -it -was -in -1830 -the -english -found -this -cancerous -organization -imbedded -in -the -vitals -of -the -empire -doing -its -devastating -work -in -secrecy -and -assisted -protected -sheltered -and -hidden -by -innumerable -confederates -big -and -little -native -chiefs -customs -officers -village -officials -and -native -police -all -ready -to -lie -for -it -and -the -mass -of -the -people -through -fear -persistently -pretending -to -know -nothing -about -its -doings -and -this -condition -of -things -had -existed -for -generations -and -was -formidable -with -the -sanctions -of -age -and -old -custom -if -ever -there -was -an -unpromising -task -if -ever -there -was -a -hopeless -task -in -the -world -surely -it -was -offered -here -the -task -of -conquering -thuggee -but -that -little -handful -of -english -officials -in -india -set -their -sturdy -and -confident -grip -upon -it -and -ripped -it -out -root -and -branch! -how -modest -do -captain -vallancey's -words -sound -now -when -we -read -them -again -knowing -what -we -know -the -day -that -sees -this -far -spread -evil -completely -eradicated -from -india -and -known -only -in -name -will -greatly -tend -to -immortalize -british -rule -in -the -east -it -would -be -hard -to -word -a -claim -more -modestly -than -that -for -this -most -noble -work -chapter -xlviii -grief -can -take -care -of -itself -but -to -get -the -full -value -of -a -joy -you -must -have -somebody -to -divide -it -with -pudd'nhead -wilson's -new -calendar -we -left -bombay -for -allahabad -by -a -night -train -it -is -the -custom -of -the -country -to -avoid -day -travel -when -it -can -conveniently -be -done -but -there -is -one -trouble -while -you -can -seemingly -secure -the -two -lower -berths -by -making -early -application -there -is -no -ticket -as -witness -of -it -and -no -other -producible -evidence -in -case -your -proprietorship -shall -chance -to -be -challenged -the -word -engaged -appears -on -the -window -but -it -doesn't -state -who -the -compartment -is -engaged -for -if -your -satan -and -your -barney -arrive -before -somebody -else's -servants -and -spread -the -bedding -on -the -two -sofas -and -then -stand -guard -till -you -come -all -will -be -well -but -if -they -step -aside -on -an -errand -they -may -find -the -beds -promoted -to -the -two -shelves -and -somebody -else's -demons -standing -guard -over -their -master's -beds -which -in -the -meantime -have -been -spread -upon -your -sofas -you -do -not -pay -anything -extra -for -your -sleeping -place -that -is -where -the -trouble -lies -if -you -buy -a -fare -ticket -and -fail -to -use -it -there -is -room -thus -made -available -for -someone -else -but -if -the -place -were -secured -to -you -it -would -remain -vacant -and -yet -your -ticket -would -secure -you -another -place -when -you -were -presently -ready -to -travel -however -no -explanation -of -such -a -system -can -make -it -seem -quite -rational -to -a -person -who -has -been -used -to -a -more -rational -system -if -our -people -had -the -arranging -of -it -we -should -charge -extra -for -securing -the -place -and -then -the -road -would -suffer -no -loss -if -the -purchaser -did -not -occupy -it -the -present -system -encourages -good -manners -and -also -discourages -them -if -a -young -girl -has -a -lower -berth -and -an -elderly -lady -comes -in -it -is -usual -for -the -girl -to -offer -her -place -to -this -late -comer -and -it -is -usual -for -the -late -comer -to -thank -her -courteously -and -take -it -but -the -thing -happens -differently -sometimes -when -we -were -ready -to -leave -bombay -my -daughter's -satchels -were -holding -possession -of -her -berth -a -lower -one -at -the -last -moment -a -middle -aged -american -lady -swarmed -into -the -compartment -followed -by -native -porters -laden -with -her -baggage -she -was -growling -and -snarling -and -scolding -and -trying -to -make -herself -phenomenally -disagreeable -and -succeeding -without -a -word -she -hoisted -the -satchels -into -the -hanging -shelf -and -took -possession -of -that -lower -berth -on -one -of -our -trips -mr -smythe -and -i -got -out -at -a -station -to -walk -up -and -down -and -when -we -came -back -smythe's -bed -was -in -the -hanging -shelf -and -an -english -cavalry -officer -was -in -bed -on -the -sofa -which -he -had -lately -been -occupying -it -was -mean -to -be -glad -about -it -but -it -is -the -way -we -are -made -i -could -not -have -been -gladder -if -it -had -been -my -enemy -that -had -suffered -this -misfortune -we -all -like -to -see -people -in -trouble -if -it -doesn't -cost -us -anything -i -was -so -happy -over -mr -smythe's -chagrin -that -i -couldn't -go -to -sleep -for -thinking -of -it -and -enjoying -it -i -knew -he -supposed -the -officer -had -committed -the -robbery -himself -whereas -without -a -doubt -the -officer's -servant -had -done -it -without -his -knowledge -mr -smythe -kept -this -incident -warm -in -his -heart -and -longed -for -a -chance -to -get -even -with -somebody -for -it -sometime -afterward -the -opportunity -came -in -calcutta -we -were -leaving -on -a -24 -hour -journey -to -darjeeling -mr -barclay -the -general -superintendent -has -made -special -provision -for -our -accommodation -mr -smythe -said -so -there -was -no -need -to -hurry -about -getting -to -the -train -consequently -we -were -a -little -late -when -we -arrived -the -usual -immense -turmoil -and -confusion -of -a -great -indian -station -were -in -full -blast -it -was -an -immoderately -long -train -for -all -the -natives -of -india -were -going -by -it -somewhither -and -the -native -officials -were -being -pestered -to -frenzy -by -belated -and -anxious -people -they -didn't -know -where -our -car -was -and -couldn't -remember -having -received -any -orders -about -it -it -was -a -deep -disappointment -moreover -it -looked -as -if -our -half -of -our -party -would -be -left -behind -altogether -then -satan -came -running -and -said -he -had -found -a -compartment -with -one -shelf -and -one -sofa -unoccupied -and -had -made -our -beds -and -had -stowed -our -baggage -we -rushed -to -the -place -and -just -as -the -train -was -ready -to -pull -out -and -the -porters -were -slamming -the -doors -to -all -down -the -line -an -officer -of -the -indian -civil -service -a -good -friend -of -ours -put -his -head -in -and -said -i -have -been -hunting -for -you -everywhere -what -are -you -doing -here -don't -you -know -the -train -started -before -he -could -finish -mr -smythe's -opportunity -was -come -his -bedding -on -the -shelf -at -once -changed -places -with -the -bedding -a -stranger's -that -was -occupying -the -sofa -that -was -opposite -to -mine -about -ten -o'clock -we -stopped -somewhere -and -a -large -englishman -of -official -military -bearing -stepped -in -we -pretended -to -be -asleep -the -lamps -were -covered -but -there -was -light -enough -for -us -to -note -his -look -of -surprise -he -stood -there -grand -and -fine -peering -down -at -smythe -and -wondering -in -silence -at -the -situation -after -a -bit -be -said -well! -and -that -was -all -but -that -was -enough -it -was -easy -to -understand -it -meant -this -is -extraordinary -this -is -high -handed -i -haven't -had -an -experience -like -this -before -he -sat -down -on -his -baggage -and -for -twenty -minutes -we -watched -him -through -our -eyelashes -rocking -and -swaying -there -to -the -motion -of -the -train -then -we -came -to -a -station -and -he -got -up -and -went -out -muttering -i -must -find -a -lower -berth -or -wait -over -his -servant -came -presently -and -carried -away -his -things -mr -smythe's -sore -place -was -healed -his -hunger -for -revenge -was -satisfied -but -he -couldn't -sleep -and -neither -could -i -for -this -was -a -venerable -old -car -and -nothing -about -it -was -taut -the -closet -door -slammed -all -night -and -defied -every -fastening -we -could -invent -we -got -up -very -much -jaded -at -dawn -and -stepped -out -at -a -way -station -and -while -we -were -taking -a -cup -of -coffee -that -englishman -ranged -up -alongside -and -somebody -said -to -him -so -you -didn't -stop -off -after -all -no -the -guard -found -a -place -for -me -that -had -been -engaged -and -not -occupied -i -had -a -whole -saloon -car -all -to -myself -oh -quite -palatial! -i -never -had -such -luck -in -my -life -that -was -our -car -you -see -we -moved -into -it -straight -off -the -family -and -all -but -i -asked -the -english -gentleman -to -remain -and -he -did -a -pleasant -man -an -infantry -colonel -and -doesn't -know -yet -that -smythe -robbed -him -of -his -berth -but -thinks -it -was -done -by -smythe's -servant -without -smythe's -knowledge -he -was -assisted -in -gathering -this -impression -the -indian -trains -are -manned -by -natives -exclusively -the -indian -stations -except -very -large -and -important -ones -are -manned -entirely -by -natives -and -so -are -the -posts -and -telegraphs -the -rank -and -file -of -the -police -are -natives -all -these -people -are -pleasant -and -accommodating -one -day -i -left -an -express -train -to -lounge -about -in -that -perennially -ravishing -show -the -ebb -and -flow -and -whirl -of -gaudy -natives -that -is -always -surging -up -and -down -the -spacious -platform -of -a -great -indian -station -and -i -lost -myself -in -the -ecstasy -of -it -and -when -i -turned -the -train -was -moving -swiftly -away -i -was -going -to -sit -down -and -wait -for -another -train -as -i -would -have -done -at -home -i -had -no -thought -of -any -other -course -but -a -native -official -who -had -a -green -flag -in -his -hand -saw -me -and -said -politely -don't -you -belong -in -the -train -sir -yes -i -said -he -waved -his -flag -and -the -train -came -back! -and -he -put -me -aboard -with -as -much -ceremony -as -if -i -had -been -the -general -superintendent -they -are -kindly -people -the -natives -the -face -and -the -bearing -that -indicate -a -surly -spirit -and -a -bad -heart -seemed -to -me -to -be -so -rare -among -indians -so -nearly -non -existent -in -fact -that -i -sometimes -wondered -if -thuggee -wasn't -a -dream -and -not -a -reality -the -bad -hearts -are -there -but -i -believe -that -they -are -in -a -small -poor -minority -one -thing -is -sure -they -are -much -the -most -interesting -people -in -the -world -and -the -nearest -to -being -incomprehensible -at -any -rate -the -hardest -to -account -for -their -character -and -their -history -their -customs -and -their -religion -confront -you -with -riddles -at -every -turn -riddles -which -are -a -trifle -more -perplexing -after -they -are -explained -than -they -were -before -you -can -get -the -facts -of -a -custom -like -caste -and -suttee -and -thuggee -and -so -on -and -with -the -facts -a -theory -which -tries -to -explain -but -never -quite -does -it -to -your -satisfaction -you -can -never -quite -understand -how -so -strange -a -thing -could -have -been -born -nor -why -for -instance -the -suttee -this -is -the -explanation -of -it -a -woman -who -throws -away -her -life -when -her -husband -dies -is -instantly -joined -to -him -again -and -is -forever -afterward -happy -with -him -in -heaven -her -family -will -build -a -little -monument -to -her -or -a -temple -and -will -hold -her -in -honor -and -indeed -worship -her -memory -always -they -will -themselves -be -held -in -honor -by -the -public -the -woman's -self -sacrifice -has -conferred -a -noble -and -lasting -distinction -upon -her -posterity -and -besides -see -what -she -has -escaped -if -she -had -elected -to -live -she -would -be -a -disgraced -person -she -could -not -remarry -her -family -would -despise -her -and -disown -her -she -would -be -a -friendless -outcast -and -miserable -all -her -days -very -well -you -say -but -the -explanation -is -not -complete -yet -how -did -people -come -to -drift -into -such -a -strange -custom -what -was -the -origin -of -the -idea -well -nobody -knows -it -was -probably -a -revelation -sent -down -by -the -gods -one -more -thing -why -was -such -a -cruel -death -chosen -why -wouldn't -a -gentle -one -have -answered -nobody -knows -maybe -that -was -a -revelation -too -no -you -can -never -understand -it -it -all -seems -impossible -you -resolve -to -believe -that -a -widow -never -burnt -herself -willingly -but -went -to -her -death -because -she -was -afraid -to -defy -public -opinion -but -you -are -not -able -to -keep -that -position -history -drives -you -from -it -major -sleeman -has -a -convincing -case -in -one -of -his -books -in -his -government -on -the -nerbudda -he -made -a -brave -attempt -on -the -28th -of -march -1828 -to -put -down -suttee -on -his -own -hook -and -without -warrant -from -the -supreme -government -of -india -he -could -not -foresee -that -the -government -would -put -it -down -itself -eight -months -later -the -only -backing -he -had -was -a -bold -nature -and -a -compassionate -heart -he -issued -his -proclamation -abolishing -the -suttee -in -his -district -on -the -morning -of -tuesday -note -the -day -of -the -week -the -24th -of -the -following -november -ummed -singh -upadhya -head -of -the -most -respectable -and -most -extensive -brahmin -family -in -the -district -died -and -presently -came -a -deputation -of -his -sons -and -grandsons -to -beg -that -his -old -widow -might -be -allowed -to -burn -herself -upon -his -pyre -sleeman -threatened -to -enforce -his -order -and -punish -severely -any -man -who -assisted -and -he -placed -a -police -guard -to -see -that -no -one -did -so -from -the -early -morning -the -old -widow -of -sixty -five -had -been -sitting -on -the -bank -of -the -sacred -river -by -her -dead -waiting -through -the -long -hours -for -the -permission -and -at -last -the -refusal -came -instead -in -one -little -sentence -sleeman -gives -you -a -pathetic -picture -of -this -lonely -old -gray -figure -all -day -and -all -night -she -remained -sitting -by -the -edge -of -the -water -without -eating -or -drinking -the -next -morning -the -body -of -the -husband -was -burned -to -ashes -in -a -pit -eight -feet -square -and -three -or -four -feet -deep -in -the -view -of -several -thousand -spectators -then -the -widow -waded -out -to -a -bare -rock -in -the -river -and -everybody -went -away -but -her -sons -and -other -relations -all -day -she -sat -there -on -her -rock -in -the -blazing -sun -without -food -or -drink -and -with -no -clothing -but -a -sheet -over -her -shoulders -the -relatives -remained -with -her -and -all -tried -to -persuade -her -to -desist -from -her -purpose -for -they -deeply -loved -her -she -steadily -refused -then -a -part -of -the -family -went -to -sleeman's -house -ten -miles -away -and -tried -again -to -get -him -to -let -her -burn -herself -he -refused -hoping -to -save -her -yet -all -that -day -she -scorched -in -her -sheet -on -the -rock -and -all -that -night -she -kept -her -vigil -there -in -the -bitter -cold -thursday -morning -in -the -sight -of -her -relatives -she -went -through -a -ceremonial -which -said -more -to -them -than -any -words -could -have -done -she -put -on -the -dhaja -a -coarse -red -turban -and -broke -her -bracelets -in -pieces -by -these -acts -she -became -a -dead -person -in -the -eye -of -the -law -and -excluded -from -her -caste -forever -by -the -iron -rule -of -ancient -custom -if -she -should -now -choose -to -live -she -could -never -return -to -her -family -sleeman -was -in -deep -trouble -if -she -starved -herself -to -death -her -family -would -be -disgraced -and -moreover -starving -would -be -a -more -lingering -misery -than -the -death -by -fire -he -went -back -in -the -evening -thoroughly -worried -the -old -woman -remained -on -her -rock -and -there -in -the -morning -he -found -her -with -her -dhaja -still -on -her -head -she -talked -very -collectedly -telling -me -that -she -had -determined -to -mix -her -ashes -with -those -of -her -departed -husband -and -should -patiently -wait -my -permission -to -do -so -assured -that -god -would -enable -her -to -sustain -life -till -that -was -given -though -she -dared -not -eat -or -drink -looking -at -the -sun -then -rising -before -her -over -a -long -and -beautiful -reach -of -the -river -she -said -calmly -'my -soul -has -been -for -five -days -with -my -husband's -near -that -sun -nothing -but -my -earthly -frame -is -left -and -this -i -know -you -will -in -time -suffer -to -be -mixed -with -his -ashes -in -yonder -pit -because -it -is -not -in -your -nature -or -usage -wantonly -to -prolong -the -miseries -of -a -poor -old -woman -' -he -assured -her -that -it -was -his -desire -and -duty -to -save -her -and -to -urge -her -to -live -and -to -keep -her -family -from -the -disgrace -of -being -thought -her -murderers -but -she -said -she -was -not -afraid -of -their -being -thought -so -that -they -had -all -like -good -children -done -everything -in -their -power -to -induce -her -to -live -and -to -abide -with -them -and -if -i -should -consent -i -know -they -would -love -and -honor -me -but -my -duties -to -them -have -now -ended -i -commit -them -all -to -your -care -and -i -go -to -attend -my -husband -ummed -singh -upadhya -with -whose -ashes -on -the -funeral -pile -mine -have -been -already -three -times -mixed -she -believed -that -she -and -he -had -been -upon -the -earth -three -several -times -as -wife -and -husband -and -that -she -had -burned -herself -to -death -three -times -upon -his -pyre -that -is -why -she -said -that -strange -thing -since -she -had -broken -her -bracelets -and -put -on -the -red -turban -she -regarded -herself -as -a -corpse -otherwise -she -would -not -have -allowed -herself -to -do -her -husband -the -irreverence -of -pronouncing -his -name -this -was -the -first -time -in -her -long -life -that -she -had -ever -uttered -her -husband's -name -for -in -india -no -woman -high -or -low -ever -pronounces -the -name -of -her -husband -major -sleeman -still -tried -to -shake -her -purpose -he -promised -to -build -her -a -fine -house -among -the -temples -of -her -ancestors -upon -the -bank -of -the -river -and -make -handsome -provision -for -her -out -of -rent -free -lands -if -she -would -consent -to -live -and -if -she -wouldn't -he -would -allow -no -stone -or -brick -to -ever -mark -the -place -where -she -died -but -she -only -smiled -and -said -my -pulse -has -long -ceased -to -beat -my -spirit -has -departed -i -shall -suffer -nothing -in -the -burning -and -if -you -wish -proof -order -some -fire -and -you -shall -see -this -arm -consumed -without -giving -me -any -pain -sleeman -was -now -satisfied -that -he -could -not -alter -her -purpose -he -sent -for -all -the -chief -members -of -the -family -and -said -he -would -suffer -her -to -burn -herself -if -they -would -enter -into -a -written -engagement -to -abandon -the -suttee -in -their -family -thenceforth -they -agreed -the -papers -were -drawn -out -and -signed -and -at -noon -saturday -word -was -sent -to -the -poor -old -woman -she -seemed -greatly -pleased -the -ceremonies -of -bathing -were -gone -through -with -and -by -three -o'clock -she -was -ready -and -the -fire -was -briskly -burning -in -the -pit -she -had -now -gone -without -food -or -drink -during -more -than -four -days -and -a -half -she -came -ashore -from -her -rock -first -wetting -her -sheet -in -the -waters -of -the -sacred -river -for -without -that -safeguard -any -shadow -which -might -fall -upon -her -would -convey -impurity -to -her -then -she -walked -to -the -pit -leaning -upon -one -of -her -sons -and -a -nephew -the -distance -was -a -hundred -and -fifty -yards -i -had -sentries -placed -all -around -and -no -other -person -was -allowed -to -approach -within -five -paces -she -came -on -with -a -calm -and -cheerful -countenance -stopped -once -and -casting -her -eyes -upwards -said -'why -have -they -kept -me -five -days -from -thee -my -husband -' -on -coming -to -the -sentries -her -supporters -stopped -and -remained -standing -she -moved -on -and -walked -once -around -the -pit -paused -a -moment -and -while -muttering -a -prayer -threw -some -flowers -into -the -fire -she -then -walked -up -deliberately -and -steadily -to -the -brink -stepped -into -the -centre -of -the -flame -sat -down -and -leaning -back -in -the -midst -as -if -reposing -upon -a -couch -was -consumed -without -uttering -a -shriek -or -betraying -one -sign -of -agony -it -is -fine -and -beautiful -it -compels -one's -reverence -and -respect -no -has -it -freely -and -without -compulsion -we -see -how -the -custom -once -started -could -continue -for -the -soul -of -it -is -that -stupendous -power -faith -faith -brought -to -the -pitch -of -effectiveness -by -the -cumulative -force -of -example -and -long -use -and -custom -but -we -cannot -understand -how -the -first -widows -came -to -take -to -it -that -is -a -perplexing -detail -sleeman -says -that -it -was -usual -to -play -music -at -the -suttee -but -that -the -white -man's -notion -that -this -was -to -drown -the -screams -of -the -martyr -is -not -correct -that -it -had -a -quite -different -purpose -it -was -believed -that -the -martyr -died -prophecying -that -the -prophecies -sometimes -foretold -disaster -and -it -was -considered -a -kindness -to -those -upon -whom -it -was -to -fall -to -drown -the -voice -and -keep -them -in -ignorance -of -the -misfortune -that -was -to -come -chapter -xlix -he -had -had -much -experience -of -physicians -and -said -the -only -way -to -keep -your -health -is -to -eat -what -you -don't -want -drink -what -you -don't -like -and -do -what -you'd -druther -not -pudd'nhead -wilson's -new -calendar -it -was -a -long -journey -two -nights -one -day -and -part -of -another -day -from -bombay -eastward -to -allahabad -but -it -was -always -interesting -and -it -was -not -fatiguing -at -first -the -night -travel -promised -to -be -fatiguing -but -that -was -on -account -of -pyjamas -this -foolish -night -dress -consists -of -jacket -and -drawers -sometimes -they -are -made -of -silk -sometimes -of -a -raspy -scratchy -slazy -woolen -material -with -a -sandpaper -surface -the -drawers -are -loose -elephant -legged -and -elephant -waisted -things -and -instead -of -buttoning -around -the -body -there -is -a -drawstring -to -produce -the -required -shrinkage -the -jacket -is -roomy -and -one -buttons -it -in -front -pyjamas -are -hot -on -a -hot -night -and -cold -on -a -cold -night -defects -which -a -nightshirt -is -free -from -i -tried -the -pyjamas -in -order -to -be -in -the -fashion -but -i -was -obliged -to -give -them -up -i -couldn't -stand -them -there -was -no -sufficient -change -from -day -gear -to -night -gear -i -missed -the -refreshing -and -luxurious -sense -induced -by -the -night -gown -of -being -undressed -emancipated -set -free -from -restraints -and -trammels -in -place -of -that -i -had -the -worried -confined -oppressed -suffocated -sense -of -being -abed -with -my -clothes -on -all -through -the -warm -half -of -the -night -the -coarse -surfaces -irritated -my -skin -and -made -it -feel -baked -and -feverish -and -the -dreams -which -came -in -the -fitful -flurries -of -slumber -were -such -as -distress -the -sleep -of -the -damned -or -ought -to -and -all -through -the -cold -other -half -of -the -night -i -could -get -no -time -for -sleep -because -i -had -to -employ -it -all -in -stealing -blankets -but -blankets -are -of -no -value -at -such -a -time -the -higher -they -are -piled -the -more -effectively -they -cork -the -cold -in -and -keep -it -from -getting -out -the -result -is -that -your -legs -are -ice -and -you -know -how -you -will -feel -by -and -by -when -you -are -buried -in -a -sane -interval -i -discarded -the -pyjamas -and -led -a -rational -and -comfortable -life -thenceforth -out -in -the -country -in -india -the -day -begins -early -one -sees -a -plain -perfectly -flat -dust -colored -and -brick -yardy -stretching -limitlessly -away -on -every -side -in -the -dim -gray -light -striped -everywhere -with -hard -beaten -narrow -paths -the -vast -flatness -broken -at -wide -intervals -by -bunches -of -spectral -trees -that -mark -where -villages -are -and -along -all -the -paths -are -slender -women -and -the -black -forms -of -lanky -naked -men -moving -to -their -work -the -women -with -brass -water -jars -on -their -heads -the -men -carrying -hoes -the -man -is -not -entirely -naked -always -there -is -a -bit -of -white -rag -a -loin -cloth -it -amounts -to -a -bandage -and -is -a -white -accent -on -his -black -person -like -the -silver -band -around -the -middle -of -a -pipe -stem -sometimes -he -also -wears -a -fluffy -and -voluminous -white -turban -and -this -adds -a -second -accent -he -then -answers -properly -to -miss -gordon -cumming's -flash -light -picture -of -him -as -a -person -who -is -dressed -in -a -turban -and -a -pocket -handkerchief -all -day -long -one -has -this -monotony -of -dust -colored -dead -levels -and -scattering -bunches -of -trees -and -mud -villages -you -soon -realize -that -india -is -not -beautiful -still -there -is -an -enchantment -about -it -that -is -beguiling -and -which -does -not -pall -you -cannot -tell -just -what -it -is -that -makes -the -spell -perhaps -but -you -feel -it -and -confess -it -nevertheless -of -course -at -bottom -you -know -in -a -vague -way -that -it -is -history -it -is -that -that -affects -you -a -haunting -sense -of -the -myriads -of -human -lives -that -have -blossomed -and -withered -and -perished -here -repeating -and -repeating -and -repeating -century -after -century -and -age -after -age -the -barren -and -meaningless -process -it -is -this -sense -that -gives -to -this -forlorn -uncomely -land -power -to -speak -to -the -spirit -and -make -friends -with -it -to -speak -to -it -with -a -voice -bitter -with -satire -but -eloquent -with -melancholy -the -deserts -of -australia -and -the -ice -barrens -of -greenland -have -no -speech -for -they -have -no -venerable -history -with -nothing -to -tell -of -man -and -his -vanities -his -fleeting -glories -and -his -miseries -they -have -nothing -wherewith -to -spiritualize -their -ugliness -and -veil -it -with -a -charm -there -is -nothing -pretty -about -an -indian -village -a -mud -one -and -i -do -not -remember -that -we -saw -any -but -mud -ones -on -that -long -flight -to -allahabad -it -is -a -little -bunch -of -dirt -colored -mud -hovels -jammed -together -within -a -mud -wall -as -a -rule -the -rains -had -beaten -down -parts -of -some -of -the -houses -and -this -gave -the -village -the -aspect -of -a -mouldering -and -hoary -ruin -i -believe -the -cattle -and -the -vermin -live -inside -the -wall -for -i -saw -cattle -coming -out -and -cattle -going -in -and -whenever -i -saw -a -villager -he -was -scratching -this -last -is -only -circumstantial -evidence -but -i -think -it -has -value -the -village -has -a -battered -little -temple -or -two -big -enough -to -hold -an -idol -and -with -custom -enough -to -fat -up -a -priest -and -keep -him -comfortable -where -there -are -mohammedans -there -are -generally -a -few -sorry -tombs -outside -the -village -that -have -a -decayed -and -neglected -look -the -villages -interested -me -because -of -things -which -major -sleeman -says -about -them -in -his -books -particularly -what -he -says -about -the -division -of -labor -in -them -he -says -that -the -whole -face -of -india -is -parceled -out -into -estates -of -villages -that -nine -tenths -of -the -vast -population -of -the -land -consist -of -cultivators -of -the -soil -that -it -is -these -cultivators -who -inhabit -the -villages -that -there -are -certain -established -village -servants -mechanics -and -others -who -are -apparently -paid -a -wage -by -the -village -at -large -and -whose -callings -remain -in -certain -families -and -are -handed -down -from -father -to -son -like -an -estate -he -gives -a -list -of -these -established -servants -priest -blacksmith -carpenter -accountant -washerman -basketmaker -potter -watchman -barber -shoemaker -brazier -confectioner -weaver -dyer -etc -in -his -day -witches -abounded -and -it -was -not -thought -good -business -wisdom -for -a -man -to -marry -his -daughter -into -a -family -that -hadn't -a -witch -in -it -for -she -would -need -a -witch -on -the -premises -to -protect -her -children -from -the -evil -spells -which -would -certainly -be -cast -upon -them -by -the -witches -connected -with -the -neighboring -families -the -office -of -midwife -was -hereditary -in -the -family -of -the -basket -maker -it -belonged -to -his -wife -she -might -not -be -competent -but -the -office -was -hers -anyway -her -pay -was -not -high -25 -cents -for -a -boy -and -half -as -much -for -a -girl -the -girl -was -not -desired -because -she -would -be -a -disastrous -expense -by -and -by -as -soon -as -she -should -be -old -enough -to -begin -to -wear -clothes -for -propriety's -sake -it -would -be -a -disgrace -to -the -family -if -she -were -not -married -and -to -marry -her -meant -financial -ruin -for -by -custom -the -father -must -spend -upon -feasting -and -wedding -display -everything -he -had -and -all -he -could -borrow -in -fact -reduce -himself -to -a -condition -of -poverty -which -he -might -never -more -recover -from -it -was -the -dread -of -this -prospective -ruin -which -made -the -killing -of -girl -babies -so -prevalent -in -india -in -the -old -days -before -england -laid -the -iron -hand -of -her -prohibitions -upon -the -piteous -slaughter -one -may -judge -of -how -prevalent -the -custom -was -by -one -of -sleeman's -casual -electrical -remarks -when -he -speaks -of -children -at -play -in -villages -where -girl -voices -were -never -heard! -the -wedding -display -folly -is -still -in -full -force -in -india -and -by -consequence -the -destruction -of -girl -babies -is -still -furtively -practiced -but -not -largely -because -of -the -vigilance -of -the -government -and -the -sternness -of -the -penalties -it -levies -in -some -parts -of -india -the -village -keeps -in -its -pay -three -other -servants -an -astrologer -to -tell -the -villager -when -he -may -plant -his -crop -or -make -a -journey -or -marry -a -wife -or -strangle -a -child -or -borrow -a -dog -or -climb -a -tree -or -catch -a -rat -or -swindle -a -neighbor -without -offending -the -alert -and -solicitous -heavens -and -what -his -dream -means -if -he -has -had -one -and -was -not -bright -enough -to -interpret -it -himself -by -the -details -of -his -dinner -the -two -other -established -servants -were -the -tiger -persuader -and -the -hailstorm -discourager -the -one -kept -away -the -tigers -if -he -could -and -collected -the -wages -anyway -and -the -other -kept -off -the -hailstorms -or -explained -why -he -failed -he -charged -the -same -for -explaining -a -failure -that -he -did -for -scoring -a -success -a -man -is -an -idiot -who -can't -earn -a -living -in -india -major -sleeman -reveals -the -fact -that -the -trade -union -and -the -boycott -are -antiquities -in -india -india -seems -to -have -originated -everything -the -sweeper -belongs -to -the -bottom -caste -he -is -the -lowest -of -the -low -all -other -castes -despise -him -and -scorn -his -office -but -that -does -not -trouble -him -his -caste -is -a -caste -and -that -is -sufficient -for -him -and -so -he -is -proud -of -it -not -ashamed -sleeman -says -it -is -perhaps -not -known -to -many -of -my -countrymen -even -in -india -that -in -every -town -and -city -in -the -country -the -right -of -sweeping -the -houses -and -streets -is -a -monopoly -and -is -supported -entirely -by -the -pride -of -castes -among -the -scavengers -who -are -all -of -the -lowest -class -the -right -of -sweeping -within -a -certain -range -is -recognized -by -the -caste -to -belong -to -a -certain -member -and -if -any -other -member -presumes -to -sweep -within -that -range -he -is -excommunicated -no -other -member -will -smoke -out -of -his -pipe -or -drink -out -of -his -jug -and -he -can -get -restored -to -caste -only -by -a -feast -to -the -whole -body -of -sweepers -if -any -housekeeper -within -a -particular -circle -happens -to -offend -the -sweeper -of -that -range -none -of -his -filth -will -be -removed -till -he -pacifies -him -because -no -other -sweeper -will -dare -to -touch -it -and -the -people -of -a -town -are -often -more -tyrannized -over -by -these -people -than -by -any -other -a -footnote -by -major -sleeman's -editor -mr -vincent -arthur -smith -says -that -in -our -day -this -tyranny -of -the -sweepers' -guild -is -one -of -the -many -difficulties -which -bar -the -progress -of -indian -sanitary -reform -think -of -this -the -sweepers -cannot -be -readily -coerced -because -no -hindoo -or -mussulman -would -do -their -work -to -save -his -life -nor -will -he -pollute -himself -by -beating -the -refractory -scavenger -they -certainly -do -seem -to -have -the -whip -hand -it -would -be -difficult -to -imagine -a -more -impregnable -position -the -vested -rights -described -in -the -text -are -so -fully -recognized -in -practice -that -they -are -frequently -the -subject -of -sale -or -mortgage -just -like -a -milk -route -or -like -a -london -crossing -sweepership -it -is -said -that -the -london -crossing -sweeper's -right -to -his -crossing -is -recognized -by -the -rest -of -the -guild -that -they -protect -him -in -its -possession -that -certain -choice -crossings -are -valuable -property -and -are -saleable -at -high -figures -i -have -noticed -that -the -man -who -sweeps -in -front -of -the -army -and -navy -stores -has -a -wealthy -south -african -aristocratic -style -about -him -and -when -he -is -off -his -guard -he -has -exactly -that -look -on -his -face -which -you -always -see -in -the -face -of -a -man -who -has -is -saving -up -his -daughter -to -marry -her -to -a -duke -it -appears -from -sleeman -that -in -india -the -occupation -of -elephant -driver -is -confined -to -mohammedans -i -wonder -why -that -is -the -water -carrier -'bheestie' -is -a -mohammedan -but -it -is -said -that -the -reason -of -that -is -that -the -hindoo's -religion -does -not -allow -him -to -touch -the -skin -of -dead -kine -and -that -is -what -the -water -sack -is -made -of -it -would -defile -him -and -it -doesn't -allow -him -to -eat -meat -the -animal -that -furnished -the -meat -was -murdered -and -to -take -any -creature's -life -is -a -sin -it -is -a -good -and -gentle -religion -but -inconvenient -a -great -indian -river -at -low -water -suggests -the -familiar -anatomical -picture -of -a -skinned -human -body -the -intricate -mesh -of -interwoven -muscles -and -tendons -to -stand -for -water -channels -and -the -archipelagoes -of -fat -and -flesh -inclosed -by -them -to -stand -for -the -sandbars -somewhere -on -this -journey -we -passed -such -a -river -and -on -a -later -journey -we -saw -in -the -sutlej -the -duplicate -of -that -river -curious -rivers -they -are -low -shores -a -dizzy -distance -apart -with -nothing -between -but -an -enormous -acreage -of -sand -flats -with -sluggish -little -veins -of -water -dribbling -around -amongst -them -saharas -of -sand -smallpox -pitted -with -footprints -punctured -in -belts -as -straight -as -the -equator -clear -from -the -one -shore -to -the -other -barring -the -channel -interruptions -a -dry -shod -ferry -you -see -long -railway -bridges -are -required -for -this -sort -of -rivers -and -india -has -them -you -approach -allahabad -by -a -very -long -one -it -was -now -carrying -us -across -the -bed -of -the -jumna -a -bed -which -did -not -seem -to -have -been -slept -in -for -one -while -or -more -it -wasn't -all -river -bed -most -of -it -was -overflow -ground -allahabad -means -city -of -god -i -get -this -from -the -books -from -a -printed -curiosity -a -letter -written -by -one -of -those -brave -and -confident -hindoo -strugglers -with -the -english -tongue -called -a -babu -i -got -a -more -compressed -translation -godville -it -is -perfectly -correct -but -that -is -the -most -that -can -be -said -for -it -we -arrived -in -the -forenoon -and -short -handed -for -satan -got -left -behind -somewhere -that -morning -and -did -not -overtake -us -until -after -nightfall -it -seemed -very -peaceful -without -him -the -world -seemed -asleep -and -dreaming -i -did -not -see -the -native -town -i -think -i -do -not -remember -why -for -an -incident -connects -it -with -the -great -mutiny -and -that -is -enough -to -make -any -place -interesting -but -i -saw -the -english -part -of -the -city -it -is -a -town -of -wide -avenues -and -noble -distances -and -is -comely -and -alluring -and -full -of -suggestions -of -comfort -and -leisure -and -of -the -serenity -which -a -good -conscience -buttressed -by -a -sufficient -bank -account -gives -the -bungalows -dwellings -stand -well -back -in -the -seclusion -and -privacy -of -large -enclosed -compounds -private -grounds -as -we -should -say -and -in -the -shade -and -shelter -of -trees -even -the -photographer -and -the -prosperous -merchant -ply -their -industries -in -the -elegant -reserve -of -big -compounds -and -the -citizens -drive -in -thereupon -their -business -occasions -and -not -in -cabs -no -in -the -indian -cities -cabs -are -for -the -drifting -stranger -all -the -white -citizens -have -private -carriages -and -each -carriage -has -a -flock -of -white -turbaned -black -footmen -and -drivers -all -over -it -the -vicinity -of -a -lecture -hall -looks -like -a -snowstorm -and -makes -the -lecturer -feel -like -an -opera -india -has -many -names -and -they -are -correctly -descriptive -it -is -the -land -of -contradictions -the -land -of -subtlety -and -superstition -the -land -of -wealth -and -poverty -the -land -of -splendor -and -desolation -the -land -of -plague -and -famine -the -land -of -the -thug -and -the -poisoner -and -of -the -meek -and -the -patient -the -land -of -the -suttee -the -land -of -the -unreinstatable -widow -the -land -where -all -life -is -holy -the -land -of -cremation -the -land -where -the -vulture -is -a -grave -and -a -monument -the -land -of -the -multitudinous -gods -and -if -signs -go -for -anything -it -is -the -land -of -the -private -carriage -in -bombay -the -forewoman -of -a -millinery -shop -came -to -the -hotel -in -her -private -carriage -to -take -the -measure -for -a -gown -not -for -me -but -for -another -she -had -come -out -to -india -to -make -a -temporary -stay -but -was -extending -it -indefinitely -indeed -she -was -purposing -to -end -her -days -there -in -london -she -said -her -work -had -been -hard -her -hours -long -for -economy's -sake -she -had -had -to -live -in -shabby -rooms -and -far -away -from -the -shop -watch -the -pennies -deny -herself -many -of -the -common -comforts -of -life -restrict -herself -in -effect -to -its -bare -necessities -eschew -cabs -travel -third -class -by -underground -train -to -and -from -her -work -swallowing -coal -smoke -and -cinders -all -the -way -and -sometimes -troubled -with -the -society -of -men -and -women -who -were -less -desirable -than -the -smoke -and -the -cinders -but -in -bombay -on -almost -any -kind -of -wages -she -could -live -in -comfort -and -keep -her -carriage -and -have -six -servants -in -place -of -the -woman -of -all -work -she -had -had -in -her -english -home -later -in -calcutta -i -found -that -the -standard -oil -clerks -had -small -one -horse -vehicles -and -did -no -walking -and -i -was -told -that -the -clerks -of -the -other -large -concerns -there -had -the -like -equipment -but -to -return -to -allahabad -i -was -up -at -dawn -the -next -morning -in -india -the -tourist's -servant -does -not -sleep -in -a -room -in -the -hotel -but -rolls -himself -up -head -and -ears -in -his -blanket -and -stretches -himself -on -the -veranda -across -the -front -of -his -master's -door -and -spends -the -night -there -i -don't -believe -anybody's -servant -occupies -a -room -apparently -the -bungalow -servants -sleep -on -the -veranda -it -is -roomy -and -goes -all -around -the -house -i -speak -of -menservants -i -saw -none -of -the -other -sex -i -think -there -are -none -except -child -nurses -i -was -up -at -dawn -and -walked -around -the -veranda -past -the -rows -of -sleepers -in -front -of -one -door -a -hindoo -servant -was -squatting -waiting -for -his -master -to -call -him -he -had -polished -the -yellow -shoes -and -placed -them -by -the -door -and -now -he -had -nothing -to -do -but -wait -it -was -freezing -cold -but -there -he -was -as -motionless -as -a -sculptured -image -and -as -patient -it -troubled -me -i -wanted -to -say -to -him -don't -crouch -there -like -that -and -freeze -nobody -requires -it -of -you -stir -around -and -get -warm -but -i -hadn't -the -words -i -thought -of -saying -'jeldy -jow' -but -i -couldn't -remember -what -it -meant -so -i -didn't -say -it -i -knew -another -phrase -but -it -wouldn't -come -to -my -mind -i -moved -on -purposing -to -dismiss -him -from -my -thoughts -but -his -bare -legs -and -bare -feet -kept -him -there -they -kept -drawing -me -back -from -the -sunny -side -to -a -point -whence -i -could -see -him -at -the -end -of -an -hour -he -had -not -changed -his -attitude -in -the -least -degree -it -was -a -curious -and -impressive -exhibition -of -meekness -and -patience -or -fortitude -or -indifference -i -did -not -know -which -but -it -worried -me -and -it -was -spoiling -my -morning -in -fact -it -spoiled -two -hours -of -it -quite -thoroughly -i -quitted -this -vicinity -then -and -left -him -to -punish -himself -as -much -as -he -might -want -to -but -up -to -that -time -the -man -had -not -changed -his -attitude -a -hair -he -will -always -remain -with -me -i -suppose -his -figure -never -grows -vague -in -my -memory -whenever -i -read -of -indian -resignation -indian -patience -under -wrongs -hardships -and -misfortunes -he -comes -before -me -he -becomes -a -personification -and -stands -for -india -in -trouble -and -for -untold -ages -india -in -trouble -has -been -pursued -with -the -very -remark -which -i -was -going -to -utter -but -didn't -because -its -meaning -had -slipped -me -jeddy -jow! -come -shove -along! -why -it -was -the -very -thing -in -the -early -brightness -we -made -a -long -drive -out -to -the -fort -part -of -the -way -was -beautiful -it -led -under -stately -trees -and -through -groups -of -native -houses -and -by -the -usual -village -well -where -the -picturesque -gangs -are -always -flocking -to -and -fro -and -laughing -and -chattering -and -this -time -brawny -men -were -deluging -their -bronze -bodies -with -the -limpid -water -and -making -a -refreshing -and -enticing -show -of -it -enticing -for -the -sun -was -already -transacting -business -firing -india -up -for -the -day -there -was -plenty -of -this -early -bathing -going -on -for -it -was -getting -toward -breakfast -time -and -with -an -unpurified -body -the -hindoo -must -not -eat -then -we -struck -into -the -hot -plain -and -found -the -roads -crowded -with -pilgrims -of -both -sexes -for -one -of -the -great -religious -fairs -of -india -was -being -held -just -beyond -the -fort -at -the -junction -of -the -sacred -rivers -the -ganges -and -the -jumna -three -sacred -rivers -i -should -have -said -for -there -is -a -subterranean -one -nobody -has -seen -it -but -that -doesn't -signify -the -fact -that -it -is -there -is -enough -these -pilgrims -had -come -from -all -over -india -some -of -them -had -been -months -on -the -way -plodding -patiently -along -in -the -heat -and -dust -worn -poor -hungry -but -supported -and -sustained -by -an -unwavering -faith -and -belief -they -were -supremely -happy -and -content -now -their -full -and -sufficient -reward -was -at -hand -they -were -going -to -be -cleansed -from -every -vestige -of -sin -and -corruption -by -these -holy -waters -which -make -utterly -pure -whatsoever -thing -they -touch -even -the -dead -and -rotten -it -is -wonderful -the -power -of -a -faith -like -that -that -can -make -multitudes -upon -multitudes -of -the -old -and -weak -and -the -young -and -frail -enter -without -hesitation -or -complaint -upon -such -incredible -journeys -and -endure -the -resultant -miseries -without -repining -it -is -done -in -love -or -it -is -done -in -fear -i -do -not -know -which -it -is -no -matter -what -the -impulse -is -the -act -born -of -it -is -beyond -imagination -marvelous -to -our -kind -of -people -the -cold -whites -there -are -choice -great -natures -among -us -that -could -exhibit -the -equivalent -of -this -prodigious -self -sacrifice -but -the -rest -of -us -know -that -we -should -not -be -equal -to -anything -approaching -it -still -we -all -talk -self -sacrifice -and -this -makes -me -hope -that -we -are -large -enough -to -honor -it -in -the -hindoo -two -millions -of -natives -arrive -at -this -fair -every -year -how -many -start -and -die -on -the -road -from -age -and -fatigue -and -disease -and -scanty -nourishment -and -how -many -die -on -the -return -from -the -same -causes -no -one -knows -but -the -tale -is -great -one -may -say -enormous -every -twelfth -year -is -held -to -be -a -year -of -peculiar -grace -a -greatly -augmented -volume -of -pilgrims -results -then -the -twelfth -year -has -held -this -distinction -since -the -remotest -times -it -is -said -it -is -said -also -that -there -is -to -be -but -one -more -twelfth -year -for -the -ganges -after -that -that -holiest -of -all -sacred -rivers -will -cease -to -be -holy -and -will -be -abandoned -by -the -pilgrim -for -many -centuries -how -many -the -wise -men -have -not -stated -at -the -end -of -that -interval -it -will -become -holy -again -meantime -the -data -will -be -arranged -by -those -people -who -have -charge -of -all -such -matters -the -great -chief -brahmins -it -will -be -like -shutting -down -a -mint -at -a -first -glance -it -looks -most -unbrahminically -uncommercial -but -i -am -not -disturbed -being -soothed -and -tranquilized -by -their -reputation -brer -fox -he -lay -low -as -uncle -remus -says -and -at -the -judicious -time -he -will -spring -something -on -the -indian -public -which -will -show -that -he -was -not -financially -asleep -when -he -took -the -ganges -out -of -the -market -great -numbers -of -the -natives -along -the -roads -were -bringing -away -holy -water -from -the -rivers -they -would -carry -it -far -and -wide -in -india -and -sell -it -tavernier -the -french -traveler -17th -century -notes -that -ganges -water -is -often -given -at -weddings -each -guest -receiving -a -cup -or -two -according -to -the -liberality -of -the -host -sometimes -2 -000 -or -3 -000 -rupees' -worth -of -it -is -consumed -at -a -wedding -the -fort -is -a -huge -old -structure -and -has -had -a -large -experience -in -religions -in -its -great -court -stands -a -monolith -which -was -placed -there -more -than -2 -000 -years -ago -to -preach -budhism -by -its -pious -inscription -the -fort -was -built -three -centuries -ago -by -a -mohammedan -emperor -a -resanctification -of -the -place -in -the -interest -of -that -religion -there -is -a -hindoo -temple -too -with -subterranean -ramifications -stocked -with -shrines -and -idols -and -now -the -fort -belongs -to -the -english -it -contains -a -christian -church -insured -in -all -the -companies -from -the -lofty -ramparts -one -has -a -fine -view -of -the -sacred -rivers -they -join -at -that -point -the -pale -blue -jumna -apparently -clean -and -clear -and -the -muddy -ganges -dull -yellow -and -not -clean -on -a -long -curved -spit -between -the -rivers -towns -of -tents -were -visible -with -a -multitude -of -fluttering -pennons -and -a -mighty -swarm -of -pilgrims -it -was -a -troublesome -place -to -get -down -to -and -not -a -quiet -place -when -you -arrived -but -it -was -interesting -there -was -a -world -of -activity -and -turmoil -and -noise -partly -religious -partly -commercial -for -the -mohammedans -were -there -to -curse -and -sell -and -the -hindoos -to -buy -and -pray -it -is -a -fair -as -well -as -a -religious -festival -crowds -were -bathing -praying -and -drinking -the -purifying -waters -and -many -sick -pilgrims -had -come -long -journeys -in -palanquins -to -be -healed -of -their -maladies -by -a -bath -or -if -that -might -not -be -then -to -die -on -the -blessed -banks -and -so -make -sure -of -heaven -there -were -fakeers -in -plenty -with -their -bodies -dusted -over -with -ashes -and -their -long -hair -caked -together -with -cow -dung -for -the -cow -is -holy -and -so -is -the -rest -of -it -so -holy -that -the -good -hindoo -peasant -frescoes -the -walls -of -his -hut -with -this -refuse -and -also -constructs -ornamental -figures -out -of -it -for -the -gracing -of -his -dirt -floor -there -were -seated -families -fearfully -and -wonderfully -painted -who -by -attitude -and -grouping -represented -the -families -of -certain -great -gods -there -was -a -holy -man -who -sat -naked -by -the -day -and -by -the -week -on -a -cluster -of -iron -spikes -and -did -not -seem -to -mind -it -and -another -holy -man -who -stood -all -day -holding -his -withered -arms -motionless -aloft -and -was -said -to -have -been -doing -it -for -years -all -of -these -performers -have -a -cloth -on -the -ground -beside -them -for -the -reception -of -contributions -and -even -the -poorest -of -the -people -give -a -trifle -and -hope -that -the -sacrifice -will -be -blessed -to -him -at -last -came -a -procession -of -naked -holy -people -marching -by -and -chanting -and -i -wrenched -myself -away -chapter -l -the -man -who -is -ostentatious -of -his -modesty -is -twin -to -the -statue -that -wears -a -fig -leaf -pudd'nhead -wilson's -new -calendar -the -journey -to -benares -was -all -in -daylight -and -occupied -but -a -few -hours -it -was -admirably -dusty -the -dust -settled -upon -you -in -a -thick -ashy -layer -and -turned -you -into -a -fakeer -with -nothing -lacking -to -the -role -but -the -cow -manure -and -the -sense -of -holiness -there -was -a -change -of -cars -about -mid -afternoon -at -moghul -serai -if -that -was -the -name -and -a -wait -of -two -hours -there -for -the -benares -train -we -could -have -found -a -carriage -and -driven -to -the -sacred -city -but -we -should -have -lost -the -wait -in -other -countries -a -long -wait -at -a -station -is -a -dull -thing -and -tedious -but -one -has -no -right -to -have -that -feeling -in -india -you -have -the -monster -crowd -of -bejeweled -natives -the -stir -the -bustle -the -confusion -the -shifting -splendors -of -the -costumes -dear -me -the -delight -of -it -the -charm -of -it -are -beyond -speech -the -two -hour -wait -was -over -too -soon -among -other -satisfying -things -to -look -at -was -a -minor -native -prince -from -the -backwoods -somewhere -with -his -guard -of -honor -a -ragged -but -wonderfully -gaudy -gang -of -fifty -dark -barbarians -armed -with -rusty -flint -lock -muskets -the -general -show -came -so -near -to -exhausting -variety -that -one -would -have -said -that -no -addition -to -it -could -be -conspicuous -but -when -this -falstaff -and -his -motleys -marched -through -it -one -saw -that -that -seeming -impossibility -had -happened -we -got -away -by -and -by -and -soon -reached -the -outer -edge -of -benares -then -there -was -another -wait -but -as -usual -with -something -to -look -at -this -was -a -cluster -of -little -canvas -boxes -palanquins -a -canvas -box -is -not -much -of -a -sight -when -empty -but -when -there -is -a -lady -in -it -it -is -an -object -of -interest -these -boxes -were -grouped -apart -in -the -full -blaze -of -the -terrible -sun -during -the -three -quarters -of -an -hour -that -we -tarried -there -they -contained -zenana -ladies -they -had -to -sit -up -there -was -not -room -enough -to -stretch -out -they -probably -did -not -mind -it -they -are -used -to -the -close -captivity -of -the -dwellings -all -their -lives -when -they -go -a -journey -they -are -carried -to -the -train -in -these -boxes -in -the -train -they -have -to -be -secluded -from -inspection -many -people -pity -them -and -i -always -did -it -myself -and -never -charged -anything -but -it -is -doubtful -if -this -compassion -is -valued -while -we -were -in -india -some -good -hearted -europeans -in -one -of -the -cities -proposed -to -restrict -a -large -park -to -the -use -of -zenana -ladies -so -that -they -could -go -there -and -in -assured -privacy -go -about -unveiled -and -enjoy -the -sunshine -and -air -as -they -had -never -enjoyed -them -before -the -good -intentions -back -of -the -proposition -were -recognized -and -sincere -thanks -returned -for -it -but -the -proposition -itself -met -with -a -prompt -declination -at -the -hands -of -those -who -were -authorized -to -speak -for -the -zenana -ladies -apparently -the -idea -was -shocking -to -the -ladies -indeed -it -was -quite -manifestly -shocking -was -that -proposition -the -equivalent -of -inviting -european -ladies -to -assemble -scantily -and -scandalously -clothed -in -the -seclusion -of -a -private -park -it -seemed -to -be -about -that -without -doubt -modesty -is -nothing -less -than -a -holy -feeling -and -without -doubt -the -person -whose -rule -of -modesty -has -been -transgressed -feels -the -same -sort -of -wound -that -he -would -feel -if -something -made -holy -to -him -by -his -religion -had -suffered -a -desecration -i -say -rule -of -modesty -because -there -are -about -a -million -rules -in -the -world -and -this -makes -a -million -standards -to -be -looked -out -for -major -sleeman -mentions -the -case -of -some -high -caste -veiled -ladies -who -were -profoundly -scandalized -when -some -english -young -ladies -passed -by -with -faces -bare -to -the -world -so -scandalized -that -they -spoke -out -with -strong -indignation -and -wondered -that -people -could -be -so -shameless -as -to -expose -their -persons -like -that -and -yet -the -legs -of -the -objectors -were -naked -to -mid -thigh -both -parties -were -clean -minded -and -irreproachably -modest -while -abiding -by -their -separate -rules -but -they -couldn't -have -traded -rules -for -a -change -without -suffering -considerable -discomfort -all -human -rules -are -more -or -less -idiotic -i -suppose -it -is -best -so -no -doubt -the -way -it -is -now -the -asylums -can -hold -the -sane -people -but -if -we -tried -to -shut -up -the -insane -we -should -run -out -of -building -materials -you -have -a -long -drive -through -the -outskirts -of -benares -before -you -get -to -the -hotel -and -all -the -aspects -are -melancholy -it -is -a -vision -of -dusty -sterility -decaying -temples -crumbling -tombs -broken -mud -walls -shabby -huts -the -whole -region -seems -to -ache -with -age -and -penury -it -must -take -ten -thousand -years -of -want -to -produce -such -an -aspect -we -were -still -outside -of -the -great -native -city -when -we -reached -the -hotel -it -was -a -quiet -and -homelike -house -inviting -and -manifestly -comfortable -but -we -liked -its -annex -better -and -went -thither -it -was -a -mile -away -perhaps -and -stood -in -the -midst -of -a -large -compound -and -was -built -bungalow -fashion -everything -on -the -ground -floor -and -a -veranda -all -around -they -have -doors -in -india -but -i -don't -know -why -they -don't -fasten -and -they -stand -open -as -a -rule -with -a -curtain -hanging -in -the -doorspace -to -keep -out -the -glare -of -the -sun -still -there -is -plenty -of -privacy -for -no -white -person -will -come -in -without -notice -of -course -the -native -men -servants -will -but -they -don't -seem -to -count -they -glide -in -barefoot -and -noiseless -and -are -in -the -midst -before -one -knows -it -at -first -this -is -a -shock -and -sometimes -it -is -an -embarrassment -but -one -has -to -get -used -to -it -and -does -there -was -one -tree -in -the -compound -and -a -monkey -lived -in -it -at -first -i -was -strongly -interested -in -the -tree -for -i -was -told -that -it -was -the -renowned -peepul -the -tree -in -whose -shadow -you -cannot -tell -a -lie -this -one -failed -to -stand -the -test -and -i -went -away -from -it -disappointed -there -was -a -softly -creaking -well -close -by -and -a -couple -of -oxen -drew -water -from -it -by -the -hour -superintended -by -two -natives -dressed -in -the -usual -turban -and -pocket -handkerchief -the -tree -and -the -well -were -the -only -scenery -and -so -the -compound -was -a -soothing -and -lonesome -and -satisfying -place -and -very -restful -after -so -many -activities -there -was -nobody -in -our -bungalow -but -ourselves -the -other -guests -were -in -the -next -one -where -the -table -d'hote -was -furnished -a -body -could -not -be -more -pleasantly -situated -each -room -had -the -customary -bath -attached -a -room -ten -or -twelve -feet -square -with -a -roomy -stone -paved -pit -in -it -and -abundance -of -water -one -could -not -easily -improve -upon -this -arrangement -except -by -furnishing -it -with -cold -water -and -excluding -the -hot -in -deference -to -the -fervency -of -the -climate -but -that -is -forbidden -it -would -damage -the -bather's -health -the -stranger -is -warned -against -taking -cold -baths -in -india -but -even -the -most -intelligent -strangers -are -fools -and -they -do -not -obey -and -so -they -presently -get -laid -up -i -was -the -most -intelligent -fool -that -passed -through -that -year -but -i -am -still -more -intelligent -now -now -that -it -is -too -late -i -wonder -if -the -'dorian' -if -that -is -the -name -of -it -is -another -superstition -like -the -peepul -tree -there -was -a -great -abundance -and -variety -of -tropical -fruits -but -the -dorian -was -never -in -evidence -it -was -never -the -season -for -the -dorian -it -was -always -going -to -arrive -from -burma -sometime -or -other -but -it -never -did -by -all -accounts -it -was -a -most -strange -fruit -and -incomparably -delicious -to -the -taste -but -not -to -the -smell -its -rind -was -said -to -exude -a -stench -of -so -atrocious -a -nature -that -when -a -dorian -was -in -the -room -even -the -presence -of -a -polecat -was -a -refreshment -we -found -many -who -had -eaten -the -dorian -and -they -all -spoke -of -it -with -a -sort -of -rapture -they -said -that -if -you -could -hold -your -nose -until -the -fruit -was -in -your -mouth -a -sacred -joy -would -suffuse -you -from -head -to -foot -that -would -make -you -oblivious -to -the -smell -of -the -rind -but -that -if -your -grip -slipped -and -you -caught -the -smell -of -the -rind -before -the -fruit -was -in -your -mouth -you -would -faint -there -is -a -fortune -in -that -rind -some -day -somebody -will -import -it -into -europe -and -sell -it -for -cheese -benares -was -not -a -disappointment -it -justified -its -reputation -as -a -curiosity -it -is -on -high -ground -and -overhangs -a -grand -curve -of -the -ganges -it -is -a -vast -mass -of -building -compactly -crusting -a -hill -and -is -cloven -in -all -directions -by -an -intricate -confusion -of -cracks -which -stand -for -streets -tall -slim -minarets -and -beflagged -temple -spires -rise -out -of -it -and -give -it -picturesqueness -viewed -from -the -river -the -city -is -as -busy -as -an -ant -hill -and -the -hurly -burly -of -human -life -swarming -along -the -web -of -narrow -streets -reminds -one -of -the -ants -the -sacred -cow -swarms -along -too -and -goes -whither -she -pleases -and -takes -toll -of -the -grain -shops -and -is -very -much -in -the -way -and -is -a -good -deal -of -a -nuisance -since -she -must -not -be -molested -benares -is -older -than -history -older -than -tradition -older -even -than -legend -and -looks -twice -as -old -as -all -of -them -put -together -from -a -hindoo -statement -quoted -in -rev -mr -parker's -compact -and -lucid -guide -to -benares -i -find -that -the -site -of -the -town -was -the -beginning -place -of -the -creation -it -was -merely -an -upright -lingam -at -first -no -larger -than -a -stove -pipe -and -stood -in -the -midst -of -a -shoreless -ocean -this -was -the -work -of -the -god -vishnu -later -he -spread -the -lingam -out -till -its -surface -was -ten -miles -across -still -it -was -not -large -enough -for -the -business -therefore -he -presently -built -the -globe -around -it -benares -is -thus -the -center -of -the -earth -this -is -considered -an -advantage -it -has -had -a -tumultuous -history -both -materially -and -spiritually -it -started -brahminically -many -ages -ago -then -by -and -by -buddha -came -in -recent -times -2 -500 -years -ago -and -after -that -it -was -buddhist -during -many -centuries -twelve -perhaps -but -the -brahmins -got -the -upper -hand -again -then -and -have -held -it -ever -since -it -is -unspeakably -sacred -in -hindoo -eyes -and -is -as -unsanitary -as -it -is -sacred -and -smells -like -the -rind -of -the -dorian -it -is -the -headquarters -of -the -brahmin -faith -and -one -eighth -of -the -population -are -priests -of -that -church -but -it -is -not -an -overstock -for -they -have -all -india -as -a -prey -all -india -flocks -thither -on -pilgrimage -and -pours -its -savings -into -the -pockets -of -the -priests -in -a -generous -stream -which -never -fails -a -priest -with -a -good -stand -on -the -shore -of -the -ganges -is -much -better -off -than -the -sweeper -of -the -best -crossing -in -london -a -good -stand -is -worth -a -world -of -money -the -holy -proprietor -of -it -sits -under -his -grand -spectacular -umbrella -and -blesses -people -all -his -life -and -collects -his -commission -and -grows -fat -and -rich -and -the -stand -passes -from -father -to -son -down -and -down -and -down -through -the -ages -and -remains -a -permanent -and -lucrative -estate -in -the -family -as -mr -parker -suggests -it -can -become -a -subject -of -dispute -at -one -time -or -another -and -then -the -matter -will -be -settled -not -by -prayer -and -fasting -and -consultations -with -vishnu -but -by -the -intervention -of -a -much -more -puissant -power -an -english -court -in -bombay -i -was -told -by -an -american -missionary -that -in -india -there -are -640 -protestant -missionaries -at -work -at -first -it -seemed -an -immense -force -but -of -course -that -was -a -thoughtless -idea -one -missionary -to -500 -000 -natives -no -that -is -not -a -force -it -is -the -reverse -of -it -640 -marching -against -an -intrenched -camp -of -300 -000 -000 -the -odds -are -too -great -a -force -of -640 -in -benares -alone -would -have -its -hands -over -full -with -8 -000 -brahmin -priests -for -adversary -missionaries -need -to -be -well -equipped -with -hope -and -confidence -and -this -equipment -they -seem -to -have -always -had -in -all -parts -of -the -world -mr -parker -has -it -it -enables -him -to -get -a -favorable -outlook -out -of -statistics -which -might -add -up -differently -with -other -mathematicians -for -instance -during -the -past -few -years -competent -observers -declare -that -the -number -of -pilgrims -to -benares -has -increased -and -then -he -adds -up -this -fact -and -gets -this -conclusion -but -the -revival -if -so -it -may -be -called -has -in -it -the -marks -of -death -it -is -a -spasmodic -struggle -before -dissolution -in -this -world -we -have -seen -the -roman -catholic -power -dying -upon -these -same -terms -for -many -centuries -many -a -time -we -have -gotten -all -ready -for -the -funeral -and -found -it -postponed -again -on -account -of -the -weather -or -something -taught -by -experience -we -ought -not -to -put -on -our -things -for -this -brahminical -one -till -we -see -the -procession -move -apparently -one -of -the -most -uncertain -things -in -the -world -is -the -funeral -of -a -religion -i -should -have -been -glad -to -acquire -some -sort -of -idea -of -hindoo -theology -but -the -difficulties -were -too -great -the -matter -was -too -intricate -even -the -mere -a -b -c -of -it -is -baffling -there -is -a -trinity -brahma -shiva -and -vishnu -independent -powers -apparently -though -one -cannot -feel -quite -sure -of -that -because -in -one -of -the -temples -there -is -an -image -where -an -attempt -has -been -made -to -concentrate -the -three -in -one -person -the -three -have -other -names -and -plenty -of -them -and -this -makes -confusion -in -one's -mind -the -three -have -wives -and -the -wives -have -several -names -and -this -increases -the -confusion -there -are -children -the -children -have -many -names -and -thus -the -confusion -goes -on -and -on -it -is -not -worth -while -to -try -to -get -any -grip -upon -the -cloud -of -minor -gods -there -are -too -many -of -them -it -is -even -a -justifiable -economy -to -leave -brahma -the -chiefest -god -of -all -out -of -your -studies -for -he -seems -to -cut -no -great -figure -in -india -the -vast -bulk -of -the -national -worship -is -lavished -upon -shiva -and -vishnu -and -their -families -shiva's -symbol -the -lingam -with -which -vishnu -began -the -creation -is -worshiped -by -everybody -apparently -it -is -the -commonest -object -in -benares -it -is -on -view -everywhere -it -is -garlanded -with -flowers -offerings -are -made -to -it -it -suffers -no -neglect -commonly -it -is -an -upright -stone -shaped -like -a -thimble -sometimes -like -an -elongated -thimble -this -priapus -worship -then -is -older -than -history -mr -parker -says -that -the -lingams -in -benares -outnumber -the -inhabitants -in -benares -there -are -many -mohammedan -mosques -there -are -hindoo -temples -without -number -these -quaintly -shaped -and -elaborately -sculptured -little -stone -jugs -crowd -all -the -lanes -the -ganges -itself -and -every -individual -drop -of -water -in -it -are -temples -religion -then -is -the -business -of -benares -just -as -gold -production -is -the -business -of -johannesburg -other -industries -count -for -nothing -as -compared -with -the -vast -and -all -absorbing -rush -and -drive -and -boom -of -the -town's -specialty -benares -is -the -sacredest -of -sacred -cities -the -moment -you -step -across -the -sharply -defined -line -which -separates -it -from -the -rest -of -the -globe -you -stand -upon -ineffably -and -unspeakably -holy -ground -mr -parker -says -it -is -impossible -to -convey -any -adequate -idea -of -the -intense -feelings -of -veneration -and -affection -with -which -the -pious -hindoo -regards -'holy -kashi' -benares -and -then -he -gives -you -this -vivid -and -moving -picture -let -a -hindoo -regiment -be -marched -through -the -district -and -as -soon -as -they -cross -the -line -and -enter -the -limits -of -the -holy -place -they -rend -the -air -with -cries -of -'kashi -ji -ki -jai -jai -jai! -holy -kashi! -hail -to -thee! -hail! -hail! -hail -' -the -weary -pilgrim -scarcely -able -to -stand -with -age -and -weakness -blinded -by -the -dust -and -heat -and -almost -dead -with -fatigue -crawls -out -of -the -oven -like -railway -carriage -and -as -soon -as -his -feet -touch -the -ground -he -lifts -up -his -withered -hands -and -utters -the -same -pious -exclamation -let -a -european -in -some -distant -city -in -casual -talk -in -the -bazar -mention -the -fact -that -he -has -lived -at -benares -and -at -once -voices -will -be -raised -to -call -down -blessings -on -his -head -for -a -dweller -in -benares -is -of -all -men -most -blessed -it -makes -our -own -religious -enthusiasm -seem -pale -and -cold -inasmuch -as -the -life -of -religion -is -in -the -heart -not -the -head -mr -parker's -touching -picture -seems -to -promise -a -sort -of -indefinite -postponement -of -that -funeral -chapter -li -let -me -make -the -superstitions -of -a -nation -and -i -care -not -who -makes -its -laws -or -its -songs -either -pudd'nhead -wilson's -new -calendar -yes -the -city -of -benares -is -in -effect -just -a -big -church -a -religious -hive -whose -every -cell -is -a -temple -a -shrine -or -a -mosque -and -whose -every -conceivable -earthly -and -heavenly -good -is -procurable -under -one -roof -so -to -speak -a -sort -of -army -and -navy -stores -theologically -stocked -i -will -make -out -a -little -itinerary -for -the -pilgrim -then -you -will -see -how -handy -the -system -is -how -convenient -how -comprehensive -if -you -go -to -benares -with -a -serious -desire -to -spiritually -benefit -yourself -you -will -find -it -valuable -i -got -some -of -the -facts -from -conversations -with -the -rev -mr -parker -and -the -others -from -his -guide -to -benares -they -are -therefore -trustworthy -1 -purification -at -sunrise -you -must -go -down -to -the -ganges -and -bathe -pray -and -drink -some -of -the -water -this -is -for -your -general -purification -2 -protection -against -hunger -next -you -must -fortify -yourself -against -the -sorrowful -earthly -ill -just -named -this -you -will -do -by -worshiping -for -a -moment -in -the -cow -temple -by -the -door -of -it -you -will -find -an -image -of -ganesh -son -of -shiva -it -has -the -head -of -an -elephant -on -a -human -body -its -face -and -hands -are -of -silver -you -will -worship -it -a -little -and -pass -on -into -a -covered -veranda -where -you -will -find -devotees -reciting -from -the -sacred -books -with -the -help -of -instructors -in -this -place -are -groups -of -rude -and -dismal -idols -you -may -contribute -something -for -their -support -then -pass -into -the -temple -a -grim -and -stenchy -place -for -it -is -populous -with -sacred -cows -and -with -beggars -you -will -give -something -to -the -beggars -and -reverently -kiss -the -tails -of -such -cows -as -pass -along -for -these -cows -are -peculiarly -holy -and -this -act -of -worship -will -secure -you -from -hunger -for -the -day -3 -the -poor -man's -friend -you -will -next -worship -this -god -he -is -at -the -bottom -of -a -stone -cistern -in -the -temple -of -dalbhyeswar -under -the -shade -of -a -noble -peepul -tree -on -the -bluff -overlooking -the -ganges -so -you -must -go -back -to -the -river -the -poor -man's -friend -is -the -god -of -material -prosperity -in -general -and -the -god -of -the -rain -in -particular -you -will -secure -material -prosperity -or -both -by -worshiping -him -he -is -shiva -under -a -new -alias -and -he -abides -in -the -bottom -of -that -cistern -in -the -form -of -a -stone -lingam -you -pour -ganges -water -over -him -and -in -return -for -this -homage -you -get -the -promised -benefits -if -there -is -any -delay -about -the -rain -you -must -pour -water -in -until -the -cistern -is -full -the -rain -will -then -be -sure -to -come -4 -fever -at -the -kedar -ghat -you -will -find -a -long -flight -of -stone -steps -leading -down -to -the -river -half -way -down -is -a -tank -filled -with -sewage -drink -as -much -of -it -as -you -want -it -is -for -fever -5 -smallpox -go -straight -from -there -to -the -central -ghat -at -its -upstream -end -you -will -find -a -small -whitewashed -building -which -is -a -temple -sacred -to -sitala -goddess -of -smallpox -her -under -study -is -there -a -rude -human -figure -behind -a -brass -screen -you -will -worship -this -for -reasons -to -be -furnished -presently -6 -the -well -of -fate -for -certain -reasons -you -will -next -go -and -do -homage -at -this -well -you -will -find -it -in -the -dandpan -temple -in -the -city -the -sunlight -falls -into -it -from -a -square -hole -in -the -masonry -above -you -will -approach -it -with -awe -for -your -life -is -now -at -stake -you -will -bend -over -and -look -if -the -fates -are -propitious -you -will -see -your -face -pictured -in -the -water -far -down -in -the -well -if -matters -have -been -otherwise -ordered -a -sudden -cloud -will -mask -the -sun -and -you -will -see -nothing -this -means -that -you -have -not -six -months -to -live -if -you -are -already -at -the -point -of -death -your -circumstances -are -now -serious -there -is -no -time -to -lose -let -this -world -go -arrange -for -the -next -one -handily -situated -at -your -very -elbow -is -opportunity -for -this -you -turn -and -worship -the -image -of -maha -kal -the -great -fate -and -happiness -in -the -life -to -come -is -secured -if -there -is -breath -in -your -body -yet -you -should -now -make -an -effort -to -get -a -further -lease -of -the -present -life -you -have -a -chance -there -is -a -chance -for -everything -in -this -admirably -stocked -and -wonderfully -systemized -spiritual -and -temporal -army -and -navy -store -you -must -get -yourself -carried -to -the -7 -well -of -long -life -this -is -within -the -precincts -of -the -mouldering -and -venerable -briddhkal -temple -which -is -one -of -the -oldest -in -benares -you -pass -in -by -a -stone -image -of -the -monkey -god -hanuman -and -there -among -the -ruined -courtyards -you -will -find -a -shallow -pool -of -stagnant -sewage -it -smells -like -the -best -limburger -cheese -and -is -filthy -with -the -washings -of -rotting -lepers -but -that -is -nothing -bathe -in -it -bathe -in -it -gratefully -and -worshipfully -for -this -is -the -fountain -of -youth -these -are -the -waters -of -long -life -your -gray -hairs -will -disappear -and -with -them -your -wrinkles -and -your -rheumatism -the -burdens -of -care -and -the -weariness -of -age -and -you -will -come -out -young -fresh -elastic -and -full -of -eagerness -for -the -new -race -of -life -now -will -come -flooding -upon -you -the -manifold -desires -that -haunt -the -dear -dreams -of -the -morning -of -life -you -will -go -whither -you -will -find -8 -fulfillment -of -desire -to -wit -to -the -kameshwar -temple -sacred -to -shiva -as -the -lord -of -desires -arrange -for -yours -there -and -if -you -like -to -look -at -idols -among -the -pack -and -jam -of -temples -there -you -will -find -enough -to -stock -a -museum -you -will -begin -to -commit -sins -now -with -a -fresh -new -vivacity -therefore -it -will -be -well -to -go -frequently -to -a -place -where -you -can -get -9 -temporary -cleansing -from -sin -to -wit -to -the -well -of -the -earring -you -must -approach -this -with -the -profoundest -reverence -for -it -is -unutterably -sacred -it -is -indeed -the -most -sacred -place -in -benares -the -very -holy -of -holies -in -the -estimation -of -the -people -it -is -a -railed -tank -with -stone -stairways -leading -down -to -the -water -the -water -is -not -clean -of -course -it -could -not -be -for -people -are -always -bathing -in -it -as -long -as -you -choose -to -stand -and -look -you -will -see -the -files -of -sinners -descending -and -ascending -descending -soiled -with -sin -ascending -purged -from -it -the -liar -the -thief -the -murderer -and -the -adulterer -may -here -wash -and -be -clean -says -the -rev -mr -parker -in -his -book -very -well -i -know -mr -parker -and -i -believe -it -but -if -anybody -else -had -said -it -i -should -consider -him -a -person -who -had -better -go -down -in -the -tank -and -take -another -wash -the -god -vishnu -dug -this -tank -he -had -nothing -to -dig -with -but -his -discus -i -do -not -know -what -a -discus -is -but -i -know -it -is -a -poor -thing -to -dig -tanks -with -because -by -the -time -this -one -was -finished -it -was -full -of -sweat -vishnu's -sweat -he -constructed -the -site -that -benares -stands -on -and -afterward -built -the -globe -around -it -and -thought -nothing -of -it -yet -sweated -like -that -over -a -little -thing -like -this -tank -one -of -these -statements -is -doubtful -i -do -not -know -which -one -it -is -but -i -think -it -difficult -not -to -believe -that -a -god -who -could -build -a -world -around -benares -would -not -be -intelligent -enough -to -build -it -around -the -tank -too -and -not -have -to -dig -it -youth -long -life -temporary -purification -from -sin -salvation -through -propitiation -of -the -great -fate -these -are -all -good -but -you -must -do -something -more -you -must -10 -make -salvation -sure -there -are -several -ways -to -get -drowned -in -the -ganges -is -one -but -that -is -not -pleasant -to -die -within -the -limits -of -benares -is -another -but -that -is -a -risky -one -because -you -might -be -out -of -town -when -your -time -came -the -best -one -of -all -is -the -pilgrimage -around -the -city -you -must -walk -also -you -must -go -barefoot -the -tramp -is -forty -four -miles -for -the -road -winds -out -into -the -country -a -piece -and -you -will -be -marching -five -or -six -days -but -you -will -have -plenty -of -company -you -will -move -with -throngs -and -hosts -of -happy -pilgrims -whose -radiant -costumes -will -make -the -spectacle -beautiful -and -whose -glad -songs -and -holy -pans -of -triumph -will -banish -your -fatigues -and -cheer -your -spirit -and -at -intervals -there -will -be -temples -where -you -may -sleep -and -be -refreshed -with -food -the -pilgrimage -completed -you -have -purchased -salvation -and -paid -for -it -but -you -may -not -get -it -unless -you -11 -get -your -redemption -recorded -you -can -get -this -done -at -the -sakhi -binayak -temple -and -it -is -best -to -do -it -for -otherwise -you -might -not -be -able -to -prove -that -you -had -made -the -pilgrimage -in -case -the -matter -should -some -day -come -to -be -disputed -that -temple -is -in -a -lane -back -of -the -cow -temple -over -the -door -is -a -red -image -of -ganesh -of -the -elephant -head -son -and -heir -of -shiva -and -prince -of -wales -to -the -theological -monarchy -so -to -speak -within -is -a -god -whose -office -it -is -to -record -your -pilgrimage -and -be -responsible -for -you -you -will -not -see -him -but -you -will -see -a -brahmin -who -will -attend -to -the -matter -and -take -the -money -if -he -should -forget -to -collect -the -money -you -can -remind -him -he -knows -that -your -salvation -is -now -secure -but -of -course -you -would -like -to -know -it -yourself -you -have -nothing -to -do -but -go -and -pray -and -pay -at -the -12 -well -of -the -knowledge -of -salvation -it -is -close -to -the -golden -temple -there -you -will -see -sculptured -out -of -a -single -piece -of -black -marble -a -bull -which -is -much -larger -than -any -living -bull -you -have -ever -seen -and -yet -is -not -a -good -likeness -after -all -and -there -also -you -will -see -a -very -uncommon -thing -an -image -of -shiva -you -have -seen -his -lingam -fifty -thousand -times -already -but -this -is -shiva -himself -and -said -to -be -a -good -likeness -it -has -three -eyes -he -is -the -only -god -in -the -firm -that -has -three -the -well -is -covered -by -a -fine -canopy -of -stone -supported -by -forty -pillars -and -around -it -you -will -find -what -you -have -already -seen -at -almost -every -shrine -you -have -visited -in -benares -a -mob -of -devout -and -eager -pilgrims -the -sacred -water -is -being -ladled -out -to -them -with -it -comes -to -them -the -knowledge -clear -thrilling -absolute -that -they -are -saved -and -you -can -see -by -their -faces -that -there -is -one -happiness -in -this -world -which -is -supreme -and -to -which -no -other -joy -is -comparable -you -receive -your -water -you -make -your -deposit -and -now -what -more -would -you -have -gold -diamonds -power -fame -all -in -a -single -moment -these -things -have -withered -to -dirt -dust -ashes -the -world -has -nothing -to -give -you -now -for -you -it -is -bankrupt -i -do -not -claim -that -the -pilgrims -do -their -acts -of -worship -in -the -order -and -sequence -above -charted -out -in -this -itinerary -of -mine -but -i -think -logic -suggests -that -they -ought -to -do -so -instead -of -a -helter -skelter -worship -we -then -have -a -definite -starting -place -and -a -march -which -carries -the -pilgrim -steadily -forward -by -reasoned -and -logical -progression -to -a -definite -goal -thus -his -ganges -bath -in -the -early -morning -gives -him -an -appetite -he -kisses -the -cow -tails -and -that -removes -it -it -is -now -business -hours -and -longings -for -material -prosperity -rise -in -his -mind -and -be -goes -and -pours -water -over -shiva's -symbol -this -insures -the -prosperity -but -also -brings -on -a -rain -which -gives -him -a -fever -then -he -drinks -the -sewage -at -the -kedar -ghat -to -cure -the -fever -it -cures -the -fever -but -gives -him -the -smallpox -he -wishes -to -know -how -it -is -going -to -turn -out -he -goes -to -the -dandpan -temple -and -looks -down -the -well -a -clouded -sun -shows -him -that -death -is -near -logically -his -best -course -for -the -present -since -he -cannot -tell -at -what -moment -he -may -die -is -to -secure -a -happy -hereafter -this -he -does -through -the -agency -of -the -great -fate -he -is -safe -now -for -heaven -his -next -move -will -naturally -be -to -keep -out -of -it -as -long -as -he -can -therefore -he -goes -to -the -briddhkal -temple -and -secures -youth -and -long -life -by -bathing -in -a -puddle -of -leper -pus -which -would -kill -a -microbe -logically -youth -has -re -equipped -him -for -sin -and -with -the -disposition -to -commit -it -he -will -naturally -go -to -the -fane -which -is -consecrated -to -the -fulfillment -of -desires -and -make -arrangements -logically -he -will -now -go -to -the -well -of -the -earring -from -time -to -time -to -unload -and -freshen -up -for -further -banned -enjoyments -but -first -and -last -and -all -the -time -he -is -human -and -therefore -in -his -reflective -intervals -he -will -always -be -speculating -in -futures -he -will -make -the -great -pilgrimage -around -the -city -and -so -make -his -salvation -absolutely -sure -he -will -also -have -record -made -of -it -so -that -it -may -remain -absolutely -sure -and -not -be -forgotten -or -repudiated -in -the -confusion -of -the -final -settlement -logically -also -he -will -wish -to -have -satisfying -and -tranquilizing -personal -knowledge -that -that -salvation -is -secure -therefore -he -goes -to -the -well -of -the -knowledge -of -salvation -adds -that -completing -detail -and -then -goes -about -his -affairs -serene -and -content -serene -and -content -for -he -is -now -royally -endowed -with -an -advantage -which -no -religion -in -this -world -could -give -him -but -his -own -for -henceforth -he -may -commit -as -many -million -sins -as -he -wants -to -and -nothing -can -come -of -it -thus -the -system -properly -and -logically -ordered -is -neat -compact -clearly -defined -and -covers -the -whole -ground -i -desire -to -recommend -it -to -such -as -find -the -other -systems -too -difficult -exacting -and -irksome -for -the -uses -of -this -fretful -brief -life -of -ours -however -let -me -not -deceive -any -one -my -itinerary -lacks -a -detail -i -must -put -it -in -the -truth -is -that -after -the -pilgrim -has -faithfully -followed -the -requirements -of -the -itinerary -through -to -the -end -and -has -secured -his -salvation -and -also -the -personal -knowledge -of -that -fact -there -is -still -an -accident -possible -to -him -which -can -annul -the -whole -thing -if -he -should -ever -cross -to -the -other -side -of -the -ganges -and -get -caught -out -and -die -there -he -would -at -once -come -to -life -again -in -the -form -of -an -ass -think -of -that -after -all -this -trouble -and -expense -you -see -how -capricious -and -uncertain -salvation -is -there -the -hindoo -has -a -childish -and -unreasoning -aversion -to -being -turned -into -an -ass -it -is -hard -to -tell -why -one -could -properly -expect -an -ass -to -have -an -aversion -to -being -turned -into -a -hindoo -one -could -understand -that -he -could -lose -dignity -by -it -also -self -respect -and -nine -tenths -of -his -intelligence -but -the -hindoo -changed -into -an -ass -wouldn't -lose -anything -unless -you -count -his -religion -and -he -would -gain -much -release -from -his -slavery -to -two -million -gods -and -twenty -million -priests -fakeers -holy -mendicants -and -other -sacred -bacilli -he -would -escape -the -hindoo -hell -he -would -also -escape -the -hindoo -heaven -these -are -advantages -which -the -hindoo -ought -to -consider -then -he -would -go -over -and -die -on -the -other -side -benares -is -a -religious -vesuvius -in -its -bowels -the -theological -forces -have -been -heaving -and -tossing -rumbling -thundering -and -quaking -boiling -and -weltering -and -flaming -and -smoking -for -ages -but -a -little -group -of -missionaries -have -taken -post -at -its -base -and -they -have -hopes -there -are -the -baptist -missionary -society -the -church -missionary -society -the -london -missionary -society -the -wesleyan -missionary -society -and -the -zenana -bible -and -medical -mission -they -have -schools -and -the -principal -work -seems -to -be -among -the -children -and -no -doubt -that -part -of -the -work -prospers -best -for -grown -people -everywhere -are -always -likely -to -cling -to -the -religion -they -were -brought -up -in -chapter -lii -wrinkles -should -merely -indicate -where -smiles -have -been -pudd'nhead -wilson's -new -calendar -in -one -of -those -benares -temples -we -saw -a -devotee -working -for -salvation -in -a -curious -way -he -had -a -huge -wad -of -clay -beside -him -and -was -making -it -up -into -little -wee -gods -no -bigger -than -carpet -tacks -he -stuck -a -grain -of -rice -into -each -to -represent -the -lingam -i -think -he -turned -them -out -nimbly -for -he -had -had -long -practice -and -had -acquired -great -facility -every -day -he -made -2 -000 -gods -then -threw -them -into -the -holy -ganges -this -act -of -homage -brought -him -the -profound -homage -of -the -pious -also -their -coppers -he -had -a -sure -living -here -and -was -earning -a -high -place -in -the -hereafter -the -ganges -front -is -the -supreme -show -place -of -benares -its -tall -bluffs -are -solidly -caked -from -water -to -summit -along -a -stretch -of -three -miles -with -a -splendid -jumble -of -massive -and -picturesque -masonry -a -bewildering -and -beautiful -confusion -of -stone -platforms -temples -stair -flights -rich -and -stately -palaces -nowhere -a -break -nowhere -a -glimpse -of -the -bluff -itself -all -the -long -face -of -it -is -compactly -walled -from -sight -by -this -crammed -perspective -of -platforms -soaring -stairways -sculptured -temples -majestic -palaces -softening -away -into -the -distances -and -there -is -movement -motion -human -life -everywhere -and -brilliantly -costumed -streaming -in -rainbows -up -and -down -the -lofty -stairways -and -massed -in -metaphorical -flower -gardens -on -the -miles -of -great -platforms -at -the -river's -edge -all -this -masonry -all -this -architecture -represents -piety -the -palaces -were -built -by -native -princes -whose -homes -as -a -rule -are -far -from -benares -but -who -go -there -from -time -to -time -to -refresh -their -souls -with -the -sight -and -touch -of -the -ganges -the -river -of -their -idolatry -the -stairways -are -records -of -acts -of -piety -the -crowd -of -costly -little -temples -are -tokens -of -money -spent -by -rich -men -for -present -credit -and -hope -of -future -reward -apparently -the -rich -christian -who -spends -large -sums -upon -his -religion -is -conspicuous -with -us -by -his -rarity -but -the -rich -hindoo -who -doesn't -spend -large -sums -upon -his -religion -is -seemingly -non -existent -with -us -the -poor -spend -money -on -their -religion -but -they -keep -back -some -to -live -on -apparently -in -india -the -poor -bankrupt -themselves -daily -for -their -religion -the -rich -hindoo -can -afford -his -pious -outlays -he -gets -much -glory -for -his -spendings -yet -keeps -back -a -sufficiency -of -his -income -for -temporal -purposes -but -the -poor -hindoo -is -entitled -to -compassion -for -his -spendings -keep -him -poor -yet -get -him -no -glory -we -made -the -usual -trip -up -and -down -the -river -seated -in -chairs -under -an -awning -on -the -deck -of -the -usual -commodious -hand -propelled -ark -made -it -two -or -three -times -and -could -have -made -it -with -increasing -interest -and -enjoyment -many -times -more -for -of -course -the -palaces -and -temples -would -grow -more -and -more -beautiful -every -time -one -saw -them -for -that -happens -with -all -such -things -also -i -think -one -would -not -get -tired -of -the -bathers -nor -their -costumes -nor -of -their -ingenuities -in -getting -out -of -them -and -into -them -again -without -exposing -too -much -bronze -nor -of -their -devotional -gesticulations -and -absorbed -bead -tellings -but -i -should -get -tired -of -seeing -them -wash -their -mouths -with -that -dreadful -water -and -drink -it -in -fact -i -did -get -tired -of -it -and -very -early -too -at -one -place -where -we -halted -for -a -while -the -foul -gush -from -a -sewer -was -making -the -water -turbid -and -murky -all -around -and -there -was -a -random -corpse -slopping -around -in -it -that -had -floated -down -from -up -country -ten -steps -below -that -place -stood -a -crowd -of -men -women -and -comely -young -maidens -waist -deep -in -the -water -and -they -were -scooping -it -up -in -their -hands -and -drinking -it -faith -can -certainly -do -wonders -and -this -is -an -instance -of -it -those -people -were -not -drinking -that -fearful -stuff -to -assuage -thirst -but -in -order -to -purify -their -souls -and -the -interior -of -their -bodies -according -to -their -creed -the -ganges -water -makes -everything -pure -that -it -touches -instantly -and -utterly -pure -the -sewer -water -was -not -an -offence -to -them -the -corpse -did -not -revolt -them -the -sacred -water -had -touched -both -and -both -were -now -snow -pure -and -could -defile -no -one -the -memory -of -that -sight -will -always -stay -by -me -but -not -by -request -a -word -further -concerning -the -nasty -but -all -purifying -ganges -water -when -we -went -to -agra -by -and -by -we -happened -there -just -in -time -to -be -in -at -the -birth -of -a -marvel -a -memorable -scientific -discovery -the -discovery -that -in -certain -ways -the -foul -and -derided -ganges -water -is -the -most -puissant -purifier -in -the -world! -this -curious -fact -as -i -have -said -had -just -been -added -to -the -treasury -of -modern -science -it -had -long -been -noted -as -a -strange -thing -that -while -benares -is -often -afflicted -with -the -cholera -she -does -not -spread -it -beyond -her -borders -this -could -not -be -accounted -for -mr -henkin -the -scientist -in -the -employ -of -the -government -of -agra -concluded -to -examine -the -water -he -went -to -benares -and -made -his -tests -he -got -water -at -the -mouths -of -the -sewers -where -they -empty -into -the -river -at -the -bathing -ghats -a -cubic -centimetre -of -it -contained -millions -of -germs -at -the -end -of -six -hours -they -were -all -dead -he -caught -a -floating -corpse -towed -it -to -the -shore -and -from -beside -it -he -dipped -up -water -that -was -swarming -with -cholera -germs -at -the -end -of -six -hours -they -were -all -dead -he -added -swarm -after -swarm -of -cholera -germs -to -this -water -within -the -six -hours -they -always -died -to -the -last -sample -repeatedly -he -took -pure -well -water -which -was -bare -of -animal -life -and -put -into -it -a -few -cholera -germs -they -always -began -to -propagate -at -once -and -always -within -six -hours -they -swarmed -and -were -numberable -by -millions -upon -millions -for -ages -and -ages -the -hindoos -have -had -absolute -faith -that -the -water -of -the -ganges -was -absolutely -pure -could -not -be -defiled -by -any -contact -whatsoever -and -infallibly -made -pure -and -clean -whatsoever -thing -touched -it -they -still -believe -it -and -that -is -why -they -bathe -in -it -and -drink -it -caring -nothing -for -its -seeming -filthiness -and -the -floating -corpses -the -hindoos -have -been -laughed -at -these -many -generations -but -the -laughter -will -need -to -modify -itself -a -little -from -now -on -how -did -they -find -out -the -water's -secret -in -those -ancient -ages -had -they -germ -scientists -then -we -do -not -know -we -only -know -that -they -had -a -civilization -long -before -we -emerged -from -savagery -but -to -return -to -where -i -was -before -i -was -about -to -speak -of -the -burning -ghat -they -do -not -burn -fakeers -those -revered -mendicants -they -are -so -holy -that -they -can -get -to -their -place -without -that -sacrament -provided -they -be -consigned -to -the -consecrating -river -we -saw -one -carried -to -mid -stream -and -thrown -overboard -he -was -sandwiched -between -two -great -slabs -of -stone -we -lay -off -the -cremation -ghat -half -an -hour -and -saw -nine -corpses -burned -i -should -not -wish -to -see -any -more -of -it -unless -i -might -select -the -parties -the -mourners -follow -the -bier -through -the -town -and -down -to -the -ghat -then -the -bier -bearers -deliver -the -body -to -some -low -caste -natives -doms -and -the -mourners -turn -about -and -go -back -home -i -heard -no -crying -and -saw -no -tears -there -was -no -ceremony -of -parting -apparently -these -expressions -of -grief -and -affection -are -reserved -for -the -privacy -of -the -home -the -dead -women -came -draped -in -red -the -men -in -white -they -are -laid -in -the -water -at -the -river's -edge -while -the -pyre -is -being -prepared -the -first -subject -was -a -man -when -the -doms -unswathed -him -to -wash -him -he -proved -to -be -a -sturdily -built -well -nourished -and -handsome -old -gentleman -with -not -a -sign -about -him -to -suggest -that -he -had -ever -been -ill -dry -wood -was -brought -and -built -up -into -a -loose -pile -the -corpse -was -laid -upon -it -and -covered -over -with -fuel -then -a -naked -holy -man -who -was -sitting -on -high -ground -a -little -distance -away -began -to -talk -and -shout -with -great -energy -and -he -kept -up -this -noise -right -along -it -may -have -been -the -funeral -sermon -and -probably -was -i -forgot -to -say -that -one -of -the -mourners -remained -behind -when -the -others -went -away -this -was -the -dead -man's -son -a -boy -of -ten -or -twelve -brown -and -handsome -grave -and -self -possessed -and -clothed -in -flowing -white -he -was -there -to -burn -his -father -he -was -given -a -torch -and -while -he -slowly -walked -seven -times -around -the -pyre -the -naked -black -man -on -the -high -ground -poured -out -his -sermon -more -clamorously -than -ever -the -seventh -circuit -completed -the -boy -applied -the -torch -at -his -father's -head -then -at -his -feet -the -flames -sprang -briskly -up -with -a -sharp -crackling -noise -and -the -lad -went -away -hindoos -do -not -want -daughters -because -their -weddings -make -such -a -ruinous -expense -but -they -want -sons -so -that -at -death -they -may -have -honorable -exit -from -the -world -and -there -is -no -honor -equal -to -the -honor -of -having -one's -pyre -lighted -by -one's -son -the -father -who -dies -sonless -is -in -a -grievous -situation -indeed -and -is -pitied -life -being -uncertain -the -hindoo -marries -while -he -is -still -a -boy -in -the -hope -that -he -will -have -a -son -ready -when -the -day -of -his -need -shall -come -but -if -he -have -no -son -he -will -adopt -one -this -answers -every -purpose -meantime -the -corpse -is -burning -also -several -others -it -is -a -dismal -business -the -stokers -did -not -sit -down -in -idleness -but -moved -briskly -about -punching -up -the -fires -with -long -poles -and -now -and -then -adding -fuel -sometimes -they -hoisted -the -half -of -a -skeleton -into -the -air -then -slammed -it -down -and -beat -it -with -the -pole -breaking -it -up -so -that -it -would -burn -better -they -hoisted -skulls -up -in -the -same -way -and -banged -and -battered -them -the -sight -was -hard -to -bear -it -would -have -been -harder -if -the -mourners -had -stayed -to -witness -it -i -had -but -a -moderate -desire -to -see -a -cremation -so -it -was -soon -satisfied -for -sanitary -reasons -it -would -be -well -if -cremation -were -universal -but -this -form -is -revolting -and -not -to -be -recommended -the -fire -used -is -sacred -of -course -for -there -is -money -in -it -ordinary -fire -is -forbidden -there -is -no -money -in -it -i -was -told -that -this -sacred -fire -is -all -furnished -by -one -person -and -that -he -has -a -monopoly -of -it -and -charges -a -good -price -for -it -sometimes -a -rich -mourner -pays -a -thousand -rupees -for -it -to -get -to -paradise -from -india -is -an -expensive -thing -every -detail -connected -with -the -matter -costs -something -and -helps -to -fatten -a -priest -i -suppose -it -is -quite -safe -to -conclude -that -that -fire -bug -is -in -holy -orders -close -to -the -cremation -ground -stand -a -few -time -worn -stones -which -are -remembrances -of -the -suttee -each -has -a -rough -carving -upon -it -representing -a -man -and -a -woman -standing -or -walking -hand -in -hand -and -marks -the -spot -where -a -widow -went -to -her -death -by -fire -in -the -days -when -the -suttee -flourished -mr -parker -said -that -widows -would -burn -themselves -now -if -the -government -would -allow -it -the -family -that -can -point -to -one -of -these -little -memorials -and -say -she -who -burned -herself -there -was -an -ancestress -of -ours -is -envied -it -is -a -curious -people -with -them -all -life -seems -to -be -sacred -except -human -life -even -the -life -of -vermin -is -sacred -and -must -not -be -taken -the -good -jain -wipes -off -a -seat -before -using -it -lest -he -cause -the -death -of -some -valueless -insect -by -sitting -down -on -it -it -grieves -him -to -have -to -drink -water -because -the -provisions -in -his -stomach -may -not -agree -with -the -microbes -yet -india -invented -thuggery -and -the -suttee -india -is -a -hard -country -to -understand -we -went -to -the -temple -of -the -thug -goddess -bhowanee -or -kali -or -durga -she -has -these -names -and -others -she -is -the -only -god -to -whom -living -sacrifices -are -made -goats -are -sacrificed -to -her -monkeys -would -be -cheaper -there -are -plenty -of -them -about -the -place -being -sacred -they -make -themselves -very -free -and -scramble -around -wherever -they -please -the -temple -and -its -porch -are -beautifully -carved -but -this -is -not -the -case -with -the -idol -bhowanee -is -not -pleasant -to -look -at -she -has -a -silver -face -and -a -projecting -swollen -tongue -painted -a -deep -red -she -wears -a -necklace -of -skulls -in -fact -none -of -the -idols -in -benares -are -handsome -or -attractive -and -what -a -swarm -of -them -there -is! -the -town -is -a -vast -museum -of -idols -and -all -of -them -crude -misshapen -and -ugly -they -flock -through -one's -dreams -at -night -a -wild -mob -of -nightmares -when -you -get -tired -of -them -in -the -temples -and -take -a -trip -on -the -river -you -find -idol -giants -flashily -painted -stretched -out -side -by -side -on -the -shore -and -apparently -wherever -there -is -room -for -one -more -lingam -a -lingam -is -there -if -vishnu -had -foreseen -what -his -town -was -going -to -be -he -would -have -called -it -idolville -or -lingamburg -the -most -conspicuous -feature -of -benares -is -the -pair -of -slender -white -minarets -which -tower -like -masts -from -the -great -mosque -of -aurangzeb -they -seem -to -be -always -in -sight -from -everywhere -those -airy -graceful -inspiring -things -but -masts -is -not -the -right -word -for -masts -have -a -perceptible -taper -while -these -minarets -have -not -they -are -142 -feet -high -and -only -8 -1/2 -feet -in -diameter -at -the -base -and -7 -1/2 -at -the -summit -scarcely -any -taper -at -all -these -are -the -proportions -of -a -candle -and -fair -and -fairylike -candles -these -are -will -be -anyway -some -day -when -the -christians -inherit -them -and -top -them -with -the -electric -light -there -is -a -great -view -from -up -there -a -wonderful -view -a -large -gray -monkey -was -part -of -it -and -damaged -it -a -monkey -has -no -judgment -this -one -was -skipping -about -the -upper -great -heights -of -the -mosque -skipping -across -empty -yawning -intervals -which -were -almost -too -wide -for -him -and -which -he -only -just -barely -cleared -each -time -by -the -skin -of -his -teeth -he -got -me -so -nervous -that -i -couldn't -look -at -the -view -i -couldn't -look -at -anything -but -him -every -time -he -went -sailing -over -one -of -those -abysses -my -breath -stood -still -and -when -he -grabbed -for -the -perch -he -was -going -for -i -grabbed -too -in -sympathy -and -he -was -perfectly -indifferent -perfectly -unconcerned -and -i -did -all -the -panting -myself -he -came -within -an -ace -of -losing -his -life -a -dozen -times -and -i -was -so -troubled -about -him -that -i -would -have -shot -him -if -i -had -had -anything -to -do -it -with -but -i -strongly -recommend -the -view -there -is -more -monkey -than -view -and -there -is -always -going -to -be -more -monkey -while -that -idiot -survives -but -what -view -you -get -is -superb -all -benares -the -river -and -the -region -round -about -are -spread -before -you -take -a -gun -and -look -at -the -view -the -next -thing -i -saw -was -more -reposeful -it -was -a -new -kind -of -art -it -was -a -picture -painted -on -water -it -was -done -by -a -native -he -sprinkled -fine -dust -of -various -colors -on -the -still -surface -of -a -basin -of -water -and -out -of -these -sprinklings -a -dainty -and -pretty -picture -gradually -grew -a -picture -which -a -breath -could -destroy -somehow -it -was -impressive -after -so -much -browsing -among -massive -and -battered -and -decaying -fanes -that -rest -upon -ruins -and -those -ruins -upon -still -other -ruins -and -those -upon -still -others -again -it -was -a -sermon -an -allegory -a -symbol -of -instability -those -creations -in -stone -were -only -a -kind -of -water -pictures -after -all -a -prominent -episode -in -the -indian -career -of -warren -hastings -had -benares -for -its -theater -wherever -that -extraordinary -man -set -his -foot -he -left -his -mark -he -came -to -benares -in -1781 -to -collect -a -fine -of -l500 -000 -which -he -had -levied -upon -its -rajah -cheit -singly -on -behalf -of -the -east -india -company -hastings -was -a -long -way -from -home -and -help -there -were -probably -not -a -dozen -englishmen -within -reach -the -rajah -was -in -his -fort -with -his -myriads -around -him -but -no -matter -from -his -little -camp -in -a -neighboring -garden -hastings -sent -a -party -to -arrest -the -sovereign -he -sent -on -this -daring -mission -a -couple -of -hundred -native -soldiers -sepoys -under -command -of -three -young -english -lieutenants -the -rajah -submitted -without -a -word -the -incident -lights -up -the -indian -situation -electrically -and -gives -one -a -vivid -sense -of -the -strides -which -the -english -had -made -and -the -mastership -they -had -acquired -in -the -land -since -the -date -of -clive's -great -victory -in -a -quarter -of -a -century -from -being -nobodies -and -feared -by -none -they -were -become -confessed -lords -and -masters -feared -by -all -sovereigns -included -and -served -by -all -sovereigns -included -it -makes -the -fairy -tales -sound -true -the -english -had -not -been -afraid -to -enlist -native -soldiers -to -fight -against -their -own -people -and -keep -them -obedient -and -now -hastings -was -not -afraid -to -come -away -out -to -this -remote -place -with -a -handful -of -such -soldiers -and -send -them -to -arrest -a -native -sovereign -the -lieutenants -imprisoned -the -rajah -in -his -own -fort -it -was -beautiful -the -pluckiness -of -it -the -impudence -of -it -the -arrest -enraged -the -rajah's -people -and -all -benares -came -storming -about -the -place -and -threatening -vengeance -and -yet -but -for -an -accident -nothing -important -would -have -resulted -perhaps -the -mob -found -out -a -most -strange -thing -an -almost -incredible -thing -that -this -handful -of -soldiers -had -come -on -this -hardy -errand -with -empty -guns -and -no -ammunition -this -has -been -attributed -to -thoughtlessness -but -it -could -hardly -have -been -that -for -in -such -large -emergencies -as -this -intelligent -people -do -think -it -must -have -been -indifference -an -over -confidence -born -of -the -proved -submissiveness -of -the -native -character -when -confronted -by -even -one -or -two -stern -britons -in -their -war -paint -but -however -that -may -be -it -was -a -fatal -discovery -that -the -mob -had -made -they -were -full -of -courage -now -and -they -broke -into -the -fort -and -massacred -the -helpless -soldiers -and -their -officers -hastings -escaped -from -benares -by -night -and -got -safely -away -leaving -the -principality -in -a -state -of -wild -insurrection -but -he -was -back -again -within -the -month -and -quieted -it -down -in -his -prompt -and -virile -way -and -took -the -rajah's -throne -away -from -him -and -gave -it -to -another -man -he -was -a -capable -kind -of -person -was -warren -hastings -this -was -the -only -time -he -was -ever -out -of -ammunition -some -of -his -acts -have -left -stains -upon -his -name -which -can -never -be -washed -away -but -he -saved -to -england -the -indian -empire -and -that -was -the -best -service -that -was -ever -done -to -the -indians -themselves -those -wretched -heirs -of -a -hundred -centuries -of -pitiless -oppression -and -abuse -chapter -liii -true -irreverence -is -disrespect -for -another -man's -god -pudd'nhead -wilson's -new -calendar -it -was -in -benares -that -i -saw -another -living -god -that -makes -two -i -believe -i -have -seen -most -of -the -greater -and -lesser -wonders -of -the -world -but -i -do -not -remember -that -any -of -them -interested -me -so -overwhelmingly -as -did -that -pair -of -gods -when -i -try -to -account -for -this -effect -i -find -no -difficulty -about -it -i -find -that -as -a -rule -when -a -thing -is -a -wonder -to -us -it -is -not -because -of -what -we -see -in -it -but -because -of -what -others -have -seen -in -it -we -get -almost -all -our -wonders -at -second -hand -we -are -eager -to -see -any -celebrated -thing -and -we -never -fail -of -our -reward -just -the -deep -privilege -of -gazing -upon -an -object -which -has -stirred -the -enthusiasm -or -evoked -the -reverence -or -affection -or -admiration -of -multitudes -of -our -race -is -a -thing -which -we -value -we -are -profoundly -glad -that -we -have -seen -it -we -are -permanently -enriched -from -having -seen -it -we -would -not -part -with -the -memory -of -that -experience -for -a -great -price -and -yet -that -very -spectacle -may -be -the -taj -you -cannot -keep -your -enthusiasms -down -you -cannot -keep -your -emotions -within -bounds -when -that -soaring -bubble -of -marble -breaks -upon -your -view -but -these -are -not -your -enthusiasms -and -emotions -they -are -the -accumulated -emotions -and -enthusiasms -of -a -thousand -fervid -writers -who -have -been -slowly -and -steadily -storing -them -up -in -your -heart -day -by -day -and -year -by -year -all -your -life -and -now -they -burst -out -in -a -flood -and -overwhelm -you -and -you -could -not -be -a -whit -happier -if -they -were -your -very -own -by -and -by -you -sober -down -and -then -you -perceive -that -you -have -been -drunk -on -the -smell -of -somebody -else's -cork -for -ever -and -ever -the -memory -of -my -distant -first -glimpse -of -the -taj -will -compensate -me -for -creeping -around -the -globe -to -have -that -great -privilege -but -the -taj -with -all -your -inflation -of -delusive -emotions -acquired -at -second -hand -from -people -to -whom -in -the -majority -of -cases -they -were -also -delusions -acquired -at -second -hand -a -thing -which -you -fortunately -did -not -think -of -or -it -might -have -made -you -doubtful -of -what -you -imagined -were -your -own -what -is -the -taj -as -a -marvel -a -spectacle -and -an -uplifting -and -overpowering -wonder -compared -with -a -living -breathing -speaking -personage -whom -several -millions -of -human -beings -devoutly -and -sincerely -and -unquestioningly -believe -to -be -a -god -and -humbly -and -gratefully -worship -as -a -god -he -was -sixty -years -old -when -i -saw -him -he -is -called -sri -108 -swami -bhaskarananda -saraswati -that -is -one -form -of -it -i -think -that -that -is -what -you -would -call -him -in -speaking -to -him -because -it -is -short -but -you -would -use -more -of -his -name -in -addressing -a -letter -to -him -courtesy -would -require -this -even -then -you -would -not -have -to -use -all -of -it -but -only -this -much -sri -108 -matparamahansrzpairivrajakacharyaswamibhaskaranandasaraswati -you -do -not -put -esq -after -it -for -that -is -not -necessary -the -word -which -opens -the -volley -is -itself -a -title -of -honor -sri -the -108 -stands -for -the -rest -of -his -names -i -believe -vishnu -has -108 -names -which -he -does -not -use -in -business -and -no -doubt -it -is -a -custom -of -gods -and -a -privilege -sacred -to -their -order -to -keep -108 -extra -ones -in -stock -just -the -restricted -name -set -down -above -is -a -handsome -property -without -the -108 -by -my -count -it -has -58 -letters -in -it -this -removes -the -long -german -words -from -competition -they -are -permanently -out -of -the -race -sri -108 -s -b -saraswati -has -attained -to -what -among -the -hindoos -is -called -the -state -of -perfection -it -is -a -state -which -other -hindoos -reach -by -being -born -again -and -again -and -over -and -over -again -into -this -world -through -one -re -incarnation -after -another -a -tiresome -long -job -covering -centuries -and -decades -of -centuries -and -one -that -is -full -of -risks -too -like -the -accident -of -dying -on -the -wrong -side -of -the -ganges -some -time -or -other -and -waking -up -in -the -form -of -an -ass -with -a -fresh -start -necessary -and -the -numerous -trips -to -be -made -all -over -again -but -in -reaching -perfection -sri -108 -s -b -s -has -escaped -all -that -he -is -no -longer -a -part -or -a -feature -of -this -world -his -substance -has -changed -all -earthiness -has -departed -out -of -it -he -is -utterly -holy -utterly -pure -nothing -can -desecrate -this -holiness -or -stain -this -purity -he -is -no -longer -of -the -earth -its -concerns -are -matters -foreign -to -him -its -pains -and -griefs -and -troubles -cannot -reach -him -when -he -dies -nirvana -is -his -he -will -be -absorbed -into -the -substance -of -the -supreme -deity -and -be -at -peace -forever -the -hindoo -scriptures -point -out -how -this -state -is -to -be -reached -but -it -is -only -once -in -a -thousand -years -perhaps -that -candidate -accomplishes -it -this -one -has -traversed -the -course -required -stage -by -stage -from -the -beginning -to -the -end -and -now -has -nothing -left -to -do -but -wait -for -the -call -which -shall -release -him -from -a -world -in -which -he -has -now -no -part -nor -lot -first -he -passed -through -the -student -stage -and -became -learned -in -the -holy -books -next -he -became -citizen -householder -husband -and -father -that -was -the -required -second -stage -then -like -john -bunyan's -christian -he -bade -perpetual -good -bye -to -his -family -as -required -and -went -wandering -away -he -went -far -into -the -desert -and -served -a -term -as -hermit -next -he -became -a -beggar -in -accordance -with -the -rites -laid -down -in -the -scriptures -and -wandered -about -india -eating -the -bread -of -mendicancy -a -quarter -of -a -century -ago -he -reached -the -stage -of -purity -this -needs -no -garment -its -symbol -is -nudity -he -discarded -the -waist -cloth -which -he -had -previously -worn -he -could -resume -it -now -if -he -chose -for -neither -that -nor -any -other -contact -can -defile -him -but -he -does -not -choose -there -are -several -other -stages -i -believe -but -i -do -not -remember -what -they -are -but -he -has -been -through -them -throughout -the -long -course -he -was -perfecting -himself -in -holy -learning -and -writing -commentaries -upon -the -sacred -books -he -was -also -meditating -upon -brahma -and -he -does -that -now -white -marble -relief -portraits -of -him -are -sold -all -about -india -he -lives -in -a -good -house -in -a -noble -great -garden -in -benares -all -meet -and -proper -to -his -stupendous -rank -necessarily -he -does -not -go -abroad -in -the -streets -deities -would -never -be -able -to -move -about -handily -in -any -country -if -one -whom -we -recognized -and -adored -as -a -god -should -go -abroad -in -our -streets -and -the -day -it -was -to -happen -were -known -all -traffic -would -be -blocked -and -business -would -come -to -a -standstill -this -god -is -comfortably -housed -and -yet -modestly -all -things -considered -for -if -he -wanted -to -live -in -a -palace -he -would -only -need -to -speak -and -his -worshipers -would -gladly -build -it -sometimes -he -sees -devotees -for -a -moment -and -comforts -them -and -blesses -them -and -they -kiss -his -feet -and -go -away -happy -rank -is -nothing -to -him -he -being -a -god -to -him -all -men -are -alike -he -sees -whom -he -pleases -and -denies -himself -to -whom -he -pleases -sometimes -he -sees -a -prince -and -denies -himself -to -a -pauper -at -other -times -he -receives -the -pauper -and -turns -the -prince -away -however -he -does -not -receive -many -of -either -class -he -has -to -husband -his -time -for -his -meditations -i -think -he -would -receive -rev -mr -parker -at -any -time -i -think -he -is -sorry -for -mr -parker -and -i -think -mr -parker -is -sorry -for -him -and -no -doubt -this -compassion -is -good -for -both -of -them -when -we -arrived -we -had -to -stand -around -in -the -garden -a -little -while -and -wait -and -the -outlook -was -not -good -for -he -had -been -turning -away -maharajas -that -day -and -receiving -only -the -riff -raff -and -we -belonged -in -between -somewhere -but -presently -a -servant -came -out -saying -it -was -all -right -he -was -coming -and -sure -enough -he -came -and -i -saw -him -that -object -of -the -worship -of -millions -it -was -a -strange -sensation -and -thrilling -i -wish -i -could -feel -it -stream -through -my -veins -again -and -yet -to -me -he -was -not -a -god -he -was -only -a -taj -the -thrill -was -not -my -thrill -but -had -come -to -me -secondhand -from -those -invisible -millions -of -believers -by -a -hand -shake -with -their -god -i -had -ground -circuited -their -wire -and -got -their -monster -battery's -whole -charge -he -was -tall -and -slender -indeed -emaciated -he -had -a -clean -cut -and -conspicuously -intellectual -face -and -a -deep -and -kindly -eye -he -looked -many -years -older -than -he -really -was -but -much -study -and -meditation -and -fasting -and -prayer -with -the -arid -life -he -had -led -as -hermit -and -beggar -could -account -for -that -he -is -wholly -nude -when -he -receives -natives -of -whatever -rank -they -may -be -but -he -had -white -cloth -around -his -loins -now -a -concession -to -mr -parker's -europe -prejudices -no -doubt -as -soon -as -i -had -sobered -down -a -little -we -got -along -very -well -together -and -i -found -him -a -most -pleasant -and -friendly -deity -he -had -heard -a -deal -about -chicago -and -showed -a -quite -remarkable -interest -in -it -for -a -god -it -all -came -of -the -world's -fair -and -the -congress -of -religions -if -india -knows -about -nothing -else -american -she -knows -about -those -and -will -keep -them -in -mind -one -while -he -proposed -an -exchange -of -autographs -a -delicate -attention -which -made -me -believe -in -him -but -i -had -been -having -my -doubts -before -he -wrote -his -in -his -book -and -i -have -a -reverent -regard -for -that -book -though -the -words -run -from -right -to -left -and -so -i -can't -read -it -it -was -a -mistake -to -print -in -that -way -it -contains -his -voluminous -comments -on -the -hindoo -holy -writings -and -if -i -could -make -them -out -i -would -try -for -perfection -myself -i -gave -him -a -copy -of -huckleberry -finn -i -thought -it -might -rest -him -up -a -little -to -mix -it -in -along -with -his -meditations -on -brahma -for -he -looked -tired -and -i -knew -that -if -it -didn't -do -him -any -good -it -wouldn't -do -him -any -harm -he -has -a -scholar -meditating -under -him -mina -bahadur -rana -but -we -did -not -see -him -he -wears -clothes -and -is -very -imperfect -he -has -written -a -little -pamphlet -about -his -master -and -i -have -that -it -contains -a -wood -cut -of -the -master -and -himself -seated -on -a -rug -in -the -garden -the -portrait -of -the -master -is -very -good -indeed -the -posture -is -exactly -that -which -brahma -himself -affects -and -it -requires -long -arms -and -limber -legs -and -can -be -accumulated -only -by -gods -and -the -india -rubber -man -there -is -a -life -size -marble -relief -of -shri -108 -s -b -s -in -the -garden -it -represents -him -in -this -same -posture -dear -me! -it -is -a -strange -world -particularly -the -indian -division -of -it -this -pupil -mina -bahadur -rana -is -not -a -commonplace -person -but -a -man -of -distinguished -capacities -and -attainments -and -apparently -he -had -a -fine -worldly -career -in -front -of -him -he -was -serving -the -nepal -government -in -a -high -capacity -at -the -court -of -the -viceroy -of -india -twenty -years -ago -he -was -an -able -man -educated -a -thinker -a -man -of -property -but -the -longing -to -devote -himself -to -a -religious -life -came -upon -him -and -he -resigned -his -place -turned -his -back -upon -the -vanities -and -comforts -of -the -world -and -went -away -into -the -solitudes -to -live -in -a -hut -and -study -the -sacred -writings -and -meditate -upon -virtue -and -holiness -and -seek -to -attain -them -this -sort -of -religion -resembles -ours -christ -recommended -the -rich -to -give -away -all -their -property -and -follow -him -in -poverty -not -in -worldly -comfort -american -and -english -millionaires -do -it -every -day -and -thus -verify -and -confirm -to -the -world -the -tremendous -forces -that -lie -in -religion -yet -many -people -scoff -at -them -for -this -loyalty -to -duty -and -many -will -scoff -at -mina -bahadur -rana -and -call -him -a -crank -like -many -christians -of -great -character -and -intellect -he -has -made -the -study -of -his -scriptures -and -the -writing -of -books -of -commentaries -upon -them -the -loving -labor -of -his -life -like -them -he -has -believed -that -his -was -not -an -idle -and -foolish -waste -of -his -life -but -a -most -worthy -and -honorable -employment -of -it -yet -there -are -many -people -who -will -see -in -those -others -men -worthy -of -homage -and -deep -reverence -but -in -him -merely -a -crank -but -i -shall -not -he -has -my -reverence -and -i -don't -offer -it -as -a -common -thing -and -poor -but -as -an -unusual -thing -and -of -value -the -ordinary -reverence -the -reverence -defined -and -explained -by -the -dictionary -costs -nothing -reverence -for -one's -own -sacred -things -parents -religion -flag -laws -and -respect -for -one's -own -beliefs -these -are -feelings -which -we -cannot -even -help -they -come -natural -to -us -they -are -involuntary -like -breathing -there -is -no -personal -merit -in -breathing -but -the -reverence -which -is -difficult -and -which -has -personal -merit -in -it -is -the -respect -which -you -pay -without -compulsion -to -the -political -or -religious -attitude -of -a -man -whose -beliefs -are -not -yours -you -can't -revere -his -gods -or -his -politics -and -no -one -expects -you -to -do -that -but -you -could -respect -his -belief -in -them -if -you -tried -hard -enough -and -you -could -respect -him -too -if -you -tried -hard -enough -but -it -is -very -very -difficult -it -is -next -to -impossible -and -so -we -hardly -ever -try -if -the -man -doesn't -believe -as -we -do -we -say -he -is -a -crank -and -that -settles -it -i -mean -it -does -nowadays -because -now -we -can't -burn -him -we -are -always -canting -about -people's -irreverence -always -charging -this -offense -upon -somebody -or -other -and -thereby -intimating -that -we -are -better -than -that -person -and -do -not -commit -that -offense -ourselves -whenever -we -do -this -we -are -in -a -lying -attitude -and -our -speech -is -cant -for -none -of -us -are -reverent -in -a -meritorious -way -deep -down -in -our -hearts -we -are -all -irreverent -there -is -probably -not -a -single -exception -to -this -rule -in -the -earth -there -is -probably -not -one -person -whose -reverence -rises -higher -than -respect -for -his -own -sacred -things -and -therefore -it -is -not -a -thing -to -boast -about -and -be -proud -of -since -the -most -degraded -savage -has -that -and -like -the -best -of -us -has -nothing -higher -to -speak -plainly -we -despise -all -reverences -and -all -objects -of -reverence -which -are -outside -the -pale -of -our -own -list -of -sacred -things -and -yet -with -strange -inconsistency -we -are -shocked -when -other -people -despise -and -defile -the -things -which -are -holy -to -us -suppose -we -should -meet -with -a -paragraph -like -the -following -in -the -newspapers -yesterday -a -visiting -party -of -the -british -nobility -had -a -picnic -at -mount -vernon -and -in -the -tomb -of -washington -they -ate -their -luncheon -sang -popular -songs -played -games -and -danced -waltzes -and -polkas -should -we -be -shocked -should -we -feel -outraged -should -we -be -amazed -should -we -call -the -performance -a -desecration -yes -that -would -all -happen -we -should -denounce -those -people -in -round -terms -and -call -them -hard -names -and -suppose -we -found -this -paragraph -in -the -newspapers -yesterday -a -visiting -party -of -american -pork -millionaires -had -a -picnic -in -westminster -abbey -and -in -that -sacred -place -they -ate -their -luncheon -sang -popular -songs -played -games -and -danced -waltzes -and -polkas -would -the -english -be -shocked -would -they -feel -outraged -would -they -be -amazed -would -they -call -the -performance -a -desecration -that -would -all -happen -the -pork -millionaires -would -be -denounced -in -round -terms -they -would -be -called -hard -names -in -the -tomb -at -mount -vernon -lie -the -ashes -of -america's -most -honored -son -in -the -abbey -the -ashes -of -england's -greatest -dead -the -tomb -of -tombs -the -costliest -in -the -earth -the -wonder -of -the -world -the -taj -was -built -by -a -great -emperor -to -honor -the -memory -of -a -perfect -wife -and -perfect -mother -one -in -whom -there -was -no -spot -or -blemish -whose -love -was -his -stay -and -support -whose -life -was -the -light -of -the -world -to -him -in -it -her -ashes -lie -and -to -the -mohammedan -millions -of -india -it -is -a -holy -place -to -them -it -is -what -mount -vernon -is -to -americans -it -is -what -the -abbey -is -to -the -english -major -sleeman -wrote -forty -or -fifty -years -ago -the -italics -are -mine -i -would -here -enter -my -humble -protest -against -the -quadrille -and -lunch -parties -which -are -sometimes -given -to -european -ladies -and -gentlemen -of -the -station -at -this -imperial -tomb -drinking -and -dancing -are -no -doubt -very -good -things -in -their -season -but -they -are -sadly -out -of -place -in -a -sepulchre -were -there -any -americans -among -those -lunch -parties -if -they -were -invited -there -were -if -my -imagined -lunch -parties -in -westminster -and -the -tomb -of -washington -should -take -place -the -incident -would -cause -a -vast -outbreak -of -bitter -eloquence -about -barbarism -and -irreverence -and -it -would -come -from -two -sets -of -people -who -would -go -next -day -and -dance -in -the -taj -if -they -had -a -chance -as -we -took -our -leave -of -the -benares -god -and -started -away -we -noticed -a -group -of -natives -waiting -respectfully -just -within -the -gate -a -rajah -from -somewhere -in -india -and -some -people -of -lesser -consequence -the -god -beckoned -them -to -come -and -as -we -passed -out -the -rajah -was -kneeling -and -reverently -kissing -his -sacred -feet -if -barnum -but -barnum's -ambitions -are -at -rest -this -god -will -remain -in -the -holy -peace -and -seclusion -of -his -garden -undisturbed -barnum -could -not -have -gotten -him -anyway -still -he -would -have -found -a -substitute -that -would -answer -chapter -liv -do -not -undervalue -the -headache -while -it -is -at -its -sharpest -it -seems -a -bad -investment -but -when -relief -begins -the -unexpired -remainder -is -worth -$4 -a -minute -pudd'nhead -wilson's -new -calendar -a -comfortable -railway -journey -of -seventeen -and -a -half -hours -brought -us -to -the -capital -of -india -which -is -likewise -the -capital -of -bengal -calcutta -like -bombay -it -has -a -population -of -nearly -a -million -natives -and -a -small -gathering -of -white -people -it -is -a -huge -city -and -fine -and -is -called -the -city -of -palaces -it -is -rich -in -historical -memories -rich -in -british -achievement -military -political -commercial -rich -in -the -results -of -the -miracles -done -by -that -brace -of -mighty -magicians -clive -and -hastings -and -has -a -cloud -kissing -monument -to -one -ochterlony -it -is -a -fluted -candlestick -250 -feet -high -this -lingam -is -the -only -large -monument -in -calcutta -i -believe -it -is -a -fine -ornament -and -will -keep -ochterlony -in -mind -wherever -you -are -in -calcutta -and -for -miles -around -you -can -see -it -and -always -when -you -see -it -you -think -of -ochterlony -and -so -there -is -not -an -hour -in -the -day -that -you -do -not -think -of -ochterlony -and -wonder -who -he -was -it -is -good -that -clive -cannot -come -back -for -he -would -think -it -was -for -plassey -and -then -that -great -spirit -would -be -wounded -when -the -revelation -came -that -it -was -not -clive -would -find -out -that -it -was -for -ochterlony -and -he -would -think -ochterlony -was -a -battle -and -he -would -think -it -was -a -great -one -too -and -he -would -say -with -three -thousand -i -whipped -sixty -thousand -and -founded -the -empire -and -there -is -no -monument -this -other -soldier -must -have -whipped -a -billion -with -a -dozen -and -saved -the -world -but -he -would -be -mistaken -ochterlony -was -a -man -not -a -battle -and -he -did -good -and -honorable -service -too -as -good -and -honorable -service -as -has -been -done -in -india -by -seventy -five -or -a -hundred -other -englishmen -of -courage -rectitude -and -distinguished -capacity -for -india -has -been -a -fertile -breeding -ground -of -such -men -and -remains -so -great -men -both -in -war -and -in -the -civil -service -and -as -modest -as -great -but -they -have -no -monuments -and -were -not -expecting -any -ochterlony -could -not -have -been -expecting -one -and -it -is -not -at -all -likely -that -he -desired -one -certainly -not -until -clive -and -hastings -should -be -supplied -every -day -clive -and -hastings -lean -on -the -battlements -of -heaven -and -look -down -and -wonder -which -of -the -two -the -monument -is -for -and -they -fret -and -worry -because -they -cannot -find -out -and -so -the -peace -of -heaven -is -spoiled -for -them -and -lost -but -not -for -ochterlony -ochterlony -is -not -troubled -he -doesn't -suspect -that -it -is -his -monument -heaven -is -sweet -and -peaceful -to -him -there -is -a -sort -of -unfairness -about -it -all -indeed -if -monuments -were -always -given -in -india -for -high -achievements -duty -straitly -performed -and -smirchless -records -the -landscape -would -be -monotonous -with -them -the -handful -of -english -in -india -govern -the -indian -myriads -with -apparent -ease -and -without -noticeable -friction -through -tact -training -and -distinguished -administrative -ability -reinforced -by -just -and -liberal -laws -and -by -keeping -their -word -to -the -native -whenever -they -give -it -england -is -far -from -india -and -knows -little -about -the -eminent -services -performed -by -her -servants -there -for -it -is -the -newspaper -correspondent -who -makes -fame -and -he -is -not -sent -to -india -but -to -the -continent -to -report -the -doings -of -the -princelets -and -the -dukelets -and -where -they -are -visiting -and -whom -they -are -marrying -often -a -british -official -spends -thirty -or -forty -years -in -india -climbing -from -grade -to -grade -by -services -which -would -make -him -celebrated -anywhere -else -and -finishes -as -a -vice -sovereign -governing -a -great -realm -and -millions -of -subjects -then -he -goes -home -to -england -substantially -unknown -and -unheard -of -and -settles -down -in -some -modest -corner -and -is -as -one -extinguished -ten -years -later -there -is -a -twenty -line -obituary -in -the -london -papers -and -the -reader -is -paralyzed -by -the -splendors -of -a -career -which -he -is -not -sure -that -he -had -ever -heard -of -before -but -meanwhile -he -has -learned -all -about -the -continental -princelets -and -dukelets -the -average -man -is -profoundly -ignorant -of -countries -that -lie -remote -from -his -own -when -they -are -mentioned -in -his -presence -one -or -two -facts -and -maybe -a -couple -of -names -rise -like -torches -in -his -mind -lighting -up -an -inch -or -two -of -it -and -leaving -the -rest -all -dark -the -mention -of -egypt -suggests -some -biblical -facts -and -the -pyramids -nothing -more -the -mention -of -south -africa -suggests -kimberly -and -the -diamonds -and -there -an -end -formerly -the -mention -to -a -hindoo -of -america -suggested -a -name -george -washington -with -that -his -familiarity -with -our -country -was -exhausted -latterly -his -familiarity -with -it -has -doubled -in -bulk -so -that -when -america -is -mentioned -now -two -torches -flare -up -in -the -dark -caverns -of -his -mind -and -he -says -ah -the -country -of -the -great -man -washington -and -of -the -holy -city -chicago -for -he -knows -about -the -congress -of -religion -and -this -has -enabled -him -to -get -an -erroneous -impression -of -chicago -when -india -is -mentioned -to -the -citizen -of -a -far -country -it -suggests -clive -hastings -the -mutiny -kipling -and -a -number -of -other -great -events -and -the -mention -of -calcutta -infallibly -brings -up -the -black -hole -and -so -when -that -citizen -finds -himself -in -the -capital -of -india -he -goes -first -of -all -to -see -the -black -hole -of -calcutta -and -is -disappointed -the -black -hole -was -not -preserved -it -is -gone -long -long -ago -it -is -strange -just -as -it -stood -it -was -itself -a -monument -a -ready -made -one -it -was -finished -it -was -complete -its -materials -were -strong -and -lasting -it -needed -no -furbishing -up -no -repairs -it -merely -needed -to -be -let -alone -it -was -the -first -brick -the -foundation -stone -upon -which -was -reared -a -mighty -empire -the -indian -empire -of -great -britain -it -was -the -ghastly -episode -of -the -black -hole -that -maddened -the -british -and -brought -clive -that -young -military -marvel -raging -up -from -madras -it -was -the -seed -from -which -sprung -plassey -and -it -was -that -extraordinary -battle -whose -like -had -not -been -seen -in -the -earth -since -agincourt -that -laid -deep -and -strong -the -foundations -of -england's -colossal -indian -sovereignty -and -yet -within -the -time -of -men -who -still -live -the -black -hole -was -torn -down -and -thrown -away -as -carelessly -as -if -its -bricks -were -common -clay -not -ingots -of -historic -gold -there -is -no -accounting -for -human -beings -the -supposed -site -of -the -black -hole -is -marked -by -an -engraved -plate -i -saw -that -and -better -that -than -nothing -the -black -hole -was -a -prison -a -cell -is -nearer -the -right -word -eighteen -feet -square -the -dimensions -of -an -ordinary -bedchamber -and -into -this -place -the -victorious -nabob -of -bengal -packed -146 -of -his -english -prisoners -there -was -hardly -standing -room -for -them -scarcely -a -breath -of -air -was -to -be -got -the -time -was -night -the -weather -sweltering -hot -before -the -dawn -came -the -captives -were -all -dead -but -twenty -three -mr -holwell's -long -account -of -the -awful -episode -was -familiar -to -the -world -a -hundred -years -ago -but -one -seldom -sees -in -print -even -an -extract -from -it -in -our -day -among -the -striking -things -in -it -is -this -mr -holwell -perishing -with -thirst -kept -himself -alive -by -sucking -the -perspiration -from -his -sleeves -it -gives -one -a -vivid -idea -of -the -situation -he -presently -found -that -while -he -was -busy -drawing -life -from -one -of -his -sleeves -a -young -english -gentleman -was -stealing -supplies -from -the -other -one -holwell -was -an -unselfish -man -a -man -of -the -most -generous -impulses -he -lived -and -died -famous -for -these -fine -and -rare -qualities -yet -when -he -found -out -what -was -happening -to -that -unwatched -sleeve -he -took -the -precaution -to -suck -that -one -dry -first -the -miseries -of -the -black -hole -were -able -to -change -even -a -nature -like -his -but -that -young -gentleman -was -one -of -the -twenty -three -survivors -and -he -said -it -was -the -stolen -perspiration -that -saved -his -life -from -the -middle -of -mr -holwell's -narrative -i -will -make -a -brief -excerpt -then -a -general -prayer -to -heaven -to -hasten -the -approach -of -the -flames -to -the -right -and -left -of -us -and -put -a -period -to -our -misery -but -these -failing -they -whose -strength -and -spirits -were -quite -exhausted -laid -themselves -down -and -expired -quietly -upon -their -fellows -others -who -had -yet -some -strength -and -vigor -left -made -a -last -effort -at -the -windows -and -several -succeeded -by -leaping -and -scrambling -over -the -backs -and -heads -of -those -in -the -first -rank -and -got -hold -of -the -bars -from -which -there -was -no -removing -them -many -to -the -right -and -left -sunk -with -the -violent -pressure -and -were -soon -suffocated -for -now -a -steam -arose -from -the -living -and -the -dead -which -affected -us -in -all -its -circumstances -as -if -we -were -forcibly -held -with -our -heads -over -a -bowl -full -of -strong -volatile -spirit -of -hartshorn -until -suffocated -nor -could -the -effluvia -of -the -one -be -distinguished -from -the -other -and -frequently -when -i -was -forced -by -the -load -upon -my -head -and -shoulders -to -hold -my -face -down -i -was -obliged -near -as -i -was -to -the -window -instantly -to -raise -it -again -to -avoid -suffocation -i -need -not -my -dear -friend -ask -your -commiseration -when -i -tell -you -that -in -this -plight -from -half -an -hour -past -eleven -till -near -two -in -the -morning -i -sustained -the -weight -of -a -heavy -man -with -his -knees -in -my -back -and -the -pressure -of -his -whole -body -on -my -head -a -dutch -surgeon -who -had -taken -his -seat -upon -my -left -shoulder -and -a -topaz -a -black -christian -soldier -bearing -on -my -right -all -which -nothing -could -have -enabled -me -to -support -but -the -props -and -pressure -equally -sustaining -me -all -around -the -two -latter -i -frequently -dislodged -by -shifting -my -hold -on -the -bars -and -driving -my -knuckles -into -their -ribs -but -my -friend -above -stuck -fast -held -immovable -by -two -bars -i -exerted -anew -my -strength -and -fortitude -but -the -repeated -trials -and -efforts -i -made -to -dislodge -the -insufferable -incumbrances -upon -me -at -last -quite -exhausted -me -and -towards -two -o'clock -finding -i -must -quit -the -window -or -sink -where -i -was -i -resolved -on -the -former -having -bore -truly -for -the -sake -of -others -infinitely -more -for -life -than -the -best -of -it -is -worth -in -the -rank -close -behind -me -was -an -officer -of -one -of -the -ships -whose -name -was -cary -and -who -had -behaved -with -much -bravery -during -the -siege -his -wife -a -fine -woman -though -country -born -would -not -quit -him -but -accompanied -him -into -the -prison -and -was -one -who -survived -this -poor -wretch -had -been -long -raving -for -water -and -air -i -told -him -i -was -determined -to -give -up -life -and -recommended -his -gaining -my -station -on -my -quitting -it -he -made -a -fruitless -attempt -to -get -my -place -but -the -dutch -surgeon -who -sat -on -my -shoulder -supplanted -him -poor -cary -expressed -his -thankfulness -and -said -he -would -give -up -life -too -but -it -was -with -the -utmost -labor -we -forced -our -way -from -the -window -several -in -the -inner -ranks -appearing -to -me -dead -standing -unable -to -fall -by -the -throng -and -equal -pressure -around -he -laid -himself -down -to -die -and -his -death -i -believe -was -very -sudden -for -he -was -a -short -full -sanguine -man -his -strength -was -great -and -i -imagine -had -he -not -retired -with -me -i -should -never -have -been -able -to -force -my -way -i -was -at -this -time -sensible -of -no -pain -and -little -uneasiness -i -can -give -you -no -better -idea -of -my -situation -than -by -repeating -my -simile -of -the -bowl -of -spirit -of -hartshorn -i -found -a -stupor -coming -on -apace -and -laid -myself -down -by -that -gallant -old -man -the -rev -mr -jervas -bellamy -who -laid -dead -with -his -son -the -lieutenant -hand -in -hand -near -the -southernmost -wall -of -the -prison -when -i -had -lain -there -some -little -time -i -still -had -reflection -enough -to -suffer -some -uneasiness -in -the -thought -that -i -should -be -trampled -upon -when -dead -as -i -myself -had -done -to -others -with -some -difficulty -i -raised -myself -and -gained -the -platform -a -second -time -where -i -presently -lost -all -sensation -the -last -trace -of -sensibility -that -i -have -been -able -to -recollect -after -my -laying -down -was -my -sash -being -uneasy -about -my -waist -which -i -untied -and -threw -from -me -of -what -passed -in -this -interval -to -the -time -of -my -resurrection -from -this -hole -of -horrors -i -can -give -you -no -account -there -was -plenty -to -see -in -calcutta -but -there -was -not -plenty -of -time -for -it -i -saw -the -fort -that -clive -built -and -the -place -where -warren -hastings -and -the -author -of -the -junius -letters -fought -their -duel -and -the -great -botanical -gardens -and -the -fashionable -afternoon -turnout -in -the -maidan -and -a -grand -review -of -the -garrison -in -a -great -plain -at -sunrise -and -a -military -tournament -in -which -great -bodies -of -native -soldiery -exhibited -the -perfection -of -their -drill -at -all -arms -a -spectacular -and -beautiful -show -occupying -several -nights -and -closing -with -the -mimic -storming -of -a -native -fort -which -was -as -good -as -the -reality -for -thrilling -and -accurate -detail -and -better -than -the -reality -for -security -and -comfort -we -had -a -pleasure -excursion -on -the -'hoogly' -by -courtesy -of -friends -and -devoted -the -rest -of -the -time -to -social -life -and -the -indian -museum -one -should -spend -a -month -in -the -museum -an -enchanted -palace -of -indian -antiquities -indeed -a -person -might -spend -half -a -year -among -the -beautiful -and -wonderful -things -without -exhausting -their -interest -it -was -winter -we -were -of -kipling's -hosts -of -tourists -who -travel -up -and -down -india -in -the -cold -weather -showing -how -things -ought -to -be -managed -it -is -a -common -expression -there -the -cold -weather -and -the -people -think -there -is -such -a -thing -it -is -because -they -have -lived -there -half -a -lifetime -and -their -perceptions -have -become -blunted -when -a -person -is -accustomed -to -138 -in -the -shade -his -ideas -about -cold -weather -are -not -valuable -i -had -read -in -the -histories -that -the -june -marches -made -between -lucknow -and -cawnpore -by -the -british -forces -in -the -time -of -the -mutiny -were -made -weather -138 -in -the -shade -and -had -taken -it -for -historical -embroidery -i -had -read -it -again -in -serjeant -major -forbes -mitchell's -account -of -his -military -experiences -in -the -mutiny -at -least -i -thought -i -had -and -in -calcutta -i -asked -him -if -it -was -true -and -he -said -it -was -an -officer -of -high -rank -who -had -been -in -the -thick -of -the -mutiny -said -the -same -as -long -as -those -men -were -talking -about -what -they -knew -they -were -trustworthy -and -i -believed -them -but -when -they -said -it -was -now -cold -weather -i -saw -that -they -had -traveled -outside -of -their -sphere -of -knowledge -and -were -floundering -i -believe -that -in -india -cold -weather -is -merely -a -conventional -phrase -and -has -come -into -use -through -the -necessity -of -having -some -way -to -distinguish -between -weather -which -will -melt -a -brass -door -knob -and -weather -which -will -only -make -it -mushy -it -was -observable -that -brass -ones -were -in -use -while -i -was -in -calcutta -showing -that -it -was -not -yet -time -to -change -to -porcelain -i -was -told -the -change -to -porcelain -was -not -usually -made -until -may -but -this -cold -weather -was -too -warm -for -us -so -we -started -to -darjeeling -in -the -himalayas -a -twenty -four -hour -journey -chapter -lv -there -are -869 -different -forms -of -lying -but -only -one -of -them -has -been -squarely -forbidden -thou -shalt -not -bear -false -witness -against -thy -neighbor -pudd'nhead -wilson's -new -calendar -from -diary -february -14 -we -left -at -4 -30 -p -m -until -dark -we -moved -through -rich -vegetation -then -changed -to -a -boat -and -crossed -the -ganges -february -15 -up -with -the -sun -a -brilliant -morning -and -frosty -a -double -suit -of -flannels -is -found -necessary -the -plain -is -perfectly -level -and -seems -to -stretch -away -and -away -and -away -dimming -and -softening -to -the -uttermost -bounds -of -nowhere -what -a -soaring -strenuous -gushing -fountain -spray -of -delicate -greenery -a -bunch -of -bamboo -is! -as -far -as -the -eye -can -reach -these -grand -vegetable -geysers -grace -the -view -their -spoutings -refined -to -steam -by -distance -and -there -are -fields -of -bananas -with -the -sunshine -glancing -from -the -varnished -surface -of -their -drooping -vast -leaves -and -there -are -frequent -groves -of -palm -and -an -effective -accent -is -given -to -the -landscape -by -isolated -individuals -of -this -picturesque -family -towering -clean -stemmed -their -plumes -broken -and -hanging -ragged -nature's -imitation -of -an -umbrella -that -has -been -out -to -see -what -a -cyclone -is -like -and -is -trying -not -to -look -disappointed -and -everywhere -through -the -soft -morning -vistas -we -glimpse -the -villages -the -countless -villages -the -myriad -villages -thatched -built -of -clean -new -matting -snuggling -among -grouped -palms -and -sheaves -of -bamboo -villages -villages -no -end -of -villages -not -three -hundred -yards -apart -and -dozens -and -dozens -of -them -in -sight -all -the -time -a -mighty -city -hundreds -of -miles -long -hundreds -of -miles -broad -made -all -of -villages -the -biggest -city -in -the -earth -and -as -populous -as -a -european -kingdom -i -have -seen -no -such -city -as -this -before -and -there -is -a -continuously -repeated -and -replenished -multitude -of -naked -men -in -view -on -both -sides -and -ahead -we -fly -through -it -mile -after -mile -but -still -it -is -always -there -on -both -sides -and -ahead -brown -bodied -naked -men -and -boys -plowing -in -the -fields -but -not -woman -in -these -two -hours -i -have -not -seen -a -woman -or -a -girl -working -in -the -fields -from -greenland's -icy -mountains -from -india's -coral -strand -where -afric's -sunny -fountains -roll -down -their -golden -sand -from -many -an -ancient -river -from -many -a -palmy -plain -they -call -us -to -deliver -their -land -from -error's -chain -those -are -beautiful -verses -and -they -have -remained -in -my -memory -all -my -life -but -if -the -closing -lines -are -true -let -us -hope -that -when -we -come -to -answer -the -call -and -deliver -the -land -from -its -errors -we -shall -secrete -from -it -some -of -our -high -civilization -ways -and -at -the -same -time -borrow -some -of -its -pagan -ways -to -enrich -our -high -system -with -we -have -a -right -to -do -this -if -we -lift -those -people -up -we -have -a -right -to -lift -ourselves -up -nine -or -ten -grades -or -so -at -their -expense -a -few -years -ago -i -spent -several -weeks -at -tolz -in -bavaria -it -is -a -roman -catholic -region -and -not -even -benares -is -more -deeply -or -pervasively -or -intelligently -devout -in -my -diary -of -those -days -i -find -this -we -took -a -long -drive -yesterday -around -about -the -lovely -country -roads -but -it -was -a -drive -whose -pleasure -was -damaged -in -a -couple -of -ways -by -the -dreadful -shrines -and -by -the -shameful -spectacle -of -gray -and -venerable -old -grandmothers -toiling -in -the -fields -the -shrines -were -frequent -along -the -roads -figures -of -the -saviour -nailed -to -the -cross -and -streaming -with -blood -from -the -wounds -of -the -nails -and -the -thorns -when -missionaries -go -from -here -do -they -find -fault -with -the -pagan -idols -i -saw -many -women -seventy -and -even -eighty -years -old -mowing -and -binding -in -the -fields -and -pitchforking -the -loads -into -the -wagons -i -was -in -austria -later -and -in -munich -in -munich -i -saw -gray -old -women -pushing -trucks -up -hill -and -down -long -distances -trucks -laden -with -barrels -of -beer -incredible -loads -in -my -austrian -diary -i -find -this -in -the -fields -i -often -see -a -woman -and -a -cow -harnessed -to -the -plow -and -a -man -driving -in -the -public -street -of -marienbad -to -day -i -saw -an -old -bent -gray -headed -woman -in -harness -with -a -dog -drawing -a -laden -sled -over -bare -dirt -roads -and -bare -pavements -and -at -his -ease -walked -the -driver -smoking -his -pipe -a -hale -fellow -not -thirty -years -old -five -or -six -years -ago -i -bought -an -open -boat -made -a -kind -of -a -canvas -wagon -roof -over -the -stern -of -it -to -shelter -me -from -sun -and -rain -hired -a -courier -and -a -boatman -and -made -a -twelve -day -floating -voyage -down -the -rhone -from -lake -bourget -to -marseilles -in -my -diary -of -that -trip -i -find -this -entry -i -was -far -down -the -rhone -then -passing -st -etienne -2 -15 -p -m -on -a -distant -ridge -inland -a -tall -openwork -structure -commandingly -situated -with -a -statue -of -the -virgin -standing -on -it -a -devout -country -all -down -this -river -wherever -there -is -a -crag -there -is -a -statue -of -the -virgin -on -it -i -believe -i -have -seen -a -hundred -of -them -and -yet -in -many -respects -the -peasantry -seem -to -be -mere -pagans -and -destitute -of -any -considerable -degree -of -civilization -we -reached -a -not -very -promising -looking -village -about -4 -o'clock -and -i -concluded -to -tie -up -for -the -day -munching -fruit -and -fogging -the -hood -with -pipe -smoke -had -grown -monotonous -i -could -not -have -the -hood -furled -because -the -floods -of -rain -fell -unceasingly -the -tavern -was -on -the -river -bank -as -is -the -custom -it -was -dull -there -and -melancholy -nothing -to -do -but -look -out -of -the -window -into -the -drenching -rain -and -shiver -one -could -do -that -for -it -was -bleak -and -cold -and -windy -and -country -france -furnishes -no -fire -winter -overcoats -did -not -help -me -much -they -had -to -be -supplemented -with -rugs -the -raindrops -were -so -large -and -struck -the -river -with -such -force -that -they -knocked -up -the -water -like -pebble -splashes -with -the -exception -of -a -very -occasional -woodenshod -peasant -nobody -was -abroad -in -this -bitter -weather -i -mean -nobody -of -our -sex -but -all -weathers -are -alike -to -the -women -in -these -continental -countries -to -them -and -the -other -animals -life -is -serious -nothing -interrupts -their -slavery -three -of -them -were -washing -clothes -in -the -river -under -the -window -when -i -arrived -and -they -continued -at -it -as -long -as -there -was -light -to -work -by -one -was -apparently -thirty -another -the -mother! -above -fifty -the -third -grandmother! -so -old -and -worn -and -gray -she -could -have -passed -for -eighty -i -took -her -to -be -that -old -they -had -no -waterproofs -nor -rubbers -of -course -over -their -shoulders -they -wore -gunnysacks -simply -conductors -for -rivers -of -water -some -of -the -volume -reached -the -ground -the -rest -soaked -in -on -the -way -at -last -a -vigorous -fellow -of -thirty -five -arrived -dry -and -comfortable -smoking -his -pipe -under -his -big -umbrella -in -an -open -donkey -cart -husband -son -and -grandson -of -those -women! -he -stood -up -in -the -cart -sheltering -himself -and -began -to -superintend -issuing -his -orders -in -a -masterly -tone -of -command -and -showing -temper -when -they -were -not -obeyed -swiftly -enough -without -complaint -or -murmur -the -drowned -women -patiently -carried -out -the -orders -lifting -the -immense -baskets -of -soggy -wrung -out -clothing -into -the -cart -and -stowing -them -to -the -man's -satisfaction -there -were -six -of -the -great -baskets -and -a -man -of -mere -ordinary -strength -could -not -have -lifted -any -one -of -them -the -cart -being -full -now -the -frenchman -descended -still -sheltered -by -his -umbrella -entered -the -tavern -and -the -women -went -drooping -homeward -trudging -in -the -wake -of -the -cart -and -soon -were -blended -with -the -deluge -and -lost -to -sight -when -i -went -down -into -the -public -room -the -frenchman -had -his -bottle -of -wine -and -plate -of -food -on -a -bare -table -black -with -grease -and -was -chomping -like -a -horse -he -had -the -little -religious -paper -which -is -in -everybody's -hands -on -the -rhone -borders -and -was -enlightening -himself -with -the -histories -of -french -saints -who -used -to -flee -to -the -desert -in -the -middle -ages -to -escape -the -contamination -of -woman -for -two -hundred -years -france -has -been -sending -missionaries -to -other -savage -lands -to -spare -to -the -needy -from -poverty -like -hers -is -fine -and -true -generosity -but -to -get -back -to -india -where -as -my -favorite -poem -says -every -prospect -pleases -and -only -man -is -vile -it -is -because -bavaria -and -austria -and -france -have -not -introduced -their -civilization -to -him -yet -but -bavaria -and -austria -and -france -are -on -their -way -they -are -coming -they -will -rescue -him -they -will -refine -the -vileness -out -of -him -some -time -during -the -forenoon -approaching -the -mountains -we -changed -from -the -regular -train -to -one -composed -of -little -canvas -sheltered -cars -that -skimmed -along -within -a -foot -of -the -ground -and -seemed -to -be -going -fifty -miles -an -hour -when -they -were -really -making -about -twenty -each -car -had -seating -capacity -for -half -a -dozen -persons -and -when -the -curtains -were -up -one -was -substantially -out -of -doors -and -could -see -everywhere -and -get -all -the -breeze -and -be -luxuriously -comfortable -it -was -not -a -pleasure -excursion -in -name -only -but -in -fact -after -a -while -the -stopped -at -a -little -wooden -coop -of -a -station -just -within -the -curtain -of -the -sombre -jungle -a -place -with -a -deep -and -dense -forest -of -great -trees -and -scrub -and -vines -all -about -it -the -royal -bengal -tiger -is -in -great -force -there -and -is -very -bold -and -unconventional -from -this -lonely -little -station -a -message -once -went -to -the -railway -manager -in -calcutta -tiger -eating -station -master -on -front -porch -telegraph -instructions -it -was -there -that -i -had -my -first -tiger -hunt -i -killed -thirteen -we -were -presently -away -again -and -the -train -began -to -climb -the -mountains -in -one -place -seven -wild -elephants -crossed -the -track -but -two -of -them -got -away -before -i -could -overtake -them -the -railway -journey -up -the -mountain -is -forty -miles -and -it -takes -eight -hours -to -make -it -it -is -so -wild -and -interesting -and -exciting -and -enchanting -that -it -ought -to -take -a -week -as -for -the -vegetation -it -is -a -museum -the -jungle -seemed -to -contain -samples -of -every -rare -and -curious -tree -and -bush -that -we -had -ever -seen -or -heard -of -it -is -from -that -museum -i -think -that -the -globe -must -have -been -supplied -with -the -trees -and -vines -and -shrubs -that -it -holds -precious -the -road -is -infinitely -and -charmingly -crooked -it -goes -winding -in -and -out -under -lofty -cliffs -that -are -smothered -in -vines -and -foliage -and -around -the -edges -of -bottomless -chasms -and -all -the -way -one -glides -by -files -of -picturesque -natives -some -carrying -burdens -up -others -going -down -from -their -work -in -the -tea -gardens -and -once -there -was -a -gaudy -wedding -procession -all -bright -tinsel -and -color -and -a -bride -comely -and -girlish -who -peeped -out -from -the -curtains -of -her -palanquin -exposing -her -face -with -that -pure -delight -which -the -young -and -happy -take -in -sin -for -sin's -own -sake -by -and -by -we -were -well -up -in -the -region -of -the -clouds -and -from -that -breezy -height -we -looked -down -and -afar -over -a -wonderful -picture -the -plains -of -india -stretching -to -the -horizon -soft -and -fair -level -as -a -floor -shimmering -with -heat -mottled -with -cloud -shadows -and -cloven -with -shining -rivers -immediately -below -us -and -receding -down -down -down -toward -the -valley -was -a -shaven -confusion -of -hilltops -with -ribbony -roads -and -paths -squirming -and -snaking -cream -yellow -all -over -them -and -about -them -every -curve -and -twist -sharply -distinct -at -an -elevation -of -6 -000 -feet -we -entered -a -thick -cloud -and -it -shut -out -the -world -and -kept -it -shut -out -we -climbed -1 -000 -feet -higher -then -began -to -descend -and -presently -got -down -to -darjeeling -which -is -6 -000 -feet -above -the -level -of -the -plains -we -had -passed -many -a -mountain -village -on -the -way -up -and -seen -some -new -kinds -of -natives -among -them -many -samples -of -the -fighting -ghurkas -they -are -not -large -men -but -they -are -strong -and -resolute -there -are -no -better -soldiers -among -britain's -native -troops -and -we -had -passed -shoals -of -their -women -climbing -the -forty -miles -of -steep -road -from -the -valley -to -their -mountain -homes -with -tall -baskets -on -their -backs -hitched -to -their -foreheads -by -a -band -and -containing -a -freightage -weighing -i -will -not -say -how -many -hundreds -of -pounds -for -the -sum -is -unbelievable -these -were -young -women -and -they -strode -smartly -along -under -these -astonishing -burdens -with -the -air -of -people -out -for -a -holiday -i -was -told -that -a -woman -will -carry -a -piano -on -her -back -all -the -way -up -the -mountain -and -that -more -than -once -a -woman -had -done -it -if -these -were -old -women -i -should -regard -the -ghurkas -as -no -more -civilized -than -the -europeans -at -the -railway -station -at -darjeeling -you -find -plenty -of -cab -substitutes -open -coffins -in -which -you -sit -and -are -then -borne -on -men's -shoulders -up -the -steep -roads -into -the -town -up -there -we -found -a -fairly -comfortable -hotel -the -property -of -an -indiscriminate -and -incoherent -landlord -who -looks -after -nothing -but -leaves -everything -to -his -army -of -indian -servants -no -he -does -look -after -the -bill -to -be -just -to -him -and -the -tourist -cannot -do -better -than -follow -his -example -i -was -told -by -a -resident -that -the -summit -of -kinchinjunga -is -often -hidden -in -the -clouds -and -that -sometimes -a -tourist -has -waited -twenty -two -days -and -then -been -obliged -to -go -away -without -a -sight -of -it -and -yet -went -not -disappointed -for -when -he -got -his -hotel -bill -he -recognized -that -he -was -now -seeing -the -highest -thing -in -the -himalayas -but -this -is -probably -a -lie -after -lecturing -i -went -to -the -club -that -night -and -that -was -a -comfortable -place -it -is -loftily -situated -and -looks -out -over -a -vast -spread -of -scenery -from -it -you -can -see -where -the -boundaries -of -three -countries -come -together -some -thirty -miles -away -thibet -is -one -of -them -nepaul -another -and -i -think -herzegovina -was -the -other -apparently -in -every -town -and -city -in -india -the -gentlemen -of -the -british -civil -and -military -service -have -a -club -sometimes -it -is -a -palatial -one -always -it -is -pleasant -and -homelike -the -hotels -are -not -always -as -good -as -they -might -be -and -the -stranger -who -has -access -to -the -club -is -grateful -for -his -privilege -and -knows -how -to -value -it -next -day -was -sunday -friends -came -in -the -gray -dawn -with -horses -and -my -party -rode -away -to -a -distant -point -where -kinchinjunga -and -mount -everest -show -up -best -but -i -stayed -at -home -for -a -private -view -for -it -was -very -old -and -i -was -not -acquainted -with -the -horses -any -way -i -got -a -pipe -and -a -few -blankets -and -sat -for -two -hours -at -the -window -and -saw -the -sun -drive -away -the -veiling -gray -and -touch -up -the -snow -peaks -one -after -another -with -pale -pink -splashes -and -delicate -washes -of -gold -and -finally -flood -the -whole -mighty -convulsion -of -snow -mountains -with -a -deluge -of -rich -splendors -kinchinjunga's -peak -was -but -fitfully -visible -but -in -the -between -times -it -was -vividly -clear -against -the -sky -away -up -there -in -the -blue -dome -more -than -28 -000 -feet -above -sea -level -the -loftiest -land -i -had -ever -seen -by -12 -000 -feet -or -more -it -was -45 -miles -away -mount -everest -is -a -thousand -feet -higher -but -it -was -not -a -part -of -that -sea -of -mountains -piled -up -there -before -me -so -i -did -not -see -it -but -i -did -not -care -because -i -think -that -mountains -that -are -as -high -as -that -are -disagreeable -i -changed -from -the -back -to -the -front -of -the -house -and -spent -the -rest -of -the -morning -there -watching -the -swarthy -strange -tribes -flock -by -from -their -far -homes -in -the -himalayas -all -ages -and -both -sexes -were -represented -and -the -breeds -were -quite -new -to -me -though -the -costumes -of -the -thibetans -made -them -look -a -good -deal -like -chinamen -the -prayer -wheel -was -a -frequent -feature -it -brought -me -near -to -these -people -and -made -them -seem -kinfolk -of -mine -through -our -preacher -we -do -much -of -our -praying -by -proxy -we -do -not -whirl -him -around -a -stick -as -they -do -but -that -is -merely -a -detail -the -swarm -swung -briskly -by -hour -after -hour -a -strange -and -striking -pageant -it -was -wasted -there -and -it -seemed -a -pity -it -should -have -been -sent -streaming -through -the -cities -of -europe -or -america -to -refresh -eyes -weary -of -the -pale -monotonies -of -the -circus -pageant -these -people -were -bound -for -the -bazar -with -things -to -sell -we -went -down -there -later -and -saw -that -novel -congress -of -the -wild -peoples -and -plowed -here -and -there -through -it -and -concluded -that -it -would -be -worth -coming -from -calcutta -to -see -even -if -there -were -no -kinchinjunga -and -everest -chapter -lvi -there -are -two -times -in -a -man's -life -when -he -should -not -speculate -when -he -can't -afford -it -and -when -he -can -pudd'nhead -wilson's -new -calendar -on -monday -and -tuesday -at -sunrise -we -again -had -fair -to -middling -views -of -the -stupendous -mountains -then -being -well -cooled -off -and -refreshed -we -were -ready -to -chance -the -weather -of -the -lower -world -once -more -we -traveled -up -hill -by -the -regular -train -five -miles -to -the -summit -then -changed -to -a -little -canvas -canopied -hand -car -for -the -35 -mile -descent -it -was -the -size -of -a -sleigh -it -had -six -seats -and -was -so -low -that -it -seemed -to -rest -on -the -ground -it -had -no -engine -or -other -propelling -power -and -needed -none -to -help -it -fly -down -those -steep -inclines -it -only -needed -a -strong -brake -to -modify -its -flight -and -it -had -that -there -was -a -story -of -a -disastrous -trip -made -down -the -mountain -once -in -this -little -car -by -the -lieutenant -governor -of -bengal -when -the -car -jumped -the -track -and -threw -its -passengers -over -a -precipice -it -was -not -true -but -the -story -had -value -for -me -for -it -made -me -nervous -and -nervousness -wakes -a -person -up -and -makes -him -alive -and -alert -and -heightens -the -thrill -of -a -new -and -doubtful -experience -the -car -could -really -jump -the -track -of -course -a -pebble -on -the -track -placed -there -by -either -accident -or -malice -at -a -sharp -curve -where -one -might -strike -it -before -the -eye -could -discover -it -could -derail -the -car -and -fling -it -down -into -india -and -the -fact -that -the -lieutenant -governor -had -escaped -was -no -proof -that -i -would -have -the -same -luck -and -standing -there -looking -down -upon -the -indian -empire -from -the -airy -altitude -of -7 -000 -feet -it -seemed -unpleasantly -far -dangerously -far -to -be -flung -from -a -handcar -but -after -all -there -was -but -small -danger -for -me -what -there -was -was -for -mr -pugh -inspector -of -a -division -of -the -indian -police -in -whose -company -and -protection -we -had -come -from -calcutta -he -had -seen -long -service -as -an -artillery -officer -was -less -nervous -than -i -was -and -so -he -was -to -go -ahead -of -us -in -a -pilot -hand -car -with -a -ghurka -and -another -native -and -the -plan -was -that -when -we -should -see -his -car -jump -over -a -precipice -we -must -put -on -our -break -[sp -] -and -send -for -another -pilot -it -was -a -good -arrangement -also -mr -barnard -chief -engineer -of -the -mountain -division -of -the -road -was -to -take -personal -charge -of -our -car -and -he -had -been -down -the -mountain -in -it -many -a -time -everything -looked -safe -indeed -there -was -but -one -questionable -detail -left -the -regular -train -was -to -follow -us -as -soon -as -we -should -start -and -it -might -run -over -us -privately -i -thought -it -would -the -road -fell -sharply -down -in -front -of -us -and -went -corkscrewing -in -and -out -around -the -crags -and -precipices -down -down -forever -down -suggesting -nothing -so -exactly -or -so -uncomfortably -as -a -croaked -toboggan -slide -with -no -end -to -it -mr -pugh -waved -his -flag -and -started -like -an -arrow -from -a -bow -and -before -i -could -get -out -of -the -car -we -were -gone -too -i -had -previously -had -but -one -sensation -like -the -shock -of -that -departure -and -that -was -the -gaspy -shock -that -took -my -breath -away -the -first -time -that -i -was -discharged -from -the -summit -of -a -toboggan -slide -but -in -both -instances -the -sensation -was -pleasurable -intensely -so -it -was -a -sudden -and -immense -exaltation -a -mixed -ecstasy -of -deadly -fright -and -unimaginable -joy -i -believe -that -this -combination -makes -the -perfection -of -human -delight -the -pilot -car's -flight -down -the -mountain -suggested -the -swoop -of -a -swallow -that -is -skimming -the -ground -so -swiftly -and -smoothly -and -gracefully -it -swept -down -the -long -straight -reaches -and -soared -in -and -out -of -the -bends -and -around -the -corners -we -raced -after -it -and -seemed -to -flash -by -the -capes -and -crags -with -the -speed -of -light -and -now -and -then -we -almost -overtook -it -and -had -hopes -but -it -was -only -playing -with -us -when -we -got -near -it -released -its -brake -make -a -spring -around -a -corner -and -the -next -time -it -spun -into -view -a -few -seconds -later -it -looked -as -small -as -a -wheelbarrow -it -was -so -far -away -we -played -with -the -train -in -the -same -way -we -often -got -out -to -gather -flowers -or -sit -on -a -precipice -and -look -at -the -scenery -then -presently -we -would -hear -a -dull -and -growing -roar -and -the -long -coils -of -the -train -would -come -into -sight -behind -and -above -us -but -we -did -not -need -to -start -till -the -locomotive -was -close -down -upon -us -then -we -soon -left -it -far -behind -it -had -to -stop -at -every -station -therefore -it -was -not -an -embarrassment -to -us -our -brake -was -a -good -piece -of -machinery -it -could -bring -the -car -to -a -standstill -on -a -slope -as -steep -as -a -house -roof -the -scenery -was -grand -and -varied -and -beautiful -and -there -was -no -hurry -we -could -always -stop -and -examine -it -there -was -abundance -of -time -we -did -not -need -to -hamper -the -train -if -it -wanted -the -road -we -could -switch -off -and -let -it -go -by -then -overtake -it -and -pass -it -later -we -stopped -at -one -place -to -see -the -gladstone -cliff -a -great -crag -which -the -ages -and -the -weather -have -sculptured -into -a -recognizable -portrait -of -the -venerable -statesman -mr -gladstone -is -a -stockholder -in -the -road -and -nature -began -this -portrait -ten -thousand -years -ago -with -the -idea -of -having -the -compliment -ready -in -time -for -the -event -we -saw -a -banyan -tree -which -sent -down -supporting -stems -from -branches -which -were -sixty -feet -above -the -ground -that -is -i -suppose -it -was -a -banyan -its -bark -resembled -that -of -the -great -banyan -in -the -botanical -gardens -at -calcutta -that -spider -legged -thing -with -its -wilderness -of -vegetable -columns -and -there -were -frequent -glimpses -of -a -totally -leafless -tree -upon -whose -innumerable -twigs -and -branches -a -cloud -of -crimson -butterflies -had -lighted -apparently -in -fact -these -brilliant -red -butterflies -were -flowers -but -the -illusion -was -good -afterward -in -south -africa -i -saw -another -splendid -effect -made -by -red -flowers -this -flower -was -probably -called -the -torch -plant -should -have -been -so -named -anyway -it -had -a -slender -stem -several -feet -high -and -from -its -top -stood -up -a -single -tongue -of -flame -an -intensely -red -flower -of -the -size -and -shape -of -a -small -corn -cob -the -stems -stood -three -or -four -feet -apart -all -over -a -great -hill -slope -that -was -a -mile -long -and -make -one -think -of -what -the -place -de -la -concorde -would -be -if -its -myriad -lights -were -red -instead -of -white -and -yellow -a -few -miles -down -the -mountain -we -stopped -half -an -hour -to -see -a -thibetan -dramatic -performance -it -was -in -the -open -air -on -the -hillside -the -audience -was -composed -of -thibetans -ghurkas -and -other -unusual -people -the -costumes -of -the -actors -were -in -the -last -degree -outlandish -and -the -performance -was -in -keeping -with -the -clothes -to -an -accompaniment -of -barbarous -noises -the -actors -stepped -out -one -after -another -and -began -to -spin -around -with -immense -swiftness -and -vigor -and -violence -chanting -the -while -and -soon -the -whole -troupe -would -be -spinning -and -chanting -and -raising -the -dust -they -were -performing -an -ancient -and -celebrated -historical -play -and -a -chinaman -explained -it -to -me -in -pidjin -english -as -it -went -along -the -play -was -obscure -enough -without -the -explanation -with -the -explanation -added -it -was -opake -as -a -drama -this -ancient -historical -work -of -art -was -defective -i -thought -but -as -a -wild -and -barbarous -spectacle -the -representation -was -beyond -criticism -far -down -the -mountain -we -got -out -to -look -at -a -piece -of -remarkable -loop -engineering -a -spiral -where -the -road -curves -upon -itself -with -such -abruptness -that -when -the -regular -train -came -down -and -entered -the -loop -we -stood -over -it -and -saw -the -locomotive -disappear -under -our -bridge -then -in -a -few -moments -appear -again -chasing -its -own -tail -and -we -saw -it -gain -on -it -overtake -it -draw -ahead -past -the -rear -cars -and -run -a -race -with -that -end -of -the -train -it -was -like -a -snake -swallowing -itself -half -way -down -the -mountain -we -stopped -about -an -hour -at -mr -barnard's -house -for -refreshments -and -while -we -were -sitting -on -the -veranda -looking -at -the -distant -panorama -of -hills -through -a -gap -in -the -forest -we -came -very -near -seeing -a -leopard -kill -a -calf -[it -killed -it -the -day -before -] -it -is -a -wild -place -and -lovely -from -the -woods -all -about -came -the -songs -of -birds -among -them -the -contributions -of -a -couple -of -birds -which -i -was -not -then -acquainted -with -the -brain -fever -bird -and -the -coppersmith -the -song -of -the -brain -fever -demon -starts -on -a -low -but -steadily -rising -key -and -is -a -spiral -twist -which -augments -in -intensity -and -severity -with -each -added -spiral -growing -sharper -and -sharper -and -more -and -more -painful -more -and -more -agonizing -more -and -more -maddening -intolerable -unendurable -as -it -bores -deeper -and -deeper -and -deeper -into -the -listener's -brain -until -at -last -the -brain -fever -comes -as -a -relief -and -the -man -dies -i -am -bringing -some -of -these -birds -home -to -america -they -will -be -a -great -curiosity -there -and -it -is -believed -that -in -our -climate -they -will -multiply -like -rabbits -the -coppersmith -bird's -note -at -a -certain -distance -away -has -the -ring -of -a -sledge -on -granite -at -a -certain -other -distance -the -hammering -has -a -more -metallic -ring -and -you -might -think -that -the -bird -was -mending -a -copper -kettle -at -another -distance -it -has -a -more -woodeny -thump -but -it -is -a -thump -that -is -full -of -energy -and -sounds -just -like -starting -a -bung -so -he -is -a -hard -bird -to -name -with -a -single -name -he -is -a -stone -breaker -coppersmith -and -bung -starter -and -even -then -he -is -not -completely -named -for -when -he -is -close -by -you -find -that -there -is -a -soft -deep -melodious -quality -in -his -thump -and -for -that -no -satisfying -name -occurs -to -you -you -will -not -mind -his -other -notes -but -when -he -camps -near -enough -for -you -to -hear -that -one -you -presently -find -that -his -measured -and -monotonous -repetition -of -it -is -beginning -to -disturb -you -next -it -will -weary -you -soon -it -will -distress -you -and -before -long -each -thump -will -hurt -your -head -if -this -goes -on -you -will -lose -your -mind -with -the -pain -and -misery -of -it -and -go -crazy -i -am -bringing -some -of -these -birds -home -to -america -there -is -nothing -like -them -there -they -will -be -a -great -surprise -and -it -is -said -that -in -a -climate -like -ours -they -will -surpass -expectation -for -fecundity -i -am -bringing -some -nightingales -too -and -some -cue -owls -i -got -them -in -italy -the -song -of -the -nightingale -is -the -deadliest -known -to -ornithology -that -demoniacal -shriek -can -kill -at -thirty -yards -the -note -of -the -cue -owl -is -infinitely -soft -and -sweet -soft -and -sweet -as -the -whisper -of -a -flute -but -penetrating -oh -beyond -belief -it -can -bore -through -boiler -iron -it -is -a -lingering -note -and -comes -in -triplets -on -the -one -unchanging -key -hoo -o -o -hoo -o -o -hoo -o -o -then -a -silence -of -fifteen -seconds -then -the -triplet -again -and -so -on -all -night -at -first -it -is -divine -then -less -so -then -trying -then -distressing -then -excruciating -then -agonizing -and -at -the -end -of -two -hours -the -listener -is -a -maniac -and -so -presently -we -took -to -the -hand -car -and -went -flying -down -the -mountain -again -flying -and -stopping -flying -and -stopping -till -at -last -we -were -in -the -plain -once -more -and -stowed -for -calcutta -in -the -regular -train -that -was -the -most -enjoyable -day -i -have -spent -in -the -earth -for -rousing -tingling -rapturous -pleasure -there -is -no -holiday -trip -that -approaches -the -bird -flight -down -the -himalayas -in -a -hand -car -it -has -no -fault -no -blemish -no -lack -except -that -there -are -only -thirty -five -miles -of -it -instead -of -five -hundred -chapter -lvii -she -was -not -quite -what -you -would -call -refined -she -was -not -quite -what -you -would -call -unrefined -she -was -the -kind -of -person -that -keeps -a -parrot -pudd'nhead -wilson's -new -calendar -so -far -as -i -am -able -to -judge -nothing -has -been -left -undone -either -by -man -or -nature -to -make -india -the -most -extraordinary -country -that -the -sun -visits -on -his -round -nothing -seems -to -have -been -forgotten -nothing -over -looked -always -when -you -think -you -have -come -to -the -end -of -her -tremendous -specialties -and -have -finished -banging -tags -upon -her -as -the -land -of -the -thug -the -land -of -the -plague -the -land -of -famine -the -land -of -giant -illusions -the -land -of -stupendous -mountains -and -so -forth -another -specialty -crops -up -and -another -tag -is -required -i -have -been -overlooking -the -fact -that -india -is -by -an -unapproachable -supremacy -the -land -of -murderous -wild -creatures -perhaps -it -will -be -simplest -to -throw -away -the -tags -and -generalize -her -with -one -all -comprehensive -name -as -the -land -of -wonders -for -many -years -the -british -indian -government -has -been -trying -to -destroy -the -murderous -wild -creatures -and -has -spent -a -great -deal -of -money -in -the -effort -the -annual -official -returns -show -that -the -undertaking -is -a -difficult -one -these -returns -exhibit -a -curious -annual -uniformity -in -results -the -sort -of -uniformity -which -you -find -in -the -annual -output -of -suicides -in -the -world's -capitals -and -the -proportions -of -deaths -by -this -that -and -the -other -disease -you -can -always -come -close -to -foretelling -how -many -suicides -will -occur -in -paris -london -and -new -york -next -year -and -also -how -many -deaths -will -result -from -cancer -consumption -dog -bite -falling -out -of -the -window -getting -run -over -by -cabs -etc -if -you -know -the -statistics -of -those -matters -for -the -present -year -in -the -same -way -with -one -year's -indian -statistics -before -you -you -can -guess -closely -at -how -many -people -were -killed -in -that -empire -by -tigers -during -the -previous -year -and -the -year -before -that -and -the -year -before -that -and -at -how -many -were -killed -in -each -of -those -years -by -bears -how -many -by -wolves -and -how -many -by -snakes -and -you -can -also -guess -closely -at -how -many -people -are -going -to -be -killed -each -year -for -the -coming -five -years -by -each -of -those -agencies -you -can -also -guess -closely -at -how -many -of -each -agency -the -government -is -going -to -kill -each -year -for -the -next -five -years -i -have -before -me -statistics -covering -a -period -of -six -consecutive -years -by -these -i -know -that -in -india -the -tiger -kills -something -over -800 -persons -every -year -and -that -the -government -responds -by -killing -about -double -as -many -tigers -every -year -in -four -of -the -six -years -referred -to -the -tiger -got -800 -odd -in -one -of -the -remaining -two -years -he -got -only -700 -but -in -the -other -remaining -year -he -made -his -average -good -by -scoring -917 -he -is -always -sure -of -his -average -anyone -who -bets -that -the -tiger -will -kill -2 -400 -people -in -india -in -any -three -consecutive -years -has -invested -his -money -in -a -certainty -anyone -who -bets -that -he -will -kill -2 -600 -in -any -three -consecutive -years -is -absolutely -sure -to -lose -as -strikingly -uniform -as -are -the -statistics -of -suicide -they -are -not -any -more -so -than -are -those -of -the -tiger's -annual -output -of -slaughtered -human -beings -in -india -the -government's -work -is -quite -uniform -too -it -about -doubles -the -tiger's -average -in -six -years -the -tiger -killed -5 -000 -persons -minus -50 -in -the -same -six -years -10 -000 -tigers -were -killed -minus -400 -the -wolf -kills -nearly -as -many -people -as -the -tiger -700 -a -year -to -the -tiger's -800 -odd -but -while -he -is -doing -it -more -than -5 -000 -of -his -tribe -fall -the -leopard -kills -an -average -of -230 -people -per -year -but -loses -3 -300 -of -his -own -mess -while -he -is -doing -it -the -bear -kills -100 -people -per -year -at -a -cost -of -1 -250 -of -his -own -tribe -the -tiger -as -the -figures -show -makes -a -very -handsome -fight -against -man -but -it -is -nothing -to -the -elephant's -fight -the -king -of -beasts -the -lord -of -the -jungle -loses -four -of -his -mess -per -year -but -he -kills -forty -five -persons -to -make -up -for -it -but -when -it -comes -to -killing -cattle -the -lord -of -the -jungle -is -not -interested -he -kills -but -100 -in -six -years -horses -of -hunters -no -doubt -but -in -the -same -six -the -tiger -kills -more -than -84 -000 -the -leopard -100 -000 -the -bear -4 -000 -the -wolf -70 -000 -the -hyena -more -than -13 -000 -other -wild -beasts -27 -000 -and -the -snakes -19 -000 -a -grand -total -of -more -than -300 -000 -an -average -of -50 -000 -head -per -year -in -response -the -government -kills -in -the -six -years -a -total -of -3 -201 -232 -wild -beasts -and -snakes -ten -for -one -it -will -be -perceived -that -the -snakes -are -not -much -interested -in -cattle -they -kill -only -3 -000 -odd -per -year -the -snakes -are -much -more -interested -in -man -india -swarms -with -deadly -snakes -at -the -head -of -the -list -is -the -cobra -the -deadliest -known -to -the -world -a -snake -whose -bite -kills -where -the -rattlesnake's -bite -merely -entertains -in -india -the -annual -man -killings -by -snakes -are -as -uniform -as -regular -and -as -forecastable -as -are -the -tiger -average -and -the -suicide -average -anyone -who -bets -that -in -india -in -any -three -consecutive -years -the -snakes -will -kill -49 -500 -persons -will -win -his -bet -and -anyone -who -bets -that -in -india -in -any -three -consecutive -years -the -snakes -will -kill -53 -500 -persons -will -lose -his -bet -in -india -the -snakes -kill -17 -000 -people -a -year -they -hardly -ever -fall -short -of -it -they -as -seldom -exceed -it -an -insurance -actuary -could -take -the -indian -census -tables -and -the -government's -snake -tables -and -tell -you -within -sixpence -how -much -it -would -be -worth -to -insure -a -man -against -death -by -snake -bite -there -if -i -had -a -dollar -for -every -person -killed -per -year -in -india -i -would -rather -have -it -than -any -other -property -as -it -is -the -only -property -in -the -world -not -subject -to -shrinkage -i -should -like -to -have -a -royalty -on -the -government -end -of -the -snake -business -too -and -am -in -london -now -trying -to -get -it -but -when -i -get -it -it -is -not -going -to -be -as -regular -an -income -as -the -other -will -be -if -i -get -that -i -have -applied -for -it -the -snakes -transact -their -end -of -the -business -in -a -more -orderly -and -systematic -way -than -the -government -transacts -its -end -of -it -because -the -snakes -have -had -a -long -experience -and -know -all -about -the -traffic -you -can -make -sure -that -the -government -will -never -kill -fewer -than -110 -000 -snakes -in -a -year -and -that -it -will -newer -quite -reach -300 -000 -too -much -room -for -oscillation -good -speculative -stock -to -bear -or -bull -and -buy -and -sell -long -and -short -and -all -that -kind -of -thing -but -not -eligible -for -investment -like -the -other -the -man -that -speculates -in -the -government's -snake -crop -wants -to -go -carefully -i -would -not -advise -a -man -to -buy -a -single -crop -at -all -i -mean -a -crop -of -futures -for -the -possible -wobble -is -something -quite -extraordinary -if -he -can -buy -six -future -crops -in -a -bunch -seller -to -deliver -1 -500 -000 -altogether -that -is -another -matter -i -do -not -know -what -snakes -are -worth -now -but -i -know -what -they -would -be -worth -then -for -the -statistics -show -that -the -seller -could -not -come -within -427 -000 -of -carrying -out -his -contract -however -i -think -that -a -person -who -speculates -in -snakes -is -a -fool -anyway -he -always -regrets -it -afterwards -to -finish -the -statistics -in -six -years -the -wild -beasts -kill -20 -000 -persons -and -the -snakes -kill -103 -000 -in -the -same -six -the -government -kills -1 -073 -546 -snakes -plenty -left -there -are -narrow -escapes -in -india -in -the -very -jungle -where -i -killed -sixteen -tigers -and -all -those -elephants -a -cobra -bit -me -but -it -got -well -everyone -was -surprised -this -could -not -happen -twice -in -ten -years -perhaps -usually -death -would -result -in -fifteen -minutes -we -struck -out -westward -or -northwestward -from -calcutta -on -an -itinerary -of -a -zig -zag -sort -which -would -in -the -course -of -time -carry -us -across -india -to -its -northwestern -corner -and -the -border -of -afghanistan -the -first -part -of -the -trip -carried -us -through -a -great -region -which -was -an -endless -garden -miles -and -miles -of -the -beautiful -flower -from -whose -juices -comes -the -opium -and -at -muzaffurpore -we -were -in -the -midst -of -the -indigo -culture -thence -by -a -branch -road -to -the -ganges -at -a -point -near -dinapore -and -by -a -train -which -would -have -missed -the -connection -by -a -week -but -for -the -thoughtfulness -of -some -british -officers -who -were -along -and -who -knew -the -ways -of -trains -that -are -run -by -natives -without -white -supervision -this -train -stopped -at -every -village -for -no -purpose -connected -with -business -apparently -we -put -out -nothing -we -took -nothing -aboard -the -train -bands -stepped -ashore -and -gossiped -with -friends -a -quarter -of -an -hour -then -pulled -out -and -repeated -this -at -the -succeeding -villages -we -had -thirty -five -miles -to -go -and -six -hours -to -do -it -in -but -it -was -plain -that -we -were -not -going -to -make -it -it -was -then -that -the -english -officers -said -it -was -now -necessary -to -turn -this -gravel -train -into -an -express -so -they -gave -the -engine -driver -a -rupee -and -told -him -to -fly -it -was -a -simple -remedy -after -that -we -made -ninety -miles -an -hour -we -crossed -the -ganges -just -at -dawn -made -our -connection -and -went -to -benares -where -we -stayed -twenty -four -hours -and -inspected -that -strange -and -fascinating -piety -hive -again -then -left -for -lucknow -a -city -which -is -perhaps -the -most -conspicuous -of -the -many -monuments -of -british -fortitude -and -valor -that -are -scattered -about -the -earth -the -heat -was -pitiless -the -flat -plains -were -destitute -of -grass -and -baked -dry -by -the -sun -they -were -the -color -of -pale -dust -which -was -flying -in -clouds -but -it -was -much -hotter -than -this -when -the -relieving -forces -marched -to -lucknow -in -the -time -of -the -mutiny -those -were -the -days -of -138 -deg -in -the -shade -chapter -lviii -make -it -a -point -to -do -something -every -day -that -you -don't -want -to -do -this -is -the -golden -rule -for -acquiring -the -habit -of -doing -your -duty -without -pain -pudd'nhead -wilson's -new -calendar -it -seems -to -be -settled -now -that -among -the -many -causes -from -which -the -great -mutiny -sprang -the -main -one -was -the -annexation -of -the -kingdom -of -oudh -by -the -east -india -company -characterized -by -sir -henry -lawrence -as -the -most -unrighteous -act -that -was -ever -committed -in -the -spring -of -1857 -a -mutinous -spirit -was -observable -in -many -of -the -native -garrisons -and -it -grew -day -by -day -and -spread -wider -and -wider -the -younger -military -men -saw -something -very -serious -in -it -and -would -have -liked -to -take -hold -of -it -vigorously -and -stamp -it -out -promptly -but -they -were -not -in -authority -old -men -were -in -the -high -places -of -the -army -men -who -should -have -been -retired -long -before -because -of -their -great -age -and -they -regarded -the -matter -as -a -thing -of -no -consequence -they -loved -their -native -soldiers -and -would -not -believe -that -anything -could -move -them -to -revolt -everywhere -these -obstinate -veterans -listened -serenely -to -the -rumbling -of -the -volcanoes -under -them -and -said -it -was -nothing -and -so -the -propagators -of -mutiny -had -everything -their -own -way -they -moved -from -camp -to -camp -undisturbed -and -painted -to -the -native -soldier -the -wrongs -his -people -were -suffering -at -the -hands -of -the -english -and -made -his -heart -burn -for -revenge -they -were -able -to -point -to -two -facts -of -formidable -value -as -backers -of -their -persuasions -in -clive's -day -native -armies -were -incoherent -mobs -and -without -effective -arms -therefore -they -were -weak -against -clive's -organized -handful -of -well -armed -men -but -the -thing -was -the -other -way -now -the -british -forces -were -native -they -had -been -trained -by -the -british -organized -by -the -british -armed -by -the -british -all -the -power -was -in -their -hands -they -were -a -club -made -by -british -hands -to -beat -out -british -brains -with -there -was -nothing -to -oppose -their -mass -nothing -but -a -few -weak -battalions -of -british -soldiers -scattered -about -india -a -force -not -worth -speaking -of -this -argument -taken -alone -might -not -have -succeeded -for -the -bravest -and -best -indian -troops -had -a -wholesome -dread -of -the -white -soldier -whether -he -was -weak -or -strong -but -the -agitators -backed -it -with -their -second -and -best -point -prophecy -a -prophecy -a -hundred -years -old -the -indian -is -open -to -prophecy -at -all -times -argument -may -fail -to -convince -him -but -not -prophecy -there -was -a -prophecy -that -a -hundred -years -from -the -year -of -that -battle -of -clive's -which -founded -the -british -indian -empire -the -british -power -would -be -overthrown -and -swept -away -by -the -natives -the -mutiny -broke -out -at -meerut -on -the -10th -of -may -1857 -and -fired -a -train -of -tremendous -historical -explosions -nana -sahib's -massacre -of -the -surrendered -garrison -of -cawnpore -occurred -in -june -and -the -long -siege -of -lucknow -began -the -military -history -of -england -is -old -and -great -but -i -think -it -must -be -granted -that -the -crushing -of -the -mutiny -is -the -greatest -chapter -in -it -the -british -were -caught -asleep -and -unprepared -they -were -a -few -thousands -swallowed -up -in -an -ocean -of -hostile -populations -it -would -take -months -to -inform -england -and -get -help -but -they -did -not -falter -or -stop -to -count -the -odds -but -with -english -resolution -and -english -devotion -they -took -up -their -task -and -went -stubbornly -on -with -it -through -good -fortune -and -bad -and -fought -the -most -unpromising -fight -that -one -may -read -of -in -fiction -or -out -of -it -and -won -it -thoroughly -the -mutiny -broke -out -so -suddenly -and -spread -with -such -rapidity -that -there -was -but -little -time -for -occupants -of -weak -outlying -stations -to -escape -to -places -of -safety -attempts -were -made -of -course -but -they -were -attended -by -hardships -as -bitter -as -death -in -the -few -cases -which -were -successful -for -the -heat -ranged -between -120 -and -138 -in -the -shade -the -way -led -through -hostile -peoples -and -food -and -water -were -hardly -to -be -had -for -ladies -and -children -accustomed -to -ease -and -comfort -and -plenty -such -a -journey -must -have -been -a -cruel -experience -sir -g -o -trevelyan -quotes -an -example -this -is -what -befell -mrs -m -the -wife -of -the -surgeon -at -a -certain -station -on -the -southern -confines -of -the -insurrection -'i -heard -' -she -says -'a -number -of -shots -fired -and -looking -out -i -saw -my -husband -driving -furiously -from -the -mess -house -waving -his -whip -i -ran -to -him -and -seeing -a -bearer -with -my -child -in -his -arms -i -caught -her -up -and -got -into -the -buggy -at -the -mess -house -we -found -all -the -officers -assembled -together -with -sixty -sepoys -who -had -remained -faithful -we -went -off -in -one -large -party -amidst -a -general -conflagration -of -our -late -homes -we -reached -the -caravanserai -at -chattapore -the -next -morning -and -thence -started -for -callinger -at -this -point -our -sepoy -escort -deserted -us -we -were -fired -upon -by -match -lockmen -and -one -officer -was -shot -dead -we -heard -likewise -that -the -people -had -risen -at -callinger -so -we -returned -and -walked -back -ten -miles -that -day -m -and -i -carried -the -child -alternately -presently -mrs -smalley -died -of -sunstroke -we -had -no -food -amongst -us -an -officer -kindly -lent -us -a -horse -we -were -very -faint -the -major -died -and -was -buried -also -the -sergeant -major -and -some -women -the -bandsmen -left -us -on -the -nineteenth -of -june -we -were -fired -at -again -by -match -lockmen -and -changed -direction -for -allahabad -our -party -consisted -of -nine -gentlemen -two -children -the -sergeant -and -his -wife -on -the -morning -of -the -twentieth -captain -scott -took -lottie -on -to -his -horse -i -was -riding -behind -my -husband -and -she -was -so -crushed -between -us -she -was -two -years -old -on -the -first -of -the -month -we -were -both -weak -through -want -of -food -and -the -effect -of -the -sun -lottie -and -i -had -no -head -covering -m -had -a -sepoy's -cap -i -found -on -the -ground -soon -after -sunrise -we -were -followed -by -villagers -armed -with -clubs -and -spears -one -of -them -struck -captain -scott's -horse -on -the -leg -he -galloped -off -with -lottie -and -my -poor -husband -never -saw -his -child -again -we -rode -on -several -miles -keeping -away -from -villages -and -then -crossed -the -river -our -thirst -was -extreme -m -had -dreadful -cramps -so -that -i -had -to -hold -him -on -the -horse -i -was -very -uneasy -about -him -the -day -before -i -saw -the -drummer's -wife -eating -chupatties -and -asked -her -to -give -a -piece -to -the -child -which -she -did -i -now -saw -water -in -a -ravine -the -descent -was -steep -and -our -only -drinkingvessel -was -m -'s -cap -our -horse -got -water -and -i -bathed -my -neck -i -had -no -stockings -and -my -feet -were -torn -and -blistered -two -peasants -came -in -sight -and -we -were -frightened -and -rode -off -the -sergeant -held -our -horse -and -m -put -me -up -and -mounted -i -think -he -must -have -got -suddenly -faint -for -i -fell -and -he -over -me -on -the -road -when -the -horse -started -off -some -time -before -he -said -and -barber -too -that -he -could -not -live -many -hours -i -felt -he -was -dying -before -we -came -to -the -ravine -he -told -me -his -wishes -about -his -children -and -myself -and -took -leave -my -brain -seemed -burnt -up -no -tears -came -as -soon -as -we -fell -the -sergeant -let -go -the -horse -and -it -went -off -so -that -escape -was -cut -off -we -sat -down -on -the -ground -waiting -for -death -poor -fellow! -he -was -very -weak -his -thirst -was -frightful -and -i -went -to -get -him -water -some -villagers -came -and -took -my -rupees -and -watch -i -took -off -my -wedding -ring -and -twisted -it -in -my -hair -and -replaced -the -guard -i -tore -off -the -skirt -of -my -dress -to -bring -water -in -but -was -no -use -for -when -i -returned -my -beloved's -eyes -were -fixed -and -though -i -called -and -tried -to -restore -him -and -poured -water -into -his -mouth -it -only -rattled -in -his -throat -he -never -spoke -to -me -again -i -held -him -in -my -arms -till -he -sank -gradually -down -i -felt -frantic -but -could -not -cry -i -was -alone -i -bound -his -head -and -face -in -my -dress -for -there -was -no -earth -to -buy -him -the -pain -in -my -hands -and -feet -was -dreadful -i -went -down -to -the -ravine -and -sat -in -the -water -on -a -stone -hoping -to -get -off -at -night -and -look -for -lottie -when -i -came -back -from -the -water -i -saw -that -they -had -not -taken -her -little -watch -chain -and -seals -so -i -tied -them -under -my -petticoat -in -an -hour -about -thirty -villagers -came -they -dragged -me -out -of -the -ravine -and -took -off -my -jacket -and -found -the -little -chain -they -then -dragged -me -to -a -village -mocking -me -all -the -way -and -disputing -as -to -whom -i -was -to -belong -to -the -whole -population -came -to -look -at -me -i -asked -for -a -bedstead -and -lay -down -outside -the -door -of -a -hut -they -had -a -dozen -of -cows -and -yet -refused -me -milk -when -night -came -and -the -village -was -quiet -some -old -woman -brought -me -a -leafful -of -rice -i -was -too -parched -to -eat -and -they -gave -me -water -the -morning -after -a -neighboring -rajah -sent -a -palanquin -and -a -horseman -to -fetch -me -who -told -me -that -a -little -child -and -three -sahibs -had -come -to -his -master's -house -and -so -the -poor -mother -found -her -lost -one -'greatly -blistered -' -poor -little -creature -it -is -not -for -europeans -in -india -to -pray -that -their -flight -be -not -in -the -winter -in -the -first -days -of -june -the -aged -general -sir -hugh -wheeler -commanding -the -forces -at -cawnpore -was -deserted -by -his -native -troops -then -he -moved -out -of -the -fort -and -into -an -exposed -patch -of -open -flat -ground -and -built -a -four -foot -mud -wall -around -it -he -had -with -him -a -few -hundred -white -soldiers -and -officers -and -apparently -more -women -and -children -than -soldiers -he -was -short -of -provisions -short -of -arms -short -of -ammunition -short -of -military -wisdom -short -of -everything -but -courage -and -devotion -to -duty -the -defense -of -that -open -lot -through -twenty -one -days -and -nights -of -hunger -thirst -indian -heat -and -a -never -ceasing -storm -of -bullets -bombs -and -cannon -balls -a -defense -conducted -not -by -the -aged -and -infirm -general -but -by -a -young -officer -named -moore -is -one -of -the -most -heroic -episodes -in -history -when -at -last -the -nana -found -it -impossible -to -conquer -these -starving -men -and -women -with -powder -and -ball -he -resorted -to -treachery -and -that -succeeded -he -agreed -to -supply -them -with -food -and -send -them -to -allahabad -in -boats -their -mud -wall -and -their -barracks -were -in -ruins -their -provisions -were -at -the -point -of -exhaustion -they -had -done -all -that -the -brave -could -do -they -had -conquered -an -honorable -compromise -their -forces -had -been -fearfully -reduced -by -casualties -and -by -disease -they -were -not -able -to -continue -the -contest -longer -they -came -forth -helpless -but -suspecting -no -treachery -the -nana's -host -closed -around -them -and -at -a -signal -from -a -trumpet -the -massacre -began -about -two -hundred -women -and -children -were -spared -for -the -present -but -all -the -men -except -three -or -four -were -killed -among -the -incidents -of -the -massacre -quoted -by -sir -g -o -trevelyan -is -this -when -after -the -lapse -of -some -twenty -minutes -the -dead -began -to -outnumber -the -living -when -the -fire -slackened -as -the -marks -grew -few -and -far -between -then -the -troopers -who -had -been -drawn -up -to -the -right -of -the -temple -plunged -into -the -river -sabre -between -teeth -and -pistol -in -hand -thereupon -two -half -caste -christian -women -the -wives -of -musicians -in -the -band -of -the -fifty -sixth -witnessed -a -scene -which -should -not -be -related -at -second -hand -'in -the -boat -where -i -was -to -have -gone -' -says -mrs -bradshaw -confirmed -throughout -by -mrs -betts -'was -the -school -mistress -and -twenty -two -misses -general -wheeler -came -last -in -a -palkee -they -carried -him -into -the -water -near -the -boat -i -stood -close -by -he -said -'carry -me -a -little -further -towards -the -boat -' -but -a -trooper -said -'no -get -out -here -' -as -the -general -got -out -of -the -palkee -head -foremost -the -trooper -gave -him -a -cut -with -his -sword -into -the -neck -and -he -fell -into -the -water -my -son -was -killed -near -him -i -saw -it -alas! -alas! -some -were -stabbed -with -bayonets -others -cut -down -little -infants -were -torn -in -pieces -we -saw -it -we -did -and -tell -you -only -what -we -saw -other -children -were -stabbed -and -thrown -into -the -river -the -schoolgirls -were -burnt -to -death -i -saw -their -clothes -and -hair -catch -fire -in -the -water -a -few -paces -off -by -the -next -boat -we -saw -the -youngest -daughter -of -colonel -williams -a -sepoy -was -going -to -kill -her -with -his -bayonet -she -said -'my -father -was -always -kind -to -sepoys -' -he -turned -away -and -just -then -a -villager -struck -her -on -the -head -with -a -club -and -she -fell -into -the -water -these -people -likewise -saw -good -mr -moncrieff -the -clergyman -take -a -book -from -his -pocket -that -he -never -had -leisure -to -open -and -heard -him -commence -a -prayer -for -mercy -which -he -was -not -permitted -to -conclude -another -deponent -observed -an -european -making -for -a -drain -like -a -scared -water -rat -when -some -boatmen -armed -with -cudgels -cut -off -his -retreat -and -beat -him -down -dead -into -the -mud -the -women -and -children -who -had -been -reserved -from -the -massacre -were -imprisoned -during -a -fortnight -in -a -small -building -one -story -high -a -cramped -place -a -slightly -modified -black -hole -of -calcutta -they -were -waiting -in -suspense -there -was -none -who -could -foretaste -their -fate -meantime -the -news -of -the -massacre -had -traveled -far -and -an -army -of -rescuers -with -havelock -at -its -head -was -on -its -way -at -least -an -army -which -hoped -to -be -rescuers -it -was -crossing -the -country -by -forced -marches -and -strewing -its -way -with -its -own -dead -men -struck -down -by -cholera -and -by -a -heat -which -reached -135 -deg -it -was -in -a -vengeful -fury -and -it -stopped -for -nothing -neither -heat -nor -fatigue -nor -disease -nor -human -opposition -it -tore -its -impetuous -way -through -hostile -forces -winning -victory -after -victory -but -still -striding -on -and -on -not -halting -to -count -results -and -at -last -after -this -extraordinary -march -it -arrived -before -the -walls -of -cawnpore -met -the -nana's -massed -strength -delivered -a -crushing -defeat -and -entered -but -too -late -only -a -few -hours -too -late -for -at -the -last -moment -the -nana -had -decided -upon -the -massacre -of -the -captive -women -and -children -and -had -commissioned -three -mohammedans -and -two -hindoos -to -do -the -work -sir -g -o -trevelyan -says -thereupon -the -five -men -entered -it -was -the -short -gloaming -of -hindostan -the -hour -when -ladies -take -their -evening -drive -she -who -had -accosted -the -officer -was -standing -in -the -doorway -with -her -were -the -native -doctor -and -two -hindoo -menials -that -much -of -the -business -might -be -seen -from -the -veranda -but -all -else -was -concealed -amidst -the -interior -gloom -shrieks -and -scuffing -acquainted -those -without -that -the -journeymen -were -earning -their -hire -survur -khan -soon -emerged -with -his -sword -broken -off -at -the -hilt -he -procured -another -from -the -nana's -house -and -a -few -minutes -after -appeared -again -on -the -same -errand -the -third -blade -was -of -better -temper -or -perhaps -the -thick -of -the -work -was -already -over -by -the -time -darkness -had -closed -in -the -men -came -forth -and -locked -up -the -house -for -the -night -then -the -screams -ceased -but -the -groans -lasted -till -morning -the -sun -rose -as -usual -when -he -had -been -up -nearly -three -hours -the -five -repaired -to -the -scene -of -their -labors -over -night -they -were -attended -by -a -few -sweepers -who -proceeded -to -transfer -the -contents -of -the -house -to -a -dry -well -situated -behind -some -trees -which -grew -hard -by -'the -bodies -' -says -one -who -was -present -throughout -'were -dragged -out -most -of -them -by -the -hair -of -the -head -those -who -had -clothing -worth -taking -were -stripped -some -of -the -women -were -alive -i -cannot -say -how -many -but -three -could -speak -they -prayed -for -the -sake -of -god -that -an -end -might -be -put -to -their -sufferings -i -remarked -one -very -stout -woman -a -half -caste -who -was -severely -wounded -in -both -arms -who -entreated -to -be -killed -she -and -two -or -three -others -were -placed -against -the -bank -of -the -cut -by -which -bullocks -go -down -in -drawing -water -the -dead -were -first -thrown -in -yes -there -was -a -great -crowd -looking -on -they -were -standing -along -the -walls -of -the -compound -they -were -principally -city -people -and -villagers -yes -there -were -also -sepoys -three -boys -were -alive -they -were -fair -children -the -eldest -i -think -must -have -been -six -or -seven -and -the -youngest -five -years -they -were -running -around -the -well -where -else -could -they -go -to -and -there -was -none -to -save -them -no -one -said -a -word -or -tried -to -save -them -' -at -length -the -smallest -of -them -made -an -infantile -attempt -to -get -away -the -little -thing -had -been -frightened -past -bearing -by -the -murder -of -one -of -the -surviving -ladies -he -thus -attracted -the -observation -of -a -native -who -flung -him -and -his -companions -down -the -well -the -soldiers -had -made -a -march -of -eighteen -days -almost -without -rest -to -save -the -women -and -the -children -and -now -they -were -too -late -all -were -dead -and -the -assassin -had -flown -what -happened -then -trevelyan -hesitated -to -put -into -words -of -what -took -place -the -less -said -is -the -better -then -he -continues -but -there -was -a -spectacle -to -witness -which -might -excuse -much -those -who -straight -from -the -contested -field -wandered -sobbing -through -the -rooms -of -the -ladies' -house -saw -what -it -were -well -could -the -outraged -earth -have -straightway -hidden -the -inner -apartment -was -ankle -deep -in -blood -the -plaster -was -scored -with -sword -cuts -not -high -up -as -where -men -have -fought -but -low -down -and -about -the -corners -as -if -a -creature -had -crouched -to -avoid -the -blow -strips -of -dresses -vainly -tied -around -the -handles -of -the -doors -signified -the -contrivance -to -which -feminine -despair -had -resorted -as -a -means -of -keeping -out -the -murderers -broken -combs -were -there -and -the -frills -of -children's -trousers -and -torn -cuffs -and -pinafores -and -little -round -hats -and -one -or -two -shoes -with -burst -latchets -and -one -or -two -daguerreotype -cases -with -cracked -glasses -an -officer -picked -up -a -few -curls -preserved -in -a -bit -of -cardboard -and -marked -'ned's -hair -with -love' -but -around -were -strewn -locks -some -near -a -yard -in -length -dissevered -not -as -a -keepsake -by -quite -other -scissors -the -battle -of -waterloo -was -fought -on -the -18th -of -june -1815 -i -do -not -state -this -fact -as -a -reminder -to -the -reader -but -as -news -to -him -for -a -forgotten -fact -is -news -when -it -comes -again -writers -of -books -have -the -fashion -of -whizzing -by -vast -and -renowned -historical -events -with -the -remark -the -details -of -this -tremendous -episode -are -too -familiar -to -the -reader -to -need -repeating -here -they -know -that -that -is -not -true -it -is -a -low -kind -of -flattery -they -know -that -the -reader -has -forgotten -every -detail -of -it -and -that -nothing -of -the -tremendous -event -is -left -in -his -mind -but -a -vague -and -formless -luminous -smudge -aside -from -the -desire -to -flatter -the -reader -they -have -another -reason -for -making -the -remark -two -reasons -indeed -they -do -not -remember -the -details -themselves -and -do -not -want -the -trouble -of -hunting -them -up -and -copying -them -out -also -they -are -afraid -that -if -they -search -them -out -and -print -them -they -will -be -scoffed -at -by -the -book -reviewers -for -retelling -those -worn -old -things -which -are -familiar -to -everybody -they -should -not -mind -the -reviewer's -jeer -he -doesn't -remember -any -of -the -worn -old -things -until -the -book -which -he -is -reviewing -has -retold -them -to -him -i -have -made -the -quoted -remark -myself -at -one -time -and -another -but -i -was -not -doing -it -to -flatter -the -reader -i -was -merely -doing -it -to -save -work -if -i -had -known -the -details -without -brushing -up -i -would -have -put -them -in -but -i -didn't -and -i -did -not -want -the -labor -of -posting -myself -so -i -said -the -details -of -this -tremendous -episode -are -too -familiar -to -the -reader -to -need -repeating -here -i -do -not -like -that -kind -of -a -lie -still -it -does -save -work -i -am -not -trying -to -get -out -of -repeating -the -details -of -the -siege -of -lucknow -in -fear -of -the -reviewer -i -am -not -leaving -them -out -in -fear -that -they -would -not -interest -the -reader -i -am -leaving -them -out -partly -to -save -work -mainly -for -lack -of -room -it -is -a -pity -too -for -there -is -not -a -dull -place -anywhere -in -the -great -story -ten -days -before -the -outbreak -may -10th -of -the -mutiny -all -was -serene -at -lucknow -the -huge -capital -of -oudh -the -kingdom -which -had -recently -been -seized -by -the -india -company -there -was -a -great -garrison -composed -of -about -7 -000 -native -troops -and -between -700 -and -800 -whites -these -white -soldiers -and -their -families -were -probably -the -only -people -of -their -race -there -at -their -elbow -was -that -swarming -population -of -warlike -natives -a -race -of -born -soldiers -brave -daring -and -fond -of -fighting -on -high -ground -just -outside -the -city -stood -the -palace -of -that -great -personage -the -resident -the -representative -of -british -power -and -authority -it -stood -in -the -midst -of -spacious -grounds -with -its -due -complement -of -outbuildings -and -the -grounds -were -enclosed -by -a -wall -a -wall -not -for -defense -but -for -privacy -the -mutinous -spirit -was -in -the -air -but -the -whites -were -not -afraid -and -did -not -feel -much -troubled -then -came -the -outbreak -at -meerut -then -the -capture -of -delhi -by -the -mutineers -in -june -came -the -three -weeks -leaguer -of -sir -hugh -wheeler -in -his -open -lot -at -cawnpore -40 -miles -distant -from -lucknow -then -the -treacherous -massacre -of -that -gallant -little -garrison -and -now -the -great -revolt -was -in -full -flower -and -the -comfortable -condition -of -things -at -lucknow -was -instantly -changed -there -was -an -outbreak -there -and -sir -henry -lawrence -marched -out -of -the -residency -on -the -30th -of -june -to -put -it -down -but -was -defeated -with -heavy -loss -and -had -difficulty -in -getting -back -again -that -night -the -memorable -siege -of -the -residency -called -the -siege -of -lucknow -began -sir -henry -was -killed -three -days -later -and -brigadier -inglis -succeeded -him -in -command -outside -of -the -residency -fence -was -an -immense -host -of -hostile -and -confident -native -besiegers -inside -it -were -480 -loyal -native -soldiers -730 -white -ones -and -500 -women -and -children -in -those -days -the -english -garrisons -always -managed -to -hamper -themselves -sufficiently -with -women -and -children -the -natives -established -themselves -in -houses -close -at -hand -and -began -to -rain -bullets -and -cannon -balls -into -the -residency -and -this -they -kept -up -night -and -day -during -four -months -and -a -half -the -little -garrison -industriously -replying -all -the -time -the -women -and -children -soon -became -so -used -to -the -roar -of -the -guns -that -it -ceased -to -disturb -their -sleep -the -children -imitated -siege -and -defense -in -their -play -the -women -with -any -pretext -or -with -none -would -sally -out -into -the -storm -swept -grounds -the -defense -was -kept -up -week -after -week -with -stubborn -fortitude -in -the -midst -of -death -which -came -in -many -forms -by -bullet -small -pox -cholera -and -by -various -diseases -induced -by -unpalatable -and -insufficient -food -by -the -long -hours -of -wearying -and -exhausting -overwork -in -the -daily -and -nightly -battle -in -the -oppressive -indian -heat -and -by -the -broken -rest -caused -by -the -intolerable -pest -of -mosquitoes -flies -mice -rats -and -fleas -six -weeks -after -the -beginning -of -the -siege -more -than -one -half -of -the -original -force -of -white -soldiers -was -dead -and -close -upon -three -fifths -of -the -original -native -force -but -the -fighting -went -on -just -the -same -the -enemy -mined -the -english -counter -mined -and -turn -about -they -blew -up -each -other's -posts -the -residency -grounds -were -honey -combed -with -the -enemy's -tunnels -deadly -courtesies -were -constantly -exchanged -sorties -by -the -english -in -the -night -rushes -by -the -enemy -in -the -night -rushes -whose -purpose -was -to -breach -the -walls -or -scale -them -rushes -which -cost -heavily -and -always -failed -the -ladies -got -used -to -all -the -horrors -of -war -the -shrieks -of -mutilated -men -the -sight -of -blood -and -death -lady -inglis -makes -this -mention -in -her -diary -mrs -bruere's -nurse -was -carried -past -our -door -to -day -wounded -in -the -eye -to -extract -the -bullet -it -was -found -necessary -to -take -out -the -eye -a -fearful -operation -her -mistress -held -her -while -it -was -performed -the -first -relieving -force -failed -to -relieve -it -was -under -havelock -and -outram -and -arrived -when -the -siege -had -been -going -on -for -three -months -it -fought -its -desperate -way -to -lucknow -then -fought -its -way -through -the -city -against -odds -of -a -hundred -to -one -and -entered -the -residency -but -there -was -not -enough -left -of -it -then -to -do -any -good -it -lost -more -men -in -its -last -fight -than -it -found -in -the -residency -when -it -got -in -it -became -captive -itself -the -fighting -and -starving -and -dying -by -bullets -and -disease -went -steadily -on -both -sides -fought -with -energy -and -industry -captain -birch -puts -this -striking -incident -in -evidence -he -is -speaking -of -the -third -month -of -the -siege -as -an -instance -of -the -heavy -firing -brought -to -bear -on -our -position -this -month -may -be -mentioned -the -cutting -down -of -the -upper -story -of -a -brick -building -simply -by -musketry -firring -this -building -was -in -a -most -exposed -position -all -the -shots -which -just -missed -the -top -of -the -rampart -cut -into -the -dead -wall -pretty -much -in -a -straight -line -and -at -length -cut -right -through -and -brought -the -upper -story -tumbling -down -the -upper -structure -on -the -top -of -the -brigade -mess -also -fell -in -the -residency -house -was -a -wreck -captain -anderson's -post -had -long -ago -been -knocked -down -and -innes' -post -also -fell -in -these -two -were -riddled -with -round -shot -as -many -as -200 -were -picked -up -by -colonel -masters -the -exhausted -garrison -fought -doggedly -on -all -through -the -next -month -october -then -november -2d -news -came -sir -colin -campbell's -relieving -force -would -soon -be -on -its -way -from -cawnpore -on -the -12th -the -boom -of -his -guns -was -heard -on -the -13th -the -sounds -came -nearer -he -was -slowly -but -steadily -cutting -his -way -through -storming -one -stronghold -after -another -on -the -14th -he -captured -the -martiniere -college -and -ran -up -the -british -flag -there -it -was -seen -from -the -residency -next -he -took -the -dilkoosha -on -the -17th -he -took -the -former -mess -house -of -the -32d -regiment -a -fortified -building -and -very -strong -a -most -exciting -anxious -day -writes -lady -inglis -in -her -diary -about -4 -p -m -two -strange -officers -walked -through -our -yard -leading -their -horses -and -by -that -sign -she -knew -that -communication -was -established -between -the -forces -that -the -relief -was -real -this -time -and -that -the -long -siege -of -lucknow -was -ended -the -last -eight -or -ten -miles -of -sir -colin -campbell's -march -was -through -seas -of -blood -the -weapon -mainly -used -was -the -bayonet -the -fighting -was -desperate -the -way -was -mile -stoned -with -detached -strong -buildings -of -stone -fortified -and -heavily -garrisoned -and -these -had -to -be -taken -by -assault -neither -side -asked -for -quarter -and -neither -gave -it -at -the -secundrabagh -where -nearly -two -thousand -of -the -enemy -occupied -a -great -stone -house -in -a -garden -the -work -of -slaughter -was -continued -until -every -man -was -killed -that -is -a -sample -of -the -character -of -that -devastating -march -there -were -but -few -trees -in -the -plain -at -that -time -and -from -the -residency -the -progress -of -the -march -step -by -step -victory -by -victory -could -be -noted -the -ascending -clouds -of -battle -smoke -marked -the -way -to -the -eye -and -the -thunder -of -the -guns -marked -it -to -the -ear -sir -colin -campbell -had -not -come -to -lucknow -to -hold -it -but -to -save -the -occupants -of -the -residency -and -bring -them -away -four -or -five -days -after -his -arrival -the -secret -evacuation -by -the -troops -took -place -in -the -middle -of -a -dark -night -by -the -principal -gate -the -bailie -guard -the -two -hundred -women -and -two -hundred -and -fifty -children -had -been -previously -removed -captain -birch -says -and -now -commenced -a -movement -of -the -most -perfect -arrangement -and -successful -generalship -the -withdrawal -of -the -whole -of -the -various -forces -a -combined -movement -requiring -the -greatest -care -and -skill -first -the -garrison -in -immediate -contact -with -the -enemy -at -the -furthest -extremity -of -the -residency -position -was -marched -out -every -other -garrison -in -turn -fell -in -behind -it -and -so -passed -out -through -the -bailie -guard -gate -till -the -whole -of -our -position -was -evacuated -then -havelock's -force -was -similarly -withdrawn -post -by -post -marching -in -rear -of -our -garrison -after -them -in -turn -came -the -forces -of -the -commander -in -chief -which -joined -on -in -the -rear -of -havelock's -force -regiment -by -regiment -was -withdrawn -with -the -utmost -order -and -regularity -the -whole -operation -resembled -the -movement -of -a -telescope -stern -silence -was -kept -and -the -enemy -took -no -alarm -lady -inglis -referring -to -her -husband -and -to -general -sir -james -outram -sets -down -the -closing -detail -of -this -impressive -midnight -retreat -in -darkness -and -by -stealth -of -this -shadowy -host -through -the -gate -which -it -had -defended -so -long -and -so -well -at -twelve -precisely -they -marched -out -john -and -sir -james -outram -remaining -till -all -had -passed -and -then -they -took -off -their -hats -to -the -bailie -guard -the -scene -of -as -noble -a -defense -as -i -think -history -will -ever -have -to -relate -chapter -lix -don't -part -with -your -illusions -when -they -are -gone -you -may -still -exist -but -you -have -ceased -to -live -pudd'nhead -wilson's -new -calendar -often -the -surest -way -to -convey -misinformation -is -to -tell -the -strict -truth -pudd'nhead -wilson's -new -calendar -we -were -driven -over -sir -colin -campbell's -route -by -a -british -officer -and -when -i -arrived -at -the -residency -i -was -so -familiar -with -the -road -that -i -could -have -led -a -retreat -over -it -myself -but -the -compass -in -my -head -has -been -out -of -order -from -my -birth -and -so -as -soon -as -i -was -within -the -battered -bailie -guard -and -turned -about -to -review -the -march -and -imagine -the -relieving -forces -storming -their -way -along -it -everything -was -upside -down -and -wrong -end -first -in -a -moment -and -i -was -never -able -to -get -straightened -out -again -and -now -when -i -look -at -the -battle -plan -the -confusion -remains -in -me -the -east -was -born -west -the -battle -plans -which -have -the -east -on -the -right -hand -side -are -of -no -use -to -me -the -residency -ruins -are -draped -with -flowering -vines -and -are -impressive -and -beautiful -they -and -the -grounds -are -sacred -now -and -will -suffer -no -neglect -nor -be -profaned -by -any -sordid -or -commercial -use -while -the -british -remain -masters -of -india -within -the -grounds -are -buried -the -dead -who -gave -up -their -lives -there -in -the -long -siege -after -a -fashion -i -was -able -to -imagine -the -fiery -storm -that -raged -night -and -day -over -the -place -during -so -many -months -and -after -a -fashion -i -could -imagine -the -men -moving -through -it -but -i -could -not -satisfactorily -place -the -200 -women -and -i -could -do -nothing -at -all -with -the -250 -children -i -knew -by -lady -inglis' -diary -that -the -children -carried -on -their -small -affairs -very -much -as -if -blood -and -carnage -and -the -crash -and -thunder -of -a -siege -were -natural -and -proper -features -of -nursery -life -and -i -tried -to -realize -it -but -when -her -little -johnny -came -rushing -all -excitement -through -the -din -and -smoke -shouting -oh -mamma -the -white -hen -has -laid -an -egg! -i -saw -that -i -could -not -do -it -johnny's -place -was -under -the -bed -i -could -imagine -him -there -because -i -could -imagine -myself -there -and -i -think -i -should -not -have -been -interested -in -a -hen -that -was -laying -an -egg -my -interest -would -have -been -with -the -parties -that -were -laying -the -bombshells -i -sat -at -dinner -with -one -of -those -children -in -the -club's -indian -palace -and -i -knew -that -all -through -the -siege -he -was -perfecting -his -teething -and -learning -to -talk -and -while -to -me -he -was -the -most -impressive -object -in -lucknow -after -the -residency -ruins -i -was -not -able -to -imagine -what -his -life -had -been -during -that -tempestuous -infancy -of -his -nor -what -sort -of -a -curious -surprise -it -must -have -been -to -him -to -be -marched -suddenly -out -into -a -strange -dumb -world -where -there -wasn't -any -noise -and -nothing -going -on -he -was -only -forty -one -when -i -saw -him -a -strangely -youthful -link -to -connect -the -present -with -so -ancient -an -episode -as -the -great -mutiny -by -and -by -we -saw -cawnpore -and -the -open -lot -which -was -the -scene -of -moore's -memorable -defense -and -the -spot -on -the -shore -of -the -ganges -where -the -massacre -of -the -betrayed -garrison -occurred -and -the -small -indian -temple -whence -the -bugle -signal -notified -the -assassins -to -fall -on -this -latter -was -a -lonely -spot -and -silent -the -sluggish -river -drifted -by -almost -currentless -it -was -dead -low -water -narrow -channels -with -vast -sandbars -between -all -the -way -across -the -wide -bed -and -the -only -living -thing -in -sight -was -that -grotesque -and -solemn -bald -headed -bird -the -adjutant -standing -on -his -six -foot -stilts -solitary -on -a -distant -bar -with -his -head -sunk -between -his -shoulders -thinking -thinking -of -his -prize -i -suppose -the -dead -hindoo -that -lay -awash -at -his -feet -and -whether -to -eat -him -alone -or -invite -friends -he -and -his -prey -were -a -proper -accent -to -that -mournful -place -they -were -in -keeping -with -it -they -emphasized -its -loneliness -and -its -solemnity -and -we -saw -the -scene -of -the -slaughter -of -the -helpless -women -and -children -and -also -the -costly -memorial -that -is -built -over -the -well -which -contains -their -remains -the -black -hole -of -calcutta -is -gone -but -a -more -reverent -age -is -come -and -whatever -remembrancer -still -exists -of -the -moving -and -heroic -sufferings -and -achievements -of -the -garrisons -of -lucknow -and -cawnpore -will -be -guarded -and -preserved -in -agra -and -its -neighborhood -and -afterwards -at -delhi -we -saw -forts -mosques -and -tombs -which -were -built -in -the -great -days -of -the -mohammedan -emperors -and -which -are -marvels -of -cost -magnitude -and -richness -of -materials -and -ornamentation -creations -of -surpassing -grandeur -wonders -which -do -indeed -make -the -like -things -in -the -rest -of -the -world -seem -tame -and -inconsequential -by -comparison -i -am -not -purposing -to -describe -them -by -good -fortune -i -had -not -read -too -much -about -them -and -therefore -was -able -to -get -a -natural -and -rational -focus -upon -them -with -the -result -that -they -thrilled -blessed -and -exalted -me -but -if -i -had -previously -overheated -my -imagination -by -drinking -too -much -pestilential -literary -hot -scotch -i -should -have -suffered -disappointment -and -sorrow -i -mean -to -speak -of -only -one -of -these -many -world -renowned -buildings -the -taj -mahal -the -most -celebrated -construction -in -the -earth -i -had -read -a -great -deal -too -much -about -it -i -saw -it -in -the -daytime -i -saw -it -in -the -moonlight -i -saw -it -near -at -hand -i -saw -it -from -a -distance -and -i -knew -all -the -time -that -of -its -kind -it -was -the -wonder -of -the -world -with -no -competitor -now -and -no -possible -future -competitor -and -yet -it -was -not -my -taj -my -taj -had -been -built -by -excitable -literary -people -it -was -solidly -lodged -in -my -head -and -i -could -not -blast -it -out -i -wish -to -place -before -the -reader -some -of -the -usual -descriptions -of -the -taj -and -ask -him -to -take -note -of -the -impressions -left -in -his -mind -these -descriptions -do -really -state -the -truth -as -nearly -as -the -limitations -of -language -will -allow -but -language -is -a -treacherous -thing -a -most -unsure -vehicle -and -it -can -seldom -arrange -descriptive -words -in -such -a -way -that -they -will -not -inflate -the -facts -by -help -of -the -reader's -imagination -which -is -always -ready -to -take -a -hand -and -work -for -nothing -and -do -the -bulk -of -it -at -that -i -will -begin -with -a -few -sentences -from -the -excellent -little -local -guide -book -of -mr -satya -chandra -mukerji -i -take -them -from -here -and -there -in -his -description -the -inlaid -work -of -the -taj -and -the -flowers -and -petals -that -are -to -be -found -on -all -sides -on -the -surface -of -the -marble -evince -a -most -delicate -touch -that -is -true -the -inlaid -work -the -marble -the -flowers -the -buds -the -leaves -the -petals -and -the -lotus -stems -are -almost -without -a -rival -in -the -whole -of -the -civilized -world -the -work -of -inlaying -with -stones -and -gems -is -found -in -the -highest -perfection -in -the -taj -gems -inlaid -flowers -buds -and -leaves -to -be -found -on -all -sides -what -do -you -see -before -you -is -the -fairy -structure -growing -is -it -becoming -a -jewel -casket -the -whole -of -the -taj -produces -a -wonderful -effect -that -is -equally -sublime -and -beautiful -then -sir -william -wilson -hunter -the -taj -mahal -with -its -beautiful -domes -'a -dream -of -marble -' -rises -on -the -river -bank -the -materials -are -white -marble -and -red -sandstone -the -complexity -of -its -design -and -the -delicate -intricacy -of -the -workmanship -baffle -description -sir -william -continues -i -will -italicize -some -of -his -words -the -mausoleum -stands -on -a -raised -marble -platform -at -each -of -whose -corners -rises -a -tall -and -slender -minaret -of -graceful -proportions -and -of -exquisite -beauty -beyond -the -platform -stretch -the -two -wings -one -of -which -is -itself -a -mosque -of -great -architectural -merit -in -the -center -of -the -whole -design -the -mausoleum -occupies -a -square -of -186 -feet -with -the -angles -deeply -truncated -so -also -form -an -unequal -octagon -the -main -feature -in -this -central -pile -is -the -great -dome -which -swells -upward -to -nearly -two -thirds -of -a -sphere -and -tapers -at -its -extremity -into -a -pointed -spire -crowned -by -a -crescent -beneath -it -an -enclosure -of -marble -trellis -work -surrounds -the -tomb -of -the -princess -and -of -her -husband -the -emperor -each -corner -of -the -mausoleum -is -covered -by -a -similar -though -much -smaller -dome -erected -on -a -pediment -pierced -with -graceful -saracenic -arches -light -is -admitted -into -the -interior -through -a -double -screen -of -pierced -marble -which -tempers -the -glare -of -an -indian -sky -while -its -whiteness -prevents -the -mellow -effect -from -degenerating -into -gloom -the -internal -decorations -consist -of -inlaid -work -in -precious -stones -such -as -agate -jasper -etc -with -which -every -squandril -or -salient -point -in -the -architecture -is -richly -fretted -brown -and -violet -marble -is -also -freely -employed -in -wreaths -scrolls -and -lintels -to -relieve -the -monotony -of -white -wall -in -regard -to -color -and -design -the -interior -of -the -taj -may -rank -first -in -the -world -for -purely -decorative -workmanship -while -the -perfect -symmetry -of -its -exterior -once -seen -can -never -be -forgotten -nor -the -aerial -grace -of -its -domes -rising -like -marble -bubbles -into -the -clear -sky -the -taj -represents -the -most -highly -elaborated -stage -of -ornamentation -reached -by -the -indo -mohammedan -builders -the -stage -in -which -the -architect -ends -and -the -jeweler -begins -in -its -magnificent -gateway -the -diagonal -ornamentation -at -the -corners -which -satisfied -the -designers -of -the -gateways -of -itimad -ud -doulah -and -sikandra -mausoleums -is -superseded -by -fine -marble -cables -in -bold -twists -strong -and -handsome -the -triangular -insertions -of -white -marble -and -large -flowers -have -in -like -manner -given -place -to -fine -inlaid -work -firm -perpendicular -lines -in -black -marble -with -well -proportioned -panels -of -the -same -material -are -effectively -used -in -the -interior -of -the -gateway -on -its -top -the -hindu -brackets -and -monolithic -architraves -of -sikandra -are -replaced -by -moorish -carped -arches -usually -single -blocks -of -red -sandstone -in -the -kiosks -and -pavilions -which -adorn -the -roof -from -the -pillared -pavilions -a -magnificent -view -is -obtained -of -the -taj -gardens -below -with -the -noble -jumna -river -at -their -farther -end -and -the -city -and -fort -of -agra -in -the -distance -from -this -beautiful -and -splendid -gateway -one -passes -up -a -straight -alley -shaded -by -evergreen -trees -cooled -by -a -broad -shallow -piece -of -water -running -along -the -middle -of -the -path -to -the -taj -itself -the -taj -is -entirely -of -marble -and -gems -the -red -sandstone -of -the -other -mohammedan -buildings -has -entirely -disappeared -or -rather -the -red -sandstone -which -used -to -form -the -thickness -of -the -walls -is -in -the -taj -itself -overlaid -completely -with -white -marble -and -the -white -marble -is -itself -inlaid -with -precious -stones -arranged -in -lovely -patterns -of -flowers -a -feeling -of -purity -impresses -itself -on -the -eye -and -the -mind -from -the -absence -of -the -coarser -material -which -forms -so -invariable -a -material -in -agra -architecture -the -lower -wall -and -panels -are -covered -with -tulips -oleanders -and -fullblown -lilies -in -flat -carving -on -the -white -marble -and -although -the -inlaid -work -of -flowers -done -in -gems -is -very -brilliant -when -looked -at -closely -there -is -on -the -whole -but -little -color -and -the -all -prevailing -sentiment -is -one -of -whiteness -silence -and -calm -the -whiteness -is -broken -only -by -the -fine -color -of -the -inlaid -gems -by -lines -in -black -marble -and -by -delicately -written -inscriptions -also -in -black -from -the -koran -under -the -dome -of -the -vast -mausoleum -a -high -and -beautiful -screen -of -open -tracery -in -white -marble -rises -around -the -two -tombs -or -rather -cenotaphs -of -the -emperor -and -his -princess -and -in -this -marvel -of -marble -the -carving -has -advanced -from -the -old -geometrical -patterns -to -a -trellis -work -of -flowers -and -foliage -handled -with -great -freedom -and -spirit -the -two -cenotaphs -in -the -center -of -the -exquisite -enclosure -have -no -carving -except -the -plain -kalamdan -or -oblong -pen -box -on -the -tomb -of -emperor -shah -jehan -but -both -cenotaphs -are -inlaid -with -flowers -made -of -costly -gems -and -with -the -ever -graceful -oleander -scroll -bayard -taylor -after -describing -the -details -of -the -taj -goes -on -to -say -on -both -sides -the -palm -the -banyan -and -the -feathery -bamboo -mingle -their -foliage -the -song -of -birds -meets -your -ears -and -the -odor -of -roses -and -lemon -flowers -sweetens -the -air -down -such -a -vista -and -over -such -a -foreground -rises -the -taj -there -is -no -mystery -no -sense -of -partial -failure -about -the -taj -a -thing -of -perfect -beauty -and -of -absolute -finish -in -every -detail -it -might -pass -for -the -work -of -genii -who -knew -naught -of -the -weaknesses -and -ills -with -which -mankind -are -beset -all -of -these -details -are -true -but -taken -together -they -state -a -falsehood -to -you -you -cannot -add -them -up -correctly -those -writers -know -the -values -of -their -words -and -phrases -but -to -you -the -words -and -phrases -convey -other -and -uncertain -values -to -those -writers -their -phrases -have -values -which -i -think -i -am -now -acquainted -with -and -for -the -help -of -the -reader -i -will -here -repeat -certain -of -those -words -and -phrases -and -follow -them -with -numerals -which -shall -represent -those -values -then -we -shall -see -the -difference -between -a -writer's -ciphering -and -a -mistaken -reader's -precious -stones -such -as -agate -jasper -etc -5 -with -which -every -salient -point -is -richly -fretted -5 -first -in -the -world -for -purely -decorative -workmanship -9 -the -taj -represents -the -stage -where -the -architect -ends -and -the -jeweler -begins -5 -the -taj -is -entirely -of -marble -and -gems -7 -inlaid -with -precious -stones -in -lovely -patterns -of -flowers -5 -the -inlaid -work -of -flowers -done -in -gems -is -very -brilliant -followed -by -a -most -important -modification -which -the -reader -is -sure -to -read -too -carelessly -2 -the -vast -mausoleum -5 -this -marvel -of -marble -5 -the -exquisite -enclosure -5 -inlaid -with -flowers -made -of -costly -gems -5 -a -thing -of -perfect -beauty -and -absolute -finish -5 -those -details -are -correct -the -figures -which -i -have -placed -after -them -represent -quite -fairly -their -individual -values -then -why -as -a -whole -do -they -convey -a -false -impression -to -the -reader -it -is -because -the -reader -beguiled -by -his -heated -imagination -masses -them -in -the -wrong -way -the -writer -would -mass -the -first -three -figures -in -the -following -way -and -they -would -speak -the -truth -total -19 -but -the -reader -masses -them -thus -and -then -they -tell -a -lie -559 -the -writer -would -add -all -of -his -twelve -numerals -together -and -then -the -sum -would -express -the -whole -truth -about -the -taj -and -the -truth -only -63 -but -the -reader -always -helped -by -his -imagination -would -put -the -figures -in -a -row -one -after -the -other -and -get -this -sum -which -would -tell -him -a -noble -big -lie -559575255555 -you -must -put -in -the -commas -yourself -i -have -to -go -on -with -my -work -the -reader -will -always -be -sure -to -put -the -figures -together -in -that -wrong -way -and -then -as -surely -before -him -will -stand -sparkling -in -the -sun -a -gem -crusted -taj -tall -as -the -matterhorn -i -had -to -visit -niagara -fifteen -times -before -i -succeeded -in -getting -my -imaginary -falls -gauged -to -the -actuality -and -could -begin -to -sanely -and -wholesomely -wonder -at -them -for -what -they -were -not -what -i -had -expected -them -to -be -when -i -first -approached -them -it -was -with -my -face -lifted -toward -the -sky -for -i -thought -i -was -going -to -see -an -atlantic -ocean -pouring -down -thence -over -cloud -vexed -himalayan -heights -a -sea -green -wall -of -water -sixty -miles -front -and -six -miles -high -and -so -when -the -toy -reality -came -suddenly -into -view -that -beruiled -little -wet -apron -hanging -out -to -dry -the -shock -was -too -much -for -me -and -i -fell -with -a -dull -thud -yet -slowly -surely -steadily -in -the -course -of -my -fifteen -visits -the -proportions -adjusted -themselves -to -the -facts -and -i -came -at -last -to -realize -that -a -waterfall -a -hundred -and -sixty -five -feet -high -and -a -quarter -of -a -mile -wide -was -an -impressive -thing -it -was -not -a -dipperful -to -my -vanished -great -vision -but -it -would -answer -i -know -that -i -ought -to -do -with -the -taj -as -i -was -obliged -to -do -with -niagara -see -it -fifteen -times -and -let -my -mind -gradually -get -rid -of -the -taj -built -in -it -by -its -describers -by -help -of -my -imagination -and -substitute -for -it -the -taj -of -fact -it -would -be -noble -and -fine -then -and -a -marvel -not -the -marvel -which -it -replaced -but -still -a -marvel -and -fine -enough -i -am -a -careless -reader -i -suppose -an -impressionist -reader -an -impressionist -reader -of -what -is -not -an -impressionist -picture -a -reader -who -overlooks -the -informing -details -or -masses -their -sum -improperly -and -gets -only -a -large -splashy -general -effect -an -effect -which -is -not -correct -and -which -is -not -warranted -by -the -particulars -placed -before -me -particulars -which -i -did -not -examine -and -whose -meanings -i -did -not -cautiously -and -carefully -estimate -it -is -an -effect -which -is -some -thirty -five -or -forty -times -finer -than -the -reality -and -is -therefore -a -great -deal -better -and -more -valuable -than -the -reality -and -so -i -ought -never -to -hunt -up -the -reality -but -stay -miles -away -from -it -and -thus -preserve -undamaged -my -own -private -mighty -niagara -tumbling -out -of -the -vault -of -heaven -and -my -own -ineffable -taj -built -of -tinted -mists -upon -jeweled -arches -of -rainbows -supported -by -colonnades -of -moonlight -it -is -a -mistake -for -a -person -with -an -unregulated -imagination -to -go -and -look -at -an -illustrious -world's -wonder -i -suppose -that -many -many -years -ago -i -gathered -the -idea -that -the -taj's -place -in -the -achievements -of -man -was -exactly -the -place -of -the -ice -storm -in -the -achievements -of -nature -that -the -taj -represented -man's -supremest -possibility -in -the -creation -of -grace -and -beauty -and -exquisiteness -and -splendor -just -as -the -ice -storm -represents -nature's -supremest -possibility -in -the -combination -of -those -same -qualities -i -do -not -know -how -long -ago -that -idea -was -bred -in -me -but -i -know -that -i -cannot -remember -back -to -a -time -when -the -thought -of -either -of -these -symbols -of -gracious -and -unapproachable -perfection -did -not -at -once -suggest -the -other -if -i -thought -of -the -ice -storm -the -taj -rose -before -me -divinely -beautiful -if -i -thought -of -the -taj -with -its -encrustings -and -inlayings -of -jewels -the -vision -of -the -ice -storm -rose -and -so -to -me -all -these -years -the -taj -has -had -no -rival -among -the -temples -and -palaces -of -men -none -that -even -remotely -approached -it -it -was -man's -architectural -ice -storm -here -in -london -the -other -night -i -was -talking -with -some -scotch -and -english -friends -and -i -mentioned -the -ice -storm -using -it -as -a -figure -a -figure -which -failed -for -none -of -them -had -heard -of -the -ice -storm -one -gentleman -who -was -very -familiar -with -american -literature -said -he -had -never -seen -it -mentioned -in -any -book -that -is -strange -and -i -myself -was -not -able -to -say -that -i -had -seen -it -mentioned -in -a -book -and -yet -the -autumn -foliage -with -all -other -american -scenery -has -received -full -and -competent -attention -the -oversight -is -strange -for -in -america -the -ice -storm -is -an -event -and -it -is -not -an -event -which -one -is -careless -about -when -it -comes -the -news -flies -from -room -to -room -in -the -house -there -are -bangings -on -the -doors -and -shoutings -the -ice -storm! -the -ice -storm! -and -even -the -laziest -sleepers -throw -off -the -covers -and -join -the -rush -for -the -windows -the -ice -storm -occurs -in -midwinter -and -usually -its -enchantments -are -wrought -in -the -silence -and -the -darkness -of -the -night -a -fine -drizzling -rain -falls -hour -after -hour -upon -the -naked -twigs -and -branches -of -the -trees -and -as -it -falls -it -freezes -in -time -the -trunk -and -every -branch -and -twig -are -incased -in -hard -pure -ice -so -that -the -tree -looks -like -a -skeleton -tree -made -all -of -glass -glass -that -is -crystal -clear -all -along -the -underside -of -every -branch -and -twig -is -a -comb -of -little -icicles -the -frozen -drip -sometimes -these -pendants -do -not -quite -amount -to -icicles -but -are -round -beads -frozen -tears -the -weather -clears -toward -dawn -and -leaves -a -brisk -pure -atmosphere -and -a -sky -without -a -shred -of -cloud -in -it -and -everything -is -still -there -is -not -a -breath -of -wind -the -dawn -breaks -and -spreads -the -news -of -the -storm -goes -about -the -house -and -the -little -and -the -big -in -wraps -and -blankets -flock -to -the -window -and -press -together -there -and -gaze -intently -out -upon -the -great -white -ghost -in -the -grounds -and -nobody -says -a -word -nobody -stirs -all -are -waiting -they -know -what -is -coming -and -they -are -waiting -waiting -for -the -miracle -the -minutes -drift -on -and -on -and -on -with -not -a -sound -but -the -ticking -of -the -clock -at -last -the -sun -fires -a -sudden -sheaf -of -rays -into -the -ghostly -tree -and -turns -it -into -a -white -splendor -of -glittering -diamonds -everybody -catches -his -breath -and -feels -a -swelling -in -his -throat -and -a -moisture -in -his -eyes -but -waits -again -for -he -knows -what -is -coming -there -is -more -yet -the -sun -climbs -higher -and -still -higher -flooding -the -tree -from -its -loftiest -spread -of -branches -to -its -lowest -turning -it -to -a -glory -of -white -fire -then -in -a -moment -without -warning -comes -the -great -miracle -the -supreme -miracle -the -miracle -without -its -fellow -in -the -earth -a -gust -of -wind -sets -every -branch -and -twig -to -swaying -and -in -an -instant -turns -the -whole -white -tree -into -a -spouting -and -spraying -explosion -of -flashing -gems -of -every -conceivable -color -and -there -it -stands -and -sways -this -way -and -that -flash! -flash! -flash! -a -dancing -and -glancing -world -of -rubies -emeralds -diamonds -sapphires -the -most -radiant -spectacle -the -most -blinding -spectacle -the -divinest -the -most -exquisite -the -most -intoxicating -vision -of -fire -and -color -and -intolerable -and -unimaginable -splendor -that -ever -any -eye -has -rested -upon -in -this -world -or -will -ever -rest -upon -outside -of -the -gates -of -heaven -by -all -my -senses -all -my -faculties -i -know -that -the -icestorm -is -nature's -supremest -achievement -in -the -domain -of -the -superb -and -the -beautiful -and -by -my -reason -at -least -i -know -that -the -taj -is -man's -ice -storm -in -the -ice -storm -every -one -of -the -myriad -ice -beads -pendant -from -twig -and -branch -is -an -individual -gem -and -changes -color -with -every -motion -caused -by -the -wind -each -tree -carries -a -million -and -a -forest -front -exhibits -the -splendors -of -the -single -tree -multiplied -by -a -thousand -it -occurs -to -me -now -that -i -have -never -seen -the -ice -storm -put -upon -canvas -and -have -not -heard -that -any -painter -has -tried -to -do -it -i -wonder -why -that -is -is -it -that -paint -cannot -counterfeit -the -intense -blaze -of -a -sun -flooded -jewel -there -should -be -and -must -be -a -reason -and -a -good -one -why -the -most -enchanting -sight -that -nature -has -created -has -been -neglected -by -the -brush -often -the -surest -way -to -convey -misinformation -is -to -tell -the -strict -truth -the -describers -of -the -taj -have -used -the -word -gem -in -its -strictest -sense -its -scientific -sense -in -that -sense -it -is -a -mild -word -and -promises -but -little -to -the -eye -nothing -bright -nothing -brilliant -nothing -sparkling -nothing -splendid -in -the -way -of -color -it -accurately -describes -the -sober -and -unobtrusive -gem -work -of -the -taj -that -is -to -the -very -highly -educated -one -person -in -a -thousand -but -it -most -falsely -describes -it -to -the -999 -but -the -999 -are -the -people -who -ought -to -be -especially -taken -care -of -and -to -them -it -does -not -mean -quiet -colored -designs -wrought -in -carnelians -or -agates -or -such -things -they -know -the -word -in -its -wide -and -ordinary -sense -only -and -so -to -them -it -means -diamonds -and -rubies -and -opals -and -their -kindred -and -the -moment -their -eyes -fall -upon -it -in -print -they -see -a -vision -of -glorious -colors -clothed -in -fire -these -describers -are -writing -for -the -general -and -so -in -order -to -make -sure -of -being -understood -they -ought -to -use -words -in -their -ordinary -sense -or -else -explain -the -word -fountain -means -one -thing -in -syria -where -there -is -but -a -handful -of -people -it -means -quite -another -thing -in -north -america -where -there -are -75 -000 -000 -if -i -were -describing -some -syrian -scenery -and -should -exclaim -within -the -narrow -space -of -a -quarter -of -a -mile -square -i -saw -in -the -glory -of -the -flooding -moonlight -two -hundred -noble -fountains -imagine -the -spectacle! -the -north -american -would -have -a -vision -of -clustering -columns -of -water -soaring -aloft -bending -over -in -graceful -arches -bursting -in -beaded -spray -and -raining -white -fire -in -the -moonlight -and -he -would -be -deceived -but -the -syrian -would -not -be -deceived -he -would -merely -see -two -hundred -fresh -water -springs -two -hundred -drowsing -puddles -as -level -and -unpretentious -and -unexcited -as -so -many -door -mats -and -even -with -the -help -of -the -moonlight -he -would -not -lose -his -grip -in -the -presence -of -the -exhibition -my -word -fountain -would -be -correct -it -would -speak -the -strict -truth -and -it -would -convey -the -strict -truth -to -the -handful -of -syrians -and -the -strictest -misinformation -to -the -north -american -millions -with -their -gems -and -gems -and -more -gems -and -gems -again -and -still -other -gems -the -describers -of -the -taj -are -within -their -legal -but -not -their -moral -rights -they -are -dealing -in -the -strictest -scientific -truth -and -in -doing -it -they -succeed -to -admiration -in -telling -what -ain't -so -chapter -lx -satan -impatiently -to -new -comer -the -trouble -with -you -chicago -people -is -that -you -think -you -are -the -best -people -down -here -whereas -you -are -merely -the -most -numerous -pudd'nhead -wilson's -new -calendar -we -wandered -contentedly -around -here -and -there -in -india -to -lahore -among -other -places -where -the -lieutenant -governor -lent -me -an -elephant -this -hospitality -stands -out -in -my -experiences -in -a -stately -isolation -it -was -a -fine -elephant -affable -gentlemanly -educated -and -i -was -not -afraid -of -it -i -even -rode -it -with -confidence -through -the -crowded -lanes -of -the -native -city -where -it -scared -all -the -horses -out -of -their -senses -and -where -children -were -always -just -escaping -its -feet -it -took -the -middle -of -the -road -in -a -fine -independent -way -and -left -it -to -the -world -to -get -out -of -the -way -or -take -the -consequences -i -am -used -to -being -afraid -of -collisions -when -i -ride -or -drive -but -when -one -is -on -top -of -an -elephant -that -feeling -is -absent -i -could -have -ridden -in -comfort -through -a -regiment -of -runaway -teams -i -could -easily -learn -to -prefer -an -elephant -to -any -other -vehicle -partly -because -of -that -immunity -from -collisions -and -partly -because -of -the -fine -view -one -has -from -up -there -and -partly -because -of -the -dignity -one -feels -in -that -high -place -and -partly -because -one -can -look -in -at -the -windows -and -see -what -is -going -on -privately -among -the -family -the -lahore -horses -were -used -to -elephants -but -they -were -rapturously -afraid -of -them -just -the -same -it -seemed -curious -perhaps -the -better -they -know -the -elephant -the -more -they -respect -him -in -that -peculiar -way -in -our -own -case -we -are -not -afraid -of -dynamite -till -we -get -acquainted -with -it -we -drifted -as -far -as -rawal -pindi -away -up -on -the -afghan -frontier -i -think -it -was -the -afghan -frontier -but -it -may -have -been -hertzegovina -it -was -around -there -somewhere -and -down -again -to -delhi -to -see -the -ancient -architectural -wonders -there -and -in -old -delhi -and -not -describe -them -and -also -to -see -the -scene -of -the -illustrious -assault -in -the -mutiny -days -when -the -british -carried -delhi -by -storm -one -of -the -marvels -of -history -for -impudent -daring -and -immortal -valor -we -had -a -refreshing -rest -there -in -delhi -in -a -great -old -mansion -which -possessed -historical -interest -it -was -built -by -a -rich -englishman -who -had -become -orientalized -so -much -so -that -he -had -a -zenana -but -he -was -a -broadminded -man -and -remained -so -to -please -his -harem -he -built -a -mosque -to -please -himself -he -built -an -english -church -that -kind -of -a -man -will -arrive -somewhere -in -the -mutiny -days -the -mansion -was -the -british -general's -headquarters -it -stands -in -a -great -garden -oriental -fashion -and -about -it -are -many -noble -trees -the -trees -harbor -monkeys -and -they -are -monkeys -of -a -watchful -and -enterprising -sort -and -not -much -troubled -with -fear -they -invade -the -house -whenever -they -get -a -chance -and -carry -off -everything -they -don't -want -one -morning -the -master -of -the -house -was -in -his -bath -and -the -window -was -open -near -it -stood -a -pot -of -yellow -paint -and -a -brush -some -monkeys -appeared -in -the -window -to -scare -them -away -the -gentleman -threw -his -sponge -at -them -they -did -not -scare -at -all -they -jumped -into -the -room -and -threw -yellow -paint -all -over -him -from -the -brush -and -drove -him -out -then -they -painted -the -walls -and -the -floor -and -the -tank -and -the -windows -and -the -furniture -yellow -and -were -in -the -dressing -room -painting -that -when -help -arrived -and -routed -them -two -of -these -creatures -came -into -my -room -in -the -early -morning -through -a -window -whose -shutters -i -had -left -open -and -when -i -woke -one -of -them -was -before -the -glass -brushing -his -hair -and -the -other -one -had -my -note -book -and -was -reading -a -page -of -humorous -notes -and -crying -i -did -not -mind -the -one -with -the -hair -brush -but -the -conduct -of -the -other -one -hurt -me -it -hurts -me -yet -i -threw -something -at -him -and -that -was -wrong -for -my -host -had -told -me -that -the -monkeys -were -best -left -alone -they -threw -everything -at -me -that -they -could -lift -and -then -went -into -the -bathroom -to -get -some -more -things -and -i -shut -the -door -on -them -at -jeypore -in -rajputana -we -made -a -considerable -stay -we -were -not -in -the -native -city -but -several -miles -from -it -in -the -small -european -official -suburb -there -were -but -few -europeans -only -fourteen -but -they -were -all -kind -and -hospitable -and -it -amounted -to -being -at -home -in -jeypore -we -found -again -what -we -had -found -all -about -india -that -while -the -indian -servant -is -in -his -way -a -very -real -treasure -he -will -sometimes -bear -watching -and -the -englishman -watches -him -if -he -sends -him -on -an -errand -he -wants -more -than -the -man's -word -for -it -that -he -did -the -errand -when -fruit -and -vegetables -were -sent -to -us -a -chit -came -with -them -a -receipt -for -us -to -sign -otherwise -the -things -might -not -arrive -if -a -gentleman -sent -up -his -carriage -the -chit -stated -from -such -and -such -an -hour -to -such -and -such -an -hour -which -made -it -unhandy -for -the -coachman -and -his -two -or -three -subordinates -to -put -us -off -with -a -part -of -the -allotted -time -and -devote -the -rest -of -it -to -a -lark -of -their -own -we -were -pleasantly -situated -in -a -small -two -storied -inn -in -an -empty -large -compound -which -was -surrounded -by -a -mud -wall -as -high -as -a -man's -head -the -inn -was -kept -by -nine -hindoo -brothers -its -owners -they -lived -with -their -families -in -a -one -storied -building -within -the -compound -but -off -to -one -side -and -there -was -always -a -long -pile -of -their -little -comely -brown -children -loosely -stacked -in -its -veranda -and -a -detachment -of -the -parents -wedged -among -them -smoking -the -hookah -or -the -howdah -or -whatever -they -call -it -by -the -veranda -stood -a -palm -and -a -monkey -lived -in -it -and -led -a -lonesome -life -and -always -looked -sad -and -weary -and -the -crows -bothered -him -a -good -deal -the -inn -cow -poked -about -the -compound -and -emphasized -the -secluded -and -country -air -of -the -place -and -there -was -a -dog -of -no -particular -breed -who -was -always -present -in -the -compound -and -always -asleep -always -stretched -out -baking -in -the -sun -and -adding -to -the -deep -tranquility -and -reposefulness -of -the -place -when -the -crows -were -away -on -business -white -draperied -servants -were -coming -and -going -all -the -time -but -they -seemed -only -spirits -for -their -feet -were -bare -and -made -no -sound -down -the -lane -a -piece -lived -an -elephant -in -the -shade -of -a -noble -tree -and -rocked -and -rocked -and -reached -about -with -his -trunk -begging -of -his -brown -mistress -or -fumbling -the -children -playing -at -his -feet -and -there -were -camels -about -but -they -go -on -velvet -feet -and -were -proper -to -the -silence -and -serenity -of -the -surroundings -the -satan -mentioned -at -the -head -of -this -chapter -was -not -our -satan -but -the -other -one -our -satan -was -lost -to -us -in -these -later -days -he -had -passed -out -of -our -life -lamented -by -me -and -sincerely -i -was -missing -him -i -am -missing -him -yet -after -all -these -months -he -was -an -astonishing -creature -to -fly -around -and -do -things -he -didn't -always -do -them -quite -right -but -he -did -them -and -did -them -suddenly -there -was -no -time -wasted -you -would -say -pack -the -trunks -and -bags -satan -wair -good -very -good -then -there -would -be -a -brief -sound -of -thrashing -and -slashing -and -humming -and -buzzing -and -a -spectacle -as -of -a -whirlwind -spinning -gowns -and -jackets -and -coats -and -boots -and -things -through -the -air -and -then -with -bow -and -touch -awready -master -it -was -wonderful -it -made -one -dizzy -he -crumpled -dresses -a -good -deal -and -he -had -no -particular -plan -about -the -work -at -first -except -to -put -each -article -into -the -trunk -it -didn't -belong -in -but -he -soon -reformed -in -this -matter -not -entirely -for -to -the -last -he -would -cram -into -the -satchel -sacred -to -literature -any -odds -and -ends -of -rubbish -that -he -couldn't -find -a -handy -place -for -elsewhere -when -threatened -with -death -for -this -it -did -not -trouble -him -he -only -looked -pleasant -saluted -with -soldierly -grace -said -wair -good -and -did -it -again -next -day -he -was -always -busy -kept -the -rooms -tidied -up -the -boots -polished -the -clothes -brushed -the -wash -basin -full -of -clean -water -my -dress -clothes -laid -out -and -ready -for -the -lecture -hall -an -hour -ahead -of -time -and -he -dressed -me -from -head -to -heel -in -spite -of -my -determination -to -do -it -myself -according -to -my -lifelong -custom -he -was -a -born -boss -and -loved -to -command -and -to -jaw -and -dispute -with -inferiors -and -harry -them -and -bullyrag -them -he -was -fine -at -the -railway -station -yes -he -was -at -his -finest -there -he -would -shoulder -and -plunge -and -paw -his -violent -way -through -the -packed -multitude -of -natives -with -nineteen -coolies -at -his -tail -each -bearing -a -trifle -of -luggage -one -a -trunk -another -a -parasol -another -a -shawl -another -a -fan -and -so -on -one -article -to -each -and -the -longer -the -procession -the -better -he -was -suited -and -he -was -sure -to -make -for -some -engaged -sleeper -and -begin -to -hurl -the -owner's -things -out -of -it -swearing -that -it -was -ours -and -that -there -had -been -a -mistake -arrived -at -our -own -sleeper -he -would -undo -the -bedding -bundles -and -make -the -beds -and -put -everything -to -rights -and -shipshape -in -two -minutes -then -put -his -head -out -at -a -window -and -have -a -restful -good -time -abusing -his -gang -of -coolies -and -disputing -their -bill -until -we -arrived -and -made -him -pay -them -and -stop -his -noise -speaking -of -noise -he -certainly -was -the -noisest -little -devil -in -india -and -that -is -saying -much -very -much -indeed -i -loved -him -for -his -noise -but -the -family -detested -him -for -it -they -could -not -abide -it -they -could -not -get -reconciled -to -it -it -humiliated -them -as -a -rule -when -we -got -within -six -hundred -yards -of -one -of -those -big -railway -stations -a -mighty -racket -of -screaming -and -shrieking -and -shouting -and -storming -would -break -upon -us -and -i -would -be -happy -to -myself -and -the -family -would -say -with -shame -there -that's -satan -why -do -you -keep -him -and -sure -enough -there -in -the -whirling -midst -of -fifteen -hundred -wondering -people -we -would -find -that -little -scrap -of -a -creature -gesticulating -like -a -spider -with -the -colic -his -black -eyes -snapping -his -fez -tassel -dancing -his -jaws -pouring -out -floods -of -billingsgate -upon -his -gang -of -beseeching -and -astonished -coolies -i -loved -him -i -couldn't -help -it -but -the -family -why -they -could -hardly -speak -of -him -with -patience -to -this -day -i -regret -his -loss -and -wish -i -had -him -back -but -they -it -is -different -with -them -he -was -a -native -and -came -from -surat -twenty -degrees -of -latitude -lay -between -his -birthplace -and -manuel's -and -fifteen -hundred -between -their -ways -and -characters -and -dispositions -i -only -liked -manuel -but -i -loved -satan -this -latter's -real -name -was -intensely -indian -i -could -not -quite -get -the -hang -of -it -but -it -sounded -like -bunder -rao -ram -chunder -clam -chowder -it -was -too -long -for -handy -use -anyway -so -i -reduced -it -when -he -had -been -with -us -two -or -three -weeks -he -began -to -make -mistakes -which -i -had -difficulty -in -patching -up -for -him -approaching -benares -one -day -he -got -out -of -the -train -to -see -if -he -could -get -up -a -misunderstanding -with -somebody -for -it -had -been -a -weary -long -journey -and -he -wanted -to -freshen -up -he -found -what -he -was -after -but -kept -up -his -pow -wow -a -shade -too -long -and -got -left -so -there -we -were -in -a -strange -city -and -no -chambermaid -it -was -awkward -for -us -and -we -told -him -he -must -not -do -so -any -more -he -saluted -and -said -in -his -dear -pleasant -way -wair -good -then -at -lucknow -he -got -drunk -i -said -it -was -a -fever -and -got -the -family's -compassion -and -solicitude -aroused -so -they -gave -him -a -teaspoonful -of -liquid -quinine -and -it -set -his -vitals -on -fire -he -made -several -grimaces -which -gave -me -a -better -idea -of -the -lisbon -earthquake -than -any -i -have -ever -got -of -it -from -paintings -and -descriptions -his -drunk -was -still -portentously -solid -next -morning -but -i -could -have -pulled -him -through -with -the -family -if -he -would -only -have -taken -another -spoonful -of -that -remedy -but -no -although -he -was -stupefied -his -memory -still -had -flickerings -of -life -so -he -smiled -a -divinely -dull -smile -and -said -fumblingly -saluting -scoose -me -mem -saheb -scoose -me -missy -saheb -satan -not -prefer -it -please -then -some -instinct -revealed -to -them -that -he -was -drunk -they -gave -him -prompt -notice -that -next -time -this -happened -he -must -go -he -got -out -a -maudlin -and -most -gentle -wair -good -and -saluted -indefinitely -only -one -short -week -later -he -fell -again -and -oh -sorrow! -not -in -a -hotel -this -time -but -in -an -english -gentleman's -private -house -and -in -agra -of -all -places -so -he -had -to -go -when -i -told -him -he -said -patiently -wair -good -and -made -his -parting -salute -and -went -out -from -us -to -return -no -more -forever -dear -me! -i -would -rather -have -lost -a -hundred -angels -than -that -one -poor -lovely -devil -what -style -he -used -to -put -on -in -a -swell -hotel -or -in -a -private -house -snow -white -muslin -from -his -chin -to -his -bare -feet -a -crimson -sash -embroidered -with -gold -thread -around -his -waist -and -on -his -head -a -great -sea -green -turban -like -to -the -turban -of -the -grand -turk -he -was -not -a -liar -but -he -will -become -one -if -he -keeps -on -he -told -me -once -that -he -used -to -crack -cocoanuts -with -his -teeth -when -he -was -a -boy -and -when -i -asked -how -he -got -them -into -his -mouth -he -said -he -was -upward -of -six -feet -high -at -that -time -and -had -an -unusual -mouth -and -when -i -followed -him -up -and -asked -him -what -had -become -of -that -other -foot -he -said -a -house -fell -on -him -and -he -was -never -able -to -get -his -stature -back -again -swervings -like -these -from -the -strict -line -of -fact -often -beguile -a -truthful -man -on -and -on -until -he -eventually -becomes -a -liar -his -successor -was -a -mohammedan -sahadat -mohammed -khan -very -dark -very -tall -very -grave -he -went -always -in -flowing -masses -of -white -from -the -top -of -his -big -turban -down -to -his -bare -feet -his -voice -was -low -he -glided -about -in -a -noiseless -way -and -looked -like -a -ghost -he -was -competent -and -satisfactory -but -where -he -was -it -seemed -always -sunday -it -was -not -so -in -satan's -time -jeypore -is -intensely -indian -but -it -has -two -or -three -features -which -indicate -the -presence -of -european -science -and -european -interest -in -the -weal -of -the -common -public -such -as -the -liberal -water -supply -furnished -by -great -works -built -at -the -state's -expense -good -sanitation -resulting -in -a -degree -of -healthfulness -unusually -high -for -india -a -noble -pleasure -garden -with -privileged -days -for -women -schools -for -the -instruction -of -native -youth -in -advanced -art -both -ornamental -and -utilitarian -and -a -new -and -beautiful -palace -stocked -with -a -museum -of -extraordinary -interest -and -value -without -the -maharaja's -sympathy -and -purse -these -beneficences -could -not -have -been -created -but -he -is -a -man -of -wide -views -and -large -generosities -and -all -such -matters -find -hospitality -with -him -we -drove -often -to -the -city -from -the -hotel -kaiser -i -hind -a -journey -which -was -always -full -of -interest -both -night -and -day -for -that -country -road -was -never -quiet -never -empty -but -was -always -india -in -motion -always -a -streaming -flood -of -brown -people -clothed -in -smouchings -from -the -rainbow -a -tossing -and -moiling -flood -happy -noisy -a -charming -and -satisfying -confusion -of -strange -human -and -strange -animal -life -and -equally -strange -and -outlandish -vehicles -and -the -city -itself -is -a -curiosity -any -indian -city -is -that -but -this -one -is -not -like -any -other -that -we -saw -it -is -shut -up -in -a -lofty -turreted -wall -the -main -body -of -it -is -divided -into -six -parts -by -perfectly -straight -streets -that -are -more -than -a -hundred -feet -wide -the -blocks -of -houses -exhibit -a -long -frontage -of -the -most -taking -architectural -quaintnesses -the -straight -lines -being -broken -everywhere -by -pretty -little -balconies -pillared -and -highly -ornamented -and -other -cunning -and -cozy -and -inviting -perches -and -projections -and -many -of -the -fronts -are -curiously -pictured -by -the -brush -and -the -whole -of -them -have -the -soft -rich -tint -of -strawberry -ice -cream -one -cannot -look -down -the -far -stretch -of -the -chief -street -and -persuade -himself -that -these -are -real -houses -and -that -it -is -all -out -of -doors -the -impression -that -it -is -an -unreality -a -picture -a -scene -in -a -theater -is -the -only -one -that -will -take -hold -then -there -came -a -great -day -when -this -illusion -was -more -pronounced -than -ever -a -rich -hindoo -had -been -spending -a -fortune -upon -the -manufacture -of -a -crowd -of -idols -and -accompanying -paraphernalia -whose -purpose -was -to -illustrate -scenes -in -the -life -of -his -especial -god -or -saint -and -this -fine -show -was -to -be -brought -through -the -town -in -processional -state -at -ten -in -the -morning -as -we -passed -through -the -great -public -pleasure -garden -on -our -way -to -the -city -we -found -it -crowded -with -natives -that -was -one -sight -then -there -was -another -in -the -midst -of -the -spacious -lawns -stands -the -palace -which -contains -the -museum -a -beautiful -construction -of -stone -which -shows -arched -colonnades -one -above -another -and -receding -terrace -fashion -toward -the -sky -every -one -of -these -terraces -all -the -way -to -the -top -one -was -packed -and -jammed -with -natives -one -must -try -to -imagine -those -solid -masses -of -splendid -color -one -above -another -up -and -up -against -the -blue -sky -and -the -indian -sun -turning -them -all -to -beds -of -fire -and -flame -later -when -we -reached -the -city -and -glanced -down -the -chief -avenue -smouldering -in -its -crushed -strawberry -tint -those -splendid -effects -were -repeated -for -every -balcony -and -every -fanciful -bird -cage -of -a -snuggery -countersunk -in -the -house -fronts -and -all -the -long -lines -of -roofs -were -crowded -with -people -and -each -crowd -was -an -explosion -of -brilliant -color -then -the -wide -street -itself -away -down -and -down -and -down -into -the -distance -was -alive -with -gorgeously -clothed -people -not -still -but -moving -swaying -drifting -eddying -a -delirious -display -of -all -colors -and -all -shades -of -color -delicate -lovely -pale -soft -strong -stunning -vivid -brilliant -a -sort -of -storm -of -sweetpea -blossoms -passing -on -the -wings -of -a -hurricane -and -presently -through -this -storm -of -color -came -swaying -and -swinging -the -majestic -elephants -clothed -in -their -sunday -best -of -gaudinesses -and -the -long -procession -of -fanciful -trucks -freighted -with -their -groups -of -curious -and -costly -images -and -then -the -long -rearguard -of -stately -camels -with -their -picturesque -riders -for -color -and -picturesqueness -and -novelty -and -outlandishness -and -sustained -interest -and -fascination -it -was -the -most -satisfying -show -i -had -ever -seen -and -i -suppose -i -shall -not -have -the -privilege -of -looking -upon -its -like -again -chapter -lxi -in -the -first -place -god -made -idiots -this -was -for -practice -then -he -made -school -boards -pudd'nhead -wilson's -new -calendar -suppose -we -applied -no -more -ingenuity -to -the -instruction -of -deaf -and -dumb -and -blind -children -than -we -sometimes -apply -in -our -american -public -schools -to -the -instruction -of -children -who -are -in -possession -of -all -their -faculties -the -result -would -be -that -the -deaf -and -dumb -and -blind -would -acquire -nothing -they -would -live -and -die -as -ignorant -as -bricks -and -stones -the -methods -used -in -the -asylums -are -rational -the -teacher -exactly -measures -the -child's -capacity -to -begin -with -and -from -thence -onwards -the -tasks -imposed -are -nicely -gauged -to -the -gradual -development -of -that -capacity -the -tasks -keep -pace -with -the -steps -of -the -child's -progress -they -don't -jump -miles -and -leagues -ahead -of -it -by -irrational -caprice -and -land -in -vacancy -according -to -the -average -public -school -plan -in -the -public -school -apparently -they -teach -the -child -to -spell -cat -then -ask -it -to -calculate -an -eclipse -when -it -can -read -words -of -two -syllables -they -require -it -to -explain -the -circulation -of -the -blood -when -it -reaches -the -head -of -the -infant -class -they -bully -it -with -conundrums -that -cover -the -domain -of -universal -knowledge -this -sounds -extravagant -and -is -yet -it -goes -no -great -way -beyond -the -facts -i -received -a -curious -letter -one -day -from -the -punjab -you -must -pronounce -it -punjawb -the -handwriting -was -excellent -and -the -wording -was -english -english -and -yet -not -exactly -english -the -style -was -easy -and -smooth -and -flowing -yet -there -was -something -subtly -foreign -about -it -a -something -tropically -ornate -and -sentimental -and -rhetorical -it -turned -out -to -be -the -work -of -a -hindoo -youth -the -holder -of -a -humble -clerical -billet -in -a -railway -office -he -had -been -educated -in -one -of -the -numerous -colleges -of -india -upon -inquiry -i -was -told -that -the -country -was -full -of -young -fellows -of -his -like -they -had -been -educated -away -up -to -the -snow -summits -of -learning -and -the -market -for -all -this -elaborate -cultivation -was -minutely -out -of -proportion -to -the -vastness -of -the -product -this -market -consisted -of -some -thousands -of -small -clerical -posts -under -the -government -the -supply -of -material -for -it -was -multitudinous -if -this -youth -with -the -flowing -style -and -the -blossoming -english -was -occupying -a -small -railway -clerkship -it -meant -that -there -were -hundreds -and -hundreds -as -capable -as -he -or -he -would -be -in -a -high -place -and -it -certainly -meant -that -there -were -thousands -whose -education -and -capacity -had -fallen -a -little -short -and -that -they -would -have -to -go -without -places -apparently -then -the -colleges -of -india -were -doing -what -our -high -schools -have -long -been -doing -richly -over -supplying -the -market -for -highly -educated -service -and -thereby -doing -a -damage -to -the -scholar -and -through -him -to -the -country -at -home -i -once -made -a -speech -deploring -the -injuries -inflicted -by -the -high -school -in -making -handicrafts -distasteful -to -boys -who -would -have -been -willing -to -make -a -living -at -trades -and -agriculture -if -they -had -but -had -the -good -luck -to -stop -with -the -common -school -but -i -made -no -converts -not -one -in -a -community -overrun -with -educated -idlers -who -were -above -following -their -fathers' -mechanical -trades -yet -could -find -no -market -for -their -book -knowledge -the -same -rail -that -brought -me -the -letter -from -the -punjab -brought -also -a -little -book -published -by -messrs -thacker -spink -& -co -of -calcutta -which -interested -me -for -both -its -preface -and -its -contents -treated -of -this -matter -of -over -education -in -the -preface -occurs -this -paragraph -from -the -calcutta -review -for -government -office -read -drygoods -clerkship -and -it -will -fit -more -than -one -region -of -america -the -education -that -we -give -makes -the -boys -a -little -less -clownish -in -their -manners -and -more -intelligent -when -spoken -to -by -strangers -on -the -other -hand -it -has -made -them -less -contented -with -their -lot -in -life -and -less -willing -to -work -with -their -hands -the -form -which -discontent -takes -in -this -country -is -not -of -a -healthy -kind -for -the -natives -of -india -consider -that -the -only -occupation -worthy -of -an -educated -man -is -that -of -a -writership -in -some -office -and -especially -in -a -government -office -the -village -schoolboy -goes -back -to -the -plow -with -the -greatest -reluctance -and -the -town -schoolboy -carries -the -same -discontent -and -inefficiency -into -his -father's -workshop -sometimes -these -ex -students -positively -refuse -at -first -to -work -and -more -than -once -parents -have -openly -expressed -their -regret -that -they -ever -allowed -their -sons -to -be -inveigled -to -school -the -little -book -which -i -am -quoting -from -is -called -indo -anglian -literature -and -is -well -stocked -with -baboo -english -clerkly -english -hooky -english -acquired -in -the -schools -some -of -it -is -very -funny -almost -as -funny -perhaps -as -what -you -and -i -produce -when -we -try -to -write -in -a -language -not -our -own -but -much -of -it -is -surprisingly -correct -and -free -if -i -were -going -to -quote -good -english -but -i -am -not -india -is -well -stocked -with -natives -who -speak -it -and -write -it -as -well -as -the -best -of -us -i -merely -wish -to -show -some -of -the -quaint -imperfect -attempts -at -the -use -of -our -tongue -there -are -many -letters -in -the -book -poverty -imploring -help -bread -money -kindness -office -generally -an -office -a -clerkship -some -way -to -get -food -and -a -rag -out -of -the -applicant's -unmarketable -education -and -food -not -for -himself -alone -but -sometimes -for -a -dozen -helpless -relations -in -addition -to -his -own -family -for -those -people -are -astonishingly -unselfish -and -admirably -faithful -to -their -ties -of -kinship -among -us -i -think -there -is -nothing -approaching -it -strange -as -some -of -these -wailing -and -supplicating -letters -are -humble -and -even -groveling -as -some -of -them -are -and -quaintly -funny -and -confused -as -a -goodly -number -of -them -are -there -is -still -a -pathos -about -them -as -a -rule -that -checks -the -rising -laugh -and -reproaches -it -in -the -following -letter -father -is -not -to -be -read -literally -in -ceylon -a -little -native -beggar -girl -embarrassed -me -by -calling -me -father -although -i -knew -she -was -mistaken -i -was -so -new -that -i -did -not -know -that -she -was -merely -following -the -custom -of -the -dependent -and -the -supplicant -sir -i -pray -please -to -give -me -some -action -work -for -i -am -very -poor -boy -i -have -no -one -to -help -me -even -so -father -for -it -so -it -seemed -in -thy -good -sight -you -give -the -telegraph -office -and -another -work -what -is -your -wish -i -am -very -poor -boy -this -understand -what -is -your -wish -you -my -father -i -am -your -son -this -understand -what -is -your -wish -your -sirvent -p -c -b -through -ages -of -debasing -oppression -suffered -by -these -people -at -the -hands -of -their -native -rulers -they -come -legitimately -by -the -attitude -and -language -of -fawning -and -flattery -and -one -must -remember -this -in -mitigation -when -passing -judgment -upon -the -native -character -it -is -common -in -these -letters -to -find -the -petitioner -furtively -trying -to -get -at -the -white -man's -soft -religious -side -even -this -poor -boy -baits -his -hook -with -a -macerated -bible -text -in -the -hope -that -it -may -catch -something -if -all -else -fail -here -is -an -application -for -the -post -of -instructor -in -english -to -some -children -my -dear -sir -or -gentleman -that -your -petitioner -has -much -qualification -in -the -language -of -english -to -instruct -the -young -boys -i -was -given -to -understand -that -your -of -suitable -children -has -to -acquire -the -knowledge -of -english -language -as -a -sample -of -the -flowery -eastern -style -i -will -take -a -sentence -or -two -from -along -letter -written -by -a -young -native -to -the -lieutenant -governor -of -bengal -an -application -for -employment -honored -and -much -respected -sir -i -hope -your -honor -will -condescend -to -hear -the -tale -of -this -poor -creature -i -shall -overflow -with -gratitude -at -this -mark -of -your -royal -condescension -the -bird -like -happiness -has -flown -away -from -my -nest -like -heart -and -has -not -hitherto -returned -from -the -period -whence -the -rose -of -my -father's -life -suffered -the -autumnal -breath -of -death -in -plain -english -he -passed -through -the -gates -of -grave -and -from -that -hour -the -phantom -of -delight -has -never -danced -before -me -it -is -all -school -english -book -english -you -see -and -good -enough -too -all -things -considered -if -the -native -boy -had -but -that -one -study -he -would -shine -he -would -dazzle -no -doubt -but -that -is -not -the -case -he -is -situated -as -are -our -public -school -children -loaded -down -with -an -over -freightage -of -other -studies -and -frequently -they -are -as -far -beyond -the -actual -point -of -progress -reached -by -him -and -suited -to -the -stage -of -development -attained -as -could -be -imagined -by -the -insanest -fancy -apparently -like -our -public -school -boy -he -must -work -work -work -in -school -and -out -and -play -but -little -apparently -like -our -public -school -boy -his -education -consists -in -learning -things -not -the -meaning -of -them -he -is -fed -upon -the -husks -not -the -corn -from -several -essays -written -by -native -schoolboys -in -answer -to -the -question -of -how -they -spend -their -day -i -select -one -the -one -which -goes -most -into -detail -66 -at -the -break -of -day -i -rises -from -my -own -bed -and -finish -my -daily -duty -then -i -employ -myself -till -8 -o'clock -after -which -i -employ -myself -to -bathe -then -take -for -my -body -some -sweet -meat -and -just -at -9 -1/2 -i -came -to -school -to -attend -my -class -duty -then -at -2 -1/2 -p -m -i -return -from -school -and -engage -myself -to -do -my -natural -duty -then -i -engage -for -a -quarter -to -take -my -tithn -then -i -study -till -5 -p -m -after -which -i -began -to -play -anything -which -comes -in -my -head -after -8 -1/2 -half -pass -to -eight -we -are -began -to -sleep -before -sleeping -i -told -a -constable -just -11 -o' -he -came -and -rose -us -from -half -pass -eleven -we -began -to -read -still -morning -it -is -not -perfectly -clear -now -that -i -come -to -cipher -upon -it -he -gets -up -at -about -5 -in -the -morning -or -along -there -somewhere -and -goes -to -bed -about -fifteen -or -sixteen -hours -afterward -that -much -of -it -seems -straight -but -why -he -should -rise -again -three -hours -later -and -resume -his -studies -till -morning -is -puzzling -i -think -it -is -because -he -is -studying -history -history -requires -a -world -of -time -and -bitter -hard -work -when -your -education -is -no -further -advanced -than -the -cat's -when -you -are -merely -stuffing -yourself -with -a -mixed -up -mess -of -empty -names -and -random -incidents -and -elusive -dates -which -no -one -teaches -you -how -to -interpret -and -which -uninterpreted -pay -you -not -a -farthing's -value -for -your -waste -of -time -yes -i -think -he -had -to -get -up -at -halfpast -11 -p -m -in -order -to -be -sure -to -be -perfect -with -his -history -lesson -by -noon -with -results -as -follows -from -a -calcutta -school -examination -q -who -was -cardinal -wolsey -cardinal -wolsey -was -an -editor -of -a -paper -named -north -briton -no -45 -of -his -publication -he -charged -the -king -of -uttering -a -lie -from -the -throne -he -was -arrested -and -cast -into -prison -and -after -releasing -went -to -france -3 -as -bishop -of -york -but -died -in -disentry -in -a -church -on -his -way -to -be -blockheaded -8 -cardinal -wolsey -was -the -son -of -edward -iv -after -his -father's -death -he -himself -ascended -the -throne -at -the -age -of -10 -ten -only -but -when -he -surpassed -or -when -he -was -fallen -in -his -twenty -years -of -age -at -that -time -he -wished -to -make -a -journey -in -his -countries -under -him -but -he -was -opposed -by -his -mother -to -do -journey -and -according -to -his -mother's -example -he -remained -in -the -home -and -then -became -king -after -many -times -obstacles -and -many -confusion -he -become -king -and -afterwards -his -brother -there -is -probably -not -a -word -of -truth -in -that -q -what -is -the -meaning -of -'ich -dien' -10 -an -honor -conferred -on -the -first -or -eldest -sons -of -english -sovereigns -it -is -nothing -more -than -some -feathers -11 -ich -dien -was -the -word -which -was -written -on -the -feathers -of -the -blind -king -who -came -to -fight -being -interlaced -with -the -bridles -of -the -horse -13 -ich -dien -is -a -title -given -to -henry -vii -by -the -pope -of -rome -when -he -forwarded -the -reformation -of -cardinal -wolsy -to -rome -and -for -this -reason -he -was -called -commander -of -the -faith -a -dozen -or -so -of -this -kind -of -insane -answers -are -quoted -in -the -book -from -that -examination -each -answer -is -sweeping -proof -all -by -itself -that -the -person -uttering -it -was -pushed -ahead -of -where -he -belonged -when -he -was -put -into -history -proof -that -he -had -been -put -to -the -task -of -acquiring -history -before -he -had -had -a -single -lesson -in -the -art -of -acquiring -it -which -is -the -equivalent -of -dumping -a -pupil -into -geometry -before -he -has -learned -the -progressive -steps -which -lead -up -to -it -and -make -its -acquirement -possible -those -calcutta -novices -had -no -business -with -history -there -was -no -excuse -for -examining -them -in -it -no -excuse -for -exposing -them -and -their -teachers -they -were -totally -empty -there -was -nothing -to -examine -helen -keller -has -been -dumb -stone -deaf -and -stone -blind -ever -since -she -was -a -little -baby -a -year -and -a -half -old -and -now -at -sixteen -years -of -age -this -miraculous -creature -this -wonder -of -all -the -ages -passes -the -harvard -university -examination -in -latin -german -french -history -belles -lettres -and -such -things -and -does -it -brilliantly -too -not -in -a -commonplace -fashion -she -doesn't -know -merely -things -she -is -splendidly -familiar -with -the -meanings -of -them -when -she -writes -an -essay -on -a -shakespearean -character -her -english -is -fine -and -strong -her -grasp -of -the -subject -is -the -grasp -of -one -who -knows -and -her -page -is -electric -with -light -has -miss -sullivan -taught -her -by -the -methods -of -india -and -the -american -public -school -no -oh -no -for -then -she -would -be -deafer -and -dumber -and -blinder -than -she -was -before -it -is -a -pity -that -we -can't -educate -all -the -children -in -the -asylums -to -continue -the -calcutta -exposure -what -is -the -meaning -of -a -sheriff -25 -sheriff -is -a -post -opened -in -the -time -of -john -the -duty -of -sheriff -here -in -calcutta -to -look -out -and -catch -those -carriages -which -is -rashly -driven -out -by -the -coachman -but -it -is -a -high -post -in -england -26 -sheriff -was -the -english -bill -of -common -prayer -27 -the -man -with -whom -the -accusative -persons -are -placed -is -called -sheriff -28 -sheriff -latin -term -for -'shrub -' -we -called -broom -worn -by -the -first -earl -of -enjue -as -an -emblem -of -humility -when -they -went -to -the -pilgrimage -and -from -this -their -hairs -took -their -crest -and -surname -29 -sheriff -is -a -kind -of -titlous -sect -of -people -as -barons -nobles -etc -30 -sheriff -a -tittle -given -on -those -persons -who -were -respective -and -pious -in -england -the -students -were -examined -in -the -following -bulky -matters -geometry -the -solar -spectrum -the -habeas -corpus -act -the -british -parliament -and -in -metaphysics -they -were -asked -to -trace -the -progress -of -skepticism -from -descartes -to -hume -it -is -within -bounds -to -say -that -some -of -the -results -were -astonishing -without -doubt -there -were -students -present -who -justified -their -teacher's -wisdom -in -introducing -them -to -these -studies -but -the -fact -is -also -evident -that -others -had -been -pushed -into -these -studies -to -waste -their -time -over -them -when -they -could -have -been -profitably -employed -in -hunting -smaller -game -under -the -head -of -geometry -one -of -the -answers -is -this -49 -the -whole -bd -= -the -whole -ca -and -so -so -so -so -so -so -so -to -me -this -is -cloudy -but -i -was -never -well -up -in -geometry -that -was -the -only -effort -made -among -the -five -students -who -appeared -for -examination -in -geometry -the -other -four -wailed -and -surrendered -without -a -fight -they -are -piteous -wails -too -wails -of -despair -and -one -of -them -is -an -eloquent -reproach -it -comes -from -a -poor -fellow -who -has -been -laden -beyond -his -strength -by -a -stupid -teacher -and -is -eloquent -in -spite -of -the -poverty -of -its -english -the -poor -chap -finds -himself -required -to -explain -riddles -which -even -sir -isaac -newton -was -not -able -to -understand -50 -oh -my -dear -father -examiner -you -my -father -and -you -kindly -give -a -number -of -pass -you -my -great -father -51 -i -am -a -poor -boy -and -have -no -means -to -support -my -mother -and -two -brothers -who -are -suffering -much -for -want -of -food -i -get -four -rupees -monthly -from -charity -fund -of -this -place -from -which -i -send -two -rupees -for -their -support -and -keep -two -for -my -own -support -father -if -i -relate -the -unlucky -circumstance -under -which -we -are -placed -then -i -think -you -will -not -be -able -to -suppress -the -tender -tear -52 -sir -which -sir -isaac -newton -and -other -experienced -mathematicians -cannot -understand -i -being -third -of -entrance -class -can -understand -these -which -is -too -impossible -to -imagine -and -my -examiner -also -has -put -very -tiresome -and -very -heavy -propositions -to -prove -we -must -remember -that -these -pupils -had -to -do -their -thinking -in -one -language -and -express -themselves -in -another -and -alien -one -it -was -a -heavy -handicap -i -have -by -me -english -as -she -is -taught -a -collection -of -american -examinations -made -in -the -public -schools -of -brooklyn -by -one -of -the -teachers -miss -caroline -b -le -row -an -extract -or -two -from -its -pages -will -show -that -when -the -american -pupil -is -using -but -one -language -and -that -one -his -own -his -performance -is -no -whit -better -than -his -indian -brother's -on -history -christopher -columbus -was -called -the -father -of -his -country -queen -isabella -of -spain -sold -her -watch -and -chain -and -other -millinery -so -that -columbus -could -discover -america -the -indian -wars -were -very -desecrating -to -the -country -the -indians -pursued -their -warfare -by -hiding -in -the -bushes -and -then -scalping -them -captain -john -smith -has -been -styled -the -father -of -his -country -his -life -was -saved -by -his -daughter -pochahantas -the -puritans -found -an -insane -asylum -in -the -wilds -of -america -the -stamp -act -was -to -make -everybody -stamp -all -materials -so -they -should -be -null -and -void -washington -died -in -spain -almost -broken -hearted -his -remains -were -taken -to -the -cathedral -in -havana -gorilla -warfare -was -where -men -rode -on -gorillas -in -brooklyn -as -in -india -they -examine -a -pupil -and -when -they -find -out -he -doesn't -know -anything -they -put -him -into -literature -or -geometry -or -astronomy -or -government -or -something -like -that -so -that -he -can -properly -display -the -assification -of -the -whole -system -on -literature -'bracebridge -hall' -was -written -by -henry -irving -edgar -a -poe -was -a -very -curdling -writer -beowulf -wrote -the -scriptures -ben -johnson -survived -shakespeare -in -some -respects -in -the -'canterbury -tale' -it -gives -account -of -king -alfred -on -his -way -to -the -shrine -of -thomas -bucket -chaucer -was -the -father -of -english -pottery -chaucer -was -succeeded -by -h -wads -longfellow -we -will -finish -with -a -couple -of -samples -of -literature -one -from -america -the -other -from -india -the -first -is -a -brooklyn -public -school -boy's -attempt -to -turn -a -few -verses -of -the -lady -of -the -lake -into -prose -you -will -have -to -concede -that -he -did -it -the -man -who -rode -on -the -horse -performed -the -whip -and -an -instrument -made -of -steel -alone -with -strong -ardor -not -diminishing -for -being -tired -from -the -time -passed -with -hard -labor -overworked -with -anger -and -ignorant -with -weariness -while -every -breath -for -labor -lie -drew -with -cries -full -of -sorrow -the -young -deer -made -imperfect -who -worked -hard -filtered -in -sight -the -following -paragraph -is -from -a -little -book -which -is -famous -in -india -the -biography -of -a -distinguished -hindoo -judge -onoocool -chunder -mookerjee -it -was -written -by -his -nephew -and -is -unintentionally -funny -in -fact -exceedingly -so -i -offer -here -the -closing -scene -if -you -would -like -to -sample -the -rest -of -the -book -it -can -be -had -by -applying -to -the -publishers -messrs -thacker -spink -& -co -calcutta -and -having -said -these -words -he -hermetically -sealed -his -lips -not -to -open -them -again -all -the -well -known -doctors -of -calcutta -that -could -be -procured -for -a -man -of -his -position -and -wealth -were -brought -doctors -payne -fayrer -and -nilmadhub -mookerjee -and -others -they -did -what -they -could -do -with -their -puissance -and -knack -of -medical -knowledge -but -it -proved -after -all -as -if -to -milk -the -ram! -his -wife -and -children -had -not -the -mournful -consolation -to -hear -his -last -words -he -remained -sotto -voce -for -a -few -hours -and -then -was -taken -from -us -at -6 -12 -p -m -according -to -the -caprice -of -god -which -passeth -understanding -chapter -lxii -there -are -no -people -who -are -quite -so -vulgar -as -the -over -refined -ones -pudd'nhead -wilson's -new -calendar -we -sailed -from -calcutta -toward -the -end -of -march -stopped -a -day -at -madras -two -or -three -days -in -ceylon -then -sailed -westward -on -a -long -flight -for -mauritius -from -my -diary -april -7 -we -are -far -abroad -upon -the -smooth -waters -of -the -indian -ocean -now -it -is -shady -and -pleasant -and -peaceful -under -the -vast -spread -of -the -awnings -and -life -is -perfect -again -ideal -the -difference -between -a -river -and -the -sea -is -that -the -river -looks -fluid -the -sea -solid -usually -looks -as -if -you -could -step -out -and -walk -on -it -the -captain -has -this -peculiarity -he -cannot -tell -the -truth -in -a -plausible -way -in -this -he -is -the -very -opposite -of -the -austere -scot -who -sits -midway -of -the -table -he -cannot -tell -a -lie -in -an -unplausible -way -when -the -captain -finishes -a -statement -the -passengers -glance -at -each -other -privately -as -who -should -say -do -you -believe -that -when -the -scot -finishes -one -the -look -says -how -strange -and -interesting -the -whole -secret -is -in -the -manner -and -method -of -the -two -men -the -captain -is -a -little -shy -and -diffident -and -he -states -the -simplest -fact -as -if -he -were -a -little -afraid -of -it -while -the -scot -delivers -himself -of -the -most -abandoned -lie -with -such -an -air -of -stern -veracity -that -one -is -forced -to -believe -it -although -one -knows -it -isn't -so -for -instance -the -scot -told -about -a -pet -flying -fish -he -once -owned -that -lived -in -a -little -fountain -in -his -conservatory -and -supported -itself -by -catching -birds -and -frogs -and -rats -in -the -neighboring -fields -it -was -plain -that -no -one -at -the -table -doubted -this -statement -by -and -by -in -the -course -of -some -talk -about -custom -house -annoyances -the -captain -brought -out -the -following -simple -everyday -incident -but -through -his -infirmity -of -style -managed -to -tell -it -in -such -a -way -that -it -got -no -credence -he -said -i -went -ashore -at -naples -one -voyage -when -i -was -in -that -trade -and -stood -around -helping -my -passengers -for -i -could -speak -a -little -italian -two -or -three -times -at -intervals -the -officer -asked -me -if -i -had -anything -dutiable -about -me -and -seemed -more -and -more -put -out -and -disappointed -every -time -i -told -him -no -finally -a -passenger -whom -i -had -helped -through -asked -me -to -come -out -and -take -something -i -thanked -him -but -excused -myself -saying -i -had -taken -a -whisky -just -before -i -came -ashore -it -was -a -fatal -admission -the -officer -at -once -made -me -pay -sixpence -import -duty -on -the -whisky -just -from -ship -to -shore -you -see -and -he -fined -me -l5 -for -not -declaring -the -goods -another -l5 -for -falsely -denying -that -i -had -anything -dutiable -about -me -also -l5 -for -concealing -the -goods -and -l50 -for -smuggling -which -is -the -maximum -penalty -for -unlawfully -bringing -in -goods -under -the -value -of -sevenpence -ha'penny -altogether -sixty -five -pounds -sixpence -for -a -little -thing -like -that -the -scot -is -always -believed -yet -he -never -tells -anything -but -lies -whereas -the -captain -is -never -believed -although -he -never -tells -a -lie -so -far -as -i -can -judge -if -he -should -say -his -uncle -was -a -male -person -he -would -probably -say -it -in -such -a -way -that -nobody -would -believe -it -at -the -same -time -the -scot -could -claim -that -he -had -a -female -uncle -and -not -stir -a -doubt -in -anybody's -mind -my -own -luck -has -been -curious -all -my -literary -life -i -never -could -tell -a -lie -that -anybody -would -doubt -nor -a -truth -that -anybody -would -believe -lots -of -pets -on -board -birds -and -things -in -these -far -countries -the -white -people -do -seem -to -run -remarkably -to -pets -our -host -in -cawnpore -had -a -fine -collection -of -birds -the -finest -we -saw -in -a -private -house -in -india -and -in -colombo -dr -murray's -great -compound -and -commodious -bungalow -were -well -populated -with -domesticated -company -from -the -woods -frisky -little -squirrels -a -ceylon -mina -walking -sociably -about -the -house -a -small -green -parrot -that -whistled -a -single -urgent -note -of -call -without -motion -of -its -beak -also -chuckled -a -monkey -in -a -cage -on -the -back -veranda -and -some -more -out -in -the -trees -also -a -number -of -beautiful -macaws -in -the -trees -and -various -and -sundry -birds -and -animals -of -breeds -not -known -to -me -but -no -cat -yet -a -cat -would -have -liked -that -place -april -9 -tea -planting -is -the -great -business -in -ceylon -now -a -passenger -says -it -often -pays -40 -per -cent -on -the -investment -says -there -is -a -boom -april -10 -the -sea -is -a -mediterranean -blue -and -i -believe -that -that -is -about -the -divinest -color -known -to -nature -it -is -strange -and -fine -nature's -lavish -generosities -to -her -creatures -at -least -to -all -of -them -except -man -for -those -that -fly -she -has -provided -a -home -that -is -nobly -spacious -a -home -which -is -forty -miles -deep -and -envelops -the -whole -globe -and -has -not -an -obstruction -in -it -for -those -that -swim -she -has -provided -a -more -than -imperial -domain -a -domain -which -is -miles -deep -and -covers -four -fifths -of -the -globe -but -as -for -man -she -has -cut -him -off -with -the -mere -odds -and -ends -of -the -creation -she -has -given -him -the -thin -skin -the -meagre -skin -which -is -stretched -over -the -remaining -one -fifth -the -naked -bones -stick -up -through -it -in -most -places -on -the -one -half -of -this -domain -he -can -raise -snow -ice -sand -rocks -and -nothing -else -so -the -valuable -part -of -his -inheritance -really -consists -of -but -a -single -fifth -of -the -family -estate -and -out -of -it -he -has -to -grub -hard -to -get -enough -to -keep -him -alive -and -provide -kings -and -soldiers -and -powder -to -extend -the -blessings -of -civilization -with -yet -man -in -his -simplicity -and -complacency -and -inability -to -cipher -thinks -nature -regards -him -as -the -important -member -of -the -family -in -fact -her -favorite -surely -it -must -occur -to -even -his -dull -head -sometimes -that -she -has -a -curious -way -of -showing -it -afternoon -the -captain -has -been -telling -how -in -one -of -his -arctic -voyages -it -was -so -cold -that -the -mate's -shadow -froze -fast -to -the -deck -and -had -to -be -ripped -loose -by -main -strength -and -even -then -he -got -only -about -two -thirds -of -it -back -nobody -said -anything -and -the -captain -went -away -i -think -he -is -becoming -disheartened -also -to -be -fair -there -is -another -word -of -praise -due -to -this -ship's -library -it -contains -no -copy -of -the -vicar -of -wakefield -that -strange -menagerie -of -complacent -hypocrites -and -idiots -of -theatrical -cheap -john -heroes -and -heroines -who -are -always -showing -off -of -bad -people -who -are -not -interesting -and -good -people -who -are -fatiguing -a -singular -book -not -a -sincere -line -in -it -and -not -a -character -that -invites -respect -a -book -which -is -one -long -waste -pipe -discharge -of -goody -goody -puerilities -and -dreary -moralities -a -book -which -is -full -of -pathos -which -revolts -and -humor -which -grieves -the -heart -there -are -few -things -in -literature -that -are -more -piteous -more -pathetic -than -the -celebrated -humorous -incident -of -moses -and -the -spectacles -jane -austen's -books -too -are -absent -from -this -library -just -that -one -omission -alone -would -make -a -fairly -good -library -out -of -a -library -that -hadn't -a -book -in -it -customs -in -tropic -seas -at -5 -in -the -morning -they -pipe -to -wash -down -the -decks -and -at -once -the -ladies -who -are -sleeping -there -turn -out -and -they -and -their -beds -go -below -then -one -after -another -the -men -come -up -from -the -bath -in -their -pyjamas -and -walk -the -decks -an -hour -or -two -with -bare -legs -and -bare -feet -coffee -and -fruit -served -the -ship -cat -and -her -kitten -now -appear -and -get -about -their -toilets -next -the -barber -comes -and -flays -us -on -the -breezy -deck -breakfast -at -9 -30 -and -the -day -begins -i -do -not -know -how -a -day -could -be -more -reposeful -no -motion -a -level -blue -sea -nothing -in -sight -from -horizon -to -horizon -the -speed -of -the -ship -furnishes -a -cooling -breeze -there -is -no -mail -to -read -and -answer -no -newspapers -to -excite -you -no -telegrams -to -fret -you -or -fright -you -the -world -is -far -far -away -it -has -ceased -to -exist -for -you -seemed -a -fading -dream -along -in -the -first -days -has -dissolved -to -an -unreality -now -it -is -gone -from -your -mind -with -all -its -businesses -and -ambitions -its -prosperities -and -disasters -its -exultations -and -despairs -its -joys -and -griefs -and -cares -and -worries -they -are -no -concern -of -yours -any -more -they -have -gone -out -of -your -life -they -are -a -storm -which -has -passed -and -left -a -deep -calm -behind -the -people -group -themselves -about -the -decks -in -their -snowy -white -linen -and -read -smoke -sew -play -cards -talk -nap -and -so -on -in -other -ships -the -passengers -are -always -ciphering -about -when -they -are -going -to -arrive -out -in -these -seas -it -is -rare -very -rare -to -hear -that -subject -broached -in -other -ships -there -is -always -an -eager -rush -to -the -bulletin -board -at -noon -to -find -out -what -the -run -has -been -in -these -seas -the -bulletin -seems -to -attract -no -interest -i -have -seen -no -one -visit -it -in -thirteen -days -i -have -visited -it -only -once -then -i -happened -to -notice -the -figures -of -the -day's -run -on -that -day -there -happened -to -be -talk -at -dinner -about -the -speed -of -modern -ships -i -was -the -only -passenger -present -who -knew -this -ship's -gait -necessarily -the -atlantic -custom -of -betting -on -the -ship's -run -is -not -a -custom -here -nobody -ever -mentions -it -i -myself -am -wholly -indifferent -as -to -when -we -are -going -to -get -in -if -any -one -else -feels -interested -in -the -matter -he -has -not -indicated -it -in -my -hearing -if -i -had -my -way -we -should -never -get -in -at -all -this -sort -of -sea -life -is -charged -with -an -indestructible -charm -there -is -no -weariness -no -fatigue -no -worry -no -responsibility -no -work -no -depression -of -spirits -there -is -nothing -like -this -serenity -this -comfort -this -peace -this -deep -contentment -to -be -found -anywhere -on -land -if -i -had -my -way -i -would -sail -on -for -ever -and -never -go -to -live -on -the -solid -ground -again -one -of -kipling's -ballads -has -delivered -the -aspect -and -sentiment -of -this -bewitching -sea -correctly -the -injian -ocean -sets -an' -smiles -so -sof' -so -bright -so -bloomin' -blue -there -aren't -a -wave -for -miles -an' -miles -excep' -the -jiggle -from -the -screw -april -14 -it -turns -out -that -the -astronomical -apprentice -worked -off -a -section -of -the -milky -way -on -me -for -the -magellan -clouds -a -man -of -more -experience -in -the -business -showed -one -of -them -to -me -last -night -it -was -small -and -faint -and -delicate -and -looked -like -the -ghost -of -a -bunch -of -white -smoke -left -floating -in -the -sky -by -an -exploded -bombshell -wednesday -april -15 -mauritius -arrived -and -anchored -off -port -louis -2 -a -m -rugged -clusters -of -crags -and -peaks -green -to -their -summits -from -their -bases -to -the -sea -a -green -plain -with -just -tilt -enough -to -it -to -make -the -water -drain -off -i -believe -it -is -in -56 -e -and -22 -s -a -hot -tropical -country -the -green -plain -has -an -inviting -look -has -scattering -dwellings -nestling -among -the -greenery -scene -of -the -sentimental -adventure -of -paul -and -virginia -island -under -french -control -which -means -a -community -which -depends -upon -quarantines -not -sanitation -for -its -health -thursday -april -16 -went -ashore -in -the -forenoon -at -port -louis -a -little -town -but -with -the -largest -variety -of -nationalities -and -complexions -we -have -encountered -yet -french -english -chinese -arabs -africans -with -wool -blacks -with -straight -hair -east -indians -half -whites -quadroons -and -great -varieties -in -costumes -and -colors -took -the -train -for -curepipe -at -1 -30 -two -hours' -run -gradually -uphill -what -a -contrast -this -frantic -luxuriance -of -vegetation -with -the -arid -plains -of -india -these -architecturally -picturesque -crags -and -knobs -and -miniature -mountains -with -the -monotony -of -the -indian -dead -levels -a -native -pointed -out -a -handsome -swarthy -man -of -grave -and -dignified -bearing -and -said -in -an -awed -tone -that -is -so -and -so -has -held -office -of -one -sort -or -another -under -this -government -for -37 -years -he -is -known -all -over -this -whole -island -and -in -the -other -countries -of -the -world -perhaps -who -knows -one -thing -is -certain -you -can -speak -his -name -anywhere -in -this -whole -island -and -you -will -find -not -one -grown -person -that -has -not -heard -it -it -is -a -wonderful -thing -to -be -so -celebrated -yet -look -at -him -it -makes -no -change -in -him -he -does -not -even -seem -to -know -it -curepipe -means -pincushion -or -pegtown -probably -sixteen -miles -two -hours -by -rail -from -port -louis -at -each -end -of -every -roof -and -on -the -apex -of -every -dormer -window -a -wooden -peg -two -feet -high -stands -up -in -some -cases -its -top -is -blunt -in -others -the -peg -is -sharp -and -looks -like -a -toothpick -the -passion -for -this -humble -ornament -is -universal -apparently -there -has -been -only -one -prominent -event -in -the -history -of -mauritius -and -that -one -didn't -happen -i -refer -to -the -romantic -sojourn -of -paul -and -virginia -here -it -was -that -story -that -made -mauritius -known -to -the -world -made -the -name -familiar -to -everybody -the -geographical -position -of -it -to -nobody -a -clergyman -was -asked -to -guess -what -was -in -a -box -on -a -table -it -was -a -vellum -fan -painted -with -the -shipwreck -and -was -one -of -virginia's -wedding -gifts -april -18 -this -is -the -only -country -in -the -world -where -the -stranger -is -not -asked -how -do -you -like -this -place -this -is -indeed -a -large -distinction -here -the -citizen -does -the -talking -about -the -country -himself -the -stranger -is -not -asked -to -help -you -get -all -sorts -of -information -from -one -citizen -you -gather -the -idea -that -mauritius -was -made -first -and -then -heaven -and -that -heaven -was -copied -after -mauritius -another -one -tells -you -that -this -is -an -exaggeration -that -the -two -chief -villages -port -louis -and -curepipe -fall -short -of -heavenly -perfection -that -nobody -lives -in -port -louis -except -upon -compulsion -and -that -curepipe -is -the -wettest -and -rainiest -place -in -the -world -an -english -citizen -said -in -the -early -part -of -this -century -mauritius -was -used -by -the -french -as -a -basis -from -which -to -operate -against -england's -indian -merchantmen -so -england -captured -the -island -and -also -the -neighbor -bourbon -to -stop -that -annoyance -england -gave -bourbon -back -the -government -in -london -did -not -want -any -more -possessions -in -the -west -indies -if -the -government -had -had -a -better -quality -of -geography -in -stock -it -would -not -have -wasted -bourbon -in -that -foolish -way -a -big -war -will -temporarily -shut -up -the -suez -canal -some -day -and -the -english -ships -will -have -to -go -to -india -around -the -cape -of -good -hope -again -then -england -will -have -to -have -bourbon -and -will -take -it -mauritius -was -a -crown -colony -until -20 -years -ago -with -a -governor -appointed -by -the -crown -and -assisted -by -a -council -appointed -by -himself -but -pope -hennessey -came -out -as -governor -then -and -he -worked -hard -to -get -a -part -of -the -council -made -elective -and -succeeded -so -now -the -whole -council -is -french -and -in -all -ordinary -matters -of -legislation -they -vote -together -and -in -the -french -interest -not -the -english -the -english -population -is -very -slender -it -has -not -votes -enough -to -elect -a -legislator -half -a -dozen -rich -french -families -elect -the -legislature -pope -hennessey -was -an -irishman -a -catholic -a -home -ruler -m -p -a -hater -of -england -and -the -english -a -very -troublesome -person -and -a -serious -incumbrance -at -westminster -so -it -was -decided -to -send -him -out -to -govern -unhealthy -countries -in -hope -that -something -would -happen -to -him -but -nothing -did -the -first -experiment -was -not -merely -a -failure -it -was -more -than -a -failure -he -proved -to -be -more -of -a -disease -himself -than -any -he -was -sent -to -encounter -the -next -experiment -was -here -the -dark -scheme -failed -again -it -was -an -off -season -and -there -was -nothing -but -measles -here -at -the -time -pope -hennessey's -health -was -not -affected -he -worked -with -the -french -and -for -the -french -and -against -the -english -and -he -made -the -english -very -tired -and -the -french -very -happy -and -lived -to -have -the -joy -of -seeing -the -flag -he -served -publicly -hissed -his -memory -is -held -in -worshipful -reverence -and -affection -by -the -french -it -is -a -land -of -extraordinary -quarantines -they -quarantine -a -ship -for -anything -or -for -nothing -quarantine -her -for -20 -and -even -30 -days -they -once -quarantined -a -ship -because -her -captain -had -had -the -smallpox -when -he -was -a -boy -that -and -because -he -was -english -the -population -is -very -small -small -to -insignificance -the -majority -is -east -indian -then -mongrels -then -negroes -descendants -of -the -slaves -of -the -french -times -then -french -then -english -there -was -an -american -but -he -is -dead -or -mislaid -the -mongrels -are -the -result -of -all -kinds -of -mixtures -black -and -white -mulatto -and -white -quadroon -and -white -octoroon -and -white -and -so -there -is -every -shade -of -complexion -ebony -old -mahogany -horsechestnut -sorrel -molasses -candy -clouded -amber -clear -amber -old -ivory -white -new -ivory -white -fish -belly -white -this -latter -the -leprous -complexion -frequent -with -the -anglo -saxon -long -resident -in -tropical -climates -you -wouldn't -expect -a -person -to -be -proud -of -being -a -mauritian -now -would -you -but -it -is -so -the -most -of -them -have -never -been -out -of -the -island -and -haven't -read -much -or -studied -much -and -they -think -the -world -consists -of -three -principal -countries -judaea -france -and -mauritius -so -they -are -very -proud -of -belonging -to -one -of -the -three -grand -divisions -of -the -globe -they -think -that -russia -and -germany -are -in -england -and -that -england -does -not -amount -to -much -they -have -heard -vaguely -about -the -united -states -and -the -equator -but -they -think -both -of -them -are -monarchies -they -think -mount -peter -botte -is -the -highest -mountain -in -the -world -and -if -you -show -one -of -them -a -picture -of -milan -cathedral -he -will -swell -up -with -satisfaction -and -say -that -the -idea -of -that -jungle -of -spires -was -stolen -from -the -forest -of -peg -tops -and -toothpicks -that -makes -the -roofs -of -curepipe -look -so -fine -and -prickly -there -is -not -much -trade -in -books -the -newspapers -educate -and -entertain -the -people -mainly -the -latter -they -have -two -pages -of -large -print -reading -matter -one -of -them -english -the -other -french -the -english -page -is -a -translation -of -the -french -one -the -typography -is -super -extra -primitive -in -this -quality -it -has -not -its -equal -anywhere -there -is -no -proof -reader -now -he -is -dead -where -do -they -get -matter -to -fill -up -a -page -in -this -little -island -lost -in -the -wastes -of -the -indian -ocean -oh -madagascar -they -discuss -madagascar -and -france -that -is -the -bulk -then -they -chock -up -the -rest -with -advice -to -the -government -also -slurs -upon -the -english -administration -the -papers -are -all -owned -and -edited -by -creoles -french -the -language -of -the -country -is -french -everybody -speaks -it -has -to -you -have -to -know -french -particularly -mongrel -french -the -patois -spoken -by -tom -dick -and -harry -of -the -multiform -complexions -or -you -can't -get -along -this -was -a -flourishing -country -in -former -days -for -it -made -then -and -still -makes -the -best -sugar -in -the -world -but -first -the -suez -canal -severed -it -from -the -world -and -left -it -out -in -the -cold -and -next -the -beetroot -sugar -helped -by -bounties -captured -the -european -markets -sugar -is -the -life -of -mauritius -and -it -is -losing -its -grip -its -downward -course -was -checked -by -the -depreciation -of -the -rupee -for -the -planter -pays -wages -in -rupees -but -sells -his -crop -for -gold -and -the -insurrection -in -cuba -and -paralyzation -of -the -sugar -industry -there -have -given -our -prices -here -a -life -saving -lift -but -the -outlook -has -nothing -permanently -favorable -about -it -it -takes -a -year -to -mature -the -canes -on -the -high -ground -three -and -six -months -longer -and -there -is -always -a -chance -that -the -annual -cyclone -will -rip -the -profit -out -of -the -crop -in -recent -times -a -cyclone -took -the -whole -crop -as -you -may -say -and -the -island -never -saw -a -finer -one -some -of -the -noblest -sugar -estates -in -the -island -are -in -deep -difficulties -a -dozen -of -them -are -investments -of -english -capital -and -the -companies -that -own -them -are -at -work -now -trying -to -settle -up -and -get -out -with -a -saving -of -half -the -money -they -put -in -you -know -in -these -days -when -a -country -begins -to -introduce -the -tea -culture -it -means -that -its -own -specialty -has -gone -back -on -it -look -at -bengal -look -at -ceylon -well -they've -begun -to -introduce -the -tea -culture -here -many -copies -of -paul -and -virginia -are -sold -every -year -in -mauritius -no -other -book -is -so -popular -here -except -the -bible -by -many -it -is -supposed -to -be -a -part -of -the -bible -all -the -missionaries -work -up -their -french -on -it -when -they -come -here -to -pervert -the -catholic -mongrel -it -is -the -greatest -story -that -was -ever -written -about -mauritius -and -the -only -one -chapter -lxiii -the -principal -difference -between -a -cat -and -a -lie -is -that -the -cat -has -only -nine -lives -pudd'nhead -wilson's -new -calendar -april -20 -the -cyclone -of -1892 -killed -and -crippled -hundreds -of -people -it -was -accompanied -by -a -deluge -of -rain -which -drowned -port -louis -and -produced -a -water -famine -quite -true -for -it -burst -the -reservoir -and -the -water -pipes -and -for -a -time -after -the -flood -had -disappeared -there -was -much -distress -from -want -of -water -this -is -the -only -place -in -the -world -where -no -breed -of -matches -can -stand -the -damp -only -one -match -in -16 -will -light -the -roads -are -hard -and -smooth -some -of -the -compounds -are -spacious -some -of -the -bungalows -commodious -and -the -roadways -are -walled -by -tall -bamboo -hedges -trim -and -green -and -beautiful -and -there -are -azalea -hedges -too -both -the -white -and -the -red -i -never -saw -that -before -as -to -healthiness -i -translate -from -to -day's -april -20 -merchants' -and -planters' -gazette -from -the -article -of -a -regular -contributor -carminge -concerning -the -death -of -the -nephew -of -a -prominent -citizen -sad -and -lugubrious -existence -this -which -we -lead -in -mauritius -i -believe -there -is -no -other -country -in -the -world -where -one -dies -more -easily -than -among -us -the -least -indisposition -becomes -a -mortal -malady -a -simple -headache -develops -into -meningitis -a -cold -into -pneumonia -and -presently -when -we -are -least -expecting -it -death -is -a -guest -in -our -home -this -daily -paper -has -a -meteorological -report -which -tells -you -what -the -weather -was -day -before -yesterday -one -is -clever -pestered -by -a -beggar -or -a -peddler -in -this -town -so -far -as -i -can -see -this -is -pleasantly -different -from -india -april -22 -to -such -as -believe -that -the -quaint -product -called -french -civilization -would -be -an -improvement -upon -the -civilization -of -new -guinea -and -the -like -the -snatching -of -madagascar -and -the -laying -on -of -french -civilization -there -will -be -fully -justified -but -why -did -the -english -allow -the -french -to -have -madagascar -did -she -respect -a -theft -of -a -couple -of -centuries -ago -dear -me -robbery -by -european -nations -of -each -other's -territories -has -never -been -a -sin -is -not -a -sin -to -day -to -the -several -cabinets -the -several -political -establishments -of -the -world -are -clotheslines -and -a -large -part -of -the -official -duty -of -these -cabinets -is -to -keep -an -eye -on -each -other's -wash -and -grab -what -they -can -of -it -as -opportunity -offers -all -the -territorial -possessions -of -all -the -political -establishments -in -the -earth -including -america -of -course -consist -of -pilferings -from -other -people's -wash -no -tribe -howsoever -insignificant -and -no -nation -howsoever -mighty -occupies -a -foot -of -land -that -was -not -stolen -when -the -english -the -french -and -the -spaniards -reached -america -the -indian -tribes -had -been -raiding -each -other's -territorial -clothes -lines -for -ages -and -every -acre -of -ground -in -the -continent -had -been -stolen -and -re -stolen -500 -times -the -english -the -french -and -the -spaniards -went -to -work -and -stole -it -all -over -again -and -when -that -was -satisfactorily -accomplished -they -went -diligently -to -work -and -stole -it -from -each -other -in -europe -and -asia -and -africa -every -acre -of -ground -has -been -stolen -several -millions -of -times -a -crime -persevered -in -a -thousand -centuries -ceases -to -be -a -crime -and -becomes -a -virtue -this -is -the -law -of -custom -and -custom -supersedes -all -other -forms -of -law -christian -governments -are -as -frank -to -day -as -open -and -above -board -in -discussing -projects -for -raiding -each -other's -clothes -lines -as -ever -they -were -before -the -golden -rule -came -smiling -into -this -inhospitable -world -and -couldn't -get -a -night's -lodging -anywhere -in -150 -years -england -has -beneficently -retired -garment -after -garment -from -the -indian -lines -until -there -is -hardly -a -rag -of -the -original -wash -left -dangling -anywhere -in -800 -years -an -obscure -tribe -of -muscovite -savages -has -risen -to -the -dazzling -position -of -land -robber -in -chief -she -found -a -quarter -of -the -world -hanging -out -to -dry -on -a -hundred -parallels -of -latitude -and -she -scooped -in -the -whole -wash -she -keeps -a -sharp -eye -on -a -multitude -of -little -lines -that -stretch -along -the -northern -boundaries -of -india -and -every -now -and -then -she -snatches -a -hip -rag -or -a -pair -of -pyjamas -it -is -england's -prospective -property -and -russia -knows -it -but -russia -cares -nothing -for -that -in -fact -in -our -day -land -robbery -claim -jumping -is -become -a -european -governmental -frenzy -some -have -been -hard -at -it -in -the -borders -of -china -in -burma -in -siam -and -the -islands -of -the -sea -and -all -have -been -at -it -in -africa -africa -has -been -as -coolly -divided -up -and -portioned -out -among -the -gang -as -if -they -had -bought -it -and -paid -for -it -and -now -straightway -they -are -beginning -the -old -game -again -to -steal -each -other's -grabbings -germany -found -a -vast -slice -of -central -africa -with -the -english -flag -and -the -english -missionary -and -the -english -trader -scattered -all -over -it -but -with -certain -formalities -neglected -no -signs -up -keep -off -the -grass -trespassers -forbidden -etc -and -she -stepped -in -with -a -cold -calm -smile -and -put -up -the -signs -herself -and -swept -those -english -pioneers -promptly -out -of -the -country -there -is -a -tremendous -point -there -it -can -be -put -into -the -form -of -a -maxim -get -your -formalities -right -never -mind -about -the -moralities -it -was -an -impudent -thing -but -england -had -to -put -up -with -it -now -in -the -case -of -madagascar -the -formalities -had -originally -been -observed -but -by -neglect -they -had -fallen -into -desuetude -ages -ago -england -should -have -snatched -madagascar -from -the -french -clothes -line -without -an -effort -she -could -have -saved -those -harmless -natives -from -the -calamity -of -french -civilization -and -she -did -not -do -it -now -it -is -too -late -the -signs -of -the -times -show -plainly -enough -what -is -going -to -happen -all -the -savage -lands -in -the -world -are -going -to -be -brought -under -subjection -to -the -christian -governments -of -europe -i -am -not -sorry -but -glad -this -coming -fate -might -have -been -a -calamity -to -those -savage -peoples -two -hundred -years -ago -but -now -it -will -in -some -cases -be -a -benefaction -the -sooner -the -seizure -is -consummated -the -better -for -the -savages -the -dreary -and -dragging -ages -of -bloodshed -and -disorder -and -oppression -will -give -place -to -peace -and -order -and -the -reign -of -law -when -one -considers -what -india -was -under -her -hindoo -and -mohammedan -rulers -and -what -she -is -now -when -he -remembers -the -miseries -of -her -millions -then -and -the -protections -and -humanities -which -they -enjoy -now -he -must -concede -that -the -most -fortunate -thing -that -has -ever -befallen -that -empire -was -the -establishment -of -british -supremacy -there -the -savage -lands -of -the -world -are -to -pass -to -alien -possession -their -peoples -to -the -mercies -of -alien -rulers -let -us -hope -and -believe -that -they -will -all -benefit -by -the -change -april -23 -the -first -year -they -gather -shells -the -second -year -they -gather -shells -and -drink -the -third -year -they -do -not -gather -shells -said -of -immigrants -to -mauritius -population -375 -000 -120 -sugar -factories -population -1851 -185 -000 -the -increase -is -due -mainly -to -the -introduction -of -indian -coolies -they -now -apparently -form -the -great -majority -of -the -population -they -are -admirable -breeders -their -homes -are -always -hazy -with -children -great -savers -of -money -a -british -officer -told -me -that -in -india -he -paid -his -servant -10 -rupees -a -month -and -he -had -11 -cousins -uncles -parents -etc -dependent -upon -him -and -he -supported -them -on -his -wages -these -thrifty -coolies -are -said -to -be -acquiring -land -a -trifle -at -a -time -and -cultivating -it -and -may -own -the -island -by -and -by -the -indian -women -do -very -hard -labor -[for -wages -of -1/2 -rupee -for -twelve -hours' -work -] -they -carry -mats -of -sugar -on -their -heads -70 -pounds -all -day -lading -ships -for -half -a -rupee -and -work -at -gardening -all -day -for -less -the -camaron -is -a -fresh -water -creature -like -a -cray -fish -it -is -regarded -here -as -the -world's -chiefest -delicacy -and -certainly -it -is -good -guards -patrol -the -streams -to -prevent -poaching -it -a -fine -of -rs -200 -or -300 -they -say -for -poaching -bait -is -thrown -in -the -water -the -camaron -goes -for -it -the -fisher -drops -his -loop -in -and -works -it -around -and -about -the -camaron -he -has -selected -till -he -gets -it -over -its -tail -then -there's -a -jerk -or -something -to -certify -the -camaron -that -it -is -his -turn -now -he -suddenly -backs -away -which -moves -the -loop -still -further -up -his -person -and -draws -it -taut -and -his -days -are -ended -another -dish -called -palmiste -is -like -raw -turnip -shavings -and -tastes -like -green -almonds -is -very -delicate -and -good -costs -the -life -of -a -palm -tree -12 -to -20 -years -old -for -it -is -the -pith -another -dish -looks -like -greens -or -a -tangle -of -fine -seaweed -is -a -preparation -of -the -deadly -nightshade -good -enough -the -monkeys -live -in -the -dense -forests -on -the -flanks -of -the -toy -mountains -and -they -flock -down -nights -and -raid -the -sugar -fields -also -on -other -estates -they -come -down -and -destroy -a -sort -of -bean -crop -just -for -fun -apparently -tear -off -the -pods -and -throw -them -down -the -cyclone -of -1892 -tore -down -two -great -blocks -of -stone -buildings -in -the -center -of -port -louis -the -chief -architectural -feature -and -left -the -uncomely -and -apparently -frail -blocks -standing -everywhere -in -its -track -it -annihilated -houses -tore -off -roofs -destroyed -trees -and -crops -the -men -were -in -the -towns -the -women -and -children -at -home -in -the -country -getting -crippled -killed -frightened -to -insanity -and -the -rain -deluging -them -the -wind -howling -the -thunder -crashing -the -lightning -glaring -this -for -an -hour -or -so -then -a -lull -and -sunshine -many -ventured -out -of -safe -shelter -then -suddenly -here -it -came -again -from -the -opposite -point -and -renewed -and -completed -the -devastation -it -is -said -the -chinese -fed -the -sufferers -for -days -on -free -rice -whole -streets -in -port -louis -were -laid -flat -wrecked -during -a -minute -and -a -half -the -wind -blew -123 -miles -an -hour -no -official -record -made -after -that -when -it -may -have -reached -150 -it -cut -down -an -obelisk -it -carried -an -american -ship -into -the -woods -after -breaking -the -chains -of -two -anchors -they -now -use -four -two -forward -two -astern -common -report -says -it -killed -1 -200 -in -port -louis -alone -in -half -an -hour -then -came -the -lull -of -the -central -calm -people -did -not -know -the -barometer -was -still -going -down -then -suddenly -all -perdition -broke -loose -again -while -people -were -rushing -around -seeking -friends -and -rescuing -the -wounded -the -noise -was -comparable -to -nothing -there -is -nothing -resembling -it -but -thunder -and -cannon -and -these -are -feeble -in -comparison -what -there -is -of -mauritius -is -beautiful -you -have -undulating -wide -expanses -of -sugar -cane -a -fine -fresh -green -and -very -pleasant -to -the -eye -and -everywhere -else -you -have -a -ragged -luxuriance -of -tropic -vegetation -of -vivid -greens -of -varying -shades -a -wild -tangle -of -underbrush -with -graceful -tall -palms -lifting -their -crippled -plumes -high -above -it -and -you -have -stretches -of -shady -dense -forest -with -limpid -streams -frolicking -through -them -continually -glimpsed -and -lost -and -glimpsed -again -in -the -pleasantest -hide -and -seek -fashion -and -you -have -some -tiny -mountains -some -quaint -and -picturesque -groups -of -toy -peaks -and -a -dainty -little -vest -pocket -matterhorn -and -here -and -there -and -now -and -then -a -strip -of -sea -with -a -white -ruffle -of -surf -breaks -into -the -view -that -is -mauritius -and -pretty -enough -the -details -are -few -the -massed -result -is -charming -but -not -imposing -not -riotous -not -exciting -it -is -a -sunday -landscape -perspective -and -the -enchantments -wrought -by -distance -are -wanting -there -are -no -distances -there -is -no -perspective -so -to -speak -fifteen -miles -as -the -crow -flies -is -the -usual -limit -of -vision -mauritius -is -a -garden -and -a -park -combined -it -affects -one's -emotions -as -parks -and -gardens -affect -them -the -surfaces -of -one's -spiritual -deeps -are -pleasantly -played -upon -the -deeps -themselves -are -not -reached -not -stirred -spaciousness -remote -altitudes -the -sense -of -mystery -which -haunts -apparently -inaccessible -mountain -domes -and -summits -reposing -in -the -sky -these -are -the -things -which -exalt -the -spirit -and -move -it -to -see -visions -and -dream -dreams -the -sandwich -islands -remain -my -ideal -of -the -perfect -thing -in -the -matter -of -tropical -islands -i -would -add -another -story -to -mauna -loa's -16 -000 -feet -if -i -could -and -make -it -particularly -bold -and -steep -and -craggy -and -forbidding -and -snowy -and -i -would -make -the -volcano -spout -its -lava -floods -out -of -its -summit -instead -of -its -sides -but -aside -from -these -non -essentials -i -have -no -corrections -to -suggest -i -hope -these -will -be -attended -to -i -do -not -wish -to -have -to -speak -of -it -again -chapter -lxiv -when -your -watch -gets -out -of -order -you -have -choice -of -two -things -to -do -throw -it -in -the -fire -or -take -it -to -the -watch -tinker -the -former -is -the -quickest -pudd'nhead -wilson's -new -calendar -the -arundel -castle -is -the -finest -boat -i -have -seen -in -these -seas -she -is -thoroughly -modern -and -that -statement -covers -a -great -deal -of -ground -she -has -the -usual -defect -the -common -defect -the -universal -defect -the -defect -that -has -never -been -missing -from -any -ship -that -ever -sailed -she -has -imperfect -beds -many -ships -have -good -beds -but -no -ship -has -very -good -ones -in -the -matter -of -beds -all -ships -have -been -badly -edited -ignorantly -edited -from -the -beginning -the -selection -of -the -beds -is -given -to -some -hearty -strong -backed -self -made -man -when -it -ought -to -be -given -to -a -frail -woman -accustomed -from -girlhood -to -backaches -and -insomnia -nothing -is -so -rare -on -either -side -of -the -ocean -as -a -perfect -bed -nothing -is -so -difficult -to -make -some -of -the -hotels -on -both -sides -provide -it -but -no -ship -ever -does -or -ever -did -in -noah's -ark -the -beds -were -simply -scandalous -noah -set -the -fashion -and -it -will -endure -in -one -degree -of -modification -or -another -till -the -next -flood -8 -a -m -passing -isle -de -bourbon -broken -up -sky -line -of -volcanic -mountains -in -the -middle -surely -it -would -not -cost -much -to -repair -them -and -it -seems -inexcusable -neglect -to -leave -them -as -they -are -it -seems -stupid -to -send -tired -men -to -europe -to -rest -it -is -no -proper -rest -for -the -mind -to -clatter -from -town -to -town -in -the -dust -and -cinders -and -examine -galleries -and -architecture -and -be -always -meeting -people -and -lunching -and -teaing -and -dining -and -receiving -worrying -cables -and -letters -and -a -sea -voyage -on -the -atlantic -is -of -no -use -voyage -too -short -sea -too -rough -the -peaceful -indian -and -pacific -oceans -and -the -long -stretches -of -time -are -the -healing -thing -may -2 -am -a -fair -great -ship -in -sight -almost -the -first -we -have -seen -in -these -weeks -of -lonely -voyaging -we -are -now -in -the -mozambique -channel -between -madagascar -and -south -africa -sailing -straight -west -for -delagoa -bay -last -night -the -burly -chief -engineer -middle -aged -was -standing -telling -a -spirited -seafaring -tale -and -had -reached -the -most -exciting -place -where -a -man -overboard -was -washing -swiftly -astern -on -the -great -seas -and -uplifting -despairing -cries -everybody -racing -aft -in -a -frenzy -of -excitement -and -fading -hope -when -the -band -which -had -been -silent -a -moment -began -impressively -its -closing -piece -the -english -national -anthem -as -simply -as -if -he -was -unconscious -of -what -he -was -doing -he -stopped -his -story -uncovered -laid -his -laced -cap -against -his -breast -and -slightly -bent -his -grizzled -head -the -few -bars -finished -he -put -on -his -cap -and -took -up -his -tale -again -as -naturally -as -if -that -interjection -of -music -had -been -a -part -of -it -there -was -something -touching -and -fine -about -it -and -it -was -moving -to -reflect -that -he -was -one -of -a -myriad -scattered -over -every -part -of -the -globe -who -by -turn -was -doing -as -he -was -doing -every -hour -of -the -twenty -four -those -awake -doing -it -while -the -others -slept -those -impressive -bars -forever -floating -up -out -of -the -various -climes -never -silent -and -never -lacking -reverent -listeners -all -that -i -remember -about -madagascar -is -that -thackeray's -little -billie -went -up -to -the -top -of -the -mast -and -there -knelt -him -upon -his -knee -saying -i -see -jerusalem -and -madagascar -and -north -and -south -amerikee -may -3 -sunday -fifteen -or -twenty -africanders -who -will -end -their -voyage -to -day -and -strike -for -their -several -homes -from -delagoa -bay -to -morrow -sat -up -singing -on -the -afterdeck -in -the -moonlight -till -3 -a -m -good -fun -and -wholesome -and -the -songs -were -clean -songs -and -some -of -them -were -hallowed -by -tender -associations -finally -in -a -pause -a -man -asked -have -you -heard -about -the -fellow -that -kept -a -diary -crossing -the -atlantic -it -was -a -discord -a -wet -blanket -the -men -were -not -in -the -mood -for -humorous -dirt -the -songs -had -carried -them -to -their -homes -and -in -spirit -they -sat -by -those -far -hearthstones -and -saw -faces -and -heard -voices -other -than -those -that -were -about -them -and -so -this -disposition -to -drag -in -an -old -indecent -anecdote -got -no -welcome -nobody -answered -the -poor -man -hadn't -wit -enough -to -see -that -he -had -blundered -but -asked -his -question -again -again -there -was -no -response -it -was -embarrassing -for -him -in -his -confusion -he -chose -the -wrong -course -did -the -wrong -thing -began -the -anecdote -began -it -in -a -deep -and -hostile -stillness -where -had -been -such -life -and -stir -and -warm -comradeship -before -he -delivered -himself -of -the -brief -details -of -the -diary's -first -day -and -did -it -with -some -confidence -and -a -fair -degree -of -eagerness -it -fell -flat -there -was -an -awkward -pause -the -two -rows -of -men -sat -like -statues -there -was -no -movement -no -sound -he -had -to -go -on -there -was -no -other -way -at -least -none -that -an -animal -of -his -calibre -could -think -of -at -the -close -of -each -day's -diary -the -same -dismal -silence -followed -when -at -last -he -finished -his -tale -and -sprung -the -indelicate -surprise -which -is -wont -to -fetch -a -crash -of -laughter -not -a -ripple -of -sound -resulted -it -was -as -if -the -tale -had -been -told -to -dead -men -after -what -seemed -a -long -long -time -somebody -sighed -somebody -else -stirred -in -his -seat -presently -the -men -dropped -into -a -low -murmur -of -confidential -talk -each -with -his -neighbor -and -the -incident -was -closed -there -were -indications -that -that -man -was -fond -of -his -anecdote -that -it -was -his -pet -his -standby -his -shot -that -never -missed -his -reputation -maker -but -he -will -never -tell -it -again -no -doubt -he -will -think -of -it -sometimes -for -that -cannot -well -be -helped -and -then -he -will -see -a -picture -and -always -the -same -picture -the -double -rank -of -dead -men -the -vacant -deck -stretching -away -in -dimming -perspective -beyond -them -the -wide -desert -of -smooth -sea -all -abroad -the -rim -of -the -moon -spying -from -behind -a -rag -of -black -cloud -the -remote -top -of -the -mizzenmast -shearing -a -zigzag -path -through -the -fields -of -stars -in -the -deeps -of -space -and -this -soft -picture -will -remind -him -of -the -time -that -he -sat -in -the -midst -of -it -and -told -his -poor -little -tale -and -felt -so -lonesome -when -he -got -through -fifty -indians -and -chinamen -asleep -in -a -big -tent -in -the -waist -of -the -ship -forward -they -lie -side -by -side -with -no -space -between -the -former -wrapped -up -head -and -all -as -in -the -indian -streets -the -chinamen -uncovered -the -lamp -and -things -for -opium -smoking -in -the -center -a -passenger -said -it -was -ten -2 -ton -truck -loads -of -dynamite -that -lately -exploded -at -johannesburg -hundreds -killed -he -doesn't -know -how -many -limbs -picked -up -for -miles -around -glass -shattered -and -roofs -swept -away -or -collapsed -200 -yards -off -fragment -of -iron -flung -three -and -a -half -miles -it -occurred -at -3 -p -m -at -6 -l65 -000 -had -been -subscribed -when -this -passenger -left -l35 -000 -had -been -voted -by -city -and -state -governments -and -l100 -000 -by -citizens -and -business -corporations -when -news -of -the -disaster -was -telephoned -to -the -exchange -l35 -000 -were -subscribed -in -the -first -five -minutes -subscribing -was -still -going -on -when -he -left -the -papers -had -ceased -the -names -only -the -amounts -too -many -names -not -enough -room -l100 -000 -subscribed -by -companies -and -citizens -if -this -is -true -it -must -be -what -they -call -in -australia -a -record -the -biggest -instance -of -a -spontaneous -outpour -for -charity -in -history -considering -the -size -of -the -population -it -was -drawn -from -$8 -or -$10 -for -each -white -resident -babies -at -the -breast -included -monday -may -4 -steaming -slowly -in -the -stupendous -delagoa -bay -its -dim -arms -stretching -far -away -and -disappearing -on -both -sides -it -could -furnish -plenty -of -room -for -all -the -ships -in -the -world -but -it -is -shoal -the -lead -has -given -us -3 -1/2 -fathoms -several -times -and -we -are -drawing -that -lacking -6 -inches -a -bold -headland -precipitous -wall -150 -feet -high -very -strong -red -color -stretching -a -mile -or -so -a -man -said -it -was -portuguese -blood -battle -fought -here -with -the -natives -last -year -i -think -this -doubtful -pretty -cluster -of -houses -on -the -tableland -above -the -red -and -rolling -stretches -of -grass -and -groups -of -trees -like -england -the -portuguese -have -the -railroad -one -passenger -train -a -day -to -the -border -70 -miles -then -the -netherlands -company -have -it -thousands -of -tons -of -freight -on -the -shore -no -cover -this -is -portuguese -allover -indolence -piousness -poverty -impotence -crews -of -small -boats -and -tugs -all -jet -black -woolly -heads -and -very -muscular -winter -the -south -african -winter -is -just -beginning -now -but -nobody -but -an -expert -can -tell -it -from -summer -however -i -am -tired -of -summer -we -have -had -it -unbroken -for -eleven -months -we -spent -the -afternoon -on -shore -delagoa -bay -a -small -town -no -sights -no -carriages -three -'rickshas -but -we -couldn't -get -them -apparently -private -these -portuguese -are -a -rich -brown -like -some -of -the -indians -some -of -the -blacks -have -the -long -horse -beads -and -very -long -chins -of -the -negroes -of -the -picture -books -but -most -of -them -are -exactly -like -the -negroes -of -our -southern -states -round -faces -flat -noses -good -natured -and -easy -laughers -flocks -of -black -women -passed -along -carrying -outrageously -heavy -bags -of -freight -on -their -heads -the -quiver -of -their -leg -as -the -foot -was -planted -and -the -strain -exhibited -by -their -bodies -showed -what -a -tax -upon -their -strength -the -load -was -they -were -stevedores -and -doing -full -stevedores -work -they -were -very -erect -when -unladden -from -carrying -heavy -loads -on -their -heads -just -like -the -indian -women -it -gives -them -a -proud -fine -carriage -sometimes -one -saw -a -woman -carrying -on -her -head -a -laden -and -top -heavy -basket -the -shape -of -an -inverted -pyramid -its -top -the -size -of -a -soup -plate -its -base -the -diameter -of -a -teacup -it -required -nice -balancing -and -got -it -no -bright -colors -yet -there -were -a -good -many -hindoos -the -second -class -passenger -came -over -as -usual -at -lights -out -11 -and -we -lounged -along -the -spacious -vague -solitudes -of -the -deck -and -smoked -the -peaceful -pipe -and -talked -he -told -me -an -incident -in -mr -barnum's -life -which -was -evidently -characteristic -of -that -great -showman -in -several -ways -this -was -barnum's -purchase -of -shakespeare's -birthplace -a -quarter -of -a -century -ago -the -second -class -passenger -was -in -jamrach's -employ -at -the -time -and -knew -barnum -well -he -said -the -thing -began -in -this -way -one -morning -barnum -and -jamrach -were -in -jamrach's -little -private -snuggery -back -of -the -wilderness -of -caged -monkeys -and -snakes -and -other -commonplaces -of -jamrach's -stock -in -trade -refreshing -themselves -after -an -arduous -stroke -of -business -jamrach -with -something -orthodox -barnum -with -something -heterodox -for -barnum -was -a -teetotaler -the -stroke -of -business -was -in -the -elephant -line -jamrach -had -contracted -to -deliver -to -barnum -in -new -york -18 -elephants -for -$360 -000 -in -time -for -the -next -season's -opening -then -it -occurred -to -mr -barnum -that -he -needed -a -card -he -suggested -jumbo -jamrach -said -he -would -have -to -think -of -something -else -jumbo -couldn't -be -had -the -zoo -wouldn't -part -with -that -elephant -barnum -said -he -was -willing -to -pay -a -fortune -for -jumbo -if -he -could -get -him -jamrach -said -it -was -no -use -to -think -about -it -that -jumbo -was -as -popular -as -the -prince -of -wales -and -the -zoo -wouldn't -dare -to -sell -him -all -england -would -be -outraged -at -the -idea -jumbo -was -an -english -institution -he -was -part -of -the -national -glory -one -might -as -well -think -of -buying -the -nelson -monument -barnum -spoke -up -with -vivacity -and -said -it's -a -first -rate -idea -i'll -buy -the -monument -jamrach -was -speechless -for -a -second -then -he -said -like -one -ashamed -you -caught -me -i -was -napping -for -a -moment -i -thought -you -were -in -earnest -barnum -said -pleasantly -i -was -in -earnest -i -know -they -won't -sell -it -but -no -matter -i -will -not -throw -away -a -good -idea -for -all -that -all -i -want -is -a -big -advertisement -i -will -keep -the -thing -in -mind -and -if -nothing -better -turns -up -i -will -offer -to -buy -it -that -will -answer -every -purpose -it -will -furnish -me -a -couple -of -columns -of -gratis -advertising -in -every -english -and -american -paper -for -a -couple -of -months -and -give -my -show -the -biggest -boom -a -show -ever -had -in -this -world -jamrach -started -to -deliver -a -burst -of -admiration -but -was -interrupted -by -barnum -who -said -here -is -a -state -of -things! -england -ought -to -blush -his -eye -had -fallen -upon -something -in -the -newspaper -he -read -it -through -to -himself -then -read -it -aloud -it -said -that -the -house -that -shakespeare -was -born -in -at -stratford -on -avon -was -falling -gradually -to -ruin -through -neglect -that -the -room -where -the -poet -first -saw -the -light -was -now -serving -as -a -butcher's -shop -that -all -appeals -to -england -to -contribute -money -the -requisite -sum -stated -to -buy -and -repair -the -house -and -place -it -in -the -care -of -salaried -and -trustworthy -keepers -had -fallen -resultless -then -barnum -said -there's -my -chance -let -jumbo -and -the -monument -alone -for -the -present -they'll -keep -i'll -buy -shakespeare's -house -i'll -set -it -up -in -my -museum -in -new -york -and -put -a -glass -case -around -it -and -make -a -sacred -thing -of -it -and -you'll -see -all -america -flock -there -to -worship -yes -and -pilgrims -from -the -whole -earth -and -i'll -make -them -take -their -hats -off -too -in -america -we -know -how -to -value -anything -that -shakespeare's -touch -has -made -holy -you'll -see -in -conclusion -the -s -c -p -said -that -is -the -way -the -thing -came -about -barnum -did -buy -shakespeare's -house -he -paid -the -price -asked -and -received -the -properly -attested -documents -of -sale -then -there -was -an -explosion -i -can -tell -you -england -rose! -that -the -birthplace -of -the -master -genius -of -all -the -ages -and -all -the -climes -that -priceless -possession -of -britain -to -be -carted -out -of -the -country -like -so -much -old -lumber -and -set -up -for -sixpenny -desecration -in -a -yankee -show -shop -the -idea -was -not -to -be -tolerated -for -a -moment -england -rose -in -her -indignation -and -barnum -was -glad -to -relinquish -his -prize -and -offer -apologies -however -he -stood -out -for -a -compromise -he -claimed -a -concession -england -must -let -him -have -jumbo -and -england -consented -but -not -cheerfully -it -shows -how -by -help -of -time -a -story -can -grow -even -after -barnum -has -had -the -first -innings -in -the -telling -of -it -mr -barnum -told -me -the -story -himself -years -ago -he -said -that -the -permission -to -buy -jumbo -was -not -a -concession -the -purchase -was -made -and -the -animal -delivered -before -the -public -knew -anything -about -it -also -that -the -securing -of -jumbo -was -all -the -advertisement -he -needed -it -produced -many -columns -of -newspaper -talk -free -of -cost -and -he -was -satisfied -he -said -that -if -he -had -failed -to -get -jumbo -he -would -have -caused -his -notion -of -buying -the -nelson -monument -to -be -treacherously -smuggled -into -print -by -some -trusty -friend -and -after -he -had -gotten -a -few -hundred -pages -of -gratuitous -advertising -out -of -it -he -would -have -come -out -with -a -blundering -obtuse -but -warm -hearted -letter -of -apology -and -in -a -postscript -to -it -would -have -naively -proposed -to -let -the -monument -go -and -take -stonehenge -in -place -of -it -at -the -same -price -it -was -his -opinion -that -such -a -letter -written -with -well -simulated -asinine -innocence -and -gush -would -have -gotten -his -ignorance -and -stupidity -an -amount -of -newspaper -abuse -worth -six -fortunes -to -him -and -not -purchasable -for -twice -the -money -i -knew -mr -barnum -well -and -i -placed -every -confidence -in -the -account -which -he -gave -me -of -the -shakespeare -birthplace -episode -he -said -he -found -the -house -neglected -and -going -to -decay -and -he -inquired -into -the -matter -and -was -told -that -many -times -earnest -efforts -had -been -made -to -raise -money -for -its -proper -repair -and -preservation -but -without -success -he -then -proposed -to -buy -it -the -proposition -was -entertained -and -a -price -named -$50 -000 -i -think -but -whatever -it -was -barnum -paid -the -money -down -without -remark -and -the -papers -were -drawn -up -and -executed -he -said -that -it -had -been -his -purpose -to -set -up -the -house -in -his -museum -keep -it -in -repair -protect -it -from -name -scribblers -and -other -desecrators -and -leave -it -by -bequest -to -the -safe -and -perpetual -guardianship -of -the -smithsonian -institute -at -washington -but -as -soon -as -it -was -found -that -shakespeare's -house -had -passed -into -foreign -hands -and -was -going -to -be -carried -across -the -ocean -england -was -stirred -as -no -appeal -from -the -custodians -of -the -relic -had -ever -stirred -england -before -and -protests -came -flowing -in -and -money -too -to -stop -the -outrage -offers -of -repurchase -were -made -offers -of -double -the -money -that -mr -barnum -had -paid -for -the -house -he -handed -the -house -back -but -took -only -the -sum -which -it -had -cost -him -but -on -the -condition -that -an -endowment -sufficient -for -the -future -safeguarding -and -maintenance -of -the -sacred -relic -should -be -raised -this -condition -was -fulfilled -that -was -barnum's -account -of -the -episode -and -to -the -end -of -his -days -he -claimed -with -pride -and -satisfaction -that -not -england -but -america -represented -by -him -saved -the -birthplace -of -shakespeare -from -destruction -at -3 -p -m -may -6th -the -ship -slowed -down -off -the -land -and -thoughtfully -and -cautiously -picked -her -way -into -the -snug -harbor -of -durban -south -africa -chapter -lxv -in -statesmanship -get -the -formalities -right -never -mind -about -the -moralities -pudd'nhead -wilson's -new -calendar -from -diary -royal -hotel -comfortable -good -table -good -service -of -natives -and -madrasis -curious -jumble -of -modern -and -ancient -city -and -village -primitiveness -and -the -other -thing -electric -bells -but -they -don't -ring -asked -why -they -didn't -the -watchman -in -the -office -said -he -thought -they -must -be -out -of -order -he -thought -so -because -some -of -them -rang -but -most -of -them -didn't -wouldn't -it -be -a -good -idea -to -put -them -in -order -he -hesitated -like -one -who -isn't -quite -sure -then -conceded -the -point -may -7 -a -bang -on -the -door -at -6 -did -i -want -my -boots -cleaned -fifteen -minutes -later -another -bang -did -we -want -coffee -fifteen -later -bang -again -my -wife's -bath -ready -15 -later -my -bath -ready -two -other -bangs -i -forget -what -they -were -about -then -lots -of -shouting -back -and -forth -among -the -servants -just -as -in -an -indian -hotel -evening -at -4 -p -m -it -was -unpleasantly -warm -half -hour -after -sunset -one -needed -a -spring -overcoat -by -8 -a -winter -one -durban -is -a -neat -and -clean -town -one -notices -that -without -having -his -attention -called -to -it -rickshaws -drawn -by -splendidly -built -black -zulus -so -overflowing -with -strength -seemingly -that -it -is -a -pleasure -not -a -pain -to -see -them -snatch -a -rickshaw -along -they -smile -and -laugh -and -show -their -teeth -a -good -natured -lot -not -allowed -to -drink -2s -per -hour -for -one -person -3s -for -two -3d -for -a -course -one -person -the -chameleon -in -the -hotel -court -he -is -fat -and -indolent -and -contemplative -but -is -business -like -and -capable -when -a -fly -comes -about -reaches -out -a -tongue -like -a -teaspoon -and -takes -him -in -he -gums -his -tongue -first -he -is -always -pious -in -his -looks -and -pious -and -thankful -both -when -providence -or -one -of -us -sends -him -a -fly -he -has -a -froggy -head -and -a -back -like -a -new -grave -for -shape -and -hands -like -a -bird's -toes -that -have -been -frostbitten -but -his -eyes -are -his -exhibition -feature -a -couple -of -skinny -cones -project -from -the -sides -of -his -head -with -a -wee -shiny -bead -of -an -eye -set -in -the -apex -of -each -and -these -cones -turn -bodily -like -pivot -guns -and -point -every -which -way -and -they -are -independent -of -each -other -each -has -its -own -exclusive -machinery -when -i -am -behind -him -and -c -in -front -of -him -he -whirls -one -eye -rearwards -and -the -other -forwards -which -gives -him -a -most -congressional -expression -one -eye -on -the -constituency -and -one -on -the -swag -and -then -if -something -happens -above -and -below -him -he -shoots -out -one -eye -upward -like -a -telescope -and -the -other -downward -and -this -changes -his -expression -but -does -not -improve -it -natives -must -not -be -out -after -the -curfew -bell -without -a -pass -in -natal -there -are -ten -blacks -to -one -white -sturdy -plump -creatures -are -the -women -they -comb -their -wool -up -to -a -peak -and -keep -it -in -position -by -stiffening -it -with -brown -red -clay -half -of -this -tower -colored -denotes -engagement -the -whole -of -it -colored -denotes -marriage -none -but -heathen -zulus -on -the -police -christian -ones -not -allowed -may -9 -a -drive -yesterday -with -friends -over -the -berea -very -fine -roads -and -lofty -overlooking -the -whole -town -the -harbor -and -the -sea -beautiful -views -residences -all -along -set -in -the -midst -of -green -lawns -with -shrubs -and -generally -one -or -two -intensely -red -outbursts -of -poinsettia -the -flaming -splotch -of -blinding -red -a -stunning -contrast -with -the -world -of -surrounding -green -the -cactus -tree -candelabrum -like -and -one -twisted -like -gray -writhing -serpents -the -flat -crown -should -be -flat -roof -half -a -dozen -naked -branches -full -of -elbows -slant -upward -like -artificial -supports -and -fling -a -roof -of -delicate -foliage -out -in -a -horizontal -platform -as -flat -as -a -floor -and -you -look -up -through -this -thin -floor -as -through -a -green -cobweb -or -veil -the -branches -are -japanesich -all -about -you -is -a -bewildering -variety -of -unfamiliar -and -beautiful -trees -one -sort -wonderfully -dense -foliage -and -very -dark -green -so -dark -that -you -notice -it -at -once -notwithstanding -there -are -so -many -orange -trees -the -flamboyant -not -in -flower -now -but -when -in -flower -lives -up -to -its -name -we -are -told -another -tree -with -a -lovely -upright -tassel -scattered -among -its -rich -greenery -red -and -glowing -as -a -firecoal -here -and -there -a -gum -tree -half -a -dozen -lofty -norfolk -island -pines -lifting -their -fronded -arms -skyward -groups -of -tall -bamboo -saw -one -bird -not -many -birds -here -and -they -have -no -music -and -the -flowers -not -much -smell -they -grow -so -fast -everything -neat -and -trim -and -clean -like -the -town -the -loveliest -trees -and -the -greatest -variety -i -have -ever -seen -anywhere -except -approaching -darjeeling -have -not -heard -anyone -call -natal -the -garden -of -south -africa -but -that -is -what -it -probably -is -it -was -when -bishop -of -natal -that -colenso -raised -such -a -storm -in -the -religious -world -the -concerns -of -religion -are -a -vital -matter -here -yet -a -vigilant -eye -is -kept -upon -sunday -museums -and -other -dangerous -resorts -are -not -allowed -to -be -open -you -may -sail -on -the -bay -but -it -is -wicked -to -play -cricket -for -a -while -a -sunday -concert -was -tolerated -upon -condition -that -it -must -be -admission -free -and -the -money -taken -by -collection -but -the -collection -was -alarmingly -large -and -that -stopped -the -matter -they -are -particular -about -babies -a -clergyman -would -not -bury -a -child -according -to -the -sacred -rites -because -it -had -not -been -baptized -the -hindoo -is -more -liberal -he -burns -no -child -under -three -holding -that -it -does -not -need -purifying -the -king -of -the -zulus -a -fine -fellow -of -30 -was -banished -six -years -ago -for -a -term -of -seven -years -he -is -occupying -napoleon's -old -stand -st -helena -the -people -are -a -little -nervous -about -having -him -come -back -and -they -may -well -be -for -zulu -kings -have -been -terrible -people -sometimes -like -tchaka -dingaan -and -cetewayo -there -is -a -large -trappist -monastery -two -hours -from -durban -over -the -country -roads -and -in -company -with -mr -milligan -and -mr -hunter -general -manager -of -the -natal -government -railways -who -knew -the -heads -of -it -we -went -out -to -see -it -there -it -all -was -just -as -one -reads -about -it -in -books -and -cannot -believe -that -it -is -so -i -mean -the -rough -hard -work -the -impossible -hours -the -scanty -food -the -coarse -raiment -the -maryborough -beds -the -tabu -of -human -speech -of -social -intercourse -of -relaxation -of -amusement -of -entertainment -of -the -presence -of -woman -in -the -men's -establishment -there -it -all -was -it -was -not -a -dream -it -was -not -a -lie -and -yet -with -the -fact -before -one's -face -it -was -still -incredible -it -is -such -a -sweeping -suppression -of -human -instincts -such -an -extinction -of -the -man -as -an -individual -la -trappe -must -have -known -the -human -race -well -the -scheme -which -he -invented -hunts -out -everything -that -a -man -wants -and -values -and -withholds -it -from -him -apparently -there -is -no -detail -that -can -help -make -life -worth -living -that -has -not -been -carefully -ascertained -and -placed -out -of -the -trappist's -reach -la -trappe -must -have -known -that -there -were -men -who -would -enjoy -this -kind -of -misery -but -how -did -he -find -it -out -if -he -had -consulted -you -or -me -he -would -have -been -told -that -his -scheme -lacked -too -many -attractions -that -it -was -impossible -that -it -could -never -be -floated -but -there -in -the -monastery -was -proof -that -he -knew -the -human -race -better -than -it -knew -itself -he -set -his -foot -upon -every -desire -that -a -man -has -yet -he -floated -his -project -and -it -has -prospered -for -two -hundred -years -and -will -go -on -prospering -forever -no -doubt -man -likes -personal -distinction -there -in -the -monastery -it -is -obliterated -he -likes -delicious -food -there -he -gets -beans -and -bread -and -tea -and -not -enough -of -it -he -likes -to -lie -softly -there -he -lies -on -a -sand -mattress -and -has -a -pillow -and -a -blanket -but -no -sheet -when -he -is -dining -in -a -great -company -of -friends -he -likes -to -laugh -and -chat -there -a -monk -reads -a -holy -book -aloud -during -meals -and -nobody -speaks -or -laughs -when -a -man -has -a -hundred -friends -about -him -evenings -be -likes -to -have -a -good -time -and -run -late -there -he -and -the -rest -go -silently -to -bed -at -8 -and -in -the -dark -too -there -is -but -a -loose -brown -robe -to -discard -there -are -no -night -clothes -to -put -on -a -light -is -not -needed -man -likes -to -lie -abed -late -there -he -gets -up -once -or -twice -in -the -night -to -perform -some -religious -office -and -gets -up -finally -for -the -day -at -two -in -the -morning -man -likes -light -work -or -none -at -all -there -he -labors -all -day -in -the -field -or -in -the -blacksmith -shop -or -the -other -shops -devoted -to -the -mechanical -trades -such -as -shoemaking -saddlery -carpentry -and -so -on -man -likes -the -society -of -girls -and -women -there -he -never -has -it -he -likes -to -have -his -children -about -him -and -pet -them -and -play -with -them -there -he -has -none -he -likes -billiards -there -is -no -table -there -he -likes -outdoor -sports -and -indoor -dramatic -and -musical -and -social -entertainments -there -are -none -there -he -likes -to -bet -on -things -i -was -told -that -betting -is -forbidden -there -when -a -man's -temper -is -up -he -likes -to -pour -it -out -upon -somebody -there -this -is -not -allowed -a -man -likes -animals -pets -there -are -none -there -he -likes -to -smoke -there -he -cannot -do -it -he -likes -to -read -the -news -no -papers -or -magazines -come -there -a -man -likes -to -know -how -his -parents -and -brothers -and -sisters -are -getting -along -when -he -is -away -and -if -they -miss -him -there -he -cannot -know -a -man -likes -a -pretty -house -and -pretty -furniture -and -pretty -things -and -pretty -colors -there -he -has -nothing -but -naked -aridity -and -sombre -colors -a -man -likes -name -it -yourself -whatever -it -is -it -is -absent -from -that -place -from -what -i -could -learn -all -that -a -man -gets -for -this -is -merely -the -saving -of -his -soul -it -all -seems -strange -incredible -impossible -but -la -trappe -knew -the -race -he -knew -the -powerful -attraction -of -unattractiveness -he -knew -that -no -life -could -be -imagined -howsoever -comfortless -and -forbidding -but -somebody -would -want -to -try -it -this -parent -establishment -of -germans -began -its -work -fifteen -years -ago -strangers -poor -and -unencouraged -it -owns -15 -000 -acres -of -land -now -and -raises -grain -and -fruit -and -makes -wines -and -manufactures -all -manner -of -things -and -has -native -apprentices -in -its -shops -and -sends -them -forth -able -to -read -and -write -and -also -well -equipped -to -earn -their -living -by -their -trades -and -this -young -establishment -has -set -up -eleven -branches -in -south -africa -and -in -them -they -are -christianizing -and -educating -and -teaching -wage -yielding -mechanical -trades -to -1 -200 -boys -and -girls -protestant -missionary -work -is -coldly -regarded -by -the -commercial -white -colonist -all -over -the -heathen -world -as -a -rule -and -its -product -is -nicknamed -rice -christians -occupationless -incapables -who -join -the -church -for -revenue -only -but -i -think -it -would -be -difficult -to -pick -a -flaw -in -the -work -of -these -catholic -monks -and -i -believe -that -the -disposition -to -attempt -it -has -not -shown -itself -tuesday -may -12 -transvaal -politics -in -a -confused -condition -first -the -sentencing -of -the -johannesburg -reformers -startled -england -by -its -severity -on -the -top -of -this -came -kruger's -exposure -of -the -cipher -correspondence -which -showed -that -the -invasion -of -the -transvaal -with -the -design -of -seizing -that -country -and -adding -it -to -the -british -empire -was -planned -by -cecil -rhodes -and -beit -which -made -a -revulsion -in -english -feeling -and -brought -out -a -storm -against -rhodes -and -the -chartered -company -for -degrading -british -honor -for -a -good -while -i -couldn't -seem -to -get -at -a -clear -comprehension -of -it -it -was -so -tangled -but -at -last -by -patient -study -i -have -managed -it -i -believe -as -i -understand -it -the -uitlanders -and -other -dutchmen -were -dissatisfied -because -the -english -would -not -allow -them -to -take -any -part -in -the -government -except -to -pay -taxes -next -as -i -understand -it -dr -kruger -and -dr -jameson -not -having -been -able -to -make -the -medical -business -pay -made -a -raid -into -matabeleland -with -the -intention -of -capturing -the -capital -johannesburg -and -holding -the -women -and -children -to -ransom -until -the -uitlanders -and -the -other -boers -should -grant -to -them -and -the -chartered -company -the -political -rights -which -had -been -withheld -from -them -they -would -have -succeeded -in -this -great -scheme -as -i -understand -it -but -for -the -interference -of -cecil -rhodes -and -mr -beit -and -other -chiefs -of -the -matabele -who -persuaded -their -countrymen -to -revolt -and -throw -off -their -allegiance -to -germany -this -in -turn -as -i -understand -it -provoked -the -king -of -abyssinia -to -destroy -the -italian -army -and -fall -back -upon -johannesburg -this -at -the -instigation -of -rhodes -to -bull -the -stock -market -chapter -lxvi -every -one -is -a -moon -and -has -a -dark -side -which -he -never -shows -to -anybody -pudd'nhead -wilson's -new -calendar -when -i -scribbled -in -my -note -book -a -year -ago -the -paragraph -which -ends -the -preceding -chapter -it -was -meant -to -indicate -in -an -extravagant -form -two -things -the -conflicting -nature -of -the -information -conveyed -by -the -citizen -to -the -stranger -concerning -south -african -politics -and -the -resulting -confusion -created -in -the -stranger's -mind -thereby -but -it -does -not -seem -so -very -extravagant -now -nothing -could -in -that -disturbed -and -excited -time -make -south -african -politics -clear -or -quite -rational -to -the -citizen -of -the -country -because -his -personal -interest -and -his -political -prejudices -were -in -his -way -and -nothing -could -make -those -politics -clear -or -rational -to -the -stranger -the -sources -of -his -information -being -such -as -they -were -i -was -in -south -africa -some -little -time -when -i -arrived -there -the -political -pot -was -boiling -fiercely -four -months -previously -jameson -had -plunged -over -the -transvaal -border -with -about -600 -armed -horsemen -at -his -back -to -go -to -the -relief -of -the -women -and -children -of -johannesburg -on -the -fourth -day -of -his -march -the -boers -had -defeated -him -in -battle -and -carried -him -and -his -men -to -pretoria -the -capital -as -prisoners -the -boer -government -had -turned -jameson -and -his -officers -over -to -the -british -government -for -trial -and -shipped -them -to -england -next -it -had -arrested -64 -important -citizens -of -johannesburg -as -raid -conspirators -condemned -their -four -leaders -to -death -then -commuted -the -sentences -and -now -the -64 -were -waiting -in -jail -for -further -results -before -midsummer -they -were -all -out -excepting -two -who -refused -to -sign -the -petitions -for -release -58 -had -been -fined -$10 -000 -each -and -enlarged -and -the -four -leaders -had -gotten -off -with -fines -of -$125 -000 -each -with -permanent -exile -added -in -one -case -those -were -wonderfully -interesting -days -for -a -stranger -and -i -was -glad -to -be -in -the -thick -of -the -excitement -everybody -was -talking -and -i -expected -to -understand -the -whole -of -one -side -of -it -in -a -very -little -while -i -was -disappointed -there -were -singularities -perplexities -unaccountabilities -about -it -which -i -was -not -able -to -master -i -had -no -personal -access -to -boers -their -side -was -a -secret -to -me -aside -from -what -i -was -able -to -gather -of -it -from -published -statements -my -sympathies -were -soon -with -the -reformers -in -the -pretoria -jail -with -their -friends -and -with -their -cause -by -diligent -inquiry -in -johannesburg -i -found -out -apparently -all -the -details -of -their -side -of -the -quarrel -except -one -what -they -expected -to -accomplish -by -an -armed -rising -nobody -seemed -to -know -the -reason -why -the -reformers -were -discontented -and -wanted -some -changes -made -seemed -quite -clear -in -johannesburg -it -was -claimed -that -the -uitlanders -strangers -foreigners -paid -thirteen -fifteenths -of -the -transvaal -taxes -yet -got -little -or -nothing -for -it -their -city -had -no -charter -it -had -no -municipal -government -it -could -levy -no -taxes -for -drainage -water -supply -paving -cleaning -sanitation -policing -there -was -a -police -force -but -it -was -composed -of -boers -it -was -furnished -by -the -state -government -and -the -city -had -no -control -over -it -mining -was -very -costly -the -government -enormously -increased -the -cost -by -putting -burdensome -taxes -upon -the -mines -the -output -the -machinery -the -buildings -by -burdensome -imposts -upon -incoming -materials -by -burdensome -railway -freight -charges -hardest -of -all -to -bear -the -government -reserved -to -itself -a -monopoly -in -that -essential -thing -dynamite -and -burdened -it -with -an -extravagant -price -the -detested -hollander -from -over -the -water -held -all -the -public -offices -the -government -was -rank -with -corruption -the -uitlander -had -no -vote -and -must -live -in -the -state -ten -or -twelve -years -before -he -could -get -one -he -was -not -represented -in -the -raad -legislature -that -oppressed -him -and -fleeced -him -religion -was -not -free -there -were -no -schools -where -the -teaching -was -in -english -yet -the -great -majority -of -the -white -population -of -the -state -knew -no -tongue -but -that -the -state -would -not -pass -a -liquor -law -but -allowed -a -great -trade -in -cheap -vile -brandy -among -the -blacks -with -the -result -that -25 -per -cent -of -the -50 -000 -blacks -employed -in -the -mines -were -usually -drunk -and -incapable -of -working -there -it -was -plain -enough -that -the -reasons -for -wanting -some -changes -made -were -abundant -and -reasonable -if -this -statement -of -the -existing -grievances -was -correct -what -the -uitlanders -wanted -was -reform -under -the -existing -republic -what -they -proposed -to -do -was -to -secure -these -reforms -by -prayer -petition -and -persuasion -they -did -petition -also -they -issued -a -manifesto -whose -very -first -note -is -a -bugle -blast -of -loyalty -we -want -the -establishment -of -this -republic -as -a -true -republic -could -anything -be -clearer -than -the -uitlander's -statement -of -the -grievances -and -oppressions -under -which -they -were -suffering -could -anything -be -more -legal -and -citizen -like -and -law -respecting -than -their -attitude -as -expressed -by -their -manifesto -no -those -things -were -perfectly -clear -perfectly -comprehensible -but -at -this -point -the -puzzles -and -riddles -and -confusions -begin -to -flock -in -you -have -arrived -at -a -place -which -you -cannot -quite -understand -for -you -find -that -as -a -preparation -for -this -loyal -lawful -and -in -every -way -unexceptionable -attempt -to -persuade -the -government -to -right -their -grievances -the -uitlanders -had -smuggled -a -maxim -gun -or -two -and -1 -500 -muskets -into -the -town -concealed -in -oil -tanks -and -coal -cars -and -had -begun -to -form -and -drill -military -companies -composed -of -clerks -merchants -and -citizens -generally -what -was -their -idea -did -they -suppose -that -the -boers -would -attack -them -for -petitioning -for -redress -that -could -not -be -did -they -suppose -that -the -boers -would -attack -them -even -for -issuing -a -manifesto -demanding -relief -under -the -existing -government -yes -they -apparently -believed -so -because -the -air -was -full -of -talk -of -forcing -the -government -to -grant -redress -if -it -were -not -granted -peacefully -the -reformers -were -men -of -high -intelligence -if -they -were -in -earnest -they -were -taking -extraordinary -risks -they -had -enormously -valuable -properties -to -defend -their -town -was -full -of -women -and -children -their -mines -and -compounds -were -packed -with -thousands -upon -thousands -of -sturdy -blacks -if -the -boers -attacked -the -mines -would -close -the -blacks -would -swarm -out -and -get -drunk -riot -and -conflagration -and -the -boers -together -might -lose -the -reformers -more -in -a -day -in -money -blood -and -suffering -than -the -desired -political -relief -could -compensate -in -ten -years -if -they -won -the -fight -and -secured -the -reforms -it -is -may -1897 -now -a -year -has -gone -by -and -the -confusions -of -that -day -have -been -to -a -considerable -degree -cleared -away -mr -cecil -rhodes -dr -jameson -and -others -responsible -for -the -raid -have -testified -before -the -parliamentary -committee -of -inquiry -in -london -and -so -have -mr -lionel -phillips -and -other -johannesburg -reformers -monthly -nurses -of -the -revolution -which -was -born -dead -these -testimonies -have -thrown -light -three -books -have -added -much -to -this -light -south -africa -as -it -is -by -mr -statham -an -able -writer -partial -to -the -boers -the -story -of -an -african -crisis -by -mr -garrett -a -brilliant -writer -partial -to -rhodes -and -a -woman's -part -in -a -revolution -by -mrs -john -hays -hammond -a -vigorous -and -vivid -diarist -partial -to -the -reformers -by -liquifying -the -evidence -of -the -prejudiced -books -and -of -the -prejudiced -parliamentary -witnesses -and -stirring -the -whole -together -and -pouring -it -into -my -own -prejudiced -moulds -i -have -got -at -the -truth -of -that -puzzling -south -african -situation -which -is -this -1 -the -capitalists -and -other -chief -men -of -johannesburg -were -fretting -under -various -political -and -financial -burdens -imposed -by -the -state -the -south -african -republic -sometimes -called -the -transvaal -and -desired -to -procure -by -peaceful -means -a -modification -of -the -laws -2 -mr -cecil -rhodes -premier -of -the -british -cape -colony -millionaire -creator -and -managing -director -of -the -territorially -immense -and -financially -unproductive -south -africa -company -projector -of -vast -schemes -for -the -unification -and -consolidation -of -all -the -south -african -states -one -imposing -commonwealth -or -empire -under -the -shadow -and -general -protection -of -the -british -flag -thought -he -saw -an -opportunity -to -make -profitable -use -of -the -uitlander -discontent -above -mentioned -make -the -johannesburg -cat -help -pull -out -one -of -his -consolidation -chestnuts -for -him -with -this -view -he -set -himself -the -task -of -warming -the -lawful -and -legitimate -petitions -and -supplications -of -the -uitlanders -into -seditious -talk -and -their -frettings -into -threatenings -the -final -outcome -to -be -revolt -and -armed -rebellion -if -he -could -bring -about -a -bloody -collision -between -those -people -and -the -boer -government -great -britain -would -have -to -interfere -her -interference -would -be -resisted -by -the -boers -she -would -chastise -them -and -add -the -transvaal -to -her -south -african -possessions -it -was -not -a -foolish -idea -but -a -rational -and -practical -one -after -a -couple -of -years -of -judicious -plotting -mr -rhodes -had -his -reward -the -revolutionary -kettle -was -briskly -boiling -in -johannesburg -and -the -uitlander -leaders -were -backing -their -appeals -to -the -government -now -hardened -into -demands -by -threats -of -force -and -bloodshed -by -the -middle -of -december -1895 -the -explosion -seemed -imminent -mr -rhodes -was -diligently -helping -from -his -distant -post -in -cape -town -he -was -helping -to -procure -arms -for -johannesburg -he -was -also -arranging -to -have -jameson -break -over -the -border -and -come -to -johannesburg -with -600 -mounted -men -at -his -back -jameson -as -per -instructions -from -rhodes -perhaps -wanted -a -letter -from -the -reformers -requesting -him -to -come -to -their -aid -it -was -a -good -idea -it -would -throw -a -considerable -share -of -the -responsibility -of -his -invasion -upon -the -reformers -he -got -the -letter -that -famous -one -urging -him -to -fly -to -the -rescue -of -the -women -and -children -he -got -it -two -months -before -he -flew -the -reformers -seem -to -have -thought -it -over -and -concluded -that -they -had -not -done -wisely -for -the -next -day -after -giving -jameson -the -implicating -document -they -wanted -to -withdraw -it -and -leave -the -women -and -children -in -danger -but -they -were -told -that -it -was -too -late -the -original -had -gone -to -mr -rhodes -at -the -cape -jameson -had -kept -a -copy -though -from -that -time -until -the -29th -of -december -a -good -deal -of -the -reformers' -time -was -taken -up -with -energetic -efforts -to -keep -jameson -from -coming -to -their -assistance -jameson's -invasion -had -been -set -for -the -26th -the -reformers -were -not -ready -the -town -was -not -united -some -wanted -a -fight -some -wanted -peace -some -wanted -a -new -government -some -wanted -the -existing -one -reformed -apparently -very -few -wanted -the -revolution -to -take -place -in -the -interest -and -under -the -ultimate -shelter -of -the -imperial -flag -british -yet -a -report -began -to -spread -that -mr -rhodes's -embarrassing -assistance -had -for -its -end -this -latter -object -jameson -was -away -up -on -the -frontier -tugging -at -his -leash -fretting -to -burst -over -the -border -by -hard -work -the -reformers -got -his -starting -date -postponed -a -little -and -wanted -to -get -it -postponed -eleven -days -apparently -rhodes's -agents -were -seconding -their -efforts -in -fact -wearing -out -the -telegraph -wires -trying -to -hold -him -back -rhodes -was -himself -the -only -man -who -could -have -effectively -postponed -jameson -but -that -would -have -been -a -disadvantage -to -his -scheme -indeed -it -could -spoil -his -whole -two -years' -work -jameson -endured -postponement -three -days -then -resolved -to -wait -no -longer -without -any -orders -excepting -mr -rhodes's -significant -silence -he -cut -the -telegraph -wires -on -the -29th -and -made -his -plunge -that -night -to -go -to -the -rescue -of -the -women -and -children -by -urgent -request -of -a -letter -now -nine -days -old -as -per -date -a -couple -of -months -old -in -fact -he -read -the -letter -to -his -men -and -it -affected -them -it -did -not -affect -all -of -them -alike -some -saw -in -it -a -piece -of -piracy -of -doubtful -wisdom -and -were -sorry -to -find -that -they -had -been -assembled -to -violate -friendly -territory -instead -of -to -raid -native -kraals -as -they -had -supposed -jameson -would -have -to -ride -150 -miles -he -knew -that -there -were -suspicions -abroad -in -the -transvaal -concerning -him -but -he -expected -to -get -through -to -johannesburg -before -they -should -become -general -and -obstructive -but -a -telegraph -wire -had -been -overlooked -and -not -cut -it -spread -the -news -of -his -invasion -far -and -wide -and -a -few -hours -after -his -start -the -boer -farmers -were -riding -hard -from -every -direction -to -intercept -him -as -soon -as -it -was -known -in -johannesburg -that -he -was -on -his -way -to -rescue -the -women -and -children -the -grateful -people -put -the -women -and -children -in -a -train -and -rushed -them -for -australia -in -fact -the -approach -of -johannesburg's -saviour -created -panic -and -consternation -there -and -a -multitude -of -males -of -peaceable -disposition -swept -to -the -trains -like -a -sand -storm -the -early -ones -fared -best -they -secured -seats -by -sitting -in -them -eight -hours -before -the -first -train -was -timed -to -leave -mr -rhodes -lost -no -time -he -cabled -the -renowned -johannesburg -letter -of -invitation -to -the -london -press -the -gray -headedest -piece -of -ancient -history -that -ever -went -over -a -cable -the -new -poet -laureate -lost -no -time -he -came -out -with -a -rousing -poem -lauding -jameson's -prompt -and -splendid -heroism -in -flying -to -the -rescue -of -the -women -and -children -for -the -poet -could -not -know -that -he -did -not -fly -until -two -months -after -the -invitation -he -was -deceived -by -the -false -date -of -the -letter -which -was -december -20th -jameson -was -intercepted -by -the -boers -on -new -year's -day -and -on -the -next -day -he -surrendered -he -had -carried -his -copy -of -the -letter -along -and -if -his -instructions -required -him -in -case -of -emergency -to -see -that -it -fell -into -the -hands -of -the -boers -he -loyally -carried -them -out -mrs -hammond -gives -him -a -sharp -rap -for -his -supposed -carelessness -and -emphasizes -her -feeling -about -it -with -burning -italics -it -was -picked -up -on -the -battle -field -in -a -leathern -pouch -supposed -to -be -dr -jameson's -saddle -bag -why -in -the -name -of -all -that -is -discreet -and -honorable -didn't -he -eat -it! -she -requires -too -much -he -was -not -in -the -service -of -the -reformers -excepting -ostensibly -he -was -in -the -service -of -mr -rhodes -it -was -the -only -plain -english -document -undarkened -by -ciphers -and -mysteries -and -responsibly -signed -and -authenticated -which -squarely -implicated -the -reformers -in -the -raid -and -it -was -not -to -mr -rhodes's -interest -that -it -should -be -eaten -besides -that -letter -was -not -the -original -it -was -only -a -copy -mr -rhodes -had -the -original -and -didn't -eat -it -he -cabled -it -to -the -london -press -it -had -already -been -read -in -england -and -america -and -all -over -europe -before -jameson -dropped -it -on -the -battlefield -if -the -subordinate's -knuckles -deserved -a -rap -the -principal's -deserved -as -many -as -a -couple -of -them -that -letter -is -a -juicily -dramatic -incident -and -is -entitled -to -all -its -celebrity -because -of -the -odd -and -variegated -effects -which -it -produced -all -within -the -space -of -a -single -week -it -had -made -jameson -an -illustrious -hero -in -england -a -pirate -in -pretoria -and -an -ass -without -discretion -or -honor -in -johannesburg -also -it -had -produced -a -poet -laureatic -explosion -of -colored -fireworks -which -filled -the -world's -sky -with -giddy -splendors -and -the -knowledge -that -jameson -was -coming -with -it -to -rescue -the -women -and -children -emptied -johannesburg -of -that -detail -of -the -population -for -an -old -letter -this -was -much -for -a -letter -two -months -old -it -did -marvels -if -it -had -been -a -year -old -it -would -have -done -miracles -chapter -lxvii -first -catch -your -boer -then -kick -him -pudd'nhead -wilson's -new -calendar -those -latter -days -were -days -of -bitter -worry -and -trouble -for -the -harassed -reformers -from -mrs -hammond -we -learn -that -on -the -31st -the -day -after -johannesburg -heard -of -the -invasion -the -reform -committee -repudiates -dr -jameson's -inroad -it -also -publishes -its -intention -to -adhere -to -the -manifesto -it -also -earnestly -desires -that -the -inhabitants -shall -refrain -from -overt -acts -against -the -boer -government -it -also -distributes -arms -at -the -court -house -and -furnishes -horses -to -the -newly -enrolled -volunteers -it -also -brings -a -transvaal -flag -into -the -committee -room -and -the -entire -body -swear -allegiance -to -it -with -uncovered -heads -and -upraised -arms -also -one -thousand -lee -metford -rifles -have -been -given -out -to -rebels -also -in -a -speech -reformer -lionel -phillips -informs -the -public -that -the -reform -committee -delegation -has -been -received -with -courtesy -by -the -government -commission -and -been -assured -that -their -proposals -shall -be -earnestly -considered -that -while -the -reform -committee -regretted -jameson's -precipitate -action -they -would -stand -by -him -also -the -populace -are -in -a -state -of -wild -enthusiasm -and -46 -can -scarcely -be -restrained -they -want -to -go -out -to -meet -jameson -and -bring -him -in -with -triumphal -outcry -also -the -british -high -commissioner -has -issued -a -damnifying -proclamation -against -jameson -and -all -british -abettors -of -his -game -it -arrives -january -1st -it -is -a -difficult -position -for -the -reformers -and -full -of -hindrances -and -perplexities -their -duty -is -hard -but -plain -1 -they -have -to -repudiate -the -inroad -and -stand -by -the -inroader -2 -they -have -to -swear -allegiance -to -the -boer -government -and -distribute -cavalry -horses -to -the -rebels -3 -they -have -to -forbid -overt -acts -against -the -boer -government -and -distribute -arms -to -its -enemies -4 -they -have -to -avoid -collision -with -the -british -government -but -still -stand -by -jameson -and -their -new -oath -of -allegiance -to -the -boer -government -taken -uncovered -in -presence -of -its -flag -they -did -such -of -these -things -as -they -could -they -tried -to -do -them -all -in -fact -did -do -them -all -but -only -in -turn -not -simultaneously -in -the -nature -of -things -they -could -not -be -made -to -simultane -in -preparing -for -armed -revolution -and -in -talking -revolution -were -the -reformers -bluffing -or -were -they -in -earnest -if -they -were -in -earnest -they -were -taking -great -risks -as -has -been -already -pointed -out -a -gentleman -of -high -position -told -me -in -johannesburg -that -he -had -in -his -possession -a -printed -document -proclaiming -a -new -government -and -naming -its -president -one -of -the -reform -leaders -he -said -that -this -proclamation -had -been -ready -for -issue -but -was -suppressed -when -the -raid -collapsed -perhaps -i -misunderstood -him -indeed -i -must -have -misunderstood -him -for -i -have -not -seen -mention -of -this -large -incident -in -print -anywhere -besides -i -hope -i -am -mistaken -for -if -i -am -then -there -is -argument -that -the -reformers -were -privately -not -serious -but -were -only -trying -to -scare -the -boer -government -into -granting -the -desired -reforms -the -boer -government -was -scared -and -it -had -a -right -to -be -for -if -mr -rhodes's -plan -was -to -provoke -a -collision -that -would -compel -the -interference -of -england -that -was -a -serious -matter -if -it -could -be -shown -that -that -was -also -the -reformers' -plan -and -purpose -it -would -prove -that -they -had -marked -out -a -feasible -project -at -any -rate -although -it -was -one -which -could -hardly -fail -to -cost -them -ruinously -before -england -should -arrive -but -it -seems -clear -that -they -had -no -such -plan -nor -desire -if -when -the -worst -should -come -to -the -worst -they -meant -to -overthrow -the -government -they -also -meant -to -inherit -the -assets -themselves -no -doubt -this -scheme -could -hardly -have -succeeded -with -an -army -of -boers -at -their -gates -and -50 -000 -riotous -blacks -in -their -midst -the -odds -against -success -would -have -been -too -heavy -even -if -the -whole -town -had -been -armed -with -only -2 -500 -rifles -in -the -place -they -stood -really -no -chance -to -me -the -military -problems -of -the -situation -are -of -more -interest -than -the -political -ones -because -by -disposition -i -have -always -been -especially -fond -of -war -no -i -mean -fond -of -discussing -war -and -fond -of -giving -military -advice -if -i -had -been -with -jameson -the -morning -after -he -started -i -should -have -advised -him -to -turn -back -that -was -monday -it -was -then -that -he -received -his -first -warning -from -a -boer -source -not -to -violate -the -friendly -soil -of -the -transvaal -it -showed -that -his -invasion -was -known -if -i -had -been -with -him -on -tuesday -morning -and -afternoon -when -he -received -further -warnings -i -should -have -repeated -my -advice -if -i -had -been -with -him -the -next -morning -new -year's -when -he -received -notice -that -a -few -hundred -boers -were -waiting -for -him -a -few -miles -ahead -i -should -not -have -advised -but -commanded -him -to -go -back -and -if -i -had -been -with -him -two -or -three -hours -later -a -thing -not -conceivable -to -me -i -should -have -retired -him -by -force -for -at -that -time -he -learned -that -the -few -hundred -had -now -grown -to -800 -and -that -meant -that -the -growing -would -go -on -growing -for -by -authority -of -mr -garrett -one -knows -that -jameson's -600 -were -only -530 -at -most -when -you -count -out -his -native -drivers -etc -and -that -the -530 -consisted -largely -of -green -youths -raw -young -fellows -not -trained -and -war -worn -british -soldiers -and -i -would -have -told -jameson -that -those -lads -would -not -be -able -to -shoot -effectively -from -horseback -in -the -scamper -and -racket -of -battle -and -that -there -would -not -be -anything -for -them -to -shoot -at -anyway -but -rocks -for -the -boers -would -be -behind -the -rocks -not -out -in -the -open -i -would -have -told -him -that -300 -boer -sharpshooters -behind -rocks -would -be -an -overmatch -for -his -500 -raw -young -fellows -on -horseback -if -pluck -were -the -only -thing -essential -to -battle -winning -the -english -would -lose -no -battles -but -discretion -as -well -as -pluck -is -required -when -one -fights -boers -and -red -indians -in -south -africa -the -briton -has -always -insisted -upon -standing -bravely -up -unsheltered -before -the -hidden -boer -and -taking -the -results -jameson's -men -would -follow -the -custom -jameson -would -not -have -listened -to -me -he -would -have -been -intent -upon -repeating -history -according -to -precedent -americans -are -not -acquainted -with -the -british -boer -war -of -1881 -but -its -history -is -interesting -and -could -have -been -instructive -to -jameson -if -he -had -been -receptive -i -will -cull -some -details -of -it -from -trustworthy -sources -mainly -from -russell's -natal -mr -russell -is -not -a -boer -but -a -briton -he -is -inspector -of -schools -and -his -history -is -a -text -book -whose -purpose -is -the -instruction -of -the -natal -english -youth -after -the -seizure -of -the -transvaal -and -the -suppression -of -the -boer -government -by -england -in -1877 -the -boers -fretted -for -three -years -and -made -several -appeals -to -england -for -a -restoration -of -their -liberties -but -without -result -then -they -gathered -themselves -together -in -a -great -mass -meeting -at -krugersdorp -talked -their -troubles -over -and -resolved -to -fight -for -their -deliverance -from -the -british -yoke -krugersdorp -the -place -where -the -boers -interrupted -the -jameson -raid -the -little -handful -of -farmers -rose -against -the -strongest -empire -in -the -world -they -proclaimed -martial -law -and -the -re -establishment -of -their -republic -they -organized -their -forces -and -sent -them -forward -to -intercept -the -british -battalions -this -although -sir -garnet -wolseley -had -but -lately -made -proclamation -that -so -long -as -the -sun -shone -in -the -heavens -the -transvaal -would -be -and -remain -english -territory -and -also -in -spite -of -the -fact -that -the -commander -of -the -94th -regiment -already -on -the -march -to -suppress -this -rebellion -had -been -heard -to -say -that -the -boers -would -turn -tail -at -the -first -beat -of -the -big -drum -[ -south -africa -as -it -is -by -f -reginald -statham -page -82 -london -t -fisher -unwin -1897 -] -four -days -after -the -flag -raising -the -boer -force -which -had -been -sent -forward -to -forbid -the -invasion -of -the -english -troops -met -them -at -bronkhorst -spruit -246 -men -of -the -94th -regiment -in -command -of -a -colonel -the -big -drum -beating -the -band -playing -and -the -first -battle -was -fought -it -lasted -ten -minutes -result -british -loss -more -than -150 -officers -and -men -out -of -the -246 -surrender -of -the -remnant -boer -loss -if -any -not -stated -they -are -fine -marksmen -the -boers -from -the -cradle -up -they -live -on -horseback -and -hunt -wild -animals -with -the -rifle -they -have -a -passion -for -liberty -and -the -bible -and -care -for -nothing -else -general -sir -george -colley -lieutenant -governor -and -commander -in -chief -in -natal -felt -it -his -duty -to -proceed -at -once -to -the -relief -of -the -loyalists -and -soldiers -beleaguered -in -the -different -towns -of -the -transvaal -he -moved -out -with -1 -000 -men -and -some -artillery -he -found -the -boers -encamped -in -a -strong -and -sheltered -position -on -high -ground -at -laing's -nek -every -boer -behind -a -rock -early -in -the -morning -of -the -28th -january -1881 -he -moved -to -the -attack -with -the -58th -regiment -commanded -by -colonel -deane -a -mounted -squadron -of -70 -men -the -60th -rifles -the -naval -brigade -with -three -rocket -tubes -and -the -artillery -with -six -guns -he -shelled -the -boers -for -twenty -minutes -then -the -assault -was -delivered -the -58th -marching -up -the -slope -in -solid -column -the -battle -was -soon -finished -with -this -result -according -to -russell -british -loss -in -killed -and -wounded -174 -boer -loss -trifling -colonel -deane -was -killed -and -apparently -every -officer -above -the -grade -of -lieutenant -was -killed -or -wounded -for -the -58th -retreated -to -its -camp -in -command -of -a -lieutenant -africa -as -it -is -that -ended -the -second -battle -on -the -7th -of -february -general -colley -discovered -that -the -boers -were -flanking -his -position -the -next -morning -he -left -his -camp -at -mount -pleasant -and -marched -out -and -crossed -the -ingogo -river -with -270 -men -started -up -the -ingogo -heights -and -there -fought -a -battle -which -lasted -from -noon -till -nightfall -he -then -retreated -leaving -his -wounded -with -his -military -chaplain -and -in -recrossing -the -now -swollen -river -lost -some -of -his -men -by -drowning -that -was -the -third -boer -victory -result -according -to -mr -russell -british -loss -150 -out -of -270 -engaged -boer -loss -8 -killed -9 -wounded -17 -there -was -a -season -of -quiet -now -but -at -the -end -of -about -three -weeks -sir -george -colley -conceived -the -idea -of -climbing -with -an -infantry -and -artillery -force -the -steep -and -rugged -mountain -of -amajuba -in -the -night -a -bitter -hard -task -but -he -accomplished -it -on -the -way -he -left -about -200 -men -to -guard -a -strategic -point -and -took -about -400 -up -the -mountain -with -him -when -the -sun -rose -in -the -morning -there -was -an -unpleasant -surprise -for -the -boers -yonder -were -the -english -troops -visible -on -top -of -the -mountain -two -or -three -miles -away -and -now -their -own -position -was -at -the -mercy -of -the -english -artillery -the -boer -chief -resolved -to -retreat -up -that -mountain -he -asked -for -volunteers -and -got -them -the -storming -party -crossed -the -swale -and -began -to -creep -up -the -steeps -and -from -behind -rocks -and -bushes -they -shot -at -the -soldiers -on -the -skyline -as -if -they -were -stalking -deer -says -mr -russell -there -was -continuous -musketry -fire -steady -and -fatal -on -the -one -side -wild -and -ineffectual -on -the -other -the -boers -reached -the -top -and -began -to -put -in -their -ruinous -work -presently -the -british -broke -and -fled -for -their -lives -down -the -rugged -steep -the -boers -had -won -the -battle -result -in -killed -and -wounded -including -among -the -killed -the -british -general -british -loss -226 -out -of -400 -engaged -boer -loss -1 -killed -5 -wounded -that -ended -the -war -england -listened -to -reason -and -recognized -the -boer -republic -a -government -which -has -never -been -in -any -really -awful -danger -since -until -jameson -started -after -it -with -his -500 -raw -young -fellows -to -recapitulate -the -boer -farmers -and -british -soldiers -fought -4 -battles -and -the -boers -won -them -all -result -of -the -4 -in -killed -and -wounded -british -loss -700 -men -boer -loss -so -far -as -known -23 -men -it -is -interesting -now -to -note -how -loyally -jameson -and -his -several -trained -british -military -officers -tried -to -make -their -battles -conform -to -precedent -mr -garrett's -account -of -the -raid -is -much -the -best -one -i -have -met -with -and -my -impressions -of -the -raid -are -drawn -from -that -when -jameson -learned -that -near -krugersdorp -he -would -find -800 -boers -waiting -to -dispute -his -passage -he -was -not -in -the -least -disturbed -he -was -feeling -as -he -had -felt -two -or -three -days -before -when -he -had -opened -his -campaign -with -a -historic -remark -to -the -same -purport -as -the -one -with -which -the -commander -of -the -94th -had -opened -the -boer -british -war -of -fourteen -years -before -that -commander's -remark -was -that -the -boers -would -turn -tail -at -the -first -beat -of -the -big -drum -jameson's -was -that -with -his -raw -young -fellows -he -could -kick -the -persons -of -the -boers -all -round -the -transvaal -he -was -keeping -close -to -historic -precedent -jameson -arrived -in -the -presence -of -the -boers -they -according -to -precedent -were -not -visible -it -was -a -country -of -ridges -depressions -rocks -ditches -moraines -of -mining -tailings -not -even -as -favorable -for -cavalry -work -as -laing's -nek -had -been -in -the -former -disastrous -days -jameson -shot -at -the -ridges -and -rocks -with -his -artillery -just -as -general -colley -had -done -at -the -nek -and -did -them -no -damage -and -persuaded -no -boer -to -show -himself -then -about -a -hundred -of -his -men -formed -up -to -charge -the -ridge -according -to -the -58th's -precedent -at -the -nek -but -as -they -dashed -forward -they -opened -out -in -a -long -line -which -was -a -considerable -improvement -on -the -58th's -tactics -when -they -had -gotten -to -within -200 -yards -of -the -ridge -the -concealed -boers -opened -out -on -them -and -emptied -20 -saddles -the -unwounded -dismounted -and -fired -at -the -rocks -over -the -backs -of -their -horses -but -the -return -fire -was -too -hot -and -they -mounted -again -and -galloped -back -or -crawled -away -into -a -clump -of -reeds -for -cover -where -they -were -shortly -afterward -taken -prisoners -as -they -lay -among -the -reeds -some -thirty -prisoners -were -so -taken -and -during -the -night -which -followed -the -boers -carried -away -another -thirty -killed -and -wounded -the -wounded -to -krugersdorp -hospital -sixty -per -cent -of -the -assaulted -force -disposed -of -according -to -mr -garrett's -estimate -it -was -according -to -amajuba -precedent -where -the -british -loss -was -226 -out -of -about -400 -engaged -also -in -jameson's -camp -that -night -there -lay -about -30 -wounded -or -otherwise -disabled -men -also -during -the -night -some -30 -or -40 -young -fellows -got -separated -from -the -command -and -straggled -through -into -johannesburg -altogether -a -possible -150 -men -gone -out -of -his -530 -his -lads -had -fought -valorously -but -had -not -been -able -to -get -near -enough -to -a -boer -to -kick -him -around -the -transvaal -at -dawn -the -next -morning -the -column -of -something -short -of -400 -whites -resumed -its -march -jameson's -grit -was -stubbornly -good -indeed -it -was -always -that -he -still -had -hopes -there -was -a -long -and -tedious -zigzagging -march -through -broken -ground -with -constant -harassment -from -the -boers -and -at -last -the -column -walked -into -a -sort -of -trap -and -the -boers -closed -in -upon -it -men -and -horses -dropped -on -all -sides -in -the -column -the -feeling -grew -that -unless -it -could -burst -through -the -boer -lines -at -this -point -it -was -done -for -the -maxims -were -fired -until -they -grew -too -hot -and -water -failing -for -the -cool -jacket -five -of -them -jammed -and -went -out -of -action -the -7 -pounder -was -fired -until -only -half -an -hour's -ammunition -was -left -to -fire -with -one -last -rush -was -made -and -failed -and -then -the -staats -artillery -came -up -on -the -left -flank -and -the -game -was -up -jameson -hoisted -a -white -flag -and -surrendered -there -is -a -story -which -may -not -be -true -about -an -ignorant -boer -farmer -there -who -thought -that -this -white -flag -was -the -national -flag -of -england -he -had -been -at -bronkhorst -and -laing's -nek -and -ingogo -and -amajuba -and -supposed -that -the -english -did -not -run -up -their -flag -excepting -at -the -end -of -a -fight -the -following -is -as -i -understand -it -mr -garrett's -estimate -of -jameson's -total -loss -in -killed -and -wounded -for -the -two -days -when -they -gave -in -they -were -minus -some -20 -per -cent -of -combatants -there -were -76 -casualties -there -were -30 -men -hurt -or -sick -in -the -wagons -there -were -27 -killed -on -the -spot -or -mortally -wounded -total -133 -out -of -the -original -530 -it -is -just -25 -per -cent -[however -i -judge -that -the -total -was -really -150 -for -the -number -of -wounded -carried -to -krugersdorp -hospital -was -53 -not -30 -as -mr -garrett -reports -it -the -lady -whose -guest -i -was -in -krugerdorp -gave -me -the -figures -she -was -head -nurse -from -the -beginning -of -hostilities -jan -1 -until -the -professional -nurses -arrived -jan -8th -of -the -53 -three -or -four -were -boers -i -quote -her -words -] -this -is -a -large -improvement -upon -the -precedents -established -at -bronkhorst -laing's -nek -ingogo -and -amajuba -and -seems -to -indicate -that -boer -marksmanship -is -not -so -good -now -as -it -was -in -those -days -but -there -is -one -detail -in -which -the -raid -episode -exactly -repeats -history -by -surrender -at -bronkhorst -the -whole -british -force -disappeared -from -the -theater -of -war -this -was -the -case -with -jameson's -force -in -the -boer -loss -also -historical -precedent -is -followed -with -sufficient -fidelity -in -the -4 -battles -named -above -the -boer -loss -so -far -as -known -was -an -average -of -6 -men -per -battle -to -the -british -average -loss -of -175 -in -jameson's -battles -as -per -boer -official -report -the -boer -loss -in -killed -was -4 -two -of -these -were -killed -by -the -boers -themselves -by -accident -the -other -by -jameson's -army -one -of -them -intentionally -the -other -by -a -pathetic -mischance -a -young -boer -named -jacobz -was -moving -forward -to -give -a -drink -to -one -of -the -wounded -troopers -jameson's -after -the -first -charge -when -another -wounded -man -mistaking -his -intention -shot -him -there -were -three -or -four -wounded -boers -in -the -krugersdorp -hospital -and -apparently -no -others -have -been -reported -mr -garrett -on -a -balance -of -probabilities -fully -accepts -the -official -version -and -thanks -heaven -the -killed -was -not -larger -as -a -military -man -i -wish -to -point -out -what -seems -to -me -to -be -military -errors -in -the -conduct -of -the -campaign -which -we -have -just -been -considering -i -have -seen -active -service -in -the -field -and -it -was -in -the -actualities -of -war -that -i -acquired -my -training -and -my -right -to -speak -i -served -two -weeks -in -the -beginning -of -our -civil -war -and -during -all -that -tune -commanded -a -battery -of -infantry -composed -of -twelve -men -general -grant -knew -the -history -of -my -campaign -for -i -told -it -him -i -also -told -him -the -principle -upon -which -i -had -conducted -it -which -was -to -tire -the -enemy -i -tired -out -and -disqualified -many -battalions -yet -never -had -a -casualty -myself -nor -lost -a -man -general -grant -was -not -given -to -paying -compliments -yet -he -said -frankly -that -if -i -had -conducted -the -whole -war -much -bloodshed -would -have -been -spared -and -that -what -the -army -might -have -lost -through -the -inspiriting -results -of -collision -in -the -field -would -have -been -amply -made -up -by -the -liberalizing -influences -of -travel -further -endorsement -does -not -seem -to -me -to -be -necessary -let -us -now -examine -history -and -see -what -it -teaches -in -the -4 -battles -fought -in -1881 -and -the -two -fought -by -jameson -the -british -loss -in -killed -wounded -and -prisoners -was -substantially -1 -300 -men -the -boer -loss -as -far -as -is -ascertainable -eras -about -30 -men -these -figures -show -that -there -was -a -defect -somewhere -it -was -not -in -the -absence -of -courage -i -think -it -lay -in -the -absence -of -discretion -the -briton -should -have -done -one -thing -or -the -other -discarded -british -methods -and -fought -the -boer -with -boer -methods -or -augmented -his -own -force -until -using -british -methods -it -should -be -large -enough -to -equalize -results -with -the -boer -to -retain -the -british -method -requires -certain -things -determinable -by -arithmetic -if -for -argument's -sake -we -allow -that -the -aggregate -of -1 -716 -british -soldiers -engaged -in -the -4 -early -battles -was -opposed -by -the -same -aggregate -of -boers -we -have -this -result -the -british -loss -of -700 -and -the -boer -loss -of -23 -argues -that -in -order -to -equalize -results -in -future -battles -you -must -make -the -british -force -thirty -times -as -strong -as -the -boer -force -mr -garrett -shows -that -the -boer -force -immediately -opposed -to -jameson -was -2 -000 -and -that -there -were -6 -000 -more -on -hand -by -the -evening -of -the -second -day -arithmetic -shows -that -in -order -to -make -himself -the -equal -of -the -8 -000 -boers -jameson -should -have -had -240 -000 -men -whereas -he -merely -had -530 -boys -from -a -military -point -of -view -backed -by -the -facts -of -history -i -conceive -that -jameson's -military -judgment -was -at -fault -another -thing -jameson -was -encumbered -by -artillery -ammunition -and -rifles -the -facts -of -the -battle -show -that -he -should -have -had -none -of -those -things -along -they -were -heavy -they -were -in -his -way -they -impeded -his -march -there -was -nothing -to -shoot -at -but -rocks -he -knew -quite -well -that -there -would -be -nothing -to -shoot -at -but -rocks -and -he -knew -that -artillery -and -rifles -have -no -effect -upon -rocks -he -was -badly -overloaded -with -unessentials -he -had -8 -maxims -a -maxim -is -a -kind -of -gatling -i -believe -and -shoots -about -500 -bullets -per -minute -he -had -one -12 -1/2 -pounder -cannon -and -two -7 -pounders -also -145 -000 -rounds -of -ammunition -he -worked -the -maxims -so -hard -upon -the -rocks -that -five -of -them -became -disabled -five -of -the -maxims -not -the -rocks -it -is -believed -that -upwards -of -100 -000 -rounds -of -ammunition -of -the -various -kinds -were -fired -during -the -21 -hours -that -the -battles -lasted -one -man -killed -he -must -have -been -much -mutilated -it -was -a -pity -to -bring -those -futile -maxims -along -jameson -should -have -furnished -himself -with -a -battery -of -pudd'nhead -wilson -maxims -instead -they -are -much -more -deadly -than -those -others -and -they -are -easily -carried -because -they -have -no -weight -mr -garrett -not -very -carefully -concealing -a -smile -excuses -the -presence -of -the -maxims -by -saying -that -they -were -of -very -substantial -use -because -their -sputtering -disordered -the -aim -of -the -boers -and -in -that -way -saved -lives -three -cannon -eight -maxims -and -five -hundred -rifles -yielded -a -result -which -emphasized -a -fact -which -had -already -been -established -that -the -british -system -of -standing -out -in -the -open -to -fight -boers -who -are -behind -rocks -is -not -wise -not -excusable -and -ought -to -be -abandoned -for -something -more -efficacious -for -the -purpose -of -war -is -to -kill -not -merely -to -waste -ammunition -if -i -could -get -the -management -of -one -of -those -campaigns -i -would -know -what -to -do -for -i -have -studied -the -boer -he -values -the -bible -above -every -other -thing -the -most -delicious -edible -in -south -africa -is -biltong -you -will -have -seen -it -mentioned -in -olive -schreiner's -books -it -is -what -our -plainsmen -call -jerked -beef -it -is -the -boer's -main -standby -he -has -a -passion -for -it -and -he -is -right -if -i -had -the -command -of -the -campaign -i -would -go -with -rifles -only -no -cumbersome -maxims -and -cannon -to -spoil -good -rocks -with -i -would -move -surreptitiously -by -night -to -a -point -about -a -quarter -of -a -mile -from -the -boer -camp -and -there -i -would -build -up -a -pyramid -of -biltong -and -bibles -fifty -feet -high -and -then -conceal -my -men -all -about -in -the -morning -the -boers -would -send -out -spies -and -then -the -rest -would -come -with -a -rush -i -would -surround -them -and -they -would -have -to -fight -my -men -on -equal -terms -in -the -open -there -wouldn't -be -any -amajuba -results -[just -as -i -am -finishing -this -book -an -unfortunate -dispute -has -sprung -up -between -dr -jameson -and -his -officers -on -the -one -hand -and -colonel -rhodes -on -the -other -concerning -the -wording -of -a -note -which -colonel -rhodes -sent -from -johannesburg -by -a -cyclist -to -jameson -just -before -hostilities -began -on -the -memorable -new -year's -day -some -of -the -fragments -of -this -note -were -found -on -the -battlefield -after -the -fight -and -these -have -been -pieced -together -the -dispute -is -as -to -what -words -the -lacking -fragments -contained -jameson -says -the -note -promised -him -a -reinforcement -of -300 -men -from -johannesburg -colonel -rhodes -denies -this -and -says -he -merely -promised -to -send -out -some -men -to -meet -you -] -[it -seems -a -pity -that -these -friends -should -fall -out -over -so -little -a -thing -if -the -300 -had -been -sent -what -good -would -it -have -done -in -21 -hours -of -industrious -fighting -jameson's -530 -men -with -8 -maxims -3 -cannon -and -145 -000 -rounds -of -ammunition -killed -an -aggregate -of -1 -boer -these -statistics -show -that -a -reinforcement -of -300 -johannesburgers -armed -merely -with -muskets -would -have -killed -at -the -outside -only -a -little -over -a -half -of -another -boer -this -would -not -have -saved -the -day -it -would -not -even -have -seriously -affected -the -general -result -the -figures -show -clearly -and -with -mathematical -violence -that -the -only -way -to -save -jameson -or -even -give -him -a -fair -and -equal -chance -with -the -enemy -was -for -johannesburg -to -send -him -240 -maxims -90 -cannon -600 -carloads -of -ammunition -and -240 -000 -men -johannesburg -was -not -in -a -position -to -do -this -johannesburg -has -been -called -very -hard -names -for -not -reinforcing -jameson -but -in -every -instance -this -has -been -done -by -two -classes -of -persons -people -who -do -not -read -history -and -people -like -jameson -who -do -not -understand -what -it -means -after -they -have -read -it -] -chapter -lxviii -none -of -us -can -have -as -many -virtues -as -the -fountain -pen -or -half -its -cussedness -but -we -can -try -pudd'nhead -wilson's -new -calendar -the -duke -of -fife -has -borne -testimony -that -mr -rhodes -deceived -him -that -is -also -what -mr -rhodes -did -with -the -reformers -he -got -them -into -trouble -and -then -stayed -out -himself -a -judicious -man -he -has -always -been -that -as -to -this -there -was -a -moment -of -doubt -once -it -was -when -he -was -out -on -his -last -pirating -expedition -in -the -matabele -country -the -cable -shouted -out -that -he -had -gone -unarmed -to -visit -a -party -of -hostile -chiefs -it -was -true -too -and -this -dare -devil -thing -came -near -fetching -another -indiscretion -out -of -the -poet -laureate -it -would -have -been -too -bad -for -when -the -facts -were -all -in -it -turned -out -that -there -was -a -lady -along -too -and -she -also -was -unarmed -in -the -opinion -of -many -people -mr -rhodes -is -south -africa -others -think -he -is -only -a -large -part -of -it -these -latter -consider -that -south -africa -consists -of -table -mountain -the -diamond -mines -the -johannesburg -gold -fields -and -cecil -rhodes -the -gold -fields -are -wonderful -in -every -way -in -seven -or -eight -years -they -built -up -in -a -desert -a -city -of -a -hundred -thousand -inhabitants -counting -white -and -black -together -and -not -the -ordinary -mining -city -of -wooden -shanties -but -a -city -made -out -of -lasting -material -nowhere -in -the -world -is -there -such -a -concentration -of -rich -mines -as -at -johannesburg -mr -bonamici -my -manager -there -gave -me -a -small -gold -brick -with -some -statistics -engraved -upon -it -which -record -the -output -of -gold -from -the -early -days -to -july -1895 -and -exhibit -the -strides -which -have -been -made -in -the -development -of -the -industry -in -1888 -the -output -was -$4 -162 -440 -the -output -of -the -next -five -and -a -half -years -was -total -$17 -585 -894 -for -the -single -year -ending -with -june -1895 -it -was -$45 -553 -700 -the -capital -which -has -developed -the -mines -came -from -england -the -mining -engineers -from -america -this -is -the -case -with -the -diamond -mines -also -south -africa -seems -to -be -the -heaven -of -the -american -scientific -mining -engineer -he -gets -the -choicest -places -and -keeps -them -his -salary -is -not -based -upon -what -he -would -get -in -america -but -apparently -upon -what -a -whole -family -of -him -would -get -there -the -successful -mines -pay -great -dividends -yet -the -rock -is -not -rich -from -a -californian -point -of -view -rock -which -yields -ten -or -twelve -dollars -a -ton -is -considered -plenty -rich -enough -it -is -troubled -with -base -metals -to -such -a -degree -that -twenty -years -ago -it -would -have -been -only -about -half -as -valuable -as -it -is -now -for -at -that -time -there -was -no -paying -way -of -getting -anything -out -of -such -rock -but -the -coarser -grained -free -gold -but -the -new -cyanide -process -has -changed -all -that -and -the -gold -fields -of -the -world -now -deliver -up -fifty -million -dollars' -worth -of -gold -per -year -which -would -have -gone -into -the -tailing -pile -under -the -former -conditions -the -cyanide -process -was -new -to -me -and -full -of -interest -and -among -the -costly -and -elaborate -mining -machinery -there -were -fine -things -which -were -new -to -me -but -i -was -already -familiar -with -the -rest -of -the -details -of -the -gold -mining -industry -i -had -been -a -gold -miner -myself -in -my -day -and -knew -substantially -everything -that -those -people -knew -about -it -except -how -to -make -money -at -it -but -i -learned -a -good -deal -about -the -boers -there -and -that -was -a -fresh -subject -what -i -heard -there -was -afterwards -repeated -to -me -in -other -parts -of -south -africa -summed -up -according -to -the -information -thus -gained -this -is -the -boer -he -is -deeply -religious -profoundly -ignorant -dull -obstinate -bigoted -uncleanly -in -his -habits -hospitable -honest -in -his -dealings -with -the -whites -a -hard -master -to -his -black -servant -lazy -a -good -shot -good -horseman -addicted -to -the -chase -a -lover -of -political -independence -a -good -husband -and -father -not -fond -of -herding -together -in -towns -but -liking -the -seclusion -and -remoteness -and -solitude -and -empty -vastness -and -silence -of -the -veldt -a -man -of -a -mighty -appetite -and -not -delicate -about -what -he -appeases -it -with -well -satisfied -with -pork -and -indian -corn -and -biltong -requiring -only -that -the -quantity -shall -not -be -stinted -willing -to -ride -a -long -journey -to -take -a -hand -in -a -rude -all -night -dance -interspersed -with -vigorous -feeding -and -boisterous -jollity -but -ready -to -ride -twice -as -far -for -a -prayer -meeting -proud -of -his -dutch -and -huguenot -origin -and -its -religious -and -military -history -proud -of -his -race's -achievements -in -south -africa -its -bold -plunges -into -hostile -and -uncharted -deserts -in -search -of -free -solitudes -unvexed -by -the -pestering -and -detested -english -also -its -victories -over -the -natives -and -the -british -proudest -of -all -of -the -direct -and -effusive -personal -interest -which -the -deity -has -always -taken -in -its -affairs -he -cannot -read -he -cannot -write -he -has -one -or -two -newspapers -but -he -is -apparently -not -aware -of -it -until -latterly -he -had -no -schools -and -taught -his -children -nothing -news -is -a -term -which -has -no -meaning -to -him -and -the -thing -itself -he -cares -nothing -about -he -hates -to -be -taxed -and -resents -it -he -has -stood -stock -still -in -south -africa -for -two -centuries -and -a -half -and -would -like -to -stand -still -till -the -end -of -time -for -he -has -no -sympathy -with -uitlander -notions -of -progress -he -is -hungry -to -be -rich -for -he -is -human -but -his -preference -has -been -for -riches -in -cattle -not -in -fine -clothes -and -fine -houses -and -gold -and -diamonds -the -gold -and -the -diamonds -have -brought -the -godless -stranger -within -his -gates -also -contamination -and -broken -repose -and -he -wishes -that -they -had -never -been -discovered -i -think -that -the -bulk -of -those -details -can -be -found -in -olive -schreiner's -books -and -she -would -not -be -accused -of -sketching -the -boer's -portrait -with -an -unfair -hand -now -what -would -you -expect -from -that -unpromising -material -what -ought -you -to -expect -from -it -laws -inimical -to -religious -liberty -yes -laws -denying -representation -and -suffrage -to -the -intruder -yes -laws -unfriendly -to -educational -institutions -yes -laws -obstructive -of -gold -production -yes -discouragement -of -railway -expansion -yes -laws -heavily -taxing -the -intruder -and -overlooking -the -boer -yes -the -uitlander -seems -to -have -expected -something -very -different -from -all -that -i -do -not -know -why -nothing -different -from -it -was -rationally -to -be -expected -a -round -man -cannot -be -expected -to -fit -a -square -hole -right -away -he -must -have -time -to -modify -his -shape -the -modification -had -begun -in -a -detail -or -two -before -the -raid -and -was -making -some -progress -it -has -made -further -progress -since -there -are -wise -men -in -the -boer -government -and -that -accounts -for -the -modification -the -modification -of -the -boer -mass -has -probably -not -begun -yet -if -the -heads -of -the -boer -government -had -not -been -wise -men -they -would -have -hanged -jameson -and -thus -turned -a -very -commonplace -pirate -into -a -holy -martyr -but -even -their -wisdom -has -its -limits -and -they -will -hang -mr -rhodes -if -they -ever -catch -him -that -will -round -him -and -complete -him -and -make -him -a -saint -he -has -already -been -called -by -all -other -titles -that -symbolize -human -grandeur -and -he -ought -to -rise -to -this -one -the -grandest -of -all -it -will -be -a -dizzy -jump -from -where -he -is -now -but -that -is -nothing -it -will -land -him -in -good -company -and -be -a -pleasant -change -for -him -some -of -the -things -demanded -by -the -johannesburgers' -manifesto -have -been -conceded -since -the -days -of -the -raid -and -the -others -will -follow -in -time -no -doubt -it -was -most -fortunate -for -the -miners -of -johannesburg -that -the -taxes -which -distressed -them -so -much -were -levied -by -the -boer -government -instead -of -by -their -friend -rhodes -and -his -chartered -company -of -highwaymen -for -these -latter -take -half -of -whatever -their -mining -victims -find -they -do -not -stop -at -a -mere -percentage -if -the -johannesburg -miners -were -under -their -jurisdiction -they -would -be -in -the -poorhouse -in -twelve -months -i -have -been -under -the -impression -all -along -that -i -had -an -unpleasant -paragraph -about -the -boers -somewhere -in -my -notebook -and -also -a -pleasant -one -i -have -found -them -now -the -unpleasant -one -is -dated -at -an -interior -village -and -says -mr -z -called -he -is -an -english -afrikander -is -an -old -resident -and -has -a -boer -wife -he -speaks -the -language -and -his -professional -business -is -with -the -boers -exclusively -he -told -me -that -the -ancient -boer -families -in -the -great -region -of -which -this -village -is -the -commercial -center -are -falling -victims -to -their -inherited -indolence -and -dullness -in -the -materialistic -latter -day -race -and -struggle -and -are -dropping -one -by -one -into -the -grip -of -the -usurer -getting -hopelessly -in -debt -and -are -losing -their -high -place -and -retiring -to -second -and -lower -the -boer's -farm -does -not -go -to -another -boer -when -he -loses -it -but -to -a -foreigner -some -have -fallen -so -low -that -they -sell -their -daughters -to -the -blacks -under -date -of -another -south -african -town -i -find -the -note -which -is -creditable -to -the -boers -dr -x -told -me -that -in -the -kafir -war -1 -500 -kafirs -took -refuge -in -a -great -cave -in -the -mountains -about -90 -miles -north -of -johannesburg -and -the -boers -blocked -up -the -entrance -and -smoked -them -to -death -dr -x -has -been -in -there -and -seen -the -great -array -of -bleached -skeletons -one -a -woman -with -the -skeleton -of -a -child -hugged -to -her -breast -the -great -bulk -of -the -savages -must -go -the -white -man -wants -their -lands -and -all -must -go -excepting -such -percentage -of -them -as -he -will -need -to -do -his -work -for -him -upon -terms -to -be -determined -by -himself -since -history -has -removed -the -element -of -guesswork -from -this -matter -and -made -it -certainty -the -humanest -way -of -diminishing -the -black -population -should -be -adopted -not -the -old -cruel -ways -of -the -past -mr -rhodes -and -his -gang -have -been -following -the -old -ways -they -are -chartered -to -rob -and -slay -and -they -lawfully -do -it -but -not -in -a -compassionate -and -christian -spirit -they -rob -the -mashonas -and -the -matabeles -of -a -portion -of -their -territories -in -the -hallowed -old -style -of -purchase! -for -a -song -and -then -they -force -a -quarrel -and -take -the -rest -by -the -strong -hand -they -rob -the -natives -of -their -cattle -under -the -pretext -that -all -the -cattle -in -the -country -belonged -to -the -king -whom -they -have -tricked -and -assassinated -they -issue -regulations -requiring -the -incensed -and -harassed -natives -to -work -for -the -white -settlers -and -neglect -their -own -affairs -to -do -it -this -is -slavery -and -is -several -times -worse -than -was -the -american -slavery -which -used -to -pain -england -so -much -for -when -this -rhodesian -slave -is -sick -super -annuated -or -otherwise -disabled -he -must -support -himself -or -starve -his -master -is -under -no -obligation -to -support -him -the -reduction -of -the -population -by -rhodesian -methods -to -the -desired -limit -is -a -return -to -the -old -time -slow -misery -and -lingering -death -system -of -a -discredited -time -and -a -crude -civilization -we -humanely -reduce -an -overplus -of -dogs -by -swift -chloroform -the -boer -humanely -reduced -an -overplus -of -blacks -by -swift -suffocation -the -nameless -but -right -hearted -australian -pioneer -humanely -reduced -his -overplus -of -aboriginal -neighbors -by -a -sweetened -swift -death -concealed -in -a -poisoned -pudding -all -these -are -admirable -and -worthy -of -praise -you -and -i -would -rather -suffer -either -of -these -deaths -thirty -times -over -in -thirty -successive -days -than -linger -out -one -of -the -rhodesian -twenty -year -deaths -with -its -daily -burden -of -insult -humiliation -and -forced -labor -for -a -man -whose -entire -race -the -victim -hates -rhodesia -is -a -happy -name -for -that -land -of -piracy -and -pillage -and -puts -the -right -stain -upon -it -several -long -journeys -gave -us -experience -of -the -cape -colony -railways -easy -riding -fine -cars -all -the -conveniences -thorough -cleanliness -comfortable -beds -furnished -for -the -night -trains -it -was -in -the -first -days -of -june -and -winter -the -daytime -was -pleasant -the -nighttime -nice -and -cold -spinning -along -all -day -in -the -cars -it -was -ecstasy -to -breathe -the -bracing -air -and -gaze -out -over -the -vast -brown -solitudes -of -the -velvet -plains -soft -and -lovely -near -by -still -softer -and -lovelier -further -away -softest -and -loveliest -of -all -in -the -remote -distances -where -dim -island -hills -seemed -afloat -as -in -a -sea -a -sea -made -of -dream -stuff -and -flushed -with -colors -faint -and -rich -and -dear -me -the -depth -of -the -sky -and -the -beauty -of -the -strange -new -cloud -forms -and -the -glory -of -the -sunshine -the -lavishness -the -wastefulness -of -it! -the -vigor -and -freshness -and -inspiration -of -the -air -and -the -sunwell -it -was -all -just -as -olive -schreiner -had -made -it -in -her -books -to -me -the -veldt -in -its -sober -winter -garb -was -surpassingly -beautiful -there -were -unlevel -stretches -where -it -was -rolling -and -swelling -and -rising -and -subsiding -and -sweeping -superbly -on -and -on -and -still -on -and -on -like -an -ocean -toward -the -faraway -horizon -its -pale -brown -deepening -by -delicately -graduated -shades -to -rich -orange -and -finally -to -purple -and -crimson -where -it -washed -against -the -wooded -hills -and -naked -red -crags -at -the -base -of -the -sky -everywhere -from -cape -town -to -kimberley -and -from -kimberley -to -port -elizabeth -and -east -london -the -towns -were -well -populated -with -tamed -blacks -tamed -and -christianized -too -i -suppose -for -they -wore -the -dowdy -clothes -of -our -christian -civilization -but -for -that -many -of -them -would -have -been -remarkably -handsome -these -fiendish -clothes -together -with -the -proper -lounging -gait -good -natured -face -happy -air -and -easy -laugh -made -them -precise -counterparts -of -our -american -blacks -often -where -all -the -other -aspects -were -strikingly -and -harmoniously -and -thrillingly -african -a -flock -of -these -natives -would -intrude -looking -wholly -out -of -place -and -spoil -it -all -making -the -thing -a -grating -discord -half -african -and -half -american -one -sunday -in -king -william's -town -a -score -of -colored -women -came -mincing -across -the -great -barren -square -dressed -oh -in -the -last -perfection -of -fashion -and -newness -and -expensiveness -and -showy -mixture -of -unrelated -colors -all -just -as -i -had -seen -it -so -often -at -home -and -in -their -faces -and -their -gait -was -that -languishing -aristocratic -divine -delight -in -their -finery -which -was -so -familiar -to -me -and -had -always -been -such -a -satisfaction -to -my -eye -and -my -heart -i -seemed -among -old -old -friends -friends -of -fifty -years -and -i -stopped -and -cordially -greeted -them -they -broke -into -a -good -fellowship -laugh -flashing -their -white -teeth -upon -me -and -all -answered -at -once -i -did -not -understand -a -word -they -said -i -was -astonished -i -was -not -dreaming -that -they -would -answer -in -anything -but -american -the -voices -too -of -the -african -women -were -familiar -to -me -sweet -and -musical -just -like -those -of -the -slave -women -of -my -early -days -i -followed -a -couple -of -them -all -over -the -orange -free -state -no -over -its -capital -bloemfontein -to -hear -their -liquid -voices -and -the -happy -ripple -of -their -laughter -their -language -was -a -large -improvement -upon -american -also -upon -the -zulu -it -had -no -zulu -clicks -in -it -and -it -seemed -to -have -no -angles -or -corners -no -roughness -no -vile -s's -or -other -hissing -sounds -but -was -very -very -mellow -and -rounded -and -flowing -in -moving -about -the -country -in -the -trains -i -had -opportunity -to -see -a -good -many -boers -of -the -veldt -one -day -at -a -village -station -a -hundred -of -them -got -out -of -the -third -class -cars -to -feed -their -clothes -were -very -interesting -for -ugliness -of -shapes -and -for -miracles -of -ugly -colors -inharmoniously -associated -they -were -a -record -the -effect -was -nearly -as -exciting -and -interesting -as -that -produced -by -the -brilliant -and -beautiful -clothes -and -perfect -taste -always -on -view -at -the -indian -railway -stations -one -man -had -corduroy -trousers -of -a -faded -chewing -gum -tint -and -they -were -new -showing -that -this -tint -did -not -come -by -calamity -but -was -intentional -the -very -ugliest -color -i -have -ever -seen -a -gaunt -shackly -country -lout -six -feet -high -in -battered -gray -slouched -hat -with -wide -brim -and -old -resin -colored -breeches -had -on -a -hideous -brand -new -woolen -coat -which -was -imitation -tiger -skin -wavy -broad -stripes -of -dazzling -yellow -and -deep -brown -i -thought -he -ought -to -be -hanged -and -asked -the -station -master -if -it -could -be -arranged -he -said -no -and -not -only -that -but -said -it -rudely -said -it -with -a -quite -unnecessary -show -of -feeling -then -he -muttered -something -about -my -being -a -jackass -and -walked -away -and -pointed -me -out -to -people -and -did -everything -he -could -to -turn -public -sentiment -against -me -it -is -what -one -gets -for -trying -to -do -good -in -the -train -that -day -a -passenger -told -me -some -more -about -boer -life -out -in -the -lonely -veldt -he -said -the -boer -gets -up -early -and -sets -his -niggers -at -their -tasks -pasturing -the -cattle -and -watching -them -eats -smokes -drowses -sleeps -toward -evening -superintends -the -milking -etc -eats -smokes -drowses -goes -to -bed -at -early -candlelight -in -the -fragrant -clothes -he -and -she -have -worn -all -day -and -every -week -day -for -years -i -remember -that -last -detail -in -olive -schreiner's -story -of -an -african -farm -and -the -passenger -told -me -that -the -boers -were -justly -noted -for -their -hospitality -he -told -me -a -story -about -it -he -said -that -his -grace -the -bishop -of -a -certain -see -was -once -making -a -business -progress -through -the -tavernless -veldt -and -one -night -he -stopped -with -a -boer -after -supper -was -shown -to -bed -he -undressed -weary -and -worn -out -and -was -soon -sound -asleep -in -the -night -he -woke -up -feeling -crowded -and -suffocated -and -found -the -old -boer -and -his -fat -wife -in -bed -with -him -one -on -each -side -with -all -their -clothes -on -and -snoring -he -had -to -stay -there -and -stand -it -awake -and -suffering -until -toward -dawn -when -sleep -again -fell -upon -him -for -an -hour -then -he -woke -again -the -boer -was -gone -but -the -wife -was -still -at -his -side -those -reformers -detested -that -boer -prison -they -were -not -used -to -cramped -quarters -and -tedious -hours -and -weary -idleness -and -early -to -bed -and -limited -movement -and -arbitrary -and -irritating -rules -and -the -absence -of -the -luxuries -which -wealth -comforts -the -day -and -the -night -with -the -confinement -told -upon -their -bodies -and -their -spirits -still -they -were -superior -men -and -they -made -the -best -that -was -to -be -made -of -the -circumstances -their -wives -smuggled -delicacies -to -them -which -helped -to -smooth -the -way -down -for -the -prison -fare -in -the -train -mr -b -told -me -that -the -boer -jail -guards -treated -the -black -prisoners -even -political -ones -mercilessly -an -african -chief -and -his -following -had -been -kept -there -nine -months -without -trial -and -during -all -that -time -they -had -been -without -shelter -from -rain -and -sun -he -said -that -one -day -the -guards -put -a -big -black -in -the -stocks -for -dashing -his -soup -on -the -ground -they -stretched -his -legs -painfully -wide -apart -and -set -him -with -his -back -down -hill -he -could -not -endure -it -and -put -back -his -hands -upon -the -slope -for -a -support -the -guard -ordered -him -to -withdraw -the -support -and -kicked -him -in -the -back -then -said -mr -b -'the -powerful -black -wrenched -the -stocks -asunder -and -went -for -the -guard -a -reform -prisoner -pulled -him -off -and -thrashed -the -guard -himself -chapter -lxix -the -very -ink -with -which -all -history -is -written -is -merely -fluid -prejudice -pudd'nhead -wilsons's -new -calendar -there -isn't -a -parallel -of -latitude -but -thinks -it -would -have -been -the -equator -if -it -had -had -its -rights -pudd'nhead -wilson's -new -calendar -next -to -mr -rhodes -to -me -the -most -interesting -convulsion -of -nature -in -south -africa -was -the -diamond -crater -the -rand -gold -fields -are -a -stupendous -marvel -and -they -make -all -other -gold -fields -small -but -i -was -not -a -stranger -to -gold -mining -the -veldt -was -a -noble -thing -to -see -but -it -was -only -another -and -lovelier -variety -of -our -great -plains -the -natives -were -very -far -from -being -uninteresting -but -they -were -not -new -and -as -for -the -towns -i -could -find -my -way -without -a -guide -through -the -most -of -them -because -i -had -learned -the -streets -under -other -names -in -towns -just -like -them -in -other -lands -but -the -diamond -mine -was -a -wholly -fresh -thing -a -splendid -and -absorbing -novelty -very -few -people -in -the -world -have -seen -the -diamond -in -its -home -it -has -but -three -or -four -homes -in -the -world -whereas -gold -has -a -million -it -is -worth -while -to -journey -around -the -globe -to -see -anything -which -can -truthfully -be -called -a -novelty -and -the -diamond -mine -is -the -greatest -and -most -select -and -restricted -novelty -which -the -globe -has -in -stock -the -kimberley -diamond -deposits -were -discovered -about -1869 -i -think -when -everything -is -taken -into -consideration -the -wonder -is -that -they -were -not -discovered -five -thousand -years -ago -and -made -familiar -to -the -african -world -for -the -rest -of -time -for -this -reason -the -first -diamonds -were -found -on -the -surface -of -the -ground -they -were -smooth -and -limpid -and -in -the -sunlight -they -vomited -fire -they -were -the -very -things -which -an -african -savage -of -any -era -would -value -above -every -other -thing -in -the -world -excepting -a -glass -bead -for -two -or -three -centuries -we -have -been -buying -his -lands -his -cattle -his -neighbor -and -any -other -thing -he -had -for -sale -for -glass -beads -and -so -it -is -strange -that -he -was -indifferent -to -the -diamonds -for -he -must -have -pickets -them -up -many -and -many -a -time -it -would -not -occur -to -him -to -try -to -sell -them -to -whites -of -course -since -the -whites -already -had -plenty -of -glass -beads -and -more -fashionably -shaped -too -than -these -but -one -would -think -that -the -poorer -sort -of -black -who -could -not -afford -real -glass -would -have -been -humbly -content -to -decorate -himself -with -the -imitation -and -that -presently -the -white -trader -would -notice -the -things -and -dimly -suspect -and -carry -some -of -them -home -and -find -out -what -they -were -and -at -once -empty -a -multitude -of -fortune -hunters -into -africa -there -are -many -strange -things -in -human -history -one -of -the -strangest -is -that -the -sparkling -diamonds -laid -there -so -long -without -exciting -any -one's -interest -the -revelation -came -at -last -by -accident -in -a -boer's -hut -out -in -the -wide -solitude -of -the -plains -a -traveling -stranger -noticed -a -child -playing -with -a -bright -object -and -was -told -it -was -a -piece -of -glass -which -had -been -found -in -the -veldt -the -stranger -bought -it -for -a -trifle -and -carried -it -away -and -being -without -honor -made -another -stranger -believe -it -was -a -diamond -and -so -got -$125 -out -of -him -for -it -and -was -as -pleased -with -himself -as -if -he -had -done -a -righteous -thing -in -paris -the -wronged -stranger -sold -it -to -a -pawnshop -for -$10 -000 -who -sold -it -to -a -countess -for -$90 -000 -who -sold -it -to -a -brewer -for -$800 -000 -who -traded -it -to -a -king -for -a -dukedom -and -a -pedigree -and -the -king -put -it -up -the -spout -[handwritten -note -from -the -greek -meaning -'pawned -it -' -m -t -] -i -know -these -particulars -to -be -correct -the -news -flew -around -and -the -south -african -diamond -boom -began -the -original -traveler -the -dishonest -one -now -remembered -that -he -had -once -seen -a -boer -teamster -chocking -his -wagon -wheel -on -a -steep -grade -with -a -diamond -as -large -as -a -football -and -he -laid -aside -his -occupations -and -started -out -to -hunt -for -it -but -not -with -the -intention -of -cheating -anybody -out -of -$125 -with -it -for -he -had -reformed -we -now -come -to -matters -more -didactic -diamonds -are -not -imbedded -in -rock -ledges -fifty -miles -long -like -the -johannesburg -gold -but -are -distributed -through -the -rubbish -of -a -filled -up -well -so -to -speak -the -well -is -rich -its -walls -are -sharply -defined -outside -of -the -walls -are -no -diamonds -the -well -is -a -crater -and -a -large -one -before -it -had -been -meddled -with -its -surface -was -even -with -the -level -plain -and -there -was -no -sign -to -suggest -that -it -was -there -the -pasturage -covering -the -surface -of -the -kimberley -crater -was -sufficient -for -the -support -of -a -cow -and -the -pasturage -underneath -was -sufficient -for -the -support -of -a -kingdom -but -the -cow -did -not -know -it -and -lost -her -chance -the -kimberley -crater -is -roomy -enough -to -admit -the -roman -coliseum -the -bottom -of -the -crater -has -not -been -reached -and -no -one -can -tell -how -far -down -in -the -bowels -of -the -earth -it -goes -originally -it -was -a -perpendicular -hole -packed -solidly -full -of -blue -rock -or -cement -and -scattered -through -that -blue -mass -like -raisins -in -a -pudding -were -the -diamonds -as -deep -down -in -the -earth -as -the -blue -stuff -extends -so -deep -will -the -diamonds -be -found -there -are -three -or -four -other -celebrated -craters -near -by -a -circle -three -miles -in -diameter -would -enclose -them -all -they -are -owned -by -the -de -beers -company -a -consolidation -of -diamond -properties -arranged -by -mr -rhodes -twelve -or -fourteen -years -ago -the -de -beers -owns -other -craters -they -are -under -the -grass -but -the -de -beers -knows -where -they -are -and -will -open -them -some -day -if -the -market -should -require -it -originally -the -diamond -deposits -were -the -property -of -the -orange -free -state -but -a -judicious -rectification -of -the -boundary -line -shifted -them -over -into -the -british -territory -of -cape -colony -a -high -official -of -the -free -state -told -me -that -the -sum -of -$4 -00 -000 -was -handed -to -his -commonwealth -as -a -compromise -or -indemnity -or -something -of -the -sort -and -that -he -thought -his -commonwealth -did -wisely -to -take -the -money -and -keep -out -of -a -dispute -since -the -power -was -all -on -the -one -side -and -the -weakness -all -on -the -other -the -de -beers -company -dig -out -$400 -000 -worth -of -diamonds -per -week -now -the -cape -got -the -territory -but -no -profit -for -mr -rhodes -and -the -rothschilds -and -the -other -de -beers -people -own -the -mines -and -they -pay -no -taxes -in -our -day -the -mines -are -worked -upon -scientific -principles -under -the -guidance -of -the -ablest -mining -engineering -talent -procurable -in -america -there -are -elaborate -works -for -reducing -the -blue -rock -and -passing -it -through -one -process -after -another -until -every -diamond -it -contains -has -been -hunted -down -and -secured -i -watched -the -concentrators -at -work -big -tanks -containing -mud -and -water -and -invisible -diamonds -and -was -told -that -each -could -stir -and -churn -and -properly -treat -300 -car -loads -of -mud -per -day -1 -600 -pounds -to -the -car -load -and -reduce -it -to -3 -car -loads -of -slush -i -saw -the -3 -carloads -of -slush -taken -to -the -pulsators -and -there -reduced -to -quarter -of -a -load -of -nice -clean -dark -colored -sand -then -i -followed -it -to -the -sorting -tables -and -saw -the -men -deftly -and -swiftly -spread -it -out -and -brush -it -about -and -seize -the -diamonds -as -they -showed -up -i -assisted -and -once -i -found -a -diamond -half -as -large -as -an -almond -it -is -an -exciting -kind -of -fishing -and -you -feel -a -fine -thrill -of -pleasure -every -time -you -detect -the -glow -of -one -of -those -limpid -pebbles -through -the -veil -of -dark -sand -i -would -like -to -spend -my -saturday -holidays -in -that -charming -sport -every -now -and -then -of -course -there -are -disappointments -sometimes -you -find -a -diamond -which -is -not -a -diamond -it -is -only -a -quartz -crystal -or -some -such -worthless -thing -the -expert -can -generally -distinguish -it -from -the -precious -stone -which -it -is -counterfeiting -but -if -he -is -in -doubt -he -lays -it -on -a -flatiron -and -hits -it -with -a -sledgehammer -if -it -is -a -diamond -it -holds -its -own -if -it -is -anything -else -it -is -reduced -to -powder -i -liked -that -experiment -very -much -and -did -not -tire -of -repetitions -of -it -it -was -full -of -enjoyable -apprehensions -unmarred -by -any -personal -sense -of -risk -the -de -beers -concern -treats -8 -000 -carloads -about -6 -000 -tons -of -blue -rock -per -day -and -the -result -is -three -pounds -of -diamonds -value -uncut -$50 -000 -to -$70 -000 -after -cutting -they -will -weigh -considerably -less -than -a -pound -but -will -be -worth -four -or -five -times -as -much -as -they -were -before -all -the -plain -around -that -region -is -spread -over -a -foot -deep -with -blue -rock -placed -there -by -the -company -and -looks -like -a -plowed -field -exposure -for -a -length -of -time -make -the -rock -easier -to -work -than -it -is -when -it -comes -out -of -the -mine -if -mining -should -cease -now -the -supply -of -rock -spread -over -those -fields -would -furnish -the -usual -8 -000 -car -loads -per -day -to -the -separating -works -during -three -years -the -fields -are -fenced -and -watched -and -at -night -they -are -under -the -constant -inspection -of -lofty -electric -searchlight -they -contain -fifty -or -sixty -million -dollars' -worth' -of -diamonds -and -there -is -an -abundance -of -enterprising -thieves -around -in -the -dirt -of -the -kimberley -streets -there -is -much -hidden -wealth -some -time -ago -the -people -were -granted -the -privilege -of -a -free -wash -up -there -was -a -general -rush -the -work -was -done -with -thoroughness -and -a -good -harvest -of -diamonds -was -gathered -the -deep -mining -is -done -by -natives -there -are -many -hundreds -of -them -they -live -in -quarters -built -around -the -inside -of -a -great -compound -they -are -a -jolly -and -good -natured -lot -and -accommodating -they -performed -a -war -dance -for -us -which -was -the -wildest -exhibition -i -have -ever -seen -they -are -not -allowed -outside -of -the -compound -during -their -term -of -service -three -months -i -think -it -is -as -a -rule -they -go -down -the -shaft -stand -their -watch -come -up -again -are -searched -and -go -to -bed -or -to -their -amusements -in -the -compound -and -this -routine -they -repeat -day -in -and -day -out -it -is -thought -that -they -do -not -now -steal -many -diamonds -successfully -they -used -to -swallow -them -and -find -other -ways -of -concealing -them -but -the -white -man -found -ways -of -beating -their -various -games -one -man -cut -his -leg -and -shoved -a -diamond -into -the -wound -but -even -that -project -did -not -succeed -when -they -find -a -fine -large -diamond -they -are -more -likely -to -report -it -than -to -steal -it -for -in -the -former -case -they -get -a -reward -and -in -the -latter -they -are -quite -apt -to -merely -get -into -trouble -some -years -ago -in -a -mine -not -owned -by -the -de -beers -a -black -found -what -has -been -claimed -to -be -the -largest -diamond -known -to -the -world's -history -and -as -a -reward -he -was -released -from -service -and -given -a -blanket -a -horse -and -five -hundred -dollars -it -made -him -a -vanderbilt -he -could -buy -four -wives -and -have -money -left -four -wives -are -an -ample -support -for -a -native -with -four -wives -he -is -wholly -independent -and -need -never -do -a -stroke -of -work -again -that -great -diamond -weighs -97l -carats -some -say -it -is -as -big -as -a -piece -of -alum -others -say -it -is -as -large -as -a -bite -of -rock -candy -but -the -best -authorities -agree -that -it -is -almost -exactly -the -size -of -a -chunk -of -ice -but -those -details -are -not -important -and -in -my -opinion -not -trustworthy -it -has -a -flaw -in -it -otherwise -it -would -be -of -incredible -value -as -it -is -it -is -held -to -be -worth -$2 -000 -000 -after -cutting -it -ought -to -be -worth -from -$5 -000 -000 -to -$8 -000 -000 -therefore -persons -desiring -to -save -money -should -buy -it -now -it -is -owned -by -a -syndicate -and -apparently -there -is -no -satisfactory -market -for -it -it -is -earning -nothing -it -is -eating -its -head -off -up -to -this -time -it -has -made -nobody -rich -but -the -native -who -found -it -he -found -it -in -a -mine -which -was -being -worked -by -contract -that -is -to -say -a -company -had -bought -the -privilege -of -taking -from -the -mine -5 -000 -000 -carloads -of -blue -rock -for -a -sum -down -and -a -royalty -their -speculation -had -not -paid -but -on -the -very -day -that -their -privilege -ran -out -that -native -found -the -$2 -000 -000 -diamond -and -handed -it -over -to -them -even -the -diamond -culture -is -not -without -its -romantic -episodes -the -koh -i -noor -is -a -large -diamond -and -valuable -but -it -cannot -compete -in -these -matters -with -three -which -according -to -legend -are -among -the -crown -trinkets -of -portugal -and -russia -one -of -these -is -held -to -be -worth -$20 -000 -000 -another -$25 -000 -000 -and -the -third -something -over -$28 -000 -000 -those -are -truly -wonderful -diamonds -whether -they -exist -or -not -and -yet -they -are -of -but -little -importance -by -comparison -with -the -one -wherewith -the -boer -wagoner -chocked -his -wheel -on -that -steep -grade -as -heretofore -referred -to -in -kimberley -i -had -some -conversation -with -the -man -who -saw -the -boer -do -that -an -incident -which -had -occurred -twenty -seven -or -twenty -eight -years -before -i -had -my -talk -with -him -he -assured -me -that -that -diamond's -value -could -have -been -over -a -billion -dollars -but -not -under -it -i -believed -him -because -he -had -devoted -twenty -seven -years -to -hunting -for -it -and -was -in -a -position -to -know -a -fitting -and -interesting -finish -to -an -examination -of -the -tedious -and -laborious -and -costly -processes -whereby -the -diamonds -are -gotten -out -of -the -deeps -of -the -earth -and -freed -from -the -base -stuffs -which -imprison -them -is -the -visit -to -the -de -beers -offices -in -the -town -of -kimberley -where -the -result -of -each -day's -mining -is -brought -every -day -and -weighed -assorted -valued -and -deposited -in -safes -against -shipping -day -an -unknown -and -unaccredited -person -cannot -get -into -that -place -and -it -seemed -apparent -from -the -generous -supply -of -warning -and -protective -and -prohibitory -signs -that -were -posted -all -about -that -not -even -the -known -and -accredited -can -steal -diamonds -there -without -inconvenience -we -saw -the -day's -output -shining -little -nests -of -diamonds -distributed -a -foot -apart -along -a -counter -each -nest -reposing -upon -a -sheet -of -white -paper -that -day's -catch -was -about -$70 -000 -worth -in -the -course -of -a -year -half -a -ton -of -diamonds -pass -under -the -scales -there -and -sleep -on -that -counter -the -resulting -money -is -$18 -000 -000 -or -$20 -000 -000 -profit -about -$12 -000 -000 -young -girls -were -doing -the -sorting -a -nice -clean -dainty -and -probably -distressing -employment -every -day -ducal -incomes -sift -and -sparkle -through -the -fingers -of -those -young -girls -yet -they -go -to -bed -at -night -as -poor -as -they -were -when -they -got -up -in -the -morning -the -same -thing -next -day -and -all -the -days -they -are -beautiful -things -those -diamonds -in -their -native -state -they -are -of -various -shapes -they -have -flat -surfaces -rounded -borders -and -never -a -sharp -edge -they -are -of -all -colors -and -shades -of -color -from -dewdrop -white -to -actual -black -and -their -smooth -and -rounded -surfaces -and -contours -variety -of -color -and -transparent -limpidity -make -them -look -like -piles -of -assorted -candies -a -very -light -straw -color -is -their -commonest -tint -it -seemed -to -me -that -these -uncut -gems -must -be -more -beautiful -than -any -cut -ones -could -be -but -when -a -collection -of -cut -ones -was -brought -out -i -saw -my -mistake -nothing -is -so -beautiful -as -a -rose -diamond -with -the -light -playing -through -it -except -that -uncostly -thing -which -is -just -like -it -wavy -sea -water -with -the -sunlight -playing -through -it -and -striking -a -white -sand -bottom -before -the -middle -of -july -we -reached -cape -town -and -the -end -of -our -african -journeyings -and -well -satisfied -for -towering -above -us -was -table -mountain -a -reminder -that -we -had -now -seen -each -and -all -of -the -great -features -of -south -africa -except -mr -cecil -rhodes -i -realize -that -that -is -a -large -exception -i -know -quite -well -that -whether -mr -rhodes -is -the -lofty -and -worshipful -patriot -and -statesman -that -multitudes -believe -him -to -be -or -satan -come -again -as -the -rest -of -the -world -account -him -he -is -still -the -most -imposing -figure -in -the -british -empire -outside -of -england -when -he -stands -on -the -cape -of -good -hope -his -shadow -falls -to -the -zambesi -he -is -the -only -colonial -in -the -british -dominions -whose -goings -and -comings -are -chronicled -and -discussed -under -all -the -globe's -meridians -and -whose -speeches -unclipped -are -cabled -from -the -ends -of -the -earth -and -he -is -the -only -unroyal -outsider -whose -arrival -in -london -can -compete -for -attention -with -an -eclipse -that -he -is -an -extraordinary -man -and -not -an -accident -of -fortune -not -even -his -dearest -south -african -enemies -were -willing -to -deny -so -far -as -i -heard -them -testify -the -whole -south -african -world -seemed -to -stand -in -a -kind -of -shuddering -awe -of -him -friend -and -enemy -alike -it -was -as -if -he -were -deputy -god -on -the -one -side -deputy -satan -on -the -other -proprietor -of -the -people -able -to -make -them -or -ruin -them -by -his -breath -worshiped -by -many -hated -by -many -but -blasphemed -by -none -among -the -judicious -and -even -by -the -indiscreet -in -guarded -whispers -only -what -is -the -secret -of -his -formidable -supremacy -one -says -it -is -his -prodigious -wealth -a -wealth -whose -drippings -in -salaries -and -in -other -ways -support -multitudes -and -make -them -his -interested -and -loyal -vassals -another -says -it -is -his -personal -magnetism -and -his -persuasive -tongue -and -that -these -hypnotize -and -make -happy -slaves -of -all -that -drift -within -the -circle -of -their -influence -another -says -it -is -his -majestic -ideas -his -vast -schemes -for -the -territorial -aggrandizement -of -england -his -patriotic -and -unselfish -ambition -to -spread -her -beneficent -protection -and -her -just -rule -over -the -pagan -wastes -of -africa -and -make -luminous -the -african -darkness -with -the -glory -of -her -name -and -another -says -he -wants -the -earth -and -wants -it -for -his -own -and -that -the -belief -that -he -will -get -it -and -let -his -friends -in -on -the -ground -floor -is -the -secret -that -rivets -so -many -eyes -upon -him -and -keeps -him -in -the -zenith -where -the -view -is -unobstructed -one -may -take -his -choice -they -are -all -the -same -price -one -fact -is -sure -he -keeps -his -prominence -and -a -vast -following -no -matter -what -he -does -he -deceives -the -duke -of -fife -it -is -the -duke's -word -but -that -does -not -destroy -the -duke's -loyalty -to -him -he -tricks -the -reformers -into -immense -trouble -with -his -raid -but -the -most -of -them -believe -he -meant -well -he -weeps -over -the -harshly -taxed -johannesburgers -and -makes -them -his -friends -at -the -same -time -he -taxes -his -charter -settlers -50 -per -cent -and -so -wins -their -affection -and -their -confidence -that -they -are -squelched -with -despair -at -every -rumor -that -the -charter -is -to -be -annulled -he -raids -and -robs -and -slays -and -enslaves -the -matabele -and -gets -worlds -of -charter -christian -applause -for -it -he -has -beguiled -england -into -buying -charter -waste -paper -for -bank -of -england -notes -ton -for -ton -and -the -ravished -still -burn -incense -to -him -as -the -eventual -god -of -plenty -he -has -done -everything -he -could -think -of -to -pull -himself -down -to -the -ground -he -has -done -more -than -enough -to -pull -sixteen -common -run -great -men -down -yet -there -he -stands -to -this -day -upon -his -dizzy -summit -under -the -dome -of -the -sky -an -apparent -permanency -the -marvel -of -the -time -the -mystery -of -the -age -an -archangel -with -wings -to -half -the -world -satan -with -a -tail -to -the -other -half -i -admire -him -i -frankly -confess -it -and -when -his -time -comes -i -shall -buy -a -piece -of -the -rope -for -a -keepsake -conclusion -i -have -traveled -more -than -anyone -else -and -i -have -noticed -that -even -the -angels -speak -english -with -an -accent -pudd'nhead -wilson's -new -calendar -i -saw -table -rock -anyway -a -majestic -pile -it -is -3 -000 -feet -high -it -is -also -17 -000 -feet -high -these -figures -may -be -relied -upon -i -got -them -in -cape -town -from -the -two -best -informed -citizens -men -who -had -made -table -rock -the -study -of -their -lives -and -i -saw -table -bay -so -named -for -its -levelness -i -saw -the -castle -built -by -the -dutch -east -india -company -three -hundred -years -ago -where -the -commanding -general -lives -i -saw -st -simon's -bay -where -the -admiral -lives -i -saw -the -government -also -the -parliament -where -they -quarreled -in -two -languages -when -i -was -there -and -agreed -in -none -i -saw -the -club -i -saw -and -explored -the -beautiful -sea -girt -drives -that -wind -about -the -mountains -and -through -the -paradise -where -the -villas -are -also -i -saw -some -of -the -fine -old -dutch -mansions -pleasant -homes -of -the -early -times -pleasant -homes -to -day -and -enjoyed -the -privilege -of -their -hospitalities -and -just -before -i -sailed -i -saw -in -one -of -them -a -quaint -old -picture -which -was -a -link -in -a -curious -romance -a -picture -of -a -pale -intellectual -young -man -in -a -pink -coat -with -a -high -black -collar -it -was -a -portrait -of -dr -james -barry -a -military -surgeon -who -came -out -to -the -cape -fifty -years -ago -with -his -regiment -he -was -a -wild -young -fellow -and -was -guilty -of -various -kinds -of -misbehavior -he -was -several -times -reported -to -headquarters -in -england -and -it -was -in -each -case -expected -that -orders -would -come -out -to -deal -with -him -promptly -and -severely -but -for -some -mysterious -reason -no -orders -of -any -kind -ever -came -back -nothing -came -but -just -an -impressive -silence -this -made -him -an -imposing -and -uncanny -wonder -to -the -town -next -he -was -promoted -away -up -he -was -made -medical -superintendent -general -and -transferred -to -india -presently -he -was -back -at -the -cape -again -and -at -his -escapades -once -more -there -were -plenty -of -pretty -girls -but -none -of -them -caught -him -none -of -them -could -get -hold -of -his -heart -evidently -he -was -not -a -marrying -man -and -that -was -another -marvel -another -puzzle -and -made -no -end -of -perplexed -talk -once -he -was -called -in -the -night -an -obstetric -service -to -do -what -he -could -for -a -woman -who -was -believed -to -be -dying -he -was -prompt -and -scientific -and -saved -both -mother -and -child -there -are -other -instances -of -record -which -testify -to -his -mastership -of -his -profession -and -many -which -testify -to -his -love -of -it -and -his -devotion -to -it -among -other -adventures -of -his -was -a -duel -of -a -desperate -sort -fought -with -swords -at -the -castle -he -killed -his -man -the -child -heretofore -mentioned -as -having -been -saved -by -dr -barry -so -long -ago -was -named -for -him -and -still -lives -in -cape -town -he -had -dr -barry's -portrait -painted -and -gave -it -to -the -gentleman -in -whose -old -dutch -house -i -saw -it -the -quaint -figure -in -pink -coat -and -high -black -collar -the -story -seems -to -be -arriving -nowhere -but -that -is -because -i -have -not -finished -dr -barry -died -in -cape -town -30 -years -ago -it -was -then -discovered -that -he -was -a -woman -the -legend -goes -that -enquiries -soon -silenced -developed -the -fact -that -she -was -a -daughter -of -a -great -english -house -and -that -that -was -why -her -cape -wildnesses -brought -no -punishment -and -got -no -notice -when -reported -to -the -government -at -home -her -name -was -an -alias -she -had -disgraced -herself -with -her -people -so -she -chose -to -change -her -name -and -her -sex -and -take -a -new -start -in -the -world -we -sailed -on -the -15th -of -july -in -the -norman -a -beautiful -ship -perfectly -appointed -the -voyage -to -england -occupied -a -short -fortnight -without -a -stop -except -at -madeira -a -good -and -restful -voyage -for -tired -people -and -there -were -several -of -us -i -seemed -to -have -been -lecturing -a -thousand -years -though -it -was -only -a -twelvemonth -and -a -considerable -number -of -the -others -were -reformers -who -were -fagged -out -with -their -five -months -of -seclusion -in -the -pretoria -prison -our -trip -around -the -earth -ended -at -the -southampton -pier -where -we -embarked -thirteen -months -before -it -seemed -a -fine -and -large -thing -to -have -accomplished -the -circumnavigation -of -this -great -globe -in -that -little -time -and -i -was -privately -proud -of -it -for -a -moment -then -came -one -of -those -vanity -snubbing -astronomical -reports -from -the -observatory -people -whereby -it -appeared -that -another -great -body -of -light -had -lately -flamed -up -in -the -remotenesses -of -space -which -was -traveling -at -a -gait -which -would -enable -it -to -do -all -that -i -had -done -in -a -minute -and -a -half -human -pride -is -not -worth -while -there -is -always -something -lying -in -wait -to -take -the -wind -out -of -it -end -of -the -project -gutenberg -ebook -of -following -the -equator -complete -by -mark -twain -samuel -clemens -the -full -project -gutenberg -license -please -read -this -before -you -distribute -or -use -this -work -to -protect -the -project -gutenberg -tm -mission -of -promoting -the -free -distribution -of -electronic -works -by -using -or -distributing -this -work -or -any -other -work -associated -in -any -way -with -the -phrase -project -gutenberg -you -agree -to -comply -with -all -the -terms -of -the -full -project -gutenberg -tm -license -available -with -this -file -or -online -at -http -//gutenberg -net/license -section -1 -general -terms -of -use -and -redistributing -project -gutenberg -tm -electronic -works -1 -a -by -reading -or -using -any -part -of -this -project -gutenberg -tm -electronic -work -you -indicate -that -you -have -read -understand -agree -to -and -accept -all -the -terms -of -this -license -and -intellectual -property -trademark/copyright -agreement -if -you -do -not -agree -to -abide -by -all -the -terms -of -this -agreement -you -must -cease -using -and -return -or -destroy -all -copies -of -project -gutenberg -tm -electronic -works -in -your -possession -if -you -paid -a -fee -for -obtaining -a -copy -of -or -access -to -a -project -gutenberg -tm -electronic -work -and -you -do -not -agree -to -be -bound -by -the -terms -of -this -agreement -you -may -obtain -a -refund -from -the -person -or -entity -to -whom -you -paid -the -fee -as -set -forth -in -paragraph -1 -e -8 -1 -b -project -gutenberg -is -a -registered -trademark -it -may -only -be -used -on -or -associated -in -any -way -with -an -electronic -work -by -people -who -agree -to -be -bound -by -the -terms -of -this -agreement -there -are -a -few -things -that -you -can -do -with -most -project -gutenberg -tm -electronic -works -even -without -complying -with -the -full -terms -of -this -agreement -see -paragraph -1 -c -below -there -are -a -lot -of -things -you -can -do -with -project -gutenberg -tm -electronic -works -if -you -follow -the -terms -of -this -agreement -and -help -preserve -free -future -access -to -project -gutenberg -tm -electronic -works -see -paragraph -1 -e -below -1 -c -the -project -gutenberg -literary -archive -foundation -the -foundation -or -pglaf -owns -a -compilation -copyright -in -the -collection -of -project -gutenberg -tm -electronic -works -nearly -all -the -individual -works -in -the -collection -are -in -the -public -domain -in -the -united -states -if -an -individual -work -is -in -the -public -domain -in -the -united -states -and -you -are -located -in -the -united -states -we -do -not -claim -a -right -to -prevent -you -from -copying -distributing -performing -displaying -or -creating -derivative -works -based -on -the -work -as -long -as -all -references -to -project -gutenberg -are -removed -of -course -we -hope -that -you -will -support -the -project -gutenberg -tm -mission -of -promoting -free -access -to -electronic -works -by -freely -sharing -project -gutenberg -tm -works -in -compliance -with -the -terms -of -this -agreement -for -keeping -the -project -gutenberg -tm -name -associated -with -the -work -you -can -easily -comply -with -the -terms -of -this -agreement -by -keeping -this -work -in -the -same -format -with -its -attached -full -project -gutenberg -tm -license -when -you -share -it -without -charge -with -others -1 -d -the -copyright -laws -of -the -place -where -you -are -located -also -govern -what -you -can -do -with -this -work -copyright -laws -in -most -countries -are -in -a -constant -state -of -change -if -you -are -outside -the -united -states -check -the -laws -of -your -country -in -addition -to -the -terms -of -this -agreement -before -downloading -copying -displaying -performing -distributing -or -creating -derivative -works -based -on -this -work -or -any -other -project -gutenberg -tm -work -the -foundation -makes -no -representations -concerning -the -copyright -status -of -any -work -in -any -country -outside -the -united -states -1 -e -unless -you -have -removed -all -references -to -project -gutenberg -1 -e -1 -the -following -sentence -with -active -links -to -or -other -immediate -access -to -the -full -project -gutenberg -tm -license -must -appear -prominently -whenever -any -copy -of -a -project -gutenberg -tm -work -any -work -on -which -the -phrase -project -gutenberg -appears -or -with -which -the -phrase -project -gutenberg -is -associated -is -accessed -displayed -performed -viewed -copied -or -distributed -this -ebook -is -for -the -use -of -anyone -anywhere -at -no -cost -and -with -almost -no -restrictions -whatsoever -you -may -copy -it -give -it -away -or -re -use -it -under -the -terms -of -the -project -gutenberg -license -included -with -this -ebook -or -online -at -www -gutenberg -net -1 -e -2 -if -an -individual -project -gutenberg -tm -electronic -work -is -derived -from -the -public -domain -does -not -contain -a -notice -indicating -that -it -is -posted -with -permission -of -the -copyright -holder -the -work -can -be -copied -and -distributed -to -anyone -in -the -united -states -without -paying -any -fees -or -charges -if -you -are -redistributing -or -providing -access -to -a -work -with -the -phrase -project -gutenberg -associated -with -or -appearing -on -the -work -you -must -comply -either -with -the -requirements -of -paragraphs -1 -e -1 -through -1 -e -7 -or -obtain -permission -for -the -use -of -the -work -and -the -project -gutenberg -tm -trademark -as -set -forth -in -paragraphs -1 -e -8 -or -1 -e -9 -1 -e -3 -if -an -individual -project -gutenberg -tm -electronic -work -is -posted -with -the -permission -of -the -copyright -holder -your -use -and -distribution -must -comply -with -both -paragraphs -1 -e -1 -through -1 -e -7 -and -any -additional -terms -imposed -by -the -copyright -holder -additional -terms -will -be -linked -to -the -project -gutenberg -tm -license -for -all -works -posted -with -the -permission -of -the -copyright -holder -found -at -the -beginning -of -this -work -1 -e -4 -do -not -unlink -or -detach -or -remove -the -full -project -gutenberg -tm -license -terms -from -this -work -or -any -files -containing -a -part -of -this -work -or -any -other -work -associated -with -project -gutenberg -tm -1 -e -5 -do -not -copy -display -perform -distribute -or -redistribute -this -electronic -work -or -any -part -of -this -electronic -work -without -prominently -displaying -the -sentence -set -forth -in -paragraph -1 -e -1 -with -active -links -or -immediate -access -to -the -full -terms -of -the -project -gutenberg -tm -license -1 -e -6 -you -may -convert -to -and -distribute -this -work -in -any -binary -compressed -marked -up -nonproprietary -or -proprietary -form -including -any -word -processing -or -hypertext -form -however -if -you -provide -access -to -or -distribute -copies -of -a -project -gutenberg -tm -work -in -a -format -other -than -plain -vanilla -ascii -or -other -format -used -in -the -official -version -posted -on -the -official -project -gutenberg -tm -web -site -www -gutenberg -net -you -must -at -no -additional -cost -fee -or -expense -to -the -user -provide -a -copy -a -means -of -exporting -a -copy -or -a -means -of -obtaining -a -copy -upon -request -of -the -work -in -its -original -plain -vanilla -ascii -or -other -form -any -alternate -format -must -include -the -full -project -gutenberg -tm -license -as -specified -in -paragraph -1 -e -1 -1 -e -7 -do -not -charge -a -fee -for -access -to -viewing -displaying -performing -copying -or -distributing -any -project -gutenberg -tm -works -unless -you -comply -with -paragraph -1 -e -8 -or -1 -e -9 -1 -e -8 -you -may -charge -a -reasonable -fee -for -copies -of -or -providing -access -to -or -distributing -project -gutenberg -tm -electronic -works -provided -that -you -pay -a -royalty -fee -of -20% -of -the -gross -profits -you -derive -from -the -use -of -project -gutenberg -tm -works -calculated -using -the -method -you -already -use -to -calculate -your -applicable -taxes -the -fee -is -owed -to -the -owner -of -the -project -gutenberg -tm -trademark -but -he -has -agreed -to -donate -royalties -under -this -paragraph -to -the -project -gutenberg -literary -archive -foundation -royalty -payments -must -be -paid -within -60 -days -following -each -date -on -which -you -prepare -or -are -legally -required -to -prepare -your -periodic -tax -returns -royalty -payments -should -be -clearly -marked -as -such -and -sent -to -the -project -gutenberg -literary -archive -foundation -at -the -address -specified -in -section -4 -information -about -donations -to -the -project -gutenberg -literary -archive -foundation -you -provide -a -full -refund -of -any -money -paid -by -a -user -who -notifies -you -in -writing -or -by -e -mail -within -30 -days -of -receipt -that -s/he -does -not -agree -to -the -terms -of -the -full -project -gutenberg -tm -license -you -must -require -such -a -user -to -return -or -destroy -all -copies -of -the -works -possessed -in -a -physical -medium -and -discontinue -all -use -of -and -all -access -to -other -copies -of -project -gutenberg -tm -works -you -provide -in -accordance -with -paragraph -1 -f -3 -a -full -refund -of -any -money -paid -for -a -work -or -a -replacement -copy -if -a -defect -in -the -electronic -work -is -discovered -and -reported -to -you -within -90 -days -of -receipt -of -the -work -you -comply -with -all -other -terms -of -this -agreement -for -free -distribution -of -project -gutenberg -tm -works -1 -e -9 -if -you -wish -to -charge -a -fee -or -distribute -a -project -gutenberg -tm -electronic -work -or -group -of -works -on -different -terms -than -are -set -forth -in -this -agreement -you -must -obtain -permission -in -writing -from -both -the -project -gutenberg -literary -archive -foundation -and -michael -hart -the -owner -of -the -project -gutenberg -tm -trademark -contact -the -foundation -as -set -forth -in -section -3 -below -1 -f -1 -f -1 -project -gutenberg -volunteers -and -employees -expend -considerable -effort -to -identify -do -copyright -research -on -transcribe -and -proofread -public -domain -works -in -creating -the -project -gutenberg -tm -collection -despite -these -efforts -project -gutenberg -tm -electronic -works -and -the -medium -on -which -they -may -be -stored -may -contain -defects -such -as -but -not -limited -to -incomplete -inaccurate -or -corrupt -data -transcription -errors -a -copyright -or -other -intellectual -property -infringement -a -defective -or -damaged -disk -or -other -medium -a -computer -virus -or -computer -codes -that -damage -or -cannot -be -read -by -your -equipment -1 -f -2 -limited -warranty -disclaimer -of -damages -except -for -the -right -of -replacement -or -refund -described -in -paragraph -1 -f -3 -the -project -gutenberg -literary -archive -foundation -the -owner -of -the -project -gutenberg -tm -trademark -and -any -other -party -distributing -a -project -gutenberg -tm -electronic -work -under -this -agreement -disclaim -all -liability -to -you -for -damages -costs -and -expenses -including -legal -fees -you -agree -that -you -have -no -remedies -for -negligence -strict -liability -breach -of -warranty -or -breach -of -contract -except -those -provided -in -paragraph -f3 -you -agree -that -the -foundation -the -trademark -owner -and -any -distributor -under -this -agreement -will -not -be -liable -to -you -for -actual -direct -indirect -consequential -punitive -or -incidental -damages -even -if -you -give -notice -of -the -possibility -of -such -damage -1 -f -3 -limited -right -of -replacement -or -refund -if -you -discover -a -defect -in -this -electronic -work -within -90 -days -of -receiving -it -you -can -receive -a -refund -of -the -money -if -any -you -paid -for -it -by -sending -a -written -explanation -to -the -person -you -received -the -work -from -if -you -received -the -work -on -a -physical -medium -you -must -return -the -medium -with -your -written -explanation -the -person -or -entity -that -provided -you -with -the -defective -work -may -elect -to -provide -a -replacement -copy -in -lieu -of -a -refund -if -you -received -the -work -electronically -the -person -or -entity -providing -it -to -you -may -choose -to -give -you -a -second -opportunity -to -receive -the -work -electronically -in -lieu -of -a -refund -if -the -second -copy -is -also -defective -you -may -demand -a -refund -in -writing -without -further -opportunities -to -fix -the -problem -1 -f -4 -except -for -the -limited -right -of -replacement -or -refund -set -forth -in -paragraph -1 -f -3 -this -work -is -provided -to -you -'as -is' -with -no -other -warranties -of -any -kind -express -or -implied -including -but -not -limited -to -warranties -of -merchantibility -or -fitness -for -any -purpose -1 -f -5 -some -states -do -not -allow -disclaimers -of -certain -implied -warranties -or -the -exclusion -or -limitation -of -certain -types -of -damages -if -any -disclaimer -or -limitation -set -forth -in -this -agreement -violates -the -law -of -the -state -applicable -to -this -agreement -the -agreement -shall -be -interpreted -to -make -the -maximum -disclaimer -or -limitation -permitted -by -the -applicable -state -law -the -invalidity -or -unenforceability -of -any -provision -of -this -agreement -shall -not -void -the -remaining -provisions -1 -f -6 -indemnity -you -agree -to -indemnify -and -hold -the -foundation -the -trademark -owner -any -agent -or -employee -of -the -foundation -anyone -providing -copies -of -project -gutenberg -tm -electronic -works -in -accordance -with -this -agreement -and -any -volunteers -associated -with -the -production -promotion -and -distribution -of -project -gutenberg -tm -electronic -works -harmless -from -all -liability -costs -and -expenses -including -legal -fees -that -arise -directly -or -indirectly -from -any -of -the -following -which -you -do -or -cause -to -occur -a -distribution -of -this -or -any -project -gutenberg -tm -work -b -alteration -modification -or -additions -or -deletions -to -any -project -gutenberg -tm -work -and -c -any -defect -you -cause -section -2 -information -about -the -mission -of -project -gutenberg -tm -project -gutenberg -tm -is -synonymous -with -the -free -distribution -of -electronic -works -in -formats -readable -by -the -widest -variety -of -computers -including -obsolete -old -middle -aged -and -new -computers -it -exists -because -of -the -efforts -of -hundreds -of -volunteers -and -donations -from -people -in -all -walks -of -life -volunteers -and -financial -support -to -provide -volunteers -with -the -assistance -they -need -is -critical -to -reaching -project -gutenberg -tm's -goals -and -ensuring -that -the -project -gutenberg -tm -collection -will -remain -freely -available -for -generations -to -come -in -2001 -the -project -gutenberg -literary -archive -foundation -was -created -to -provide -a -secure -and -permanent -future -for -project -gutenberg -tm -and -future -generations -to -learn -more -about -the -project -gutenberg -literary -archive -foundation -and -how -your -efforts -and -donations -can -help -see -sections -3 -and -4 -and -the -foundation -web -page -at -http -//www -pglaf -org -section -3 -information -about -the -project -gutenberg -literary -archive -foundation -the -project -gutenberg -literary -archive -foundation -is -a -non -profit -501 -c -3 -educational -corporation -organized -under -the -laws -of -the -state -of -mississippi -and -granted -tax -exempt -status -by -the -internal -revenue -service -the -foundation's -ein -or -federal -tax -identification -number -is -64 -6221541 -its -501 -c -3 -letter -is -posted -at -http -//pglaf -org/fundraising -contributions -to -the -project -gutenberg -literary -archive -foundation -are -tax -deductible -to -the -full -extent -permitted -by -u -s -federal -laws -and -your -state's -laws -the -foundation's -principal -office -is -located -at -4557 -melan -dr -s -fairbanks -ak -99712 -but -its -volunteers -and -employees -are -scattered -throughout -numerous -locations -its -business -office -is -located -at -809 -north -1500 -west -salt -lake -city -ut -84116 -801 -596 -1887 -email -business@pglaf -org -email -contact -links -and -up -to -date -contact -information -can -be -found -at -the -foundation's -web -site -and -official -page -at -http -//pglaf -org -for -additional -contact -information -dr -gregory -b -newby -chief -executive -and -director -gbnewby@pglaf -org -section -4 -information -about -donations -to -the -project -gutenberg -literary -archive -foundation -project -gutenberg -tm -depends -upon -and -cannot -survive -without -wide -spread -public -support -and -donations -to -carry -out -its -mission -of -increasing -the -number -of -public -domain -and -licensed -works -that -can -be -freely -distributed -in -machine -readable -form -accessible -by -the -widest -array -of -equipment -including -outdated -equipment -many -small -donations -$1 -to -$5 -000 -are -particularly -important -to -maintaining -tax -exempt -status -with -the -irs -the -foundation -is -committed -to -complying -with -the -laws -regulating -charities -and -charitable -donations -in -all -50 -states -of -the -united -states -compliance -requirements -are -not -uniform -and -it -takes -a -considerable -effort -much -paperwork -and -many -fees -to -meet -and -keep -up -with -these -requirements -we -do -not -solicit -donations -in -locations -where -we -have -not -received -written -confirmation -of -compliance -to -send -donations -or -determine -the -status -of -compliance -for -any -particular -state -visit -http -//pglaf -org -while -we -cannot -and -do -not -solicit -contributions -from -states -where -we -have -not -met -the -solicitation -requirements -we -know -of -no -prohibition -against -accepting -unsolicited -donations -from -donors -in -such -states -who -approach -us -with -offers -to -donate -international -donations -are -gratefully -accepted -but -we -cannot -make -any -statements -concerning -tax -treatment -of -donations -received -from -outside -the -united -states -u -s -laws -alone -swamp -our -small -staff -please -check -the -project -gutenberg -web -pages -for -current -donation -methods -and -addresses -donations -are -accepted -in -a -number -of -other -ways -including -including -checks -online -payments -and -credit -card -donations -to -donate -please -visit -http -//pglaf -org/donate -section -5 -general -information -about -project -gutenberg -tm -electronic -works -professor -michael -s -hart -is -the -originator -of -the -project -gutenberg -tm -concept -of -a -library -of -electronic -works -that -could -be -freely -shared -with -anyone -for -thirty -years -he -produced -and -distributed -project -gutenberg -tm -ebooks -with -only -a -loose -network -of -volunteer -support -project -gutenberg -tm -ebooks -are -often -created -from -several -printed -editions -all -of -which -are -confirmed -as -public -domain -in -the -u -s -unless -a -copyright -notice -is -included -thus -we -do -not -necessarily -keep -ebooks -in -compliance -with -any -particular -paper -edition -most -people -start -at -our -web -site -which -has -the -main -pg -search -facility -http -//www -gutenberg -net -this -web -site -includes -information -about -project -gutenberg -tm -including -how -to -make -donations -to -the -project -gutenberg -literary -archive -foundation -how -to -help -produce -our -new -ebooks -and -how -to -subscribe -to -our -email -newsletter -to -hear -about -new -ebooks diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde deleted file mode 100644 index 22afb4fa1..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/equator_03b/equator_03b.pde +++ /dev/null @@ -1,40 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -import treemap.*; - -Treemap map; - -void setup() { - size(1024, 768); - - smooth(); - strokeWeight(0.25f); - PFont font = createFont("Serif", 13); - textFont(font); - - WordMap mapData = new WordMap(); - - String[] lines = loadStrings("equator.txt"); - for (int i = 0; i < lines.length; i++) { - mapData.addWord(lines[i]); - } - mapData.finishAdd(); - - // different choices for the layout method - //MapLayout algorithm = new SliceLayout(); - //MapLayout algorithm = new StripTreemap(); - //MapLayout algorithm = new PivotBySplitSize(); - //MapLayout algorithm = new SquarifiedLayout(); - - map = new Treemap(mapData, 0, 0, width, height); - - // only run draw() once - noLoop(); -} - - -void draw() { - background(255); - map.draw(); -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde deleted file mode 100644 index e6ddcf43c..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/Node.pde +++ /dev/null @@ -1,58 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class Node { - File file; - - Node[] children; - int childCount; - - Node(File file) { - this.file = file; - if (file.isDirectory()) { - addFolder(this); - } - } - - void check() { - String[] contents = file.list(); - if (contents != null) { - // Sort the file names in case insensitive order - contents = sort(contents); - - children = new Node[contents.length]; - for (int i = 0 ; i < contents.length; i++) { - // Skip the . and .. directory entries on Unix systems - if (contents[i].equals(".") || contents[i].equals("..")) { - continue; - } - File childFile = new File(file, contents[i]); - // Skip any file that appears to be a symbolic link - try { - String absPath = childFile.getAbsolutePath(); - String canPath = childFile.getCanonicalPath(); - if (!absPath.equals(canPath)) { - continue; - } - } catch (IOException e) { } - - Node child = new Node(childFile); - children[childCount++] = child; - } - } - } - - - void printList(int depth) { - // print four spaces for each level of depth; - for (int i = 0; i < depth; i++) { - print(" "); - } - println(file.getName()); - - // now handle the children, if any - for (int i = 0; i < childCount; i++) { - children[i].printList(depth + 1); - } - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde deleted file mode 100644 index 73eea9e81..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/file_tree_queue_08b/file_tree_queue_08b.pde +++ /dev/null @@ -1,67 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -Node[] folders = new Node[10]; -int folderCount; -int folderIndex; - -Node rootNode; - - -void setup() { - size(400, 130); - // Replace this location with a folder on your machine - //File rootFile = new File("/Applications/Processing.app"); - //File rootFile = new File("c:\\processing-2.0"); - File rootFile = new File(System.getProperty("user.home")); - rootNode = new Node(rootFile); - PFont font = createFont("SansSerif", 11); - textFont(font); -} - - -void draw() { - background(224); - nextFolder(); - drawStatus(); -} - - -void drawStatus() { - float statusX = 30; - float statusW = width - statusX*2; - float statusY = 60; - float statusH = 20; - - fill(0); - if (folderIndex != folderCount) { - text("Reading " + nfc(folderIndex+1) + - " out of " + nfc(folderCount) + " folders...", - statusX, statusY - 10); - } else { - text("Done reading.", statusX, statusY - 10); - } - fill(128); - rect(statusX, statusY, statusW, statusH); - - float completedW = map(folderIndex + 1, 0, folderCount, 0, statusW); - fill(255); - rect(statusX, statusY, completedW, statusH); -} - - -void addFolder(Node folder) { - if (folderCount == folders.length) { - folders = (Node[]) expand(folders); - } - folders[folderCount++] = folder; -} - - -void nextFolder() { - if (folderIndex != folderCount) { - Node n = folders[folderIndex++]; - n.check(); - } -} - diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java deleted file mode 100644 index a568a930d..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/BoundsIntegrator.java +++ /dev/null @@ -1,178 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -public class BoundsIntegrator { - - static final float ATTRACTION = 0.2f; - static final float DAMPING = 0.5f; - - float valueX, velocityX, accelerationX; - float valueY, velocityY, accelerationY; - float valueW, velocityW, accelerationW; - float valueH, velocityH, accelerationH; - - float damping; - float attraction; - - boolean targeting; - float targetX, targetY, targetW, targetH; - - - public BoundsIntegrator() { - this.valueX = 0; - this.valueY = 0; - this.valueW = 1; - this.valueH = 1; - - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public BoundsIntegrator(float x, float y, float w, float h) { - this.valueX = x; - this.valueY = y; - this.valueW = w; - this.valueH = h; - - this.damping = DAMPING; - this.attraction = ATTRACTION; - } - - - public void set(float x, float y, float w, float h) { - this.valueX = x; - this.valueY = y; - this.valueW = w; - this.valueH = h; - } - - - public float getX() { - return valueX; - } - - - public float getY() { - return valueY; - } - - - public float getW() { - return valueW; - } - - - public float getH() { - return valueH; - } - - - public float spanX(float pointX, float start, float span) { - if (valueW != 0) { - //return (pointX - valueX) / valueW; - float n = (pointX - valueX) / valueW; - return start + n*span; - } else { - return Float.NaN; - } - } - - - public float spanY(float pointY, float start, float span) { - if (valueH != 0) { - //return (pointY - valueY) / valueH; - float n = (pointY - valueY) / valueH; - return start + n*span; - } else { - return Float.NaN; - } - } - - - public void setAttraction(float a) { - attraction = a; - } - - - public void setDamping(float d) { - damping = d; - } - - - public boolean update() { - if (targeting) { - accelerationX += attraction * (targetX - valueX); - velocityX = (velocityX + accelerationX) * damping; - valueX += velocityX; - accelerationX = 0; - boolean updated = (Math.abs(velocityX) > 0.0001f); - - accelerationY += attraction * (targetY - valueY); - velocityY = (velocityY + accelerationY) * damping; - valueY += velocityY; - accelerationY = 0; - updated |= (Math.abs(velocityY) > 0.0001f); - - accelerationW += attraction * (targetW - valueW); - velocityW = (velocityW + accelerationW) * damping; - valueW += velocityW; - accelerationW = 0; - updated |= (Math.abs(velocityW) > 0.0001f); - - accelerationH += attraction * (targetH - valueH); - velocityH = (velocityH + accelerationH) * damping; - valueH += velocityH; - accelerationH = 0; - updated |= (Math.abs(velocityH) > 0.0001f); - } - return false; - } - - - public void target(float tx, float ty, float tw, float th) { - targeting = true; - targetX = tx; - targetY = ty; - targetW = tw; - targetH = th; - } - - - public void targetLocation(float tx, float ty) { - targeting = true; - targetX = tx; - targetY = ty; - } - - - public void targetSize(float tw, float th) { - targeting = true; - targetW = tw; - targetH = th; - } - - - public void targetX(float tx) { - targeting = true; - targetX = tx; - } - - - public void targetY(float ty) { - targeting = true; - targetY = ty; - } - - - public void targetW(float tw) { - targeting = true; - targetW = tw; - } - - - public void targetH(float th) { - targeting = true; - targetH = th; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde deleted file mode 100644 index 0ff648a82..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FileItem.pde +++ /dev/null @@ -1,118 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class FileItem extends SimpleMapItem { - FolderItem parent; - File file; - String name; - int level; - - color c; - float hue; - float brightness; - - float textPadding = 8; - - float boxLeft, boxTop; - float boxRight, boxBottom; - - - FileItem(FolderItem parent, File file, int level, int order) { - this.parent = parent; - this.file = file; - this.order = order; - this.level = level; - - name = file.getName(); - size = file.length(); - - modTimes.add(file.lastModified()); - } - - - void updateColors() { - if (parent != null) { - hue = map(order, 0, parent.getItemCount(), 0, 360); - } - brightness = modTimes.percentile(file.lastModified()) * 100; - - colorMode(HSB, 360, 100, 100); - if (parent == zoomItem) { - c = color(hue, 80, 80); - } else if (parent != null) { - c = color(parent.hue, 80, brightness); - } - colorMode(RGB, 255); - } - - - void calcBox() { - boxLeft = zoomBounds.spanX(x, 0, width); - boxRight = zoomBounds.spanX(x+w, 0, width); - boxTop = zoomBounds.spanY(y, 0, height); - boxBottom = zoomBounds.spanY(y+h, 0, height); - } - - - void draw() { - calcBox(); - - fill(c); - rect(boxLeft, boxTop, boxRight, boxBottom); - - if (textFits()) { - drawTitle(); - } else if (mouseInside()) { - rolloverItem = this; - } - } - - - void drawTitle() { - fill(255, 200); - - float middleX = (boxLeft + boxRight) / 2; - float middleY = (boxTop + boxBottom) / 2; - if (middleX > 0 && middleX < width && middleY > 0 && middleY < height) { - if (boxLeft + textWidth(name) + textPadding*2 > width) { - textAlign(RIGHT); - text(name, width - textPadding, boxBottom - textPadding); - } else { - textAlign(LEFT); - text(name, boxLeft + textPadding, boxBottom - textPadding); - } - } - } - - - boolean textFits() { - float wide = textWidth(name) + textPadding*2; - float high = textAscent() + textDescent() + textPadding*2; - return (boxRight - boxLeft > wide) && (boxBottom - boxTop > high); - } - - - boolean mouseInside() { - return (mouseX > boxLeft && mouseX < boxRight && - mouseY > boxTop && mouseY < boxBottom); - } - - - boolean mousePressed() { - if (mouseInside()) { - if (mouseButton == LEFT) { - parent.zoomIn(); - return true; - - } else if (mouseButton == RIGHT) { - if (parent == zoomItem) { - parent.zoomOut(); - } else { - parent.hideContents(); - } - return true; - } - } - return false; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde deleted file mode 100644 index 87b30c982..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/FolderItem.pde +++ /dev/null @@ -1,213 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - - -class FolderItem extends FileItem implements MapModel { - MapLayout algorithm = new PivotBySplitSize(); - Mappable[] items; - boolean contentsVisible; - boolean layoutValid; - float darkness; - - - public FolderItem(FolderItem parent, File folder, int level, int order) { - super(parent, folder, level, order); - - String[] contents = folder.list(); - if (contents != null) { - contents = sort(contents); - items = new Mappable[contents.length]; - int count = 0; - for (int i = 0; i < contents.length; i++) { - if (contents[i].equals(".") || contents[i].equals("..")) { - continue; - } - File fileItem = new File(folder, contents[i]); - try { - String absolutePath = fileItem.getAbsolutePath(); - String canonicalPath = fileItem.getCanonicalPath(); - if (!absolutePath.equals(canonicalPath)) { - continue; - } - } catch (IOException e) { } - - FileItem newItem = null; - if (fileItem.isDirectory()) { - newItem = new FolderItem(this, fileItem, level+1, count); - } else { - newItem = new FileItem(this, fileItem, level+1, count); - } - items[count++] = newItem; - size += newItem.getSize(); - } - if (count != items.length) { - items = (Mappable[]) subset(items, 0, count); - } - } else { - // If no items found in this folder, create a dummy array so that - // items will not be null, which will ensure that items.length will - // return 0 rather than causing a NullPointerException. - items = new Mappable[0]; - } - } - - void updateColors() { - super.updateColors(); - - for (int i = 0; i < items.length; i++) { - FileItem fi = (FileItem) items[i]; - fi.updateColors(); - } - } - - void checkLayout() { - if (!layoutValid) { - if (getItemCount() != 0) { - algorithm.layout(this, bounds); - } - layoutValid = true; - } - } - - - boolean mousePressed() { - if (mouseInside()) { - if (contentsVisible) { - // Pass the mouse press to the child items - for (int i = 0; i < items.length; i++) { - FileItem fi = (FileItem) items[i]; - if (fi.mousePressed()) { - return true; - } - } - } else { // not opened - if (mouseButton == LEFT) { - if (parent == zoomItem) { - showContents(); - } else { - parent.zoomIn(); - } - } else if (mouseButton == RIGHT) { - if (parent == zoomItem) { - parent.zoomOut(); - } else { - parent.hideContents(); - } - } - return true; - } - } - return false; - } - - - // Zoom to the parent's boundary, zooming out from this item - void zoomOut() { - if (parent != null) { - // Close contents of any opened children - for (int i = 0; i < items.length; i++) { - if (items[i] instanceof FolderItem) { - ((FolderItem)items[i]).hideContents(); - } - } - parent.zoomIn(); - } - } - - - void zoomIn() { - zoomItem = this; - zoomBounds.target(x, y, w, h); ///width, h/height); - } - - - void showContents() { - contentsVisible = true; - } - - - void hideContents() { - // Prevent the user from closing the root level - if (parent != null) { - contentsVisible = false; - } - } - - - void draw() { - checkLayout(); - calcBox(); - - if (contentsVisible) { - for (int i = 0; i < items.length; i++) { - items[i].draw(); - } - } else { - super.draw(); - } - - if (contentsVisible) { - if (mouseInside()) { - if (parent == zoomItem) { - taggedItem = this; - } - } - } - if (mouseInside()) { - darkness *= 0.05; - } else { - darkness += (150 - darkness) * 0.05; - } - if (parent == zoomItem) { - colorMode(RGB, 255); - fill(0, darkness); - rect(boxLeft, boxTop, boxRight, boxBottom); - } - } - - - void drawTitle() { - if (!contentsVisible) { - super.drawTitle(); - } - } - - - void drawTag() { - float boxHeight = textAscent() + textPadding*2; - - if (boxBottom - boxTop > boxHeight*2) { - // if the height of the box is at least twice the height of the tag, - // draw the tag inside the box itself - fill(0, 128); - rect(boxLeft, boxTop, boxRight, boxTop+boxHeight); - fill(255); - textAlign(LEFT, TOP); - text(name, boxLeft+textPadding, boxTop+textPadding); - - } else if (boxTop > boxHeight) { - // if there's enough room to draw above, draw it there - fill(0, 128); - rect(boxLeft, boxTop-boxHeight, boxRight, boxTop); - fill(255); - text(name, boxLeft+textPadding, boxTop-textPadding); - - } else if (boxBottom + boxHeight < height) { - // otherwise draw the tag below - fill(0, 128); - rect(boxLeft, boxBottom, boxRight, boxBottom+boxHeight); - fill(255); - textAlign(LEFT, TOP); - text(name, boxLeft+textPadding, boxBottom+textPadding); - } - } - - - Mappable[] getItems() { - return items; - } - - - int getItemCount() { - return items.length; - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde deleted file mode 100644 index efc68f46b..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/RankedLongArray.pde +++ /dev/null @@ -1,57 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. - -import java.util.Arrays; - - -class RankedLongArray { - long[] values = new long[100]; - int count; - boolean dirty; - - public void add(long what) { - if (count == values.length) { - values = (long[]) expand(values); - } - values[count++] = what; - dirty = true; - } - - public void remove(long what) { - int index = find(what, 0, count-1); - arraycopy(values, index+1, values, index, count-index-1); - count--; - } - - private void update() { - Arrays.sort(values, 0, count); - dirty = false; - } - - public float percentile(long what) { - int index = find(what); - return index / (float)count; - } - - public int find(long what) { - return find(what, 0, count-1); - } - - private int find(long num, int start, int stop) { - if (dirty) update(); - - int middle = (start + stop) / 2; - - // if this is the char, then return it - if (num == values[middle]) return middle; - - // doesn't exist, otherwise would have been the middle - if (start >= stop) return -1; - - // if it's in the lower half, continue searching that - if (num < values[middle]) { - return find(num, start, middle-1); - } - // otherwise continue in the upper half - return find(num, middle+1, stop); - } -} diff --git a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde b/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde deleted file mode 100644 index 1b1d43504..000000000 --- a/java/examples/Books/Visualizing Data/ch07-hierarchies/filetreemap_06b/filetreemap_06b.pde +++ /dev/null @@ -1,93 +0,0 @@ -/* -This book is here to help you get your job done. In general, you may use the -code in this book in your programs and documentation. You do not need to contact -us for permission unless you’re reproducing a significant portion of the code. -For example, writing a program that uses several chunks of code from this book -does not require permission. Selling or distributing a CD-ROM of examples from -O’Reilly books does require permission. Answering a question by citing this book -and quoting example code does not require permission. Incorporating a significant -amount of example code from this book into your product’s documentation does -require permission. - -We appreciate, but do not require, attribution. An attribution usually includes -the title, author, publisher, and ISBN. For example: “Visualizing Data, First -Edition by Ben Fry. Copyright 2008 Ben Fry, 9780596514556.” - -If you feel your use of code examples falls outside fair use or the permission -given above, feel free to contact us at permissions@oreilly.com. -*/ -//import treemap.*; - -import javax.swing.*; - -FolderItem rootItem; -FileItem rolloverItem; -FolderItem taggedItem; - -BoundsIntegrator zoomBounds; -FolderItem zoomItem; - -RankedLongArray modTimes = new RankedLongArray(); - -PFont font; - - -void setup() { - size(1024, 768); - zoomBounds = new BoundsIntegrator(0, 0, width, height); - - cursor(CROSS); - rectMode(CORNERS); - smooth(); - noStroke(); - - font = createFont("SansSerif", 13); - - selectFolder("Choose a folder to browse...", "setRoot"); -} - - -void setRoot(File folder) { - if (folder == null) { - println("No folder selected."); - - } else { - FolderItem tm = new FolderItem(null, folder, 0, 0); - tm.setBounds(0, 0, width, height); - tm.contentsVisible = true; - - rootItem = tm; - rootItem.zoomIn(); - rootItem.updateColors(); - } -} - - -void draw() { - background(0); - textFont(font); - - frameRate(30); - zoomBounds.update(); - - rolloverItem = null; - taggedItem = null; - - if (rootItem != null) { - rootItem.draw(); - } - if (rolloverItem != null) { - rolloverItem.drawTitle(); - } - if (taggedItem != null) { - taggedItem.drawTag(); - } -} - - -void mousePressed() { - if (zoomItem != null) { - zoomItem.mousePressed(); - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde deleted file mode 100644 index bf893b7e4..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_06c_variable_size_nodes/step_06c_variable_size_nodes.pde +++ /dev/null @@ -1,186 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - println(edgeCount); - font = createFont("SansSerif", 10); - textFont(font); - smooth(); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde deleted file mode 100644 index e16073bab..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_07c_save_pdf/step_07c_save_pdf.pde +++ /dev/null @@ -1,186 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - println(edgeCount); - font = createFont("SansSerif", 10); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - textFont(font); - smooth(); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde deleted file mode 100644 index 589f1cba0..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Edge.pde +++ /dev/null @@ -1,45 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Edge { - Node from; - Node to; - float len; - int count; - - - Edge(Node from, Node to) { - this.from = from; - this.to = to; - this.len = 50; - } - - - void increment() { - count++; - } - - - void relax() { - float vx = to.x - from.x; - float vy = to.y - from.y; - float d = mag(vx, vy); - if (d > 0) { - float f = (len - d) / (d * 3); - float dx = f * vx; - float dy = f * vy; - to.dx += dx; - to.dy += dy; - from.dx -= dx; - from.dy -= dy; - } - } - - - void draw() { - stroke(edgeColor); - strokeWeight(0.35); - line(from.x, from.y, to.x, to.y); - } -} diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde deleted file mode 100644 index 6bf898f6d..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/Node.pde +++ /dev/null @@ -1,80 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -class Node { - float x, y; - float dx, dy; - boolean fixed; - String label; - int count; - - - Node(String label) { - this.label = label; - x = random(width); - y = random(height); - } - - - void increment() { - count++; - } - - - void relax() { - float ddx = 0; - float ddy = 0; - - for (int j = 0; j < nodeCount; j++) { - Node n = nodes[j]; - if (n != this) { - float vx = x - n.x; - float vy = y - n.y; - float lensq = vx * vx + vy * vy; - if (lensq == 0) { - ddx += random(1); - ddy += random(1); - } else if (lensq < 100*100) { - ddx += vx / lensq; - ddy += vy / lensq; - } - } - } - float dlen = mag(ddx, ddy) / 2; - if (dlen > 0) { - dx += ddx / dlen; - dy += ddy / dlen; - } - } - - - void update() { - if (!fixed) { - x += constrain(dx, -5, 5); - y += constrain(dy, -5, 5); - - x = constrain(x, 0, width); - y = constrain(y, 0, height); - } - dx /= 2; - dy /= 2; - } - - - void draw() { - fill(nodeColor); - stroke(0); - strokeWeight(0.5); - - ellipse(x, y, count, count); - float w = textWidth(label); - - if (count > w+2) { - fill(0); - textAlign(CENTER, CENTER); - text(label, x, y); - } - } -} - diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt deleted file mode 100644 index b524c3811..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/data/huckfinn.txt +++ /dev/null @@ -1,17 +0,0 @@ -YOU don't know about me without you have read a book by the name of The Adventures of Tom Sawyer; but that ain't no matter. That book was made by Mr. Mark Twain, and he told the truth, mainly. There was things which he stretched, but mainly he told the truth. That is nothing. I never seen anybody but lied one time or another, without it was Aunt Polly, or the widow, or maybe Mary. Aunt Polly--Tom's Aunt Polly, she is--and Mary, and the Widow Douglas is all told about in that book, which is mostly a true book, with some stretchers, as I said before. - -Now the way that the book winds up is this: Tom and me found the money that the robbers hid in the cave, and it made us rich. We got six thousand dollars apiece--all gold. It was an awful sight of money when it was piled up. Well, Judge Thatcher he took it and put it out at interest, and it fetched us a dollar a day apiece all the year round--more than a body could tell what to do with. The Widow Douglas she took me for her son, and allowed she would sivilize me; but it was rough living in the house all the time, considering how dismal regular and decent the widow was in all her ways; and so when I couldn't stand it no longer I lit out. I got into my old rags and my sugar-hogshead again, and was free and satisfied. But Tom Sawyer he hunted me up and said he was going to start a band of robbers, and I might join if I would go back to the widow and be respectable. So I went back. - -The widow she cried over me, and called me a poor lost lamb, and she called me a lot of other names, too, but she never meant no harm by it. She put me in them new clothes again, and I couldn't do nothing but sweat and sweat, and feel all cramped up. Well, then, the old thing commenced again. The widow rung a bell for supper, and you had to come to time. When you got to the table you couldn't go right to eating, but you had to wait for the widow to tuck down her head and grumble a little over the victuals, though there warn't really anything the matter with them,--that is, nothing only everything was cooked by itself. In a barrel of odds and ends it is different; things get mixed up, and the juice kind of swaps around, and the things go better. - -After supper she got out her book and learned me about Moses and the Bulrushers, and I was in a sweat to find out all about him; but by and by she let it out that Moses had been dead a considerable long time; so then I didn't care no more about him, because I don't take no stock in dead people. - -Pretty soon I wanted to smoke, and asked the widow to let me. But she wouldn't. She said it was a mean practice and wasn't clean, and I must try to not do it any more. That is just the way with some people. They get down on a thing when they don't know nothing about it. Here she was a-bothering about Moses, which was no kin to her, and no use to anybody, being gone, you see, yet finding a power of fault with me for doing a thing that had some good in it. And she took snuff, too; of course that was all right, because she done it herself. - -Her sister, Miss Watson, a tolerable slim old maid, with goggles on, had just come to live with her, and took a set at me now with a spelling-book. She worked me middling hard for about an hour, and then the widow made her ease up. I couldn't stood it much longer. Then for an hour it was deadly dull, and I was fidgety. Miss Watson would say, "Don't put your feet up there, Huckleberry;" and "Don't scrunch up like that, Huckleberry--set up straight;" and pretty soon she would say, "Don't gap and stretch like that, Huckleberry--why don't you try to behave?" Then she told me all about the bad place, and I said I wished I was there. She got mad then, but I didn't mean no harm. All I wanted was to go somewheres; all I wanted was a change, I warn't particular. She said it was wicked to say what I said; said she wouldn't say it for the whole world; she was going to live so as to go to the good place. Well, I couldn't see no advantage in going where she was going, so I made up my mind I wouldn't try for it. But I never said so, because it would only make trouble, and wouldn't do no good. - -Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together. - -Miss Watson she kept pecking at me, and it got tiresome and lonesome. By and by they fetched the niggers in and had prayers, and then everybody was off to bed. I went up to my room with a piece of candle, and put it on the table. Then I set down in a chair by the window and tried to think of something cheerful, but it warn't no use. I felt so lonesome I most wished I was dead. The stars were shining, and the leaves rustled in the woods ever so mournful; and I heard an owl, away off, who-whooing about somebody that was dead, and a whippowill and a dog crying about somebody that was going to die; and the wind was trying to whisper something to me, and I couldn't make out what it was, and so it made the cold shivers run over me. Then away out in the woods I heard that kind of a sound that a ghost makes when it wants to tell about something that's on its mind and can't make itself understood, and so can't rest easy in its grave, and has to go about that way every night grieving. I got so down-hearted and scared I did wish I had some company. Pretty soon a spider went crawling up my shoulder, and I flipped it off and it lit in the candle; and before I could budge it was all shriveled up. I didn't need anybody to tell me that that was an awful bad sign and would fetch me some bad luck, so I was scared and most shook the clothes off of me. I got up and turned around in my tracks three times and crossed my breast every time; and then I tied up a little lock of my hair with a thread to keep witches away. But I hadn't no confidence. You do that when you've lost a horseshoe that you've found, instead of nailing it up over the door, but I hadn't ever heard anybody say it was any way to keep off bad luck when you'd killed a spider. - -I set down again, a-shaking all over, and got out my pipe for a smoke; for the house was all as still as death now, and so the widow wouldn't know. Well, after a long time I heard the clock away off in the town go boom--boom--boom--twelve licks; and all still again--stiller than ever. Pretty soon I heard a twig snap down in the dark amongst the trees--something was a stirring. I set still and listened. Directly I could just barely hear a "me-yow! me-yow!" down there. That was good! Says I, "me-yow! me-yow!" as soft as I could, and then I put out the light and scrambled out of the window on to the shed. Then I slipped down to the ground and crawled in among the trees, and, sure enough, there was Tom Sawyer waiting for me. diff --git a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde b/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde deleted file mode 100644 index 7b2a4a842..000000000 --- a/java/examples/Books/Visualizing Data/ch08-graphlayout/step_08c_graphviz/step_08c_graphviz.pde +++ /dev/null @@ -1,200 +0,0 @@ -// Code from Visualizing Data, First Edition, Copyright 2008 Ben Fry. -// Based on the GraphLayout example by Sun Microsystems. - - -int nodeCount; -Node[] nodes = new Node[100]; -HashMap nodeTable = new HashMap(); - -int edgeCount; -Edge[] edges = new Edge[500]; - -static final color nodeColor = #F0C070; -static final color selectColor = #FF3030; -static final color fixedColor = #FF8080; -static final color edgeColor = #000000; - -PFont font; - - -void setup() { - size(600, 600); - loadData(); - font = createFont("SansSerif", 10); - writeData(); -} - - -void writeData() { - PrintWriter writer = createWriter("huckfinn.dot"); - writer.println("digraph output {"); - for (int i = 0; i < edgeCount; i++) { - String from = "\"" + edges[i].from.label + "\""; - String to = "\"" + edges[i].to.label + "\""; - writer.println(TAB + from + " -> " + to + ";"); - } - writer.println("}"); - writer.flush(); - writer.close(); -} - - -void loadData() { - String[] lines = loadStrings("huckfinn.txt"); - - // Make the text into a single String object - String line = join(lines, " "); - - // Replace -- with an actual em dash - line = line.replaceAll("--", "\u2014"); - - // Split into phrases using any of the provided tokens - String[] phrases = splitTokens(line, ".,;:?!\u2014\""); - //println(phrases); - - for (int i = 0; i < phrases.length; i++) { - // Make this phrase lowercase - String phrase = phrases[i].toLowerCase(); - // Split each phrase into individual words at one or more spaces - String[] words = splitTokens(phrase, " "); - for (int w = 0; w < words.length-1; w++) { - addEdge(words[w], words[w+1]); - } - } -} - - -void addEdge(String fromLabel, String toLabel) { - // Filter out unnecessary words - if (ignoreWord(fromLabel) || ignoreWord(toLabel)) return; - - Node from = findNode(fromLabel); - Node to = findNode(toLabel); - from.increment(); - to.increment(); - - for (int i = 0; i < edgeCount; i++) { - if (edges[i].from == from && edges[i].to == to) { - edges[i].increment(); - return; - } - } - - Edge e = new Edge(from, to); - e.increment(); - if (edgeCount == edges.length) { - edges = (Edge[]) expand(edges); - } - edges[edgeCount++] = e; -} - - -String[] ignore = { "a", "of", "the", "i", "it", "you", "and", "to" }; - -boolean ignoreWord(String what) { - for (int i = 0; i < ignore.length; i++) { - if (what.equals(ignore[i])) { - return true; - } - } - return false; -} - - -Node findNode(String label) { - label = label.toLowerCase(); - Node n = (Node) nodeTable.get(label); - if (n == null) { - return addNode(label); - } - return n; -} - - -Node addNode(String label) { - Node n = new Node(label); - if (nodeCount == nodes.length) { - nodes = (Node[]) expand(nodes); - } - nodeTable.put(label, n); - nodes[nodeCount++] = n; - return n; -} - - -void draw() { - if (record) { - beginRecord(PDF, "output.pdf"); - } - - background(255); - textFont(font); - smooth(); - - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].relax(); - } - for (int i = 0; i < nodeCount; i++) { - nodes[i].update(); - } - for (int i = 0 ; i < edgeCount ; i++) { - edges[i].draw(); - } - for (int i = 0 ; i < nodeCount ; i++) { - nodes[i].draw(); - } - - if (record) { - endRecord(); - record = false; - } -} - - -boolean record; - -void keyPressed() { - if (key == 'r') { - record = true; - } -} - - -Node selection; - - -void mousePressed() { - // Ignore anything greater than this distance - float closest = 20; - for (int i = 0; i < nodeCount; i++) { - Node n = nodes[i]; - float d = dist(mouseX, mouseY, n.x, n.y); - if (d < closest) { - selection = n; - closest = d; - } - } - if (selection != null) { - if (mouseButton == LEFT) { - selection.fixed = true; - } else if (mouseButton == RIGHT) { - selection.fixed = false; - } - } -} - - -void mouseDragged() { - if (selection != null) { - selection.x = mouseX; - selection.y = mouseY; - } -} - - -void mouseReleased() { - selection = null; -}