HN user

janka102

74 karma

[ my public key: https://keybase.io/janka102; my proof: https://keybase.io/janka102/sigs/TkrDqVDspM9JKB0zTUikjWVCV0IHwtXf2jpyT-dpiFw ]

Posts2
Comments16
View on HN

The actual code seems to be from here [0]

on line 588 is the comparison

    var rightWrong = (inputData[0] < inputData[1]) & (inputData[1] < inputData[2]) ? right : wrong;
With a variable declaration on line 545 being
    var inputData = [NaN, NaN, NaN],
        revealed = false,
        right = "<p class = 'g-answer g-yes'>Yes!</p>",
        wrong = "<p class = 'g-answer g-no'>No.</p>";
And `inputData` is changed on text input on line 662
    $("#g-input input").each(function(i) {
        var val = $(this).val();
        inputData[i] = $.isNumeric(val) ? Number(val) : NaN;
    });
It uses the `Number()` function to convert from the input text to an actual number, so it can convert any number format defined by ES5[1] or ES6[2]. So in ES6 you can use binary (0b, 0B) and octal (0o, 0O) formatting along with exponential (1e-2) and hex (0x, 0X). Binary and octal works for me currently on Chrome 43 OS X.

[0] http://graphics8.nytimes.com/newsgraphics/2015/06/16/puzzle/...

[1] http://www.ecma-international.org/ecma-262/5.1/#sec-9.3.1

[2] http://www.ecma-international.org/ecma-262/6.0/#sec-7.1.3.1

I haven't before, but I just might now. It was a real pain for me to add those machines that are there now, I did it all manually by checking how far parts were from the top left of the image. I probably could have came up with a way to add parts to an image by clicking on it... oh well.

That sounds like a cool idea where people could collaboratively add and edit pictures of things and add the names of parts

I started summer of 2013 and was using Bootstrap 2.3. And I've never seen Clever before, do schools have to sign up to it or how does it work?

I made this mainly the summer after my junior year in high school. I kinda consider it one of my very first "real" projects I've done.

We got handouts of every machine we had in the shop and had to take a test on the parts and what they did, so from those handouts I made this site hoping it would make it easier for people to study.