Skip to content

Commit a03e77c

Browse files
c252jiegillet
authored andcommitted
fixed some formatting issues (#462)
1 parent c109531 commit a03e77c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

contents/bubble_sort/code/nim/bubble_sort.nim

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
proc print_array(a: openArray[int]) =
2-
for n in 0 .. < len(a):
3-
echo a[n]
2+
for n in 0 .. < len(a):
3+
echo a[n]
44

55
proc bubble_sort(a: var openArray[int]) =
6-
for i in 0 .. < len(a) - 1:
7-
for j in 0 .. < len(a) - 1:
8-
if a[j+1] < a[j]:
9-
swap(a[j],a[j+1])
6+
for i in 0 .. < len(a) - 1:
7+
for j in 0 .. < len(a) - 1:
8+
if a[j + 1] < a[j]:
9+
swap(a[j], a[j + 1])
1010

11-
var x: array[10,int] = [32,32,64,16,128,8,256,4,512,2]
11+
var x: array[10,int] = [32, 32, 64, 16, 128, 8, 256, 4, 512, 2]
1212
echo "Unsorted:"
1313
print_array(x)
1414
echo "\nSorted:"

0 commit comments

Comments
 (0)