Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Last active December 30, 2015 14:29
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 chuck0523/971fa2ed33701921f93b to your computer and use it in GitHub Desktop.
Save chuck0523/971fa2ed33701921f93b to your computer and use it in GitHub Desktop.
var status = {
'worker' : 0,
'student' : 1,
'fish' : 2
};
var time = {
'morning' : 0,
'evening' : 1,
'night' : 2
}
var text = [
['get ready for working!', 'work hard!', 'sleep well for tomorrow!'],
['sleep till noon...', 'have breakfast', 'play video games'],
['swim slowly', 'swim quickly', 'swim very slowly']
];
function whoDoesWhat_short(a, b) {
var who = status[a];
var what = time[b];
console.log(text[who][what]);
}
whoDoesWhat_short('worker', 'evening'); // work hard!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment