Welcome to the BF Forums! Register Now, It's Free!

Welcome to the BF Forums; your source for the latest and greatest video game news, strategies, discussions, and resources. Join over 60,000 like-minded gamers from around the world to chat about your interests in our community.

You are currently viewing the forums as a guest user, which limits your access to certain content, contests, downloads, and more. By joining our free community, you will be able to respond in discussions/articles, contact members privately (PM), participate in regular-scheduled contests, see less advertisements, and have access to many other features. Registration is quick, easy, and completely free.

Have your questions answered. Share your thoughts about a topic. Take 2 minutes, Register Now!
BattleForums.com Forums > Major Games > Warcraft > Warcraft Maps and Modifications

Reply
 
Thread Tools Display Modes
Old 03-25-2006, 10:39 AM   #1 (permalink)
BattleForums Junior Member
 
Stardragon's Avatar
 
Join Date: Nov 2003
Location: Sweden
Age: 20
Posts: 106
How to pick the highest value in a variable array?

I have an integer array in which I've stored 9 players' number of kills. Now I want to make a trigger which selects the player with most kills and let him win.

Does anyone know a nice way to accomplish this?
__________________


www.beelzebub.se -My new website
Stardragon is offline   Reply With Quote
Old 03-25-2006, 11:30 PM   #2 (permalink)
[F-Zero Fanatic]
 
Chris's Avatar
 
Join Date: May 2003
Location: Phantom Road
Age: 22
Posts: 15,139
I remember seeing someting like this in Turing, I will load up WE and see how I can help you.
__________________


The Purpose of DTD is not to show off how good you are.
But to do an insane flying move and landing at 3000 km/h.
Hopefully, without crashing into something or flying off in the process.

F-Zero Forever!

One of Wrestlemania 24's Epic Moments

Chris is offline   Reply With Quote
Old 04-27-2006, 12:08 AM   #3 (permalink)
BattleForums Newbie
 
Join Date: Apr 2006
Posts: 11
Id do a for loop with a if then stament

iHighest_so_far = 0

For A = 1 to 9 do
if iArray[A] > iHighest_so_far then
iHighest_so_far = A
loop

Winner = iHighest_so_far


That make sence to ya?
Galmore is offline   Reply With Quote
Old 04-27-2006, 12:17 AM   #4 (permalink)
[F-Zero Fanatic]
 
Chris's Avatar
 
Join Date: May 2003
Location: Phantom Road
Age: 22
Posts: 15,139
Yes, the Bubble Sort Method is probably the best way to do it.
__________________


The Purpose of DTD is not to show off how good you are.
But to do an insane flying move and landing at 3000 km/h.
Hopefully, without crashing into something or flying off in the process.

F-Zero Forever!

One of Wrestlemania 24's Epic Moments

Chris is offline   Reply With Quote
Old 04-27-2006, 04:47 AM   #5 (permalink)
*shakes fist*
 
x42bn6's Avatar
 
Join Date: Nov 2002
Location: Trieste, Friuli-Venezia Giulia
Age: 20
Posts: 14,882
It's the only feasible way in the World Editor unless you are using JASS...*
__________________
* Hang on a second...

Diablo III has been announced!

Here's what you need to do: Register a new account and tell the world what you think of this game.

Tell the damned world. The world wants to know.
x42bn6 is offline   Reply With Quote
Reply

« Custom Hero maps how? as in picking abilitys | why would my heros not level past level 5 »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


All times are GMT -4. The time now is 04:47 PM.



Powered by vBulletin® Version 3.7.2 | Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0