SAIL - A one little problem
Posted: Sun Jan 30, 2011 12:42 am
Hey, guys! I need some help.
I need a function that sorts indexes in the array according to the situation. I have 3 buildigns... I need to get them inside the array.. BUT!... First index will be a building that has the least of life. You have these buildings:
Suddenly the enemy attacks to your base and building 3 needs repair more, than its sisters. The Building 1 is a little repaired.
Now, the Building 3 must be first and the Building 1 must be last. And now, I need a function for this.
Thanks.
Write your questions if you have them.
I need a function that sorts indexes in the array according to the situation. I have 3 buildigns... I need to get them inside the array.. BUT!... First index will be a building that has the least of life. You have these buildings:
Code: Select all
arr[1] - Building 1: 580 lives
arr[2] - Building 2: 720 lives
arr[3] - Building 3: 1000 lives
Code: Select all
arr[1] - Building 1: 880 lives
arr[2] - Building 2: 720 lives
arr[3] - Building 3: 350 lives
Thanks.
Write your questions if you have them.