These videos have helped me build a true purpose in life. I think about everything I have experience with and how it has all let me to The Coding Train. Apple for the teacher!
i like how all of your "open and end curly brackets" are just super quickly drawn worms :D Thank you for making these! I've learned so much i can finally understand some of those programming memes i couldn't figure out before :D
dude u re awesum...u make this coding stuff much easy to understand thn it was before whether it s treehouse or anything ...u re d bst teacher ..hats off man
A couple things have changed in p5 since these videos were released - println() for example. It's probably good practice to just go and check the reference if you are using a p5 function and you get errors such as "not defined". Quick and easy way to double check your code!
In the web editor (editor.p5js.org), use console.log. print() will activate the browser's print function to physically print the page. If print() is written in the draw function you will have a loop that always pops up the browser's print window.
OBSERVATION: The function printLn() will not work in the actual p5.js library, instead what would be working is print(). (by the way, i have no words to express you all my gratitude, you are a wonderful programmer and teacher)
Hi, I really struggled to get this to work but got this answer from 'GoToLoop' on the processing forum which really helped me. " Function println() was removed from p5.js' API! Replace it w/ print(). Or use console.log() or console.info(), etc. BtW, hit F12 to open browser's developer tool. Then go to the console tab, so you can see whether any errors happened or not. " I may be the only person to not realise you had to use the console in the browser.
here are a few more examples: function setup() { createCanvas(400, 400); var km = milestokm(100); console.log(km + " km"); var pfund = kgtopfund(20); console.log(pfund + " pfund"); var f = celsiustofahrenheit(30); console.log(f + " F°"); var moonWeight = earthWeightToMoonweight(26.3); console.log(nfc(moonWeight, 2) + " kg on the 🌛 "); } function draw() { background(220); } function milestokm(miles) { var km = miles * 1.609; return km; } function kgtopfund(kg) { var pfund = kg * 0.5; return pfund; } function celsiustofahrenheit(c) { var f = (9 / 5) * c + 32; return f; } function earthWeightToMoonweight(earthWeight) { var moonWeight = (earthWeight / 9.81) * 1.622; return moonWeight; }
A quick question ,however, I want to store the pressed key in an array order wise, first pressed key first. Any handy solutions? I've tried almost everything.
do the scope of the variable(s) under the mileToKm function, which i would consider local, by pass that scope since the function as a whole is then used within function setup?
p5 console doesn't work need to see what thats about seems like and odd problem ;S " println is not defined " written on the browser console ... Must re install this or am I missing libraries? the console used to work something is missing i guess. plus some of the previous lessons.js are damaged / not working... I will re install p5
its confusing. I get the idea, but i don't understand what is the reason of saying miles then not defining where miles came from and what it is. confused
Think of it this way... when you set the variable as a parameter, you're sort of declaring it... then inside the code, you tell the computer what to do with the variable... then when you pass the argument thru, you're assigning a value to the variable. You're doing everything you've been doing, just in a different way.
Yep that seems to be the case.... I had a the very same problem yesterday so I used console.log(; instead of googling it up or looking in the reference :-P
i have made this button maker, after whatcing only your videos var rectBotton = function(x,y,s){ return mouseX > x-s/2 && mouseX < x+s/2 && mouseY > y-s/2 && mouseY < y+s/2; }
@@mbrasseau thanks, now i can return everybodys life because everybody is variable thats pushed into the new world using an object blueprint jk, it was for a pong game, but i already finished it
A computer is treating decimal numbers in a special way. Look up this link if you wish to find out more: softwareengineering.stackexchange.com/questions/167147/why-dont-computers-store-decimal-numbers-as-a-second-whole-number
Got a Uncaught ReferenceError: println is not defined, used print instead. What is the reason i cant use println? my example editor.p5js.org/morfen/sketches/qjBacfdJs
No, if miles is bigger than 1 mile is 1.6 km, he's right www.google.co.uk/search?q=1+mile+to+km&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&ei=34FZWOGsEuTG8Aep7Iu4CA You can check out conversions on google
You got a thinking error there. 1 mile = 1.6 km which means we need to take the value of a given mile and multiply it by 1.6 to get the value as km. km * 1.6 would be correct if 1 km = 1.6 miles would be true.
Anyone ever told u that u talk a bit too much! Anyways, I'm watching ur videos cz they are really informative. So, I must say, content quality is good!
After the 3rth video I stoped, finding this guy to anoying.. he explaines well but the laughing about(?) distracts me all the time. I'll try again tomorrow
хм, ....Daniel Shiffman один из талантливейших учителей.... смотрю видосы с автоматическим переводом на русский, скачал GettingStartedwithP5js.... нет проблем... хотя есть... нет живого и непосредственного общения((
I want to know in my code how to bring the number thats been input in "celsiusToFahrenheit(24)" function to be displayed in console in replacement to that "degree" part from print execution. Thank You codingTrain. editor.p5js.org/sauhard.eg@gmail.com/sketches/HkFOk4taX
I still don't understand the most of functions but I watch as I really enjoy and appreciate the energy and dedication of this guy.
i could cry on how amazing this is
These videos have helped me build a true purpose in life. I think about everything I have experience with and how it has all let me to The Coding Train. Apple for the teacher!
i like how all of your "open and end curly brackets" are just super quickly drawn worms :D
Thank you for making these! I've learned so much i can finally understand some of those programming memes i couldn't figure out before :D
Watching during covid19 outbreak
thanks, you really helped my friend Dev, he didn't know any of it!
He is still a beginner unfortunately
I helped you Mikey 😑
@@devpatel8505 nah bro
I always wanted cheat code but never understood how your TH-cam channel helped me a lot thank u
dude u re awesum...u make this coding stuff much easy to understand thn it was before whether it s treehouse or anything ...u re d bst teacher ..hats off man
A couple things have changed in p5 since these videos were released - println() for example. It's probably good practice to just go and check the reference if you are using a p5 function and you get errors such as "not defined". Quick and easy way to double check your code!
I think I'm starting to understand. *wipes away tears*
fyi: println( ) is now print( )
Thank you so much!
In the web editor (editor.p5js.org), use console.log. print() will activate the browser's print function to physically print the page. If print() is written in the draw function you will have a loop that always pops up the browser's print window.
@@anthonyalbertorio5180 happened to me once and i had to force quit chrome
This had me stuck for a few minutes until I actually read the console.
OBSERVATION: The function printLn() will not work in the actual p5.js library, instead what would be working is print(). (by the way, i have no words to express you all my gratitude, you are a wonderful programmer and teacher)
love your enthusiasm john!
Don't know which language you teaching here but I got what I looking for for .. thank you Very much
JavaScript!
i made a BMI calculator using weight and height as arguments ;) (i feel proud...)
u shouldnt
with p5.js ??
@@sadhlife Its superb loved the way you created and did all the hard work :D
Thanks!
Thank you for the support!
Thank you very much ! I am watching all your videos and your style of teaching is amazing
trying hard to learn c , this made my life easy in understanding function. Saw ur other video as well. Thanx
my favoirte teacher
I love this guy!
I don't know if anybody else ran into this error but if you get "Uncaught Reference Error println is not defined, use print(); instead. works
Thanks for this correction!
you are awesome. the best.
thank you a lot
Or use console.log(); instead :>
Thanks!!!
Hi, I really struggled to get this to work but got this answer from 'GoToLoop' on the processing forum which really helped me.
" Function println() was removed from p5.js' API!
Replace it w/ print(). Or use console.log() or console.info(), etc.
BtW, hit F12 to open browser's developer tool. Then go to the console tab, so you can see whether any errors happened or not. "
I may be the only person to not realise you had to use the console in the browser.
thank you! was wondering why i couldnt see anything in brackets
Thanks for sharing valuable info. Great learning, happy teaching
I’m having trouble understanding why the (miles) argument gets set to the parameter (26.3)... is there something I’m missing? @ 5:05
here are a few more examples:
function setup() {
createCanvas(400, 400);
var km = milestokm(100);
console.log(km + " km");
var pfund = kgtopfund(20);
console.log(pfund + " pfund");
var f = celsiustofahrenheit(30);
console.log(f + " F°");
var moonWeight = earthWeightToMoonweight(26.3);
console.log(nfc(moonWeight, 2) + " kg on the 🌛 ");
}
function draw() {
background(220);
}
function milestokm(miles) {
var km = miles * 1.609;
return km;
}
function kgtopfund(kg) {
var pfund = kg * 0.5;
return pfund;
}
function celsiustofahrenheit(c) {
var f = (9 / 5) * c + 32;
return f;
}
function earthWeightToMoonweight(earthWeight) {
var moonWeight = (earthWeight / 9.81) * 1.622;
return moonWeight;
}
thank you !! you are a good teacher !
Love you Dan
Can you just write :
return 1.6*miles;
or do you need to do that calculation into a variable?
That would work too!
sir, we can use notepad for above programm instead of p5.js
Yes! This workflow video might help: th-cam.com/video/HZ4D3wDRaec/w-d-xo.html
Also, sublime text: th-cam.com/video/UCHzlUiDD10/w-d-xo.html
Atom editor: th-cam.com/video/UCHzlUiDD10/w-d-xo.html
codepen: th-cam.com/video/5gfUgNpS6kY/w-d-xo.html
I think your camara is an agent of evilness and destruction that doesn´t want the world to learn p5.js
haha, indeed.
@@TheCodingTrain 🤣
A quick question ,however, I want to store the pressed key in an array order wise, first pressed key first. Any handy solutions?
I've tried almost everything.
*****
Thanks so much, I got many links which explain Arrays, this one is excellent.
@@deepankverma Hello, which one is excellent?
but i love your videos, very helpful !
How can I use that JetBrain font with the P5 editor?
The function print(); calls the printer window; println(); is not recognized.
Yes, this changed since I made these videos thanks for the note!
do the scope of the variable(s) under the mileToKm function, which i would consider local, by pass that scope since the function as a whole is then used within function setup?
How would you create a function with a single input, that returns a list or array of outputs?
Thank you!
You rock)
thank you sir.
Hi! Could you please create a video about how to export the animation to video o GIF? Thanks.
This is a bit confusing. How are you calling milestokm function if you didn't define it in setup?
It is defined outside setup and called within setup.
Thank you! can a function return 2 or more variables?? how about a boolean value return??
The FIRST short video :D
Blood for the blood godddddd
Why do you write “car” before the variable name?
p5 console doesn't work need to see what thats about
seems like and odd problem
;S " println is not defined " written on the browser console ...
Must re install this or am I missing libraries?
the console used to work something is missing i guess.
plus some of the previous lessons.js are damaged / not working...
I will re install p5
Random its now called print()
Dude don’t just use print()
what is the difference between print() and console.log()?
I want to know this too! And there is not much information about print() out there...
@@espanol9750 console.log() is part of JS. The p5.js library has a wrapper print(). It's exactly the same. Use console.log()
Ultra marathon XD
Am I the only one wondering why 26,3*1,6 returns 42,08000000000005?
its confusing. I get the idea, but i don't understand what is the reason of saying miles then not defining where miles came from and what it is. confused
Think of it this way... when you set the variable as a parameter, you're sort of declaring it... then inside the code, you tell the computer what to do with the variable... then when you pass the argument thru, you're assigning a value to the variable. You're doing everything you've been doing, just in a different way.
My console keeps telling "println is not defined". Is there something I need to enable in de libs?
same here
pretty sure the most recent version of p5 uses "print" instead of "println"
Yep that seems to be the case.... I had a the very same problem yesterday so I used console.log(; instead of googling it up or looking in the reference :-P
the printin () can be replace by console.log?
Yep
thank you
i have made this button maker, after whatcing only your videos
var rectBotton = function(x,y,s){
return mouseX > x-s/2 && mouseX < x+s/2 && mouseY > y-s/2 && mouseY < y+s/2;
}
console.log(basketball(true));
function orderMyLogic(val) {
if (val < 10) {
print(Less than 10);
} else if (val < 5) {
print(is smaller than 5);
} else {
print(Greater than or equal to 10);
}
}
orderMyLogic(7);
how to display this value () how to check this ??? Help pls
app.js:38 Uncaught SyntaxError: missing ) after argument list
I think you have to use return
i know I'm 4 years late, but returning a function is stopping its execution, right?
yes
@@mbrasseau thanks, now i can return everybodys life because everybody is variable thats pushed into the new world using an object blueprint
jk, it was for a pong game, but i already finished it
I was tracking until this point. I have no idea what return is for ir does. Ive watched this 4 times
How comes that 26.3 * 1.6 is not equal to simply 42.08? That's the correct result
A computer is treating decimal numbers in a special way. Look up this link if you wish to find out more: softwareengineering.stackexchange.com/questions/167147/why-dont-computers-store-decimal-numbers-as-a-second-whole-number
Got a Uncaught ReferenceError: println is not defined, used print instead. What is the reason i cant use println?
my example editor.p5js.org/morfen/sketches/qjBacfdJs
it changed to just print() in p5 now, apologies!
Why the math error? 26.3 * 1.6 = 42.08 exactly.
functions do not have a type?
couldn't have been better.
"Oh man, this camera keeps turning off" what's the counter value for this statement?
does p5.js have a physics engine??
No but take a look at matter.js th-cam.com/video/urR596FsU68/w-d-xo.html
Mile is lager than KM.
Is that actually,
var miles = km*1.6 ?
return miles or km?
商书豪 You are right, in video should be var km=miles/1.6;
No, if miles is bigger than 1 mile is 1.6 km, he's right
www.google.co.uk/search?q=1+mile+to+km&ie=utf-8&oe=utf-8&client=firefox-b-ab&gfe_rd=cr&ei=34FZWOGsEuTG8Aep7Iu4CA
You can check out conversions on google
I mean mile is larger than km, so miles = km*1.6
You got a thinking error there. 1 mile = 1.6 km which means we need to take the value of a given mile and multiply it by 1.6 to get the value as km. km * 1.6 would be correct if 1 km = 1.6 miles would be true.
What??? I mean 1 mile = 1.6 km, so I say mile is greater than km
Event handler mouseover alert : mouse is over the object peace ✌✌✌
you kind of look like the professor from the show heist
3: Uncaught ReferenceError: println is not defined
try print(), p5 changed.
If you ever feel useless, think about the function draw in the video xD
You are mega poggers
Anyone ever told u that u talk a bit too much!
Anyways, I'm watching ur videos cz they are really informative. So, I must say, content quality is good!
I've found this one to be confusing...
What is a function ?
th-cam.com/video/wRHAitGzBrg/w-d-xo.html
this example is a bit hard to understand for beginners to understand
Yeah it was kinda hard for me but after explaining it to myself I got it!
I'm the only one with the error called "println is not difened"?
It's print() now, my apologies!
10:31 you've gotta stop exceeding the time limit.10:00 or nothing,not even 10:01.
I followed the video and it still says (in my case) lbsTokg is undefined... Am I retarded?
Marathon is 26.2 miles. Just being pedantic, sorry.
After the 3rth video I stoped, finding this guy to anoying.. he explaines well but the laughing about(?) distracts me all the time. I'll try again tomorrow
Ничего не понятно, но очень интересно
хм, ....Daniel Shiffman один из талантливейших учителей....
смотрю видосы с автоматическим переводом на русский, скачал GettingStartedwithP5js.... нет проблем... хотя есть... нет живого и непосредственного общения((
I want to know in my code how to bring the number thats been input in "celsiusToFahrenheit(24)" function to be displayed in console in replacement to that "degree" part from print execution. Thank You codingTrain.
editor.p5js.org/sauhard.eg@gmail.com/sketches/HkFOk4taX
mxm
Ø