Skip to content

Instantly share code, notes, and snippets.

@k0001
Created October 23, 2010 02:35
Show Gist options
  • Save k0001/641694 to your computer and use it in GitHub Desktop.
Save k0001/641694 to your computer and use it in GitHub Desktop.
/**
* Check wether the given ``answer`` produces the right output for
* the current level.
*
* Returns ``null`` on success. Otherwise returns the wrong output.
*/
Soret.check_answer = function(regex, repl) {
var user_output = Soret.sub(regex, repl);
if (user_output != Soret.get_expected_output())
return user_output;
return null;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment