Forum

> > CS2D > Scripts > highest value in table
Forums overviewCS2D overview Scripts overviewLog in to reply

English highest value in table

8 replies
To the start Previous 1 Next To the start

old Re: highest value in table

DC
Admin Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
function tablemax(t)
	if t==nil then return 0 end
	if #t==0 then return 0 end
	max=t[1]
	for i=2,#t do
		if t[i]>max then
			max=t[i]
		end
	end
	return max
end

untested
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview