From b8147afcc5bfbeb5fad62e4f68f1b88fc6c60d96 Mon Sep 17 00:00:00 2001 From: sanine Date: Thu, 18 Aug 2022 20:52:26 -0500 Subject: add lua-5.1.5 files --- libs/lua-5.1.5/test/sort.lua | 66 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 libs/lua-5.1.5/test/sort.lua (limited to 'libs/lua-5.1.5/test/sort.lua') diff --git a/libs/lua-5.1.5/test/sort.lua b/libs/lua-5.1.5/test/sort.lua new file mode 100644 index 0000000..0bcb15f --- /dev/null +++ b/libs/lua-5.1.5/test/sort.lua @@ -0,0 +1,66 @@ +-- two implementations of a sort function +-- this is an example only. Lua has now a built-in function "sort" + +-- extracted from Programming Pearls, page 110 +function qsort(x,l,u,f) + if ly end) + show("after reverse selection sort",x) + qsort(x,1,n,function (x,y) return x