Archived

This topic is now archived and is closed to further replies.

mandrake_linux

assistance with an algorithm

Recommended Posts

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 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

Share this post


Link to post
Share on other sites
I think this would work (I haven''t got a compiler here, so I can''t verify...)

int f(int x, int y) // 0,0 is the upper left number
{
int ans = x - y + 1;
if ans<= 0
n+=5;
return n;
}

//Ksero

Share this post


Link to post
Share on other sites