mirror of
https://github.com/wezm/advent-of-code.git
synced 2024-12-18 18:29: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/map.{Map}
|
||||||
import gleam/iterator
|
import gleam/iterator
|
||||||
import gleam/string
|
import gleam/string
|
||||||
import gleam/erlang/process
|
|
||||||
|
|
||||||
type Movement {
|
type Movement {
|
||||||
Movement(quantity: Int, from: Int, to: Int)
|
Movement(quantity: Int, from: Int, to: Int)
|
||||||
|
@ -132,18 +131,13 @@ fn top_of_stacks(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn abort(msg: String) -> Nil {
|
// fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
|
||||||
io.println(msg)
|
// case i < map.size(stacks) {
|
||||||
process.kill(process.self())
|
// True -> {
|
||||||
}
|
// assert Ok(stack) = map.get(stacks, i)
|
||||||
|
// io.println(int.to_string(i + 1) <> ": " <> string.join(stack, " "))
|
||||||
fn dump(stacks: Map(Int, List(String)), i: Int) -> Map(Int, List(String)) {
|
// dump(stacks, i + 1)
|
||||||
case i < map.size(stacks) {
|
// }
|
||||||
True -> {
|
// False -> stacks
|
||||||
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/int
|
||||||
import gleam/iterator.{zip}
|
import gleam/iterator.{zip}
|
||||||
import gleam/string
|
import gleam/string
|
||||||
|
@ -156,7 +155,7 @@ fn visible(
|
||||||
|> unwrap
|
|> unwrap
|
||||||
{
|
{
|
||||||
other if other < tree -> visible(trees, coord, delta, tree, count + 1)
|
other if other < tree -> visible(trees, coord, delta, tree, count + 1)
|
||||||
otherwise -> count + 1
|
_ -> count + 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue