mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-12-18 10:19:55 +00:00
Clean up some more warnings
This commit is contained in:
parent
61559271c8
commit
ca1892ceff
2 changed files with 11 additions and 18 deletions
|
@ -5,7 +5,6 @@ import gleam/list.{map}
|
|||
import gleam/map.{Map}
|
||||
import gleam/iterator
|
||||
import gleam/string
|
||||
import gleam/erlang/process
|
||||
|
||||
type Movement {
|
||||
Movement(quantity: Int, from: Int, to: Int)
|
||||
|
@ -132,18 +131,13 @@ fn top_of_stacks(
|
|||
}
|
||||
}
|
||||
|
||||
fn abort(msg: String) -> Nil {
|
||||
io.println(msg)
|
||||
process.kill(process.self())
|
||||
}
|
||||
|
||||
fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
|
||||
case i < map.size(stacks) {
|
||||
True -> {
|
||||
assert Ok(stack) = map.get(stacks, i)
|
||||
io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
|
||||
dump(stacks, i + 1)
|
||||
}
|
||||
False -> stacks
|
||||
}
|
||||
}
|
||||
// fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
|
||||
// case i < map.size(stacks) {
|
||||
// True -> {
|
||||
// assert Ok(stack) = map.get(stacks, i)
|
||||
// io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
|
||||
// dump(stacks, i + 1)
|
||||
// }
|
||||
// False -> stacks
|
||||
// }
|
||||
// }
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import gleam/io.{debug}
|
||||
import gleam/int
|
||||
import gleam/iterator.{zip}
|
||||
import gleam/string
|
||||
|
@ -156,7 +155,7 @@ fn visible(
|
|||
|> unwrap
|
||||
{
|
||||
other if other < tree -> visible(trees, coord, delta, tree, count + 1)
|
||||
otherwise -> count + 1
|
||||
_ -> count + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue