We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0580b79 commit 838ae9dCopy full SHA for 838ae9d
contents/bogo_sort/bogo_sort.md
@@ -14,7 +14,7 @@ In code, it looks something like this:
14
15
{% method %}
16
{% sample lang="jl" %}
17
-[import:10-14, lang:"julia"](code/julia/bogo.jl)
+[import:12-16, lang:"julia"](code/julia/bogo.jl)
18
{% sample lang="cs" %}
19
[import:9-15, lang:"csharp"](code/csharp/BogoSort.cs)
20
{% sample lang="clj" %}
contents/bogo_sort/code/julia/bogo.jl
@@ -1,6 +1,8 @@
1
+using Random
2
+
3
function is_sorted(a::Vector{Float64})
4
for i = 1:length(a)-1
- if (a[i+1] > a[i])
5
+ if (a[i] > a[i + 1])
6
return false
7
end
8
@@ -14,7 +16,7 @@ function bogo_sort(a::Vector{Float64})
function main()
- a = [1., 3, 2,4]
+ a = [1, 3, 2, 4]
bogo_sort(a)
21
println(a)
22
0 commit comments