Thanks,
Julie
Initialize the square with zero's
Set the corner square up with a value
Use a few IF's & FOR's with some logic in there.
See ya later alligator...
Sherry
she...@interlog.com
http://www.interlog.com/~sherryg
JULIE SIGNER <BO...@worldnet.att.net> wrote in article
<5jbh45$2...@mtinsc05.worldnet.att.net>...
DYOH
Stephan
Dear Julie (or is it Steve?),
How charming to discover that the ancient art of letter-writing is not
yet dead among today's American youth, even in this electronic age. But
it is even more heart-warming to discover that you place such a high value
on the virtues of hard work, diligent study and reasoned discourse. Your
ingenious strategy of insulting the very people who might possibly have
been willing to help you has paid off handsomely! For Lo! So taken am I
by the sparkling wit which shines through every phrase you write, that I
have added to this very message a "magic squares" program of my own
devising, just for you. I have also sent this message to the comp.lang.c
newsgroup, so they can join in the joyous celebrations. As those august
philosophers Ren and Stimpy might say, "Happy Happy Joy Joy!"
With my very warmest regards,
-Edwin
#include <stdio.h>
int C[42]={3,-4,-1,-2,1,4,2,-3},c_;
#define C(x,y) c_ = C [ x-c ] ; C[ x-c ] = C[ y-c ] ; C[ y-c ] = c_
#define c(a,b) if (* (a+C) + *(C + b + a ) + C[ a + b + b ] ) return
main(){_c(9);}_c(int c){int O=0;if(!c){c(3,1);c(6,1);c(0,3);c(2,3);c
(0,4);c(0,1);c(2,2);c(1,3);puts("");}for (;O<(c?c:9);O++)if(c){C(9+0
,9+O);_c(c-1);C(O+9,9+0);}else printf("%c%c",C[O]+'5'," \n"[O%3]);}