Skip to content

Instantly share code, notes, and snippets.

@akimasa
Last active December 18, 2015 20:29
Show Gist options
  • Save akimasa/5840717 to your computer and use it in GitHub Desktop.
Save akimasa/5840717 to your computer and use it in GitHub Desktop.
EpisoPassのパスワードの候補を全部コンソールに吐き出すコード。 使うときは パスワード生成ページを保存して、最後の方の</script>前に投入
console.log($("#pass").val());
ansmax = [];
answer = [];
for(j=0;data.qas.length>j;j++){
ansmax[j]= data.qas[j].answers.length-1;
answer[j]=0;
}
outer:
for(;;){
carry = 1;
for(i=0;i<answer.length;i++){
if(carry)
answer[i]++;
if(answer[i] > ansmax[i] && i == (answer.length-1)){
break outer;
}
if(answer[i] > ansmax[i]){
for(j=0;j<=i;j++){
answer[j] = 0;
}
carry = 1;
} else {
carry = 0;
}
}
calcpass();
console.log($("#pass").val());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment