首页 > 代码库 > SegmentFault 巨献 1024 程序员游戏「红岸的呼唤」第四天任务攻略

SegmentFault 巨献 1024 程序员游戏「红岸的呼唤」第四天任务攻略

红岸的呼唤第四天已经结束好久了,干脆直接贴上我的做题文档吧,供大家各种欣赏。保证得满分哦~

高速传送门:http://segmentfault.com/game/4


function f(){ 答案7 check
	return 1
	+ ( "The ultimate answer is "
	+ [(0<<(0==0))+([0]+[(0==0)+(0==0)]^0)] * [(0^[(0==0)+(0==0)]+[0])+((0==0)>>0)]
	+ "!" ).length
	% ([(0==0) + 0] + [0]);
	
}


function f(){ 答案5
	var fault = [1,8,6,1,8,1,9,3,2,4,5,9,4];
	try{
		fault = (segment = function(fault){
			return fault.length === !fault + false ? [] : [].concat(
				segment(fault.filter(function(m){return m < fault[0]})),
				fault[0],
				segment(fault.filter(function(m){return m > fault[0]}))
				);
			}) (fault)[fault[12]];
	}
	catch(error) {return fault[12];}
	return fault;
}

function(){   答案5 check
	var t = encodeURI('你一定没有女朋友.(逃……');
	return ((t[7].charCodeAt(0) + '') .split().reduce(function(a, b){return a-0+(b-0)})+'')[1];
}

function f(){ 答案9 (error)使用文字混淆技能,仔细看可知答案 答案5  check
	return 壺 = ~ [],
	壺 = {
		答答答答: ++壺,
		答答答壺: ++壺,
		答答壺答: ++壺,
		答答壺壺: ++壺,
		答壺答答: ++壺,
		答壺答壺: ++壺,
		答壺壺答: ++壺,
		答壺壺壺: ++壺,
		壺答答答: ++壺,
		壺答答壺: ++壺
	},
	壺.壺 = 壺,
	壺.壺.答壺答壺;
}


function f(){  答案 5 check
	function a(input){
		if(input > 5 && input < 10){
			return b(input - 1);
		}else if(input > 0 && input < 5){
			return a (input + 1);
		} else {
			return input;
		}
	}

	function b(input){
		if(input > 0 && input < 5){
			return a(input + 1);
			} else if(input > 5 && input < 10){
				return b(input - 1);
			} else {
				return input;
			}
		}
		var i = parseInt(Math.random()*9 + 1);
		return a(b(i));
	}



function f(){  答案7 check
	var str = ")fodpefVSJ",f=[];
	for(var s in str){
		f.push(String.fromCharCode(str.charCodeAt(s) - 1));
}
return eval(f.join('') + '("挖掘机哪家强中国山东找蓝翔").length) % 10');
}

function f(){     答案2 check
	var T = [
		[4],
		[2,3],
		[5,3,3],
		[1,2,3,5],
		[3,1,3,4,7],
		[2,5,1,3,4,4],
		[6,5,2,3,1,4,3]];

		var size = T.length;
		variation = new Int8Array(size - 1);

		for(var i = size - 2; i>= 0;i--)
			for(var j = 0; j < T[i].length;j++){
				tmp1 = variation[j] + Math.abs(T[i][j] - T[i + 1][j]);
				tmp2 = variation[j + 1] + Math.abs(T[i][j] - T[i + 1][j + 1]);
				variation[j] = tmp1 > tmp2 ? tmp2 : tmp1;
			}
			return (1|variation[0]^16>>5)%10+1;
			}



答案2 check
function g1(){a=new Array(5,8,9,7,4,2,3,6,0,1);return a[a[(function(i){i++;return (i != 0)?false:true;})?0:2]];}



function f(){  答案 6
	var m = function (l, r){if(!l) return r;if(!r) return l;return m(l(), r());};
	var p = function (l, r){if(!l) return r;return p(l(), function(){return r;});};
	var c = function (f, s){s = s || 0;if(!f) return s; return c(f(), s+1);};
	return c(m(p(p(p(p(p(p(c,c),c,c),c),c),c),c),c));
}

function f(){ 答案 4
	challege2 = [0,0,0,8,6,0,0,8,0,9,3,2,4,5,9,4];
	segment = (fault = function(index, arr){
		return [].concat(
			arr.slice(0,index-1).reverse(),
			arr.slice(index-1, arr.length).reverse()
			).reverse()[arr.length-index]
	});
	return segment(challege2[fault(14, challege2)],challege2);
	}



function f(){  答案 0 (error) 空格处字符其实是\ufeff 所以正确答案是7 check
return "选 3的木有小JJ".charCodeAt(1) % 8;
}  

function f(){  答案5

	return (
		(Math.min() < Math.max())
		+ (Number.MIN_VALUE > 0)
		+ (123 === Number(123))
		+ ([] == [])
		+ (2 == [[[2]]])
		+ ([] == 0)
		+ ((function(){}) == (function(){}))
		+ ('foo' == new function(){return new String('foo');})
		+ (("1" + 0) == ("1" - 0))
		);	
}


function(){   答案6 check
	function fib(seq){
	return seq.shift().filter(function(n){return n;}).shift() * (seq.length - 1 ? fib(seq) : seq.shift().pop());
	}
	return fib([[1,1,2,3],[0,1,2,3],[0,0,2,3],[0,0,0,3]]);
}





SegmentFault 巨献 1024 程序员游戏「红岸的呼唤」第四天任务攻略