#### Archived

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

# assistance with an algorithm

This topic is 6353 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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

1. 1
2. 2
Rutin
20
3. 3
khawk
16
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633756
• Total Posts
3013710
×