Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks awesome. I think exercise 1.2 is broken. I enter in:

(/ (+ 5 (+ 4 (- 2 (- 3 (+ 6 (/ 4 5)))))) (* 3 (* (- 6 2) (- 2 7))))

and it tells me the result is wrong, but wolfram and my own REPL confirms the result.



The autograder checks for (+ 5 4 (- 2 ...)), instead of nesting the additions. You can view the source to see the grader. I'm not sure how to make it accomodate all the ways it could be nested though.


Why not check the result and also check for the presence of parentheses? That way you can verify the result and make sure nobody's just copying and pasting in an answer.

One could easily do something like (-2.466..) as the answer, but given that you just need a simple way to verify answers, I think my strategy works well.


I think you could get away with not even checking for parens, if you go with the idea that people doing it properly won't try to cheat it (because they'll learn nothing).

For people who do want to 'cheat', the grade is meaningless anyway.


I thought about that, but my reasoning for checking parens is that there's a decent subset of people who might get stuck and just google an answer, but if it gets rejected, then they'll put more time into figuring out the correct answer.

I guess I'm trying to view it from the POV of a beginner, as most CS people/programmers can work through this without needing the website.


Normalize it and then check if it is equal; this took longer than I like to admit: http://jsfiddle.net/jeKMF/


I think it expects you to combine the addition and multiplication, like this:

    (/ (+ 5 4 (- 2 (- 3 (+ 6 (/ 4 5))))) (* 3 (- 6 2) (- 2 7)))


I came up with the same solution and had the same wrong result.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: