Show HN: Speedsums
speedsums.com
speedsums.com
(function() {
var input = $('#answer'),
question = $('#question'),
solved = 0;
var intvl = setInterval(function() {
var questionText = question.text();
questionText = questionText.replace('÷', '/').replace('x', '*').replace('=', '');
input.val(eval(questionText));
input.keyup();
solved++
if (solved == 119) clearTimeout(intvl);
}, 50);
})();
edit: seems to give an error if you solve >= 120 questions, so adjusted to stop at 119. var answer = function() {
var q = $("#question").text().replace(/x|÷|=/g, function(m) { return {'x':'*','÷':'/','=':''}[m]});
$("#answer").val(eval(q)).keyup();
};
$('#question').bind("DOMSubtreeModified", function(){
setTimeout(answer, 200);
});
answer();
Don't have much time to search why :-)(?) I know there are various ways to do this, they just escape me at the moment.
If you want to make it more "fair" consider bining the questions by difficulty and randomly select some number from each bin, versus a random selection / generation over the entire pool of possible questions, or actually timing each response individually and showing an average of the percentiles for each answer, instead of a percentile for the average time.
Total sums done: 3,816,583 -- really?
For the timer, can it be a non-decimal number? Seems like I don't really care about decimal time (don't think most users care about fractions of a second)
But that aside, this is nicely done.
Can you make a large bank of harder questions?
Similar to the level of the calculation test on http://www.shldirect.com/en/practice-tests
https://en.wikipedia.org/wiki/Krypto_(game)
Play it here: http://illuminations.nctm.org/Activity.aspx?id=3569
I was on Firefox 38.0.5.