From 3f32649dd84795a981a7a6e7c38cd566722413b9 Mon Sep 17 00:00:00 2001 From: caminsha Date: Tue, 25 Feb 2020 22:46:04 +0100 Subject: Fixed a small math error Before: 2 -1 = 0 After: 2 - 1 = 1 --- processing.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index e437ee95..d99912e7 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -140,7 +140,7 @@ SomeRandomClass myObjectInstantiated = new SomeRandomClass(); // Arithmetic 1 + 1 // 2 -2 - 1 // 0 +2 - 1 // 1 2 * 3 // 6 3 / 2 // 1 3.0 / 2 // 1.5 -- cgit v1.2.3 From 1a9bbb6159c34df3029c0d55944094afcc91b760 Mon Sep 17 00:00:00 2001 From: caminsha Date: Thu, 27 Feb 2020 23:10:20 +0100 Subject: added semicolon at the end of the line --- processing.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index d99912e7..cf2dd77d 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -150,7 +150,7 @@ SomeRandomClass myObjectInstantiated = new SomeRandomClass(); // operations. float f = sq(3); // f = 9.0 float p = pow(3, 3); // p = 27.0 -int a = abs(-13) // a = 13 +int a = abs(-13); // a = 13 int r1 = round(3.1); // r1 = 3 int r2 = round(3.7); // r2 = 4 float sr = sqrt(25); // sr = 5.0 -- cgit v1.2.3 From 5d1c72515cbffc2e744c2ca2d500f75a3e74f1c3 Mon Sep 17 00:00:00 2001 From: caminsha Date: Thu, 27 Feb 2020 23:37:43 +0100 Subject: Added short explanation about break statement --- processing.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index cf2dd77d..d0952e96 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -191,6 +191,8 @@ int i = 3; String value = (i > 5) ? "Big" : "Small"; // "Small" // Switch-case structure can be used to check multiple conditions concisely. +// It is important to use the break statement. If the `break`-statement does +// not exist the program executes all the following cases after a case was true. int value = 2; switch(value) { case 0: -- cgit v1.2.3 From d7de2446b770382689495406a4e725810a052e2f Mon Sep 17 00:00:00 2001 From: caminsha Date: Thu, 27 Feb 2020 23:38:03 +0100 Subject: removed an unnecesarry white space --- processing.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index d0952e96..d7b0d600 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -211,7 +211,7 @@ switch(value) { // Iterative statements // For Statements - Again, the same syntax as in Java -for(int i = 0; i < 5; i ++){ +for(int i = 0; i < 5; i++){ print(i); // prints from 0 to 4 } -- cgit v1.2.3 From 48c193853c0a996d81d72c7bd861d6cdbfbc4103 Mon Sep 17 00:00:00 2001 From: caminsha Date: Sun, 1 Mar 2020 22:43:30 +0100 Subject: Changed color value in background function Changed it because we defined the color white as c before. --- processing.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index d7b0d600..dbf078a2 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -356,7 +356,7 @@ color c = color(255, 255, 255); // WHITE! // By default, Processing uses RGB colour scheme but it can be configured to // HSB using colorMode(). Read more here: // (https://processing.org/reference/colorMode_.html) -background(color); // By now, the background colour should be white. +background(c); // By now, the background colour should be white. // You can use fill() function to select the colour for filling the shapes. // It has to be configured before you start drawing shapes so the colours gets // applied. -- cgit v1.2.3 From 80063a34ed85aaf5f3070a21e26754d16b1f9f59 Mon Sep 17 00:00:00 2001 From: caminsha Date: Sun, 1 Mar 2020 22:57:55 +0100 Subject: Changed color definition I have changed the color definition because 255, 255, 255 was not yellow. --- processing.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'processing.html.markdown') diff --git a/processing.html.markdown b/processing.html.markdown index dbf078a2..777c6981 100644 --- a/processing.html.markdown +++ b/processing.html.markdown @@ -363,7 +363,7 @@ background(c); // By now, the background colour should be white. fill(color(0, 0, 0)); // If you just want to colour the outlines of the shapes then you can use // stroke() function. -stroke(255, 255, 255, 200); // stroke colour set to yellow with transparency +stroke(255, 255, 0, 200); // stroke colour set to yellow with transparency // set to a lower value. // Images -- cgit v1.2.3