Andreanes Y Vanderlee wrote: > There are 2 simple way to solve this... 1 is simulate it *let say create 2 > dimensional arrays n make a simulation > N the other way is find the formula of it... > > -- > WickedBerry® Pow3r3D bY XL GPRS network > > -----Original Message----- > From: "bugsbunny.1986" <[EMAIL PROTECTED]> > > Date: Wed, 22 Aug 2007 17:11:25 > To:[email protected] > Subject: [c-prog] Help Please > > > Group Member, I need help with this program > > If value enter is 3 then output is > 1 2 3 > 8 9 4 > 7 6 5 > > If value enter is 4 then output is > 1 2 3 4 > 12 13 14 5 > 11 16 15 6 > 10 9 8 7 > > If vaulue enter is 5 then output is > 1 2 3 4 5 > 16 17 18 19 6 > 15 24 25 20 7 > 14 23 22 21 8 > 13 12 11 10 9
The simplest method is definitely to "walk" around a 2-D array filling it in with values and then dumping it out. If the OP wants to do the formulaic approach, I highly recommend _manually_ writing out the output you expect to see for 6. I'm pretty sure it won't be nearly as easy as Andreanes thinks because the OP has presented a dual-terminating situation (1 and n^2). At least I'm not seeing any useful patterns that could allow for a formula that determines any value at a specific position. Probably doable with a 1 dimensional array and some crafty code. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/ To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/c-prog/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/c-prog/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
