Last active
August 29, 2015 14:02
-
-
Save kwyn/03ea696806054face416 to your computer and use it in GitHub Desktop.
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
| var choose = function(list){ | |
| return list[Math.floor(list.length * Math.random())]; | |
| }; | |
| var aHero = function(){ | |
| return choose(heroList); | |
| }; | |
| var aDeed = function(){ | |
| return choose(deedList); | |
| }; | |
| var aFoil = function(){ | |
| return choose(foilList); | |
| }; | |
| var heroList = ['Gal', 'Guy', 'Persyn']; | |
| var foilList = ['Cow', 'Table', 'Bus']; | |
| var deedList = ['Eyes', 'Tips', 'Flips']; | |
| var Hero = aHero(); | |
| var newSaga = function(){ | |
| var foil = aFoil(); | |
| var saga = function(){ | |
| var deed = aDeed(); | |
| alert(Hero + ' ' + deed + ' ' + foil); | |
| }; | |
| saga(); | |
| saga(); | |
| }; | |
| newSaga(); | |
| newSaga(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment