function generateSolution(){
// Create a random string with length 4 containing only values
// from the letters "ROYGBV". Each of these letters will represent
// the colors red, orange, yellow, green, blue, and violet.
// WRITE YOUR CODE HERE
var randomString = "";
var possible = "ROYGBV";
for( var i=0; i < 4; i++ ){
randomString += possible.charAt(Math.floor(Math.random() * possible.length));
}
return randomString;
}
No comments:
Post a Comment