I've been putzing through the Cattle Ranch assignments, and ran into ... discrepency, for lack of a better work. The assignment is to calculate the number of grains of wheat on each square of a chessboard (garnered from an ancient parable). The main objective was to find a certain API call. Easy enough, although I need to learn to read... would have made using this call a whole lot easier.
My question is this: the instructor's version took 35 lines to solve; whereas my solution was 7 lines of actual code plus three lines of '}' . What am I missing? Adding a pretty formatting to the output would only involve one or 2 more lines of code. So what did overlook. There are no detailed instructions; at least not that I can see.
If this is a fee-based question, or too much of a spoiler, I understand. But, I am curious as to what purpose of the additional 20some lines of code.
There are worse crimes than burning books. One of them is not reading them. Ray Bradbury
It's been a long time since I went through the nitpicking process myself, a quick solution I just wrote counts roughly 20 lines. That's including empty lines, boilerplate and braces. Admittedly, the style guide that the Cattle Drive uses is a bit less terse than what I usually write.
Your styling could be different from the one the nitpickers mandate, or you could be overlooking the fact that the output for the first square is a special case.
Either way, for a conclusive answer you should take it up with your nitpicker.
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.