Created
December 11, 2017 09:21
-
-
Save jooyunghan/b109c4355e95c358ae65283b7aa078e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* knockCodeHandler(preset) { | |
while (true) { | |
const input = []; | |
for (let i=0; i<preset.length; i++) { | |
input.push(getCode(yield)); | |
} | |
if (input.join("") === preset) { | |
success(); | |
} else { | |
failure(); | |
} | |
} | |
} | |
element.onclick = coro(knockCodeHandler("0113")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment