mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-06 14:56:54 +02:00
Merge pull request #3889 from caminsha/en/processing_smalltypos
[processing/en] Fixed some small typos
This commit is contained in:
@@ -150,7 +150,7 @@ SomeRandomClass myObjectInstantiated = new SomeRandomClass();
|
|||||||
// operations.
|
// operations.
|
||||||
float f = sq(3); // f = 9.0
|
float f = sq(3); // f = 9.0
|
||||||
float p = pow(3, 3); // p = 27.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 r1 = round(3.1); // r1 = 3
|
||||||
int r2 = round(3.7); // r2 = 4
|
int r2 = round(3.7); // r2 = 4
|
||||||
float sr = sqrt(25); // sr = 5.0
|
float sr = sqrt(25); // sr = 5.0
|
||||||
@@ -191,6 +191,8 @@ int i = 3;
|
|||||||
String value = (i > 5) ? "Big" : "Small"; // "Small"
|
String value = (i > 5) ? "Big" : "Small"; // "Small"
|
||||||
|
|
||||||
// Switch-case structure can be used to check multiple conditions concisely.
|
// 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;
|
int value = 2;
|
||||||
switch(value) {
|
switch(value) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -354,14 +356,14 @@ color c = color(255, 255, 255); // WHITE!
|
|||||||
// By default, Processing uses RGB colour scheme but it can be configured to
|
// By default, Processing uses RGB colour scheme but it can be configured to
|
||||||
// HSB using colorMode(). Read more here:
|
// HSB using colorMode(). Read more here:
|
||||||
// (https://processing.org/reference/colorMode_.html)
|
// (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.
|
// 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
|
// It has to be configured before you start drawing shapes so the colours gets
|
||||||
// applied.
|
// applied.
|
||||||
fill(color(0, 0, 0));
|
fill(color(0, 0, 0));
|
||||||
// If you just want to colour the outlines of the shapes then you can use
|
// If you just want to colour the outlines of the shapes then you can use
|
||||||
// stroke() function.
|
// 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.
|
// set to a lower value.
|
||||||
|
|
||||||
// Images
|
// Images
|
||||||
|
Reference in New Issue
Block a user