Question
#1

hey guys, i got an question about knowing when someone is X points far from another one.
What i mean by it.
Okay so lets say two clans has started war between each others.
Now if he arrives lets say 3000 points far from the other faction points he will be declared the winner.
example Clan 1 Points - 3000 , Clan 2 points - 6000 , and it auto declares Clan 2 winner.
but i dont know how to do it can you please help me
Reply
#2

Quote:
Originally Posted by TheLegend1
Посмотреть сообщение
hey guys, i got an question about knowing when someone is X points far from another one.
What i mean by it.
Okay so lets say two clans has started war between each others.
Now if he arrives lets say 3000 points far from the other faction points he will be declared the winner.
example Clan 1 Points - 3000 , Clan 2 points - 6000 , and it auto declares Clan 2 winner.
but i dont know how to do it can you please help me
What, what, and what? You mean how to determine, which clan has more points than other?
Just follow this algorithm:

Код:
1. Let be n the number of clans, t the temporary value, x temporary id (for comparisons) c clan id with the biggest score.
2. Set c = x = 0, t = score of clan[c] 
3. If there is only one clan, you're done here.
4. For i = 0, if: i < n then
  4. 1. Increment x by one.
  4. 2. If score of clan[x] is bigger than t
  4. 2. 1. If yes, then c = x and t = score of clan[x]
  4. 2. 2. If not, then continue.
  4. 3. Increment i by one
5. c contains the id of clan with the biggest score. End of algorithm.
Enough. Now take your time, analyze this algorithm and implement it.
Happy coding.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)