Skip to content

Instantly share code, notes, and snippets.

@Gkiokan
Created August 23, 2017 13:32
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 Gkiokan/22255a077a62b71aa889c805d38f96aa to your computer and use it in GitHub Desktop.
Save Gkiokan/22255a077a62b71aa889c805d38f96aa to your computer and use it in GitHub Desktop.
Gimmic Magic Console Game
var magic = {
active : false,
password : 'aaaa79b9a0437a2e461c6803ffdf6a63',
text : [
"888888888888 88 88 88 88 88 ,ad8888ba, 88 88 88 ",
" 88 88 \"\" \"\" 88 88 d8\"' `\"8b 88 \"\" 88 ",
" 88 88,dPPYba, 88 ,adPPYba, 88 ,adPPYba, 88,dPYba,,adPYba, ,adPPYYba, ,adPPYb,88 ,adPPYba, 88,dPPYba, 8b d8 88 88 ,d8 88 ,adPPYba, 88 ,d8 ,adPPYYba, 8b,dPPYba, ",
" 88 88P' \"8a 88 I8[ \"\" 88 I8[ \"\" 88P' \"88\" \"8a \"\" `Y8 a8\" `Y88 a8P_____88 88P' \"8a `8b d8' 88 88888 88 ,a8\" 88 a8\" \"8a 88 ,a8\" \"\" `Y8 88P' `\"8a ",
" 88 88 88 88 `\"Y8ba, 88 `\"Y8ba, 88 88 88 ,adPPPPP88 8b 88 8PP\"\"\"\"\"\"\" 88 d8 `8b d8' Y8, 88 8888[ 88 8b d8 8888[ ,adPPPPP88 88 88 ",
" 88 88 88 88 aa ]8I 88 aa ]8I 88 88 88 88, ,88 \"8a, ,d88 \"8b, ,aa 88b, ,a8\" `8b,d8' Y8a. .a88 88`\"Yba, 88 \"8a, ,a8\" 88`\"Yba, 88, ,88 88 88 ",
" 88 88 88 88 `\"YbbdP\"' 88 `\"YbbdP\"' 88 88 88 `\"8bbdP\"Y8 `\"8bbdP\"Y8 `\"Ybbd8\"' 8Y\"Ybbd8\"' Y88' `\"Y88888P\" 88 `Y8a 88 `\"YbbdP\"' 88 `Y8a `\"8bbdP\"Y8 88 88 ",
" d8' ",
" d8' "
],
run: function(){
var that = magic
var text = that.text
var colors = ['success', 'info', 'error', 'warning']
if(!that.active) return "I am sorry. I cannot do this. Have a nice day.";
colors.forEach(function(color){
text.forEach(function(o){
that.log(o, color)
})
})
return "Thank you for running the magic :) ";
},
log : function(message, color) {
color = color || "black";
switch (color) {
case "success":
color = "Green";
break;
case "info":
color = "DodgerBlue";
break;
case "error":
color = "Red";
break;
case "warning":
color = "Orange";
break;
default:
color = color;
}
console.log("%c" + message, "color:" + color);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment