This content has been marked as final. Show 3 replies
I already have "the answer." So technically, right now all I am asking is to just get help to understand what I was doing wrong and what the other guy did right ... that sounds pretty legitimate to me.
(If this is not a homework helping forum then what is? I'm actually asking because I have math & physics homework help forums with people helping for example but in programming people tend to reject me)
Edited by: s3a on 3-Apr-2010 10:53 AM
If there is someone out there that will answer me: I'm still analyzing and trying to reproduce the code without looking at it but I don't understand why there is a row = row + 2; in the code that guy gave me in the other forum.
I thought that when a position of the magic square is not taken (== 0 in the component of the array) that you would just add 1 to the row but do nothing to the column, instead I see that the guy did:
and apart from the two System.out.println(); lines of his code, it's all good.
row =+ 2; column--;
Edit: Also another thing I realized is when my teacher showed us how a magic square works, he showed us that you go up 1 and right 1 but if you're adding to the rows component of the array then aren't you going down? Also, if you're subtracting from column, aren't you going left instead of right?
Edited by: s3a on 3-Apr-2010 12:13 PM