I have this sorting algorithm - it is a little basic compared to a bubble sort but the code is :
for i=1,#t do for j=i+1,#t do if t[i]>t[j] the