Latest LQ Deal: Linux Power User Bundle
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org assistance with an algorithm
 Programming This forum is for all programming questions. The question does not have to be directly related to Linux and any language is fair game.

Notices

 07-25-2001, 04:32 PM #1 mandrake_linux LQ Newbie   Registered: Mar 2001 Posts: 22 Rep: assistance with an algorithm hello, I'm having trouble developing an algorithm that uses a sequence (1-5) and fills in a 5 x 5 rectangle. Here I'll show you the map. Any help is appreciated. I'll return the favor somehow, thanks. Here's my email bobnhim@yahoo.com Map: 1 2 3 4 5 5 1 2 3 4 4 5 1 2 3 3 4 5 1 2 2 3 4 5 1 Last edited by mandrake_linux; 07-25-2001 at 04:34 PM.
 07-25-2001, 05:06 PM #2 isajera Senior Member   Registered: Jun 2001 Posts: 1,635 Rep: numberarray[5][5] for (i=0; i<5; i++) for (j=0; j<5; j++){ numberarray[(j+i)%5][(j+i)%5] = i+1; } let me know if this works - i'm not at my box where i can test it.
 07-25-2001, 07:46 PM #3 mandrake_linux LQ Newbie   Registered: Mar 2001 Posts: 22 Original Poster Rep: thanks Thank you for your help. Well it's not supposed to show the numbers, but pictures. Like a quilt. Sorry I did not mention that part each one of the numbers symbolizes a block of color. 1 is yellow 2 is red 3 is blue 4 is green 5 is orange Once again sorry. Last edited by mandrake_linux; 07-25-2001 at 07:48 PM.
 07-27-2001, 04:03 AM #4 isajera Senior Member   Registered: Jun 2001 Posts: 1,635 Rep: i don't see that it makes it any different... just have each number represent a color... if(num ==1) then printf("green") or drawpicture(green)... or whatever you may need to do.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Linux.tar.gz Linux - Security 19 05-02-2006 08:54 PM inthefuture Linux - Security 1 08-26-2004 10:01 PM shakedown1987 Programming 5 08-05-2004 07:21 AM Tafta Programming 1 12-20-2003 01:43 PM raven Programming 1 01-27-2002 09:27 PM

All times are GMT -5. The time now is 10:24 AM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -