View Single Post
Old 01-31-2010, 07:53 PM   #5
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Collapse JASS:
globals
   integer array A
   integer Size = 9 // for values in the array with index between 0 - 9
endglobals

function Min10 takes nothing returns integer
   local integer i = 0
   local integer r = A[0]
   local integer a = 0
   loop
      exitwhen i == Size
      set a = Min(A[i], A[i+1])
      if a < r then
         set r = a
      endif
      set i = i+1
   endloop
   return r
endfunction
moyack is offline   Reply With Quote