Skip to content

Instantly share code, notes, and snippets.

@erayarslan
Created March 13, 2018 07:30
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 erayarslan/f05e3ab7acade6de15a84f99e451f21d to your computer and use it in GitHub Desktop.
Save erayarslan/f05e3ab7acade6de15a84f99e451f21d to your computer and use it in GitHub Desktop.
tyyp.js
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(['exports'], function (exports) {
root.tyyp = factory(root, exports);
});
} else if (typeof exports !== 'undefined') {
factory(root, exports);
} else {
root.tyyp = factory(root, {});
}
}(this, function (root, tyyp) {
tyyp.president = false;
tyyp.commands = {
"help": function () {
return "Sadece bu fonksiyon var abi onda da yardım edemiyoz :/";
}
};
tyyp.sentence = ["Bu twitter mivıtter hepsinin kökünü kazıyacağız"];
tyyp.weSentence = ["Adam Cumhurbaşkanı"];
tyyp.cigarette = ["Terbiyesize bak! Hala sigara içiyor"];
tyyp.numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
tyyp.setSentence = function (sentence) {
this.sentence = sentence;
};
tyyp.getSentence = function () {
return this.sentence;
};
tyyp.setWeSentence = function (weSentence) {
this.weSentence = weSentence;
};
tyyp.getWeSentence = function () {
return this.weSentence;
};
tyyp.getCigarette = function () {
return this.cigarette;
};
tyyp.setCigarette = function (cigarette) {
this.cigarette = cigarette;
};
tyyp.random = function () {
return 2023;
};
tyyp.do = function () {
throw new Error("Sizden öğrenecek değiliz!");
};
tyyp.walk = function () {
throw new Error("Beraber yürüdük biz bu yollarda.");
};
tyyp.ip = function () {
var ip = "";
for (var i = 1; i < 16; i++) {
if (i % 4 === 0) {
ip += ".";
} else {
ip += this.numbers[Math.floor(Math.random() * this.numbers.length)];
}
}
return ip;
};
tyyp.upgrade = function () {
throw new Error("Daha iyisi yok!");
};
tyyp.say = function () {
this.sentence.push("En az 3 çocuk!");
return this.sentence;
};
tyyp.weSay = function () {
this.weSentence.push("Hüloloğğ");
return this.weSentence;
};
tyyp.where = function () {
throw new Error("#occupygezi");
};
tyyp.isHalal = function () {
return undefined;
};
tyyp.fuck = function () {
return this.isHalal();
};
tyyp.getCredit = function () {
return 0;
};
tyyp.noSmoking = function () {
return this.cigarette;
};
tyyp.setFunction = function (n, f) {
if (typeof f === "function") {
this.commands[n] = f;
return true;
} else {
throw new Error("Fonksiyon lazım :(");
}
};
tyyp.send = function (command) {
if (this.commands[command] !== undefined && typeof this.commands[command] === "function") {
return this.commands[command]();
} else {
throw new Error("Komutu bulamadık :(");
}
};
return tyyp;
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment