Last active
March 16, 2016 01:20
-
-
Save christiearcus/3658282ce3c5dd3a2223 to your computer and use it in GitHub Desktop.
Fortune Teller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The Fortune Teller | |
// Why pay a fortune teller when you can just program your fortune yourself? | |
// Store the following into variables: number of children, partner's name, geographic location, job title. | |
// Output your fortune to the screen like so: "You will be a X in Y, and married to Z with N kids." | |
var children = Math.random() * 10; | |
var partnerName = Math.random() * 10; | |
var geoLocation = Math.random() * 10; | |
var jobTitle = Math.random() * 10; | |
if (partnerName < 5) { | |
partnerName = 'Ryan Gosling'; | |
} | |
else { | |
partnerName = 'Leo'; | |
} | |
if (geoLocation < 5) { | |
geoLocation = 'Hawaii'; | |
} | |
else { | |
geoLocation = 'Brazil'; | |
} | |
if (jobTitle < 5) { | |
jobTitle = 'CEO'; | |
} | |
else { | |
jobTitle = 'Freelance Web Developer'; | |
} | |
console.log('Your will have ' + children + ' children with ' + partnerName + ' living in ' + geoLocation + ' working as a ' + jobTitle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment