From eddac153a064648bee2aef6fb733ab6820bb96c3 Mon Sep 17 00:00:00 2001 From: Shinya Sato Date: Thu, 28 Apr 2022 21:41:58 +0900 Subject: v0.8.2 --- comparison/SML/bsort-40000.sml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'comparison/SML/bsort-40000.sml') diff --git a/comparison/SML/bsort-40000.sml b/comparison/SML/bsort-40000.sml index e892f09..5e6e98b 100644 --- a/comparison/SML/bsort-40000.sml +++ b/comparison/SML/bsort-40000.sml @@ -15,7 +15,7 @@ fun go xs 0 = xs fun bsort xs = go xs (length(xs) - 1); -(* mkRandList *) +(* Creates a random list *) local val nextInt = Random.randRange(1,10000); val r = Random.rand(1,1); @@ -25,4 +25,17 @@ in end; -bsort (mkRandList 40000); +(* Validation checks *) +fun validation [] = true + | validation (x::xs) = + let fun validation_cons x [] = true + | validation_cons x (y::ys) = + if x<=y then validation_cons y ys + else false + in + validation_cons x xs + end; + + +(* Main *) +validation(bsort(mkRandList 40000)); -- cgit v1.2.3