Re: Connect 4 in C++
Situation: The OP, a beginner posted code with several bugs in it. They said they thought the code worked okay, because they hadn't discovered the bugs during their testing, either because of poor testing and/or a lucky memory arrangement by the compiler.
The first comment mentioned the most egregious bug. My answer also mentioned another off-by-one/out-of-order bug. All of a sudden the question has 5 close votes due to being buggy.
I was under the impression that "closed due to non-working code" is only for cases where the code is horribly broken (e.g. a sort that doesn't actually sort arbitrary lists) or where the OP is asking for help fixing the bugs. In cases where the code has hidden bugs, review is still permitted.
Or am I off-base here?
EDIT: For reference, from the "broken code" link in the "put on hold" message:
If your question contains broken code…
Does your question contain something like:
- ... runs ...but it gives the wrong answer...
- ...I tried ... but sometimes...
- ...works great when I do ..., but when I do ...
- ...it works fine, but I also need it to do ...
If it does, then your code does not work in the way that you expect, or need.
Broken code is code that:
- cannot possibly compile even if other dependencies are included
- fails to run (crashes, throws exceptions, core-dumps, segfaults, etc.)
- produces results that are obviously incorrect
I think that the question being discussed satisfies precisely NONE of the above (albeit, it may segfault depending on the memory layout, but it obviously didn't for the asker)
clang++
org++
, without any special options, gives three warnings about "control reaches end of non-void function". \$\endgroup\$