
Show HN: Speedsums - refrigerator
http://www.speedsums.com
======
kornish

        (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.

~~~
flaie
I could get to 118, but it doesn't want a 119th answer, or the UI gets
completely broken.

[http://imgur.com/HG0J9fN](http://imgur.com/HG0J9fN)

~~~
kornish
Strange. The 119th answer is fine for me, but the 120th breaks it. I revised
the script to not rely on interval multiplication, which can be flighty due to
inconsistent latencies, but to rather keep a counter and cancel the interval
after 119 solves.

~~~
flaie
This is the script I used, but yours blocks also on 119 for me.

    
    
        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 :-)

------
function_seven
Nice. More fun than I thought it'd be. One suggestion: mark the input field as
a telephone input (?) so mobile users can get a nice fat numeric keypad.

(?) I know there are various ways to do this, they just escape me at the
moment.

~~~
refrigerator
Great idea - I'll hopefully find time to make it mobile friendly in the next
few days so will definitely implement this.

------
zaroth
Nice simple UI. I like not having to hit enter!

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?

~~~
refrigerator
I thought about taking steps to make sure that tests are more fair and
balanced, but decided against it because I think the small element of luck is
part of what makes you want to play again :)

~~~
zaroth
I think you might be right about that! On second thought, yes, a very
interesting element of the game design.

------
chillingeffect
Nice. I just ran through it along with
[http://www.keybr.com/#!game](http://www.keybr.com/#!game) to spike my mental
acuity. Anyone have other suggestions while I'm at it?

------
confiscate
Nice UI! I like the minions background at the end when the scoring page shows
up.

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)

------
AnkhMorporkian
I genuinely enjoy this. I haven't had to 'race' against simple math like that
since I did my times tables in late elementary/middle school, so this was a
lot of fun. Still got it apparently!

~~~
ams6110
I hated it then, and don't like it any better now.

But that aside, this is nicely done.

------
jetbeau
Super handy, Ive applied for air traffic controlling in Australia and these
mathematical albeit harder questions are part of the testing.

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](http://www.shldirect.com/en/practice-tests)

------
goldenkey
Reminds me of Krypto, a pretty fun card game.

[https://en.wikipedia.org/wiki/Krypto_(game)](https://en.wikipedia.org/wiki/Krypto_\(game\))

Play it here:
[http://illuminations.nctm.org/Activity.aspx?id=3569](http://illuminations.nctm.org/Activity.aspx?id=3569)

------
nicklo
I think I won the game

[http://imgur.com/qSerUAV](http://imgur.com/qSerUAV)

------
tylerpachal
The minions gif at the end made me laugh out loud in my office haha awesome

------
yitchelle
I came across a bug when it asked me for 11 x 12. I entered the answer but
nothing happened. Pressing return, another digit or some other key failed. I
just let the time run down.

I was on Firefox 38.0.5.

~~~
refrigerator
Thanks for letting me know - will look into it!

------
janjongboom
When you're typing and want to correct with BACKSPACE, but at the same time
the timer runs out you'll be returned to previous page and can't see your
score...

~~~
refrigerator
That's happened to me a couple of times and it's super annoying - will try and
fix this.

------
rusbus
Experience on mobile isn't too great... Very laggy and the box doesn't default
to numerical input.

~~~
refrigerator
Yeah apologies for this - I've been meaning to find time to make it mobile
friendly

------
MaysonL
Try using / instead of ÷, as ÷ and + are easily mistaken by those with bad
eyesight/astigmatism.

~~~
refrigerator
I did use / initially but a lot of people said that they don't instantly
register / as meaning 'divided by'

~~~
2manyredirects
Perhaps some wisely chosen (i.e. clear) SVGs - either inline or as part of an
icon font - could be used instead?

------
willyyr
Reminds me of Dr. Kawashima on the Nintendo DS a few years back. Nice.

------
met0do
Great stuff

