6.6: Nested Loops - Processing Tutorial

  Рет қаралды 231,533

The Coding Train

The Coding Train

Күн бұрын

Пікірлер: 154
@redisred
@redisred 5 жыл бұрын
I just want to say, thank you for making these videos! I've tried several times to learn programming in various ways, and for whatever reason your quirky videos on processing make more sense to me than everything else I've gone through. I've never made it this far! Thank you for doing this.
@youtubeaccount0x073
@youtubeaccount0x073 5 жыл бұрын
This is honestly the hardest thing it took me to wrap around my head over anything in java. Nothing else is harder than nester for loops.
@benfrese3573
@benfrese3573 4 жыл бұрын
Same here. I can go through the loop in my head but when something isn't working I have such a hard time to visualize what effect a change might have. It's really hard to express what my problem is, maybe I am not used enough to the concept. Dont't really know. Probably need more time playing around with them.
@idcemail123
@idcemail123 4 жыл бұрын
@@benfrese3573 same boss.
@martingracchus1687
@martingracchus1687 4 жыл бұрын
@@benfrese3573 have you started learning recursion yet?
@benfrese3573
@benfrese3573 4 жыл бұрын
@@martingracchus1687 Yeah, I find recursions to make a lot more sense since I know how the stack works.
@martingracchus1687
@martingracchus1687 4 жыл бұрын
@@benfrese3573 I see, I am learning them both at the same time right now so I am a little overwhelmed, but i haven't been able to properly study in the past couple of days and am just now able to buckle down and focus
@jos9573
@jos9573 8 жыл бұрын
dist() is pretty cool! Here's what I made, but don't run it if you suffer from PSE: int squareSize = 20; float brushSize = 1.5; void setup() { size(800, 800); } void draw() { for (int x = 0; x < width; x = x + squareSize) { for (int y = 0; y < height; y = y + squareSize) { float c = dist(x, y, mouseX, mouseY); noStroke(); fill(c / brushSize, random(255), random(255)); rect(x, y, squareSize, squareSize); } } }
@spezistyle
@spezistyle 7 жыл бұрын
some commentary in the code would be helpful
@nigeltiany
@nigeltiany 8 жыл бұрын
//To whoever cares... A nice simple Click the box to change color with processing // Thanks for these awesome tutorials Mr Shiffman. //rectangle spacing int spacing = 30; //rectangle size : should be equal to spacing so it works well :-) int rectSize = 30; void setup(){ //must be a square screen, width = height for this case size(700,700); fill(255); stroke(25); strokeWeight(0.9); for(int x=0;x
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Nigel Tiany cool, thanks!
@Sir_BoazMutatayi
@Sir_BoazMutatayi 8 жыл бұрын
+Nigel Tiany Woow! amazing
@nigeltiany
@nigeltiany 8 жыл бұрын
Thanks Sir. Boaz Mutatay
@svendunker4494
@svendunker4494 3 жыл бұрын
even though the video is years old, here is my version of the rectangles. Inside dark outside light. I love this channel. the code is attached .. // size(1000, 600); background(0); strokeWeight(2); stroke(127); float size=20; //rect size for (int x = 0; x < width; x+=size) { for (int y = 0; y < height; y+=size) { float distance = dist(x, y, width/2, height/2); println(distance); float maxvalue = dist(0, 0, width/2, height/2); println(maxvalue); float gray =map(distance, 0, maxvalue, 0, 255); println(gray); fill(gray); rect(x, y, size,size); } } //
@C204unit
@C204unit 7 жыл бұрын
//The dist() function used to control the dimensions of the rectangles close to the mouse // Such fun! :) void setup() { size(1000, 600); } void draw() { background(255, 125, 0); stroke(255); strokeWeight(2); for (int x = 0; x < width; x = x + 40) { for (int y = 0; y < height; y = y + 40) { float distance = dist(x, y, mouseX, mouseY) / 8; rect(x, y, distance, distance); fill(255, 220, 190); } } }
@TheBest-fj4qy
@TheBest-fj4qy 3 жыл бұрын
amazing!!!!! ( :
@Anton-wc7lb
@Anton-wc7lb 4 жыл бұрын
Here's a solution to your challenge! Thanks for the tutorial :) void setup() { size(400, 300); background(0); strokeWeight(2); stroke(255); } void draw () { for (int x = 0; x < width; x = x + 20) { for (int y = 0; y < height; y = y + 20) { float d = dist(mouseX, mouseY, x, y); fill(d); rect(x, y, 20, 20); } } }
@rikeshpatel8903
@rikeshpatel8903 Жыл бұрын
Thank You so much, I spent so long trying to figure out how to do this challenge
@YoshBruh
@YoshBruh 4 жыл бұрын
Gotta say that that was a real fun challenge you came up with on the spot!
@chaoukimachreki6422
@chaoukimachreki6422 3 жыл бұрын
I love the glitches between the two screens, creates some suspense XD god bless you bro.
@patriciomendoza2207
@patriciomendoza2207 5 жыл бұрын
For Loop Video : "You can actually skip this video" Nested Loops Video: "Yeah, lets actually make both of these for loops"
@Abaramotorai
@Abaramotorai 6 жыл бұрын
I finally understood nested loops. Thank you. If you need any translation to Portuguese I am actually an English teacher (Brazilian/ Portuguese speaker native). That would be my way to pay. Because you deserve it. Congrats.
@astroneer013
@astroneer013 6 жыл бұрын
made this sweet little aura around the mouse using a nested loop and mapping a max distance from the mouse to a fill color int maxDist = 200; void setup() { size(640, 360); strokeWeight(2); } void draw() { background(0); for (int i = 0; i < width; i += 20) { for (int j = 0; j < height; j +=20) { float auraDist = dist(i, j, mouseX, mouseY); if (auraDist < maxDist) { fill(map(auraDist, 0, maxDist, 150, 51), 0, map(auraDist, 0, maxDist, 255, 51)); } else { fill(51); } rect(i, j, 20, 20); } } }
@evanyoung9714
@evanyoung9714 6 жыл бұрын
// Instead of writing: myVariable = myVariable + 1 // You could just write: myVariable++; // Or if you want to use larger incraments, myVariable += 1; myVariable += 2; myVariable += 3; // It also works with other operators: myVariable *= 4; myVariable -= 5; myVariable /= 6; myVariable %= 7; println(myVariable); // Anyway, just some simple shortcuts that I think he should have explained. // That said, THANK YOU FOR THESE AMAZING TUTORIALS!
@rovewar
@rovewar 4 жыл бұрын
Understandable but that is discussed in a later lesson. There's faster ways of doing things but one needs to get a grasp of the basic stuff first.
@duck__dodgers__5294
@duck__dodgers__5294 4 жыл бұрын
Didn't see any other comments like the question I had so here it is. What confused me the most about this concept is that making a grid can be done by just filling in all of the rows or vice versa by filling in all of the columns. (If you manually wrote on a piece of paper and drew squares from left to right it would make a grid). I finally wrapped my head around the fact that it starts with the y value and proceeds to the nested loop until the x value termination condition is met (In this case if x > width go to the outside loop). It will then go to the next y value which would be y = 20 and do the same thing. Basically this is making a grid with the function rect but drawing them across the screen from left to right.
@lisafox9026
@lisafox9026 5 жыл бұрын
after this explain i forgot my name
@learner5417
@learner5417 4 жыл бұрын
lol
@angelcaru
@angelcaru 3 жыл бұрын
You are Lisa Fox. Hope I helped you. /s
@mahikamihan
@mahikamihan 3 жыл бұрын
I OVERTHOUGHT THE EXERCISE AT THE END FOR THE LAST THREE HOURS BEFORE I FINALLY UNDERSTOOD AND GOT IT WITHOUT LOOKING AT THE COMMENTS OH MY GOD THAT'S SO FRUSTRATING BUT ALSO PRETTY ACCOMPLISHING
@riversplitter
@riversplitter 5 жыл бұрын
I think of it like this an assembly line. You repeat the same process over and over. For each customer make a hamburger. For each hamburger, add bun, meat, toppings. In these kind of real world cases, it is easy to understand why we want to iterate over a set of instructions multiple times.
@boysrock4546
@boysrock4546 4 жыл бұрын
This is the most difficult concept I've come across so far
@50brownbear
@50brownbear 8 жыл бұрын
here's one the combines the bouncing ball and shaded distance float pointX; float pointY; float speedX; float speedY; void setup(){ size(500, 500); background(0); strokeWeight(1); stroke(0); pointX=random(width); pointY=random(height); speedX=random(0.0005,0.002); speedY=random(0.0005,0.002); } void draw(){ for (int x = 0; x < width; x = x + 10) { for (int y= 0; y < height; y = y + 10) { fill(dist(x,y,pointX,pointY)); rect(x, y, 10, 10); pointX=pointX+speedX; pointY=pointY+speedY; if((pointXwidth)){ speedX=-speedX; } if((pointYheight)){ speedY=-speedY; } } } }
@bamkparto
@bamkparto 8 жыл бұрын
nice job man, looks cool
@tianyuzhang6068
@tianyuzhang6068 4 жыл бұрын
Can i ask what's the reason behind 'speedX=random(0.0005,0.002)'? I tried to change this to 5 and this completely messed up the programme :(
@matShenron
@matShenron 7 жыл бұрын
Many Thanks ! You enlightened me with your explanation at 4:40 !
@aldolunabueno2634
@aldolunabueno2634 7 жыл бұрын
It helped me a lot, thanks. This is waht i made: float l=20,c=0,d=0,max_d=dist(0,0,width/2,height/2); void setup(){ fullScreen(); background(0); } void draw(){ for(int y=0;y
@yorkshire_tea_innit8097
@yorkshire_tea_innit8097 3 жыл бұрын
I heard people using this term and though it was advanced, turns out I've been doing it for ages. Oh well, great explanation though, I like how you didnt get bogged down in the detail.
@alessandrodonati4755
@alessandrodonati4755 9 жыл бұрын
You're absolutely amazing! Thanks for your lessons...very helpful!
@TheCodingTrain
@TheCodingTrain 9 жыл бұрын
+Alessandro Donati thanks for watching!
@yixiliu6181
@yixiliu6181 6 жыл бұрын
My solution for the exercise: size(400,400); background(255); stroke(255); for (int y=0; y< height; y = y+20) { for (int x=0; x
@taliafranco185
@taliafranco185 6 жыл бұрын
Thanks for explaining loops crystal clear!!! I finally understand!!! God bless u!:)
@TheTechSpaceUS
@TheTechSpaceUS 8 жыл бұрын
Code for the grid without color: float x,y; void setup(){ size(600,400); } void draw(){ background(#ffffff); stroke(#ff0000); fill(#000000); x = 0; while(x
@Finestimpression29
@Finestimpression29 3 жыл бұрын
hi! so I only learn by playing around. I took a previously shown lesson and this one and mushed them together so create a more fun effect. I left the loop in it. I'm just not sure if it's still considered a nested loop because it is draw. Let me know what you all think. float r= random(100); float g= random(100); float b= random(100); void setup () { size( 400,300); background(0); strokeWeight(2); stroke(255); } //think of x as columns //think of y as rows void draw () { for (int x = 0; x < width; x = x + 20) { rect(x, 0, 20,20); for ( int y = 0; y < height; y = y +20) { rect( x,y, 20,20); r = random ( 233 ); g = random ( 255) ; b = random ( 244) ; fill ( r, g, b); rect ( x, y, 20,20); } } }
@deevioo
@deevioo 7 жыл бұрын
Very nice videos! float d = 20; background(0); size(500, 500); for (float y = 0; y < height; y = y + d) { for (float x = 0; x < width; x = x + d) { float di = dist(width / 2, height / 2, x, y); fill(di / 2); strokeWeight(0); rect(x, y, d, d); } }
@6uiti
@6uiti 2 жыл бұрын
the power of a decrementing nested for loop for deletion
@inaugurated
@inaugurated 7 жыл бұрын
Little bit off topic, but I did use stuff from former tutorials. For anybody that knows/likes a bit of math; drawing a sine function with amplitude and frequency modulated by the mouse position: float circleX; float circleY; int circleRad = 4; float sine = 0; float period; float amplitude; void setup() { size(500, 500); } void draw() { background(50); // Set variables // The width of one full wave in pixels, modulated by mouseX. // When mouseX is at full width, there should be one full wave visible. period = (width) * mouseX/width; println("period (pixels): " + period + " period (rads): " + (period/width) *2 *PI + " frequency: " + 500/period); // The amplitude of the wave, modulated by mouseY. // height-mouseY so amplitude goes up when the mouse pointer goes up. amplitude = ((height)/2) * (height- mouseY)/height; // The starting position of the circle. Starting point is the radius of the circle, // so it starts with a full circle. circleX = circleRad; while(circleX < width) { // drawing a sine wave with the correct amplitude and period. sine = amplitude * sin(((circleX)/period)*2*PI); circleY = height/2 + sine; fill(255); ellipse(circleX, circleY, 2 * circleRad, 2 * circleRad); circleX = circleX + 2 * circleRad; } }
@DavidDaybreakASMR
@DavidDaybreakASMR 8 жыл бұрын
Personal project! //CUTE color grid (using alpha channels and for loops); void setup() { size(500, 400); } void draw() { //draw background(255); noStroke(); //logic float x = 0; float y = 0; for (x = 0; x < width; x+= 20) { fill(x, y, mouseY/2, 10); rect(x-width, 0, x, height); } for (y = 0; y < height; y+= 20) { fill(mouseX/2, x, y, 10); rect(0, y-height, width, y); } }
@RomboutVersluijs
@RomboutVersluijs 6 жыл бұрын
Wow these tuts are awesome, love your enthusiasm
@furiouscakeface6964
@furiouscakeface6964 6 жыл бұрын
i use a for loop like this: for(int i = 0; i < width; i++) { line(x, 0, x, height); }
@Ambigious
@Ambigious 6 жыл бұрын
FurIouScAkefAcE so you copy paste his last video?
@luisfuentes4824
@luisfuentes4824 9 жыл бұрын
very helpful videos....I actually learn more watching your videos than by listening to my professor in my CST 112 class lol.hahaha your videos are great thanks for making them
@nordini3516
@nordini3516 4 жыл бұрын
Thanks Mate , it really helps. Couldnt get it in my own language..
@Egosumali
@Egosumali 4 жыл бұрын
best video on the internet
@samoh6084
@samoh6084 3 жыл бұрын
I did this on my day 3 of learning JavaScript at my bootcamp and my instructor thought I wrote a bizarre code. He literally said it was bizarre. I was lke wtf? I knew this concept would exist. The dude was just intimidated
@na0m1.10
@na0m1.10 8 жыл бұрын
How would you make each square a static different colour?
@VICE-H3RO
@VICE-H3RO 4 жыл бұрын
Thank you so much, I finally understand a nested loop :D
@Calz20Videos
@Calz20Videos 7 жыл бұрын
at 4:22, replace rect() with line.
@aviralsrivastava3409
@aviralsrivastava3409 7 жыл бұрын
Most of the commands are codes!!!!!!!!!!!! See the effect of your magic DANIEL...! Love you :)
@naomifox6817
@naomifox6817 8 жыл бұрын
Hi I tried this and my rects are flashing instead of all just being one random color each they keep flashing my code is the same as yours except they flash some how
@timeslongpast
@timeslongpast 8 жыл бұрын
naomi fox did you put them in void draw() if so the random number is changing every frame so they would be flashing
@andyli1890
@andyli1890 8 жыл бұрын
naomi fox if you don't want them to change color, put the "fill()" command inside the nested loop
@igotapochahontas
@igotapochahontas 6 жыл бұрын
How would I transverse (traverse?) it? Like if I wanted to push only one x or y per row or column into an array, how?
@amarpreetmanjot706
@amarpreetmanjot706 3 жыл бұрын
I ran the code after random() fill in the rectangles but it keeps on changing the color and doesnt allots a 'still' random color to each rectangle
@amarpreetmanjot706
@amarpreetmanjot706 3 жыл бұрын
found it, he was running static I was in dynamic by making blocks of void draw()
@skuul77
@skuul77 7 жыл бұрын
here's mine: int scl = 20; void setup() { size(1920,1080); background(0); } void draw() { for (int i = 0; i < width; i+=scl) { for (int j=0; j < height; j+=scl) { float r = dist(mouseX, mouseY, i, j)/4; float g = dist(mouseX, mouseY, i, j)/5; float b = dist(mouseX, mouseY, i, j)/2; strokeWeight(2); stroke(71); fill(r, g, b); rect(i, j, scl, scl); } } }
@crvzer
@crvzer 4 жыл бұрын
Great video. Great teaching style. Thanks.
@here1am1
@here1am1 6 жыл бұрын
// color gradient generator... yup int resolution = 1; // < changes the size of each rect, effectively the resolution of the gradient or more technically, bit depth. in a way I guess size (800, 600); background(0); noStroke(); fill(126); for (int y = 0; y < height; y = y + resolution) { for (int x = 0; x < width; x = x + resolution) { fill(x/(width/255), x/(width/255), y/(height/255)); // ^ ^^^ mixing up x, y, width and height in R, G and B channels will yield different color gradients. rect(x, y, resolution, resolution); } }
@here1am1
@here1am1 6 жыл бұрын
and yes, I'm a bit late to the party lol.
@oliviawaters7815
@oliviawaters7815 Жыл бұрын
Can anyone explain how to make the grid checkered? Like alternating colours Thank you!
@TheCodingTrain
@TheCodingTrain Жыл бұрын
If you pop by the discord, we can help you there! thecodingtrain.com/discord
@neham2056
@neham2056 8 жыл бұрын
hi i was working how you woud do this with nested loops? Use 1 loop to produce a row of 5 stars * * * * *
@blahblah-pl2qd
@blahblah-pl2qd 6 жыл бұрын
i think you might have found an answer already but here it is anyway you do not require two loops a single loop is enough to get it for(int i=1;i
@shamanshamanite84
@shamanshamanite84 6 жыл бұрын
This is a for loop using python to create ***** for star in range(5): print("*",end="")
@mumberthrax
@mumberthrax 7 жыл бұрын
man... so i went to try to make it change color depending on the square's distance from the mouse... but also constrained so that the full spectrum was shown between the mouse and the edge of the window. THAT was tricky, figuring out how to tell where the ray from the cursor and the square intersected with the line defining the edge of the window. turned out not as appealing as just setting the end of the range to be the corners of the windows. might try defining some arbitrary points in the window as well and see how that looks.
@elcurvo
@elcurvo 3 жыл бұрын
See "Nested Loops Tutorial" I would like to ask, if I finally get a grid of "900 Rectangles", ---- how can I write the code "" fill (Random (255), Random (255), Random (255) "", ...-- ---, so that each fill was only "" different Reds "", and no Reds were repeated within another rectangle, obtaining 900 variations of Reds only? Thank you for your help----Greetings !!!
@flopown
@flopown 8 жыл бұрын
Hi there, I was playing around with the fill() function using the dist() from mouseX, mouseY to the x and y pos. of my rectangle. To do this I used the translate function. But I noticed that the mouseX and mouseY were still being mapped according to the topleft of the screen, instead of the middle of the screen. Might this be a bug in processing? Or is it designed to work this way and did I just miss it?
@flopown
@flopown 8 жыл бұрын
Never mind, I found the problem. I had put the translate function within draw() Now that I have put it in setup it works. Still kinda confused on why it is a problem though, while it was in draw, it was in the beginning of the code, so shouldn't it have worked?
@dhruvsharma2571
@dhruvsharma2571 4 жыл бұрын
Hey Daniel! Could you help me with this program that I wrote for a rotating circle? I wanted to add an option to increase or decrease the speed of rotation when I clicked and dragged the mouse along the Y axis. Something weird is happening though. float x, y; float rotationSpeed = 1; void settings () { fullScreen (); } void setup () { x = width/8; y = height/3; } void draw () { background (127); noStroke (); fill (100); ellipse (width/2, height/2, x, y); x = x + rotationSpeed; if (x >= width/4 || x
@isaib.ala7
@isaib.ala7 4 жыл бұрын
shouldn't rows be horizontal lines and columns verticals?
@TorIvanBoine
@TorIvanBoine 6 жыл бұрын
Awesome explanation. Struggled a bit to understand the logic of nested loops. Question: If I have 2 for loops. How do I get it to loop through both at the "same" time? instead of: x y y y ... I would get x y x y x y ....
@jibranahmad8518
@jibranahmad8518 5 жыл бұрын
had the same question. I am guessing it may be a more advanced feature that uses the multi processor power. It probably is in the newer Java
@gedece
@gedece 3 жыл бұрын
I'm thinking that for that you'll need another specialized library. for example, in python I would use the itertool library and use the product method. import itertools for i, j in itertools.product(range(x), range(y)):
@mathoesify
@mathoesify 8 жыл бұрын
Love your work. Thanks!
@badis23
@badis23 8 жыл бұрын
hello, plz how to fill up the empty spaces with random numbers with no duplication, very urgent
@vivienneyao8138
@vivienneyao8138 5 жыл бұрын
I use the same function but why my pattern is twinkling all the time?
@lucasreis8657
@lucasreis8657 8 жыл бұрын
wow, just look at it void setup(){ size(500,500); } void draw(){ background(255); for(float x=0;x
@matiamus2465
@matiamus2465 6 жыл бұрын
Really need some help with this thing. I wanted to write the same rectangle grid, but using "while" loop. And i got stuck, i don't really understand how to put everything in the right order so it would work normally. :( If someone knows, i would be very grateful for help.
@blahblah-pl2qd
@blahblah-pl2qd 6 жыл бұрын
the only difference between a while loop and a for loop is the variable assignment and increment while(termination condition){ //statements// } for(assignment ; termination condition; increment){ //statements// } to mimic a for loop using a while loop just place the the termination condition used in "for" loop inside the "while" loop but put the variable assignment right before the start of while loop and the increment right at the end of the while loop eg:- for(i=0;i
@dchamp296412
@dchamp296412 3 жыл бұрын
Bro... just what i needed
@notbarbara2647
@notbarbara2647 7 жыл бұрын
try this code: float tegelGrootte = 50; void setup() { size(400, 400); background(255); strokeWeight(3); rectMode(CENTER); int tegelY = 25; while (tegelY < height ) { tekenRij(tegelY); tegelY += 50; } } void tekenRij(float y) { int tegelX = 25; while (tegelX < width) { tekenTegel(tegelX, y, tegelGrootte); tegelX += 50; } } //deze tekenen alle vierkantjes + de kleuren void tekenTegel(float x, float y, float grootte) { while (grootte > 0) { tekenVierkant(x, y, grootte); grootte -= 10; } } void tekenVierkant(float x, float y, float grootte) { fill(random(255), random(255), random(255)); rect(x, y, grootte, grootte); }
@MyMar23
@MyMar23 6 жыл бұрын
or you could just do this :) void setup () { size (400, 400); rectMode(CENTER); } void draw () { background(255); float rectSize; float xLoc; float yLoc; for (xLoc = 25; xLoc < width; xLoc += 50) { for (yLoc = 25; yLoc < height; yLoc += 50) { for (rectSize = 50; rectSize > 0; rectSize -= 10) { fill(random(255), random(255), random(255)); rect(xLoc, yLoc, rectSize, rectSize); } } } noLoop(); }
@purplepete123
@purplepete123 6 жыл бұрын
can someone explain to me why the first row isn't working and how i could fix it? void setup(){ size(400,400); background(0); strokeWeight(2); stroke(125); } void draw(){ for(int x=0;x
@kewlfool
@kewlfool Жыл бұрын
move " fill(dist(x,y,mouseX,mouseY)); " above " rect(x,y,20,20); "
@tekiero
@tekiero 4 жыл бұрын
what will happen if we add third loop?
@matteodirollo4037
@matteodirollo4037 5 жыл бұрын
My code is not working an it looks the same, I don't know why :/
@TheCodingTrain
@TheCodingTrain 5 жыл бұрын
Hi Matteo! Have you asked in slack?
@StefWillemse
@StefWillemse 7 жыл бұрын
How would you do a checker pattern?
@tentacle_sama3822
@tentacle_sama3822 3 жыл бұрын
If we do 3 loops is it a cube?
@Sir_BoazMutatayi
@Sir_BoazMutatayi 8 жыл бұрын
Hello Mr Daniel! I have watched all your videos so far and sadly you did not cover the trigonometry part. but still Thank you very much.
@TheCodingTrain
@TheCodingTrain 8 жыл бұрын
+Sir. Boaz Mutatay take a look at this playlist kzbin.info/aero/PLRqwX-V7Uu6bR4BcLjHHTopXItSjRA7yG
@Ayo-PoL0
@Ayo-PoL0 6 жыл бұрын
How do you generate this 1***** *2**** **3*** ***4** ****5* *****6
@ChrisTian-ox5nr
@ChrisTian-ox5nr 4 жыл бұрын
great video!berry helpful!
@ZekeGaming
@ZekeGaming 7 жыл бұрын
Thank you so much :) You're doing God's work
@errornotgonatel7185
@errornotgonatel7185 3 жыл бұрын
Wow thx that makes much sense even tho im doing java
@lumbybronzearm
@lumbybronzearm 3 жыл бұрын
For every column, take off every Zig.
@rishabhsinha3713
@rishabhsinha3713 7 жыл бұрын
Here's something I've tried inspired by peoples in the comment. Enjoy. ----------------------------------------------------------------- float darkness =1.5; float randomness=1; void setup() { size(1080,1080); } void draw() { randomness+=1/randomness; strokeWeight(1); stroke(0,0,random(5*randomness)); for(int i=0;i
@andremuslim9594
@andremuslim9594 6 жыл бұрын
Great explanation :D
@ColbyCleansStuff
@ColbyCleansStuff 2 жыл бұрын
this was great thx!
@masbro1901
@masbro1901 4 жыл бұрын
i'm sleepy watching this, and my brain get dizzy
@d34dc0d35
@d34dc0d35 6 жыл бұрын
//There no dist( ); but i do my best float circleX = 0; float circleY = 0; float x = 4; float speedX = x; float y = 4; float speedY = y; boolean pause = true; void setup() { size(640, 360); } void draw() { background(255); strokeWeight(random(1, 3)); stroke(random(255)); if (circleX < width/2 && circleY < height/2) { for(int x = 0; x height/2) { for(int x = width/2; x
@mosesvalentin1600
@mosesvalentin1600 7 жыл бұрын
Ehm what programming language is this?
@samesame9305
@samesame9305 6 жыл бұрын
Its based on Java
@btgsrqlvs
@btgsrqlvs 6 жыл бұрын
I wrote this, but it doesnt count right ? :) too much if's instead of loop :/ but i couldnt figure it out how to right with fors. // Hi ! float d; int x; int y; size (800,600); stroke(0); background(0); strokeWeight(2); for(x=0;x
@btgsrqlvs
@btgsrqlvs 6 жыл бұрын
whoops :D he said darker inside brighther outsides but i did excatly the opposite :D idk why.
@36degreesMars
@36degreesMars 4 жыл бұрын
i'm really struggling with these exercises
@QwertyNPC
@QwertyNPC 8 жыл бұрын
Well, here is my solution to make the squares change shade gradually from the centre, maybe someone will find it helpful. It is not a radial gradient though. size(420, 420); background(0); stroke(255); fill(127); int shade = 0; int offset = 0; int shadeDiff = 12; int sizeOfSquare = 20; for (int x = 0; x
@BenWilliams-ie4wc
@BenWilliams-ie4wc 6 жыл бұрын
Very nice :)
@TheChosenFailure
@TheChosenFailure 7 жыл бұрын
this works but i Dont know why..... float x ; float y ; float d; void setup(){ size(400,400); background(0); strokeWeight(2); stroke(255); fill(100); } void draw(){ for(int y = 0; y < height; y = y + 20){ for(int x = 0; x < width; x = x + 20){ d = dist(mouseX,mouseY,x,y); fill(d); rect(x,y,20,20); } } println(d); }
@GinoTheSinner
@GinoTheSinner 4 жыл бұрын
Another programming tutorial that already assumes you know how to program I like it.
@brandonpillay9025
@brandonpillay9025 6 жыл бұрын
Great energy
@noobgamerbtw2701
@noobgamerbtw2701 3 жыл бұрын
bruh!!! I feel like why did i even clicked on this video
@hidayet191
@hidayet191 7 жыл бұрын
I dont know why but if I add "void setup()" and "void draw", it wont work. There are some errors
@hidayet191
@hidayet191 7 жыл бұрын
processing.app.SketchException: unexpected char: '\' at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:361) at processing.mode.java.JavaBuild.preprocess(JavaBuild.java:155) at processing.mode.java.JavaBuild.build(JavaBuild.java:122) at processing.mode.java.JavaBuild.build(JavaBuild.java:104) at processing.mode.java.JavaMode.handleLaunch(JavaMode.java:122) at processing.mode.java.JavaEditor.lambda$0(JavaEditor.java:1097) at java.lang.Thread.run(Thread.java:748) like this.
@nisargjasani8815
@nisargjasani8815 8 ай бұрын
Thank you very much for sharing your knowledge. I have created a Basic Interactive Chessboard that shrinks and expands using mouseX and mouseY: //Creating 8x8 Chessboard using Nested For Loops //Interactive Chessboard using mouseX and mouseY void setup () { size(400,400); background(0); } void draw () { background(0); strokeWeight(2); stroke(0); for(int i=0; i
@alloftheabove1653
@alloftheabove1653 6 жыл бұрын
i did the whole thing with just one for loop.... then i realised its about a loop in a loop.....
@ajcics
@ajcics 7 жыл бұрын
Super still don't get it
@indianadvisor650
@indianadvisor650 7 жыл бұрын
Thanks
@NandoSantanaMusic
@NandoSantanaMusic 2 жыл бұрын
Was just me that was disturbed by he calls squares as rectangles ? lol
@tekinuyan4856
@tekinuyan4856 7 жыл бұрын
cool video
@MASTER_ADHD_GIFTED
@MASTER_ADHD_GIFTED Жыл бұрын
Bubble tea code
@minecraftpapiernik1930
@minecraftpapiernik1930 6 жыл бұрын
Fuí el like número 667, que miedo
@pragatipatel1722
@pragatipatel1722 6 жыл бұрын
Ohh I love you.. 😘😘
@saikatmondal2715
@saikatmondal2715 7 жыл бұрын
it is a bad video......anyone van not infer stand....you have shown your style in this vedio..
6.4: Variable Scope - Processing Tutorial
9:01
The Coding Train
Рет қаралды 64 М.
6.1: While Loop - Processing Tutorial
11:15
The Coding Train
Рет қаралды 217 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 623 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 10 МЛН
Adding Nested Loops Makes this Algorithm 120x FASTER?
15:41
DepthBuffer
Рет қаралды 130 М.
Python Programming Series (Loops 4): Nested loops
14:45
Left Peel
Рет қаралды 170 М.
Nested Loops in Java
10:09
Neso Academy
Рет қаралды 296 М.
The World Depends on 60-Year-Old Code No One Knows Anymore
9:30
Coding with Dee
Рет қаралды 1 МЛН
Coding Challenge 180: Falling Sand
23:00
The Coding Train
Рет қаралды 1 МЛН
6.3: For Loop - Processing Tutorial
7:00
The Coding Train
Рет қаралды 220 М.
How to solve any Star Pattern Program
18:47
Simply Coding
Рет қаралды 1,2 МЛН
computers suck at division (a painful discovery)
5:09
Low Level
Рет қаралды 1,7 МЛН
5.1: Boolean Expressions - Processing Tutorial
12:14
The Coding Train
Рет қаралды 162 М.
9.4: Arrays and Loops - Processing Tutorial
11:32
The Coding Train
Рет қаралды 129 М.
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 623 М.