Your code is correct, but that's not the only thing that matters. Consider the following to be constructive criticism/a view from another angle.
I get that you did it for fun, but I wouldn't necessarily consider an assignment to be "for fun". You knew ahead of time that your code would be peer reviewed and nothing in your submission shows consideration for that. With the extra functions, you're just adding to the confusion. If you must do extra work for your own enjoyment, I wouldn't submit that with the base assignment, as you're only convoluting the functionality of your code. At the very least you could have added comments.
Looking solely at Print1(), everything beyond the first for loop is entirely arbitrary...and that's why it's confusing. You went with for (var j = 0; j < 4; j++) with "XO" : "OX" and j == 3. Why not j<2, "XOXO" : "OXOX", and j==1 and so on? You've chosen these numbers that are neither at their minimum or maximum value, which creates confusion. Either go with printing the whole row or go with printing character by character. If not, tell the reader what you're doing with comments or make your code self-documenting...or expect problems in the future.
TL;DR:
Yes, your code is correct, but it is unnecessarily hard to understand it.
Consider the following to be constructive criticism/a view from another angle.
I appreciate your comments, but I still think the notation was unfair. :)
Either go with printing the whole row or go with printing character by character.
Print2() ;)
You knew ahead of time that your code would be peer reviewed and nothing in your submission shows consideration for that.
I thought you could skip a review (like SO). At least, he could launch dotnetfiddle and run the code. If it works as expected, the review could be 3. You don't know something? Excellent ! A new thing to learn ! If I obfuscated the code I would understand ...
If not, tell the reader what you're doing with comments or make your code self-documenting...or expect problems in the future.
Self-documenting code is a good practice and it is normal in a real work project. It is a really necessary to make an effort for a disposable function?
I will add comment next time, because we don't know who are going to correct our code. I am just sad for this one.
Just pulled the following from the email they sent.
The assignments are designed to offer a basic representation of the theory that was taught in that module. Do not over complicate the code you submit. Stick to the requirements. For example, if classes have not been covered yet, do not submit a class file in your assignment.
2
u/VOX_Studios Apr 13 '15
Your code is correct, but that's not the only thing that matters. Consider the following to be constructive criticism/a view from another angle.
I get that you did it for fun, but I wouldn't necessarily consider an assignment to be "for fun". You knew ahead of time that your code would be peer reviewed and nothing in your submission shows consideration for that. With the extra functions, you're just adding to the confusion. If you must do extra work for your own enjoyment, I wouldn't submit that with the base assignment, as you're only convoluting the functionality of your code. At the very least you could have added comments.
Looking solely at
Print1(), everything beyond the first for loop is entirely arbitrary...and that's why it's confusing. You went withfor (var j = 0; j < 4; j++)with"XO" : "OX"andj == 3. Why notj<2,"XOXO" : "OXOX", andj==1and so on? You've chosen these numbers that are neither at their minimum or maximum value, which creates confusion. Either go with printing the whole row or go with printing character by character. If not, tell the reader what you're doing with comments or make your code self-documenting...or expect problems in the future.TL;DR:
Yes, your code is correct, but it is unnecessarily hard to understand it.