Mistakenly didn't add files?
All checks were successful
Solve / example-action (push) Successful in 16s

This commit is contained in:
Lars Mikal Rogne 2024-12-02 11:37:12 +01:00
parent 74b2ee334e
commit 632fdd4ecb
No known key found for this signature in database
3 changed files with 8 additions and 6 deletions

View File

@ -15,7 +15,9 @@ jobs:
distribution: 'corretto' # See 'Supported distributions' for available options distribution: 'corretto' # See 'Supported distributions' for available options
java-version: '21' java-version: '21'
- uses: https://github.com/fwilhe2/setup-kotlin@main - uses: https://github.com/fwilhe2/setup-kotlin@main
- name: Day 1 - name: Solutions
run: kotlin puzzle1.kts run: |
- name: Day 2 for script in $(ls *.kts | sort); do
run: kotlin puzzle2.kts echo "Running $script"
kotlin $script
done

View File

@ -2,7 +2,7 @@ import java.io.File
import java.util.Scanner import java.util.Scanner
import kotlin.math.abs import kotlin.math.abs
val scanner = Scanner(File("puzzle1input.txt")) val scanner = Scanner(File("day01input.txt"))
val firstList = mutableListOf<Int>() val firstList = mutableListOf<Int>()
val secondList = mutableListOf<Int>() val secondList = mutableListOf<Int>()
var secondMap = mutableMapOf<Int, Int>() var secondMap = mutableMapOf<Int, Int>()

View File

@ -3,7 +3,7 @@ import java.util.Scanner
import javax.print.attribute.standard.NumberUpSupported import javax.print.attribute.standard.NumberUpSupported
import kotlin.math.abs import kotlin.math.abs
val scanner = Scanner(File("puzzle2input.txt")) val scanner = Scanner(File("day02input.txt"))
var safelines = 0 var safelines = 0
var dampenedsafelines = 0 var dampenedsafelines = 0
while (scanner.hasNextLine()) { while (scanner.hasNextLine()) {