diff --git a/0001_2D_Curves.js b/CodeTrain/0001_2D_Curves.js similarity index 100% rename from 0001_2D_Curves.js rename to CodeTrain/0001_2D_Curves.js diff --git a/0002_2D_Curves_A.js b/CodeTrain/0002_2D_Curves_A.js similarity index 100% rename from 0002_2D_Curves_A.js rename to CodeTrain/0002_2D_Curves_A.js diff --git a/CodeTrain/0003_RectMode.js b/CodeTrain/0003_RectMode.js new file mode 100644 index 0000000..c3ce12f --- /dev/null +++ b/CodeTrain/0003_RectMode.js @@ -0,0 +1,28 @@ +https://editor.p5js.org/mathisudar2007/full/GMZETh4A6 + + +function setup() { + createCanvas(400, 400); +} + +function draw() { + background(220, 0, 220); + + rectMode(CORNER); + fill(255); + rect(25, 25, 50, 50); // Draw white rectangle using CORNER mode + + rectMode(CORNERS); + fill(100); + rect(25, 25, 50, 50); // Draw gray rectangle using CORNERS mode + + rectMode(RADIUS); + fill(255); + rect(200, 50, 30, 30); // Draw white rectangle using RADIUS mode + + rectMode(CENTER); + fill(100); + rect(200, 200, 300, 100); // Draw gray rectangle using CENTER mode + + +} diff --git a/CodeTrain/0004_EllipseMode.js b/CodeTrain/0004_EllipseMode.js new file mode 100644 index 0000000..d6fd2bf --- /dev/null +++ b/CodeTrain/0004_EllipseMode.js @@ -0,0 +1,26 @@ +https://editor.p5js.org/mathisudar2007/full/jU1ry9Ft4 + + +function setup() { + createCanvas(400, 400); +} + +function draw() { + background(220); + + // Example showing RADIUS and CENTER ellipsemode with 2 overlaying ellipses + ellipseMode(RADIUS); + fill(255); + ellipse(50, 50, 30, 30); // Outer white ellipse + ellipseMode(CENTER); + fill(100); + ellipse(50, 50, 30, 30); // Inner gray ellipse + + // Example showing CORNER and CORNERS ellipseMode with 2 overlaying ellipses + ellipseMode(CORNER); + fill(255); + ellipse(100, 100, 50, 50); // Outer white ellipse + ellipseMode(CORNERS); + fill(100); + ellipse(100, 50, 150, 100); // Inner gray ellipse +} diff --git a/CodeTrain/0005_ColorSettings.js b/CodeTrain/0005_ColorSettings.js new file mode 100644 index 0000000..323040b --- /dev/null +++ b/CodeTrain/0005_ColorSettings.js @@ -0,0 +1,21 @@ +https://editor.p5js.org/mathisudar2007/full/gp_TEaUlR + +function setup() { + createCanvas(400, 400); +} + +function draw() { + background(220); + + rectMode(CENTER); + fill(0,0,255); + stroke(0,255,0); + rect(200,150,150,150); + + fill(255,0,0,150); + stroke(255); + strokeWeight(8) + noStroke(); + ellipse(150,250,100,75) + +} diff --git a/CodeTrain/0006_AnimateCircle.js b/CodeTrain/0006_AnimateCircle.js new file mode 100644 index 0000000..1674149 --- /dev/null +++ b/CodeTrain/0006_AnimateCircle.js @@ -0,0 +1,20 @@ +https://editor.p5js.org/mathisudar2007/sketches/4r0AnesqF + + +function setup() { + createCanvas(400, 400); + background(0,255,0); +} + +function draw() { + + // background(0); + noStroke(); + fill(255); + circle(mouseX,mouseY,20); + +} + +function mousePressed(){ + background(0); +} diff --git a/CodeTrain/0007_AnimateCircle_B.js b/CodeTrain/0007_AnimateCircle_B.js new file mode 100644 index 0000000..bcc4c55 --- /dev/null +++ b/CodeTrain/0007_AnimateCircle_B.js @@ -0,0 +1,21 @@ +https://editor.p5js.org/mathisudar2007/full/n4ieObVQZh + +let circleX = 100; + +function setup() { + createCanvas(400, 400); +} + +function draw() { + background(0); + + fill(255); + circle(circleX,200,40); + + circleX = circleX+5; + +} + +function mousePressed(){ + circleX = 0; +} diff --git a/CodeTrain/0008_AnimationRandom_A.js b/CodeTrain/0008_AnimationRandom_A.js new file mode 100644 index 0000000..2cb7451 --- /dev/null +++ b/CodeTrain/0008_AnimationRandom_A.js @@ -0,0 +1,25 @@ +https://editor.p5js.org/mathisudar2007/full/A_jDuca2q + + +let lineWidth; +let recXsize; + +function setup() { + createCanvas(400, 400); + background(0); + +} + +function draw() { + + + lineWidth = random(3,10); + recXsize = random(100,200); + + fill(0,255,0); + stroke(0,0,255); + strokeWeight(lineWidth); + rectMode(CENTER); + rect(200,200,recXsize); + +} diff --git a/CodeTrain/0009_Animation_Random_B.js b/CodeTrain/0009_Animation_Random_B.js new file mode 100644 index 0000000..d3bf880 --- /dev/null +++ b/CodeTrain/0009_Animation_Random_B.js @@ -0,0 +1,28 @@ +https://editor.p5js.org/mathisudar2007/full/Mw2zJwdgv + + +let x,y,r,g,b; + +function setup() { + createCanvas(windowWidth, windowHeight); + background(0); +} + +function draw() { + + r = random(255); + g = random(255); + b = random(255); + x= random(width); + y = random(height); + + fill(r,g,b,100); + noStroke(); + + circle(x,y,30); + +} + +function mousePressed(){ + background(255,255,255); +} diff --git a/CodeTrain/0010_Animation_Random_C.js b/CodeTrain/0010_Animation_Random_C.js new file mode 100644 index 0000000..5de7203 --- /dev/null +++ b/CodeTrain/0010_Animation_Random_C.js @@ -0,0 +1,31 @@ + +https://editor.p5js.org/mathisudar2007/full/6W6kTM9Zz + +let r, g, b; + +function setup() { + createCanvas(400, 400); + background(0); + fill(0,255,0); + +} + +function draw() { + r = random(255); + g = random(255); + b = random(255); + + noStroke(); + + circle(mouseX, mouseY, 50); +} + +function mousePressed() { + + //background(0); + fill(r,g,b); + +} + + + diff --git a/Jonas Schmedtmann/0001_Variables.js b/Jonas Schmedtmann/0001_Variables.js new file mode 100644 index 0000000..eadd178 --- /dev/null +++ b/Jonas Schmedtmann/0001_Variables.js @@ -0,0 +1,26 @@ +let x = "Hello World!"; +let firstName = "Mathi"; +let lastName = "Krishnan"; + +let country = 'INDIA'; +let continent = 'ASIA'; +let population = 200; + +let isIsland = false; +let language = "Hindi"; + + + +console.log("\n"); +console.log(x); +console.log(firstName+" "+lastName+"\n"); + +console.log("My Country:" + country); +console.log("My Continent:" + continent); +console.log("Population:" + population+"\n"); + +console.log(typeof isIsland); +console.log(typeof population); +console.log(typeof country); +console.log(typeof language+"\n"); + diff --git a/Jonas Schmedtmann/0002_BasicOperators.js b/Jonas Schmedtmann/0002_BasicOperators.js new file mode 100644 index 0000000..e794ff0 --- /dev/null +++ b/Jonas Schmedtmann/0002_BasicOperators.js @@ -0,0 +1,23 @@ +let x = 5; // assign the value 5 to x +let y = 2; // assign the value 2 to y +let z = x + y; // assign the value 7 to z (5 + 2) + +let x1 = 5; +let y1 = 2; +let z1 = x1 * y1; + +let x2 = 10; +x2 += 5; // x2=x2+5 + +let text1 = "John"; +let text2 = "Doe"; +let text3 = text1 + " " + text2; + +let text4 = "What a very "; +text4 += "nice day"; + +console.log(z); +console.log(z1); +console.log(x2); +console.log(text3); +console.log(text4); \ No newline at end of file diff --git a/Jonas Schmedtmann/0003_ArithmeticOperators.js b/Jonas Schmedtmann/0003_ArithmeticOperators.js new file mode 100644 index 0000000..21ca73f --- /dev/null +++ b/Jonas Schmedtmann/0003_ArithmeticOperators.js @@ -0,0 +1,49 @@ +let x = 5; +let y = 2; +let z = x + y; +console.log("\n"); +console.log("Add 5,2: "+z+"\n"); + +let x2 = 5; +let y2 = 2; +let z2 = x2 - y2; +console.log("Subtract 5,2: "+z2+"\n"); + + +let x3 = 5; +let y3 = 2; +let z3 = x3 * y3; +console.log("Multiply 5,2: "+z3+"\n"); + + +let x4 = 5; +let y4 = 2; +let z4 = x4 / y4; +console.log("Div 5 ,2: "+z4+"\n"); + + + +let x5 = 5; +let y5 = 2; +let z5 = x5 % y5; // Remainder +console.log("Div-Mod 5,2: "+z5+"\n"); + + +let xyz = 5; +xyz++; +let finalXYZ = xyz; +console.log("Add Increment 5: "+finalXYZ+"\n"); + +let dec = 12; +dec--; +let finalDec = dec; +console.log("Decrement 12: "+finalDec+"\n"); + +let x6 = 5; +let z6 = x6 ** 2; // result is 25 +console.log("Exponent 5,2: "+z6+"\n"); + + +let x7 = 5; +let z7 = Math.pow(x7,2); // result is 25 +console.log("Power 5,2: "+z7+"\n"); diff --git a/Jonas Schmedtmann/0004_OperatorPreced.js b/Jonas Schmedtmann/0004_OperatorPreced.js new file mode 100644 index 0000000..79dd6e5 --- /dev/null +++ b/Jonas Schmedtmann/0004_OperatorPreced.js @@ -0,0 +1,25 @@ +const now = 2037; + +const ageJonas = now-1991; +const ageSarah = now - 2018; + +console.log(now-1991 > now-2018); + + +console.log(3 + 4 * 5); // 3 + 20 +// expected output: 23 + +console.log(4 * 3 ** 2); // 4 * 9 +// expected output: 36 + +let a; +let b; + +console.log(a = b = 5); +// expected output: 5 + + +console.log(3 + 10 * 2); // logs 23 +console.log(3 + (10 * 2)); // logs 23 because parentheses here are superfluous +console.log((3 + 10) * 2); // logs 26 because the parentheses change the order + diff --git a/Jonas Schmedtmann/0005_BasicOperators.js b/Jonas Schmedtmann/0005_BasicOperators.js new file mode 100644 index 0000000..6d7e958 --- /dev/null +++ b/Jonas Schmedtmann/0005_BasicOperators.js @@ -0,0 +1,21 @@ +let country = 'Portugal'; +let continent = 'Europe'; +let population = 10; +let language ='portuguese'; + + +console.log(population / 2); +population++; +console.log(population); +console.log(population > 6); +console.log(population < 33); + +const description1 = +country + +' is in ' + +continent + +', and its ' + +population + +' million people speak ' + +language; +console.log(description1); diff --git a/Jonas Schmedtmann/0006_CodeChallenge.js b/Jonas Schmedtmann/0006_CodeChallenge.js new file mode 100644 index 0000000..d7e09ac --- /dev/null +++ b/Jonas Schmedtmann/0006_CodeChallenge.js @@ -0,0 +1,17 @@ +const massMark = 78; +const heightMark = 1.69; +const massJohn = 92; +const heightJohn = 1.95; + +const BMIMark = massMark/heightMark**2; +const BMIJohn = massJohn/(heightJohn*heightJohn); +const isMarkHeighBMI = BMIMark > BMIJohn; + +console.log(BMIMark,BMIJohn,isMarkHeighBMI); + +/* + +C:\MATHI\VSCode\02_JAVASCRIPT\Jonas Schmedtmann>node 0006_CodeChallenge.js +27.309968138370508 24.194608809993426 true + +*/ diff --git a/Learn_JavaScript_2026 b/Learn_JavaScript_2026 new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Learn_JavaScript_2026 @@ -0,0 +1 @@ + diff --git a/0001_functionAlpha.html b/P5Edit/0001_functionAlpha.html similarity index 92% rename from 0001_functionAlpha.html rename to P5Edit/0001_functionAlpha.html index deb7ef0..a2fbef8 100644 --- a/0001_functionAlpha.html +++ b/P5Edit/0001_functionAlpha.html @@ -17,4 +17,4 @@ - \ No newline at end of file + diff --git a/0001_functionAlpha.js b/P5Edit/0001_functionAlpha.js similarity index 100% rename from 0001_functionAlpha.js rename to P5Edit/0001_functionAlpha.js diff --git a/0002_functionBrightness.js b/P5Edit/0002_functionBrightness.js similarity index 95% rename from 0002_functionBrightness.js rename to P5Edit/0002_functionBrightness.js index fdac10a..e03039c 100644 --- a/0002_functionBrightness.js +++ b/P5Edit/0002_functionBrightness.js @@ -29,4 +29,4 @@ function draw() { fill(value2); rect(135, 20, 35, 360); -} \ No newline at end of file +} diff --git a/0003_functionColor.js b/P5Edit/0003_functionColor.js similarity index 100% rename from 0003_functionColor.js rename to P5Edit/0003_functionColor.js diff --git a/0004_functionGreenHue.js b/P5Edit/0004_functionGreenHue.js similarity index 100% rename from 0004_functionGreenHue.js rename to P5Edit/0004_functionGreenHue.js diff --git a/0005_functionLerpcolorLightness.js b/P5Edit/0005_functionLerpcolorLightness.js similarity index 100% rename from 0005_functionLerpcolorLightness.js rename to P5Edit/0005_functionLerpcolorLightness.js diff --git a/0006_functionRedSaturation.js b/P5Edit/0006_functionRedSaturation.js similarity index 100% rename from 0006_functionRedSaturation.js rename to P5Edit/0006_functionRedSaturation.js diff --git a/0007_functionClearColorMode.js b/P5Edit/0007_functionClearColorMode.js similarity index 100% rename from 0007_functionClearColorMode.js rename to P5Edit/0007_functionClearColorMode.js diff --git a/0008_functionFillNoFill.js b/P5Edit/0008_functionFillNoFill.js similarity index 100% rename from 0008_functionFillNoFill.js rename to P5Edit/0008_functionFillNoFill.js diff --git a/0009_functionErase01.js b/P5Edit/0009_functionErase01.js similarity index 93% rename from 0009_functionErase01.js rename to P5Edit/0009_functionErase01.js index 86268d0..4c02d8c 100644 --- a/0009_functionErase01.js +++ b/P5Edit/0009_functionErase01.js @@ -33,4 +33,4 @@ function draw() { noErase(); -} \ No newline at end of file +} diff --git a/0009_functionErase02.js b/P5Edit/0009_functionErase02.js similarity index 95% rename from 0009_functionErase02.js rename to P5Edit/0009_functionErase02.js index 24717ff..9339ad8 100644 --- a/0009_functionErase02.js +++ b/P5Edit/0009_functionErase02.js @@ -23,4 +23,4 @@ function draw() { torus(15, 5); noErase(); -} \ No newline at end of file +} diff --git a/0010_functionNoErase.js b/P5Edit/0010_functionNoErase.js similarity index 100% rename from 0010_functionNoErase.js rename to P5Edit/0010_functionNoErase.js diff --git a/0011_functionArc01.js b/P5Edit/0011_functionArc01.js similarity index 100% rename from 0011_functionArc01.js rename to P5Edit/0011_functionArc01.js diff --git a/0011_functionArc02.js b/P5Edit/0011_functionArc02.js similarity index 100% rename from 0011_functionArc02.js rename to P5Edit/0011_functionArc02.js diff --git a/0012_functionCircleEllipse.js b/P5Edit/0012_functionCircleEllipse.js similarity index 100% rename from 0012_functionCircleEllipse.js rename to P5Edit/0012_functionCircleEllipse.js diff --git a/0013_functionLinePoint.js b/P5Edit/0013_functionLinePoint.js similarity index 100% rename from 0013_functionLinePoint.js rename to P5Edit/0013_functionLinePoint.js diff --git a/0014_functionQuadRect.js b/P5Edit/0014_functionQuadRect.js similarity index 100% rename from 0014_functionQuadRect.js rename to P5Edit/0014_functionQuadRect.js diff --git a/0015_functionSquareTriangle.js b/P5Edit/0015_functionSquareTriangle.js similarity index 96% rename from 0015_functionSquareTriangle.js rename to P5Edit/0015_functionSquareTriangle.js index dd0b27d..59a843f 100644 --- a/0015_functionSquareTriangle.js +++ b/P5Edit/0015_functionSquareTriangle.js @@ -20,4 +20,4 @@ function draw() { triangle(430, 75, 458, 20, 486, 75); -} \ No newline at end of file +} diff --git a/0016_functionEllipseModeNoSmooth.js b/P5Edit/0016_functionEllipseModeNoSmooth.js similarity index 100% rename from 0016_functionEllipseModeNoSmooth.js rename to P5Edit/0016_functionEllipseModeNoSmooth.js diff --git a/0017_functionRectmode.js b/P5Edit/0017_functionRectmode.js similarity index 100% rename from 0017_functionRectmode.js rename to P5Edit/0017_functionRectmode.js diff --git a/0018_functionStrokeCapJoinWeight.js b/P5Edit/0018_functionStrokeCapJoinWeight.js similarity index 100% rename from 0018_functionStrokeCapJoinWeight.js rename to P5Edit/0018_functionStrokeCapJoinWeight.js diff --git a/0019_functionBezierBezierDetail.js b/P5Edit/0019_functionBezierBezierDetail.js similarity index 100% rename from 0019_functionBezierBezierDetail.js rename to P5Edit/0019_functionBezierBezierDetail.js diff --git a/0020_functionBezierPoint.js b/P5Edit/0020_functionBezierPoint.js similarity index 100% rename from 0020_functionBezierPoint.js rename to P5Edit/0020_functionBezierPoint.js diff --git a/README.md b/README.md index 14bf95a..6a49cb9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,30 @@ # MK_Learn_JavaScript -# https://p5js.org/reference/ -# https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA -# https://editor.p5js.org/Puettrick/sketches/oUHOZOAR3 -# https://editor.p5js.org/yathy2007/sketches/Fl5orgMuQ + https://p5js.org/reference/ + + https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA + https://editor.p5js.org/Puettrick/sketches/oUHOZOAR3 + https://editor.p5js.org/yathy2007/sketches/Fl5orgMuQ + +# MDN Doc - Javascript +https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence + + +JAVA Script - NODE JS + + +Microsoft Windows [Version 10.0.19042.1706] +(c) Microsoft Corporation. All rights reserved. + +H:\>c: + +C:\>cd "C:\MATHI\VSCode\02_JAVASCRIPT\Jonas Schmedtmann" + +C:\MATHI\VSCode\02_JAVASCRIPT\Jonas Schmedtmann>node 0001_Variables.js +Hello World! + +C:\MATHI\VSCode\02_JAVASCRIPT\Jonas Schmedtmann> +