Download code

Jump to: navigation, search

Back to Merge_sort_(dc)

Download for Windows: single file, zip

Download for UNIX: single file, zip, tar.gz, tar.bz2

mergesort.dc

 1 #!/usr/bin/dc
 2 # The authors of this work have released all rights to it and placed it
 3 # in the public domain under the Creative Commons CC0 1.0 waiver
 4 # (http://creativecommons.org/publicdomain/zero/1.0/).
 5 # 
 6 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 7 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 8 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 9 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
10 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
11 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
12 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13 # 
14 # Retrieved from: http://en.literateprograms.org/Merge_sort_(dc)?oldid=7843
15 
16 [lx 10 ~r sx]sX
17 [ly 10 ~r sy]sY
18 [lz 10 *+ sz]sZ
19 [ls 10 ll ^ ~r ss]sS
20 [lz 10 ~r sz ls 10 *+ ss lz0<R]sR
21 [lg lZx lXx sg q]sG
22 [lh lZx lYx sh q]sH
23 [lglh<G lglh!<H]sC
24 [lCx lglh+ 0<M]sM
25 [lSxsx lSxsy lXxsg lYxsh lMx ls0<P]sP
26 [lPx lRx ll 2* sl ll lsZ >D]sD
27 
28 [c0sz1sl[? ]P?z0!=U]sT
29 [sslDx[= ]PlsplTx]sU
30 [Sort the nonzero digits of a number:
31 ]PlTx


hijacker
hijacker
hijacker
hijacker