Croqueta Posted February 23, 2013 Report Share Posted February 23, 2013 esta funcion te da el value mas grande o menor de una tabla function minmax(...) local vmin,vmax for i,v in ipairs{...} do if vmax==nil or v > vmax then vmax=v end if vmin==nil or v < vmin then vmin=v end end return vmin,vmax end vmin,vmax = minmax(4,1,6,1,8,5,8,3) say(vmin,vmax) say(vmin) say(vmax) result >1 8 >1 >8 Quote Link to comment Share on other sites More sharing options...
LeyendasMt2 Posted February 23, 2013 Report Share Posted February 23, 2013 para que se podria usar? xD Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.