Skip to content

Instantly share code, notes, and snippets.

@elliotaplant
Created September 2, 2018 16:42
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 elliotaplant/993fec7cc337a6f9a52be6efa91d7a99 to your computer and use it in GitHub Desktop.
Save elliotaplant/993fec7cc337a6f9a52be6efa91d7a99 to your computer and use it in GitHub Desktop.
function kurekTheSlimyToad() {
function place1RandomChoice() {
let place1Random = Math.floor(Math.random() * 6);
switch (place1Random) {
case 0:
return 'lord';
case 1:
return 'master';
case 2:
return 'slimiest';
case 3:
return 'swapiest';
case 4:
return 'grand toad';
case 5:
return 'swampy boy';
}
return place1RandomChoice();
};
function place2RandomChoice() {
let place2Random = Math.floor(Math.random() * 6);
switch (place2Random) {
case 0:
return 'slimy';
case 1:
return 'swamply';
case 2:
return 'toadly';
case 3:
return 'ribbeting';
case 4:
return 'croaking';
case 5:
return 'fly eating';
}
return place2RandomChoice();
};
function place3RandomChoice() {
let place3Random = Math.floor(Math.random() * 4);
switch (place3Random) {
case 0:
return 'toads';
case 1:
return 'pledges';
case 2:
return 'toads';
case 3:
return 'basement dwellers';
}
return place3RandomChoice();
};
return (`Kurek, ${place1RandomChoice()} of the ${place2RandomChoice()} ${place3RandomChoice()}`)
};
console.log(kurekTheSlimyToad());
console.log(kurekTheSlimyToad());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment