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
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
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement