Skip to content

Instantly share code, notes, and snippets.

@christiearcus
Last active March 16, 2016 01:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiearcus/3658282ce3c5dd3a2223 to your computer and use it in GitHub Desktop.
Save christiearcus/3658282ce3c5dd3a2223 to your computer and use it in GitHub Desktop.
Fortune Teller
// 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