|

02-22-2017, 12:42 AM
|
Join Date: May 2006
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
|
Anybody familiar with JavaScript?
I've been watching this YouTube channel where this professor at NYU teaches Java and JavaScript and he does these coding challenges. The guy is weird as fuck but for some reason his antics make it so I can actually learn the coding stuff w/o my eyes glazing over and wanting to kill myself.
Anyway, the most recent coding challenge was this little thing that you could put text in and it would convert that text into dots and those dots would automatically seek their location in order to form that text. Then you could move the mouse over it and it would scatter the dots within a certain number of pixels of the pointer and if the pointer was far enough from then the it would automatically move the dots back into place. At the end of the video the professor makes suggestions for what people should do with the code and one of the things was change the colors of the dots to colors of the rainbow. The channel used to be called Coding Rainbow (Like Reading Rainbow) and I figure that should be an easy enough thing to do. What I ended up creating though is a seizure inducer and I can't figure out what the fucking deal is. I'm pretty sure it's assigning a new color to each dot every time the draw() function runs but I'm at a loss at how to prevent that or change it.
Here's the code where I give it the color scheme
Code:
Vehicle.prototype.show = function() {
var vRed = [209, 0, 0];
var vOrange = [255, 102, 34];
var vYellow = [255, 218, 33];
var vGreen = [51, 221, 0];
var vBlue = [17, 51, 204];
var vIndigo = [34, 0, 102];
var vViolet = [51, 0, 68];
var RoyGBiv = [vRed, vOrange, vYellow, vGreen, vBlue, vIndigo, vViolet];
var vColor = random(RoyGBiv)
strokeWeight(8);
stroke(vColor[0], vColor[1], vColor[2]);
//stroke(255);
point(this.pos.x, this.pos.y);
}
Here's a github repo with the entirety of the code for the thing: https://github.com/CodingTrain/Rainb...ing_Text_Paths
__________________
Quote:
Originally Posted by Krhyme Killz
lol...hava nagila nigga
|
|
02-22-2017, 12:42 AM
|
#1
|
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
Join Date: May 2006
Voted:
95
audio / 718
text
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
|
Anybody familiar with JavaScript?
I've been watching this YouTube channel where this professor at NYU teaches Java and JavaScript and he does these coding challenges. The guy is weird as fuck but for some reason his antics make it so I can actually learn the coding stuff w/o my eyes glazing over and wanting to kill myself.
Anyway, the most recent coding challenge was this little thing that you could put text in and it would convert that text into dots and those dots would automatically seek their location in order to form that text. Then you could move the mouse over it and it would scatter the dots within a certain number of pixels of the pointer and if the pointer was far enough from then the it would automatically move the dots back into place. At the end of the video the professor makes suggestions for what people should do with the code and one of the things was change the colors of the dots to colors of the rainbow. The channel used to be called Coding Rainbow (Like Reading Rainbow) and I figure that should be an easy enough thing to do. What I ended up creating though is a seizure inducer and I can't figure out what the fucking deal is. I'm pretty sure it's assigning a new color to each dot every time the draw() function runs but I'm at a loss at how to prevent that or change it.
Here's the code where I give it the color scheme
Code:
Vehicle.prototype.show = function() {
var vRed = [209, 0, 0];
var vOrange = [255, 102, 34];
var vYellow = [255, 218, 33];
var vGreen = [51, 221, 0];
var vBlue = [17, 51, 204];
var vIndigo = [34, 0, 102];
var vViolet = [51, 0, 68];
var RoyGBiv = [vRed, vOrange, vYellow, vGreen, vBlue, vIndigo, vViolet];
var vColor = random(RoyGBiv)
strokeWeight(8);
stroke(vColor[0], vColor[1], vColor[2]);
//stroke(255);
point(this.pos.x, this.pos.y);
}
Here's a github repo with the entirety of the code for the thing: https://github.com/CodingTrain/Rainb...ing_Text_Paths
__________________
Quote:
Originally Posted by Krhyme Killz
lol...hava nagila nigga
|
|
Offline
|
|

02-22-2017, 02:17 AM
|
Join Date: Jan 2014
Posts: 2,971
Mentioned: 1226 Post(s)
Tagged: 61 Thread(s)
Ranked Audio Record 2 Won / 4 Lost
Ranked Text Record 111 Won / 73 Lost
Exclusive Text Record 3 Won / 6 Lost
|
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
__________________
I'm retired from LetsBeef.
|
02-22-2017, 02:17 AM
|
#2
|
Ranked Audio Record 2 Won / 4 Lost
Ranked Text Record 111 Won / 73 Lost
Exclusive Text Record 3 Won / 6 Lost
Join Date: Jan 2014
Voted:
35
audio / 1085
text
Posts: 2,971
Mentioned: 1226 Post(s)
Tagged: 61 Thread(s)
|
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
__________________
I'm retired from LetsBeef.
|
Offline
|
|

02-22-2017, 03:37 AM
|
Posts: n/a
Mentioned: Post(s)
Tagged: Thread(s)
|
Quote:
Originally Posted by Shodan
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
|
Actually I find it refreshing to read something different even if I have no idea how to help the OP.
|
02-22-2017, 03:37 AM
|
#3
|
Guest
Voted:
0 audio / 0 text
Posts: n/a
Mentioned: Post(s)
Tagged: Thread(s)
|
Quote:
Originally Posted by Shodan
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
|
Actually I find it refreshing to read something different even if I have no idea how to help the OP.
|
|
|

02-22-2017, 08:48 AM
|
Join Date: May 2006
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
|
Quote:
Originally Posted by Shodan
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
|
Because I know there are coders here and the coding board I put it in is slow as fuck.
__________________
Quote:
Originally Posted by Krhyme Killz
lol...hava nagila nigga
|
|
02-22-2017, 08:48 AM
|
#4
|
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
Join Date: May 2006
Voted:
95
audio / 718
text
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
|
Quote:
Originally Posted by Shodan
I don't know the answer to your question, but why ask this sort of question on a rap battle forum? Wouldn't make much sense to ask a question about a rap lyric on a software forum...
|
Because I know there are coders here and the coding board I put it in is slow as fuck.
|
Offline
|
|

02-22-2017, 12:45 PM
|
Join Date: May 2006
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
|
@ X?
And I thought you wrote php or something @ Nicholas?
__________________
Quote:
Originally Posted by Krhyme Killz
lol...hava nagila nigga
|
|
02-22-2017, 12:45 PM
|
#5
|
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
Join Date: May 2006
Voted:
95
audio / 718
text
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
|
@ X?
And I thought you wrote php or something @ Nicholas?
|
Offline
|
|

02-22-2017, 01:01 PM
|
Posts: n/a
Mentioned: Post(s)
Tagged: Thread(s)
|
Quote:
Originally Posted by Mindless
@ X?
And I thought you wrote php or something @ Nicholas?
|
No, I can't code. I started learning at one point so may of posted on here at the time? It's one of those things I've wanted to do for ages but not done.
|
02-22-2017, 01:01 PM
|
#6
|
Guest
Voted:
0 audio / 0 text
Posts: n/a
Mentioned: Post(s)
Tagged: Thread(s)
|
Quote:
Originally Posted by Mindless
@ X?
And I thought you wrote php or something @ Nicholas?
|
No, I can't code. I started learning at one point so may of posted on here at the time? It's one of those things I've wanted to do for ages but not done.
|
|
|

02-23-2017, 02:25 AM
|
Join Date: May 2006
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
|
Quote:
Originally Posted by Nicholas
No, I can't code. I started learning at one point so may of posted on here at the time? It's one of those things I've wanted to do for ages but not done.
|
https://www.youtube.com/user/shiffman
The guy is cringey as fuck but he explains Java and JavaScript w/o making you want to eat a bowl of cheerios with bleach instead of milk. Give it a shot if you're interested.
__________________
Quote:
Originally Posted by Krhyme Killz
lol...hava nagila nigga
|
|
02-23-2017, 02:25 AM
|
#7
|
Ranked Audio Record 3 Won / 1 Lost
Ranked Text Record 34 Won / 6 Lost
Exclusive Text Record 1 Won / 1 Lost
Join Date: May 2006
Voted:
95
audio / 718
text
Posts: 6,578
Mentioned: 713 Post(s)
Tagged: 56 Thread(s)
|
Quote:
Originally Posted by Nicholas
No, I can't code. I started learning at one point so may of posted on here at the time? It's one of those things I've wanted to do for ages but not done.
|
https://www.youtube.com/user/shiffman
The guy is cringey as fuck but he explains Java and JavaScript w/o making you want to eat a bowl of cheerios with bleach instead of milk. Give it a shot if you're interested.
|
Offline
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 01:12 AM.
|
|
|