News for hackers. Stuff that matters.
Re:C puzzles by Orangeair on Thursday November 10, 2016 @03:40PM (#12924113)
I have a problem with these puzzles that it seems like no one has pointed out. A couple of them are just intentionally misleading, specifically the ones that involve typos. For example, the solution to one of them is that it says 'defa1ut' instead of 'default' in a case statement. Ignoring the question of whether or not typos are really "puzzles", this is misleading because the syntax highlighting the author uses highlights it as if it had been spelled correctly. No actual (automatic) syntax highlighting system would ever highlight the code as it is shown on the page. It should either be presented with correct highlighting or with none at all.

For anyone who is going through these exercises, I would encourage you to copy-and-paste the code snippets into a regular text editor.

Re:C puzzles by wzdd on Thursday November 10, 2016 @04:36PM (#12924634)
> No actual (automatic) syntax highlighting system would ever highlight the code as it is shown on the page.

Not true: my actual automatic syntax highlighting system (Vim) uses the same colour for reserved words and for labels. So I think it's fair play.

Re:C puzzles by userbinator on Thursday November 10, 2016 @10:32PM (#12927420)
I think that's the whole idea behind these being puzzles --- someone who uses syntax highlighting as a sort of crutch will stumble over these, while those who are actually looking at the characters won't. One of the other ones does something similar with a comment, and it made me giggle a little as I caught it immediately. It's somewhat similar to a https://en.wikipedia.org/wiki/Stroop_effect experiment.

I bet even more would be confused if the 'defa1ut' one said 'defau1t' --- showing how font choice can also be very important to readability.

Re:C puzzles by gowrikumar on Thursday November 10, 2016 @04:28PM (#12924557)
Oh yes! That's what is mentioned in the web page upfront. "Most of the programs are meant to be compiled, run and to be explained for their behaviour. The puzzles/questions can be broadly put into the following categories: "