Mixed Messages - Analogy Generator

I thought this project was easy to just right. The easy part was writing the javascript code to create a random message, the just right part was figuring out where to write the code, where to run it, when to use Git and Github.

I think this took my 1h-1.5h.

Here is my cope repo: https://github.com/mdahewlett/mixed-messages

Not sure if this was shared and it is a private repo, but I get a 404 when I click that link

Sorry about the @designwolf, the repo is public now

Hey Michael,

Overall I noticed you took a different approach than most on this one and I like it. Seems a bit more algorithmic.

A couple of bit of feedback I noticed.

Your program is kind of locked into 3 variables the way it is put together in your messageRand function

const messageRand = () => {
    let message = '';
    for (let i = 0; i < 3; i++) {
        let itemRandIndex = Math.floor(Math.random() * messageParts[i].length);
        message += messageParts[i][itemRandIndex];
        message += messageGlue[i];
    return message;

The only thing I can think of at the moment to counter this is to maybe put your Random Parts into an array variable
and then loop through them and your glue in another loop.

Probably not the best solution. Just wanted to give some feedback :stuck_out_tongue:

Great job though! Makes a lot more sense then mine hah

I guess the how it’s put together is supposed to be fixed ‘x’ is like ‘y’ , ‘z’. The x, y and z parts are what are randomly generated, but you wouldn’t want those “glue” parts to be random.

That’s a very concise function you put together. I like it! Mine is not nearly so neat and tidy. Posting shortly