I would've never felt dumb if i had you as my professor. Thank you for making it very clear to me.
@TheCodingTrain8 жыл бұрын
+Sir. Boaz Mutatay thanks for the nice feedback!
@Dirt_Wizard8 жыл бұрын
+Sir. Boaz Mutatay You're so goddamn right.
@Giant_Swing7 жыл бұрын
Dude you really are an amazing teacher, my only advice and I'm sure many others will agree with me is that you seem to worry too much about video length and going a little bit off-topic, maybe there is an external reason for that (maybe if you use your videos in classes and you need them to be a specific length or whatever) but I dont care if the video could be "compressed" 1-3 minutes shorter, I watch your channel not only because your explanations are top-notch but because your personality and energy is super fun and entertaining, so having you talk about something not strictly related with the topic at hand for a brief moment is really enjoyable and serves like a brief pause from all the technical stuff. Anyway sorry for the 200 word essay, love your vids, keep up the good work!
@TheCodingTrain7 жыл бұрын
+giantSwing thank you I really appreciate the feedback!
@AbdulRehman-yo2qn8 жыл бұрын
You have a really unique style of teaching, and you explain every little thing that could be hard to comprehend by some people..which is really helpful.
@TheCodingTrain8 жыл бұрын
+Abdul Rehman Really appreciate the nice feedback!
@mehdirzayev7035 жыл бұрын
Just great!!! I never thought that such a complex topic as programming could be explained with so much enthusiasm and energy!!! My applause!!!
@weltraumimport8 жыл бұрын
that was a perfect pen catch at 7:10 i'm impressed
@TheCodingTrain8 жыл бұрын
hah, thanks for noticing!
@kronosuber98495 жыл бұрын
The fact that programming/computer science teachers and professors are so much more laid back than others makes me enjoy this field even more.
@roddydykes70532 жыл бұрын
If I had to guess, it’s because they KNOW their field is a sought-after and respected one. Everyone needs a programmer working at their company. They do not have to convince you what they’re trying to teach you is valuable in some way, like many other professors get caught up doing.
@valkyrie-randgris4 жыл бұрын
I love how happy and high energy this guy is. Honestly it's super fucking helpful. It's early, I'm confused, I'm tired, and I have a big project lying in front of me, but this guy is cheerful and excited by coding and it's contagious!
@aqualina-josephina5 жыл бұрын
I made a rainbow, out of randomly generated ellipses between size 10 and 50. With colors also in different shades of the main color. In pastel. I love it.
@mauricioarroyo41125 жыл бұрын
Best professor ever, thank you so much
@samuilnikolov46557 жыл бұрын
Here is the code for colour circles with random positions It is vary cool Thanks Coding Train you are awesome and keep going with those awesome videos The code: float circleX; float circleY; float r; float g; float b; void setup() { size(640,360); circleX=width/2; circleY=height/2; background(50); } void draw() { r=random(0,255); g=random(0,255); b=random(0,255); circleX=random(0,width); circleY=random(0,height); fill(r,g,b); ellipse(circleX,circleY,24,24); //circleY=circleY-1; }
@omgomgomgholyy8 жыл бұрын
Your processing tutorials are amazing ! My professor is so monotone when he talks and he's not that clear when explaining concepts like this so thank you for saving my behind with these tutorials . Love the excitement it is really encouraging. Keep it up and I love the examples as well !
@TheCodingTrain8 жыл бұрын
Glad to hear, thanks for watching!
@oscarrandle23757 жыл бұрын
I have a test tomorrow and you have single handedly saved by bacon. I salute you, oh great coding sensei
@kmms47206 жыл бұрын
okay wow honestly not complaining at all but how are your videos free??? This is saving my whole life
@ivanhizman50203 жыл бұрын
Thank you very much. My informatic teacher just sends us solutions and does not want to explain them to us.. baad.. but thank you soo soo much.. it´s was just so cool to watch your video and everything went after watching it. You´re the best! :)
@nekrosmantis10316 жыл бұрын
This guy is insane. I like him.
@alina-rx3uv Жыл бұрын
i'm really struggling with programming at university so this really helped me a lot thank you so much, my code works now haha :)
@gennaroturco8 жыл бұрын
Hi, I just started the course, sorry if what i say it is not correct. I realise something by mistake, and i don't understand why it happens. if I declare a variable by using "float size;" and i initialise it using "size=random(20,70)" when i use it, it keeps the changes at the same rate for the width and height so the circle it's always a perfect circle of different size. If I instead use just the random function on the width and height of the ellipse it randomise the size of the object not equally by width and height so it shows different shaped ellipses. I'm really loving this course! This is a great channel! Thanks a lot!
@gregjones41797 жыл бұрын
your videos do help btw; i am taking a comp sci class and have absolutely no idea what I'm doing but this helped a lot. I literally spent like 30 mins just trying out what was close to how you increased the size( i have to increase the size of a shape only if left mouse was used) i tried xSize++ in the shapes format and under the else statement.
@MrPanzerDragoon3 жыл бұрын
okay, this random() function is pretty darn cool.
@arianeairey83048 жыл бұрын
Bonjour Daniel et un grand MERCI! Vos cours sont tout simplement formidables!!! :)
@adri23506 жыл бұрын
LA FRAAAAAANCE
@ark23074 жыл бұрын
what
@mosonic3 жыл бұрын
You made me laugh with your little walk from one screen to the other at 4:10 - these little strange and humorous things make your videos so relatable. Thank you 😊
@pythoniktm2 жыл бұрын
Pl
@Hasahn. Жыл бұрын
Haha yeah its like I'm watching Blue's Clues
@ajiteshsinghrathore57703 жыл бұрын
thanks sir , i am learning and feeling it easy because of you.
@Moonwalkerrabhi3 жыл бұрын
Love your enthusiasm
@supertacokitty19968 жыл бұрын
I am your biggest fan! thank you for the videos, they help SO MUCH!!
@TheCodingTrain8 жыл бұрын
+Hannah Stevenon thanks so much, so glad to hear!
@marym77635 жыл бұрын
thank you for this tutorial! Very helpfull for my current project!
@cragland367 жыл бұрын
you make me want to stay inside and code all day
@robertidonotsharemyfullnam4964 жыл бұрын
my ocd wanted to see the circles paint out all the background before the video ended. darn you!
This is so inspiring. Thank you for all these tutorials, I love you
@SimonTiger5 жыл бұрын
Tid-bit: The operation `x = x + ___` is so common that there's a shorthand: `x += ___`! If you want to just increment by 1, like `x += 1`, you can even shorten that by just saying `x++`!
@rutajurciukonyte73989 ай бұрын
How do you add another circle (for example different color) that appears in different random places? Now I'm adding another circle with the same values but it overlaps the first circle.
@yingli57264 жыл бұрын
thank you so much! Very helpful for my work...
@slims04023 жыл бұрын
Thank you from 2021
@兴宣大院君-h4s8 жыл бұрын
That's what makes me wanna apply to NYU
@TDog33379 жыл бұрын
I have a question: I want the x value of a square to change randomly, but in increments of 50. I have random(0,width). but I only want to pick like 0, 50, 100, 150 and so on...
@AryehAmitz9 жыл бұрын
6:10 Aah, i get it. Declaring circleX to be a float datatype means that when it runs 'random()' it will include numbers with decimals. So, 'random()' is is partially defined by the datatype it is drawing from and whether or not it is immediately inside of a statement that states a datatype . I saw that if you were to put 'random()' inside of 'int()' you would be able to limit it to integers even though the datatype was originally a float. My understanding is that that would be bad code though, or at-least a waste of memory since it would be less efficient than declaring it as an int in the beginning. This isn't so bad! I think I'm getting it. This is my first time learning how to program. I'm surprising myself, i didn't think i had it in me. (...and then i scroll down and see that youve already written that below in the comments.....*facepalm*)
@TheCodingTrain9 жыл бұрын
+Indigo Veilplume Yes, this is right! random() by definition returns a float (i.e. decimal) number but that can always be converted after the fact.
@FusionTerror4 жыл бұрын
Him: *Talking about how if you heated up gas and watch the particles* at 5:44 Me: I just wanna make a random number generate
@adri23506 жыл бұрын
Hello, thanks for your videos ! How I do for slow down the distance traveled ?
@moritzsolderer29324 жыл бұрын
I'd like to do the make the velocity of my ball a random number between -6 and 6 but without the 0, everytime the ball gets reseted. Any ideas how to accomplish that?
@purityvsprofanity29623 жыл бұрын
I'm trying to make a game with the ball having random positions. I got it to do that, but it's moving fast as hell. How do i keep the speed controlled?
@cumalikarakoc25547 жыл бұрын
Thanks for the amazing videos! very didactic and funny :)
@jamh64749 жыл бұрын
Thank you for the tutorial. It was really helpful. I was just wondering how could you cap it to make only 5 random circles for example? Thanks.
@TheCodingTrain9 жыл бұрын
+Jasmin Harris If you look ahead to videos about loops and arrays this would allow you to more easily control the number of circles drawn. kzbin.info/aero/PLRqwX-V7Uu6bm-3M4Wntd4yYZGKwiKfrQ kzbin.info/aero/PLRqwX-V7Uu6bO9RKxHObluh-aPgrrvb4a
@tsmupdatertsm76337 жыл бұрын
Nice to hear you are happy on the first second of this video. :) Why is it not possible to set the "size" function outside of the "setup" scope (befor the variable declaration) ? then you could use the "width/2" variable? i get follow error : "it looks like you're mixing "active" and "static" modes. (when i try this)
@TheCodingTrain7 жыл бұрын
Your code has to be inside a function for it to be executed. setup() is the function that starts at the beginning so it's the place for size()!
@angelcaru3 жыл бұрын
In draw(), you have to use surface.setSize() instead of size()
@pratyushkamboj6343 жыл бұрын
Hi, I'm a bit unsure of how to get the ellipse in a randomised y position. So for instance when I do randomise the y position, the ellipse goes into many different y positions but I only want it to randomise the y position once every time I run the code. Any suggestions on how to do this?
@nataliasnop19014 жыл бұрын
Hi! I have a question. I'm trying to create a text whose fill changes randomly whenever I press a key. The thing is that I would like to generate a random color each time I press that key instead of once I've pressed it, for it to generate random colors all the time. I would like the random generated color to stay the way in was created until I press that key again. I'm going nuts about it and don't really know how to make that possible. Could you help me please? I hope I explained myself properly ;)
@jakes-dev13372 жыл бұрын
Coding Train! Where can I get this patterned background?
@VictorRivarola0074 жыл бұрын
4:47 In every language I have encountered before, including C64 Basic, Turbo Pascal 3, C/C++, Ada, PHP, Python, C# (shudder), and plain Java, the simple use of the random function would have been defined to work exactly this way, always generating the exact same sequence of pseudo random numbers--unless you seed it with a different number every time, from sources such as the system clock or the current mouse position. How do you control the random seed in Processing?
@winakhairunnisa63373 жыл бұрын
you're so genius, i enjoy watching your videos! can you make coding " world clock" please? can someone help me? i'm so glad if you can
@rizkayunisa81183 жыл бұрын
Me too i really need coding of world clock too, please help me
@Themarkhorcric7 жыл бұрын
thank you so much sir your videos help much
@manuebi91254 жыл бұрын
omg, width will not work bevore you did your size(x,x); ..... thanks you pointet out what i did wrong ....i was just so used to do all the variables at the top. lesson learnt
@youmah258 жыл бұрын
i can't like the video twice
@orifl66537 жыл бұрын
I made a random circle generator like you did but with random color and length of the circle void setup() { size(600,600); background(50); } void draw() { float red = random(255); float green = random(255); float blue = random(255); float circleX = random(width); float circleY = random(height); float circLengh = random(10,100); stroke(0); fill(red,green,blue); ellipse(circleX,circleY,circLengh,circLengh); println("I just made a circle at " + circleX + ", " + circleY + " with a lenght of " + circLengh + "and at color of " + red + " " + green + " " + blue + " !"); }
@Lubstrs7 жыл бұрын
thecodingtrain where did you learned all about processing?
@zachkurley52267 жыл бұрын
is there a way to get the random function to count by 2 or 3, etc, instead of by 1
@nikkonikko3714 жыл бұрын
You can make an array that has the values you want to randomly choose.
@moonshine88487 жыл бұрын
how would i create random color? i did hueX = random(255) but that just creates a random grey scale color halpp?
If I create an empty sketch and use the line print(random(100)), I get floats between 0 and 100, as expected. But then I have the same line code in the setup function of a different sketch (with many lines, functions, etc) and the random(100) function call doesn't seem to behave properly. I get floats ranging from 0 to much higher than 100, up into the thousands. Does anyone have an idea why this would happen?
@corey333p8 жыл бұрын
I figured it out. It turns out I was trying to print 2 different lines, which caused problems in the print output. The random() function was working fine. *noob*
@NPG977 жыл бұрын
what if I want to random 4 specific positions of an image?
@nikkonikko3714 жыл бұрын
You can make an array that has the values you want to randomly choose.
@woophereigo97552 жыл бұрын
I always thought that if you take whatever algorithm for a random number, and added it together with a few others, averaged the numbers, do it twice, then take the average of both of those averages, that number would be quite random, no? You can't take averages of averages, it doesn't work out, so is this decent algorithm?
@spezistyle7 жыл бұрын
/** This programm generates an infinitely number of randomized circles on screen. **/ /** Initiative variables **/ float circleX; //x-position of circle float circleY; //y-position of circle int r, g, b, a = 0; //red, green, blue and alpha channel int size = 0; //size of circle /** Set-up screensize and background color. **/ void setup() { size(800, 600); background(230); //position first ball on screen center circleX = width/2; circleY = height/2; } /** Draws a new randomized circle on any position on screen. **/ void draw() { color c = color(a, r, g, b); fill(c); //fill the circle with a color ellipse(circleX, circleY, size, size); circleX = (int)random(0, width); //get a new random posiotion circleY = (int)random(0, height);//on screen size = (int)random(5, 70); //get a new random color for each a = (int)random(20, 80); //channel r = (int)random(0, 255); g = (int)random(0, 255); b = (int)random(0, 255); }
@spezistyle7 жыл бұрын
What do you think, any suggestions or feedback?
@Giant_Swing7 жыл бұрын
But the alpha would be the fourth argument in the color "function" wouldnt it? Like color(r,g,b,a) instead (a,r,g,b)
@markmeszaros54468 жыл бұрын
Hej Daniel! First of all Thank You for making these awesome tutorials! It is GOLD! Keep it doing please! :) Second, I am trying to make the exercise You suggested in the end of the video, namely to color the circles differently if they are in a specific area of the image. I understand that I can use if statements, but the following code draws red circles also outside of the specified area. Could anybody enlighten me? Thank You in advance! float xpos; float ypos; void setup() { size(800,600); background(0,0,0); } void draw() { xpos = random(15,width-15); ypos = random(15,height-15); ellipse(xpos,ypos,30,30); if(xpos
@markmeszaros54468 жыл бұрын
The problem is resolved! I should draw the ellipse after the if evaluation... ;)
@Martmarish5 жыл бұрын
This videos of yours are exactly as good today as they were in 2015. Thank you for sharing your knowledge in a clear and fun way. I really enjoy your videos. I have a little question, tho: If I type in the circles position on the x-axis as "random(-2, 2)" it will be sett to anything from -2 to 1.9999999 or something. And if Processing just cutting away the decimal points (this video on 6.50: kzbin.info/www/bejne/qIuWZ3WwjauHbLM), isn't it just possible for the circle to move from -2 (very little chance) to 1? Or is it really rounding up to nearest int? Keep up the good work!
@TheCodingTrain5 жыл бұрын
Yes if you use int() or floor() the decimal place is lost so you would just get -1, 0, or 1. Best way is to write some code and test and println() the results!
@Martmarish5 жыл бұрын
@@TheCodingTrain Thank you for answering. Short and constructive. Love your work!
@martinlalandromero46498 жыл бұрын
Thanks man
@arttuhintsala97176 жыл бұрын
im trying to get a ball to spawn on one of three spots: 100, 200 and 300. i set the random to produce a number from 1 to 3 so that 1 is 100, 2 is 200 and 3 is 300, but somehow my random always produces 0. please help
@TheCodingTrain6 жыл бұрын
Would you mind asking at discourse.processing.org/! It's a better platform for Processing and p5.js related code questions. You can share code there easily! Feel free to link from here to your post.
@arttuhintsala97176 жыл бұрын
The Coding Train thanks, will do.
@joannamargaretreayeverittr25752 жыл бұрын
Can i randomize with vertex? if so how do i do this? T_T
@KotatsuInUnova4 жыл бұрын
Daniel
@asmael21138 жыл бұрын
Hello, I actually can't find how to use the random function to have new random colors everytime my loop is reactivated in my program, could you help me please sir?
@cs95837 жыл бұрын
random collors? int x=(int(random(255)); fill(x,x,x);
@asmael21137 жыл бұрын
João Miranda oh thank you, my professor actually explained me so i got my answer but thanks!
@Jup1_7 жыл бұрын
thank you
@antares-the-one3 жыл бұрын
just imagine what is going on inside that head: writes code and refferes to the previously implemented variables; thinks about the good way of presenting information; speaks excelent language without flaws. And all of that at the same time. Now tell me! How to live in this world when there are peolple like him competing with you in this life?
@GeodesicBruh5 жыл бұрын
I thought of 27 as well wtf?
@THFLful6 жыл бұрын
my circle is dragging it's colour all over the screen? any ideas?
@Delta.Steele5 жыл бұрын
Maybe a bit late, but check where your background function is. If it’s in setup, then it will only draw it once, and your circle will appear to duplicate, or drag its color as you’re describing. You most likely want it in your draw function, so it draws over old circles. If that makes sense
@JAMES180058 жыл бұрын
Was that thing on your shirt created using processing?
@evanyoung97146 жыл бұрын
It's actually hard to listen to this at 2x speed.
@hellboy32184 жыл бұрын
Why do I already perfectly know how work the random() function and I'm still here ?
@iiSza927 жыл бұрын
Thank uu so much!! Now I understand! Can you help me with something? I made this with stars (two triangles in a Pshape) and I want to program it so the stars won't touch each other, and the stars can only be at the top of the screen!
@iiSza927 жыл бұрын
I've managed to random the stars only in the top, but now I have to code something so that they won't touch each other!
@TheCodingTrain7 жыл бұрын
I would love to help! Can you ask this at forum.processing.org? It's easier for me and others to help that way (you can share code there easily!). Feel free to tweet me @shiffman a link so I can follow / contribute!
@iiSza927 жыл бұрын
Okay so I posted at the forum but I'm really new to this so I don't really understand what is happening there.. Could you try to explain it as simple as possible? forum.processing.org/two/discussion/21096/random-pshape-without-overlap
@carolinrusitzka23138 жыл бұрын
Can you fill a shape like for example a star with a lot of random images?
@TheCodingTrain8 жыл бұрын
+Caro Kaktus This is tricky to do, but definitely possible. texture() is a possibility or perhaps you could simply cover the image with rectangle with a star cut out of the middle. See beginContour().
@carolinrusitzka23138 жыл бұрын
Thank you! I will try that.
@iiSza927 жыл бұрын
I had to do this for a assignment for school, made a star with two triangles in a Pshape!
@washroom2 жыл бұрын
how to get random whole numbers
@snowman75146 жыл бұрын
Although 27 is as random as 50. I don't like that you choose 27 LOL. That's just too "emotional random" for me
@pylond54097 жыл бұрын
I started messing around with processing today, I tried to create a code that print the words true or false randomly, but im having some problems Heres the code float aleatorio; float random; void setup(){ aleatorio = random(1,100); random = random(50,100); } void draw(){ if(aleatorio > random){ println("True"); } else if(aleatorio < random){ println("False"); } } Im only getting True to be printed, if someone can explain why, id be happy
@Keeykey6 жыл бұрын
Try printing out what values of the random number you're getting to see if your if statements are correctly written.
@sanderhonig82767 жыл бұрын
19fps !?
@johnedwards51378 жыл бұрын
how do i slow down random?
@supertekkno8 жыл бұрын
by adding frameRate(100); to void setup. the framerate controls the random values generated per second, in this case 100.
@johnedwards51378 жыл бұрын
tried that, the goal was to make a snake-like game so it didn't really work. Already figured it out.
@aleksamitic81867 жыл бұрын
i want you to be my teacher
@vedant7785 жыл бұрын
u are amazing!!!!!!!!!!!!!!!!!!!!!!! Respect_||_
@johnrogers85356 жыл бұрын
Pretty good k lol
@xXReezeXx7 жыл бұрын
ho
@seize21794 жыл бұрын
Bro have you ever been depressed in your entire life lmao
@neelammishra69633 жыл бұрын
baklol
@shadowizz16864 жыл бұрын
Hello, if anyone wants to get free points, they can get them from Gamecrook.
@advikaagastya1664 жыл бұрын
Hello, it seems that Gamecrook is only legit site for free gems, coins, gold or whatever.