mravkata 0 Newbie Poster

Hello ,
First i want to excuse for my bad english ... :(

Now to the question ...
I make a web - based strategy game ...
I'm almost finish it

But I have problems whit battel algorithm ...
I just can`t do it ...

My idea is this :
I have saveral variables (multiple ... or what ever is on english ... )
(php code -> hp[10]; ... ) whit stas for battel (numbers of units , power,hp etc... )

each unit have a type ... (warrior,mage,etc...)

they are on 3 battel line
Warriors - line 1
Mages - line 2
Ofens mashine - line 3

The idea is that atacker kill first all unit of line 1 and after that line 2 , and line 3 ...
same time defender kill ataker units ... (and chanche atak power every round ... )

Can some one can help me whit same algorithm haw to do that ...
I try same times but do nothing ;P
I'll be glad if sameone post even link to site whit tutorials or other materials like that ...

thx ! :P