Jump to content
  • Advertisement

Archived

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

mandrake_linux

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.

If you intended to correct an error in the post then please contact us.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!