Skip to content

Instantly share code, notes, and snippets.

@jayzz55
Forked from mattswann/LifeDecider.md
Last active August 29, 2015 14:17
Show Gist options
  • Save jayzz55/b32d6e42f6113e3177ff to your computer and use it in GitHub Desktop.
Save jayzz55/b32d6e42f6113e3177ff to your computer and use it in GitHub Desktop.

###The Ultimate Life Decider Never make a decision again!

####Part One a. - The Coin of Inevitability


  1. Create a file called decider.js
  2. Write a function called coinFlip that 'console.logs' HEADS or TAILS when called
  3. Add a counter that declares WINNER in the console when either HEADS or TAILS is flipped 5 times.

#####Part One b. - The Coin App


  1. Create a file called decider.html
  2. Find any coin image online
  3. Link the .js file, while you're there you may also decide to add a .css file for some styling
  4. Now add the necessary components to the decider.html file so that when the coin image is clicked the coinFlip function result and tally are returned somewhere on the page.

#####Part Two a. - A Second Opinion


  1. Create a file called buckStopsHere.js
  2. Make a JS function that randomly returns one of the following strings to the console when called...

"No", "Not today", "It is decidedly so", "Without a doubt", "Yes definitely", "You may rely on it", "As I see it yes", "Most likely", "Outlook good", "Signs point to yes", "Reply hazy try again", "Ask again later", "Better not tell you now", "Cannot predict now", "Concentrate and ask again", "Don't count on it", "My reply is no", "My sources say no", "Outlook not so good", "Very doubtful",

#####Part Two b. Opinion App


  1. Make an .html file to display the output of the buckStopsHere.js file
    • add some styling and maybe an image of an eight ball for novelties sake.
  2. Now link the first decider.html file to this file with a link called 'Need a Second opinion?' so that if the coin flip isn't enough a user can use the magic 8 Ball to settle it once an for all!

####Part Three - Make it move


Add in a flip coin animation and output delay Add in an eight ball animation output delay

Start making life changing decisions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment