Sorting algorithms/Comb sort: Difference between revisions

m
→‎{{header|REXX}}: corrected a misspelling. -- ~~~~
m (→‎{{header|REXX}}: corrected a misspelling. -- ~~~~)
Line 1,250:
 
=={{header|REXX}}==
<lang rexx>/*REXX program sorts an array using the comb-sort method. */
<lang rexx>
/*REXX program sorts an array using the comb-sort method. */
 
call gen@ /*generate array elements. */
call show@ 'before sort' /*show before array elements*/
Line 1,258 ⟶ 1,256:
call show@ ' after sort' /*show after array elements*/
exit
 
 
/*─────────────────────────────────────COMBSORT subroutine─────────*/
combSort: procedure expose @.; parse arg n
Line 1,274 ⟶ 1,270:
 
return
 
 
/*─────────────────────────────────────GEN@ subroutine─────────────*/
gen@: @.='' /*assign default value. */
 
@.1 ='--- polygon sides'
@.2 ='============== ====='
Line 1,296 ⟶ 1,289:
highItem=highItem-1 /*adjust highItem slightly. */
return
 
 
/*─────────────────────────────────────SHOW@ subroutine────────────*/
show@: widthH=length(highItem) /*maximum width of any line.*/
Line 1,305 ⟶ 1,296:
end
 
say copies('─',80) /*show a seperatorseparator line. */
return</lang>
'''output'''
</lang>
Output:
<pre style="height:30ex;overflow:scroll">
element 1 before sort: --- polygon sides