Random Message Generator

I thought this was incredibly easy and given it is considered a portfolio project for a full-stack dev program I think it would be better if we were required to build an interactive and responsive front-end design to accompany it. Just realized I skipped ahead a bit and interactive websites aren’t covered yet when one does the natural progression of the course. An accompanying wireframe at the bare minimum and a good markdown in the readme with a short description of the project would be good. That being said, I am going to do neither. :rofl: :computer:

I did learn it is wise to spell check your strings somehow.

My project is completely random nonsense. I made sure there was no text aside from what is randomly generated.

Thinking of Random nonsense to put into the generator took roughly 20 minutes. The coding itself took 5-10 minutes.

I’m not using a code repo because I’m a madlad and keep my repos private but you can find my code below.


//I could put everything in an object but I am not sure what the point of it would be aside from showing I know how to use an object. Seems like an unnecessary extra step.

const randomFirstGrab = ["It is true,", "You better believe", "It is incredible that", "Jedi sense a disturbance in the force when", "The rotation of the earth stops when", "America has promised to switch to the metric system when", "The pyramids predict the world will enter a golden age when"]

const randomCritic = ["The Pope", "Charlie Brown", "Tony Hawk", "the cast of Friends", "Kermit the Frog", "Bob, your Uncle,", "James Bond", "The Chicago Bulls", "Bruce Willis", "Steven Segal"]

const randomAction =["listens to", "tours the world with", "arm wrestles", "plays professional Counterstrike with", "has three children with", "climbs Mt Kilimanjaro with", "acts on information from", "loses their favorite Pokemon card while white water rafting with", "saves earth from a meteor by blasting"];

const randomBandNames = ["Spoon", "Guns and Roses", "Red Hot Chili Peppers", "Third Eye Blind", "Westlife", "The Weekend", "Pearl Jam", "Tool", "Dashboard Confessional", "Warren Zevon", "Mariah Carey", "Michael Jackson", "Prince", "Taylor Swift", "Stone Temple Pilots", "Peter Gabriel", "The Toadies", "Local H"];

/*

Would be a potential getter function

function getRandomMessage {

}

Would be a potential setter function

function addBand() {

}

Would be a potential setter function

function addCritic() {

}

*/

function getRandom(arg) {

return arg[Math.floor(Math.random()*arg.length)];

}

function randomMessage() {

return getRandom(randomFirstGrab) + " " + getRandom(randomCritic) + " " + getRandom(randomAction) + " " + getRandom(randomBandNames) + "!"

}