From a61fc9c86562cb3d567bc2e06289775dd5388c1b Mon Sep 17 00:00:00 2001 From: Lars Mikal Rogne Date: Mon, 2 Dec 2024 11:22:43 +0100 Subject: [PATCH] Add some descriptive text in output --- .github/workflows/solve.yaml | 2 +- puzzle1.kts | 4 ++-- puzzle2.kts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/solve.yaml b/.github/workflows/solve.yaml index b50840f..4b67919 100644 --- a/.github/workflows/solve.yaml +++ b/.github/workflows/solve.yaml @@ -14,7 +14,7 @@ jobs: with: distribution: 'corretto' # See 'Supported distributions' for available options java-version: '21' - - uses: fwilhe2/setup-kotlin@main + - uses: https://github.com/fwilhe2/setup-kotlin@main - name: Day 1 run: kotlin puzzle1.kts - name: Day 2 diff --git a/puzzle1.kts b/puzzle1.kts index 2ac4065..6e1f524 100644 --- a/puzzle1.kts +++ b/puzzle1.kts @@ -24,5 +24,5 @@ for (i in firstList.indices) { totaldistance += distance similarityscore += (secondMap[firstList[i]] ?: 0) * firstList[i] } -println(totaldistance) -println(similarityscore) \ No newline at end of file +println("Total distance: $totaldistance") +println("Similarity score: $similarityscore") \ No newline at end of file diff --git a/puzzle2.kts b/puzzle2.kts index 853f227..c3c1368 100644 --- a/puzzle2.kts +++ b/puzzle2.kts @@ -15,8 +15,8 @@ while (scanner.hasNextLine()) { dampenedsafelines++ } } -println(safelines) -println(dampenedsafelines + safelines) +println("Safe lines: $safelines") +println("Safe lines with dampener: ${dampenedsafelines + safelines}") fun isSafe(numbers: List ): Boolean { var directionality = 0