Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,10 @@
|
|||
#lang racket
|
||||
(define (bogo-sort l) (if (apply <= l) l (bogo-sort (shuffle l))))
|
||||
|
||||
(require rackunit)
|
||||
(check-equal? (bogo-sort '(6 5 4 3 2 1)) '(1 2 3 4 5 6))
|
||||
(check-equal? (bogo-sort (shuffle '(1 1 1 2 2 2))) '(1 1 1 2 2 2))
|
||||
|
||||
(let ((unsorted (for/list ((i 10)) (random 1000))))
|
||||
(displayln unsorted)
|
||||
(displayln (bogo-sort unsorted)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue