You're looking at Less Wrong's discussion board. This includes all posts, including those that haven't been promoted to the front page yet. For more information, see About Less Wrong.

FeepingCreature comments on An attempt at a short no-prerequisite test for programming inclination - Less Wrong Discussion

4 Post author: ShardPhoenix 29 June 2013 11:36PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (68)

You are viewing a single comment's thread. Show more comments above.

Comment author: FeepingCreature 30 June 2013 02:26:02PM 0 points [-]

The indirection syntax should be rewritten to be left to right. As it is, it's a good fit for C's idiosyncratic type syntax, but needlessly obtuse otherwise.

  1. In the box whose number is in box 6, write the sum of the number that's in the box whose number is in box 4, and the number that's in box 5.

  2. Take the number in box 5. Where n is the number in box 4, take the number in box n, and the number in box 5, and add them. Where m is the number in box 6, write the result in box m.

Comment author: novalis 30 June 2013 05:27:43PM *  1 point [-]

The indirection syntax should be rewritten to be left to right.

I don't actually think so. The final answer is simply f(g(h(x))), which is a perfectly normal thing to see in programming.

That said, I still think it's a bad test. It involves no reasoning whatsoever -- merely following instructions carefully. I'm a reasonably good programmer, but sometimes a bit sloppy (that's why I write tests). So, I ended up with the correct final answer but a wrong number in one of the boxes.