From 08f78b6775b5f84da918db7447e0f565b670efdf Mon Sep 17 00:00:00 2001 From: c252 Date: Sat, 6 Oct 2018 09:25:55 -0400 Subject: [PATCH] fixed some formatting issues --- contents/bubble_sort/code/nim/bubble_sort.nim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contents/bubble_sort/code/nim/bubble_sort.nim b/contents/bubble_sort/code/nim/bubble_sort.nim index d106b5474..ad7c58d08 100644 --- a/contents/bubble_sort/code/nim/bubble_sort.nim +++ b/contents/bubble_sort/code/nim/bubble_sort.nim @@ -1,14 +1,14 @@ proc print_array(a: openArray[int]) = - for n in 0 .. < len(a): - echo a[n] + for n in 0 .. < len(a): + echo a[n] proc bubble_sort(a: var openArray[int]) = - for i in 0 .. < len(a) - 1: - for j in 0 .. < len(a) - 1: - if a[j+1] < a[j]: - swap(a[j],a[j+1]) + for i in 0 .. < len(a) - 1: + for j in 0 .. < len(a) - 1: + if a[j + 1] < a[j]: + swap(a[j], a[j + 1]) -var x: array[10,int] = [32,32,64,16,128,8,256,4,512,2] +var x: array[10,int] = [32, 32, 64, 16, 128, 8, 256, 4, 512, 2] echo "Unsorted:" print_array(x) echo "\nSorted:"