Sorting algorithms/Gnome sort: Difference between revisions

m
→‎version 1: changed separator comments and the array header.
(→‎version 2: corrected in sync with REXX version 2)
m (→‎version 1: changed separator comments and the array header.)
Line 1,669:
call show@ ' after sort' /*show "after" array elements.*/
exit /*stick a fork in it, we're done.*/
/*──────────────────────────────────gnomeSORT──────────────────────────────────GNOMESORT subroutine────────────────*/
gnomeSort: procedure expose @.; parse arg n; k=2 /*n=num items.*/
do j=3 while k<=n; km=k-1 /*KM=prev item*/
Line 1,679:
/*──────────────────────────────────GEN@ subroutine─────────────────────*/
gen@: !='deadbeef'x ...; @.=! /*default none-value; allows null*/
@.1 = '───the---the seven virtues───virtues---' /* [↓] indent the seven virtues.*/
@.2 = '=======================' ; @.6 = ' Fortitude'
@.3 = ' Faith' ; @.7 = ' Justice'