From 529f48d893406a9f68e938cad3074c2202f3e113 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 26 Feb 2024 22:42:47 +0100 Subject: [PATCH] knapsack: fix indentation Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com> --- exercises/practice/knapsack/test_knapsack.nim | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/exercises/practice/knapsack/test_knapsack.nim b/exercises/practice/knapsack/test_knapsack.nim index 63838099..365f13a5 100644 --- a/exercises/practice/knapsack/test_knapsack.nim +++ b/exercises/practice/knapsack/test_knapsack.nim @@ -17,48 +17,48 @@ suite "knapsack": test "five items (cannot be greedy by weight)": let maximumWeight = 10 let items = [ - (weight: 2, value: 5), (weight: 2, value: 5), (weight: 2, value: 5), - (weight: 2, value: 5), (weight: 10, value: 21) - ] + (weight: 2, value: 5), (weight: 2, value: 5), (weight: 2, value: 5), + (weight: 2, value: 5), (weight: 10, value: 21) + ] let expected = 21 check maximumValue(maximumWeight, items) == expected test "five items (cannot be greedy by value)": let maximumWeight = 10 let items = [ - (weight: 2, value: 20), (weight: 2, value: 20), (weight: 2, value: 20), - (weight: 2, value: 20), (weight: 10, value: 50) - ] + (weight: 2, value: 20), (weight: 2, value: 20), (weight: 2, value: 20), + (weight: 2, value: 20), (weight: 10, value: 50) + ] let expected = 80 check maximumValue(maximumWeight, items) == expected test "example knapsack": let maximumWeight = 10 let items = [ - (weight: 5, value: 10), (weight: 4, value: 40), (weight: 6, value: 30), - (weight: 4, value: 50) - ] + (weight: 5, value: 10), (weight: 4, value: 40), (weight: 6, value: 30), + (weight: 4, value: 50) + ] let expected = 90 check maximumValue(maximumWeight, items) == expected test "8 items": let maximumWeight = 104 let items = [ - (weight: 25, value: 350), (weight: 35, value: 400), (weight: 45, value: 450), - (weight: 5, value: 20), (weight: 25, value: 70), (weight: 3, value: 8), - (weight: 2, value: 5), (weight: 2, value: 5) - ] + (weight: 25, value: 350), (weight: 35, value: 400), (weight: 45, value: 450), + (weight: 5, value: 20), (weight: 25, value: 70), (weight: 3, value: 8), + (weight: 2, value: 5), (weight: 2, value: 5) + ] let expected = 900 check maximumValue(maximumWeight, items) == expected test "15 items": let maximumWeight = 750 let items = [ - (weight: 70, value: 135), (weight: 73, value: 139), (weight: 77, value: 149), - (weight: 80, value: 150), (weight: 82, value: 156), (weight: 87, value: 163), - (weight: 90, value: 173), (weight: 94, value: 184), (weight: 98, value: 192), - (weight: 106, value: 201), (weight: 110, value: 210), (weight: 113, value: 214), - (weight: 115, value: 221), (weight: 118, value: 229), (weight: 120, value: 240) - ] + (weight: 70, value: 135), (weight: 73, value: 139), (weight: 77, value: 149), + (weight: 80, value: 150), (weight: 82, value: 156), (weight: 87, value: 163), + (weight: 90, value: 173), (weight: 94, value: 184), (weight: 98, value: 192), + (weight: 106, value: 201), (weight: 110, value: 210), (weight: 113, value: 214), + (weight: 115, value: 221), (weight: 118, value: 229), (weight: 120, value: 240) + ] let expected = 1458 check maximumValue(maximumWeight, items) == expected