Skip to content

Instantly share code, notes, and snippets.

@iAklis
Created February 22, 2016 17:16
Show Gist options
  • Save iAklis/2770f07540b6ddfc1d66 to your computer and use it in GitHub Desktop.
Save iAklis/2770f07540b6ddfc1d66 to your computer and use it in GitHub Desktop.
javascript_Witcher题目源码
function (urandom) {
function step1(){
var a = new Date();
var b = Number(a.getFullYear());
t = 0;
for (var i = 0; i < b.length; i++ ){
t += parseInt();
}
var c = String(a.getFullYear());
for (var i = 0; i < c.length; i++ ){
t += b % 10;
b = b / 10;
}
var b = Number(a.getFullYear());
if (!(b%400===0 || b%100!=0 && b%4===0))
return false;
if (!(t > 11 & t < 27))
return false;
return true;
}
function step2() {
var a = Array.apply(null, new Array(Math.floor(Math.random() * 20 + 12) + 10)).map(function () {return Math.random() * 0x10000;});
var b = urandom(a.length);
if (!Array.isArray(b)) {
return false;
}
if (b.length < a.length) {
for (var i = 0, n = a.length - b.length; i < n; i++) {
delete b[b.length];
b[b.length] = [Math.random() * 0x10000];
}
} else if (b.length > a.length) {
for (var i = 0, n = b.length - a.length; i < n; i++)
Array.prototype.pop.apply(b);
}
for (var i = 0, n = b.length; i < n; i++) {
if (a[i] != b[i]) {
return false;
}
}
return true;
}
function step3() {
var a = Array.apply(null, new Array((urandom() % 20 + 12) + 10)).map(function () {return urandom() % 0x10000;});
var b = urandom(a.length);
if (!Array.isArray(b)) {
return false;
}
if (b.length < a.length) {
for (var i = 0, n = a.length - b.length; i < n; i++) {
delete b[b.length];
b[b.length] = [Math.random() * 0x10000];
}
} else if (b.length > a.length) {
for (var i = 0, n = b.length - a.length; i < n; i++)
Array.prototype.pop.apply(b);
}
for (var i = 0, n = b.length; i < n; i++) {
if (a[i] != b[i]) {
return false;
}
}
return true;
}
if (!step1())
return "Thinkphp!";
if (!step2())
return "Yiiii~";
if (!step3())
return "Laravel!";
return flag;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment