How are you supposed to learn to program without making programs?
Wow - what a clever answer ;-)
With only 0.1 % of that energy you could have solved that easy problem above...
don't you see, that in your code x and y are incremented at the same time?
you must increment y in a loop and x in an outer loop as you did while saving....
instead of being offended, read what I wrote, word for word... that's the way you may get into it... if you read Data from a File it helps if you use the same algorithm - only instead of writing use reading.
btw: program is not program ... you know that I meant "such high end programs" you are working on ;-) ?