diff options
Diffstat (limited to 'docs/examples/sort1.scala')
-rw-r--r-- | docs/examples/sort1.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/examples/sort1.scala b/docs/examples/sort1.scala index 406bf7c911..98f1370e65 100644 --- a/docs/examples/sort1.scala +++ b/docs/examples/sort1.scala @@ -1,4 +1,4 @@ -package examples; +package examples object sort1 { @@ -6,16 +6,16 @@ object sort1 { if (a.length < 2) a else { - val pivot = a(a.length / 2); - sort(a.filter(x => x < pivot)) - ::: a.filter(x => x == pivot) - ::: sort(a.filter(x => x > pivot)) + val pivot = a(a.length / 2) + sort(a.filter(x => x < pivot)) ::: + a.filter(x => x == pivot) ::: + sort(a.filter(x => x > pivot)) } } def main(args: Array[String]) = { - val xs = List(6, 2, 8, 5, 1); - Console.println(xs); + val xs = List(6, 2, 8, 5, 1) + Console.println(xs) Console.println(sort(xs)) } |