Свари волшебное зелье
Правильный рецепт спрятан в коде JavaScript. Попробуй разгадать его или доверься рандому
var boiler = new (function(){
let potion = '';
let good = {
checksum: '1121195254121555110299102461011201' +
'0199117116101459711210546101117451' +
'1910111511645494697109971221111109' +
'711911546991111094711211411110047',
length: 52
};
this.add = function(ingredient){
potion += ingredient();
if(potion.length < good.length) {
return;
}
if(this.checksum(potion) == good.checksum){
youWin(this.encode(potion));
} else {
youLose();
}
potion = '';
};
this.encode = function (text){
let code, idx, result = '';
for(idx in text){
code = text.charCodeAt(idx);
result += String.fromCharCode(code^2);
}
return result;
};
this.checksum = function(text){
let idx, sum = '';
for(idx in text){
sum += String(text.charCodeAt(idx)^2);
}
return sum;
};
})();
function steed() {
return 'awvg/crk,gw/u';
};
function sausage(){
return 'ru64{51dad,gzg';
};
function pumpkin(){
return 'lcuq,amo-rpmf-';
};
function hate() {
return 'gqv/3,cocxm';
};