code change for embedded

This commit is contained in:
Andrew Glaze
2025-12-04 21:58:35 -05:00
parent 48826e26d1
commit 2c67c49346

View File

@@ -4,12 +4,13 @@
@main
struct day01 {
static func parseInput(_ input: String) -> [(Direction, Int)] {
return input.split(whereSeparator: \.isNewline)
return input.split(whereSeparator: {char in char.isNewline})
.map({ line in
return (Direction(line.first!), Int(line.dropFirst())!)
})
}
static func part1(_ input: [(Direction, Int)]) {
var cur = 50
var count = 0