A Dash of Random explainer

Hi Ben,

The only reason the code wouldn’t function is because you’re asking pickRandom to Pick a random colour for you.

The function states to change drawbox (red) to a random colour hence the updated function would be drawbox(pickRandom(colour));

Hope this is helpful.

Hi ya! How does the code work with color as keyword without defining a color array ? I’m intrigued

Hey there, the color variable is an array of multiple strings (each representing a color) and is hard-coded into the app. Each string in the array is a hex color code, which represents a color value.

The array is hidden as it’s quite large and would take up valuable screen space in the app, so this keeps the lesson’s focus on using pickRandom().

Hope this helps!
Ben