Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,4 @@
|
|||
babel> ("Here" "are" "some" "sample" "strings" "to" "be" "sorted") strsort ! lsstr !
|
||||
( "Here" "are" "be" "sample" "some" "sorted" "strings" "to" )
|
||||
babel> ("Here" "are" "some" "sample" "strings" "to" "be" "sorted") lexsort ! lsstr !
|
||||
( "be" "to" "are" "Here" "some" "sample" "sorted" "strings" )
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
babel> ("Here" "are" "some" "sample" "strings" "to" "be" "sorted") {str2ar} over ! {strcmp 0 lt?} lssort ! {ar2str} over ! lsstr !
|
||||
( "Here" "are" "be" "some" "sample" "sorted" "strings" "to" )
|
||||
babel> ("Here" "are" "some" "sample" "strings" "to" "be" "sorted") {str2ar} over ! {arcmp 0 lt?} lssort ! {ar2str} over ! lsstr !
|
||||
( "be" "to" "are" "Here" "some" "sample" "sorted" "strings" )
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
babel> ( 5 6 8 4 5 3 9 9 4 9 ) {lt?} lssort ! lsnum !
|
||||
( 3 4 4 5 5 6 8 9 9 9 )
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
babel> (1 2 3 4 5 6 7 8 9) {1 randlf 2 rem} lssort ! lsnum !
|
||||
( 7 5 9 6 2 4 3 1 8 )
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
babel> 20 lsrange ! {1 randlf 2 rem} lssort ! 2 group ! --> this creates a shuffled list of pairs
|
||||
babel> dup {lsnum !} ... --> display the shuffled list, pair-by-pair
|
||||
( 11 10 )
|
||||
( 15 13 )
|
||||
( 12 16 )
|
||||
( 17 3 )
|
||||
( 14 5 )
|
||||
( 4 19 )
|
||||
( 18 9 )
|
||||
( 1 7 )
|
||||
( 8 6 )
|
||||
( 0 2 )
|
||||
babel> {<- car -> car lt? } lssort ! --> sort the list by first element of each pair
|
||||
babel> dup {lsnum !} ... --> display the sorted list, pair-by-pair
|
||||
( 0 2 )
|
||||
( 1 7 )
|
||||
( 4 19 )
|
||||
( 8 6 )
|
||||
( 11 10 )
|
||||
( 12 16 )
|
||||
( 14 5 )
|
||||
( 15 13 )
|
||||
( 17 3 )
|
||||
( 18 9 )
|
||||
Loading…
Add table
Add a link
Reference in a new issue