problem with sequences

new topic     » topic index » view thread      » older message » newer message

guys i seem to have problem with sequences especially when they are used in loops and how to use them for example

function shell_sort(sequence x) 
-- Shell sort based on insertion sort 
 
    integer gap, j, first, last 
    object tempi, tempj 
 
    last = length(x) 
    gap = floor(last / 10) + 1 
    while TRUE do 
	first = gap + 1 
	for i = first to last do 
	    tempi = x[i] 
	    j = i - gap 
	    while TRUE do 
		tempj = x[j] 
		if compare(tempi, tempj) >= 0 then 
		    j += gap 
		    exit 
		end if 
		x[j+gap] = tempj 
		if j <= gap then 
		    exit 
		end if 
		j -= gap 
	    end while 
	    x[j] = tempi 
	end for 
	if gap = 1 then 
	    return x 
	else 
	    gap = floor(gap / 3.5) + 1 
	end if 
    end while 
end function 

i mean that i still have not fully understood the whole concept of sequences especially when i try to read programms that use them especially in loops and other forms.for you to be very good in euphoria you have to know sequences alot.any advice or form of help.am studying hard but i get fraustrated at times

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu