Created
March 8, 2016 21:29
-
-
Save FredrikAugust/77c633503159065bad85 to your computer and use it in GitHub Desktop.
cheat for the number memory test on human benchmarking
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
// Human Benchmarking - Number Memory Test cheat | |
// Written by Fredrik A. Madsen-Malmo | |
// | |
// For educational purposes only. Duh | |
// Error when trying to access jQuery outside top-level scope | |
var j = $; | |
var current_number; | |
// Assign in if for more DRY-ness | |
var _number; | |
var _input; | |
function cheat () { | |
if ((_number = j('.big-number'))) { | |
current_number = j('.big-number').innerHTML; | |
console.log(current_number); | |
} else if ((_input = j('input[ng-model="userAnswer"]'))) { | |
j('.call-to-action').innerHTML = 'What\'s the number you ask? ' + current_number + '.'; | |
} | |
} | |
setInterval(cheat, 300); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment